Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(46)

Side by Side Diff: Source/core/html/HTMLElement.cpp

Issue 302433015: Use correct offset when attribute auto is present (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Updated tests to pass on mac and windows. Also a condition in HTMLElement which sets any direction … Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« Source/core/dom/Position.cpp ('K') | « Source/core/dom/Position.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 735 matching lines...) Expand 10 before | Expand all | Expand 10 after
746 return; 746 return;
747 } 747 }
748 } 748 }
749 } 749 }
750 } 750 }
751 751
752 void HTMLElement::calculateAndAdjustDirectionality() 752 void HTMLElement::calculateAndAdjustDirectionality()
753 { 753 {
754 Node* strongDirectionalityTextNode; 754 Node* strongDirectionalityTextNode;
755 TextDirection textDirection = directionality(&strongDirectionalityTextNode); 755 TextDirection textDirection = directionality(&strongDirectionalityTextNode);
756 setHasDirAutoFlagRecursively(this, true, strongDirectionalityTextNode); 756 if (hasDirectionAuto())
757 setHasDirAutoFlagRecursively(this, true, strongDirectionalityTextNode);
758 else
759 setHasDirAutoFlagRecursively(this, false, strongDirectionalityTextNode);
757 if (renderer() && renderer()->style() && renderer()->style()->direction() != textDirection) 760 if (renderer() && renderer()->style() && renderer()->style()->direction() != textDirection)
758 setNeedsStyleRecalc(SubtreeStyleChange); 761 setNeedsStyleRecalc(SubtreeStyleChange);
759 } 762 }
760 763
761 void HTMLElement::adjustDirectionalityIfNeededAfterChildrenChanged(Node* beforeC hange, int childCountDelta) 764 void HTMLElement::adjustDirectionalityIfNeededAfterChildrenChanged(Node* beforeC hange, int childCountDelta)
762 { 765 {
763 if (document().renderView() && childCountDelta < 0) { 766 if (document().renderView() && childCountDelta < 0) {
764 Node* node = beforeChange ? NodeTraversal::nextSkippingChildren(*beforeC hange) : 0; 767 Node* node = beforeChange ? NodeTraversal::nextSkippingChildren(*beforeC hange) : 0;
765 for (int counter = 0; node && counter < childCountDelta; counter++, node = NodeTraversal::nextSkippingChildren(*node)) { 768 for (int counter = 0; node && counter < childCountDelta; counter++, node = NodeTraversal::nextSkippingChildren(*node)) {
766 if (elementAffectsDirectionality(node)) 769 if (elementAffectsDirectionality(node))
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
955 #ifndef NDEBUG 958 #ifndef NDEBUG
956 959
957 // For use in the debugger 960 // For use in the debugger
958 void dumpInnerHTML(WebCore::HTMLElement*); 961 void dumpInnerHTML(WebCore::HTMLElement*);
959 962
960 void dumpInnerHTML(WebCore::HTMLElement* element) 963 void dumpInnerHTML(WebCore::HTMLElement* element)
961 { 964 {
962 printf("%s\n", element->innerHTML().ascii().data()); 965 printf("%s\n", element->innerHTML().ascii().data());
963 } 966 }
964 #endif 967 #endif
OLDNEW
« Source/core/dom/Position.cpp ('K') | « Source/core/dom/Position.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698