| 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 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights | 4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights |
| 5 * reserved. | 5 * reserved. |
| 6 * | 6 * |
| 7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
| 8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
| 9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
| 10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 | 24 |
| 25 #include "bindings/core/v8/ExceptionState.h" | 25 #include "bindings/core/v8/ExceptionState.h" |
| 26 #include "core/SVGNames.h" | 26 #include "core/SVGNames.h" |
| 27 #include "core/css/resolver/StyleResolver.h" | 27 #include "core/css/resolver/StyleResolver.h" |
| 28 #include "core/dom/ExceptionCode.h" | 28 #include "core/dom/ExceptionCode.h" |
| 29 #include "core/dom/FirstLetterPseudoElement.h" | 29 #include "core/dom/FirstLetterPseudoElement.h" |
| 30 #include "core/dom/LayoutTreeBuilder.h" | 30 #include "core/dom/LayoutTreeBuilder.h" |
| 31 #include "core/dom/LayoutTreeBuilderTraversal.h" | 31 #include "core/dom/LayoutTreeBuilderTraversal.h" |
| 32 #include "core/dom/NodeComputedStyle.h" | 32 #include "core/dom/NodeComputedStyle.h" |
| 33 #include "core/dom/NodeTraversal.h" | 33 #include "core/dom/NodeTraversal.h" |
| 34 #include "core/dom/shadow/ElementShadow.h" | |
| 35 #include "core/dom/shadow/ShadowRoot.h" | 34 #include "core/dom/shadow/ShadowRoot.h" |
| 36 #include "core/events/ScopedEventQueue.h" | 35 #include "core/events/ScopedEventQueue.h" |
| 37 #include "core/layout/LayoutText.h" | 36 #include "core/layout/LayoutText.h" |
| 38 #include "core/layout/LayoutTextCombine.h" | 37 #include "core/layout/LayoutTextCombine.h" |
| 39 #include "core/layout/LayoutTextFragment.h" | 38 #include "core/layout/LayoutTextFragment.h" |
| 40 #include "core/layout/api/LayoutTextItem.h" | 39 #include "core/layout/api/LayoutTextItem.h" |
| 41 #include "core/layout/svg/LayoutSVGInlineText.h" | 40 #include "core/layout/svg/LayoutSVGInlineText.h" |
| 42 #include "core/svg/SVGForeignObjectElement.h" | 41 #include "core/svg/SVGForeignObjectElement.h" |
| 43 #include "platform/bindings/DOMDataStore.h" | 42 #include "platform/bindings/DOMDataStore.h" |
| 44 #include "platform/wtf/text/CString.h" | 43 #include "platform/wtf/text/CString.h" |
| (...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 440 if (!text_layout_object) | 439 if (!text_layout_object) |
| 441 return true; | 440 return true; |
| 442 // In general we do not want to branch on lifecycle states such as | 441 // In general we do not want to branch on lifecycle states such as |
| 443 // |childNeedsDistributionRecalc|, but this code tries to figure out if we can | 442 // |childNeedsDistributionRecalc|, but this code tries to figure out if we can |
| 444 // use an optimized code path that avoids reattach. | 443 // use an optimized code path that avoids reattach. |
| 445 if (!text_node.GetDocument().ChildNeedsDistributionRecalc() && | 444 if (!text_node.GetDocument().ChildNeedsDistributionRecalc() && |
| 446 !text_node.TextLayoutObjectIsNeeded(*text_layout_object->Style(), | 445 !text_node.TextLayoutObjectIsNeeded(*text_layout_object->Style(), |
| 447 *text_layout_object->Parent())) { | 446 *text_layout_object->Parent())) { |
| 448 return true; | 447 return true; |
| 449 } | 448 } |
| 450 // Check whether this node may be about to be redistributed. | |
| 451 if (text_node.ParentElementShadow() && | |
| 452 text_node.ParentElementShadow()->NeedsDistributionRecalc()) { | |
| 453 return true; | |
| 454 } | |
| 455 if (text_layout_object->IsTextFragment()) { | 449 if (text_layout_object->IsTextFragment()) { |
| 456 // Changes of |textNode| may change first letter part, so we should | 450 // Changes of |textNode| may change first letter part, so we should |
| 457 // reattach. | 451 // reattach. |
| 458 return ToLayoutTextFragment(text_layout_object) | 452 return ToLayoutTextFragment(text_layout_object) |
| 459 ->GetFirstLetterPseudoElement(); | 453 ->GetFirstLetterPseudoElement(); |
| 460 } | 454 } |
| 461 return false; | 455 return false; |
| 462 } | 456 } |
| 463 | 457 |
| 464 void Text::UpdateTextLayoutObject(unsigned offset_of_replaced_data, | 458 void Text::UpdateTextLayoutObject(unsigned offset_of_replaced_data, |
| (...skipping 12 matching lines...) Expand all Loading... |
| 477 | 471 |
| 478 Text* Text::CloneWithData(const String& data) { | 472 Text* Text::CloneWithData(const String& data) { |
| 479 return Create(GetDocument(), data); | 473 return Create(GetDocument(), data); |
| 480 } | 474 } |
| 481 | 475 |
| 482 DEFINE_TRACE(Text) { | 476 DEFINE_TRACE(Text) { |
| 483 CharacterData::Trace(visitor); | 477 CharacterData::Trace(visitor); |
| 484 } | 478 } |
| 485 | 479 |
| 486 } // namespace blink | 480 } // namespace blink |
| OLD | NEW |