first-letter pseudo-element from ancestors is not being ignored in grids and flexboxes
authorrego@igalia.com <rego@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 Jan 2015 10:02:59 +0000 (10:02 +0000)
committerrego@igalia.com <rego@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 Jan 2015 10:02:59 +0000 (10:02 +0000)
commit01a33d5697cff00a50e5b782f3cbb76130c40b50
tree529689ca2a4c5f608a2f94b1aabfb84e8aa64da6
parentdb0ef2c0ebe54e3a25952db9367839383f0d7c31
first-letter pseudo-element from ancestors is not being ignored in grids and flexboxes
https://bugs.webkit.org/show_bug.cgi?id=138424

Reviewed by Benjamin Poulain.

Source/WebCore:

Source/WebCore:

According to the grid and flexbox specs:
"::first-letter pseudo-element do not apply to grid/flex containers".
http://dev.w3.org/csswg/css-grid/#grid-containers
http://dev.w3.org/csswg/css-flexbox/#flex-containers

Check also the CSS WG mailing list discussion:
http://lists.w3.org/Archives/Public/www-style/2014Dec/0305.html

This was almost working right, except in the case that an ancestor was
setting the ::first-letter pseudo-element.

Added a few more cases to the current tests in order to check this
behavior.
Also created some new tests to increase coverage

Tests: fast/css/first-letter-from-ancestors-not-apply-inline-elements.html
       fast/css/first-letter-ignores-display-property.html

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::getFirstLetter): Go to the next sibling when
looking for the first text child if you reach a grid or flexbox.

LayoutTests:

Modified current tests to check that first-letter from ancestors is
ignored too.
Added 2 new tests to increase coverage.

* css3/flexbox/flexbox-ignore-container-firstLetter-expected.txt:
* css3/flexbox/flexbox-ignore-container-firstLetter.html:
* fast/css-grid-layout/grid-container-ignore-first-letter-expected.txt:
* fast/css-grid-layout/grid-container-ignore-first-letter.html:
* fast/css/first-letter-from-ancestors-not-apply-inline-elements-expected.html: Added.
* fast/css/first-letter-from-ancestors-not-apply-inline-elements.html: Added.
* fast/css/first-letter-ignores-display-property-expected.html: Added.
* fast/css/first-letter-ignores-display-property.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@178822 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/css3/flexbox/flexbox-ignore-container-firstLetter-expected.txt
LayoutTests/css3/flexbox/flexbox-ignore-container-firstLetter.html
LayoutTests/fast/css-grid-layout/grid-container-ignore-first-letter-expected.txt
LayoutTests/fast/css-grid-layout/grid-container-ignore-first-letter.html
LayoutTests/fast/css/first-letter-from-ancestors-not-apply-inline-elements-expected.html [new file with mode: 0644]
LayoutTests/fast/css/first-letter-from-ancestors-not-apply-inline-elements.html [new file with mode: 0644]
LayoutTests/fast/css/first-letter-ignores-display-property-expected.html [new file with mode: 0644]
LayoutTests/fast/css/first-letter-ignores-display-property.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderBlock.cpp