WebKit Bugzilla
Attachment 339337 Details for
Bug 184695
: getCharNumAtPosition should take DOMPointInit as argument
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for landing
bug-184695-20180502231351.patch (text/plain), 8.09 KB, created by
Dirk Schulze
on 2018-05-02 14:13:52 PDT
(
hide
)
Description:
Patch for landing
Filename:
MIME Type:
Creator:
Dirk Schulze
Created:
2018-05-02 14:13:52 PDT
Size:
8.09 KB
patch
obsolete
>Subversion Revision: 231256 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index e3b8f897267a5316b6a95e019e59b51318c80eb2..56e689d1a22e8c8bc23192bc8c580d11cf61010e 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,17 @@ >+2018-04-17 Dirk Schulze <dschulze@chromium.org> >+ >+ getCharNumAtPosition should take DOMPointInit as argument >+ https://bugs.webkit.org/show_bug.cgi?id=184695 >+ >+ Reviewed by Antti Koivisto. >+ >+ Extend existing tests for getCharNumAtPosition. >+ >+ * svg/SVGTextContentElement.cpp: >+ (WebCore::SVGTextContentElement::getCharNumAtPosition): >+ * svg/SVGTextContentElement.h: >+ * svg/SVGTextContentElement.idl: Use DOMPointInit argument. >+ > 2018-05-02 Brian Burg <bburg@apple.com> > > Web Inspector: opt out of process swap on navigation if a Web Inspector frontend is connected >diff --git a/Source/WebCore/svg/SVGTextContentElement.cpp b/Source/WebCore/svg/SVGTextContentElement.cpp >index 165aae4f4cef4382368af904a3da07e59ef8e00d..703b60141d157af24dac2db81f2c3a0320348d29 100644 >--- a/Source/WebCore/svg/SVGTextContentElement.cpp >+++ b/Source/WebCore/svg/SVGTextContentElement.cpp >@@ -23,6 +23,7 @@ > > #include "CSSPropertyNames.h" > #include "CSSValueKeywords.h" >+#include "DOMPoint.h" > #include "Frame.h" > #include "FrameSelection.h" > #include "RenderObject.h" >@@ -158,10 +159,11 @@ ExceptionOr<float> SVGTextContentElement::getRotationOfChar(unsigned charnum) > return SVGTextQuery(renderer()).rotationOfCharacter(charnum); > } > >-int SVGTextContentElement::getCharNumAtPosition(SVGPoint& point) >+int SVGTextContentElement::getCharNumAtPosition(DOMPointInit&& pointInit) > { > document().updateLayoutIgnorePendingStylesheets(); >- return SVGTextQuery(renderer()).characterNumberAtPosition(point.propertyReference()); >+ FloatPoint transformPoint {static_cast<float>(pointInit.x), static_cast<float>(pointInit.y)}; >+ return SVGTextQuery(renderer()).characterNumberAtPosition(transformPoint); > } > > ExceptionOr<void> SVGTextContentElement::selectSubString(unsigned charnum, unsigned nchars) >diff --git a/Source/WebCore/svg/SVGTextContentElement.h b/Source/WebCore/svg/SVGTextContentElement.h >index dc02cc335b0bc039a2932a1c8927afc67391292c..ff69523715bc4add20cf778984d6113fe45a55ae 100644 >--- a/Source/WebCore/svg/SVGTextContentElement.h >+++ b/Source/WebCore/svg/SVGTextContentElement.h >@@ -28,6 +28,8 @@ > > namespace WebCore { > >+struct DOMPointInit; >+ > enum SVGLengthAdjustType { > SVGLengthAdjustUnknown, > SVGLengthAdjustSpacing, >@@ -78,7 +80,7 @@ public: > ExceptionOr<Ref<SVGPoint>> getEndPositionOfChar(unsigned charnum); > ExceptionOr<Ref<SVGRect>> getExtentOfChar(unsigned charnum); > ExceptionOr<float> getRotationOfChar(unsigned charnum); >- int getCharNumAtPosition(SVGPoint&); >+ int getCharNumAtPosition(DOMPointInit&&); > ExceptionOr<void> selectSubString(unsigned charnum, unsigned nchars); > > static SVGTextContentElement* elementFromRenderer(RenderObject*); >diff --git a/Source/WebCore/svg/SVGTextContentElement.idl b/Source/WebCore/svg/SVGTextContentElement.idl >index 629e8ab13a21d0594af345e3ef6284298f161b88..f816a3fac5a9632a1c44e90857b7c06748e6aa62 100644 >--- a/Source/WebCore/svg/SVGTextContentElement.idl >+++ b/Source/WebCore/svg/SVGTextContentElement.idl >@@ -39,7 +39,7 @@ interface SVGTextContentElement : SVGGraphicsElement { > [MayThrowException, NewObject] SVGPoint getEndPositionOfChar(optional unsigned long offset = 0); > [MayThrowException, NewObject] SVGRect getExtentOfChar(optional unsigned long offset = 0); > [MayThrowException] unrestricted float getRotationOfChar(optional unsigned long offset = 0); >- long getCharNumAtPosition(SVGPoint point); >+ long getCharNumAtPosition(DOMPointInit point); > [MayThrowException] void selectSubString(optional unsigned long offset = 0, optional unsigned long length = 0); > }; > >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index f3606b9745a7ef82b12c08df3cf81b4a7ed8bc91..38347983257cf37d237dd1f27e4805f6403dd619 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,12 @@ >+2018-04-17 Dirk Schulze <dschulze@chromium.org> >+ >+ getCharNumAtPosition should take DOMPointInit as argument >+ https://bugs.webkit.org/show_bug.cgi?id=184695 >+ >+ Reviewed by Antti Koivisto. >+ >+ * svg/text/lengthAdjust-text-metrics.html: Run tests with dictionary. >+ > 2018-05-02 Youenn Fablet <youenn@apple.com> > > Layout Test http/wpt/service-workers/header-filtering.https.html is a flaky failure >diff --git a/LayoutTests/svg/text/lengthAdjust-text-metrics-expected.txt b/LayoutTests/svg/text/lengthAdjust-text-metrics-expected.txt >index 99c67cedeb6c093edb98e545704ff11c05dd8bf6..e70b71e00a7454f234a4bf82d1487dcb00a6a9b5 100644 >--- a/LayoutTests/svg/text/lengthAdjust-text-metrics-expected.txt >+++ b/LayoutTests/svg/text/lengthAdjust-text-metrics-expected.txt >@@ -52,20 +52,25 @@ PASS svgText.getRotationOfChar(3).toFixed(1) is "0.0" > Test getCharNumAtPosition() API > > Testing point=(0.0,10.0) > PASS svgText.getCharNumAtPosition(point) is -1 >+PASS svgText.getCharNumAtPosition(pointDict) is -1 > > Testing point=(9.9,10.0) > PASS svgText.getCharNumAtPosition(point) is -1 >+PASS svgText.getCharNumAtPosition(pointDict) is -1 > > Testing point=(10.1,10.0) > PASS svgText.getCharNumAtPosition(point) is 0 >+PASS svgText.getCharNumAtPosition(pointDict) is 0 > > Testing point=(71.4,10.0) > PASS svgText.getCharNumAtPosition(point) is 0 > > Testing point=(71.6,10.0) > PASS svgText.getCharNumAtPosition(point) is 0 > > Testing point=(127.8,10.0) > PASS svgText.getCharNumAtPosition(point) is 1 >+PASS svgText.getCharNumAtPosition(pointDict) is 1 > > Testing point=(128.0,10.0) > PASS svgText.getCharNumAtPosition(point) is 1 > > Testing point=(179.1,10.0) > PASS svgText.getCharNumAtPosition(point) is 3 >+PASS svgText.getCharNumAtPosition(pointDict) is 3 > > Testing point=(179.3,10.0) > PASS svgText.getCharNumAtPosition(point) is 3 > > Testing point=(209.9,10.0) >diff --git a/LayoutTests/svg/text/lengthAdjust-text-metrics.html b/LayoutTests/svg/text/lengthAdjust-text-metrics.html >index 9e126dc89398b4ef9dd89ba590d49664dedb0c40..f318f097895fd89c72e84eb8e18cb2b8a584fe89 100644 >--- a/LayoutTests/svg/text/lengthAdjust-text-metrics.html >+++ b/LayoutTests/svg/text/lengthAdjust-text-metrics.html >@@ -131,6 +131,7 @@ shouldBeEqualToString("svgText.getRotationOfChar(2).toFixed(1)", "0.0"); > shouldBeEqualToString("svgText.getRotationOfChar(3).toFixed(1)", "0.0"); > > var point = svgRoot.createSVGPoint(); >+var pointDict; > point.y = 10.0; > > debug(""); >@@ -140,16 +141,22 @@ point.x = 0.0; > point = point.matrixTransform(inverseScaleMatrix); > debug("> Testing point=" + pointToString(point)); > shouldBe("svgText.getCharNumAtPosition(point)", "-1"); >+pointDict = {x: point.x, y: point.y}; >+shouldBe("svgText.getCharNumAtPosition(pointDict)", "-1"); > > point.x = 9.9; > point = point.matrixTransform(inverseScaleMatrix); > debug("> Testing point=" + pointToString(point)); > shouldBe("svgText.getCharNumAtPosition(point)", "-1"); >+pointDict = {x: point.x, y: point.y}; >+shouldBe("svgText.getCharNumAtPosition(pointDict)", "-1"); > > point.x = 10.1; > point = point.matrixTransform(inverseScaleMatrix); > debug("> Testing point=" + pointToString(point)); > shouldBe("svgText.getCharNumAtPosition(point)", "0"); >+pointDict = {x: point.x, y: point.y}; >+shouldBe("svgText.getCharNumAtPosition(pointDict)", "0"); > > point.x = 71.4; > point = point.matrixTransform(inverseScaleMatrix); >@@ -165,6 +172,8 @@ point.x = 127.8; > point = point.matrixTransform(inverseScaleMatrix); > debug("> Testing point=" + pointToString(point)); > shouldBe("svgText.getCharNumAtPosition(point)", "1"); >+pointDict = {x: point.x, y: point.y}; >+shouldBe("svgText.getCharNumAtPosition(pointDict)", "1"); > > point.x = 128.0; > point = point.matrixTransform(inverseScaleMatrix); >@@ -175,6 +184,8 @@ point.x = 179.1; > point = point.matrixTransform(inverseScaleMatrix); > debug("> Testing point=" + pointToString(point)); > shouldBe("svgText.getCharNumAtPosition(point)", "3"); >+pointDict = {x: point.x, y: point.y}; >+shouldBe("svgText.getCharNumAtPosition(pointDict)", "3"); > > point.x = 179.3; > point = point.matrixTransform(inverseScaleMatrix);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 184695
:
338116
|
338119
| 339337