Skip to content

Commit

Permalink
Remove separate ruby user-agent stylesheet and setting
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=270843
rdar://problem/124438539

Reviewed by Anne van Kesteren.

* Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml:

The setting would just disable ruby stylesheet parsing.

=* Source/WebCore/CMakeLists.txt:
=* Source/WebCore/DerivedSources-input.xcfilelist:
=* Source/WebCore/DerivedSources.make:
=* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/css/html.css:
(ruby):
(ruby, rt):
(ruby > rt):
(ruby > :not(rb, rbc, ruby)):
(rt): Deleted.

Move the ruby style rules to the main UA sheet.

* Source/WebCore/css/ruby.css: Removed.
* Source/WebCore/style/UserAgentStyle.cpp:
(WebCore::Style::UserAgentStyle::ensureDefaultStyleSheetsForElement):
* Source/WebCore/style/UserAgentStyle.h:

Canonical link: https://commits.webkit.org/275971@main
  • Loading branch information
anttijk committed Mar 12, 2024
1 parent 40efee6 commit 297c8c1
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 46 deletions.
14 changes: 0 additions & 14 deletions Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -903,20 +903,6 @@ CSS3DTransformInteroperabilityEnabled:
WebCore:
default: true

CSSBasedRubyEnabled:
type: bool
status: stable
category: css
humanReadableName: "CSS based Ruby implementation in IFC"
humanReadableDescription: "CSS based Ruby implementation in IFC"
defaultValue:
WebKitLegacy:
default: true
WebKit:
default: true
WebCore:
default: true

CSSCascadeLayersEnabled:
type: bool
status: stable
Expand Down
1 change: 0 additions & 1 deletion Source/WebCore/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1902,7 +1902,6 @@ set(WebCore_USER_AGENT_STYLE_SHEETS
${WEBCORE_DIR}/css/plugIns.css
${WEBCORE_DIR}/css/popover.css
${WEBCORE_DIR}/css/quirks.css
${WEBCORE_DIR}/css/ruby.css
${WEBCORE_DIR}/css/svg.css
${WEBCORE_DIR}/css/viewTransitions.css
${WEBCORE_DIR}/html/shadow/attachmentElementShadow.css
Expand Down
1 change: 0 additions & 1 deletion Source/WebCore/DerivedSources-input.xcfilelist
Original file line number Diff line number Diff line change
Expand Up @@ -1275,7 +1275,6 @@ $(PROJECT_DIR)/css/process-css-properties.py
$(PROJECT_DIR)/css/process-css-pseudo-selectors.py
$(PROJECT_DIR)/css/process-css-values.py
$(PROJECT_DIR)/css/quirks.css
$(PROJECT_DIR)/css/ruby.css
$(PROJECT_DIR)/css/svg.css
$(PROJECT_DIR)/css/typedom/CSSKeywordValue.idl
$(PROJECT_DIR)/css/typedom/CSSNumericValue.idl
Expand Down
1 change: 0 additions & 1 deletion Source/WebCore/DerivedSources.make
Original file line number Diff line number Diff line change
Expand Up @@ -2035,7 +2035,6 @@ USER_AGENT_STYLE_SHEETS = \
$(WebCore)/css/plugIns.css \
$(WebCore)/css/popover.css \
$(WebCore)/css/quirks.css \
$(WebCore)/css/ruby.css \
$(WebCore)/css/svg.css \
$(WebCore)/css/viewTransitions.css \
$(WebCore)/html/shadow/mac/imageControlsMac.css \
Expand Down
6 changes: 2 additions & 4 deletions Source/WebCore/WebCore.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -19791,7 +19791,6 @@
E47E276716036EDC00EE2AFB /* ExtensionStyleSheets.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ExtensionStyleSheets.cpp; sourceTree = "<group>"; };
E47FC8A125B84D71005495FC /* LoadSchedulingMode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LoadSchedulingMode.h; sourceTree = "<group>"; };
E48137B81DB3B526005C59BF /* StyleValidity.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StyleValidity.h; sourceTree = "<group>"; };
E485DC2D2AB0AC9D00096F56 /* ruby.css */ = {isa = PBXFileReference; lastKnownFileType = text.css; path = ruby.css; sourceTree = "<group>"; };
E4863CFA23842E8700972158 /* RuleData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RuleData.cpp; sourceTree = "<group>"; };
E4863CFD23842E9E00972158 /* RuleData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RuleData.h; sourceTree = "<group>"; };
E49054E82950A98B0041D57B /* CustomPropertyRegistry.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CustomPropertyRegistry.cpp; sourceTree = "<group>"; };
Expand Down Expand Up @@ -21667,10 +21666,10 @@
0D431A7E2B5A3A9700864655 /* DigitalCredential.idl */,
0D494DEC2B5DF3DC00B61C51 /* DigitalCredentialRequestOptions.h */,
0D431A802B5A3A9800864655 /* DigitalCredentialRequestOptions.idl */,
0DA1AE412B9183F900379D42 /* IdentityCredentialsContainer.cpp */,
0DA1AE3F2B91808500379D42 /* IdentityCredentialsContainer.h */,
0D431A842B5A42AB00864655 /* IdentityCredentialProtocol.h */,
0D431A862B5A42AB00864655 /* IdentityCredentialProtocol.idl */,
0DA1AE412B9183F900379D42 /* IdentityCredentialsContainer.cpp */,
0DA1AE3F2B91808500379D42 /* IdentityCredentialsContainer.h */,
0D494DED2B5DF55000B61C51 /* IdentityRequestProvider.h */,
0D431A7F2B5A3A9700864655 /* IdentityRequestProvider.idl */,
0DC0AED92B706E5700AF1E41 /* Navigator+Identity.idl */,
Expand Down Expand Up @@ -36105,7 +36104,6 @@
93CA4C9F09DF93FA00DF8677 /* quirks.css */,
BC4368E70C226E32005EFB5F /* Rect.h */,
93B248992990CD5F00B769E4 /* RectBase.h */,
E485DC2D2AB0AC9D00096F56 /* ruby.css */,
E44B4BB1141650D7002B1D8B /* SelectorChecker.cpp */,
E44B4BB2141650D7002B1D8B /* SelectorChecker.h */,
432D3FE718A8658400D7DC03 /* SelectorCheckerTestFunctions.h */,
Expand Down
18 changes: 12 additions & 6 deletions Source/WebCore/css/html.css
Original file line number Diff line number Diff line change
Expand Up @@ -1364,25 +1364,31 @@ area:any-link {

/* HTML5 ruby elements */

ruby, rt {
text-indent: 0; /* blocks used for ruby rendering should not trigger this */
ruby {
display: ruby;
}

rt {
line-height: normal;
text-emphasis: none;
ruby, rt {
text-indent: 0;
}

ruby > rt {
display: block;
display: ruby-text;
font-size: -webkit-ruby-text;
text-align: start;
line-height: normal;
text-emphasis: none;
}

ruby > rp {
display: none;
}

/* Avoid wrapping children of implicit ruby bases. We don't support <rb> or <rbc>, avoid giving them any behaviors. */
ruby > :not(rb, rbc, ruby) {
white-space: nowrap;
}

/* other elements */

frameset, frame {
Expand Down
12 changes: 0 additions & 12 deletions Source/WebCore/css/ruby.css

This file was deleted.

6 changes: 0 additions & 6 deletions Source/WebCore/style/UserAgentStyle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ StyleSheetContents* UserAgentStyle::plugInsStyleSheet;
StyleSheetContents* UserAgentStyle::horizontalFormControlsStyleSheet;
StyleSheetContents* UserAgentStyle::htmlSwitchControlStyleSheet;
StyleSheetContents* UserAgentStyle::counterStylesStyleSheet;
StyleSheetContents* UserAgentStyle::rubyStyleSheet;
StyleSheetContents* UserAgentStyle::viewTransitionsStyleSheet;
#if ENABLE(FULLSCREEN_API)
StyleSheetContents* UserAgentStyle::fullscreenStyleSheet;
Expand Down Expand Up @@ -265,11 +264,6 @@ void UserAgentStyle::ensureDefaultStyleSheetsForElement(const Element& element)
addToCounterStyleRegistry(*counterStylesStyleSheet);
}

if (!rubyStyleSheet && element.document().settings().cssBasedRubyEnabled()) {
rubyStyleSheet = parseUASheet(StringImpl::createWithoutCopying(rubyUserAgentStyleSheet, sizeof(rubyUserAgentStyleSheet)));
addToDefaultStyle(*rubyStyleSheet);
}

#if ENABLE(FULLSCREEN_API)
if (CheckedPtr fullscreenManager = element.document().fullscreenManagerIfExists(); !fullscreenStyleSheet && fullscreenManager && fullscreenManager->isFullscreen()) {
fullscreenStyleSheet = parseUASheet(StringImpl::createWithoutCopying(fullscreenUserAgentStyleSheet, sizeof(fullscreenUserAgentStyleSheet)));
Expand Down
1 change: 0 additions & 1 deletion Source/WebCore/style/UserAgentStyle.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ class UserAgentStyle {
static StyleSheetContents* plugInsStyleSheet;
static StyleSheetContents* popoverStyleSheet;
static StyleSheetContents* counterStylesStyleSheet;
static StyleSheetContents* rubyStyleSheet;
static StyleSheetContents* viewTransitionsStyleSheet;
#if ENABLE(FULLSCREEN_API)
static StyleSheetContents* fullscreenStyleSheet;
Expand Down

0 comments on commit 297c8c1

Please sign in to comment.