[Webkit-unassigned] [Bug 60529] Programmatically set selection should not have direction on Mac

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jul 14 09:31:55 PDT 2011


--- Comment #15 from Wyatt Carss <wcarss at chromium.org>  2011-07-14 09:31:54 PST ---
(From update of attachment 100760)
View in context: https://bugs.webkit.org/attachment.cgi?id=100760&action=review

>> LayoutTests/editing/selection/programmatic-selection-on-mac-is-directionless-1.html:13
>> +    <div id="regular-div">Superfluous line.<br>Superfluous line.<br>The first sentence. The second sentence. Three sentences.<br>Another sentence. A fifth sentence. A sixth sentence.<br>Sentence seven. Sentence eight. The last sentence.<br>Superfluous line.<br>Superfluous line.</div> 
> Can we just have 3 lines instead?  All these extra lines and sentences are making this code less readable.

At this point, I likely can -- I had to add them for obscure reasons earlier, so this should work fine.

>>> LayoutTests/editing/selection/programmatic-selection-on-mac-is-directionless-1.html:76
>>> +    runTestsOn(platform, document.getElementById('editable-div'));
>> I started off with a node-travesal like so:
>> for(i = 0; i < 2; i++)
>>     runTestsOn(platform, document.getElementById('test').children[i];
>> but it gave me a wacky syntax error the second time through, complaining about '1' as a property to undefined. I messed with it for 15 minutes and opted for explicitly showing the two tags instead. It's the same number of lines and similarly clear what's going on, but if you'd like me to look into the for loop solution, I'll try harder at it :P
> It's childNodes, not children!  You should also skip text nodes generated by whitespace around tags.

children is like childNodes, but doesn't have those whitespace nodes.

>> LayoutTests/editing/selection/programmatic-selection-on-mac-is-directionless-2.html:61
>> +        expectedResult = {'mac': 'Superfluous line. Superfluous line. The first sentence. The second sentence. Three sentences. Another sentence. A fifth', 
> If we're special-casing input element then why do we need so much text in the first place?  It seems like we can trim it to be 1-2 words.

good point!

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