OLD | NEW |
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 Loading... |
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); | 1597 ASSERT(pseudoStyle->styleType() == BEFORE || pseudoStyle->styleType() == AFT
ER || pseudoStyle->styleType() == FIRST_LETTER); |
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 1007 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2615 const RenderObject* rendererForFirstLineStyle = renderer; | 2615 const RenderObject* rendererForFirstLineStyle = renderer; |
2616 if (renderer->isBeforeOrAfterContent()) | 2616 if (renderer->isBeforeOrAfterContent()) |
2617 rendererForFirstLineStyle = renderer->parent(); | 2617 rendererForFirstLineStyle = renderer->parent(); |
2618 | 2618 |
2619 if (rendererForFirstLineStyle->isRenderBlockFlow() || rendererForFirstLineSt
yle->isRenderButton()) { | 2619 if (rendererForFirstLineStyle->isRenderBlockFlow() || rendererForFirstLineSt
yle->isRenderButton()) { |
2620 if (RenderBlock* firstLineBlock = rendererForFirstLineStyle->firstLineBl
ock()) { | 2620 if (RenderBlock* firstLineBlock = rendererForFirstLineStyle->firstLineBl
ock()) { |
2621 if (type == Cached) | 2621 if (type == Cached) |
2622 return firstLineBlock->getCachedPseudoStyle(FIRST_LINE, style); | 2622 return firstLineBlock->getCachedPseudoStyle(FIRST_LINE, style); |
2623 return firstLineBlock->getUncachedPseudoStyle(PseudoStyleRequest(FIR
ST_LINE), style, firstLineBlock == renderer ? style : 0); | 2623 return firstLineBlock->getUncachedPseudoStyle(PseudoStyleRequest(FIR
ST_LINE), style, firstLineBlock == renderer ? style : 0); |
2624 } | 2624 } |
2625 } else if (!rendererForFirstLineStyle->isAnonymous() && rendererForFirstLine
Style->isRenderInline()) { | 2625 } else if (!rendererForFirstLineStyle->isAnonymous() && rendererForFirstLine
Style->isRenderInline() |
| 2626 && !rendererForFirstLineStyle->node()->isFirstLetterPseudoElement()) { |
2626 RenderStyle* parentStyle = rendererForFirstLineStyle->parent()->firstLin
eStyle(); | 2627 RenderStyle* parentStyle = rendererForFirstLineStyle->parent()->firstLin
eStyle(); |
2627 if (parentStyle != rendererForFirstLineStyle->parent()->style()) { | 2628 if (parentStyle != rendererForFirstLineStyle->parent()->style()) { |
2628 if (type == Cached) { | 2629 if (type == Cached) { |
2629 // A first-line style is in effect. Cache a first-line style for
ourselves. | 2630 // A first-line style is in effect. Cache a first-line style for
ourselves. |
2630 rendererForFirstLineStyle->style()->setHasPseudoStyle(FIRST_LINE
_INHERITED); | 2631 rendererForFirstLineStyle->style()->setHasPseudoStyle(FIRST_LINE
_INHERITED); |
2631 return rendererForFirstLineStyle->getCachedPseudoStyle(FIRST_LIN
E_INHERITED, parentStyle); | 2632 return rendererForFirstLineStyle->getCachedPseudoStyle(FIRST_LIN
E_INHERITED, parentStyle); |
2632 } | 2633 } |
2633 return rendererForFirstLineStyle->getUncachedPseudoStyle(PseudoStyle
Request(FIRST_LINE_INHERITED), parentStyle, style); | 2634 return rendererForFirstLineStyle->getUncachedPseudoStyle(PseudoStyle
Request(FIRST_LINE_INHERITED), parentStyle, style); |
2634 } | 2635 } |
2635 } | 2636 } |
(...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3140 { | 3141 { |
3141 if (object1) { | 3142 if (object1) { |
3142 const blink::RenderObject* root = object1; | 3143 const blink::RenderObject* root = object1; |
3143 while (root->parent()) | 3144 while (root->parent()) |
3144 root = root->parent(); | 3145 root = root->parent(); |
3145 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); | 3146 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); |
3146 } | 3147 } |
3147 } | 3148 } |
3148 | 3149 |
3149 #endif | 3150 #endif |
OLD | NEW |