Changeset 231266 in webkit
- Timestamp:
- May 2, 2018 2:38:53 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r231263 r231266 1 2018-05-02 Dirk Schulze <dschulze@chromium.org> 2 3 getCharNumAtPosition should take DOMPointInit as argument 4 https://bugs.webkit.org/show_bug.cgi?id=184695 5 6 Reviewed by Antti Koivisto. 7 8 * svg/text/lengthAdjust-text-metrics.html: Run tests with dictionary. 9 1 10 2018-05-02 Youenn Fablet <youenn@apple.com> 2 11 -
trunk/LayoutTests/svg/text/lengthAdjust-text-metrics-expected.txt
r180271 r231266 53 53 > Testing point=(0.0,10.0) 54 54 PASS svgText.getCharNumAtPosition(point) is -1 55 PASS svgText.getCharNumAtPosition(pointDict) is -1 55 56 > Testing point=(9.9,10.0) 56 57 PASS svgText.getCharNumAtPosition(point) is -1 58 PASS svgText.getCharNumAtPosition(pointDict) is -1 57 59 > Testing point=(10.1,10.0) 58 60 PASS svgText.getCharNumAtPosition(point) is 0 61 PASS svgText.getCharNumAtPosition(pointDict) is 0 59 62 > Testing point=(71.4,10.0) 60 63 PASS svgText.getCharNumAtPosition(point) is 0 … … 63 66 > Testing point=(127.8,10.0) 64 67 PASS svgText.getCharNumAtPosition(point) is 1 68 PASS svgText.getCharNumAtPosition(pointDict) is 1 65 69 > Testing point=(128.0,10.0) 66 70 PASS svgText.getCharNumAtPosition(point) is 1 67 71 > Testing point=(179.1,10.0) 68 72 PASS svgText.getCharNumAtPosition(point) is 3 73 PASS svgText.getCharNumAtPosition(pointDict) is 3 69 74 > Testing point=(179.3,10.0) 70 75 PASS svgText.getCharNumAtPosition(point) is 3 -
trunk/LayoutTests/svg/text/lengthAdjust-text-metrics.html
r217390 r231266 132 132 133 133 var point = svgRoot.createSVGPoint(); 134 var pointDict; 134 135 point.y = 10.0; 135 136 … … 141 142 debug("> Testing point=" + pointToString(point)); 142 143 shouldBe("svgText.getCharNumAtPosition(point)", "-1"); 144 pointDict = {x: point.x, y: point.y}; 145 shouldBe("svgText.getCharNumAtPosition(pointDict)", "-1"); 143 146 144 147 point.x = 9.9; … … 146 149 debug("> Testing point=" + pointToString(point)); 147 150 shouldBe("svgText.getCharNumAtPosition(point)", "-1"); 151 pointDict = {x: point.x, y: point.y}; 152 shouldBe("svgText.getCharNumAtPosition(pointDict)", "-1"); 148 153 149 154 point.x = 10.1; … … 151 156 debug("> Testing point=" + pointToString(point)); 152 157 shouldBe("svgText.getCharNumAtPosition(point)", "0"); 158 pointDict = {x: point.x, y: point.y}; 159 shouldBe("svgText.getCharNumAtPosition(pointDict)", "0"); 153 160 154 161 point.x = 71.4; … … 166 173 debug("> Testing point=" + pointToString(point)); 167 174 shouldBe("svgText.getCharNumAtPosition(point)", "1"); 175 pointDict = {x: point.x, y: point.y}; 176 shouldBe("svgText.getCharNumAtPosition(pointDict)", "1"); 168 177 169 178 point.x = 128.0; … … 176 185 debug("> Testing point=" + pointToString(point)); 177 186 shouldBe("svgText.getCharNumAtPosition(point)", "3"); 187 pointDict = {x: point.x, y: point.y}; 188 shouldBe("svgText.getCharNumAtPosition(pointDict)", "3"); 178 189 179 190 point.x = 179.3; -
trunk/Source/WebCore/ChangeLog
r231263 r231266 1 2018-05-02 Dirk Schulze <dschulze@chromium.org> 2 3 getCharNumAtPosition should take DOMPointInit as argument 4 https://bugs.webkit.org/show_bug.cgi?id=184695 5 6 Reviewed by Antti Koivisto. 7 8 Extend existing tests for getCharNumAtPosition. 9 10 * svg/SVGTextContentElement.cpp: 11 (WebCore::SVGTextContentElement::getCharNumAtPosition): 12 * svg/SVGTextContentElement.h: 13 * svg/SVGTextContentElement.idl: Use DOMPointInit argument. 14 1 15 2018-05-02 Youenn Fablet <youenn@apple.com> 2 16 -
trunk/Source/WebCore/svg/SVGTextContentElement.cpp
r229694 r231266 24 24 #include "CSSPropertyNames.h" 25 25 #include "CSSValueKeywords.h" 26 #include "DOMPoint.h" 26 27 #include "Frame.h" 27 28 #include "FrameSelection.h" … … 159 160 } 160 161 161 int SVGTextContentElement::getCharNumAtPosition( SVGPoint& point)162 int SVGTextContentElement::getCharNumAtPosition(DOMPointInit&& pointInit) 162 163 { 163 164 document().updateLayoutIgnorePendingStylesheets(); 164 return SVGTextQuery(renderer()).characterNumberAtPosition(point.propertyReference()); 165 FloatPoint transformPoint {static_cast<float>(pointInit.x), static_cast<float>(pointInit.y)}; 166 return SVGTextQuery(renderer()).characterNumberAtPosition(transformPoint); 165 167 } 166 168 -
trunk/Source/WebCore/svg/SVGTextContentElement.h
r229694 r231266 28 28 29 29 namespace WebCore { 30 31 struct DOMPointInit; 30 32 31 33 enum SVGLengthAdjustType { … … 79 81 ExceptionOr<Ref<SVGRect>> getExtentOfChar(unsigned charnum); 80 82 ExceptionOr<float> getRotationOfChar(unsigned charnum); 81 int getCharNumAtPosition( SVGPoint&);83 int getCharNumAtPosition(DOMPointInit&&); 82 84 ExceptionOr<void> selectSubString(unsigned charnum, unsigned nchars); 83 85 -
trunk/Source/WebCore/svg/SVGTextContentElement.idl
r208705 r231266 40 40 [MayThrowException, NewObject] SVGRect getExtentOfChar(optional unsigned long offset = 0); 41 41 [MayThrowException] unrestricted float getRotationOfChar(optional unsigned long offset = 0); 42 long getCharNumAtPosition( SVGPoint point);42 long getCharNumAtPosition(DOMPointInit point); 43 43 [MayThrowException] void selectSubString(optional unsigned long offset = 0, optional unsigned long length = 0); 44 44 };
Note: See TracChangeset
for help on using the changeset viewer.