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

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: Incorporated review comments 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 | « Source/core/html/HTMLTextFormControlElement.h ('k') | Source/web/WebFormControlElement.cpp » ('j') | 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/editing/htmlediting.h" 41 #include "core/editing/htmlediting.h"
41 #include "core/events/Event.h" 42 #include "core/events/Event.h"
42 #include "core/frame/LocalFrame.h" 43 #include "core/frame/LocalFrame.h"
43 #include "core/frame/UseCounter.h" 44 #include "core/frame/UseCounter.h"
(...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after
723 if (equalIgnoringCase(dirAttributeValue, "auto")) { 724 if (equalIgnoringCase(dirAttributeValue, "auto")) {
724 bool isAuto; 725 bool isAuto;
725 TextDirection textDirection = element->directionalityIfhasDirAutoAtt ribute(isAuto); 726 TextDirection textDirection = element->directionalityIfhasDirAutoAtt ribute(isAuto);
726 return textDirection == RTL ? "rtl" : "ltr"; 727 return textDirection == RTL ? "rtl" : "ltr";
727 } 728 }
728 } 729 }
729 730
730 return "ltr"; 731 return "ltr";
731 } 732 }
732 733
734 String HTMLTextFormControlElement::directionForAutocomplete() const
tkent 2014/08/07 05:25:02 You don't need to add new function. Please replace
Sunil Ratnu 2014/08/07 07:06:18 Done.
735 {
736 if (const HTMLElement* element = this) {
tkent 2014/08/07 05:25:02 |this| must not be null.
Sunil Ratnu 2014/08/07 07:06:18 |this| can not be NULL here. What i understood it
tkent 2014/08/07 07:13:46 Right. The check is unnecessary.
737 if (RenderStyle* style = element->renderStyle())
738 return style->isLeftToRightDirection() ? "ltr" : "rtl";
739 }
740 return "ltr";
741 }
742
733 HTMLElement* HTMLTextFormControlElement::innerEditorElement() const 743 HTMLElement* HTMLTextFormControlElement::innerEditorElement() const
734 { 744 {
735 return toHTMLElement(userAgentShadowRoot()->getElementById(ShadowElementName s::innerEditor())); 745 return toHTMLElement(userAgentShadowRoot()->getElementById(ShadowElementName s::innerEditor()));
736 } 746 }
737 747
738 static Position innerNodePosition(const Position& innerPosition) 748 static Position innerNodePosition(const Position& innerPosition)
739 { 749 {
740 ASSERT(innerPosition.anchorType() != Position::PositionIsBeforeAnchor); 750 ASSERT(innerPosition.anchorType() != Position::PositionIsBeforeAnchor);
741 ASSERT(innerPosition.anchorType() != Position::PositionIsAfterAnchor); 751 ASSERT(innerPosition.anchorType() != Position::PositionIsAfterAnchor);
742 HTMLElement* element = toHTMLElement(innerPosition.anchorNode()); 752 HTMLElement* element = toHTMLElement(innerPosition.anchorNode());
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
968 Text* textNode = toText(node); 978 Text* textNode = toText(node);
969 size_t firstLineBreak = textNode->data().find('\n', isPivotNode ? pi votPosition.offsetInContainerNode() : 0); 979 size_t firstLineBreak = textNode->data().find('\n', isPivotNode ? pi votPosition.offsetInContainerNode() : 0);
970 if (firstLineBreak != kNotFound) 980 if (firstLineBreak != kNotFound)
971 return Position(textNode, firstLineBreak + 1); 981 return Position(textNode, firstLineBreak + 1);
972 } 982 }
973 } 983 }
974 return endOfInnerText(textFormControl); 984 return endOfInnerText(textFormControl);
975 } 985 }
976 986
977 } // namespace Webcore 987 } // namespace Webcore
OLDNEW
« no previous file with comments | « Source/core/html/HTMLTextFormControlElement.h ('k') | Source/web/WebFormControlElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698