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

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

Issue 2555923002: Changed TextDirection to an enum class and renamed its members (Closed)
Patch Set: Small rebase fixes Created 4 years 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
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-2008, 2013, 2014 Apple Inc. All rights reserved. 4 * Copyright (C) 2004-2008, 2013, 2014 Apple Inc. All rights reserved.
5 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. 5 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved.
6 * (http://www.torchmobile.com/) 6 * (http://www.torchmobile.com/)
7 * Copyright (C) 2011 Motorola Mobility. All rights reserved. 7 * Copyright (C) 2011 Motorola Mobility. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 770 matching lines...) Expand 10 before | Expand all | Expand 10 after
781 // https://html.spec.whatwg.org/multipage/semantics.html#the-bdi-element 781 // https://html.spec.whatwg.org/multipage/semantics.html#the-bdi-element
782 const AtomicString& direction = fastGetAttribute(dirAttr); 782 const AtomicString& direction = fastGetAttribute(dirAttr);
783 return (isHTMLBDIElement(*this) && direction == nullAtom) || 783 return (isHTMLBDIElement(*this) && direction == nullAtom) ||
784 equalIgnoringCase(direction, "auto"); 784 equalIgnoringCase(direction, "auto");
785 } 785 }
786 786
787 TextDirection HTMLElement::directionalityIfhasDirAutoAttribute( 787 TextDirection HTMLElement::directionalityIfhasDirAutoAttribute(
788 bool& isAuto) const { 788 bool& isAuto) const {
789 isAuto = hasDirectionAuto(); 789 isAuto = hasDirectionAuto();
790 if (!isAuto) 790 if (!isAuto)
791 return LTR; 791 return TextDirection::Ltr;
792 return directionality(); 792 return directionality();
793 } 793 }
794 794
795 TextDirection HTMLElement::directionality( 795 TextDirection HTMLElement::directionality(
796 Node** strongDirectionalityTextNode) const { 796 Node** strongDirectionalityTextNode) const {
797 if (isHTMLInputElement(*this)) { 797 if (isHTMLInputElement(*this)) {
798 HTMLInputElement* inputElement = 798 HTMLInputElement* inputElement =
799 toHTMLInputElement(const_cast<HTMLElement*>(this)); 799 toHTMLInputElement(const_cast<HTMLElement*>(this));
800 bool hasStrongDirectionality; 800 bool hasStrongDirectionality;
801 TextDirection textDirection = determineDirectionality( 801 TextDirection textDirection = determineDirectionality(
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
835 if (hasStrongDirectionality) { 835 if (hasStrongDirectionality) {
836 if (strongDirectionalityTextNode) 836 if (strongDirectionalityTextNode)
837 *strongDirectionalityTextNode = node; 837 *strongDirectionalityTextNode = node;
838 return textDirection; 838 return textDirection;
839 } 839 }
840 } 840 }
841 node = FlatTreeTraversal::next(*node, this); 841 node = FlatTreeTraversal::next(*node, this);
842 } 842 }
843 if (strongDirectionalityTextNode) 843 if (strongDirectionalityTextNode)
844 *strongDirectionalityTextNode = 0; 844 *strongDirectionalityTextNode = 0;
845 return LTR; 845 return TextDirection::Ltr;
846 } 846 }
847 847
848 bool HTMLElement::selfOrAncestorHasDirAutoAttribute() const { 848 bool HTMLElement::selfOrAncestorHasDirAutoAttribute() const {
849 return layoutObject() && layoutObject()->style() && 849 return layoutObject() && layoutObject()->style() &&
850 layoutObject()->style()->selfOrAncestorHasDirAutoAttribute(); 850 layoutObject()->style()->selfOrAncestorHasDirAutoAttribute();
851 } 851 }
852 852
853 void HTMLElement::dirAttributeChanged(const AtomicString& value) { 853 void HTMLElement::dirAttributeChanged(const AtomicString& value) {
854 // If an ancestor has dir=auto, and this node has the first character, 854 // If an ancestor has dir=auto, and this node has the first character,
855 // changes to dir attribute may affect the ancestor. 855 // changes to dir attribute may affect the ancestor.
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
1193 1193
1194 #ifndef NDEBUG 1194 #ifndef NDEBUG
1195 1195
1196 // For use in the debugger 1196 // For use in the debugger
1197 void dumpInnerHTML(blink::HTMLElement*); 1197 void dumpInnerHTML(blink::HTMLElement*);
1198 1198
1199 void dumpInnerHTML(blink::HTMLElement* element) { 1199 void dumpInnerHTML(blink::HTMLElement* element) {
1200 printf("%s\n", element->innerHTML().ascii().data()); 1200 printf("%s\n", element->innerHTML().ascii().data());
1201 } 1201 }
1202 #endif 1202 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698