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

Unified Diff: Source/core/rendering/RenderObject.cpp

Issue 571603003: Convert first letter into a pseudo element. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 3 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/rendering/RenderObject.cpp
diff --git a/Source/core/rendering/RenderObject.cpp b/Source/core/rendering/RenderObject.cpp
index b5d1e9e2309ec2ec2643780a6996c223eb768d17..04a90ea501dafb330c3b4e02364eee6adea19e71 100644
--- a/Source/core/rendering/RenderObject.cpp
+++ b/Source/core/rendering/RenderObject.cpp
@@ -1647,7 +1647,7 @@ StyleDifference RenderObject::adjustStyleDifference(StyleDifference diff) const
void RenderObject::setPseudoStyle(PassRefPtr<RenderStyle> pseudoStyle)
{
- ASSERT(pseudoStyle->styleType() == BEFORE || pseudoStyle->styleType() == AFTER);
+ ASSERT(pseudoStyle->styleType() == BEFORE || pseudoStyle->styleType() == AFTER || pseudoStyle->styleType() == FIRST_LETTER);
// FIXME: We should consider just making all pseudo items use an inherited style.
@@ -2667,7 +2667,10 @@ static PassRefPtr<RenderStyle> firstLineStyleForCachedUncachedType(StyleCacheSta
return firstLineBlock->getCachedPseudoStyle(FIRST_LINE, style);
return firstLineBlock->getUncachedPseudoStyle(PseudoStyleRequest(FIRST_LINE), style, firstLineBlock == renderer ? style : 0);
}
- } else if (!rendererForFirstLineStyle->isAnonymous() && rendererForFirstLineStyle->isRenderInline()) {
+ } else if (!rendererForFirstLineStyle->isAnonymous() && rendererForFirstLineStyle->isRenderInline()
+ // FIXME: IS this right? Doing this gives us the same behaviour as the non-pseudoElement first letter ....
dsinclair 2014/09/27 03:21:21 This was a fix for a failing layout test, basicall
esprehn 2014/09/30 09:00:31 Not sure what this is doing, have an example? Also
dsinclair 2014/09/30 21:46:34 Logic cleaned up. For an example, with fast/css/f
+ && !(rendererForFirstLineStyle->node() && rendererForFirstLineStyle->node()->isFirstLetterPseudoElement())) {
+
RenderStyle* parentStyle = rendererForFirstLineStyle->parent()->firstLineStyle();
if (parentStyle != rendererForFirstLineStyle->parent()->style()) {
if (type == Cached) {

Powered by Google App Engine
This is Rietveld 408576698