Changeset 243635 in webkit
- Timestamp:
- Mar 28, 2019, 6:56:51 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/dom/Range/getBoundingClientRect-on-collapsed-selection-range-expected.txt (added)
-
LayoutTests/fast/dom/Range/getBoundingClientRect-on-collapsed-selection-range.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/dom/Range.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r243634 r243635 1 2019-03-28 Ryosuke Niwa <rniwa@webkit.org> 2 3 getBoundingClientRect always returns empty rect on a collapsed range 4 https://bugs.webkit.org/show_bug.cgi?id=196380 5 6 Reviewed by Wenson Hsieh. 7 8 Added a regression test. 9 10 * fast/dom/Range/getBoundingClientRect-on-collapsed-selection-range-expected.txt: Added. 11 * fast/dom/Range/getBoundingClientRect-on-collapsed-selection-range.html: Added. 12 1 13 2019-03-28 Chris Dumez <cdumez@apple.com> 2 14 -
trunk/Source/WebCore/ChangeLog
r243627 r243635 1 2019-03-28 Ryosuke Niwa <rniwa@webkit.org> 2 3 getBoundingClientRect always returns empty rect on a collapsed range 4 https://bugs.webkit.org/show_bug.cgi?id=196380 5 6 Reviewed by Wenson Hsieh. 7 8 The bug was caused by Range::boundingRect merging rects via FloatRect::unite which ignores empty rects. 9 Use uniteIfNonZero instead to fix the bug. Note that we can't use uniteEvenIfEmpty because that would 10 set x, y to always 0, 0 as we would end up merging any rect with the initial empty rect. 11 12 Test: fast/dom/Range/getBoundingClientRect-on-collapsed-selection-range.html 13 14 * dom/Range.cpp: 15 (WebCore::Range::boundingRect const): 16 1 17 2019-03-28 Justin Fan <justin_fan@apple.com> 2 18 -
trunk/Source/WebCore/dom/Range.cpp
r243163 r243635 1843 1843 FloatRect result; 1844 1844 for (auto& rect : borderAndTextRects(space, respectClippingForTextRects)) 1845 result.unite (rect);1845 result.uniteIfNonZero(rect); 1846 1846 return result; 1847 1847 }
Note:
See TracChangeset
for help on using the changeset viewer.