OLD | NEW |
1 /* | 1 /* |
2 * (C) 1999 Lars Knoll (knoll@kde.org) | 2 * (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 2000 Dirk Mueller (mueller@kde.org) | 3 * (C) 2000 Dirk Mueller (mueller@kde.org) |
4 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. | 4 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. |
5 * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net) | 5 * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net) |
6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) | 6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 return false; | 183 return false; |
184 } | 184 } |
185 | 185 |
186 void LayoutText::styleDidChange(StyleDifference diff, const ComputedStyle* oldSt
yle) | 186 void LayoutText::styleDidChange(StyleDifference diff, const ComputedStyle* oldSt
yle) |
187 { | 187 { |
188 // There is no need to ever schedule paint invalidations from a style change
of a text run, since | 188 // There is no need to ever schedule paint invalidations from a style change
of a text run, since |
189 // we already did this for the parent of the text run. | 189 // we already did this for the parent of the text run. |
190 // We do have to schedule layouts, though, since a style change can force us
to | 190 // We do have to schedule layouts, though, since a style change can force us
to |
191 // need to relayout. | 191 // need to relayout. |
192 if (diff.needsFullLayout()) { | 192 if (diff.needsFullLayout()) { |
193 setNeedsLayoutAndPrefWidthsRecalc(); | 193 setNeedsLayoutAndPrefWidthsRecalc(LayoutInvalidationReason::StyleChange)
; |
194 m_knownToHaveNoOverflowAndNoFallbackFonts = false; | 194 m_knownToHaveNoOverflowAndNoFallbackFonts = false; |
195 } | 195 } |
196 | 196 |
197 const ComputedStyle& newStyle = styleRef(); | 197 const ComputedStyle& newStyle = styleRef(); |
198 ETextTransform oldTransform = oldStyle ? oldStyle->textTransform() : TTNONE; | 198 ETextTransform oldTransform = oldStyle ? oldStyle->textTransform() : TTNONE; |
199 ETextSecurity oldSecurity = oldStyle ? oldStyle->textSecurity() : TSNONE; | 199 ETextSecurity oldSecurity = oldStyle ? oldStyle->textSecurity() : TSNONE; |
200 if (oldTransform != newStyle.textTransform() || oldSecurity != newStyle.text
Security()) | 200 if (oldTransform != newStyle.textTransform() || oldSecurity != newStyle.text
Security()) |
201 transformText(); | 201 transformText(); |
202 | 202 |
203 // This is an optimization that kicks off font load before layout. | 203 // This is an optimization that kicks off font load before layout. |
(...skipping 1225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1429 ASSERT(text); | 1429 ASSERT(text); |
1430 | 1430 |
1431 if (!force && equal(m_text.impl(), text.get())) | 1431 if (!force && equal(m_text.impl(), text.get())) |
1432 return; | 1432 return; |
1433 | 1433 |
1434 setTextInternal(text); | 1434 setTextInternal(text); |
1435 // If preferredLogicalWidthsDirty() of an orphan child is true, LayoutObject
ChildList:: | 1435 // If preferredLogicalWidthsDirty() of an orphan child is true, LayoutObject
ChildList:: |
1436 // insertChildNode() fails to set true to owner. To avoid that, we call | 1436 // insertChildNode() fails to set true to owner. To avoid that, we call |
1437 // setNeedsLayoutAndPrefWidthsRecalc() only if this LayoutText has parent. | 1437 // setNeedsLayoutAndPrefWidthsRecalc() only if this LayoutText has parent. |
1438 if (parent()) | 1438 if (parent()) |
1439 setNeedsLayoutAndPrefWidthsRecalc(); | 1439 setNeedsLayoutAndPrefWidthsRecalc(LayoutInvalidationReason::TextChanged)
; |
1440 m_knownToHaveNoOverflowAndNoFallbackFonts = false; | 1440 m_knownToHaveNoOverflowAndNoFallbackFonts = false; |
1441 | 1441 |
1442 if (AXObjectCache* cache = document().existingAXObjectCache()) | 1442 if (AXObjectCache* cache = document().existingAXObjectCache()) |
1443 cache->textChanged(this); | 1443 cache->textChanged(this); |
1444 } | 1444 } |
1445 | 1445 |
1446 void LayoutText::dirtyOrDeleteLineBoxesIfNeeded(bool fullLayout) | 1446 void LayoutText::dirtyOrDeleteLineBoxesIfNeeded(bool fullLayout) |
1447 { | 1447 { |
1448 if (fullLayout) | 1448 if (fullLayout) |
1449 deleteTextBoxes(); | 1449 deleteTextBoxes(); |
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1898 } | 1898 } |
1899 | 1899 |
1900 void LayoutText::invalidateDisplayItemClients(const LayoutBoxModelObject& paintI
nvalidationContainer) const | 1900 void LayoutText::invalidateDisplayItemClients(const LayoutBoxModelObject& paintI
nvalidationContainer) const |
1901 { | 1901 { |
1902 LayoutObject::invalidateDisplayItemClients(paintInvalidationContainer); | 1902 LayoutObject::invalidateDisplayItemClients(paintInvalidationContainer); |
1903 for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox()) | 1903 for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox()) |
1904 paintInvalidationContainer.invalidateDisplayItemClientOnBacking(*box); | 1904 paintInvalidationContainer.invalidateDisplayItemClientOnBacking(*box); |
1905 } | 1905 } |
1906 | 1906 |
1907 } // namespace blink | 1907 } // namespace blink |
OLD | NEW |