RESOLVED FIXED Bug 106533
[Refactoring] HTMLTextFormControlElement should use shadowHost instead of shadowAncestorNode
https://bugs.webkit.org/show_bug.cgi?id=106533
Summary [Refactoring] HTMLTextFormControlElement should use shadowHost instead of sha...
Shinya Kawanaka
Reported 2013-01-09 23:39:16 PST
shadowAncestorNode() is deprecated. We would like to use shadowHost.
Attachments
Patch (3.03 KB, patch)
2013-01-09 23:53 PST, Shinya Kawanaka
no flags
Shinya Kawanaka
Comment 1 2013-01-09 23:53:47 PST
Kent Tamura
Comment 2 2013-01-15 03:39:08 PST
Comment on attachment 182076 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=182076&action=review ok > Source/WebCore/html/HTMLTextFormControlElement.cpp:647 > + return ancestor ? toTextFormControl(ancestor) : 0; Not your fault, but this code looks dangerous. Who ensures that the position points shadow nodes in text input or textarea?
Shinya Kawanaka
Comment 3 2013-01-16 20:43:53 PST
I'll land this patch anyway, and I'll file another bug to address the issue.
Shinya Kawanaka
Comment 4 2013-01-16 20:45:48 PST
WebKit Review Bot
Comment 5 2013-01-16 21:14:26 PST
Comment on attachment 182076 [details] Patch Clearing flags on attachment: 182076 Committed r139962: <http://trac.webkit.org/changeset/139962>
WebKit Review Bot
Comment 6 2013-01-16 21:14:29 PST
All reviewed patches have been landed. Closing bug.
Darin Adler
Comment 7 2013-01-17 09:42:35 PST
Comment on attachment 182076 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=182076&action=review > Source/WebCore/html/HTMLTextFormControlElement.cpp:646 > + Node* ancestor = container->shadowHost(); The ancestor variable should be of type Element*, not Node*. >> Source/WebCore/html/HTMLTextFormControlElement.cpp:647 >> + return ancestor ? toTextFormControl(ancestor) : 0; > > Not your fault, but this code looks dangerous. Who ensures that the position points shadow nodes in text input or textarea? Good point, this can be a bad cast! We need a type check.
Shinya Kawanaka
Comment 8 2013-01-17 20:17:23 PST
Comment on attachment 182076 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=182076&action=review >>> Source/WebCore/html/HTMLTextFormControlElement.cpp:647 >>> + return ancestor ? toTextFormControl(ancestor) : 0; >> >> Not your fault, but this code looks dangerous. Who ensures that the position points shadow nodes in text input or textarea? > > Good point, this can be a bad cast! We need a type check. toTextFormControl() returns 0 if it's not TextFormControl. So this would be safe, but I think it does not align our recent code convention. Maybe refactoring is desired.
Note You need to log in before you can comment on or make changes to this bug.