Changeset 70513 in webkit
- Timestamp:
- Oct 26, 2010 1:27:23 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r70512 r70513 1 2010-10-26 Sheriff Bot <webkit.review.bot@gmail.com> 2 3 Unreviewed, rolling out r70512. 4 http://trac.webkit.org/changeset/70512 5 https://bugs.webkit.org/show_bug.cgi?id=48314 6 7 crashes many tests (Requested by inferno-sec on #webkit). 8 9 * editing/spelling/spellcheck-attribute-expected.txt: 10 * editing/spelling/spellcheck-attribute.html: 11 1 12 2010-10-22 MORITA Hajime <morrita@google.com> 2 13 -
trunk/LayoutTests/editing/spelling/spellcheck-attribute-expected.txt
r70512 r70513 4 4 PASS:test1_2 5 5 PASS:test1_3 6 PASS:test1_47 PASS:test1_58 PASS:test1_69 6 PASS:test2_1 10 7 PASS:test2_2 11 8 PASS:test2_3 12 PASS:test2_413 PASS:test2_514 PASS:test2_615 9 -
trunk/LayoutTests/editing/spelling/spellcheck-attribute.html
r70512 r70513 11 11 <label>1.2.</label><input id="test1_2" type="text" spellcheck="true"></input><br/> 12 12 <label>1.3.</label><input id="test1_3" type="text" spellcheck="false"></input><br/> 13 <label>1.4.</label><input id="test1_4" type="text" spellcheck="InvalidValue"></input><br/>14 <label>1.5.</label><input id="test1_5" type="text" spellcheck></input><br/>15 <label>1.6.</label><input id="test1_6" type="text"></input><br/>16 13 </div> 17 14 <div spellcheck="false"> … … 19 16 <label>2.2.</label><input id="test2_2" type="text" spellcheck="true"></input><br/> 20 17 <label>2.3.</label><input id="test2_3" type="text" spellcheck="false"></input><br/> 21 <label>2.4.</label><input id="test2_4" type="text" spellcheck="InvalidValue"></input><br/>22 <label>2.5.</label><input id="test2_5" type="text" spellcheck></input><br/>23 <label>2.6.</label><input id="test2_6" type="text"></input><br/>24 18 </div> 25 19 </div> … … 44 38 testTypingInvalidWord('test1_2', true); 45 39 testTypingInvalidWord('test1_3', false); 46 testTypingInvalidWord('test1_4', true);47 testTypingInvalidWord('test1_5', true);48 testTypingInvalidWord('test1_6', true);49 40 testTypingInvalidWord('test2_1', false); 50 41 testTypingInvalidWord('test2_2', true); 51 42 testTypingInvalidWord('test2_3', false); 52 testTypingInvalidWord('test2_4', false);53 testTypingInvalidWord('test2_5', true);54 testTypingInvalidWord('test2_6', false);55 43 56 44 if (window.layoutTestController) { -
trunk/WebCore/ChangeLog
r70512 r70513 1 2010-10-26 Sheriff Bot <webkit.review.bot@gmail.com> 2 3 Unreviewed, rolling out r70512. 4 http://trac.webkit.org/changeset/70512 5 https://bugs.webkit.org/show_bug.cgi?id=48314 6 7 crashes many tests (Requested by inferno-sec on #webkit). 8 9 * dom/Element.cpp: 10 * dom/Element.h: 11 * editing/Editor.cpp: 12 (WebCore::markMisspellingsOrBadGrammar): 13 (WebCore::Editor::spellCheckingEnabledInFocusedNode): 14 (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges): 15 * editing/Editor.h: 16 * platform/ContextMenu.cpp: 17 (WebCore::ContextMenu::populate): 18 1 19 2010-10-24 MORITA Hajime <morrita@google.com> 2 20 -
trunk/WebCore/dom/Element.cpp
r70512 r70513 1709 1709 #endif 1710 1710 1711 SpellcheckAttributeState Element::spellcheckAttributeState() const1712 {1713 if (!hasAttribute(HTMLNames::spellcheckAttr))1714 return SpellcheckAttributeDefault;1715 1716 const AtomicString& value = getAttribute(HTMLNames::spellcheckAttr);1717 if (equalIgnoringCase(value, "true") || equalIgnoringCase(value, ""))1718 return SpellcheckAttributeTrue;1719 if (equalIgnoringCase(value, "false"))1720 return SpellcheckAttributeFalse;1721 1722 return SpellcheckAttributeDefault;1723 }1724 1725 bool Element::isSpellCheckingEnabled() const1726 {1727 const Element* element = this;1728 while (element) {1729 switch (element->spellcheckAttributeState()) {1730 case SpellcheckAttributeTrue:1731 return true;1732 case SpellcheckAttributeFalse:1733 return false;1734 case SpellcheckAttributeDefault:1735 break;1736 }1737 1738 element = element->parentElement();1739 }1740 1741 return true;1742 }1743 1744 1711 } // namespace WebCore -
trunk/WebCore/dom/Element.h
r70512 r70513 40 40 class ElementRareData; 41 41 class IntSize; 42 43 enum SpellcheckAttributeState {44 SpellcheckAttributeTrue,45 SpellcheckAttributeFalse,46 SpellcheckAttributeDefault47 };48 42 49 43 class Element : public ContainerNode { … … 327 321 #endif 328 322 329 bool isSpellCheckingEnabled() const;330 331 323 protected: 332 324 Element(const QualifiedName& tagName, Document* document, ConstructionType type) … … 384 376 ElementRareData* rareData() const; 385 377 ElementRareData* ensureRareData(); 386 387 SpellcheckAttributeState spellcheckAttributeState() const; 388 378 389 379 private: 390 380 mutable RefPtr<NamedNodeMap> m_attributeMap; -
trunk/WebCore/editing/Editor.cpp
r70512 r70513 2525 2525 return; 2526 2526 2527 if (!editor-> isSpellCheckingEnabledInFocusedNode())2527 if (!editor->spellCheckingEnabledInFocusedNode()) 2528 2528 return; 2529 2529 … … 2544 2544 } 2545 2545 2546 bool Editor:: isSpellCheckingEnabledInFocusedNode() const2546 bool Editor::spellCheckingEnabledInFocusedNode() const 2547 2547 { 2548 2548 // Ascend the DOM tree to find a "spellcheck" attribute. 2549 2549 // When we find a "spellcheck" attribute, retrieve its value and return false if its value is "false". 2550 2550 const Node* node = frame()->document()->focusedNode(); 2551 const Element* focusedElement = node->isElementNode() ? toElement(node) : node->parentElement(); 2552 if (!focusedElement) 2553 return false; 2554 return focusedElement->isSpellCheckingEnabled(); 2551 while (node) { 2552 if (node->isElementNode()) { 2553 const WTF::AtomicString& value = static_cast<const Element*>(node)->getAttribute(spellcheckAttr); 2554 if (equalIgnoringCase(value, "true")) 2555 return true; 2556 if (equalIgnoringCase(value, "false")) 2557 return false; 2558 } 2559 node = node->parent(); 2560 } 2561 return true; 2555 2562 } 2556 2563 … … 2597 2604 return; 2598 2605 2599 if (! isSpellCheckingEnabledInFocusedNode())2606 if (!spellCheckingEnabledInFocusedNode()) 2600 2607 return; 2601 2608 -
trunk/WebCore/editing/Editor.h
r70512 r70513 208 208 Vector<String> guessesForUngrammaticalSelection(); 209 209 Vector<String> guessesForMisspelledOrUngrammaticalSelection(bool& misspelled, bool& ungrammatical); 210 bool isSpellCheckingEnabledInFocusedNode() const;210 bool spellCheckingEnabledInFocusedNode() const; 211 211 void markMisspellingsAfterTypingToPosition(const VisiblePosition&); 212 212 void markMisspellings(const VisibleSelection&, RefPtr<Range>& firstMisspellingRange); -
trunk/WebCore/platform/ContextMenu.cpp
r70512 r70513 429 429 SelectionController* selection = frame->selection(); 430 430 bool inPasswordField = selection->isInPasswordField(); 431 bool spellCheckingEnabled = frame->editor()-> isSpellCheckingEnabledInFocusedNode();431 bool spellCheckingEnabled = frame->editor()->spellCheckingEnabledInFocusedNode(); 432 432 433 433 if (!inPasswordField && spellCheckingEnabled) { -
trunk/WebKit/chromium/ChangeLog
r70512 r70513 1 2010-10-26 Sheriff Bot <webkit.review.bot@gmail.com> 2 3 Unreviewed, rolling out r70512. 4 http://trac.webkit.org/changeset/70512 5 https://bugs.webkit.org/show_bug.cgi?id=48314 6 7 crashes many tests (Requested by inferno-sec on #webkit). 8 9 * src/ContextMenuClientImpl.cpp: 10 (WebKit::ContextMenuClientImpl::getCustomMenuFromDefaultItems): 11 * src/EditorClientImpl.cpp: 12 (WebKit::EditorClientImpl::shouldSpellcheckByDefault): 13 1 14 2010-10-25 MORITA Hajime <morrita@google.com> 2 15 -
trunk/WebKit/chromium/src/ContextMenuClientImpl.cpp
r70512 r70513 242 242 data.isSpellCheckingEnabled = true; 243 243 // Spellchecking might be enabled for the field, but could be disabled on the node. 244 if (m_webView->focusedWebCoreFrame()->editor()-> isSpellCheckingEnabledInFocusedNode())244 if (m_webView->focusedWebCoreFrame()->editor()->spellCheckingEnabledInFocusedNode()) 245 245 data.misspelledWord = selectMisspelledWord(defaultMenu, selectedFrame); 246 246 } -
trunk/WebKit/chromium/src/EditorClientImpl.cpp
r70512 r70513 125 125 if (!editor) 126 126 return false; 127 if (editor-> isSpellCheckingEnabledInFocusedNode())127 if (editor->spellCheckingEnabledInFocusedNode()) 128 128 return true; 129 129 const Document* document = frame->document();
Note: See TracChangeset
for help on using the changeset viewer.