Bug 62922 - indexForVisiblePosition(const VisiblePosition& visiblePosition) does not consider shadow content
Summary: indexForVisiblePosition(const VisiblePosition& visiblePosition) does not cons...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Justin Garcia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-17 18:35 PDT by Justin Garcia
Modified: 2011-06-29 17:11 PDT (History)
5 users (show)

See Also:


Attachments
patch (13.09 KB, patch)
2011-06-28 16:11 PDT, Justin Garcia
no flags Details | Formatted Diff | Diff
updated patch (10.31 KB, patch)
2011-06-28 18:21 PDT, Justin Garcia
no flags Details | Formatted Diff | Diff
patch (10.47 KB, patch)
2011-06-28 23:27 PDT, Justin Garcia
enrica: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Justin Garcia 2011-06-17 18:35:01 PDT
indexForVisiblePosition(const VisiblePosition& visiblePosition) does not visiblePositions in shadow content.
Comment 1 Justin Garcia 2011-06-28 16:11:14 PDT
Created attachment 98991 [details]
patch
Comment 2 WebKit Review Bot 2011-06-28 16:14:45 PDT
Attachment 98991 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'LayoutTests/ChangeLog', u'LayoutTests/edit..." exit_code: 1

Source/WebCore/editing/InsertListCommand.cpp:155:  Declaration has space between type name and * in Element *scope  [whitespace/declaration] [3]
Source/WebCore/editing/InsertListCommand.cpp:155:  Use 0 instead of NULL.  [readability/null] [5]
Source/WebCore/editing/htmlediting.cpp:1027:  Declaration has space between type name and * in Document *document  [whitespace/declaration] [3]
Source/WebCore/editing/htmlediting.cpp:1029:  Declaration has space between type name and * in Element *root  [whitespace/declaration] [3]
Source/WebCore/editing/htmlediting.cpp:1030:  Declaration has space between type name and * in Node *shadowRoot  [whitespace/declaration] [3]
Source/WebCore/editing/ApplyBlockElementCommand.cpp:84:  Declaration has space between type name and * in Element *startScope  [whitespace/declaration] [3]
Source/WebCore/editing/ApplyBlockElementCommand.cpp:84:  Use 0 instead of NULL.  [readability/null] [5]
Source/WebCore/editing/ApplyBlockElementCommand.cpp:86:  Declaration has space between type name and * in Element *endScope  [whitespace/declaration] [3]
Source/WebCore/editing/ApplyBlockElementCommand.cpp:86:  Use 0 instead of NULL.  [readability/null] [5]
Total errors found: 9 in 10 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Justin Garcia 2011-06-28 16:16:08 PDT
Comment on attachment 98991 [details]
patch

Clearing review flag to fix style issues.
Comment 4 Justin Garcia 2011-06-28 18:21:21 PDT
Created attachment 99018 [details]
updated patch
Comment 5 Andy Estes 2011-06-28 22:35:25 PDT
Comment on attachment 99018 [details]
updated patch

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

I have a few style comments.

> WebCore/editing/htmlediting.cpp:1035
> +        root = static_cast<Element *>(shadowRoot);

This should be static_cast<Element*>() per the style guide.

> WebCore/editing/htmlediting.cpp:1047
> +    RefPtr<Range> range = Range::create(document, 
> +                                        firstPositionInNode(root),
>                                          p.parentAnchoredEquivalent());
> +    

The last two lines should be regularly indented, not lined up with the '('.

> WebCore/editing/htmlediting.cpp:1054
> +    // indexForVisiblePosition can create a

Can create a what?
Comment 6 Justin Garcia 2011-06-28 23:27:49 PDT
Created attachment 99043 [details]
patch

Updated the patch to address the problems Andy pointed out.
Comment 7 Enrica Casucci 2011-06-29 10:06:17 PDT
Comment on attachment 99043 [details]
patch

Looks good to me.
Comment 8 Justin Garcia 2011-06-29 17:11:45 PDT
http://trac.webkit.org/changeset/90072