:first-line pseudo selector ignoring words created from :before
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 8 Oct 2012 04:42:26 +0000 (04:42 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 8 Oct 2012 04:42:26 +0000 (04:42 +0000)
commit652b61777488edc231ed47d3c88f680978881245
tree5e6dee760fff39cce3180dea5ba0d46861be574b
parent986a5cec6626eeaf6910a8f0631283f7433932c0
:first-line pseudo selector ignoring words created from :before
https://bugs.webkit.org/show_bug.cgi?id=80794

Patch by Arpita Bahuguna <arpitabahuguna@gmail.com> on 2012-10-07
Reviewed by Daniel Bates.

Source/WebCore:

The :first-line pseudo-element style is not applied for content
which is generated from the :before/:after pseudo-elements.

Test: fast/css/first-line-style-for-before-after-content.html

* rendering/RenderObject.cpp:
(WebCore::firstLineStyleForCachedUncachedType):
Added a new static helper function incorporating the common
functionality of both uncachedFirstLineStyle() and firstLineStyleSlowCase()
functions. It also modifies the functionality to handle the
scenario when :first-line style needs to be applied on content
generated from :before/:after.

While getting the :first-line style we should also consider the case
when the content is generated from a :before/:after pseudo-element in
which case the RenderInline's parent should be considered for
obtaining the first-line style.

(WebCore):
(WebCore::RenderObject::uncachedFirstLineStyle):
(WebCore::RenderObject::firstLineStyleSlowCase):
Moved the duplicate code between the two functions to the common
helper function firstLineStyleForCachedUncachedType().

LayoutTests:

* fast/css/first-line-style-for-before-after-content-expected.html: Added.
* fast/css/first-line-style-for-before-after-content.html: Added.
Added ref test for verification of the scenario when :first-line style
is applied to content generated from :before/:after pseudo-elements.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@130616 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/css/first-line-style-for-before-after-content-expected.html [new file with mode: 0644]
LayoutTests/fast/css/first-line-style-for-before-after-content.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderObject.cpp