| 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 1855 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1866 } | 1866 } |
| 1867 | 1867 |
| 1868 void LayoutObject::firstLineStyleDidChange(const ComputedStyle& oldStyle, const
ComputedStyle& newStyle) | 1868 void LayoutObject::firstLineStyleDidChange(const ComputedStyle& oldStyle, const
ComputedStyle& newStyle) |
| 1869 { | 1869 { |
| 1870 StyleDifference diff = oldStyle.visualInvalidationDiff(newStyle); | 1870 StyleDifference diff = oldStyle.visualInvalidationDiff(newStyle); |
| 1871 | 1871 |
| 1872 if (diff.needsPaintInvalidation() || diff.textDecorationOrColorChanged()) { | 1872 if (diff.needsPaintInvalidation() || diff.textDecorationOrColorChanged()) { |
| 1873 // We need to invalidate all inline boxes in the first line, because the
y need to be | 1873 // We need to invalidate all inline boxes in the first line, because the
y need to be |
| 1874 // repainted with the new style, e.g. background, font style, etc. | 1874 // repainted with the new style, e.g. background, font style, etc. |
| 1875 LayoutBlockFlow* firstLineContainer = nullptr; | 1875 LayoutBlockFlow* firstLineContainer = nullptr; |
| 1876 if (canHaveFirstLineOrFirstLetterStyle()) { | 1876 if (behavesLikeBlockContainer()) { |
| 1877 // This object is a LayoutBlock having PseudoIdFirstLine pseudo styl
e changed. | 1877 // This object is a LayoutBlock having PseudoIdFirstLine pseudo styl
e changed. |
| 1878 firstLineContainer = toLayoutBlock(this)->nearestInnerBlockWithFirst
Line(); | 1878 firstLineContainer = toLayoutBlock(this)->nearestInnerBlockWithFirst
Line(); |
| 1879 } else if (isLayoutInline()) { | 1879 } else if (isLayoutInline()) { |
| 1880 // This object is a LayoutInline having FIRST_LINE_INHERITED pesudo
style changed. | 1880 // This object is a LayoutInline having FIRST_LINE_INHERITED pesudo
style changed. |
| 1881 // This method can be called even if the LayoutInline doesn't inters
ect the first line, | 1881 // This method can be called even if the LayoutInline doesn't inters
ect the first line, |
| 1882 // but we only need to invalidate if it does. | 1882 // but we only need to invalidate if it does. |
| 1883 if (InlineBox* firstLineBox = toLayoutInline(this)->firstLineBoxIncl
udingCulling()) { | 1883 if (InlineBox* firstLineBox = toLayoutInline(this)->firstLineBoxIncl
udingCulling()) { |
| 1884 if (firstLineBox->isFirstLineStyle()) | 1884 if (firstLineBox->isFirstLineStyle()) |
| 1885 firstLineContainer = toLayoutBlockFlow(containingBlock()); | 1885 firstLineContainer = toLayoutBlockFlow(containingBlock()); |
| 1886 } | 1886 } |
| (...skipping 1116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3003 Cached, | 3003 Cached, |
| 3004 Uncached | 3004 Uncached |
| 3005 }; | 3005 }; |
| 3006 | 3006 |
| 3007 static PassRefPtr<ComputedStyle> firstLineStyleForCachedUncachedType(StyleCacheS
tate type, const LayoutObject* layoutObject, ComputedStyle* style) | 3007 static PassRefPtr<ComputedStyle> firstLineStyleForCachedUncachedType(StyleCacheS
tate type, const LayoutObject* layoutObject, ComputedStyle* style) |
| 3008 { | 3008 { |
| 3009 const LayoutObject* layoutObjectForFirstLineStyle = layoutObject; | 3009 const LayoutObject* layoutObjectForFirstLineStyle = layoutObject; |
| 3010 if (layoutObject->isBeforeOrAfterContent()) | 3010 if (layoutObject->isBeforeOrAfterContent()) |
| 3011 layoutObjectForFirstLineStyle = layoutObject->parent(); | 3011 layoutObjectForFirstLineStyle = layoutObject->parent(); |
| 3012 | 3012 |
| 3013 if (layoutObjectForFirstLineStyle->canHaveFirstLineOrFirstLetterStyle()) { | 3013 if (layoutObjectForFirstLineStyle->behavesLikeBlockContainer()) { |
| 3014 if (const LayoutBlock* firstLineBlock = toLayoutBlock(layoutObjectForFir
stLineStyle)->enclosingFirstLineStyleBlock()) { | 3014 if (const LayoutBlock* firstLineBlock = toLayoutBlock(layoutObjectForFir
stLineStyle)->enclosingFirstLineStyleBlock()) { |
| 3015 if (type == Cached) | 3015 if (type == Cached) |
| 3016 return firstLineBlock->getCachedPseudoStyle(PseudoIdFirstLine, s
tyle); | 3016 return firstLineBlock->getCachedPseudoStyle(PseudoIdFirstLine, s
tyle); |
| 3017 return firstLineBlock->getUncachedPseudoStyle(PseudoStyleRequest(Pse
udoIdFirstLine), style, firstLineBlock == layoutObject ? style : 0); | 3017 return firstLineBlock->getUncachedPseudoStyle(PseudoStyleRequest(Pse
udoIdFirstLine), style, firstLineBlock == layoutObject ? style : 0); |
| 3018 } | 3018 } |
| 3019 } else if (!layoutObjectForFirstLineStyle->isAnonymous() && layoutObjectForF
irstLineStyle->isLayoutInline() | 3019 } else if (!layoutObjectForFirstLineStyle->isAnonymous() && layoutObjectForF
irstLineStyle->isLayoutInline() |
| 3020 && !layoutObjectForFirstLineStyle->node()->isFirstLetterPseudoElement())
{ | 3020 && !layoutObjectForFirstLineStyle->node()->isFirstLetterPseudoElement())
{ |
| 3021 const ComputedStyle* parentStyle = layoutObjectForFirstLineStyle->parent
()->firstLineStyle(); | 3021 const ComputedStyle* parentStyle = layoutObjectForFirstLineStyle->parent
()->firstLineStyle(); |
| 3022 if (parentStyle != layoutObjectForFirstLineStyle->parent()->style()) { | 3022 if (parentStyle != layoutObjectForFirstLineStyle->parent()->style()) { |
| 3023 if (type == Cached) { | 3023 if (type == Cached) { |
| (...skipping 666 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3690 const blink::LayoutObject* root = object1; | 3690 const blink::LayoutObject* root = object1; |
| 3691 while (root->parent()) | 3691 while (root->parent()) |
| 3692 root = root->parent(); | 3692 root = root->parent(); |
| 3693 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); | 3693 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); |
| 3694 } else { | 3694 } else { |
| 3695 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); | 3695 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); |
| 3696 } | 3696 } |
| 3697 } | 3697 } |
| 3698 | 3698 |
| 3699 #endif | 3699 #endif |
| OLD | NEW |