Bug 54117 - Replace static_cast<HTMLElement*> with toHTMLElement
Summary: Replace static_cast<HTMLElement*> with toHTMLElement
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-09 10:20 PST by Yael
Modified: 2011-02-09 15:28 PST (History)
5 users (show)

See Also:


Attachments
Patch. (42.46 KB, patch)
2011-02-09 10:24 PST, Yael
darin: review+
yael: commit-queue-
Details | Formatted Diff | Diff
Patch. (43.18 KB, patch)
2011-02-09 12:24 PST, Yael
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yael 2011-02-09 10:20:40 PST
r78073 added a new method toHTMLElement.
Take it into use in places that currently cast Node* to HTMLElement* .
Comment 1 Yael 2011-02-09 10:24:35 PST
Created attachment 81829 [details]
Patch.
Comment 2 Darin Adler 2011-02-09 10:26:57 PST
Comment on attachment 81829 [details]
Patch.

Did you run all the regression tests? Did any assertions fire?
Comment 3 Yael 2011-02-09 10:33:07 PST
(In reply to comment #2)
> (From update of attachment 81829 [details])
> Did you run all the regression tests? Did any assertions fire?

The tests are still running, but I just noticed a crash. 
I'll stop the commit queue, it will fail anyways.
Comment 4 Yael 2011-02-09 12:24:12 PST
Created attachment 81851 [details]
Patch.

Only one test hit the ASSERT. It is editing/execCommand/insert-list-nested-with-orphaned.html .
This test is really expecting the function enclosingListChild to return a node which is not an HTMLElement.
(The test fails if I skip nodes that are not HTMLElements.)
Once I modified enclosingListChild to return Node and not HTMLElement, all tests are passing. I updated the patch to  return a Node from enclosingListChild.
Comment 5 Darin Adler 2011-02-09 12:28:53 PST
(In reply to comment #4)
> This test is really expecting the function enclosingListChild to return a node which is not an HTMLElement.

Is it an Element? Element* would be better than Node*.
Comment 6 Yael 2011-02-09 12:44:40 PST
(In reply to comment #5)
> (In reply to comment #4)
> > This test is really expecting the function enclosingListChild to return a node which is not an HTMLElement.
> 
> Is it an Element? Element* would be better than Node*.

This is a text node, not an element. It asserts when I use toElement().
Comment 7 WebKit Commit Bot 2011-02-09 15:20:23 PST
Comment on attachment 81851 [details]
Patch.

Clearing flags on attachment: 81851

Committed r78150: <http://trac.webkit.org/changeset/78150>
Comment 8 WebKit Commit Bot 2011-02-09 15:20:27 PST
All reviewed patches have been landed.  Closing bug.
Comment 9 WebKit Review Bot 2011-02-09 15:28:03 PST
http://trac.webkit.org/changeset/78150 might have broken Qt Windows 32-bit Release