Changeset 70513 in webkit


Ignore:
Timestamp:
Oct 26, 2010 1:27:23 AM (14 years ago)
Author:
morrita@google.com
Message:

2010-10-26 Sheriff Bot <webkit.review.bot@gmail.com>

Unreviewed, rolling out r70512.
http://trac.webkit.org/changeset/70512
https://bugs.webkit.org/show_bug.cgi?id=48314

crashes many tests (Requested by inferno-sec on #webkit).

  • editing/spelling/spellcheck-attribute-expected.txt:
  • editing/spelling/spellcheck-attribute.html:

2010-10-26 Sheriff Bot <webkit.review.bot@gmail.com>

Unreviewed, rolling out r70512.
http://trac.webkit.org/changeset/70512
https://bugs.webkit.org/show_bug.cgi?id=48314

crashes many tests (Requested by inferno-sec on #webkit).

  • dom/Element.cpp:
  • dom/Element.h:
  • editing/Editor.cpp: (WebCore::markMisspellingsOrBadGrammar): (WebCore::Editor::spellCheckingEnabledInFocusedNode): (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges):
  • editing/Editor.h:
  • platform/ContextMenu.cpp: (WebCore::ContextMenu::populate):

2010-10-26 Sheriff Bot <webkit.review.bot@gmail.com>

Unreviewed, rolling out r70512.
http://trac.webkit.org/changeset/70512
https://bugs.webkit.org/show_bug.cgi?id=48314

crashes many tests (Requested by inferno-sec on #webkit).

  • src/ContextMenuClientImpl.cpp: (WebKit::ContextMenuClientImpl::getCustomMenuFromDefaultItems):
  • src/EditorClientImpl.cpp: (WebKit::EditorClientImpl::shouldSpellcheckByDefault):
Location:
trunk
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r70512 r70513  
     12010-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
    1122010-10-22  MORITA Hajime <morrita@google.com>
    213
  • trunk/LayoutTests/editing/spelling/spellcheck-attribute-expected.txt

    r70512 r70513  
    44PASS:test1_2
    55PASS:test1_3
    6 PASS:test1_4
    7 PASS:test1_5
    8 PASS:test1_6
    96PASS:test2_1
    107PASS:test2_2
    118PASS:test2_3
    12 PASS:test2_4
    13 PASS:test2_5
    14 PASS:test2_6
    159
  • trunk/LayoutTests/editing/spelling/spellcheck-attribute.html

    r70512 r70513  
    1111<label>1.2.</label><input id="test1_2" type="text" spellcheck="true"></input><br/>
    1212<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/>
    1613</div>
    1714<div spellcheck="false">
     
    1916<label>2.2.</label><input id="test2_2" type="text" spellcheck="true"></input><br/>
    2017<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/>
    2418</div>
    2519</div>
     
    4438testTypingInvalidWord('test1_2', true);
    4539testTypingInvalidWord('test1_3', false);
    46 testTypingInvalidWord('test1_4', true);
    47 testTypingInvalidWord('test1_5', true);
    48 testTypingInvalidWord('test1_6', true);
    4940testTypingInvalidWord('test2_1', false);
    5041testTypingInvalidWord('test2_2', true);
    5142testTypingInvalidWord('test2_3', false);
    52 testTypingInvalidWord('test2_4', false);
    53 testTypingInvalidWord('test2_5', true);
    54 testTypingInvalidWord('test2_6', false);
    5543
    5644if (window.layoutTestController) {
  • trunk/WebCore/ChangeLog

    r70512 r70513  
     12010-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
    1192010-10-24  MORITA Hajime  <morrita@google.com>
    220
  • trunk/WebCore/dom/Element.cpp

    r70512 r70513  
    17091709#endif   
    17101710
    1711 SpellcheckAttributeState Element::spellcheckAttributeState() const
    1712 {
    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() const
    1726 {
    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 
    17441711} // namespace WebCore
  • trunk/WebCore/dom/Element.h

    r70512 r70513  
    4040class ElementRareData;
    4141class IntSize;
    42 
    43 enum SpellcheckAttributeState {
    44     SpellcheckAttributeTrue,
    45     SpellcheckAttributeFalse,
    46     SpellcheckAttributeDefault
    47 };
    4842
    4943class Element : public ContainerNode {
     
    327321#endif
    328322
    329     bool isSpellCheckingEnabled() const;
    330 
    331323protected:
    332324    Element(const QualifiedName& tagName, Document* document, ConstructionType type)
     
    384376    ElementRareData* rareData() const;
    385377    ElementRareData* ensureRareData();
    386 
    387     SpellcheckAttributeState spellcheckAttributeState() const;
    388 
     378   
    389379private:
    390380    mutable RefPtr<NamedNodeMap> m_attributeMap;
  • trunk/WebCore/editing/Editor.cpp

    r70512 r70513  
    25252525        return;
    25262526
    2527     if (!editor->isSpellCheckingEnabledInFocusedNode())
     2527    if (!editor->spellCheckingEnabledInFocusedNode())
    25282528        return;
    25292529
     
    25442544}
    25452545
    2546 bool Editor::isSpellCheckingEnabledInFocusedNode() const
     2546bool Editor::spellCheckingEnabledInFocusedNode() const
    25472547{
    25482548    // Ascend the DOM tree to find a "spellcheck" attribute.
    25492549    // When we find a "spellcheck" attribute, retrieve its value and return false if its value is "false".
    25502550    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;
    25552562}
    25562563
     
    25972604        return;
    25982605
    2599     if (!isSpellCheckingEnabledInFocusedNode())
     2606    if (!spellCheckingEnabledInFocusedNode())
    26002607        return;
    26012608
  • trunk/WebCore/editing/Editor.h

    r70512 r70513  
    208208    Vector<String> guessesForUngrammaticalSelection();
    209209    Vector<String> guessesForMisspelledOrUngrammaticalSelection(bool& misspelled, bool& ungrammatical);
    210     bool isSpellCheckingEnabledInFocusedNode() const;
     210    bool spellCheckingEnabledInFocusedNode() const;
    211211    void markMisspellingsAfterTypingToPosition(const VisiblePosition&);
    212212    void markMisspellings(const VisibleSelection&, RefPtr<Range>& firstMisspellingRange);
  • trunk/WebCore/platform/ContextMenu.cpp

    r70512 r70513  
    429429        SelectionController* selection = frame->selection();
    430430        bool inPasswordField = selection->isInPasswordField();
    431         bool spellCheckingEnabled = frame->editor()->isSpellCheckingEnabledInFocusedNode();
     431        bool spellCheckingEnabled = frame->editor()->spellCheckingEnabledInFocusedNode();
    432432       
    433433        if (!inPasswordField && spellCheckingEnabled) {
  • trunk/WebKit/chromium/ChangeLog

    r70512 r70513  
     12010-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
    1142010-10-25  MORITA Hajime  <morrita@google.com>
    215
  • trunk/WebKit/chromium/src/ContextMenuClientImpl.cpp

    r70512 r70513  
    242242            data.isSpellCheckingEnabled = true;
    243243            // 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())
    245245                data.misspelledWord = selectMisspelledWord(defaultMenu, selectedFrame);
    246246        }
  • trunk/WebKit/chromium/src/EditorClientImpl.cpp

    r70512 r70513  
    125125    if (!editor)
    126126        return false;
    127     if (editor->isSpellCheckingEnabledInFocusedNode())
     127    if (editor->spellCheckingEnabledInFocusedNode())
    128128        return true;
    129129    const Document* document = frame->document();
Note: See TracChangeset for help on using the changeset viewer.