-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Implement Element.currentCSSZoom
#46925
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Implement Element.currentCSSZoom
#46925
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
6f5929a
to
f77668a
Compare
This comment was marked as outdated.
This comment was marked as outdated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is adding a new feature, could you please add it behind a preference, enabled for preview for now?
f77668a
to
e69f85e
Compare
EWS run on previous version of this PR (hash e69f85e) |
e69f85e
to
1338bae
Compare
EWS run on previous version of this PR (hash 1338bae) |
@annevk - Can you review this now? |
Source/WebCore/dom/Element.cpp
Outdated
@@ -1583,6 +1583,23 @@ int Element::clientHeight() | |||
return 0; | |||
} | |||
|
|||
double Element::currentCSSZoom() | |||
{ | |||
protectedDocument()->updateStyleIfNeeded(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You want
Ref document = this->document()
here as you also use document below to get the resolver. But then from that resolver you get a document again? Is that going to be a different document? Seems unlikely.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My interpretation is -> that whenever we come across this 'currentCSSZoom' function, if there is any pending document or anything then just go ahead and update Style and then later apply whatever is below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That doesn't really answer the question. I don't think obtaining a resolver has any side effects. Updating style obviously does, but that's already done at that point.
https://bugs.webkit.org/show_bug.cgi?id=279881 rdar://136662584 Reviewed by NOBODY (OOPS!). This patch implements `currentCSSZoom` as per web specification [1] and aligns with Gecko / Firefox and Blink / Chrome. [1] https://drafts.csswg.org/cssom-view/#dom-element-currentcsszoom This is implemented behind flag while being enabled on 'Safari Technology Preview'. * Source/WebCore/dom/Element+CSSOMView.idl: * Source/WebCore/dom/Element.cpp: (WebCore::Element::currentCSSZoom): * Source/WebCore/dom/Element.h: * Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml: Enabled in `preview` * LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/Element-currentCSSZoom-expected.txt: Progression * LayoutTests/fast/zooming/currentCSSZoom-body-fixed-regression-test.html: * LayoutTests/fast/zooming/currentCSSZoom-body-fixed-regression-test-expected.txt:
1338bae
to
d7d1c83
Compare
EWS run on current version of this PR (hash d7d1c83) |
d7d1c83
d7d1c83