Diff
Modified: trunk/Source/WebCore/ChangeLog (283756 => 283757)
--- trunk/Source/WebCore/ChangeLog 2021-10-07 23:37:01 UTC (rev 283756)
+++ trunk/Source/WebCore/ChangeLog 2021-10-07 23:43:09 UTC (rev 283757)
@@ -1,3 +1,137 @@
+2021-10-07 Aditya Keerthi <[email protected]>
+
+ Introduce ShadowPseudoIds to store all UA shadow root pseudo-element ids
+ https://bugs.webkit.org/show_bug.cgi?id=231383
+
+ Reviewed by Wenson Hsieh.
+
+ Organize all UA shadow root pseudo-element ids in ShadowPseudoIds.
+
+ This refactoring also enables detection of a specific UA shadow root
+ element (for example: answering the question "is this element a caps
+ lock indicator?"). The implementation of 'appearance: auto' relies on
+ being able to to answer that question.
+
+ * Sources.txt:
+ * WebCore.xcodeproj/project.pbxproj:
+ * html/BaseDateAndTimeInputType.cpp:
+ (WebCore::BaseDateAndTimeInputType::createShadowSubtreeAndUpdateInnerTextElementEditability):
+ * html/ColorInputType.cpp:
+ (WebCore::ColorInputType::createShadowSubtreeAndUpdateInnerTextElementEditability):
+ * html/FileInputType.cpp:
+ (WebCore::UploadButtonElement::createInternal):
+ * html/HTMLKeygenElement.cpp:
+ * html/HTMLMeterElement.cpp:
+ (WebCore::setValueClass):
+ (WebCore::HTMLMeterElement::didAddUserAgentShadowRoot):
+ * html/RangeInputType.cpp:
+ (WebCore::RangeInputType::createShadowSubtreeAndUpdateInnerTextElementEditability):
+ * html/SearchInputType.cpp:
+ (WebCore::updateResultButtonPseudoType):
+ * html/TextFieldInputType.cpp:
+ (WebCore::TextFieldInputType::createShadowSubtreeAndUpdateInnerTextElementEditability):
+ (WebCore::TextFieldInputType::createDataListDropdownIndicator):
+ (WebCore::autoFillButtonTypeToAutoFillButtonPseudoClassName):
+ (WebCore::isAutoFillButtonTypeChanged):
+ (WebCore::TextFieldInputType::createContainer):
+ * html/ValidationMessage.cpp:
+ (WebCore::ValidationMessage::buildBubbleTree):
+ * html/shadow/DateTimeEditElement.cpp:
+ (WebCore::DateTimeEditBuilder::visitLiteral):
+ (WebCore::DateTimeEditElement::create):
+ (WebCore::DateTimeEditElement::layout):
+ * html/shadow/DetailsMarkerControl.cpp:
+ (WebCore::DetailsMarkerControl::create):
+ * html/shadow/MediaControlTextTrackContainerElement.cpp:
+ (WebCore::MediaControlTextTrackContainerElement::create):
+ * html/shadow/ProgressShadowElement.cpp:
+ (WebCore::ProgressInnerElement::create):
+ (WebCore::ProgressBarElement::create):
+ (WebCore::ProgressValueElement::create):
+ * html/shadow/ShadowPseudoIds.cpp: Added.
+ (WebCore::ShadowPseudoIds::cue):
+ (WebCore::ShadowPseudoIds::fileSelectorButton):
+ (WebCore::ShadowPseudoIds::placeholder):
+ (WebCore::ShadowPseudoIds::webkitContactsAutoFillButton):
+ (WebCore::ShadowPseudoIds::webkitCredentialsAutoFillButton):
+ (WebCore::ShadowPseudoIds::webkitCreditCardAutoFillButton):
+ (WebCore::ShadowPseudoIds::webkitStrongPasswordAutoFillButton):
+ (WebCore::ShadowPseudoIds::webkitCapsLockIndicator):
+ (WebCore::ShadowPseudoIds::webkitColorSwatch):
+ (WebCore::ShadowPseudoIds::webkitColorSwatchWrapper):
+ (WebCore::ShadowPseudoIds::webkitDatetimeEdit):
+ (WebCore::ShadowPseudoIds::webkitDatetimeEditText):
+ (WebCore::ShadowPseudoIds::webkitDatetimeEditFieldsWrapper):
+ (WebCore::ShadowPseudoIds::webkitDateAndTimeValue):
+ (WebCore::ShadowPseudoIds::webkitDetailsMarker):
+ (WebCore::ShadowPseudoIds::webkitGenericCueRoot):
+ (WebCore::ShadowPseudoIds::webkitInnerSpinButton):
+ (WebCore::ShadowPseudoIds::webkitKeygenSelect):
+ (WebCore::ShadowPseudoIds::webkitListButton):
+ (WebCore::ShadowPseudoIds::webkitMediaSliderThumb):
+ (WebCore::ShadowPseudoIds::webkitMediaSliderContainer):
+ (WebCore::ShadowPseudoIds::webkitMediaTextTrackContainer):
+ (WebCore::ShadowPseudoIds::webkitMediaTextTrackDisplay):
+ (WebCore::ShadowPseudoIds::webkitMediaTextTrackDisplayBackdrop):
+ (WebCore::ShadowPseudoIds::webkitMediaTextTrackRegion):
+ (WebCore::ShadowPseudoIds::webkitMediaTextTrackRegionContainer):
+ (WebCore::ShadowPseudoIds::webkitMeterBar):
+ (WebCore::ShadowPseudoIds::webkitMeterInnerElement):
+ (WebCore::ShadowPseudoIds::webkitMeterOptimumValue):
+ (WebCore::ShadowPseudoIds::webkitMeterSuboptimumValue):
+ (WebCore::ShadowPseudoIds::webkitMeterEvenLessGoodValue):
+ (WebCore::ShadowPseudoIds::webkitPluginReplacement):
+ (WebCore::ShadowPseudoIds::webkitProgressBar):
+ (WebCore::ShadowPseudoIds::webkitProgressValue):
+ (WebCore::ShadowPseudoIds::webkitProgressInnerElement):
+ (WebCore::ShadowPseudoIds::webkitSearchDecoration):
+ (WebCore::ShadowPseudoIds::webkitSearchResultsButton):
+ (WebCore::ShadowPseudoIds::webkitSearchResultsDecoration):
+ (WebCore::ShadowPseudoIds::webkitSearchCancelButton):
+ (WebCore::ShadowPseudoIds::webkitSliderRunnableTrack):
+ (WebCore::ShadowPseudoIds::webkitSliderThumb):
+ (WebCore::ShadowPseudoIds::webkitSliderContainer):
+ (WebCore::ShadowPseudoIds::webkitTextfieldDecorationContainer):
+ (WebCore::ShadowPseudoIds::webkitValidationBubble):
+ (WebCore::ShadowPseudoIds::webkitValidationBubbleArrowClipper):
+ (WebCore::ShadowPseudoIds::webkitValidationBubbleArrow):
+ (WebCore::ShadowPseudoIds::webkitValidationBubbleMessage):
+ (WebCore::ShadowPseudoIds::webkitValidationBubbleIcon):
+ (WebCore::ShadowPseudoIds::webkitValidationBubbleTextBlock):
+ (WebCore::ShadowPseudoIds::webkitValidationBubbleHeading):
+ (WebCore::ShadowPseudoIds::webkitValidationBubbleBody):
+ * html/shadow/ShadowPseudoIds.h: Added.
+ * html/shadow/SliderThumbElement.cpp:
+ (WebCore::SliderThumbElement::resolveCustomStyle):
+ (WebCore::SliderContainerElement::resolveCustomStyle):
+ * html/shadow/SpinButtonElement.cpp:
+ (WebCore::SpinButtonElement::create):
+ * html/shadow/TextControlInnerElements.cpp:
+ (WebCore::TextControlPlaceholderElement::create):
+ (WebCore::SearchFieldCancelButtonElement::create):
+ * html/shadow/YouTubeEmbedShadowElement.cpp:
+ (WebCore::YouTubeEmbedShadowElement::create):
+ * html/track/TextTrackCue.cpp:
+ (WebCore::TextTrackCueBox::initialize):
+ (WebCore::tagPseudoObjects):
+ (WebCore::TextTrackCue::rebuildDisplayTree):
+ (WebCore::TextTrackCue::cueShadowPseudoId): Deleted.
+ (WebCore::TextTrackCue::cueBoxShadowPseudoId): Deleted.
+ (WebCore::TextTrackCue::cueBackdropShadowPseudoId): Deleted.
+ * html/track/TextTrackCue.h:
+ * html/track/VTTCue.cpp:
+ (WebCore::VTTCue::getDisplayTree):
+ * html/track/VTTRegion.cpp:
+ (WebCore::VTTRegion::getDisplayTree):
+ (WebCore::VTTRegion::prepareRegionDisplayTree):
+ (WebCore::VTTRegion::textTrackCueContainerShadowPseudoId): Deleted.
+ (WebCore::VTTRegion::textTrackRegionShadowPseudoId): Deleted.
+ * html/track/VTTRegion.h:
+ * page/CaptionUserPreferencesMediaAF.cpp:
+ (WebCore::CaptionUserPreferencesMediaAF::captionsStyleSheetOverride const):
+ * style/RuleData.cpp:
+ (WebCore::Style::determinePropertyAllowlistType):
+
2021-10-07 Myles C. Maxfield <[email protected]>
Shadowing of @font-palette-values rules doesn't work
Modified: trunk/Source/WebCore/Sources.txt (283756 => 283757)
--- trunk/Source/WebCore/Sources.txt 2021-10-07 23:37:01 UTC (rev 283756)
+++ trunk/Source/WebCore/Sources.txt 2021-10-07 23:43:09 UTC (rev 283757)
@@ -1381,6 +1381,7 @@
html/shadow/DateTimeSymbolicFieldElement.cpp
html/shadow/MediaControlTextTrackContainerElement.cpp
html/shadow/ProgressShadowElement.cpp
+html/shadow/ShadowPseudoIds.cpp
html/shadow/SliderThumbElement.cpp
html/shadow/SpinButtonElement.cpp
html/shadow/TextControlInnerElements.cpp
Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (283756 => 283757)
--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2021-10-07 23:37:01 UTC (rev 283756)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2021-10-07 23:43:09 UTC (rev 283757)
@@ -5331,6 +5331,7 @@
E4F819C626FB4EBF0094E162 /* InlineBoxPainter.h in Headers */ = {isa = PBXBuildFile; fileRef = E4F819C526FB4EBF0094E162 /* InlineBoxPainter.h */; };
E4F9EEF3156DA00700D23E7E /* StyleSheetContents.h in Headers */ = {isa = PBXBuildFile; fileRef = E4F9EEF1156D84C400D23E7E /* StyleSheetContents.h */; settings = {ATTRIBUTES = (Private, ); }; };
E50620842540919C00C43091 /* ContactsRequestData.h in Headers */ = {isa = PBXBuildFile; fileRef = E50620832540919B00C43091 /* ContactsRequestData.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ E51194BF270E7E4A0064FCBA /* ShadowPseudoIds.h in Headers */ = {isa = PBXBuildFile; fileRef = E51194BD270E7E4A0064FCBA /* ShadowPseudoIds.h */; };
E516699120FF9918009D2C27 /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = E516698F20FF9916009D2C27 /* [email protected] */; };
E517670320B88C1400D41167 /* DataListSuggestionInformation.h in Headers */ = {isa = PBXBuildFile; fileRef = E517670220B88C1400D41167 /* DataListSuggestionInformation.h */; settings = {ATTRIBUTES = (Private, ); }; };
E51D6A1F24E1E25500891CFA /* DateTimeFieldsState.h in Headers */ = {isa = PBXBuildFile; fileRef = E51D6A1D24E1E25500891CFA /* DateTimeFieldsState.h */; };
@@ -16667,6 +16668,8 @@
E4F9EEF1156D84C400D23E7E /* StyleSheetContents.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StyleSheetContents.h; sourceTree = "<group>"; };
E4FB4B35239BEB10003C336A /* LayoutIntegrationInlineContent.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = LayoutIntegrationInlineContent.cpp; sourceTree = "<group>"; };
E50620832540919B00C43091 /* ContactsRequestData.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ContactsRequestData.h; sourceTree = "<group>"; };
+ E51194BD270E7E4A0064FCBA /* ShadowPseudoIds.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ShadowPseudoIds.h; sourceTree = "<group>"; };
+ E51194BE270E7E4A0064FCBA /* ShadowPseudoIds.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = ShadowPseudoIds.cpp; sourceTree = "<group>"; };
E516698F20FF9916009D2C27 /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
E517670220B88C1400D41167 /* DataListSuggestionInformation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DataListSuggestionInformation.h; sourceTree = "<group>"; };
E51A81DE17298D7700BFCA61 /* JSPerformance.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSPerformance.cpp; sourceTree = "<group>"; };
@@ -19676,6 +19679,8 @@
E4E243821DAB953E00C26E4B /* meterElementShadow.css */,
A715E650134BBBEC00D8E713 /* ProgressShadowElement.cpp */,
A715E651134BBBEC00D8E713 /* ProgressShadowElement.h */,
+ E51194BE270E7E4A0064FCBA /* ShadowPseudoIds.cpp */,
+ E51194BD270E7E4A0064FCBA /* ShadowPseudoIds.h */,
4150F9F012B6E0E70008C860 /* SliderThumbElement.cpp */,
4150F9EF12B6E0E70008C860 /* SliderThumbElement.h */,
4512502015DCE37D002F84E2 /* SpinButtonElement.cpp */,
@@ -35223,6 +35228,7 @@
41BBA866257E373B00AC7F6D /* SFrameUtils.h in Headers */,
0F3DD45012F5EA1B000D9190 /* ShadowBlur.h in Headers */,
BC5EB8C40E82031B00B25965 /* ShadowData.h in Headers */,
+ E51194BF270E7E4A0064FCBA /* ShadowPseudoIds.h in Headers */,
A6D169641346B4C1000EB770 /* ShadowRoot.h in Headers */,
056A7AC8256C4F48002F9DDC /* ShadowRootInit.h in Headers */,
46DFF4981DC2603100B80B48 /* ShadowRootMode.h in Headers */,
Modified: trunk/Source/WebCore/html/BaseDateAndTimeInputType.cpp (283756 => 283757)
--- trunk/Source/WebCore/html/BaseDateAndTimeInputType.cpp 2021-10-07 23:37:01 UTC (rev 283756)
+++ trunk/Source/WebCore/html/BaseDateAndTimeInputType.cpp 2021-10-07 23:43:09 UTC (rev 283757)
@@ -50,6 +50,7 @@
#include "Page.h"
#include "PlatformLocale.h"
#include "Settings.h"
+#include "ShadowPseudoIds.h"
#include "ShadowRoot.h"
#include "StepRange.h"
#include "Text.h"
@@ -317,9 +318,8 @@
m_dateTimeEditElement = DateTimeEditElement::create(document, *this);
element.userAgentShadowRoot()->appendChild(source, *m_dateTimeEditElement);
} else {
- static MainThreadNeverDestroyed<const AtomString> valueContainerPseudo("-webkit-date-and-time-value", AtomString::ConstructFromLiteral);
auto valueContainer = HTMLDivElement::create(document);
- valueContainer->setPseudo(valueContainerPseudo);
+ valueContainer->setPseudo(ShadowPseudoIds::webkitDateAndTimeValue());
element.userAgentShadowRoot()->appendChild(source, valueContainer);
}
updateInnerTextValue();
Modified: trunk/Source/WebCore/html/ColorInputType.cpp (283756 => 283757)
--- trunk/Source/WebCore/html/ColorInputType.cpp 2021-10-07 23:37:01 UTC (rev 283756)
+++ trunk/Source/WebCore/html/ColorInputType.cpp 2021-10-07 23:43:09 UTC (rev 283757)
@@ -47,6 +47,7 @@
#include "InputTypeNames.h"
#include "RenderView.h"
#include "ScopedEventQueue.h"
+#include "ShadowPseudoIds.h"
#include "ShadowRoot.h"
#include "UserGestureIndicator.h"
@@ -140,14 +141,11 @@
ASSERT(element());
ASSERT(element()->shadowRoot());
- static MainThreadNeverDestroyed<const AtomString> webkitColorSwatchName("-webkit-color-swatch", AtomString::ConstructFromLiteral);
- static MainThreadNeverDestroyed<const AtomString> webkitColorSwatchWrapperName("-webkit-color-swatch-wrapper", AtomString::ConstructFromLiteral);
-
Document& document = element()->document();
auto wrapperElement = HTMLDivElement::create(document);
- wrapperElement->setPseudo(webkitColorSwatchWrapperName);
+ wrapperElement->setPseudo(ShadowPseudoIds::webkitColorSwatchWrapper());
auto colorSwatch = HTMLDivElement::create(document);
- colorSwatch->setPseudo(webkitColorSwatchName);
+ colorSwatch->setPseudo(ShadowPseudoIds::webkitColorSwatch());
wrapperElement->appendChild(source, colorSwatch);
element()->userAgentShadowRoot()->appendChild(source, wrapperElement);
Modified: trunk/Source/WebCore/html/FileInputType.cpp (283756 => 283757)
--- trunk/Source/WebCore/html/FileInputType.cpp 2021-10-07 23:37:01 UTC (rev 283756)
+++ trunk/Source/WebCore/html/FileInputType.cpp 2021-10-07 23:43:09 UTC (rev 283757)
@@ -41,6 +41,7 @@
#include "RenderFileUploadControl.h"
#include "RuntimeEnabledFeatures.h"
#include "Settings.h"
+#include "ShadowPseudoIds.h"
#include "ShadowRoot.h"
#include "UserGestureIndicator.h"
#include <wtf/FileSystem.h>
@@ -66,6 +67,7 @@
using namespace HTMLNames;
+// FIXME: This can likely be an HTMLDivElement.
class UploadButtonElement final : public HTMLInputElement {
WTF_MAKE_ISO_ALLOCATED_INLINE(UploadButtonElement);
public:
@@ -93,9 +95,8 @@
{
auto button = adoptRef(*new UploadButtonElement(document));
static MainThreadNeverDestroyed<const AtomString> buttonName("button", AtomString::ConstructFromLiteral);
- static MainThreadNeverDestroyed<const AtomString> fileSelectorButtonName("file-selector-button", AtomString::ConstructFromLiteral);
button->setType(buttonName);
- button->setPseudo(fileSelectorButtonName);
+ button->setPseudo(ShadowPseudoIds::fileSelectorButton());
button->setValue(value);
return button;
}
Modified: trunk/Source/WebCore/html/HTMLKeygenElement.cpp (283756 => 283757)
--- trunk/Source/WebCore/html/HTMLKeygenElement.cpp 2021-10-07 23:37:01 UTC (rev 283756)
+++ trunk/Source/WebCore/html/HTMLKeygenElement.cpp 2021-10-07 23:43:09 UTC (rev 283757)
@@ -33,6 +33,7 @@
#include "HTMLSelectElement.h"
#include "HTMLOptionElement.h"
#include "SSLKeyGenerator.h"
+#include "ShadowPseudoIds.h"
#include "ShadowRoot.h"
#include "Text.h"
#include <wtf/IsoMallocInlines.h>
@@ -51,8 +52,7 @@
static Ref<KeygenSelectElement> create(Document& document)
{
auto element = adoptRef(*new KeygenSelectElement(document));
- static MainThreadNeverDestroyed<const AtomString> pseudoId("-webkit-keygen-select", AtomString::ConstructFromLiteral);
- element->setPseudo(pseudoId);
+ element->setPseudo(ShadowPseudoIds::webkitKeygenSelect());
return element;
}
Modified: trunk/Source/WebCore/html/HTMLMeterElement.cpp (283756 => 283757)
--- trunk/Source/WebCore/html/HTMLMeterElement.cpp 2021-10-07 23:37:01 UTC (rev 283756)
+++ trunk/Source/WebCore/html/HTMLMeterElement.cpp 2021-10-07 23:43:09 UTC (rev 283757)
@@ -31,6 +31,7 @@
#include "Page.h"
#include "RenderMeter.h"
#include "RenderTheme.h"
+#include "ShadowPseudoIds.h"
#include "ShadowRoot.h"
#include "UserAgentStyleSheets.h"
#include <wtf/IsoMallocInlines.h>
@@ -190,15 +191,15 @@
switch (gaugeRegion) {
case HTMLMeterElement::GaugeRegionOptimum:
element.setAttribute(HTMLNames::classAttr, "optimum");
- element.setPseudo("-webkit-meter-optimum-value");
+ element.setPseudo(ShadowPseudoIds::webkitMeterOptimumValue());
return;
case HTMLMeterElement::GaugeRegionSuboptimal:
element.setAttribute(HTMLNames::classAttr, "suboptimum");
- element.setPseudo("-webkit-meter-suboptimum-value");
+ element.setPseudo(ShadowPseudoIds::webkitMeterSuboptimumValue());
return;
case HTMLMeterElement::GaugeRegionEvenLessGood:
element.setAttribute(HTMLNames::classAttr, "even-less-good");
- element.setPseudo("-webkit-meter-even-less-good-value");
+ element.setPseudo(ShadowPseudoIds::webkitMeterEvenLessGoodValue());
return;
default:
ASSERT_NOT_REACHED();
@@ -234,12 +235,12 @@
// Pseudos are set to allow author styling.
auto inner = HTMLDivElement::create(document());
inner->setIdAttribute("inner");
- inner->setPseudo("-webkit-meter-inner-element");
+ inner->setPseudo(ShadowPseudoIds::webkitMeterInnerElement());
root.appendChild(inner);
auto bar = HTMLDivElement::create(document());
bar->setIdAttribute("bar");
- bar->setPseudo("-webkit-meter-bar");
+ bar->setPseudo(ShadowPseudoIds::webkitMeterBar());
inner->appendChild(bar);
m_value = HTMLDivElement::create(document());
Modified: trunk/Source/WebCore/html/RangeInputType.cpp (283756 => 283757)
--- trunk/Source/WebCore/html/RangeInputType.cpp 2021-10-07 23:37:01 UTC (rev 283756)
+++ trunk/Source/WebCore/html/RangeInputType.cpp 2021-10-07 23:43:09 UTC (rev 283757)
@@ -46,6 +46,7 @@
#include "RenderSlider.h"
#include "RuntimeEnabledFeatures.h"
#include "ScopedEventQueue.h"
+#include "ShadowPseudoIds.h"
#include "ShadowRoot.h"
#include "SliderThumbElement.h"
#include "StepRange.h"
@@ -249,10 +250,9 @@
ASSERT(element());
ASSERT(element()->userAgentShadowRoot());
- static MainThreadNeverDestroyed<const AtomString> webkitSliderRunnableTrackName("-webkit-slider-runnable-track", AtomString::ConstructFromLiteral);
Document& document = element()->document();
auto track = HTMLDivElement::create(document);
- track->setPseudo(webkitSliderRunnableTrackName);
+ track->setPseudo(ShadowPseudoIds::webkitSliderRunnableTrack());
track->appendChild(source, SliderThumbElement::create(document));
auto container = SliderContainerElement::create(document);
container->appendChild(source, track);
Modified: trunk/Source/WebCore/html/SearchInputType.cpp (283756 => 283757)
--- trunk/Source/WebCore/html/SearchInputType.cpp 2021-10-07 23:37:01 UTC (rev 283756)
+++ trunk/Source/WebCore/html/SearchInputType.cpp 2021-10-07 23:43:09 UTC (rev 283757)
@@ -37,6 +37,7 @@
#include "InputTypeNames.h"
#include "KeyboardEvent.h"
#include "RenderSearchField.h"
+#include "ShadowPseudoIds.h"
#include "ShadowRoot.h"
#include "TextControlInnerElements.h"
@@ -65,15 +66,12 @@
static void updateResultButtonPseudoType(SearchFieldResultsButtonElement& resultButton, int maxResults)
{
- static MainThreadNeverDestroyed<const AtomString> webkitSearchDecorationName("-webkit-search-decoration", AtomString::ConstructFromLiteral);
- static MainThreadNeverDestroyed<const AtomString> webkitSearchResultsDecorationName("-webkit-search-results-decoration", AtomString::ConstructFromLiteral);
- static MainThreadNeverDestroyed<const AtomString> webkitSearchResultsButtonName("-webkit-search-results-button", AtomString::ConstructFromLiteral);
if (!maxResults)
- resultButton.setPseudo(webkitSearchResultsDecorationName);
+ resultButton.setPseudo(ShadowPseudoIds::webkitSearchResultsDecoration());
else if (maxResults < 0)
- resultButton.setPseudo(webkitSearchDecorationName);
+ resultButton.setPseudo(ShadowPseudoIds::webkitSearchDecoration());
else
- resultButton.setPseudo(webkitSearchResultsButtonName);
+ resultButton.setPseudo(ShadowPseudoIds::webkitSearchResultsButton());
}
void SearchInputType::attributeChanged(const QualifiedName& name)
Modified: trunk/Source/WebCore/html/TextFieldInputType.cpp (283756 => 283757)
--- trunk/Source/WebCore/html/TextFieldInputType.cpp 2021-10-07 23:37:01 UTC (rev 283756)
+++ trunk/Source/WebCore/html/TextFieldInputType.cpp 2021-10-07 23:43:09 UTC (rev 283757)
@@ -55,6 +55,7 @@
#include "RuntimeEnabledFeatures.h"
#include "ScriptDisallowedScope.h"
#include "Settings.h"
+#include "ShadowPseudoIds.h"
#include "ShadowRoot.h"
#include "TextControlInnerElements.h"
#include "TextEvent.h"
@@ -348,9 +349,8 @@
}
if (shouldHaveCapsLockIndicator) {
- static MainThreadNeverDestroyed<const AtomString> webkitCapsLockIndicatorName("-webkit-caps-lock-indicator", AtomString::ConstructFromLiteral);
m_capsLockIndicator = HTMLDivElement::create(document);
- m_capsLockIndicator->setPseudo(webkitCapsLockIndicatorName);
+ m_capsLockIndicator->setPseudo(ShadowPseudoIds::webkitCapsLockIndicator());
bool shouldDrawCapsLockIndicator = this->shouldDrawCapsLockIndicator();
m_capsLockIndicator->setInlineStyleProperty(CSSPropertyDisplay, shouldDrawCapsLockIndicator ? CSSValueBlock : CSSValueNone, true);
@@ -456,11 +456,10 @@
if (!m_container)
createContainer();
- static MainThreadNeverDestroyed<const AtomString> webkitListButtonName("-webkit-list-button", AtomString::ConstructFromLiteral);
ScriptDisallowedScope::EventAllowedScope allowedScope(*m_container);
m_dataListDropdownIndicator = DataListButtonElement::create(element()->document(), *this);
m_container->appendChild(*m_dataListDropdownIndicator);
- m_dataListDropdownIndicator->setPseudo(webkitListButtonName);
+ m_dataListDropdownIndicator->setPseudo(ShadowPseudoIds::webkitListButton());
m_dataListDropdownIndicator->setInlineStyleProperty(CSSPropertyDisplay, CSSValueNone, true);
}
@@ -529,13 +528,13 @@
{
switch (autoFillButtonType) {
case AutoFillButtonType::Contacts:
- return { "-webkit-contacts-auto-fill-button", AtomString::ConstructFromLiteral };
+ return ShadowPseudoIds::webkitContactsAutoFillButton();
case AutoFillButtonType::Credentials:
- return { "-webkit-credentials-auto-fill-button", AtomString::ConstructFromLiteral };
+ return ShadowPseudoIds::webkitCredentialsAutoFillButton();
case AutoFillButtonType::StrongPassword:
- return { "-webkit-strong-password-auto-fill-button", AtomString::ConstructFromLiteral };
+ return ShadowPseudoIds::webkitStrongPasswordAutoFillButton();
case AutoFillButtonType::CreditCard:
- return { "-webkit-credit-card-auto-fill-button", AtomString::ConstructFromLiteral };
+ return ShadowPseudoIds::webkitCreditCardAutoFillButton();
case AutoFillButtonType::None:
ASSERT_NOT_REACHED();
return emptyAtom();
@@ -546,13 +545,13 @@
static bool isAutoFillButtonTypeChanged(const AtomString& attribute, AutoFillButtonType autoFillButtonType)
{
- if (attribute == "-webkit-contacts-auto-fill-button" && autoFillButtonType != AutoFillButtonType::Contacts)
+ if (attribute == ShadowPseudoIds::webkitContactsAutoFillButton() && autoFillButtonType != AutoFillButtonType::Contacts)
return true;
- if (attribute == "-webkit-credentials-auto-fill-button" && autoFillButtonType != AutoFillButtonType::Credentials)
+ if (attribute == ShadowPseudoIds::webkitCredentialsAutoFillButton() && autoFillButtonType != AutoFillButtonType::Credentials)
return true;
- if (attribute == "-webkit-strong-password-auto-fill-button" && autoFillButtonType != AutoFillButtonType::StrongPassword)
+ if (attribute == ShadowPseudoIds::webkitStrongPasswordAutoFillButton() && autoFillButtonType != AutoFillButtonType::StrongPassword)
return true;
- if (attribute == "-webkit-credit-card-auto-fill-button" && autoFillButtonType != AutoFillButtonType::CreditCard)
+ if (attribute == ShadowPseudoIds::webkitCreditCardAutoFillButton() && autoFillButtonType != AutoFillButtonType::CreditCard)
return true;
return false;
}
@@ -790,7 +789,7 @@
m_container = TextControlInnerContainer::create(element()->document());
element()->userAgentShadowRoot()->appendChild(*m_container);
- m_container->setPseudo(webkitTextfieldDecorationContainerName);
+ m_container->setPseudo(ShadowPseudoIds::webkitTextfieldDecorationContainer());
m_innerBlock = TextControlInnerElement::create(element()->document());
m_container->appendChild(*m_innerBlock);
Modified: trunk/Source/WebCore/html/ValidationMessage.cpp (283756 => 283757)
--- trunk/Source/WebCore/html/ValidationMessage.cpp 2021-10-07 23:37:01 UTC (rev 283756)
+++ trunk/Source/WebCore/html/ValidationMessage.cpp 2021-10-07 23:43:09 UTC (rev 283757)
@@ -43,6 +43,7 @@
#include "RenderObject.h"
#include "ScriptDisallowedScope.h"
#include "Settings.h"
+#include "ShadowPseudoIds.h"
#include "ShadowRoot.h"
#include "StyleResolver.h"
#include "Text.h"
@@ -189,19 +190,10 @@
ScriptDisallowedScope::InMainThread scriptDisallowedScope;
ScriptDisallowedScope::EventAllowedScope allowedScope(shadowRoot);
- static MainThreadNeverDestroyed<const AtomString> webkitValidationBubbleName("-webkit-validation-bubble", AtomString::ConstructFromLiteral);
- static MainThreadNeverDestroyed<const AtomString> webkitValidationBubbleArrowClipperName("-webkit-validation-bubble-arrow-clipper", AtomString::ConstructFromLiteral);
- static MainThreadNeverDestroyed<const AtomString> webkitValidationBubbleArrowName("-webkit-validation-bubble-arrow", AtomString::ConstructFromLiteral);
- static MainThreadNeverDestroyed<const AtomString> webkitValidationBubbleMessageName("-webkit-validation-bubble-message", AtomString::ConstructFromLiteral);
- static MainThreadNeverDestroyed<const AtomString> webkitValidationBubbleIconName("-webkit-validation-bubble-icon", AtomString::ConstructFromLiteral);
- static MainThreadNeverDestroyed<const AtomString> webkitValidationBubbleTextBlockName("-webkit-validation-bubble-text-block", AtomString::ConstructFromLiteral);
- static MainThreadNeverDestroyed<const AtomString> webkitValidationBubbleHeadingName("-webkit-validation-bubble-heading", AtomString::ConstructFromLiteral);
- static MainThreadNeverDestroyed<const AtomString> webkitValidationBubbleBodyName("-webkit-validation-bubble-body", AtomString::ConstructFromLiteral);
-
Document& document = m_element->document();
m_bubble = HTMLDivElement::create(document);
shadowRoot->appendChild(*m_bubble);
- m_bubble->setPseudo(webkitValidationBubbleName);
+ m_bubble->setPseudo(ShadowPseudoIds::webkitValidationBubble());
// Need to force position:absolute because RenderMenuList doesn't assume it
// contains non-absolute or non-fixed renderers as children.
m_bubble->setInlineStyleProperty(CSSPropertyPosition, CSSValueAbsolute);
@@ -208,26 +200,26 @@
auto clipper = HTMLDivElement::create(document);
m_bubble->appendChild(clipper);
- clipper->setPseudo(webkitValidationBubbleArrowClipperName);
+ clipper->setPseudo(ShadowPseudoIds::webkitValidationBubbleArrowClipper());
auto bubbleArrow = HTMLDivElement::create(document);
clipper->appendChild(bubbleArrow);
- bubbleArrow->setPseudo(webkitValidationBubbleArrowName);
+ bubbleArrow->setPseudo(ShadowPseudoIds::webkitValidationBubbleArrow());
auto message = HTMLDivElement::create(document);
m_bubble->appendChild(message);
- message->setPseudo(webkitValidationBubbleMessageName);
+ message->setPseudo(ShadowPseudoIds::webkitValidationBubbleMessage());
auto icon = HTMLDivElement::create(document);
message->appendChild(icon);
- icon->setPseudo(webkitValidationBubbleIconName);
+ icon->setPseudo(ShadowPseudoIds::webkitValidationBubbleIcon());
auto textBlock = HTMLDivElement::create(document);
message->appendChild(textBlock);
- textBlock->setPseudo(webkitValidationBubbleTextBlockName);
+ textBlock->setPseudo(ShadowPseudoIds::webkitValidationBubbleTextBlock());
m_messageHeading = HTMLDivElement::create(document);
textBlock->appendChild(*m_messageHeading);
- m_messageHeading->setPseudo(webkitValidationBubbleHeadingName);
+ m_messageHeading->setPseudo(ShadowPseudoIds::webkitValidationBubbleHeading());
m_messageBody = HTMLDivElement::create(document);
textBlock->appendChild(*m_messageBody);
- m_messageBody->setPseudo(webkitValidationBubbleBodyName);
+ m_messageBody->setPseudo(ShadowPseudoIds::webkitValidationBubbleBody());
setMessageDOMAndStartTimer();
Modified: trunk/Source/WebCore/html/shadow/DateTimeEditElement.cpp (283756 => 283757)
--- trunk/Source/WebCore/html/shadow/DateTimeEditElement.cpp 2021-10-07 23:37:01 UTC (rev 283756)
+++ trunk/Source/WebCore/html/shadow/DateTimeEditElement.cpp 2021-10-07 23:43:09 UTC (rev 283757)
@@ -36,6 +36,7 @@
#include "DateTimeSymbolicFieldElement.h"
#include "HTMLNames.h"
#include "PlatformLocale.h"
+#include "ShadowPseudoIds.h"
#include "Text.h"
#include <wtf/IsoMallocInlines.h>
#include <wtf/text/StringBuilder.h>
@@ -167,9 +168,9 @@
void DateTimeEditBuilder::visitLiteral(const String& text)
{
ASSERT(text.length());
- static MainThreadNeverDestroyed<const AtomString> textPseudoId("-webkit-datetime-edit-text", AtomString::ConstructFromLiteral);
+
auto element = HTMLDivElement::create(m_editElement.document());
- element->setPseudo(textPseudoId);
+ element->setPseudo(ShadowPseudoIds::webkitDatetimeEditText());
// If the literal begins/ends with a space, the gap between two fields will appear
// exaggerated due to the presence of a 1px padding around each field. This can
@@ -233,18 +234,15 @@
Ref<DateTimeEditElement> DateTimeEditElement::create(Document& document, EditControlOwner& editControlOwner)
{
auto element = adoptRef(*new DateTimeEditElement(document, editControlOwner));
- static MainThreadNeverDestroyed<const AtomString> dateTimeEditPseudoId("-webkit-datetime-edit", AtomString::ConstructFromLiteral);
- element->setPseudo(dateTimeEditPseudoId);
+ element->setPseudo(ShadowPseudoIds::webkitDatetimeEdit());
return element;
}
void DateTimeEditElement::layout(const LayoutParameters& layoutParameters)
{
- static MainThreadNeverDestroyed<const AtomString> fieldsWrapperPseudoId("-webkit-datetime-edit-fields-wrapper", AtomString::ConstructFromLiteral);
-
if (!firstChild()) {
auto element = HTMLDivElement::create(document());
- element->setPseudo(fieldsWrapperPseudoId);
+ element->setPseudo(ShadowPseudoIds::webkitDatetimeEditFieldsWrapper());
appendChild(element);
}
Modified: trunk/Source/WebCore/html/shadow/DetailsMarkerControl.cpp (283756 => 283757)
--- trunk/Source/WebCore/html/shadow/DetailsMarkerControl.cpp 2021-10-07 23:37:01 UTC (rev 283756)
+++ trunk/Source/WebCore/html/shadow/DetailsMarkerControl.cpp 2021-10-07 23:43:09 UTC (rev 283757)
@@ -35,6 +35,7 @@
#include "HTMLNames.h"
#include "HTMLSummaryElement.h"
#include "RenderDetailsMarker.h"
+#include "ShadowPseudoIds.h"
#include <wtf/IsoMallocInlines.h>
namespace WebCore {
@@ -44,8 +45,7 @@
Ref<DetailsMarkerControl> DetailsMarkerControl::create(Document& document)
{
auto control = adoptRef(*new DetailsMarkerControl(document));
- static MainThreadNeverDestroyed<const AtomString> webkitDetailsMarkerName("-webkit-details-marker", AtomString::ConstructFromLiteral);
- control->setPseudo(webkitDetailsMarkerName);
+ control->setPseudo(ShadowPseudoIds::webkitDetailsMarker());
return control;
}
Modified: trunk/Source/WebCore/html/shadow/MediaControlTextTrackContainerElement.cpp (283756 => 283757)
--- trunk/Source/WebCore/html/shadow/MediaControlTextTrackContainerElement.cpp 2021-10-07 23:37:01 UTC (rev 283756)
+++ trunk/Source/WebCore/html/shadow/MediaControlTextTrackContainerElement.cpp 2021-10-07 23:43:09 UTC (rev 283757)
@@ -51,6 +51,7 @@
#include "RenderVideo.h"
#include "RenderView.h"
#include "Settings.h"
+#include "ShadowPseudoIds.h"
#include "ShadowRoot.h"
#include "StyleProperties.h"
#include "TextTrackCueGeneric.h"
@@ -68,8 +69,7 @@
Ref<MediaControlTextTrackContainerElement> MediaControlTextTrackContainerElement::create(Document& document, HTMLMediaElement& mediaElement)
{
auto element = adoptRef(*new MediaControlTextTrackContainerElement(document, mediaElement));
- static MainThreadNeverDestroyed<const AtomString> webkitMediaTextTrackContainerName("-webkit-media-text-track-container", AtomString::ConstructFromLiteral);
- element->setPseudo(webkitMediaTextTrackContainerName);
+ element->setPseudo(ShadowPseudoIds::webkitMediaTextTrackContainer());
element->hide();
return element;
}
Modified: trunk/Source/WebCore/html/shadow/ProgressShadowElement.cpp (283756 => 283757)
--- trunk/Source/WebCore/html/shadow/ProgressShadowElement.cpp 2021-10-07 23:37:01 UTC (rev 283756)
+++ trunk/Source/WebCore/html/shadow/ProgressShadowElement.cpp 2021-10-07 23:43:09 UTC (rev 283757)
@@ -34,6 +34,7 @@
#include "HTMLNames.h"
#include "HTMLProgressElement.h"
#include "RenderProgress.h"
+#include "ShadowPseudoIds.h"
#include <wtf/IsoMallocInlines.h>
namespace WebCore {
@@ -91,25 +92,22 @@
Ref<ProgressInnerElement> ProgressInnerElement::create(Document& document)
{
- static MainThreadNeverDestroyed<const AtomString> webkitProgressInnerElementName("-webkit-progress-inner-element", AtomString::ConstructFromLiteral);
Ref<ProgressInnerElement> result = adoptRef(*new ProgressInnerElement(document));
- result->setPseudo(webkitProgressInnerElementName);
+ result->setPseudo(ShadowPseudoIds::webkitProgressInnerElement());
return result;
}
Ref<ProgressBarElement> ProgressBarElement::create(Document& document)
{
- static MainThreadNeverDestroyed<const AtomString> webkitProgressBarName("-webkit-progress-bar", AtomString::ConstructFromLiteral);
Ref<ProgressBarElement> result = adoptRef(*new ProgressBarElement(document));
- result->setPseudo(webkitProgressBarName);
+ result->setPseudo(ShadowPseudoIds::webkitProgressBar());
return result;
}
Ref<ProgressValueElement> ProgressValueElement::create(Document& document)
{
- static MainThreadNeverDestroyed<const AtomString> webkitProgressValueName("-webkit-progress-value", AtomString::ConstructFromLiteral);
Ref<ProgressValueElement> result = adoptRef(*new ProgressValueElement(document));
- result->setPseudo(webkitProgressValueName);
+ result->setPseudo(ShadowPseudoIds::webkitProgressValue());
return result;
}
Added: trunk/Source/WebCore/html/shadow/ShadowPseudoIds.cpp (0 => 283757)
--- trunk/Source/WebCore/html/shadow/ShadowPseudoIds.cpp (rev 0)
+++ trunk/Source/WebCore/html/shadow/ShadowPseudoIds.cpp 2021-10-07 23:43:09 UTC (rev 283757)
@@ -0,0 +1,344 @@
+/*
+ * Copyright (C) 2021 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "ShadowPseudoIds.h"
+
+#include <wtf/NeverDestroyed.h>
+#include <wtf/text/AtomString.h>
+
+namespace WebCore {
+
+namespace ShadowPseudoIds {
+
+const AtomString& cue()
+{
+ static MainThreadNeverDestroyed<const AtomString> cue("cue", AtomString::ConstructFromLiteral);
+ return cue;
+}
+
+const AtomString& fileSelectorButton()
+{
+ static MainThreadNeverDestroyed<const AtomString> fileSelectorButton("file-selector-button", AtomString::ConstructFromLiteral);
+ return fileSelectorButton;
+}
+
+const AtomString& placeholder()
+{
+ static MainThreadNeverDestroyed<const AtomString> placeholder("placeholder", AtomString::ConstructFromLiteral);
+ return placeholder;
+}
+
+const AtomString& webkitContactsAutoFillButton()
+{
+ static MainThreadNeverDestroyed<const AtomString> webkitContactsAutoFillButton("-webkit-contacts-auto-fill-button", AtomString::ConstructFromLiteral);
+ return webkitContactsAutoFillButton;
+}
+
+const AtomString& webkitCredentialsAutoFillButton()
+{
+ static MainThreadNeverDestroyed<const AtomString> webkitCredentialsAutoFillButton("-webkit-credentials-auto-fill-button", AtomString::ConstructFromLiteral);
+ return webkitCredentialsAutoFillButton;
+}
+
+const AtomString& webkitCreditCardAutoFillButton()
+{
+ static MainThreadNeverDestroyed<const AtomString> webkitCreditCardAutoFillButton("-webkit-credit-card-auto-fill-button", AtomString::ConstructFromLiteral);
+ return webkitCreditCardAutoFillButton;
+}
+
+const AtomString& webkitStrongPasswordAutoFillButton()
+{
+ static MainThreadNeverDestroyed<const AtomString> webkitStrongPasswordAutoFillButton("-webkit-strong-password-auto-fill-button", AtomString::ConstructFromLiteral);
+ return webkitStrongPasswordAutoFillButton;
+}
+
+const AtomString& webkitCapsLockIndicator()
+{
+ static MainThreadNeverDestroyed<const AtomString> webkitCapsLockIndicator("-webkit-caps-lock-indicator", AtomString::ConstructFromLiteral);
+ return webkitCapsLockIndicator;
+}
+
+const AtomString& webkitColorSwatch()
+{
+ static MainThreadNeverDestroyed<const AtomString> webkitColorSwatch("-webkit-color-swatch", AtomString::ConstructFromLiteral);
+ return webkitColorSwatch;
+}
+
+const AtomString& webkitColorSwatchWrapper()
+{
+ static MainThreadNeverDestroyed<const AtomString> webkitColorSwatchWrapper("-webkit-color-swatch-wrapper", AtomString::ConstructFromLiteral);
+ return webkitColorSwatchWrapper;
+}
+
+const AtomString& webkitDatetimeEdit()
+{
+ static MainThreadNeverDestroyed<const AtomString> webkitDatetimeEdit("-webkit-datetime-edit", AtomString::ConstructFromLiteral);
+ return webkitDatetimeEdit;
+}
+
+const AtomString& webkitDatetimeEditText()
+{
+ static MainThreadNeverDestroyed<const AtomString> webkitDatetimeEditText("-webkit-datetime-edit-text", AtomString::ConstructFromLiteral);
+ return webkitDatetimeEditText;
+}
+
+const AtomString& webkitDatetimeEditFieldsWrapper()
+{
+ static MainThreadNeverDestroyed<const AtomString> webkitDatetimeEditFieldsWrapper("-webkit-datetime-edit-fields-wrapper", AtomString::ConstructFromLiteral);
+ return webkitDatetimeEditFieldsWrapper;
+}
+
+const AtomString& webkitDateAndTimeValue()
+{
+ static MainThreadNeverDestroyed<const AtomString> webkitDateAndTimeValue("-webkit-date-and-time-value", AtomString::ConstructFromLiteral);
+ return webkitDateAndTimeValue;
+}
+
+const AtomString& webkitDetailsMarker()
+{
+ static MainThreadNeverDestroyed<const AtomString> webkitDetailsMarker("-webkit-details-marker", AtomString::ConstructFromLiteral);
+ return webkitDetailsMarker;
+}
+
+const AtomString& webkitGenericCueRoot()
+{
+ static MainThreadNeverDestroyed<const AtomString> webkitGenericCueRoot("-webkit-generic-cue-root", AtomString::ConstructFromLiteral);
+ return webkitGenericCueRoot;
+}
+
+const AtomString& webkitInnerSpinButton()
+{
+ static MainThreadNeverDestroyed<const AtomString> webkitInnerSpinButton("-webkit-inner-spin-button", AtomString::ConstructFromLiteral);
+ return webkitInnerSpinButton;
+}
+
+const AtomString& webkitKeygenSelect()
+{
+ static MainThreadNeverDestroyed<const AtomString> webkitKeygenSelect("-webkit-keygen-select", AtomString::ConstructFromLiteral);
+ return webkitKeygenSelect;
+}
+
+const AtomString& webkitListButton()
+{
+ static MainThreadNeverDestroyed<const AtomString> webkitListButton("-webkit-list-button", AtomString::ConstructFromLiteral);
+ return webkitListButton;
+}
+
+const AtomString& webkitMediaSliderThumb()
+{
+ static MainThreadNeverDestroyed<const AtomString> webkitMediaSliderThumb("-webkit-media-slider-thumb", AtomString::ConstructFromLiteral);
+ return webkitMediaSliderThumb;
+}
+
+const AtomString& webkitMediaSliderContainer()
+{
+ static MainThreadNeverDestroyed<const AtomString> webkitMediaSliderContainer("-webkit-media-slider-container", AtomString::ConstructFromLiteral);
+ return webkitMediaSliderContainer;
+}
+
+const AtomString& webkitMediaTextTrackContainer()
+{
+ static MainThreadNeverDestroyed<const AtomString> webkitMediaTextTrackContainer("-webkit-media-text-track-container", AtomString::ConstructFromLiteral);
+ return webkitMediaTextTrackContainer;
+}
+
+const AtomString& webkitMediaTextTrackDisplay()
+{
+ static MainThreadNeverDestroyed<const AtomString> webkitMediaTextTrackDisplay("-webkit-media-text-track-display", AtomString::ConstructFromLiteral);
+ return webkitMediaTextTrackDisplay;
+}
+
+const AtomString& webkitMediaTextTrackDisplayBackdrop()
+{
+ static MainThreadNeverDestroyed<const AtomString> webkitMediaTextTrackDisplay("-webkit-media-text-track-display-backdrop", AtomString::ConstructFromLiteral);
+ return webkitMediaTextTrackDisplay;
+}
+
+const AtomString& webkitMediaTextTrackRegion()
+{
+ static MainThreadNeverDestroyed<const AtomString> webkitMediaTextTrackRegion("-webkit-media-text-track-region", AtomString::ConstructFromLiteral);
+ return webkitMediaTextTrackRegion;
+}
+
+const AtomString& webkitMediaTextTrackRegionContainer()
+{
+ static MainThreadNeverDestroyed<const AtomString> webkitMediaTextTrackRegionContainer("-webkit-media-text-track-region-container", AtomString::ConstructFromLiteral);
+ return webkitMediaTextTrackRegionContainer;
+}
+
+const AtomString& webkitMeterBar()
+{
+ static MainThreadNeverDestroyed<const AtomString> webkitMeterBar("-webkit-meter-bar", AtomString::ConstructFromLiteral);
+ return webkitMeterBar;
+}
+
+const AtomString& webkitMeterInnerElement()
+{
+ static MainThreadNeverDestroyed<const AtomString> webkitMeterInnerElement("-webkit-meter-inner-element", AtomString::ConstructFromLiteral);
+ return webkitMeterInnerElement;
+}
+
+const AtomString& webkitMeterOptimumValue()
+{
+ static MainThreadNeverDestroyed<const AtomString> webkitMeterOptimumValue("-webkit-meter-optimum-value", AtomString::ConstructFromLiteral);
+ return webkitMeterOptimumValue;
+}
+
+const AtomString& webkitMeterSuboptimumValue()
+{
+ static MainThreadNeverDestroyed<const AtomString> webkitMeterSuboptimumValue("-webkit-meter-suboptimum-value", AtomString::ConstructFromLiteral);
+ return webkitMeterSuboptimumValue;
+}
+
+const AtomString& webkitMeterEvenLessGoodValue()
+{
+ static MainThreadNeverDestroyed<const AtomString> webkitMeterEvenLessGoodValue("-webkit-meter-even-less-good-value", AtomString::ConstructFromLiteral);
+ return webkitMeterEvenLessGoodValue;
+}
+
+const AtomString& webkitPluginReplacement()
+{
+ static MainThreadNeverDestroyed<const AtomString> webkitPluginReplacement("-webkit-plugin-replacement", AtomString::ConstructFromLiteral);
+ return webkitPluginReplacement;
+}
+
+const AtomString& webkitProgressBar()
+{
+ static MainThreadNeverDestroyed<const AtomString> webkitProgressBar("-webkit-progress-bar", AtomString::ConstructFromLiteral);
+ return webkitProgressBar;
+}
+
+const AtomString& webkitProgressValue()
+{
+ static MainThreadNeverDestroyed<const AtomString> webkitProgressValue("-webkit-progress-value", AtomString::ConstructFromLiteral);
+ return webkitProgressValue;
+}
+
+const AtomString& webkitProgressInnerElement()
+{
+ static MainThreadNeverDestroyed<const AtomString> webkitProgressInnerElement("-webkit-progress-inner-element", AtomString::ConstructFromLiteral);
+ return webkitProgressInnerElement;
+}
+
+const AtomString& webkitSearchDecoration()
+{
+ static MainThreadNeverDestroyed<const AtomString> webkitSearchDecoration("-webkit-search-decoration", AtomString::ConstructFromLiteral);
+ return webkitSearchDecoration;
+}
+
+const AtomString& webkitSearchResultsButton()
+{
+ static MainThreadNeverDestroyed<const AtomString> webkitSearchResultsButton("-webkit-search-results-button", AtomString::ConstructFromLiteral);
+ return webkitSearchResultsButton;
+}
+
+const AtomString& webkitSearchResultsDecoration()
+{
+ static MainThreadNeverDestroyed<const AtomString> webkitSearchResultsDecoration("-webkit-search-results-decoration", AtomString::ConstructFromLiteral);
+ return webkitSearchResultsDecoration;
+}
+
+const AtomString& webkitSearchCancelButton()
+{
+ static MainThreadNeverDestroyed<const AtomString> webkitSearchCancelButton("-webkit-search-cancel-button", AtomString::ConstructFromLiteral);
+ return webkitSearchCancelButton;
+}
+
+const AtomString& webkitSliderRunnableTrack()
+{
+ static MainThreadNeverDestroyed<const AtomString> webkitSliderRunnableTrack("-webkit-slider-runnable-track", AtomString::ConstructFromLiteral);
+ return webkitSliderRunnableTrack;
+}
+
+const AtomString& webkitSliderThumb()
+{
+ static MainThreadNeverDestroyed<const AtomString> webkitSliderThumb("-webkit-slider-thumb", AtomString::ConstructFromLiteral);
+ return webkitSliderThumb;
+}
+
+const AtomString& webkitSliderContainer()
+{
+ static MainThreadNeverDestroyed<const AtomString> webkitSliderContainer("-webkit-slider-container", AtomString::ConstructFromLiteral);
+ return webkitSliderContainer;
+}
+
+const AtomString& webkitTextfieldDecorationContainer()
+{
+ static MainThreadNeverDestroyed<const AtomString> webkitTextfieldDecorationContainer("-webkit-textfield-decoration-container", AtomString::ConstructFromLiteral);
+ return webkitTextfieldDecorationContainer;
+}
+
+const AtomString& webkitValidationBubble()
+{
+ static MainThreadNeverDestroyed<const AtomString> webkitValidationBubble("-webkit-validation-bubble", AtomString::ConstructFromLiteral);
+ return webkitValidationBubble;
+}
+
+const AtomString& webkitValidationBubbleArrowClipper()
+{
+ static MainThreadNeverDestroyed<const AtomString> webkitValidationBubbleArrowClipper("-webkit-validation-bubble-arrow-clipper", AtomString::ConstructFromLiteral);
+ return webkitValidationBubbleArrowClipper;
+}
+
+const AtomString& webkitValidationBubbleArrow()
+{
+ static MainThreadNeverDestroyed<const AtomString> webkitValidationBubbleArrow("-webkit-validation-bubble-arrow", AtomString::ConstructFromLiteral);
+ return webkitValidationBubbleArrow;
+}
+
+const AtomString& webkitValidationBubbleMessage()
+{
+ static MainThreadNeverDestroyed<const AtomString> webkitValidationBubbleMessage("-webkit-validation-bubble-message", AtomString::ConstructFromLiteral);
+ return webkitValidationBubbleMessage;
+}
+
+const AtomString& webkitValidationBubbleIcon()
+{
+ static MainThreadNeverDestroyed<const AtomString> webkitValidationBubbleIcon("-webkit-validation-bubble-icon", AtomString::ConstructFromLiteral);
+ return webkitValidationBubbleIcon;
+}
+
+const AtomString& webkitValidationBubbleTextBlock()
+{
+ static MainThreadNeverDestroyed<const AtomString> webkitValidationBubbleTextBlock("-webkit-validation-bubble-text-block", AtomString::ConstructFromLiteral);
+ return webkitValidationBubbleTextBlock;
+}
+
+const AtomString& webkitValidationBubbleHeading()
+{
+ static MainThreadNeverDestroyed<const AtomString> webkitValidationBubbleHeading("-webkit-validation-bubble-heading", AtomString::ConstructFromLiteral);
+ return webkitValidationBubbleHeading;
+}
+
+const AtomString& webkitValidationBubbleBody()
+{
+ static MainThreadNeverDestroyed<const AtomString> webkitValidationBubbleBody("-webkit-validation-bubble-body", AtomString::ConstructFromLiteral);
+ return webkitValidationBubbleBody;
+}
+
+} // namespace ShadowPseudoId
+
+} // namespace WebCore
Added: trunk/Source/WebCore/html/shadow/ShadowPseudoIds.h (0 => 283757)
--- trunk/Source/WebCore/html/shadow/ShadowPseudoIds.h (rev 0)
+++ trunk/Source/WebCore/html/shadow/ShadowPseudoIds.h 2021-10-07 23:43:09 UTC (rev 283757)
@@ -0,0 +1,112 @@
+/*
+ * Copyright (C) 2021 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include <wtf/Forward.h>
+
+namespace WebCore {
+
+namespace ShadowPseudoIds {
+
+const AtomString& cue();
+
+const AtomString& fileSelectorButton();
+
+const AtomString& placeholder();
+
+const AtomString& webkitContactsAutoFillButton();
+const AtomString& webkitCredentialsAutoFillButton();
+const AtomString& webkitCreditCardAutoFillButton();
+const AtomString& webkitStrongPasswordAutoFillButton();
+
+const AtomString& webkitCapsLockIndicator();
+
+const AtomString& webkitColorSwatch();
+const AtomString& webkitColorSwatchWrapper();
+
+const AtomString& webkitDatetimeEdit();
+const AtomString& webkitDatetimeEditText();
+const AtomString& webkitDatetimeEditFieldsWrapper();
+const AtomString& webkitDateAndTimeValue();
+
+const AtomString& webkitDetailsMarker();
+
+const AtomString& webkitGenericCueRoot();
+
+const AtomString& webkitInnerSpinButton();
+
+const AtomString& webkitKeygenSelect();
+
+const AtomString& webkitListButton();
+
+const AtomString& webkitMediaSliderThumb();
+const AtomString& webkitMediaSliderContainer();
+
+const AtomString& webkitMediaTextTrackContainer();
+
+const AtomString& webkitMediaTextTrackDisplay();
+const AtomString& webkitMediaTextTrackDisplayBackdrop();
+
+const AtomString& webkitMediaTextTrackRegion();
+const AtomString& webkitMediaTextTrackRegionContainer();
+
+const AtomString& webkitMeterBar();
+const AtomString& webkitMeterInnerElement();
+const AtomString& webkitMeterOptimumValue();
+const AtomString& webkitMeterSuboptimumValue();
+const AtomString& webkitMeterEvenLessGoodValue();
+
+const AtomString& webkitPluginReplacement();
+
+const AtomString& webkitProgressBar();
+const AtomString& webkitProgressValue();
+const AtomString& webkitProgressInnerElement();
+
+const AtomString& webkitSearchDecoration();
+const AtomString& webkitSearchResultsButton();
+const AtomString& webkitSearchResultsDecoration();
+
+const AtomString& webkitSearchCancelButton();
+
+const AtomString& webkitSliderRunnableTrack();
+
+const AtomString& webkitSliderThumb();
+const AtomString& webkitSliderContainer();
+
+const AtomString& webkitTextfieldDecorationContainer();
+
+const AtomString& webkitValidationBubble();
+const AtomString& webkitValidationBubbleArrowClipper();
+const AtomString& webkitValidationBubbleArrow();
+const AtomString& webkitValidationBubbleMessage();
+const AtomString& webkitValidationBubbleIcon();
+const AtomString& webkitValidationBubbleTextBlock();
+const AtomString& webkitValidationBubbleHeading();
+const AtomString& webkitValidationBubbleBody();
+
+} // namespace ShadowPseudoId
+
+} // namespace WebCore
Modified: trunk/Source/WebCore/html/shadow/SliderThumbElement.cpp (283756 => 283757)
--- trunk/Source/WebCore/html/shadow/SliderThumbElement.cpp 2021-10-07 23:37:01 UTC (rev 283756)
+++ trunk/Source/WebCore/html/shadow/SliderThumbElement.cpp 2021-10-07 23:43:09 UTC (rev 283757)
@@ -45,6 +45,7 @@
#include "RenderFlexibleBox.h"
#include "RenderSlider.h"
#include "RenderTheme.h"
+#include "ShadowPseudoIds.h"
#include "ShadowRoot.h"
#include "StepRange.h"
#include "StyleResolver.h"
@@ -589,9 +590,6 @@
{
// This doesn't actually compute style. This is just a hack to pick shadow pseudo id when host style is known.
- static MainThreadNeverDestroyed<const AtomString> sliderThumbShadowPseudoId("-webkit-slider-thumb", AtomString::ConstructFromLiteral);
- static MainThreadNeverDestroyed<const AtomString> mediaSliderThumbShadowPseudoId("-webkit-media-slider-thumb", AtomString::ConstructFromLiteral);
-
if (!hostStyle)
return std::nullopt;
@@ -602,10 +600,10 @@
case MediaVolumeSliderThumbPart:
case MediaFullScreenVolumeSliderPart:
case MediaFullScreenVolumeSliderThumbPart:
- m_shadowPseudoId = mediaSliderThumbShadowPseudoId;
+ m_shadowPseudoId = ShadowPseudoIds::webkitMediaSliderThumb();
break;
default:
- m_shadowPseudoId = sliderThumbShadowPseudoId;
+ m_shadowPseudoId = ShadowPseudoIds::webkitSliderThumb();
}
return std::nullopt;
@@ -643,9 +641,6 @@
{
// This doesn't actually compute style. This is just a hack to pick shadow pseudo id when host style is known.
- static MainThreadNeverDestroyed<const AtomString> mediaSliderContainer("-webkit-media-slider-container", AtomString::ConstructFromLiteral);
- static MainThreadNeverDestroyed<const AtomString> sliderContainer("-webkit-slider-container", AtomString::ConstructFromLiteral);
-
if (!hostStyle)
return std::nullopt;
@@ -656,10 +651,10 @@
case MediaVolumeSliderThumbPart:
case MediaFullScreenVolumeSliderPart:
case MediaFullScreenVolumeSliderThumbPart:
- m_shadowPseudoId = mediaSliderContainer;
+ m_shadowPseudoId = ShadowPseudoIds::webkitMediaSliderContainer();
break;
default:
- m_shadowPseudoId = sliderContainer;
+ m_shadowPseudoId = ShadowPseudoIds::webkitSliderContainer();
}
return std::nullopt;
Modified: trunk/Source/WebCore/html/shadow/SpinButtonElement.cpp (283756 => 283757)
--- trunk/Source/WebCore/html/shadow/SpinButtonElement.cpp 2021-10-07 23:37:01 UTC (rev 283756)
+++ trunk/Source/WebCore/html/shadow/SpinButtonElement.cpp 2021-10-07 23:43:09 UTC (rev 283757)
@@ -37,6 +37,7 @@
#include "RenderBox.h"
#include "RenderTheme.h"
#include "ScrollbarTheme.h"
+#include "ShadowPseudoIds.h"
#include "WheelEvent.h"
#include <wtf/IsoMallocInlines.h>
#include <wtf/Ref.h>
@@ -61,8 +62,7 @@
Ref<SpinButtonElement> SpinButtonElement::create(Document& document, SpinButtonOwner& spinButtonOwner)
{
auto element = adoptRef(*new SpinButtonElement(document, spinButtonOwner));
- static MainThreadNeverDestroyed<const AtomString> webkitInnerSpinButtonName("-webkit-inner-spin-button", AtomString::ConstructFromLiteral);
- element->setPseudo(webkitInnerSpinButtonName);
+ element->setPseudo(ShadowPseudoIds::webkitInnerSpinButton());
return element;
}
Modified: trunk/Source/WebCore/html/shadow/TextControlInnerElements.cpp (283756 => 283757)
--- trunk/Source/WebCore/html/shadow/TextControlInnerElements.cpp 2021-10-07 23:37:01 UTC (rev 283756)
+++ trunk/Source/WebCore/html/shadow/TextControlInnerElements.cpp 2021-10-07 23:43:09 UTC (rev 283757)
@@ -41,6 +41,7 @@
#include "RenderTextControl.h"
#include "RenderView.h"
#include "ScriptController.h"
+#include "ShadowPseudoIds.h"
#include "ShadowRoot.h"
#include "StyleResolver.h"
#include "TextEvent.h"
@@ -204,8 +205,7 @@
Ref<TextControlPlaceholderElement> TextControlPlaceholderElement::create(Document& document)
{
auto element = adoptRef(*new TextControlPlaceholderElement(document));
- static MainThreadNeverDestroyed<const AtomString> placeholderName("placeholder", AtomString::ConstructFromLiteral);
- element->setPseudo(placeholderName);
+ element->setPseudo(ShadowPseudoIds::placeholder());
return element;
}
@@ -296,9 +296,9 @@
Ref<SearchFieldCancelButtonElement> SearchFieldCancelButtonElement::create(Document& document)
{
auto element = adoptRef(*new SearchFieldCancelButtonElement(document));
- static MainThreadNeverDestroyed<const AtomString> webkitSearchCancelButtonName("-webkit-search-cancel-button", AtomString::ConstructFromLiteral);
+
static MainThreadNeverDestroyed<const AtomString> buttonName("button", AtomString::ConstructFromLiteral);
- element->setPseudo(webkitSearchCancelButtonName);
+ element->setPseudo(ShadowPseudoIds::webkitSearchCancelButton());
#if !PLATFORM(IOS_FAMILY)
element->setAttributeWithoutSynchronization(aria_labelAttr, AXSearchFieldCancelButtonText());
#endif
Modified: trunk/Source/WebCore/html/shadow/YouTubeEmbedShadowElement.cpp (283756 => 283757)
--- trunk/Source/WebCore/html/shadow/YouTubeEmbedShadowElement.cpp 2021-10-07 23:37:01 UTC (rev 283756)
+++ trunk/Source/WebCore/html/shadow/YouTubeEmbedShadowElement.cpp 2021-10-07 23:43:09 UTC (rev 283757)
@@ -27,6 +27,7 @@
#include "YouTubeEmbedShadowElement.h"
#include "RenderBlockFlow.h"
+#include "ShadowPseudoIds.h"
#include <wtf/IsoMallocInlines.h>
namespace WebCore {
@@ -36,8 +37,7 @@
Ref<YouTubeEmbedShadowElement> YouTubeEmbedShadowElement::create(Document& document)
{
auto element = adoptRef(*new YouTubeEmbedShadowElement(document));
- static MainThreadNeverDestroyed<const AtomString> webkitPluginReplacementName("-webkit-plugin-replacement", AtomString::ConstructFromLiteral);
- element->setPseudo(webkitPluginReplacementName);
+ element->setPseudo(ShadowPseudoIds::webkitPluginReplacement());
return element;
}
Modified: trunk/Source/WebCore/html/track/TextTrackCue.cpp (283756 => 283757)
--- trunk/Source/WebCore/html/track/TextTrackCue.cpp 2021-10-07 23:37:01 UTC (rev 283756)
+++ trunk/Source/WebCore/html/track/TextTrackCue.cpp 2021-10-07 23:43:09 UTC (rev 283757)
@@ -45,6 +45,7 @@
#include "NodeTraversal.h"
#include "Page.h"
#include "ScriptDisallowedScope.h"
+#include "ShadowPseudoIds.h"
#include "Text.h"
#include "TextTrack.h"
#include "TextTrackCueList.h"
@@ -63,24 +64,6 @@
WTF_MAKE_ISO_ALLOCATED_IMPL(TextTrackCue);
WTF_MAKE_ISO_ALLOCATED_IMPL(TextTrackCueBox);
-const AtomString& TextTrackCue::cueShadowPseudoId()
-{
- static MainThreadNeverDestroyed<const AtomString> cue("cue", AtomString::ConstructFromLiteral);
- return cue;
-}
-
-const AtomString& TextTrackCue::cueBoxShadowPseudoId()
-{
- static MainThreadNeverDestroyed<const AtomString> trackDisplayBoxShadowPseudoId("-webkit-media-text-track-display", AtomString::ConstructFromLiteral);
- return trackDisplayBoxShadowPseudoId;
-}
-
-const AtomString& TextTrackCue::cueBackdropShadowPseudoId()
-{
- static MainThreadNeverDestroyed<const AtomString> cueBackdropShadowPseudoId("-webkit-media-text-track-display-backdrop", AtomString::ConstructFromLiteral);
- return cueBackdropShadowPseudoId;
-}
-
static const QualifiedName& cueAttributName()
{
static NeverDestroyed<QualifiedName> cueTag(nullAtom(), "cue", nullAtom());
@@ -109,7 +92,7 @@
void TextTrackCueBox::initialize()
{
- setPseudo(TextTrackCue::cueBoxShadowPseudoId());
+ setPseudo(ShadowPseudoIds::webkitMediaTextTrackDisplay());
}
TextTrackCue* TextTrackCueBox::getCue() const
@@ -169,10 +152,10 @@
auto& element = downcast<Element>(node);
if (element.hasAttributeWithoutSynchronization(cueAttributName())) {
- element.setPseudo(TextTrackCue::cueShadowPseudoId());
+ element.setPseudo(ShadowPseudoIds::cue());
nodeTypes = { RequiredNodes::Cue };
} else if (element.hasAttributeWithoutSynchronization(cueBackgroundAttributName())) {
- element.setPseudo(TextTrackCue::cueBackdropShadowPseudoId());
+ element.setPseudo(ShadowPseudoIds::webkitMediaTextTrackDisplayBackdrop());
nodeTypes = { RequiredNodes::CueBackground };
}
@@ -504,9 +487,8 @@
ScriptDisallowedScope::EventAllowedScope allowedScopeForReferenceTree(*m_cueNode);
if (!m_displayTree) {
- static MainThreadNeverDestroyed<const AtomString> webkitGenericCueRootName("-webkit-generic-cue-root", AtomString::ConstructFromLiteral);
m_displayTree = TextTrackCueBox::create(ownerDocument(), *this);
- m_displayTree->setPseudo(webkitGenericCueRootName);
+ m_displayTree->setPseudo(ShadowPseudoIds::webkitGenericCueRoot());
}
m_displayTree->removeChildren();
@@ -518,7 +500,7 @@
if (auto page = ownerDocument().page()) {
auto style = HTMLStyleElement::create(HTMLNames::styleTag, ownerDocument(), false);
style->setTextContent(makeString(page->captionUserPreferencesStyleSheet(),
- " ::", TextTrackCue::cueShadowPseudoId(), "{font-size:", m_fontSize, m_fontSizeIsImportant ? "px !important}" : "px}"));
+ " ::", ShadowPseudoIds::cue(), "{font-size:", m_fontSize, m_fontSizeIsImportant ? "px !important}" : "px}"));
m_displayTree->appendChild(style);
}
}
Modified: trunk/Source/WebCore/html/track/TextTrackCue.h (283756 => 283757)
--- trunk/Source/WebCore/html/track/TextTrackCue.h 2021-10-07 23:37:01 UTC (rev 283756)
+++ trunk/Source/WebCore/html/track/TextTrackCue.h 2021-10-07 23:43:09 UTC (rev 283757)
@@ -65,10 +65,6 @@
class TextTrackCue : public RefCounted<TextTrackCue>, public EventTargetWithInlineData, public ActiveDOMObject {
WTF_MAKE_ISO_ALLOCATED(TextTrackCue);
public:
- static const AtomString& cueShadowPseudoId();
- static const AtomString& cueBackdropShadowPseudoId();
- static const AtomString& cueBoxShadowPseudoId();
-
static ExceptionOr<Ref<TextTrackCue>> create(Document&, double start, double end, DocumentFragment&);
TextTrack* track() const;
Modified: trunk/Source/WebCore/html/track/VTTCue.cpp (283756 => 283757)
--- trunk/Source/WebCore/html/track/VTTCue.cpp 2021-10-07 23:37:01 UTC (rev 283756)
+++ trunk/Source/WebCore/html/track/VTTCue.cpp 2021-10-07 23:43:09 UTC (rev 283757)
@@ -45,6 +45,7 @@
#include "NodeTraversal.h"
#include "RenderVTTCue.h"
#include "ScriptDisallowedScope.h"
+#include "ShadowPseudoIds.h"
#include "Text.h"
#include "TextTrack.h"
#include "TextTrackCueGeneric.h"
@@ -1008,9 +1009,9 @@
// background box.
// Note: This is contained by default in m_cueHighlightBox.
- m_cueHighlightBox->setPseudo(cueShadowPseudoId());
+ m_cueHighlightBox->setPseudo(ShadowPseudoIds::cue());
- m_cueBackdropBox->setPseudo(cueBackdropShadowPseudoId());
+ m_cueBackdropBox->setPseudo(ShadowPseudoIds::webkitMediaTextTrackDisplayBackdrop());
m_cueBackdropBox->appendChild(*m_cueHighlightBox);
displayTree->appendChild(*m_cueBackdropBox);
Modified: trunk/Source/WebCore/html/track/VTTRegion.cpp (283756 => 283757)
--- trunk/Source/WebCore/html/track/VTTRegion.cpp 2021-10-07 23:37:01 UTC (rev 283756)
+++ trunk/Source/WebCore/html/track/VTTRegion.cpp 2021-10-07 23:43:09 UTC (rev 283757)
@@ -41,6 +41,7 @@
#include "HTMLParserIdioms.h"
#include "Logging.h"
#include "RenderElement.h"
+#include "ShadowPseudoIds.h"
#include "VTTCue.h"
#include "VTTScanner.h"
#include "WebVTTParser.h"
@@ -267,20 +268,6 @@
return trackRegionCueContainerScrollingClass;
}
-const AtomString& VTTRegion::textTrackCueContainerShadowPseudoId()
-{
- static MainThreadNeverDestroyed<const AtomString> trackRegionCueContainerPseudoId("-webkit-media-text-track-region-container", AtomString::ConstructFromLiteral);
-
- return trackRegionCueContainerPseudoId;
-}
-
-const AtomString& VTTRegion::textTrackRegionShadowPseudoId()
-{
- static MainThreadNeverDestroyed<const AtomString> trackRegionShadowPseudoId("-webkit-media-text-track-region", AtomString::ConstructFromLiteral);
-
- return trackRegionShadowPseudoId;
-}
-
void VTTRegion::appendTextTrackCueBox(Ref<TextTrackCueBox>&& displayBox)
{
ASSERT(m_cueContainer);
@@ -342,7 +329,7 @@
{
if (!m_regionDisplayTree) {
m_regionDisplayTree = HTMLDivElement::create(downcast<Document>(*m_scriptExecutionContext));
- m_regionDisplayTree->setPseudo(textTrackRegionShadowPseudoId());
+ m_regionDisplayTree->setPseudo(ShadowPseudoIds::webkitMediaTextTrackRegion());
m_recalculateStyles = true;
}
@@ -389,7 +376,7 @@
// gradually scrolled out as multiple cues are appended to the region.
if (!m_cueContainer) {
m_cueContainer = HTMLDivElement::create(downcast<Document>(*m_scriptExecutionContext));
- m_cueContainer->setPseudo(textTrackCueContainerShadowPseudoId());
+ m_cueContainer->setPseudo(ShadowPseudoIds::webkitMediaTextTrackRegionContainer());
m_regionDisplayTree->appendChild(*m_cueContainer);
}
m_cueContainer->setInlineStyleProperty(CSSPropertyTop, 0.0f, CSSUnitType::CSS_PX);
Modified: trunk/Source/WebCore/html/track/VTTRegion.h (283756 => 283757)
--- trunk/Source/WebCore/html/track/VTTRegion.h 2021-10-07 23:37:01 UTC (rev 283756)
+++ trunk/Source/WebCore/html/track/VTTRegion.h 2021-10-07 23:43:09 UTC (rev 283757)
@@ -118,9 +118,7 @@
void parseSettingValue(RegionSetting, VTTScanner&);
- static const AtomString& textTrackCueContainerShadowPseudoId();
static const AtomString& textTrackCueContainerScrollingClass();
- static const AtomString& textTrackRegionShadowPseudoId();
String m_id;
String m_settings;
Modified: trunk/Source/WebCore/page/CaptionUserPreferencesMediaAF.cpp (283756 => 283757)
--- trunk/Source/WebCore/page/CaptionUserPreferencesMediaAF.cpp 2021-10-07 23:37:01 UTC (rev 283756)
+++ trunk/Source/WebCore/page/CaptionUserPreferencesMediaAF.cpp 2021-10-07 23:43:09 UTC (rev 283757)
@@ -37,6 +37,7 @@
#include "HTMLMediaElement.h"
#include "LocalizedStrings.h"
#include "Logging.h"
+#include "ShadowPseudoIds.h"
#include "TextTrackList.h"
#include "UserStyleSheetTypes.h"
#include <algorithm>
@@ -608,12 +609,12 @@
String fontName = captionsDefaultFontCSS();
String background = ""
if (!background.isEmpty() || !captionsColor.isEmpty() || !edgeStyle.isEmpty() || !fontName.isEmpty())
- captionsOverrideStyleSheet.append(" ::", TextTrackCue::cueShadowPseudoId(), '{', background, captionsColor, edgeStyle, fontName, '}');
+ captionsOverrideStyleSheet.append(" ::", ShadowPseudoIds::cue(), '{', background, captionsColor, edgeStyle, fontName, '}');
String windowColor = captionsWindowCSS();
String windowCornerRadius = windowRoundedCornerRadiusCSS();
if (!windowColor.isEmpty() || !windowCornerRadius.isEmpty())
- captionsOverrideStyleSheet.append(" ::", TextTrackCue::cueBackdropShadowPseudoId(), '{', windowColor, windowCornerRadius, '}');
+ captionsOverrideStyleSheet.append(" ::", ShadowPseudoIds::webkitMediaTextTrackDisplayBackdrop(), '{', windowColor, windowCornerRadius, '}');
#endif // HAVE(MEDIA_ACCESSIBILITY_FRAMEWORK)
LOG(Media, "CaptionUserPreferencesMediaAF::captionsStyleSheetOverrideSetting style to:\n%s", captionsOverrideStyleSheet.toString().utf8().data());
Modified: trunk/Source/WebCore/style/RuleData.cpp (283756 => 283757)
--- trunk/Source/WebCore/style/RuleData.cpp 2021-10-07 23:37:01 UTC (rev 283756)
+++ trunk/Source/WebCore/style/RuleData.cpp 2021-10-07 23:43:09 UTC (rev 283757)
@@ -38,15 +38,12 @@
#include "SecurityOrigin.h"
#include "SelectorChecker.h"
#include "SelectorFilter.h"
+#include "ShadowPseudoIds.h"
#include "StyleResolver.h"
#include "StyleRule.h"
#include "StyleRuleImport.h"
#include "StyleSheetContents.h"
-#if ENABLE(VIDEO)
-#include "TextTrackCue.h"
-#endif
-
namespace WebCore {
namespace Style {
@@ -141,7 +138,7 @@
{
for (const CSSSelector* component = selector; component; component = component->tagHistory()) {
#if ENABLE(VIDEO)
- if (component->match() == CSSSelector::PseudoElement && (component->pseudoElementType() == CSSSelector::PseudoElementCue || component->value() == TextTrackCue::cueShadowPseudoId()))
+ if (component->match() == CSSSelector::PseudoElement && (component->pseudoElementType() == CSSSelector::PseudoElementCue || component->value() == ShadowPseudoIds::cue()))
return PropertyAllowlistCue;
#endif
if (component->match() == CSSSelector::PseudoElement && component->pseudoElementType() == CSSSelector::PseudoElementMarker)