Bug 123703

Summary: Add helpers for partial descendant traversal to element iterators
Product: WebKit Reporter: Antti Koivisto <koivisto>
Component: DOMAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
patch
none
better patch kling: review+

Description Antti Koivisto 2013-11-03 02:21:02 PST
More convenience
Comment 1 Antti Koivisto 2013-11-03 02:25:08 PST
Created attachment 215858 [details]
patch
Comment 2 Andreas Kling 2013-11-03 02:39:02 PST
Comment on attachment 215858 [details]
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=215858&action=review

> Source/WebCore/editing/FrameSelection.cpp:1964
> +        if (element.hasTagName(frameTag) || element.hasTagName(iframeTag)) {

We should use isHTMLFrameElement() and isHTMLIFrameElement() here.

> Source/WebCore/html/HTMLFormElement.cpp:485
> +        if (!element.isFormControlElement() && !element.hasTagName(objectTag))

isHTMLObjectElement()

> Source/WebCore/html/HTMLFormElement.cpp:740
> +    if (!startElement.parentElement())
> +        return nullptr;
> +    return lineageOfType<HTMLFormElement>(*startElement.parentElement()).first();

This would be even simpler with ancestorsOfType.
Comment 3 Antti Koivisto 2013-11-03 02:59:09 PST
Created attachment 215861 [details]
better patch
Comment 4 WebKit Commit Bot 2013-11-03 03:00:41 PST
Attachment 215861 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCore/dom/ElementAncestorIterator.h', u'Source/WebCore/dom/ElementDescendantIterator.h', u'Source/WebCore/editing/FrameSelection.cpp', u'Source/WebCore/html/HTMLFormElement.cpp']" exit_code: 1
Source/WebCore/dom/ElementDescendantIterator.h:206:  More than one command on the same line  [whitespace/newline] [4]
Total errors found: 1 in 5 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 5 Antti Koivisto 2013-11-03 03:12:30 PST
https://trac.webkit.org/r158530