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

Side by Side Diff: third_party/WebKit/Source/web/WebElement.cpp

Issue 2121313003: [Editing][DOM][CodeHealth] Make Node::isContentEditable and Node::isRichEditable global functions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 5 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 { 54 {
55 return constUnwrap<Element>()->isTextFormControl(); 55 return constUnwrap<Element>()->isTextFormControl();
56 } 56 }
57 57
58 // TODO(dglazkov): Remove. Consumers of this code should use Node:hasEditableSty le. 58 // TODO(dglazkov): Remove. Consumers of this code should use Node:hasEditableSty le.
59 // http://crbug.com/612560 59 // http://crbug.com/612560
60 bool WebElement::isEditable() const 60 bool WebElement::isEditable() const
61 { 61 {
62 const Element* element = constUnwrap<Element>(); 62 const Element* element = constUnwrap<Element>();
63 63
64 if (element->isContentEditable()) 64 if (blink::isContentEditable(*element))
65 return true; 65 return true;
66 66
67 if (element->isTextFormControl()) { 67 if (element->isTextFormControl()) {
68 const HTMLTextFormControlElement* input = toHTMLTextFormControlElement(e lement); 68 const HTMLTextFormControlElement* input = toHTMLTextFormControlElement(e lement);
69 if (!input->isDisabledOrReadOnly()) 69 if (!input->isDisabledOrReadOnly())
70 return true; 70 return true;
71 } 71 }
72 72
73 return equalIgnoringCase(element->getAttribute(roleAttr), "textbox"); 73 return equalIgnoringCase(element->getAttribute(roleAttr), "textbox");
74 } 74 }
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 m_private = elem; 163 m_private = elem;
164 return *this; 164 return *this;
165 } 165 }
166 166
167 WebElement::operator Element*() const 167 WebElement::operator Element*() const
168 { 168 {
169 return toElement(m_private.get()); 169 return toElement(m_private.get());
170 } 170 }
171 171
172 } // namespace blink 172 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698