RESOLVED FIXED 217300
Remove support for enabling subpixel CSSOM values, it's off by default everywhere and known to be not-compatible with the web
https://bugs.webkit.org/show_bug.cgi?id=217300
Summary Remove support for enabling subpixel CSSOM values, it's off by default everyw...
Sam Weinig
Reported 2020-10-04 15:03:06 PDT
Remove support for enabling subpixel CSSOM values, it's off by default everywhere and known to be not-compatible with the web
Attachments
Patch (31.58 KB, patch)
2020-10-04 15:05 PDT, Sam Weinig
no flags
Patch (33.14 KB, patch)
2020-10-04 16:43 PDT, Sam Weinig
no flags
Patch (33.09 KB, patch)
2020-10-05 08:29 PDT, Sam Weinig
no flags
Patch (33.11 KB, patch)
2020-10-05 08:33 PDT, Sam Weinig
no flags
Sam Weinig
Comment 1 2020-10-04 15:05:48 PDT Comment hidden (obsolete)
Sam Weinig
Comment 2 2020-10-04 16:43:57 PDT
Simon Fraser (smfr)
Comment 3 2020-10-04 20:15:25 PDT
Comment on attachment 410488 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=410488&action=review > Source/WebCore/dom/Element.cpp:1057 > + result.adjustedValue = result.zoomFactor == 1 ? value.toDouble() : value.toDouble() / result.zoomFactor; Surely just dividing by 1 is faster than the test. > Source/WebCore/dom/Element.cpp:1082 > + LayoutUnit offsetLeft = LayoutUnit(roundToInt(offset)); auto offsetLeft = LayoutUnit { roundToInt(offset) } ? > Source/WebCore/dom/Element.cpp:1157 > + LayoutUnit offsetWidth = LayoutUnit(roundToInt(renderer->offsetWidth())); Ditto > Source/WebCore/dom/Element.cpp:1167 > + LayoutUnit offsetHeight = LayoutUnit(roundToInt(renderer->offsetHeight())); Ditto > Source/WebCore/dom/Element.cpp:1200 > + LayoutUnit clientLeft = LayoutUnit(roundToInt(renderer->clientLeft())); ditto > Source/WebCore/dom/Element.cpp:1211 > + LayoutUnit clientTop = LayoutUnit(roundToInt(renderer->clientTop())); ditto > Source/WebCore/dom/Element.cpp:1234 > // clientWidth/Height is the visual portion of the box content, not including ditto > Source/WebCore/dom/Element.cpp:1266 > + LayoutUnit clientHeight = LayoutUnit(roundToInt(renderer->clientHeight())); ditto
Darin Adler
Comment 4 2020-10-04 20:55:36 PDT
Comment on attachment 410488 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=410488&action=review >> Source/WebCore/dom/Element.cpp:1057 >> + result.adjustedValue = result.zoomFactor == 1 ? value.toDouble() : value.toDouble() / result.zoomFactor; > > Surely just dividing by 1 is faster than the test. I’m not sure of that. We may need to benchmark it. I know that floating point division is both costly and hard for the compiler to optimize. And modern CPUs are really good at optimizing branches.
Sam Weinig
Comment 5 2020-10-05 08:29:27 PDT
Sam Weinig
Comment 6 2020-10-05 08:31:18 PDT
(In reply to Darin Adler from comment #4) > Comment on attachment 410488 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=410488&action=review > > >> Source/WebCore/dom/Element.cpp:1057 > >> + result.adjustedValue = result.zoomFactor == 1 ? value.toDouble() : value.toDouble() / result.zoomFactor; > > > > Surely just dividing by 1 is faster than the test. > > I’m not sure of that. We may need to benchmark it. I know that floating > point division is both costly and hard for the compiler to optimize. And > modern CPUs are really good at optimizing branches. I am also not sure, but with some manual inlining of the helper which was only being called by this function, the choice goes away, since we still need to branch on zoomFactor to determine the rounding mode: static int adjustOffsetForZoomAndSubpixelLayout(RenderBoxModelObject& renderer, const LayoutUnit& offset) { auto offsetLeft = LayoutUnit(roundToInt(offset)); double zoomFactor = localZoomForRenderer(renderer); if (zoomFactor == 1) return convertToNonSubpixelValue(offsetLeft, Floor); return convertToNonSubpixelValue(offsetLeft / zoomFactor, Round); }
Sam Weinig
Comment 7 2020-10-05 08:33:21 PDT
EWS
Comment 8 2020-10-05 09:17:18 PDT
Committed r267970: <https://trac.webkit.org/changeset/267970> All reviewed patches have been landed. Closing bug and clearing flags on attachment 410520 [details].
Radar WebKit Bug Importer
Comment 9 2020-10-05 09:18:22 PDT
Note You need to log in before you can comment on or make changes to this bug.