RESOLVED FIXED 56505
Add a test for r81266 and fix HTML Editing for fallback contents in object element
https://bugs.webkit.org/show_bug.cgi?id=56505
Summary Add a test for r81266 and fix HTML Editing for fallback contents in object el...
Ryosuke Niwa
Reported 2011-03-16 16:59:38 PDT
As a regression fix, http://trac.webkit.org/changeset/81266 partially fixed a bug in canHaveChildrenForEditing that WebKit used to ignore contents inside hr and datagrid elements even if those elements had child nodes. We should also fix a bug that it returns false for object element even when it uses fallback content.
Attachments
56505 (4.92 KB, patch)
2011-03-16 17:42 PDT, Ryosuke Niwa
ojan: review+
Ryosuke Niwa
Comment 1 2011-03-16 17:42:25 PDT
Ojan Vafai
Comment 2 2011-03-16 20:36:42 PDT
Comment on attachment 86010 [details] 56505 View in context: https://bugs.webkit.org/attachment.cgi?id=86010&action=review Looks like only the last case's "world" is bolded. I assuem that's a bug in the test case. > LayoutTests/editing/editability/ignored-content.html:34 > +for (var i = 0; i < (text.length + 1) * test.childNodes.length - 1; i++) > + window.getSelection().modify('extend', 'forward', 'character'); for loops should always have curly braces.
Ryosuke Niwa
Comment 3 2011-03-16 22:27:37 PDT
(In reply to comment #2) > (From update of attachment 86010 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=86010&action=review > > Looks like only the last case's "world" is bolded. I assuem that's a bug in the test case. I don't quite get what you mean by only the last case is bolded. As far as I can see in the following expected result, "world" is a child of b element in each of the tree cases: > LayoutTests/editing/editability/ignored-content-expected.txt:18 > +| <hr> > +| "hello " > +| <b> <- here > +| "world" > +| " WebKit" > +| <datagrid> > +| "hello " > +| <b> <- here > +| "world" > +| " WebKit" > +| <object> > +| "hello " > +| <b> <- here > +| "<#selection-anchor>world<#selection-focus>" > +| " WebKit" >> LayoutTests/editing/editability/ignored-content.html:34 >> + window.getSelection().modify('extend', 'forward', 'character'); > > for loops should always have curly braces. I don't think that's right. See the 3rd example in "Spacing" section of http://www.webkit.org/coding/coding-style.html. Also see: http://trac.webkit.org/browser/trunk/Source/WebCore/dom/Node.cpp#L827 http://trac.webkit.org/browser/trunk/Source/WebCore/dom/Node.cpp#L992 http://trac.webkit.org/browser/trunk/Source/WebCore/dom/Node.cpp#L1003
Ojan Vafai
Comment 4 2011-03-18 00:10:30 PDT
Comment on attachment 86010 [details] 56505 View in context: https://bugs.webkit.org/attachment.cgi?id=86010&action=review Sorry, I misread the test case and apparently I'm just wrong about for loops. > Source/WebCore/editing/htmlediting.cpp:83 > + && (!node->hasTagName(objectTag) || static_cast<const HTMLObjectElement*>(node)->useFallbackContent()) How can you know that this will be an HTMLObjectElement?
Ojan Vafai
Comment 5 2011-03-18 00:11:08 PDT
(In reply to comment #4) > (From update of attachment 86010 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=86010&action=review > > Sorry, I misread the test case and apparently I'm just wrong about for loops. > > > Source/WebCore/editing/htmlediting.cpp:83 > > + && (!node->hasTagName(objectTag) || static_cast<const HTMLObjectElement*>(node)->useFallbackContent()) > > How can you know that this will be an HTMLObjectElement? Ugh. Ignore me. I can't read today.
Ryosuke Niwa
Comment 6 2011-03-18 17:15:39 PDT
Ryosuke Niwa
Comment 7 2011-03-18 17:16:08 PDT
Thanks for the review, Ojan.
Note You need to log in before you can comment on or make changes to this bug.