> > trying to understand this part of the webcore code, I faced a possibly > wrong impl: > > (...) > VisiblePosition logicalStartOfLine(const VisiblePosition& c) > { > VisiblePosition visPos = logicalStartPositionForLine(c); > > if (visPos.isNull()) > return c.honorEditableBoundaryAtOrAfter(visPos); > > return c.honorEditableBoundaryAtOrAfter(visPos); > } > (...) > > note that "c.honorEditableBoundaryAtOrAfter(visPos);" will be > executed regardless visPos being null or not. thoughts ? >
honorEditableBoundaryAtOrAfter does check whether the visPos is null or not, and if it's null, then it returns the original visible position, so it's harmless (i.e. does not crash or has a side-effect). But I'm not sure what the caller of logicalStartOfLine is expecting; maybe we're supposed to do something in the case visible position was null. But assuming that the original is correct, we don't need that if statement at all. Did you file a bug for it? Ryosuke
_______________________________________________ webkit-dev mailing list webkit-dev@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev