| 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) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 4 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. |
| 5 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) | 5 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) |
| 6 * Copyright (C) 2011 Motorola Mobility. All rights reserved. | 6 * Copyright (C) 2011 Motorola Mobility. All rights reserved. |
| 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 757 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 768 void HTMLElement::adjustDirectionalityIfNeededAfterChildAttributeChanged(Element
* child) | 768 void HTMLElement::adjustDirectionalityIfNeededAfterChildAttributeChanged(Element
* child) |
| 769 { | 769 { |
| 770 ASSERT(selfOrAncestorHasDirAutoAttribute()); | 770 ASSERT(selfOrAncestorHasDirAutoAttribute()); |
| 771 Node* strongDirectionalityTextNode; | 771 Node* strongDirectionalityTextNode; |
| 772 TextDirection textDirection = directionality(&strongDirectionalityTextNode); | 772 TextDirection textDirection = directionality(&strongDirectionalityTextNode); |
| 773 setHasDirAutoFlagRecursively(child, false); | 773 setHasDirAutoFlagRecursively(child, false); |
| 774 if (renderer() && renderer()->style() && renderer()->style()->direction() !=
textDirection) { | 774 if (renderer() && renderer()->style() && renderer()->style()->direction() !=
textDirection) { |
| 775 Element* elementToAdjust = this; | 775 Element* elementToAdjust = this; |
| 776 for (; elementToAdjust; elementToAdjust = elementToAdjust->parentElement
()) { | 776 for (; elementToAdjust; elementToAdjust = elementToAdjust->parentElement
()) { |
| 777 if (elementAffectsDirectionality(elementToAdjust)) { | 777 if (elementAffectsDirectionality(elementToAdjust)) { |
| 778 elementToAdjust->setNeedsStyleRecalc(); | 778 elementToAdjust->setNeedsStyleRecalc(SubtreeStyleChange); |
| 779 return; | 779 return; |
| 780 } | 780 } |
| 781 } | 781 } |
| 782 } | 782 } |
| 783 } | 783 } |
| 784 | 784 |
| 785 void HTMLElement::calculateAndAdjustDirectionality() | 785 void HTMLElement::calculateAndAdjustDirectionality() |
| 786 { | 786 { |
| 787 Node* strongDirectionalityTextNode; | 787 Node* strongDirectionalityTextNode; |
| 788 TextDirection textDirection = directionality(&strongDirectionalityTextNode); | 788 TextDirection textDirection = directionality(&strongDirectionalityTextNode); |
| 789 setHasDirAutoFlagRecursively(this, true, strongDirectionalityTextNode); | 789 setHasDirAutoFlagRecursively(this, true, strongDirectionalityTextNode); |
| 790 if (renderer() && renderer()->style() && renderer()->style()->direction() !=
textDirection) | 790 if (renderer() && renderer()->style() && renderer()->style()->direction() !=
textDirection) |
| 791 setNeedsStyleRecalc(); | 791 setNeedsStyleRecalc(SubtreeStyleChange); |
| 792 } | 792 } |
| 793 | 793 |
| 794 void HTMLElement::adjustDirectionalityIfNeededAfterChildrenChanged(Node* beforeC
hange, int childCountDelta) | 794 void HTMLElement::adjustDirectionalityIfNeededAfterChildrenChanged(Node* beforeC
hange, int childCountDelta) |
| 795 { | 795 { |
| 796 if (document().renderer() && childCountDelta < 0) { | 796 if (document().renderer() && childCountDelta < 0) { |
| 797 Node* node = beforeChange ? NodeTraversal::nextSkippingChildren(*beforeC
hange) : 0; | 797 Node* node = beforeChange ? NodeTraversal::nextSkippingChildren(*beforeC
hange) : 0; |
| 798 for (int counter = 0; node && counter < childCountDelta; counter++, node
= NodeTraversal::nextSkippingChildren(*node)) { | 798 for (int counter = 0; node && counter < childCountDelta; counter++, node
= NodeTraversal::nextSkippingChildren(*node)) { |
| 799 if (elementAffectsDirectionality(node)) | 799 if (elementAffectsDirectionality(node)) |
| 800 continue; | 800 continue; |
| 801 | 801 |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 968 #ifndef NDEBUG | 968 #ifndef NDEBUG |
| 969 | 969 |
| 970 // For use in the debugger | 970 // For use in the debugger |
| 971 void dumpInnerHTML(WebCore::HTMLElement*); | 971 void dumpInnerHTML(WebCore::HTMLElement*); |
| 972 | 972 |
| 973 void dumpInnerHTML(WebCore::HTMLElement* element) | 973 void dumpInnerHTML(WebCore::HTMLElement* element) |
| 974 { | 974 { |
| 975 printf("%s\n", element->innerHTML().ascii().data()); | 975 printf("%s\n", element->innerHTML().ascii().data()); |
| 976 } | 976 } |
| 977 #endif | 977 #endif |
| OLD | NEW |