[webkit-reviews] review granted: [Bug 15954] Move DOM Selection operations out of SelectionController : [Attachment 17202] proposed patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Nov 12 12:34:01 PST 2007

Darin Adler <darin at apple.com> has granted Alexey Proskuryakov <ap at webkit.org>'s
request for review:
Bug 15954: Move DOM Selection operations out of SelectionController

Attachment 17202: proposed patch

------- Additional Comments from Darin Adler <darin at apple.com>
+    if (selectionController->isNone())
+	 return "None";
+    else if (selectionController->isCaret())
+	 return "Caret";
+    else
+	 return "Range";

We normally don't do else after return.

+	 || node->offsetInCharacters() && offset > caretMaxOffset(node)
+	 || !node->offsetInCharacters() && offset >
(int)node->childNodeCount()) {

Could probably rewrite this using ? : to not call offsetInCharacters twice. Or
maybe there should be a helper function for this relatively common operation?

+	 // Safari Selection Object API

Wow, I'm really surprised to learn that baseNode is Safari-specific!

Great patch! r=me

More information about the webkit-reviews mailing list