Switch to new PseudoElement based :before and :after
authordpranke@chromium.org <dpranke@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 11 Dec 2012 18:53:19 +0000 (18:53 +0000)
committerdpranke@chromium.org <dpranke@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 11 Dec 2012 18:53:19 +0000 (18:53 +0000)
commit880337e7bfd0894a2de9b0be648fca90f851e8f2
tree1e381a2738bf201db8ac2e182a98bd5a2a5c0cda
parent2f77fc3c417b6fcf4e26a37875a3d27009abbae1
Switch to new PseudoElement based :before and :after
https://bugs.webkit.org/show_bug.cgi?id=104462

Patch by Elliott Sprehn <esprehn@chromium.org> on 2012-12-11
Reviewed by Antti Koivisto.

Source/WebCore:

Switch to the new PseudoElement based generated content implementation
that moves :before and :after into the DOM. This also switches to using
the ComposedShadowTreeWalker for determining the siblings of PseudoElement's
making the new generated content implementation support adding :before
and :after into <input> elements.

Tests: fast/css-generated-content/block-inside-inline.html
       fast/css-generated-content/box-orient.html

* dom/ComposedShadowTreeWalker.cpp:
(WebCore::ComposedShadowTreeWalker::pseudoAwareNextSibling):
(WebCore):
(WebCore::ComposedShadowTreeWalker::pseudoAwarePreviousSibling):
(WebCore::ComposedShadowTreeWalker::traverseParent):
* dom/ComposedShadowTreeWalker.h:
(ComposedShadowTreeWalker):
* dom/Element.cpp:
(WebCore::Element::attach):
(WebCore::Element::recalcStyle):
* dom/Node.cpp:
* dom/Node.h:
(Node):
* dom/NodeRenderingContext.cpp:
(WebCore::NodeRenderingContext::nextRenderer):
(WebCore::NodeRenderingContext::previousRenderer):
(WebCore::NodeRenderingContext::createRendererForElementIfNeeded):
* dom/Position.cpp:
(WebCore::Position::Position):
(WebCore::Position::hasRenderedNonAnonymousDescendantsWithHeight):
* editing/visible_units.cpp:
(WebCore::logicallyPreviousBox):
(WebCore::logicallyNextBox):
(WebCore::startPositionForLine):
(WebCore::endPositionForLine):
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::childShouldCreateRenderer):
* page/DragController.cpp:
(WebCore::DragController::draggableNode):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::styleDidChange):
(WebCore::RenderBlock::splitBlocks):
(WebCore::RenderBlock::addChildIgnoringAnonymousColumnBlocks):
(WebCore::RenderBlock::createReplacementRunIn):
(WebCore::RenderBlock::isSelectionRoot):
* rendering/RenderBlock.h:
(RenderBlock):
* rendering/RenderButton.cpp:
* rendering/RenderButton.h:
(RenderButton):
* rendering/RenderInline.cpp:
(WebCore::RenderInline::styleDidChange):
(WebCore::RenderInline::addChildIgnoringContinuation):
(WebCore::RenderInline::splitInlines):
* rendering/RenderListItem.cpp:
(WebCore::RenderListItem::updateMarkerLocation):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::createVisiblePosition):
* rendering/RenderObject.h:
(WebCore::RenderObject::nonPseudoNode):
(RenderObject):
(WebCore::RenderObject::clearNode):
(WebCore::RenderObject::generatingNode):
* rendering/RenderObjectChildList.cpp:
* rendering/RenderObjectChildList.h:
(RenderObjectChildList):
* rendering/RenderRubyText.cpp:
* rendering/RenderRubyText.h:
(RenderRubyText):
* rendering/RenderTableRow.cpp:
(WebCore::RenderTableRow::styleDidChange):
* rendering/RenderTableRow.h:
* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::addChild):
* rendering/RenderWidget.cpp:
(WebCore::RenderWidget::destroy):

LayoutTests:

Add test for block generated content inside inlines which is now supported
properly, and also for using box-orient and reordering.

before-content-continuation.html's expectations change because we now
support block content properly.

I skipped fast/css-generated-content/table-row-group-to-inline.html
which needs a rebaseline after this this lands. Unfortunately the test
output is still wrong because we leave an anonymous RenderTable in the
tree, but that bug has always been there.

I also skipped fast/css/empty-generated-content.html which needs rebaselines
as we no longer create extra anonymous blocks, though the reason is not clear
to me.

* fast/css-generated-content/before-content-continuation-chain-expected.txt:
* fast/css-generated-content/block-inside-inline-expected.html: Added.
* fast/css-generated-content/block-inside-inline.html: Added.
* fast/css-generated-content/box-orient-expected.html: Added.
* fast/css-generated-content/box-orient.html: Added.
* platform/chromium/TestExpectations:
* platform/mac/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@137336 268f45cc-cd09-0410-ab3c-d52691b4dbfc
35 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/css-generated-content/before-content-continuation-chain-expected.txt
LayoutTests/fast/css-generated-content/block-inside-inline-expected.html [new file with mode: 0644]
LayoutTests/fast/css-generated-content/block-inside-inline.html [new file with mode: 0644]
LayoutTests/fast/css-generated-content/box-orient-expected.html [new file with mode: 0644]
LayoutTests/fast/css-generated-content/box-orient.html [new file with mode: 0644]
LayoutTests/platform/chromium/TestExpectations
LayoutTests/platform/mac/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/dom/ComposedShadowTreeWalker.cpp
Source/WebCore/dom/ComposedShadowTreeWalker.h
Source/WebCore/dom/Element.cpp
Source/WebCore/dom/Node.cpp
Source/WebCore/dom/Node.h
Source/WebCore/dom/NodeRenderingContext.cpp
Source/WebCore/dom/Position.cpp
Source/WebCore/editing/visible_units.cpp
Source/WebCore/html/HTMLTextFormControlElement.cpp
Source/WebCore/page/DragController.cpp
Source/WebCore/rendering/RenderBlock.cpp
Source/WebCore/rendering/RenderBlock.h
Source/WebCore/rendering/RenderButton.cpp
Source/WebCore/rendering/RenderButton.h
Source/WebCore/rendering/RenderInline.cpp
Source/WebCore/rendering/RenderListItem.cpp
Source/WebCore/rendering/RenderObject.cpp
Source/WebCore/rendering/RenderObject.h
Source/WebCore/rendering/RenderObjectChildList.cpp
Source/WebCore/rendering/RenderObjectChildList.h
Source/WebCore/rendering/RenderRubyText.cpp
Source/WebCore/rendering/RenderRubyText.h
Source/WebCore/rendering/RenderTableRow.cpp
Source/WebCore/rendering/RenderTableRow.h
Source/WebCore/rendering/RenderTableSection.cpp
Source/WebCore/rendering/RenderWidget.cpp