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

Side by Side Diff: Source/core/rendering/RenderObject.cpp

Issue 639863006: Revert of Convert first letter into a pseudo element. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/rendering/RenderObject.h ('k') | Source/core/rendering/RenderObjectChildList.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv ed. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv ed.
7 * Copyright (C) 2009 Google Inc. All rights reserved. 7 * Copyright (C) 2009 Google Inc. All rights reserved.
8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 1576 matching lines...) Expand 10 before | Expand all | Expand 10 after
1587 if (diff.needsPaintInvalidationLayer() && !hasLayer()) { 1587 if (diff.needsPaintInvalidationLayer() && !hasLayer()) {
1588 diff.clearNeedsPaintInvalidation(); 1588 diff.clearNeedsPaintInvalidation();
1589 diff.setNeedsPaintInvalidationObject(); 1589 diff.setNeedsPaintInvalidationObject();
1590 } 1590 }
1591 1591
1592 return diff; 1592 return diff;
1593 } 1593 }
1594 1594
1595 void RenderObject::setPseudoStyle(PassRefPtr<RenderStyle> pseudoStyle) 1595 void RenderObject::setPseudoStyle(PassRefPtr<RenderStyle> pseudoStyle)
1596 { 1596 {
1597 ASSERT(pseudoStyle->styleType() == BEFORE || pseudoStyle->styleType() == AFT ER || pseudoStyle->styleType() == FIRST_LETTER); 1597 ASSERT(pseudoStyle->styleType() == BEFORE || pseudoStyle->styleType() == AFT ER);
1598 1598
1599 // FIXME: We should consider just making all pseudo items use an inherited s tyle. 1599 // FIXME: We should consider just making all pseudo items use an inherited s tyle.
1600 1600
1601 // Images are special and must inherit the pseudoStyle so the width and heig ht of 1601 // Images are special and must inherit the pseudoStyle so the width and heig ht of
1602 // the pseudo element doesn't change the size of the image. In all other cas es we 1602 // the pseudo element doesn't change the size of the image. In all other cas es we
1603 // can just share the style. 1603 // can just share the style.
1604 // 1604 //
1605 // Quotes are also RenderInline, so we need to create an inherited style to avoid 1605 // Quotes are also RenderInline, so we need to create an inherited style to avoid
1606 // getting an inline with positioning or an invalid display. 1606 // getting an inline with positioning or an invalid display.
1607 // 1607 //
(...skipping 1012 matching lines...) Expand 10 before | Expand all | Expand 10 after
2620 const RenderObject* rendererForFirstLineStyle = renderer; 2620 const RenderObject* rendererForFirstLineStyle = renderer;
2621 if (renderer->isBeforeOrAfterContent()) 2621 if (renderer->isBeforeOrAfterContent())
2622 rendererForFirstLineStyle = renderer->parent(); 2622 rendererForFirstLineStyle = renderer->parent();
2623 2623
2624 if (rendererForFirstLineStyle->isRenderBlockFlow() || rendererForFirstLineSt yle->isRenderButton()) { 2624 if (rendererForFirstLineStyle->isRenderBlockFlow() || rendererForFirstLineSt yle->isRenderButton()) {
2625 if (RenderBlock* firstLineBlock = rendererForFirstLineStyle->firstLineBl ock()) { 2625 if (RenderBlock* firstLineBlock = rendererForFirstLineStyle->firstLineBl ock()) {
2626 if (type == Cached) 2626 if (type == Cached)
2627 return firstLineBlock->getCachedPseudoStyle(FIRST_LINE, style); 2627 return firstLineBlock->getCachedPseudoStyle(FIRST_LINE, style);
2628 return firstLineBlock->getUncachedPseudoStyle(PseudoStyleRequest(FIR ST_LINE), style, firstLineBlock == renderer ? style : 0); 2628 return firstLineBlock->getUncachedPseudoStyle(PseudoStyleRequest(FIR ST_LINE), style, firstLineBlock == renderer ? style : 0);
2629 } 2629 }
2630 } else if (!rendererForFirstLineStyle->isAnonymous() && rendererForFirstLine Style->isRenderInline() 2630 } else if (!rendererForFirstLineStyle->isAnonymous() && rendererForFirstLine Style->isRenderInline()) {
2631 && !rendererForFirstLineStyle->node()->isFirstLetterPseudoElement()) {
2632 RenderStyle* parentStyle = rendererForFirstLineStyle->parent()->firstLin eStyle(); 2631 RenderStyle* parentStyle = rendererForFirstLineStyle->parent()->firstLin eStyle();
2633 if (parentStyle != rendererForFirstLineStyle->parent()->style()) { 2632 if (parentStyle != rendererForFirstLineStyle->parent()->style()) {
2634 if (type == Cached) { 2633 if (type == Cached) {
2635 // A first-line style is in effect. Cache a first-line style for ourselves. 2634 // A first-line style is in effect. Cache a first-line style for ourselves.
2636 rendererForFirstLineStyle->style()->setHasPseudoStyle(FIRST_LINE _INHERITED); 2635 rendererForFirstLineStyle->style()->setHasPseudoStyle(FIRST_LINE _INHERITED);
2637 return rendererForFirstLineStyle->getCachedPseudoStyle(FIRST_LIN E_INHERITED, parentStyle); 2636 return rendererForFirstLineStyle->getCachedPseudoStyle(FIRST_LIN E_INHERITED, parentStyle);
2638 } 2637 }
2639 return rendererForFirstLineStyle->getUncachedPseudoStyle(PseudoStyle Request(FIRST_LINE_INHERITED), parentStyle, style); 2638 return rendererForFirstLineStyle->getUncachedPseudoStyle(PseudoStyle Request(FIRST_LINE_INHERITED), parentStyle, style);
2640 } 2639 }
2641 } 2640 }
(...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after
3146 { 3145 {
3147 if (object1) { 3146 if (object1) {
3148 const blink::RenderObject* root = object1; 3147 const blink::RenderObject* root = object1;
3149 while (root->parent()) 3148 while (root->parent())
3150 root = root->parent(); 3149 root = root->parent();
3151 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); 3150 root->showRenderTreeAndMark(object1, "*", object2, "-", 0);
3152 } 3151 }
3153 } 3152 }
3154 3153
3155 #endif 3154 #endif
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderObject.h ('k') | Source/core/rendering/RenderObjectChildList.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698