Skip to content

Clean up and apply minor optimizations to StyledElement#63199

Merged
webkit-commit-queue merged 1 commit into
WebKit:mainfrom
cdumez:312855_StyledElement
Apr 22, 2026
Merged

Clean up and apply minor optimizations to StyledElement#63199
webkit-commit-queue merged 1 commit into
WebKit:mainfrom
cdumez:312855_StyledElement

Conversation

@cdumez
Copy link
Copy Markdown
Contributor

@cdumez cdumez commented Apr 21, 2026

353f068

Clean up and apply minor optimizations to StyledElement
https://bugs.webkit.org/show_bug.cgi?id=312855

Reviewed by Anne van Kesteren and Rupin Mittal.

- Extract synchronizeStyleAttributeForSelectorInvalidation() to eliminate
  duplicated style attribute synchronization logic between dirtyStyleAttribute()
  and invalidateStyleAttribute().
- Remove redundant isSVGElement() guard around dynamicDowncast<SVGElement>,
  which already performs the same type check.
- Avoid unnecessary inlineStyleChanged() in setInlineStyleCustomProperty()
  when addParsedProperty() reports no changes were made.
- Cache inlineStyle() in inlineStyleCSSOMWrapper() to avoid double lookup,
  and use nullptr instead of 0.

* Source/WebCore/dom/StyledElement.cpp:
(WebCore::StyledElement::inlineStyleCSSOMWrapper):
(WebCore::StyledElement::synchronizeStyleAttributeForSelectorInvalidation):
(WebCore::StyledElement::dirtyStyleAttribute):
(WebCore::StyledElement::invalidateStyleAttribute):
(WebCore::StyledElement::setInlineStyleCustomProperty):
* Source/WebCore/dom/StyledElement.h:

Canonical link: https://commits.webkit.org/311740@main

d05794b

Misc iOS, visionOS, tvOS & watchOS macOS Linux Windows Apple Internal
✅ 🧪 style ✅ 🛠 ios ✅ 🛠 mac ✅ 🛠 wpe ✅ 🛠 win ⏳ 🛠 ios-apple
✅ 🧪 bindings ✅ 🛠 ios-sim ✅ 🛠 mac-AS-debug ✅ 🧪 wpe-wk2 ❌ 🧪 win-tests ⏳ 🛠 mac-apple
✅ 🧪 webkitperl ✅ 🧪 ios-wk2 ✅ 🧪 api-mac ✅ 🧪 api-wpe ⏳ 🛠 vision-apple
✅ 🧪 ios-wk2-wpt ✅ 🧪 api-mac-debug ✅ 🛠 gtk3-libwebrtc
✅ 🧪 api-ios ✅ 🧪 mac-wk1 ✅ 🛠 gtk
✅ 🛠 ios-safer-cpp ✅ 🧪 mac-wk2 ✅ 🧪 gtk-wk2
✅ 🛠 vision ✅ 🧪 mac-AS-debug-wk2 ✅ 🧪 api-gtk
✅ 🛠 🧪 merge ✅ 🛠 vision-sim ✅ 🧪 mac-wk2-stress ✅ 🛠 playstation
✅ 🧪 vision-wk2 ✅ 🧪 mac-intel-wk2
✅ 🛠 tv ✅ 🛠 mac-safer-cpp
✅ 🛠 tv-sim
✅ 🛠 watch
✅ 🛠 watch-sim

@cdumez cdumez self-assigned this Apr 21, 2026
@cdumez cdumez added the DOM For bugs specific to XML/HTML DOM elements (including parsing). label Apr 21, 2026
@cdumez cdumez marked this pull request as ready for review April 21, 2026 09:24
@cdumez cdumez requested a review from rniwa as a code owner April 21, 2026 09:24
@webkit-ews-buildbot
Copy link
Copy Markdown
Collaborator

macOS Safer C++ Build #94651 (f96e2ba)

❌ Found 1 failing file with 1 issue. Please address these issues before landing. See WebKit Guidelines for Safer C++ Programming.
(cc @rniwa)

@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Apr 21, 2026
@webkit-ews-buildbot
Copy link
Copy Markdown
Collaborator

iOS Safer C++ Build #13467 (f96e2ba)

❌ Found 1 failing file with 1 issue. Please address these issues before landing. See WebKit Guidelines for Safer C++ Programming.
(cc @rniwa)

@cdumez cdumez removed the merging-blocked Applied to prevent a change from being merged label Apr 21, 2026
@cdumez cdumez force-pushed the 312855_StyledElement branch from f96e2ba to d05794b Compare April 21, 2026 12:28
Copy link
Copy Markdown
Contributor

@annevk annevk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good modulo bots.

@cdumez cdumez added the merge-queue Applied to send a pull request to merge-queue label Apr 22, 2026
https://bugs.webkit.org/show_bug.cgi?id=312855

Reviewed by Anne van Kesteren and Rupin Mittal.

- Extract synchronizeStyleAttributeForSelectorInvalidation() to eliminate
  duplicated style attribute synchronization logic between dirtyStyleAttribute()
  and invalidateStyleAttribute().
- Remove redundant isSVGElement() guard around dynamicDowncast<SVGElement>,
  which already performs the same type check.
- Avoid unnecessary inlineStyleChanged() in setInlineStyleCustomProperty()
  when addParsedProperty() reports no changes were made.
- Cache inlineStyle() in inlineStyleCSSOMWrapper() to avoid double lookup,
  and use nullptr instead of 0.

* Source/WebCore/dom/StyledElement.cpp:
(WebCore::StyledElement::inlineStyleCSSOMWrapper):
(WebCore::StyledElement::synchronizeStyleAttributeForSelectorInvalidation):
(WebCore::StyledElement::dirtyStyleAttribute):
(WebCore::StyledElement::invalidateStyleAttribute):
(WebCore::StyledElement::setInlineStyleCustomProperty):
* Source/WebCore/dom/StyledElement.h:

Canonical link: https://commits.webkit.org/311740@main
@webkit-commit-queue
Copy link
Copy Markdown
Collaborator

Committed 311740@main (353f068): https://commits.webkit.org/311740@main

Reviewed commits have been landed. Closing PR #63199 and removing active labels.

@webkit-commit-queue webkit-commit-queue merged commit 353f068 into WebKit:main Apr 22, 2026
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Apr 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DOM For bugs specific to XML/HTML DOM elements (including parsing).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants