[CSS Grid Layout] resolveContentBasedTrackSizingFunctions should iterate over the grid items not the grid tracks
https://bugs.webkit.org/show_bug.cgi?id=112299

Reviewed by Tony Chang.

Our initial implementation would iterate over the grid tracks. This was equivalent as no items were spanning but
once grid items spans, they start to contribute to several grid tracks differently. This change aligns our code
with what the specification does.

One upside of doing a grid items' iteration is that the complexity should be better in all cases as we don't do
a full grid walking (which is potentially quadratic), only some extra grid tracks' iteration (which are linear).

Refactoring, there should be no change in behavior.

* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::computedUsedBreadthOfGridTracks):
Moved the |availableLogicalSpace| update into resolveContentBasedTrackSizingFunctions. This simplifies and consolidate our handling.

(WebCore::RenderGrid::resolveContentBasedTrackSizingFunctions):
Updated the core loop to iterator over grid items and not grid tracks. This idea is that now resolveContentBasedTrackSizingFunctionsForItems
uses a filtering function to only process the appropriate grid tracks.

(WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForItems):
Updated to filter the grid tracks here (this matches the |TracksForGrowth| spec logic that is merely a filtering function).

* rendering/RenderGrid.h:
Added a new typedef and updated resolveContentBasedTrackSizingFunctionsForItems to use it.

* rendering/style/GridTrackSize.h:
(WebCore::GridTrackSize::hasMinOrMaxContentMinTrackBreadth):
(WebCore::GridTrackSize::hasMaxContentMinTrackBreadth):
(WebCore::GridTrackSize::hasMinOrMaxContentMaxTrackBreadth):
(WebCore::GridTrackSize::hasMaxContentMaxTrackBreadth):
Added the following filtering function, which matches the values from |TracksForGrowth| in the specification.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145840 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] Use CROSS_PLATFORM_CONTEXT_MENU
https://bugs.webkit.org/show_bug.cgi?id=111877

Patch by Jesus Sanchez-Palencia <jesus.palencia@openbossa.org> on 2013-03-14
Reviewed by Caio Marcelo de Oliveira Filho.

.:

* Source/cmake/OptionsEfl.cmake: add -DWTF_USE_CROSS_PLATFORM_CONTEXT_MENUS=1

Source/WebCore:

Now EFL uses the CROSS_PLATFORM_CONTEXT_MENUS
USE flag. This flag provides a full cross-platform
representation of a ContextMenu and a ContextMenuItem.
The embedder can then decide how to show this and neither
WebCore nor WebCore/platform need to know any platform
specific code about the menus, even though they could.

No new tests needed, no behavior changes.

* platform/ContextMenu.h:
(ContextMenu):
* platform/ContextMenuItem.h:
(WebCore):
* platform/PlatformMenuDescription.h:
(WebCore):
* platform/efl/ContextMenuEfl.cpp:
(WebCore::ContextMenu::ContextMenu):
(WebCore::ContextMenu::getContextMenuItems):
(WebCore::ContextMenu::createPlatformContextMenuFromItems):
(WebCore::ContextMenu::platformContextMenu):
* platform/efl/ContextMenuItemEfl.cpp:
(WebCore::ContextMenuItem::platformContextMenuItem):

Source/WebKit/efl:

Adjust ContextMenuClient to use the CROSS_PLATFORM_CONTEXT_MENUS USE flag
by implementing customizeMenu() instead of getCustomMenuFromDefaultItems()
and by calling coreMenu->items() instead of coreMenu->platformDescription().

* WebCoreSupport/ContextMenuClientEfl.cpp:
(WebCore::ContextMenuClientEfl::customizeMenu):
* WebCoreSupport/ContextMenuClientEfl.h:
(ContextMenuClientEfl):
* ewk/ewk_contextmenu.cpp:
(ewk_context_menu_new):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145841 268f45cc-cd09-0410-ab3c-d52691b4dbfc