REGRESSION (r124512): Failures in MathML Presentation tests on GTK and EFL
https://bugs.webkit.org/show_bug.cgi?id=93073

Patch by Christophe Dumez <christophe.dumez@intel.com> on 2012-08-28
Reviewed by Kenneth Rohde Christiansen.

Source/WebCore:

Provide SimpleFontData::platformBoundsForGlyph() implementation
for FreeType backend. This fixes several CSS line-box-contain
test cases as well as the MathML tests for ports using
FreeType.

No new tests, already covered by:
fast/block/lineboxcontain/block-glyphs-replaced.html
fast/block/lineboxcontain/glyphs.html
mathml/*

* platform/graphics/freetype/SimpleFontDataFreeType.cpp:
(WebCore::SimpleFontData::platformBoundsForGlyph):

LayoutTests:

Rebaseline MathML presentation tests and several CSS line-box-contain
tests for EFL and GTK port.

Unskip mathml test cases for both ports now that their result
looks correct.

* platform/efl/TestExpectations:
* platform/efl/fast/block/lineboxcontain/block-glyphs-replaced-expected.png:
* platform/efl/fast/block/lineboxcontain/block-glyphs-replaced-expected.txt:
* platform/efl/fast/block/lineboxcontain/glyphs-expected.png:
* platform/efl/fast/block/lineboxcontain/glyphs-expected.txt:
* platform/efl/mathml/presentation/attributes-expected.png:
* platform/efl/mathml/presentation/attributes-expected.txt:
* platform/efl/mathml/presentation/fenced-expected.png:
* platform/efl/mathml/presentation/fenced-expected.txt:
* platform/efl/mathml/presentation/fenced-mi-expected.png:
* platform/efl/mathml/presentation/fenced-mi-expected.txt:
* platform/efl/mathml/presentation/fractions-expected.png:
* platform/efl/mathml/presentation/fractions-expected.txt:
* platform/efl/mathml/presentation/fractions-vertical-alignment-expected.png:
* platform/efl/mathml/presentation/fractions-vertical-alignment-expected.txt:
* platform/efl/mathml/presentation/mo-stretch-expected.png:
* platform/efl/mathml/presentation/mo-stretch-expected.txt:
* platform/efl/mathml/presentation/mroot-pref-width-expected.png:
* platform/efl/mathml/presentation/mroot-pref-width-expected.txt:
* platform/efl/mathml/presentation/roots-expected.png:
* platform/efl/mathml/presentation/roots-expected.txt:
* platform/efl/mathml/presentation/row-alignment-expected.png:
* platform/efl/mathml/presentation/row-alignment-expected.txt:
* platform/efl/mathml/presentation/sub-expected.png:
* platform/efl/mathml/presentation/sub-expected.txt:
* platform/efl/mathml/presentation/subsup-expected.png:
* platform/efl/mathml/presentation/subsup-expected.txt:
* platform/efl/mathml/presentation/sup-expected.png:
* platform/efl/mathml/presentation/sup-expected.txt:
* platform/efl/mathml/presentation/tables-expected.png:
* platform/efl/mathml/presentation/tables-expected.txt:
* platform/efl/mathml/presentation/tokenElements-expected.txt:
* platform/efl/mathml/presentation/under-expected.png:
* platform/efl/mathml/presentation/under-expected.txt:
* platform/efl/mathml/presentation/underover-expected.png:
* platform/efl/mathml/presentation/underover-expected.txt:
* platform/gtk/TestExpectations:
* platform/gtk/fast/block/lineboxcontain/block-glyphs-expected.png:
* platform/gtk/fast/block/lineboxcontain/block-glyphs-expected.txt:
* platform/gtk/fast/block/lineboxcontain/block-glyphs-replaced-expected.png:
* platform/gtk/fast/block/lineboxcontain/block-glyphs-replaced-expected.txt:
* platform/gtk/fast/block/lineboxcontain/glyphs-expected.png:
* platform/gtk/fast/block/lineboxcontain/glyphs-expected.txt:
* platform/gtk/mathml/presentation/attributes-expected.png:
* platform/gtk/mathml/presentation/attributes-expected.txt:
* platform/gtk/mathml/presentation/fenced-expected.png:
* platform/gtk/mathml/presentation/fenced-expected.txt:
* platform/gtk/mathml/presentation/fenced-mi-expected.png:
* platform/gtk/mathml/presentation/fenced-mi-expected.txt:
* platform/gtk/mathml/presentation/fractions-expected.png:
* platform/gtk/mathml/presentation/fractions-expected.txt:
* platform/gtk/mathml/presentation/fractions-vertical-alignment-expected.png:
* platform/gtk/mathml/presentation/fractions-vertical-alignment-expected.txt:
* platform/gtk/mathml/presentation/mo-expected.png:
* platform/gtk/mathml/presentation/mo-expected.txt:
* platform/gtk/mathml/presentation/mo-stretch-expected.png:
* platform/gtk/mathml/presentation/mo-stretch-expected.txt:
* platform/gtk/mathml/presentation/mroot-pref-width-expected.png:
* platform/gtk/mathml/presentation/mroot-pref-width-expected.txt:
* platform/gtk/mathml/presentation/over-expected.png:
* platform/gtk/mathml/presentation/over-expected.txt:
* platform/gtk/mathml/presentation/roots-expected.png:
* platform/gtk/mathml/presentation/roots-expected.txt:
* platform/gtk/mathml/presentation/row-alignment-expected.png:
* platform/gtk/mathml/presentation/row-alignment-expected.txt:
* platform/gtk/mathml/presentation/row-expected.png:
* platform/gtk/mathml/presentation/row-expected.txt:
* platform/gtk/mathml/presentation/style-expected.png:
* platform/gtk/mathml/presentation/style-expected.txt:
* platform/gtk/mathml/presentation/sub-expected.png:
* platform/gtk/mathml/presentation/sub-expected.txt:
* platform/gtk/mathml/presentation/subsup-expected.png:
* platform/gtk/mathml/presentation/subsup-expected.txt:
* platform/gtk/mathml/presentation/sup-expected.png:
* platform/gtk/mathml/presentation/sup-expected.txt:
* platform/gtk/mathml/presentation/tables-expected.png:
* platform/gtk/mathml/presentation/tables-expected.txt:
* platform/gtk/mathml/presentation/tokenElements-expected.txt:
* platform/gtk/mathml/presentation/under-expected.png:
* platform/gtk/mathml/presentation/under-expected.txt:
* platform/gtk/mathml/presentation/underover-expected.png:
* platform/gtk/mathml/presentation/underover-expected.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126862 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Compile fix: use fabs() instead of abs() for doubles
https://bugs.webkit.org/show_bug.cgi?id=95184

Patch by Kevin Funk <kevin.funk@kdab.com> on 2012-08-28
Reviewed by Kentaro Hara.

Simple compilation fix.

* platform/ScrollAnimatorNone.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126863 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] Range input ignores padding
https://bugs.webkit.org/show_bug.cgi?id=94595

Patch by Thiago Marcos P. Santos <thiago.santos@intel.com> on 2012-08-28
Reviewed by Kenneth Rohde Christiansen.

Source/WebCore:

We do not constrain the slider size anymore since it was ignoring the
padding. Also paint the slider thumb on the step it was suppose
to be painted. WebKit will now take care of the positioning of the
thumb, the behavior will be now more coherent with other ports.

As side effect, this patch also fixes setting a slider RTL that wasn't
working before and can be verified by the existing tests. Also
datalist will stop at tick marks.

No new tests, rebaselined the existing ones and unskipping failures.

* platform/efl/RenderThemeEfl.cpp:
(WebCore):
(WebCore::RenderThemeEfl::paintThemePart):
(WebCore::RenderThemeEfl::edjeGroupFromFormType):
(WebCore::RenderThemeEfl::adjustSliderTrackStyle):
(WebCore::RenderThemeEfl::adjustSliderThumbStyle):
(WebCore::RenderThemeEfl::adjustSliderThumbSize):
(WebCore::RenderThemeEfl::paintSliderThumb):
* platform/efl/RenderThemeEfl.h:

Source/WebKit/efl:

Updated default theme to paint the slider thumb in a different step.
This was done by splitting the thumb into a separated group.

* DefaultTheme/widget/slider/slider.edc:

LayoutTests:

Updated test expectations. We now report the correct thumb size and
respect the defined padding. Two tests were skipped because they
assume a certain thumb size and hit tests fails because of that.

* platform/efl/TestExpectations:
* platform/efl/fast/dom/HTMLInputElement/input-slider-update-expected.txt:
* platform/efl/fast/forms/box-shadow-override-expected.png:
* platform/efl/fast/forms/box-shadow-override-expected.txt:
* platform/efl/fast/forms/datalist/range-snap-to-datalist-expected.txt:
* platform/efl/fast/forms/input-appearance-height-expected.png:
* platform/efl/fast/forms/input-appearance-height-expected.txt:
* platform/efl/fast/forms/range/input-appearance-range-expected.png:
* platform/efl/fast/forms/range/input-appearance-range-expected.txt:
* platform/efl/fast/forms/range/slider-mouse-events-expected.txt: Added.
* platform/efl/fast/forms/range/slider-padding-expected.png:
* platform/efl/fast/forms/range/slider-padding-expected.txt:
* platform/efl/fast/forms/range/slider-thumb-shared-style-expected.png:
* platform/efl/fast/forms/range/slider-thumb-shared-style-expected.txt:
* platform/efl/fast/layers/video-layer-expected.png:
* platform/efl/fast/layers/video-layer-expected.txt:
* platform/efl/fast/repaint/slider-thumb-drag-release-expected.txt:
* platform/efl/media/audio-controls-rendering-expected.png:
* platform/efl/media/audio-controls-rendering-expected.txt:
* platform/efl/media/audio-repaint-expected.txt:
* platform/efl/media/controls-styling-strict-expected.png:
* platform/efl/media/controls-styling-strict-expected.txt:
* platform/efl/media/track/track-cue-rendering-horizontal-expected.png:
* platform/efl/media/track/track-cue-rendering-horizontal-expected.txt:
* platform/efl/media/track/track-cue-rendering-vertical-expected.png:
* platform/efl/media/track/track-cue-rendering-vertical-expected.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126864 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Crash in EditingStyle::mergeStyle
https://bugs.webkit.org/show_bug.cgi?id=94740

Patch by Sukolsak Sakshuwong <sukolsak@gmail.com> on 2012-08-28
Reviewed by Ryosuke Niwa.

Source/WebCore:

This bug happened when we selected "1<progress><a style>2</a></progress>"
and executed a create link command because

1. The selection ended at <progress>, not the text node inside it, because
   <progress> is an atomic node.
2. We called removeInlineStyle() to remove conflicting styles.
   Since the selection started at the text node "1" and ended at <progress>,
   we did not get to remove <a>.
3. We called fixRangeAndApplyInlineStyle(), which in turn called
   applyInlineStyleToNodeRange(). This method split the node range
   into smaller runs. In this case, the run was the whole
   "1<progress><a style>2</a></progress>".
4. We called removeStyleFromRunBeforeApplyingStyle(). This method tried
   to remove <a> by calling removeInlineStyleFromElement() on <a> with
   extractedStyle = 0. But the method expected that extractedStyle was not null.
   So, it crashed.

This bug doesn't happen with non-atomic nodes because if <a> is inside a non-atomic
node, <a> will be covered by the selection. Therefore, it will be removed in
step #2 and we will never call removeInlineStyleFromElement() on <a>
again. Thus, the assertion that extractedStyle is not null is reasonable.
Hence, this patch fixes this bug by skipping over atomic nodes when we apply style.

Test: editing/style/apply-style-atomic.html

* editing/ApplyStyleCommand.cpp:
(WebCore::ApplyStyleCommand::removeStyleFromRunBeforeApplyingStyle):
(WebCore::ApplyStyleCommand::removeInlineStyle):

LayoutTests:

* editing/style/apply-style-atomic-expected.txt: Added.
* editing/style/apply-style-atomic.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126865 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL][WK2] Implement WebPopupMenuProxyEfl to support <select>
https://bugs.webkit.org/show_bug.cgi?id=88616

Reviewed by Gyuyoung Kim.

Source/WebKit2:

Implemented popup menu proxy and interface for Efl.

Applications should implement popup menu by overriding
smart class function to support select tag.

* PlatformEfl.cmake:
* UIProcess/API/efl/EWebKit2.h: Included ewk_popup_menu_item.h
* UIProcess/API/efl/PageClientImpl.cpp:
(WebKit::PageClientImpl::createPopupMenuProxy):
* UIProcess/API/efl/ewk_popup_menu_item.cpp: Added.
(_Ewk_Popup_Menu_Item):
(_Ewk_Popup_Menu_Item::_Ewk_Popup_Menu_Item):
(ewk_popup_menu_item_new):
(ewk_popup_menu_item_free):
(ewk_popup_menu_item_type_get): Added API to retrieve type of item.
(ewk_popup_menu_item_text_get): Added API to retrieve text of item.
* UIProcess/API/efl/ewk_popup_menu_item.h: Added.
* UIProcess/API/efl/ewk_popup_menu_item_private.h: Added.
* UIProcess/API/efl/ewk_view.cpp:
(_Ewk_View_Private_Data):
(_Ewk_View_Private_Data::_Ewk_View_Private_Data):
(_Ewk_View_Private_Data::~_Ewk_View_Private_Data):
(ewk_view_popup_menu_request): Added to call popup_menu_show, smart class function.
(ewk_view_popup_menu_close): Added API to call popup_menu_hide, smart class function.
(ewk_view_popup_menu_select): Added API to change selected index.
* UIProcess/API/efl/ewk_view.h:
Added smart class function for applications to override.
* UIProcess/API/efl/ewk_view_private.h:
* UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.cpp:
(EWK2UnitTest::EWK2UnitTestBase::EWK2UnitTestBase):
(EWK2UnitTest::EWK2UnitTestBase::SetUp):
(EWK2UnitTest::EWK2UnitTestBase::loadUrlSync):
(EWK2UnitTest::EWK2UnitTestBase::waitUntilLoadFinished):
Extracted from loadUrlSync for tests using ewk_view_html_string_load to
share onLoadFinished.
* UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.h:
(EWK2UnitTest::EWK2UnitTestBase::ewkViewClass):
Added ewkViewClass to test smart methods such as popup_menu_show.
* UIProcess/API/efl/tests/test_ewk2_view.cpp:
(popup_menu_show):
(TEST_F): Added a test case for ewk_view_popup_menu_select and related codes.
* UIProcess/efl/WebPopupMenuProxyEfl.cpp: Added.
(WebKit):
(WebKit::WebPopupMenuProxyEfl::WebPopupMenuProxyEfl):
(WebKit::WebPopupMenuProxyEfl::showPopupMenu):
(WebKit::WebPopupMenuProxyEfl::hidePopupMenu):
(WebKit::WebPopupMenuProxyEfl::valueChanged):
* UIProcess/efl/WebPopupMenuProxyEfl.h: Added.
(WebPopupMenuProxyEfl):
(WebKit::WebPopupMenuProxyEfl::create):

LayoutTests:

* platform/efl-wk2/TestExpectations: Unskip fast/forms/select/menulist-popup-crash.html


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