Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(550)

Unified Diff: Source/core/dom/RenderTreeBuilder.cpp

Issue 571603003: Convert first letter into a pseudo element. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase to master Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/dom/RenderTreeBuilder.cpp
diff --git a/Source/core/dom/RenderTreeBuilder.cpp b/Source/core/dom/RenderTreeBuilder.cpp
index 7572603e73763b11ab81fd4bb3a7ae75ca1aa8b9..3c62d9c8f2ee4badc0bac4eb3384c37f6eb22d41 100644
--- a/Source/core/dom/RenderTreeBuilder.cpp
+++ b/Source/core/dom/RenderTreeBuilder.cpp
@@ -29,8 +29,10 @@
#include "core/HTMLNames.h"
#include "core/SVGNames.h"
#include "core/css/resolver/StyleResolver.h"
+#include "core/dom/FirstLetterPseudoElement.h"
#include "core/dom/Fullscreen.h"
#include "core/dom/Node.h"
+#include "core/dom/PseudoElement.h"
#include "core/dom/Text.h"
#include "core/rendering/RenderFullScreen.h"
#include "core/rendering/RenderObject.h"
@@ -54,6 +56,9 @@ RenderObject* RenderTreeBuilder::nextRenderer() const
if (m_renderingParent->needsAttach())
Julien - ping for review 2014/10/09 18:24:48 You're checking m_renderingParent->needsAttach() f
dsinclair 2014/10/09 21:14:22 Are you saying this is an existing issue, or due t
Julien - ping for review 2014/10/10 14:47:07 I was confused by the logic actually and we have t
dsinclair 2014/10/10 18:06:53 Acknowledged.
return 0;
+ if (element && element->isFirstLetterPseudoElement())
+ return FirstLetterPseudoElement::firstLetterTextRenderer(*element);
Julien - ping for review 2014/10/09 18:24:48 If we keep the code in parentRenderer(), there is
dsinclair 2014/10/09 21:14:22 In what cases is there a top layer? Is this someth
Julien - ping for review 2014/10/10 14:47:07 top layer is a DOM Element API so it won't happen
dsinclair 2014/10/10 18:06:52 Code removed from parentRenderer().
+
return NodeRenderingTraversal::nextSiblingRenderer(m_node);
}
@@ -63,6 +68,11 @@ RenderObject* RenderTreeBuilder::parentRenderer() const
Element* element = m_node->isElementNode() ? toElement(m_node) : 0;
+ if (element && element->isFirstLetterPseudoElement()) {
+ RenderObject* nextRenderer = FirstLetterPseudoElement::firstLetterTextRenderer(*element);
+ return nextRenderer ? nextRenderer->parent() : nullptr;
+ }
+
if (element && m_renderingParent->renderer()) {
// FIXME: Guarding this by m_renderingParent->renderer() isn't quite right as the spec for
// top layer only talks about display: none ancestors so putting a <dialog> inside an

Powered by Google App Engine
This is Rietveld 408576698