| Index: Source/core/dom/LayoutTreeBuilder.cpp
|
| diff --git a/Source/core/dom/LayoutTreeBuilder.cpp b/Source/core/dom/LayoutTreeBuilder.cpp
|
| index f0ae0816d1b12be8a30ff49f074572ccca31b696..d08aee3380c4850c2544ba67324fdf2abc01be80 100644
|
| --- a/Source/core/dom/LayoutTreeBuilder.cpp
|
| +++ b/Source/core/dom/LayoutTreeBuilder.cpp
|
| @@ -31,6 +31,7 @@
|
| #include "core/css/resolver/StyleResolver.h"
|
| #include "core/dom/FirstLetterPseudoElement.h"
|
| #include "core/dom/Fullscreen.h"
|
| +#include "core/dom/MarkerPseudoElement.h"
|
| #include "core/dom/Node.h"
|
| #include "core/dom/PseudoElement.h"
|
| #include "core/dom/Text.h"
|
| @@ -57,7 +58,7 @@ LayoutTreeBuilderForElement::LayoutTreeBuilderForElement(Element& element, Compu
|
| }
|
| }
|
|
|
| -LayoutObject* LayoutTreeBuilderForElement::nextLayoutObject() const
|
| +LayoutObject* LayoutTreeBuilderForElement::nextLayoutObject(LayoutObject* parentLayoutObject) const
|
| {
|
| ASSERT(m_layoutObjectParent);
|
|
|
| @@ -67,6 +68,11 @@ LayoutObject* LayoutTreeBuilderForElement::nextLayoutObject() const
|
| if (m_node->isFirstLetterPseudoElement())
|
| return FirstLetterPseudoElement::firstLetterTextRenderer(*m_node);
|
|
|
| + if (m_node->isMarkerPseudoElement()) {
|
| + ASSERT(parentLayoutObject);
|
| + return MarkerPseudoElement::firstNonMarkerChild(parentLayoutObject);
|
| + }
|
| +
|
| return LayoutTreeBuilder::nextLayoutObject();
|
| }
|
|
|
| @@ -74,8 +80,14 @@ LayoutObject* LayoutTreeBuilderForElement::parentLayoutObject() const
|
| {
|
| LayoutObject* parentLayoutObject = LayoutTreeBuilder::parentLayoutObject();
|
|
|
| + if (m_node->isMarkerPseudoElement()) {
|
| + ASSERT(m_layoutObjectParent->isLayoutBlockFlow());
|
| + if (LayoutObject* markerLayoutObject = MarkerPseudoElement::getParentOfFirstLineBox(toLayoutBlockFlow(m_layoutObjectParent), nullptr))
|
| + return markerLayoutObject;
|
| + }
|
| +
|
| if (parentLayoutObject) {
|
| - // FIXME: Guarding this by parentLayoutObject isn't quite right as the spec for
|
| + // FIXME: Guarding this by parentRenderer isn't quite right as the spec for
|
| // top layer only talks about display: none ancestors so putting a <dialog> inside an
|
| // <optgroup> seems like it should still work even though this check will prevent it.
|
| if (m_node->isInTopLayer())
|
| @@ -105,6 +117,9 @@ bool LayoutTreeBuilderForElement::shouldCreateLayoutObject() const
|
| if (!parentLayoutObject->canHaveChildren())
|
| return false;
|
|
|
| + if (m_node->isMarkerPseudoElement() && m_layoutObjectParent->style()->display() == LIST_ITEM)
|
| + return true;
|
| +
|
| return m_node->layoutObjectIsNeeded(style());
|
| }
|
|
|
| @@ -134,7 +149,7 @@ void LayoutTreeBuilderForElement::createLayoutObject()
|
| // for the first time. Otherwise code using inLayoutFlowThread() in the styleWillChange and styleDidChange will fail.
|
| newLayoutObject->setFlowThreadState(parentLayoutObject->flowThreadState());
|
|
|
| - LayoutObject* nextLayoutObject = this->nextLayoutObject();
|
| + LayoutObject* nextLayoutObject = this->nextLayoutObject(parentLayoutObject);
|
| m_node->setLayoutObject(newLayoutObject);
|
| newLayoutObject->setStyle(&style); // setStyle() can depend on layoutObject() already being set.
|
|
|
|
|