Changeset 71101 in webkit
- Timestamp:
- Nov 1, 2010 10:30:42 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r71100 r71101 1 2010-11-01 MORITA Hajime <morrita@google.com> 2 3 Reviewed by Kent Tamura. 4 5 @spellcheck attribute at the child of contentEditable node is ignored. 6 https://bugs.webkit.org/show_bug.cgi?id=48418 7 8 * editing/spelling/script-tests/spelling-attribute-at-child.js: Added. 9 * editing/spelling/spelling-attribute-at-child-expected.txt: Added. 10 * editing/spelling/spelling-attribute-at-child.html: Added. 11 1 12 2010-11-01 Adam Barth <abarth@webkit.org> 2 13 -
trunk/WebCore/ChangeLog
r71099 r71101 1 2010-11-01 MORITA Hajime <morrita@google.com> 2 3 Reviewed by Kent Tamura. 4 5 @spellcheck attribute at the child of contentEditable node is ignored. 6 https://bugs.webkit.org/show_bug.cgi?id=48418 7 8 Changed to check spellcheck availability against a node under the 9 selection (caret) instead of the focus. For shadow elements, the 10 check now refers its host node. Note that the original code didn't 11 care shadows because focus is never set on them. 12 13 Test: editing/spelling/spelling-attribute-at-child.html 14 15 * dom/Element.h: 16 * editing/Editor.cpp: 17 (WebCore::Editor::markMisspellingsOrBadGrammar): 18 (WebCore::Editor::isSpellCheckingEnabledFor): 19 (WebCore::Editor::isSpellCheckingEnabledInFocusedNode): Now just calling isSpellCheckingEnabledFor() 20 (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges): 21 * editing/Editor.h: 22 * platform/ContextMenu.cpp: 23 (WebCore::ContextMenu::populate): 24 * rendering/TextControlInnerElements.cpp: 25 (WebCore::TextControlInnerElement::isSpellCheckingEnabled): Added. 26 * rendering/TextControlInnerElements.h: 27 1 28 2010-11-01 Martin Robinson <mrobinson@igalia.com> 2 29 -
trunk/WebCore/dom/Element.h
r70598 r71101 327 327 #endif 328 328 329 bool isSpellCheckingEnabled() const;329 virtual bool isSpellCheckingEnabled() const; 330 330 331 331 protected: -
trunk/WebCore/editing/Editor.cpp
r71009 r71101 2096 2096 return; 2097 2097 2098 if (!isSpellCheckingEnabled InFocusedNode())2098 if (!isSpellCheckingEnabledFor(editableNode)) 2099 2099 return; 2100 2100 … … 2116 2116 } 2117 2117 2118 bool Editor::isSpellCheckingEnabledInFocusedNode() const 2119 { 2120 // Ascend the DOM tree to find a "spellcheck" attribute. 2121 // When we find a "spellcheck" attribute, retrieve its value and return false if its value is "false". 2122 const Node* node = frame()->document()->focusedNode(); 2118 bool Editor::isSpellCheckingEnabledFor(Node* node) const 2119 { 2123 2120 if (!node) 2124 2121 return false; … … 2127 2124 return false; 2128 2125 return focusedElement->isSpellCheckingEnabled(); 2126 } 2127 2128 bool Editor::isSpellCheckingEnabledInFocusedNode() const 2129 { 2130 return isSpellCheckingEnabledFor(m_frame->selection()->start().node()); 2129 2131 } 2130 2132 … … 2171 2173 return; 2172 2174 2173 if (!isSpellCheckingEnabled InFocusedNode())2175 if (!isSpellCheckingEnabledFor(editableNode)) 2174 2176 return; 2175 2177 -
trunk/WebCore/editing/Editor.h
r71009 r71101 220 220 Vector<String> guessesForMisspelledOrUngrammaticalSelection(bool& misspelled, bool& ungrammatical); 221 221 bool isSpellCheckingEnabledInFocusedNode() const; 222 bool isSpellCheckingEnabledFor(Node*) const; 222 223 void markMisspellingsAfterTypingToPosition(const VisiblePosition&); 223 224 void markMisspellings(const VisibleSelection&, RefPtr<Range>& firstMisspellingRange); -
trunk/WebCore/platform/ContextMenu.cpp
r70963 r71101 430 430 SelectionController* selection = frame->selection(); 431 431 bool inPasswordField = selection->isInPasswordField(); 432 bool spellCheckingEnabled = frame->editor()->isSpellCheckingEnabled InFocusedNode();432 bool spellCheckingEnabled = frame->editor()->isSpellCheckingEnabledFor(node); 433 433 434 434 if (!inPasswordField && spellCheckingEnabled) { -
trunk/WebCore/rendering/TextControlInnerElements.cpp
r70863 r71101 125 125 } 126 126 127 bool TextControlInnerElement::isSpellCheckingEnabled() const 128 { 129 return m_shadowParent && m_shadowParent->isSpellCheckingEnabled(); 130 } 131 127 132 // ---------------------------- 128 133 -
trunk/WebCore/rendering/TextControlInnerElements.h
r70490 r71101 50 50 virtual bool isShadowNode() const { return m_shadowParent; } 51 51 virtual ContainerNode* shadowParentNode() { return m_shadowParent; } 52 virtual bool isSpellCheckingEnabled() const; 52 53 void setShadowParentNode(HTMLElement* shadowParent) { m_shadowParent = shadowParent; } 53 54
Note: See TracChangeset
for help on using the changeset viewer.