[Webkit-unassigned] [Bug 91912] Adding "all" to -webkit-user-select

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Oct 30 17:24:29 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=91912





--- Comment #77 from Enrica Casucci <enrica at apple.com>  2012-10-30 17:25:43 PST ---
(In reply to comment #76)
> I'm not loving the enum & value names here. How about something like
> enum ShouldTreatSelectAllAsEditable {
>    TreatSelectAllAsEditable,
>    DoNoTreatSelectAllAsEditable,
> }
> 
I can change it, I couldn't come up with anything better.

> 
> I would prefer putting this if-def in the header file so that we can compiler-time eliminate the member functions altogether on ports/platforms where this feature is not enabled to avoid any perf. hits.
Ok.

> 
> > Source/WebCore/editing/FrameSelection.cpp:599
> > +    Node* rootUserSelectAll = Position::rootUserSelectAllForNode(pos.deepEquivalent().anchorNode());
> > +    if (rootUserSelectAll)
> 
> You should define Node* inside the if.
>
Ok.

> > Source/WebCore/editing/FrameSelection.cpp:645
> > +    Node* rootUserSelectAll = Position::rootUserSelectAllForNode(pos.deepEquivalent().anchorNode());
> > +    if (rootUserSelectAll)
> > +        pos = VisiblePosition((directionOfEnclosingBlock() == LTR) ? positionAfterNode(rootUserSelectAll).downstream(CanCrossEditingBoundary) : positionBeforeNode(rootUserSelectAll).upstream(CanCrossEditingBoundary));
> > +#endif    
> 
> It seems like these code blocks are identical. Can we extract a helper function so that we don't have to duplicate it everywhere?
> 
They are not all the same, only 2 and 2. I can add a helper.

> > LayoutTests/editing/selection/user-select-all-selection-expected.txt:31
> > +
> 
> Can we add a test case to set the selection programmatically?
> e.g. if we had <html><head></head><body><div>hello, <span style="-moz-user-select: all;">wor<b>l</b>d</span> WebKit</div></body></html>, Mozilla still lets us select just b by running getSelection().selectAllChildren(document.querySelector('b'));

Sure.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list