Changeset 69509 in webkit


Ignore:
Timestamp:
Oct 11, 2010 11:12:33 AM (14 years ago)
Author:
rniwa@webkit.org
Message:

2010-10-11 Ryosuke Niwa <rniwa@webkit.org>

Reviewed by Darin Adler.

spellcheck="false" not respected in designMode
https://bugs.webkit.org/show_bug.cgi?id=39978

The bug was caused by WebKit's setting focus to html element rather than body element in design mode.
Because we disable spell-check only if ancestor nodes of the focused element had spellcheck=false,
this caused us to ignore body element's spellcheck attribute.

Fixed the bug by overriding supportsFocus in HTMLBodyElement to make body element focusable
when the parent node of body elements (namely html element) is editable.

Test: editing/spelling/design-mode-spellcheck-off.html

  • html/HTMLBodyElement.cpp: (WebCore::HTMLBodyElement::supportsFocus): Added.
  • html/HTMLBodyElement.h:

2010-10-11 Ryosuke Niwa <rniwa@webkit.org>

Reviewed by Darin Adler.

spellcheck="false" not respected in designMode
https://bugs.webkit.org/show_bug.cgi?id=39978

Added a test to ensure Webkit respects spellcheck=off on body element.
Rebaselined are due to our setting the focus to body element rather than html element in design mode.

  • editing/spelling/design-mode-spellcheck-off-expected.txt: Added.
  • editing/spelling/design-mode-spellcheck-off.html: Added.
  • editing/inserting/space-after-removeformat-expected.txt: Editing delegates change due to focus moving to body.
  • platform/chromium-win/editing/inserting/editable-html-element-expected.txt: Ditto.
  • platform/chromium-win/editing/selection/editable-html-element-expected.txt: Ditto.
  • platform/chromium-win/editing/selection/editable-links-expected.txt: Ditto.
  • platform/chromium-win/editing/selection/focus_editable_html-expected.txt: Ditto.
  • platform/chromium-win/editing/style/designmode-expected.txt: Ditto.
  • platform/mac/editing/inserting/editable-html-element-expected.txt: Ditto.
  • platform/mac/editing/selection/designmode-no-caret-expected.txt: Ditto.
  • platform/mac/editing/selection/editable-html-element-expected.txt: Ditto.
  • platform/mac/editing/selection/editable-links-expected.txt: Ditto.
  • platform/mac/editing/selection/focus_editable_html-expected.txt: Ditto.
  • platform/mac/editing/style/designmode-expected.txt: Ditto.
  • platform/qt/editing/inserting/editable-html-element-expected.txt: Ditto.
  • platform/qt/editing/selection/editable-html-element-expected.txt: Ditto.
  • platform/qt/editing/selection/focus_editable_html-expected.txt: Ditto.
  • platform/qt/editing/style/designmode-expected.txt: Ditto.
Location:
trunk
Files:
2 added
20 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r69495 r69509  
     12010-10-11  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        Reviewed by Darin Adler.
     4
     5        spellcheck="false" not respected in designMode
     6        https://bugs.webkit.org/show_bug.cgi?id=39978
     7
     8        Added a test to ensure Webkit respects spellcheck=off on body element.
     9        Rebaselined are due to our setting the focus to body element rather than html element in design mode.
     10
     11        * editing/spelling/design-mode-spellcheck-off-expected.txt: Added.
     12        * editing/spelling/design-mode-spellcheck-off.html: Added.
     13        * editing/inserting/space-after-removeformat-expected.txt: Editing delegates change due to focus moving to body.
     14        * platform/chromium-win/editing/inserting/editable-html-element-expected.txt: Ditto.
     15        * platform/chromium-win/editing/selection/editable-html-element-expected.txt: Ditto.
     16        * platform/chromium-win/editing/selection/editable-links-expected.txt: Ditto.
     17        * platform/chromium-win/editing/selection/focus_editable_html-expected.txt: Ditto.
     18        * platform/chromium-win/editing/style/designmode-expected.txt: Ditto.
     19        * platform/mac/editing/inserting/editable-html-element-expected.txt: Ditto.
     20        * platform/mac/editing/selection/designmode-no-caret-expected.txt: Ditto.
     21        * platform/mac/editing/selection/editable-html-element-expected.txt: Ditto.
     22        * platform/mac/editing/selection/editable-links-expected.txt: Ditto.
     23        * platform/mac/editing/selection/focus_editable_html-expected.txt: Ditto.
     24        * platform/mac/editing/style/designmode-expected.txt: Ditto.
     25        * platform/qt/editing/inserting/editable-html-element-expected.txt: Ditto.
     26        * platform/qt/editing/selection/editable-html-element-expected.txt: Ditto.
     27        * platform/qt/editing/selection/focus_editable_html-expected.txt: Ditto.
     28        * platform/qt/editing/style/designmode-expected.txt: Ditto.
     29
    1302010-10-11  Martin Robinson  <mrobinson@igalia.com>
    231
  • trunk/LayoutTests/editing/inserting/space-after-removeformat-expected.txt

    r45016 r69509  
    22EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    33EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of #text > DIV > BODY > HTML > #document to 10 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
    4 EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of HTML > #document to 2 of HTML > #document
     4EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of BODY > HTML > #document to 9 of BODY > HTML > #document
    55EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
    66EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
  • trunk/LayoutTests/platform/chromium-win/editing/inserting/editable-html-element-expected.txt

    r69456 r69509  
    1 EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of HTML > #document to 2 of HTML > #document
     1EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of BODY > HTML > #document to 1 of BODY > HTML > #document
    22EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
    33EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
  • trunk/LayoutTests/platform/chromium-win/editing/selection/editable-html-element-expected.txt

    r69456 r69509  
    22EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
    33EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of BODY > HTML > #document to 0 of BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
     4EDITING DELEGATE: shouldEndEditingInDOMRange:range from 0 of HTML > #document to 2 of HTML > #document
     5EDITING DELEGATE: webViewDidEndEditing:WebViewDidEndEditingNotification
     6EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of BODY > HTML > #document to 1 of BODY > HTML > #document
     7EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
    48EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    59EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of BODY > HTML > #document to 0 of BODY > HTML > #document toDOMRange:range from 1 of #text > SPAN > BODY > HTML > #document to 1 of #text > SPAN > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
  • trunk/LayoutTests/platform/chromium-win/editing/selection/editable-links-expected.txt

    r69456 r69509  
    1 EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of HTML > #document to 2 of HTML > #document
     1EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of BODY > HTML > #document to 5 of BODY > HTML > #document
    22EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
    33EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 6 of #text > A > BODY > HTML > #document to 6 of #text > A > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
  • trunk/LayoutTests/platform/chromium-win/editing/selection/focus_editable_html-expected.txt

    r69456 r69509  
    22EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
    33EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of BODY > HTML > #document to 0 of BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
     4EDITING DELEGATE: shouldEndEditingInDOMRange:range from 0 of HTML > #document to 2 of HTML > #document
     5EDITING DELEGATE: webViewDidEndEditing:WebViewDidEndEditingNotification
     6EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of BODY > HTML > #document to 9 of BODY > HTML > #document
     7EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
    48EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    59layer at (0,0) size 2008x2096
  • trunk/LayoutTests/platform/chromium-win/editing/style/designmode-expected.txt

    r69456 r69509  
    1 EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of HTML > #document to 2 of HTML > #document
     1EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of BODY > HTML > #document to 5 of BODY > HTML > #document
    22EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
    33EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
  • trunk/LayoutTests/platform/mac/editing/inserting/editable-html-element-expected.txt

    r63291 r69509  
    1 EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of HTML > #document to 2 of HTML > #document
     1EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of BODY > HTML > #document to 1 of BODY > HTML > #document
    22EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
    33EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
  • trunk/LayoutTests/platform/mac/editing/selection/designmode-no-caret-expected.txt

    r64712 r69509  
    1 EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of HTML > #document to 2 of HTML > #document
     1EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of BODY > HTML > #document to 4 of BODY > HTML > #document
    22EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
    33EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
  • trunk/LayoutTests/platform/mac/editing/selection/editable-html-element-expected.txt

    r63291 r69509  
    22EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
    33EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of BODY > HTML > #document to 0 of BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
     4EDITING DELEGATE: shouldEndEditingInDOMRange:range from 0 of HTML > #document to 2 of HTML > #document
     5EDITING DELEGATE: webViewDidEndEditing:WebViewDidEndEditingNotification
     6EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of BODY > HTML > #document to 1 of BODY > HTML > #document
     7EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
    48EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    59EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of BODY > HTML > #document to 0 of BODY > HTML > #document toDOMRange:range from 1 of #text > SPAN > BODY > HTML > #document to 1 of #text > SPAN > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
  • trunk/LayoutTests/platform/mac/editing/selection/editable-links-expected.txt

    r63291 r69509  
    1 EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of HTML > #document to 2 of HTML > #document
     1EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of BODY > HTML > #document to 5 of BODY > HTML > #document
    22EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
    33EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 6 of #text > A > BODY > HTML > #document to 6 of #text > A > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
  • trunk/LayoutTests/platform/mac/editing/selection/focus_editable_html-expected.txt

    r63403 r69509  
    22EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
    33EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of BODY > HTML > #document to 0 of BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
     4EDITING DELEGATE: shouldEndEditingInDOMRange:range from 0 of HTML > #document to 2 of HTML > #document
     5EDITING DELEGATE: webViewDidEndEditing:WebViewDidEndEditingNotification
     6EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of BODY > HTML > #document to 9 of BODY > HTML > #document
     7EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
    48EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    59layer at (0,0) size 2008x2088
  • trunk/LayoutTests/platform/mac/editing/style/designmode-expected.txt

    r63291 r69509  
    1 EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of HTML > #document to 2 of HTML > #document
     1EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of BODY > HTML > #document to 5 of BODY > HTML > #document
    22EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
    33EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
  • trunk/LayoutTests/platform/qt/editing/inserting/editable-html-element-expected.txt

    r69456 r69509  
    1 EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of HTML > #document to 2 of HTML > #document
     1EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of BODY > HTML > #document to 1 of BODY > HTML > #document
    22EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
    33EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
  • trunk/LayoutTests/platform/qt/editing/selection/editable-html-element-expected.txt

    r69456 r69509  
    22EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
    33EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of BODY > HTML > #document to 0 of BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
     4EDITING DELEGATE: shouldEndEditingInDOMRange:range from 0 of HTML > #document to 2 of HTML > #document
     5EDITING DELEGATE: webViewDidEndEditing:WebViewDidEndEditingNotification
     6EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of BODY > HTML > #document to 1 of BODY > HTML > #document
     7EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
    48EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    59EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of BODY > HTML > #document to 0 of BODY > HTML > #document toDOMRange:range from 1 of #text > SPAN > BODY > HTML > #document to 1 of #text > SPAN > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
  • trunk/LayoutTests/platform/qt/editing/selection/focus_editable_html-expected.txt

    r69456 r69509  
    22EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
    33EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of BODY > HTML > #document to 0 of BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
     4EDITING DELEGATE: shouldEndEditingInDOMRange:range from 0 of HTML > #document to 2 of HTML > #document
     5EDITING DELEGATE: webViewDidEndEditing:WebViewDidEndEditingNotification
     6EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of BODY > HTML > #document to 9 of BODY > HTML > #document
     7EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
    48EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    59layer at (0,0) size 2008x2093
  • trunk/LayoutTests/platform/qt/editing/style/designmode-expected.txt

    r69456 r69509  
    1 EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of HTML > #document to 2 of HTML > #document
     1EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of BODY > HTML > #document to 5 of BODY > HTML > #document
    22EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
    33EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
  • trunk/WebCore/ChangeLog

    r69507 r69509  
     12010-10-11  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        Reviewed by Darin Adler.
     4
     5        spellcheck="false" not respected in designMode
     6        https://bugs.webkit.org/show_bug.cgi?id=39978
     7
     8        The bug was caused by WebKit's setting focus to html element rather than body element in design mode.
     9        Because we disable spell-check only if ancestor nodes of the focused element had spellcheck=false,
     10        this caused us to ignore body element's spellcheck attribute.
     11
     12        Fixed the bug by overriding supportsFocus in HTMLBodyElement to make body element focusable
     13        when the parent node of body elements (namely html element) is editable.
     14
     15        Test: editing/spelling/design-mode-spellcheck-off.html
     16
     17        * html/HTMLBodyElement.cpp:
     18        (WebCore::HTMLBodyElement::supportsFocus): Added.
     19        * html/HTMLBodyElement.h:
     20
    1212010-10-11  Oliver Hunt  <oliver@apple.com>
    222
  • trunk/WebCore/html/HTMLBodyElement.cpp

    r69009 r69509  
    207207}
    208208
     209bool HTMLBodyElement::supportsFocus() const
     210{
     211    return isContentEditable() || HTMLElement::supportsFocus();
     212}
     213
    209214String HTMLBodyElement::aLink() const
    210215{
  • trunk/WebCore/html/HTMLBodyElement.h

    r66057 r69509  
    7878   
    7979    virtual bool isURLAttribute(Attribute*) const;
     80   
     81    virtual bool supportsFocus() const;
    8082
    8183    virtual int scrollLeft() const;
Note: See TracChangeset for help on using the changeset viewer.