Currently WebSurroundingText has a custom initialize method based on node offsets that is used only by the LayoutTestController. Instead of this we should make the tests work with coordinates and use the same code path as the rest of the feature.
Created attachment 151455 [details] Patch
Comment on attachment 151455 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=151455&action=review > Source/WebKit/chromium/src/WebSurroundingText.cpp:43 > +void WebSurroundingText::initialize(const WebHitTestResult& hitTestResult, size_t maxLength) This method is currently in use by Chromium. However, we can switch to the new one and remove this with a 3-sided patch. > LayoutTests/platform/chromium/editing/surrounding-text/surrounding-text.html:-36 > - shouldBeEqualToString('surroundingText(\'<button>.</button>12345<p id="here">6789 12345</p>6789<button>.</button>\', 100, 5)', ''); Invalid offsets throw a JS exception in findOffsetCoordinates now.
Please wait for approval from abarth@webkit.org, dglazkov@chromium.org, fishd@chromium.org, jamesr@chromium.org or tkent@chromium.org before submitting, as this patch contains changes to the Chromium public API. See also https://trac.webkit.org/wiki/ChromiumWebKitAPI.
Comment on attachment 151455 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=151455&action=review >> Source/WebKit/chromium/src/WebSurroundingText.cpp:43 >> +void WebSurroundingText::initialize(const WebHitTestResult& hitTestResult, size_t maxLength) > > This method is currently in use by Chromium. However, we can switch to the new one and remove this with a 3-sided patch. If you like, you can add a FIXME comment to the public header to this effect.
Comment on attachment 151455 [details] Patch Clearing flags on attachment: 151455 Committed r122225: <http://trac.webkit.org/changeset/122225>
All reviewed patches have been landed. Closing bug.
Committed r122230: <http://trac.webkit.org/changeset/122230>