Bug 123703 - Add helpers for partial descendant traversal to element iterators
Summary: Add helpers for partial descendant traversal to element iterators
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-03 02:21 PST by Antti Koivisto
Modified: 2013-11-03 03:12 PST (History)
1 user (show)

See Also:


Attachments
patch (12.00 KB, patch)
2013-11-03 02:25 PST, Antti Koivisto
no flags Details | Formatted Diff | Diff
better patch (12.11 KB, patch)
2013-11-03 02:59 PST, Antti Koivisto
kling: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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