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

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

Issue 419023007: Autocomplete confused about direction if inline style and inherited dir attribute are mixed (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 4 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
« no previous file with comments | « no previous file | 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 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved.
6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) 6 * (C) 2006 Alexey Proskuryakov (ap@nypop.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 13 matching lines...) Expand all
24 24
25 #include "config.h" 25 #include "config.h"
26 #include "core/html/HTMLTextFormControlElement.h" 26 #include "core/html/HTMLTextFormControlElement.h"
27 27
28 #include "bindings/core/v8/ExceptionState.h" 28 #include "bindings/core/v8/ExceptionState.h"
29 #include "bindings/core/v8/ExceptionStatePlaceholder.h" 29 #include "bindings/core/v8/ExceptionStatePlaceholder.h"
30 #include "core/HTMLNames.h" 30 #include "core/HTMLNames.h"
31 #include "core/accessibility/AXObjectCache.h" 31 #include "core/accessibility/AXObjectCache.h"
32 #include "core/dom/Document.h" 32 #include "core/dom/Document.h"
33 #include "core/dom/NodeList.h" 33 #include "core/dom/NodeList.h"
34 #include "core/dom/NodeRenderStyle.h"
34 #include "core/dom/NodeTraversal.h" 35 #include "core/dom/NodeTraversal.h"
35 #include "core/dom/Text.h" 36 #include "core/dom/Text.h"
36 #include "core/dom/shadow/ShadowRoot.h" 37 #include "core/dom/shadow/ShadowRoot.h"
37 #include "core/editing/Editor.h" 38 #include "core/editing/Editor.h"
38 #include "core/editing/FrameSelection.h" 39 #include "core/editing/FrameSelection.h"
39 #include "core/editing/TextIterator.h" 40 #include "core/editing/TextIterator.h"
40 #include "core/events/Event.h" 41 #include "core/events/Event.h"
41 #include "core/frame/LocalFrame.h" 42 #include "core/frame/LocalFrame.h"
42 #include "core/frame/UseCounter.h" 43 #include "core/frame/UseCounter.h"
43 #include "core/html/HTMLBRElement.h" 44 #include "core/html/HTMLBRElement.h"
(...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after
649 element = element->parentElement(); 650 element = element->parentElement();
650 if (element && element->isHTMLElement()) 651 if (element && element->isHTMLElement())
651 return toHTMLElement(element); 652 return toHTMLElement(element);
652 } 653 }
653 return 0; 654 return 0;
654 } 655 }
655 656
656 String HTMLTextFormControlElement::directionForFormData() const 657 String HTMLTextFormControlElement::directionForFormData() const
657 { 658 {
658 for (const HTMLElement* element = this; element; element = parentHTMLElement (element)) { 659 for (const HTMLElement* element = this; element; element = parentHTMLElement (element)) {
659 const AtomicString& dirAttributeValue = element->fastGetAttribute(dirAtt r); 660 RenderStyle* style = element->renderStyle();
660 if (dirAttributeValue.isNull()) 661 if (style) {
Inactive 2014/08/06 20:51:43 I cannot say if the change is good or not. However
Sunil Ratnu 2014/08/07 05:20:56 Done.
661 continue; 662 return style->isLeftToRightDirection() ? "ltr" : "rtl";
662
663 if (equalIgnoringCase(dirAttributeValue, "rtl") || equalIgnoringCase(dir AttributeValue, "ltr"))
664 return dirAttributeValue;
665
666 if (equalIgnoringCase(dirAttributeValue, "auto")) {
667 bool isAuto;
668 TextDirection textDirection = element->directionalityIfhasDirAutoAtt ribute(isAuto);
669 return textDirection == RTL ? "rtl" : "ltr";
670 } 663 }
671 } 664 }
672 665
673 return "ltr"; 666 return "ltr";
674 } 667 }
675 668
676 HTMLElement* HTMLTextFormControlElement::innerEditorElement() const 669 HTMLElement* HTMLTextFormControlElement::innerEditorElement() const
677 { 670 {
678 return toHTMLElement(userAgentShadowRoot()->getElementById(ShadowElementName s::innerEditor())); 671 return toHTMLElement(userAgentShadowRoot()->getElementById(ShadowElementName s::innerEditor()));
679 } 672 }
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
911 Text* textNode = toText(node); 904 Text* textNode = toText(node);
912 size_t firstLineBreak = textNode->data().find('\n', isPivotNode ? pi votPosition.offsetInContainerNode() : 0); 905 size_t firstLineBreak = textNode->data().find('\n', isPivotNode ? pi votPosition.offsetInContainerNode() : 0);
913 if (firstLineBreak != kNotFound) 906 if (firstLineBreak != kNotFound)
914 return Position(textNode, firstLineBreak + 1); 907 return Position(textNode, firstLineBreak + 1);
915 } 908 }
916 } 909 }
917 return endOfInnerText(textFormControl); 910 return endOfInnerText(textFormControl);
918 } 911 }
919 912
920 } // namespace Webcore 913 } // namespace Webcore
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698