Changeset 267074 in webkit
- Timestamp:
- Sep 14, 2020 10:17:24 PM (4 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r267073 r267074 1 2020-09-14 Ryosuke Niwa <rniwa@webkit.org> 2 3 Element should not set an attribute inside its constructor 4 https://bugs.webkit.org/show_bug.cgi?id=216507 5 6 Reviewed by Wenson Hsieh. 7 8 Moved the code to add attributes from element constructors to respective ::create functions 9 since setting attributes could run code in parseAttribute some of which may try to store 10 "this" in Ref / RefPtr, which would not be safe before adoptRef is called. 11 12 No new tests since there should be no observable behavioral change. 13 14 * dom/Element.cpp: 15 (WebCore::Element::setAttributeInternal): Added an assertion. 16 * html/FileInputType.cpp: 17 (WebCore::UploadButtonElement::create): 18 (WebCore::UploadButtonElement::createForMultiple): 19 (WebCore::UploadButtonElement::createInternal): Extracted. 20 (WebCore::UploadButtonElement::UploadButtonElement): 21 * html/HTMLKeygenElement.cpp: 22 * html/shadow/DateTimeEditElement.cpp: 23 (WebCore::DateTimeEditElement::DateTimeEditElement): 24 (WebCore::DateTimeEditElement::create): 25 * html/shadow/DateTimeFieldElements.cpp: 26 (WebCore::DateTimeDayFieldElement::DateTimeDayFieldElement): 27 (WebCore::DateTimeDayFieldElement::create): 28 (WebCore::DateTimeHourFieldElement::DateTimeHourFieldElement): 29 (WebCore::DateTimeHourFieldElement::create): 30 (WebCore::DateTimeMeridiemFieldElement::DateTimeMeridiemFieldElement): 31 (WebCore::DateTimeMeridiemFieldElement::create): 32 (WebCore::DateTimeMillisecondFieldElement::DateTimeMillisecondFieldElement): 33 (WebCore::DateTimeMillisecondFieldElement::create): 34 (WebCore::DateTimeMinuteFieldElement::DateTimeMinuteFieldElement): 35 (WebCore::DateTimeMinuteFieldElement::create): 36 (WebCore::DateTimeMonthFieldElement::DateTimeMonthFieldElement): 37 (WebCore::DateTimeMonthFieldElement::create): 38 (WebCore::DateTimeSecondFieldElement::DateTimeSecondFieldElement): 39 (WebCore::DateTimeSecondFieldElement::create): 40 (WebCore::DateTimeSymbolicMonthFieldElement::DateTimeSymbolicMonthFieldElement): 41 (WebCore::DateTimeSymbolicMonthFieldElement::create): 42 (WebCore::DateTimeYearFieldElement::DateTimeYearFieldElement): 43 (WebCore::DateTimeYearFieldElement::create): 44 * html/shadow/DetailsMarkerControl.cpp: 45 (WebCore::DetailsMarkerControl::create): 46 (WebCore::DetailsMarkerControl::DetailsMarkerControl): 47 * html/shadow/MediaControlTextTrackContainerElement.cpp: 48 (WebCore::MediaControlTextTrackContainerElement::create): 49 (WebCore::MediaControlTextTrackContainerElement::MediaControlTextTrackContainerElement): 50 * html/shadow/SpinButtonElement.cpp: 51 (WebCore::SpinButtonElement::SpinButtonElement): 52 (WebCore::SpinButtonElement::create): 53 * html/shadow/TextControlInnerElements.cpp: 54 (WebCore::TextControlPlaceholderElement::TextControlPlaceholderElement): 55 (WebCore::TextControlPlaceholderElement::create): 56 (WebCore::SearchFieldCancelButtonElement::SearchFieldCancelButtonElement): 57 (WebCore::SearchFieldCancelButtonElement::create): 58 * html/shadow/YouTubeEmbedShadowElement.cpp: 59 (WebCore::YouTubeEmbedShadowElement::create): 60 (WebCore::YouTubeEmbedShadowElement::YouTubeEmbedShadowElement): 61 * html/track/TextTrackCue.cpp: 62 (WebCore::TextTrackCueBox::create): Moved from .h. 63 (WebCore::TextTrackCueBox::TextTrackCueBox): 64 (WebCore::TextTrackCueBox::initilaize): Added. 65 * html/track/TextTrackCue.h: 66 (WebCore::TextTrackCueBox::create): Moved to cpp. 67 * html/track/TextTrackCueGeneric.cpp: 68 (WebCore::TextTrackCueGenericBoxElement::create): Now calls initialize(). 69 * html/track/VTTCue.cpp: 70 (WebCore::VTTCueBox::create): Moved from .h. Now calls initialize(). 71 * html/track/VTTCue.h: 72 (WebCore::VTTCueBox::create): Moved to cpp. 73 1 74 2020-09-14 Myles C. Maxfield <mmaxfield@apple.com> 2 75 -
trunk/Source/WebCore/dom/Element.cpp
r266986 r267074 1735 1735 inline void Element::setAttributeInternal(unsigned index, const QualifiedName& name, const AtomString& newValue, SynchronizationOfLazyAttribute inSynchronizationOfLazyAttribute) 1736 1736 { 1737 ASSERT_WITH_MESSAGE(refCount() || parentNode(), "Attribute must not be set on an element before adoptRef"); 1738 1737 1739 if (newValue.isNull()) { 1738 1740 if (index != ElementData::attributeNotFound) -
trunk/Source/WebCore/html/FileInputType.cpp
r266168 r267074 74 74 75 75 private: 76 static Ref<UploadButtonElement> createInternal(Document&, const String& value); 76 77 bool isUploadButton() const override { return true; } 77 78 … … 81 82 Ref<UploadButtonElement> UploadButtonElement::create(Document& document) 82 83 { 84 return createInternal(document, fileButtonChooseFileLabel()); 85 } 86 87 Ref<UploadButtonElement> UploadButtonElement::createForMultiple(Document& document) 88 { 89 return createInternal(document, fileButtonChooseMultipleFilesLabel()); 90 } 91 92 Ref<UploadButtonElement> UploadButtonElement::createInternal(Document& document, const String& value) 93 { 83 94 auto button = adoptRef(*new UploadButtonElement(document)); 84 button->setValue(fileButtonChooseFileLabel()); 85 return button; 86 } 87 88 Ref<UploadButtonElement> UploadButtonElement::createForMultiple(Document& document) 89 { 90 auto button = adoptRef(*new UploadButtonElement(document)); 91 button->setValue(fileButtonChooseMultipleFilesLabel()); 95 static MainThreadNeverDestroyed<const AtomString> buttonName("button", AtomString::ConstructFromLiteral); 96 static MainThreadNeverDestroyed<const AtomString> webkitFileUploadButtonName("-webkit-file-upload-button", AtomString::ConstructFromLiteral); 97 button->setType(buttonName); 98 button->setPseudo(webkitFileUploadButtonName); 99 button->setValue(value); 92 100 return button; 93 101 } … … 96 104 : HTMLInputElement(inputTag, document, 0, false) 97 105 { 98 static MainThreadNeverDestroyed<const AtomString> buttonName("button", AtomString::ConstructFromLiteral);99 static MainThreadNeverDestroyed<const AtomString> webkitFileUploadButtonName("-webkit-file-upload-button", AtomString::ConstructFromLiteral);100 setType(buttonName);101 setPseudo(webkitFileUploadButtonName);102 106 } 103 107 -
trunk/Source/WebCore/html/HTMLKeygenElement.cpp
r261013 r267074 51 51 static Ref<KeygenSelectElement> create(Document& document) 52 52 { 53 return adoptRef(*new KeygenSelectElement(document)); 53 auto element = adoptRef(*new KeygenSelectElement(document)); 54 static MainThreadNeverDestroyed<const AtomString> pseudoId("-webkit-keygen-select", AtomString::ConstructFromLiteral); 55 element->setPseudo(pseudoId); 56 return element; 54 57 } 55 58 … … 58 61 : HTMLSelectElement(selectTag, document, 0) 59 62 { 60 static MainThreadNeverDestroyed<const AtomString> pseudoId("-webkit-keygen-select", AtomString::ConstructFromLiteral);61 setPseudo(pseudoId);62 63 } 63 64 -
trunk/Source/WebCore/html/shadow/DateTimeEditElement.cpp
r266779 r267074 181 181 , m_editControlOwner(makeWeakPtr(editControlOwner)) 182 182 { 183 static MainThreadNeverDestroyed<const AtomString> dateTimeEditPseudoId("-webkit-datetime-edit", AtomString::ConstructFromLiteral);184 setPseudo(dateTimeEditPseudoId);185 183 } 186 184 … … 223 221 Ref<DateTimeEditElement> DateTimeEditElement::create(Document& document, EditControlOwner& editControlOwner) 224 222 { 225 return adoptRef(*new DateTimeEditElement(document, editControlOwner)); 223 auto element = adoptRef(*new DateTimeEditElement(document, editControlOwner)); 224 static MainThreadNeverDestroyed<const AtomString> dateTimeEditPseudoId("-webkit-datetime-edit", AtomString::ConstructFromLiteral); 225 element->setPseudo(dateTimeEditPseudoId); 226 return element; 226 227 } 227 228 -
trunk/Source/WebCore/html/shadow/DateTimeFieldElements.cpp
r266779 r267074 41 41 : DateTimeNumericFieldElement(document, fieldOwner, Range(1, 31), "--"_s) 42 42 { 43 } 44 45 Ref<DateTimeDayFieldElement> DateTimeDayFieldElement::create(Document& document, FieldOwner& fieldOwner) 46 { 47 auto element = adoptRef(*new DateTimeDayFieldElement(document, fieldOwner)); 43 48 static MainThreadNeverDestroyed<const AtomString> dayPseudoId("-webkit-datetime-edit-day-field", AtomString::ConstructFromLiteral); 44 initialize(dayPseudoId); 45 } 46 47 Ref<DateTimeDayFieldElement> DateTimeDayFieldElement::create(Document& document, FieldOwner& fieldOwner) 48 { 49 return adoptRef(*new DateTimeDayFieldElement(document, fieldOwner)); 49 element->initialize(dayPseudoId); 50 return element; 50 51 } 51 52 … … 66 67 : DateTimeNumericFieldElement(document, fieldOwner, Range(minimum, maximum), "--"_s) 67 68 { 69 } 70 71 Ref<DateTimeHourFieldElement> DateTimeHourFieldElement::create(Document& document, FieldOwner& fieldOwner, int minimum, int maximum) 72 { 73 auto element = adoptRef(*new DateTimeHourFieldElement(document, fieldOwner, minimum, maximum)); 68 74 static MainThreadNeverDestroyed<const AtomString> hourPseudoId("-webkit-datetime-edit-hour-field", AtomString::ConstructFromLiteral); 69 initialize(hourPseudoId); 70 } 71 72 Ref<DateTimeHourFieldElement> DateTimeHourFieldElement::create(Document& document, FieldOwner& fieldOwner, int minimum, int maximum) 73 { 74 return adoptRef(*new DateTimeHourFieldElement(document, fieldOwner, minimum, maximum)); 75 element->initialize(hourPseudoId); 76 return element; 75 77 } 76 78 … … 130 132 : DateTimeSymbolicFieldElement(document, fieldOwner, labels) 131 133 { 134 } 135 136 Ref<DateTimeMeridiemFieldElement> DateTimeMeridiemFieldElement::create(Document& document, FieldOwner& fieldOwner, const Vector<String>& labels) 137 { 138 auto element = adoptRef(*new DateTimeMeridiemFieldElement(document, fieldOwner, labels)); 132 139 static MainThreadNeverDestroyed<const AtomString> meridiemPseudoId("-webkit-datetime-edit-meridiem-field", AtomString::ConstructFromLiteral); 133 initialize(meridiemPseudoId); 134 } 135 136 Ref<DateTimeMeridiemFieldElement> DateTimeMeridiemFieldElement::create(Document& document, FieldOwner& fieldOwner, const Vector<String>& labels) 137 { 138 return adoptRef(*new DateTimeMeridiemFieldElement(document, fieldOwner, labels)); 140 element->initialize(meridiemPseudoId); 141 return element; 139 142 } 140 143 … … 155 158 : DateTimeNumericFieldElement(document, fieldOwner, Range(0, 999), "--"_s) 156 159 { 160 } 161 162 Ref<DateTimeMillisecondFieldElement> DateTimeMillisecondFieldElement::create(Document& document, FieldOwner& fieldOwner) 163 { 164 auto element = adoptRef(*new DateTimeMillisecondFieldElement(document, fieldOwner)); 157 165 static MainThreadNeverDestroyed<const AtomString> millisecondPseudoId("-webkit-datetime-edit-millisecond-field", AtomString::ConstructFromLiteral); 158 initialize(millisecondPseudoId); 159 } 160 161 Ref<DateTimeMillisecondFieldElement> DateTimeMillisecondFieldElement::create(Document& document, FieldOwner& fieldOwner) 162 { 163 return adoptRef(*new DateTimeMillisecondFieldElement(document, fieldOwner)); 166 element->initialize(millisecondPseudoId); 167 return element; 164 168 } 165 169 … … 180 184 : DateTimeNumericFieldElement(document, fieldOwner, Range(0, 59), "--"_s) 181 185 { 186 } 187 188 Ref<DateTimeMinuteFieldElement> DateTimeMinuteFieldElement::create(Document& document, FieldOwner& fieldOwner) 189 { 190 auto element = adoptRef(*new DateTimeMinuteFieldElement(document, fieldOwner)); 182 191 static MainThreadNeverDestroyed<const AtomString> minutePseudoId("-webkit-datetime-edit-minute-field", AtomString::ConstructFromLiteral); 183 initialize(minutePseudoId); 184 } 185 186 Ref<DateTimeMinuteFieldElement> DateTimeMinuteFieldElement::create(Document& document, FieldOwner& fieldOwner) 187 { 188 return adoptRef(*new DateTimeMinuteFieldElement(document, fieldOwner)); 192 element->initialize(minutePseudoId); 193 return element; 189 194 } 190 195 … … 205 210 : DateTimeNumericFieldElement(document, fieldOwner, Range(1, 12), "--"_s) 206 211 { 212 } 213 214 Ref<DateTimeMonthFieldElement> DateTimeMonthFieldElement::create(Document& document, FieldOwner& fieldOwner) 215 { 216 auto element = adoptRef(*new DateTimeMonthFieldElement(document, fieldOwner)); 207 217 static MainThreadNeverDestroyed<const AtomString> monthPseudoId("-webkit-datetime-edit-month-field", AtomString::ConstructFromLiteral); 208 initialize(monthPseudoId); 209 } 210 211 Ref<DateTimeMonthFieldElement> DateTimeMonthFieldElement::create(Document& document, FieldOwner& fieldOwner) 212 { 213 return adoptRef(*new DateTimeMonthFieldElement(document, fieldOwner)); 218 element->initialize(monthPseudoId); 219 return element; 214 220 } 215 221 … … 231 237 : DateTimeNumericFieldElement(document, fieldOwner, Range(0, 59), "--"_s) 232 238 { 239 } 240 241 Ref<DateTimeSecondFieldElement> DateTimeSecondFieldElement::create(Document& document, FieldOwner& fieldOwner) 242 { 243 auto element = adoptRef(*new DateTimeSecondFieldElement(document, fieldOwner)); 233 244 static MainThreadNeverDestroyed<const AtomString> secondPseudoId("-webkit-datetime-edit-second-field", AtomString::ConstructFromLiteral); 234 initialize(secondPseudoId); 235 } 236 237 Ref<DateTimeSecondFieldElement> DateTimeSecondFieldElement::create(Document& document, FieldOwner& fieldOwner) 238 { 239 return adoptRef(*new DateTimeSecondFieldElement(document, fieldOwner)); 245 element->initialize(secondPseudoId); 246 return element; 240 247 } 241 248 … … 256 263 : DateTimeSymbolicFieldElement(document, fieldOwner, labels) 257 264 { 265 } 266 267 Ref<DateTimeSymbolicMonthFieldElement> DateTimeSymbolicMonthFieldElement::create(Document& document, FieldOwner& fieldOwner, const Vector<String>& labels) 268 { 269 auto element = adoptRef(*new DateTimeSymbolicMonthFieldElement(document, fieldOwner, labels)); 258 270 static MainThreadNeverDestroyed<const AtomString> monthPseudoId("-webkit-datetime-edit-month-field", AtomString::ConstructFromLiteral); 259 initialize(monthPseudoId); 260 } 261 262 Ref<DateTimeSymbolicMonthFieldElement> DateTimeSymbolicMonthFieldElement::create(Document& document, FieldOwner& fieldOwner, const Vector<String>& labels) 263 { 264 return adoptRef(*new DateTimeSymbolicMonthFieldElement(document, fieldOwner, labels)); 271 element->initialize(monthPseudoId); 272 return element; 265 273 } 266 274 … … 281 289 : DateTimeNumericFieldElement(document, fieldOwner, Range(DateComponents::minimumYear(), DateComponents::maximumYear()), "----"_s) 282 290 { 291 } 292 293 Ref<DateTimeYearFieldElement> DateTimeYearFieldElement::create(Document& document, FieldOwner& fieldOwner) 294 { 295 auto element = adoptRef(*new DateTimeYearFieldElement(document, fieldOwner)); 283 296 static MainThreadNeverDestroyed<const AtomString> yearPseudoId("-webkit-datetime-edit-year-field", AtomString::ConstructFromLiteral); 284 initialize(yearPseudoId); 285 } 286 287 Ref<DateTimeYearFieldElement> DateTimeYearFieldElement::create(Document& document, FieldOwner& fieldOwner) 288 { 289 return adoptRef(*new DateTimeYearFieldElement(document, fieldOwner)); 297 element->initialize(yearPseudoId); 298 return element; 290 299 } 291 300 -
trunk/Source/WebCore/html/shadow/DetailsMarkerControl.cpp
r261013 r267074 44 44 Ref<DetailsMarkerControl> DetailsMarkerControl::create(Document& document) 45 45 { 46 return adoptRef(*new DetailsMarkerControl(document)); 46 auto control = adoptRef(*new DetailsMarkerControl(document)); 47 static MainThreadNeverDestroyed<const AtomString> webkitDetailsMarkerName("-webkit-details-marker", AtomString::ConstructFromLiteral); 48 control->setPseudo(webkitDetailsMarkerName); 49 return control; 47 50 } 48 51 … … 50 53 : HTMLDivElement(HTMLNames::divTag, document) 51 54 { 52 static MainThreadNeverDestroyed<const AtomString> webkitDetailsMarkerName("-webkit-details-marker", AtomString::ConstructFromLiteral);53 setPseudo(webkitDetailsMarkerName);54 55 } 55 56 -
trunk/Source/WebCore/html/shadow/MediaControlTextTrackContainerElement.cpp
r263544 r267074 68 68 { 69 69 auto element = adoptRef(*new MediaControlTextTrackContainerElement(document, mediaElement)); 70 static MainThreadNeverDestroyed<const AtomString> webkitMediaTextTrackContainerName("-webkit-media-text-track-container", AtomString::ConstructFromLiteral); 71 element->setPseudo(webkitMediaTextTrackContainerName); 70 72 element->hide(); 71 73 return element; … … 76 78 , m_mediaElement(makeWeakPtr(&element)) 77 79 { 78 static MainThreadNeverDestroyed<const AtomString> webkitMediaTextTrackContainerName("-webkit-media-text-track-container", AtomString::ConstructFromLiteral);79 setPseudo(webkitMediaTextTrackContainerName);80 80 } 81 81 -
trunk/Source/WebCore/html/shadow/SpinButtonElement.cpp
r261013 r267074 56 56 , m_repeatingTimer(*this, &SpinButtonElement::repeatingTimerFired) 57 57 { 58 setHasCustomStyleResolveCallbacks(); 59 } 60 61 Ref<SpinButtonElement> SpinButtonElement::create(Document& document, SpinButtonOwner& spinButtonOwner) 62 { 63 auto element = adoptRef(*new SpinButtonElement(document, spinButtonOwner)); 58 64 static MainThreadNeverDestroyed<const AtomString> webkitInnerSpinButtonName("-webkit-inner-spin-button", AtomString::ConstructFromLiteral); 59 setHasCustomStyleResolveCallbacks(); 60 setPseudo(webkitInnerSpinButtonName); 61 } 62 63 Ref<SpinButtonElement> SpinButtonElement::create(Document& document, SpinButtonOwner& spinButtonOwner) 64 { 65 return adoptRef(*new SpinButtonElement(document, spinButtonOwner)); 65 element->setPseudo(webkitInnerSpinButtonName); 66 return element; 66 67 } 67 68 -
trunk/Source/WebCore/html/shadow/TextControlInnerElements.cpp
r261013 r267074 183 183 : HTMLDivElement(divTag, document) 184 184 { 185 setHasCustomStyleResolveCallbacks(); 186 } 187 188 Ref<TextControlPlaceholderElement> TextControlPlaceholderElement::create(Document& document) 189 { 190 auto element = adoptRef(*new TextControlPlaceholderElement(document)); 185 191 static MainThreadNeverDestroyed<const AtomString> placeholderName("placeholder", AtomString::ConstructFromLiteral); 186 setPseudo(placeholderName); 187 setHasCustomStyleResolveCallbacks(); 188 } 189 190 Ref<TextControlPlaceholderElement> TextControlPlaceholderElement::create(Document& document) 191 { 192 return adoptRef(*new TextControlPlaceholderElement(document)); 192 element->setPseudo(placeholderName); 193 return element; 193 194 } 194 195 … … 256 257 : HTMLDivElement(divTag, document) 257 258 { 259 setHasCustomStyleResolveCallbacks(); 260 } 261 262 Ref<SearchFieldCancelButtonElement> SearchFieldCancelButtonElement::create(Document& document) 263 { 264 auto element = adoptRef(*new SearchFieldCancelButtonElement(document)); 258 265 static MainThreadNeverDestroyed<const AtomString> webkitSearchCancelButtonName("-webkit-search-cancel-button", AtomString::ConstructFromLiteral); 259 266 static MainThreadNeverDestroyed<const AtomString> buttonName("button", AtomString::ConstructFromLiteral); 260 261 setHasCustomStyleResolveCallbacks(); 262 263 setPseudo(webkitSearchCancelButtonName); 267 element->setPseudo(webkitSearchCancelButtonName); 264 268 #if !PLATFORM(IOS_FAMILY) 265 setAttributeWithoutSynchronization(aria_labelAttr, AXSearchFieldCancelButtonText());269 element->setAttributeWithoutSynchronization(aria_labelAttr, AXSearchFieldCancelButtonText()); 266 270 #endif 267 setAttributeWithoutSynchronization(roleAttr, buttonName); 268 } 269 270 Ref<SearchFieldCancelButtonElement> SearchFieldCancelButtonElement::create(Document& document) 271 { 272 return adoptRef(*new SearchFieldCancelButtonElement(document)); 271 element->setAttributeWithoutSynchronization(roleAttr, buttonName); 272 return element; 273 273 } 274 274 -
trunk/Source/WebCore/html/shadow/YouTubeEmbedShadowElement.cpp
r261013 r267074 34 34 WTF_MAKE_ISO_ALLOCATED_IMPL(YouTubeEmbedShadowElement); 35 35 36 Ref<YouTubeEmbedShadowElement> YouTubeEmbedShadowElement::create(Document& doc )36 Ref<YouTubeEmbedShadowElement> YouTubeEmbedShadowElement::create(Document& document) 37 37 { 38 return adoptRef(*new YouTubeEmbedShadowElement(doc)); 38 auto element = adoptRef(*new YouTubeEmbedShadowElement(document)); 39 static MainThreadNeverDestroyed<const AtomString> webkitPluginReplacementName("-webkit-plugin-replacement", AtomString::ConstructFromLiteral); 40 element->setPseudo(webkitPluginReplacementName); 41 return element; 39 42 } 40 43 … … 42 45 : HTMLDivElement(HTMLNames::divTag, document) 43 46 { 44 static MainThreadNeverDestroyed<const AtomString> webkitPluginReplacementName("-webkit-plugin-replacement", AtomString::ConstructFromLiteral);45 setPseudo(webkitPluginReplacementName);46 47 } 47 48 -
trunk/Source/WebCore/html/track/TextTrackCue.cpp
r262695 r267074 93 93 } 94 94 95 Ref<TextTrackCueBox> TextTrackCueBox::create(Document& document, TextTrackCue& cue) 96 { 97 auto box = adoptRef(*new TextTrackCueBox(document, cue)); 98 box->initialize(); 99 return box; 100 } 101 95 102 TextTrackCueBox::TextTrackCueBox(Document& document, TextTrackCue& cue) 96 103 : HTMLElement(HTMLNames::divTag, document) … … 98 105 { 99 106 setHasCustomStyleResolveCallbacks(); 107 } 108 109 void TextTrackCueBox::initialize() 110 { 100 111 setPseudo(TextTrackCue::cueBoxShadowPseudoId()); 101 112 } -
trunk/Source/WebCore/html/track/TextTrackCue.h
r262695 r267074 47 47 WTF_MAKE_ISO_ALLOCATED(TextTrackCueBox); 48 48 public: 49 static Ref<TextTrackCueBox> create(Document& document, TextTrackCue& cue) 50 { 51 return adoptRef(*new TextTrackCueBox(document, cue)); 52 } 49 static Ref<TextTrackCueBox> create(Document&, TextTrackCue&); 53 50 54 51 TextTrackCue* getCue() const; … … 56 53 57 54 protected: 55 void initialize(); 56 58 57 TextTrackCueBox(Document&, TextTrackCue&); 59 58 ~TextTrackCueBox() { } -
trunk/Source/WebCore/html/track/TextTrackCueGeneric.cpp
r263788 r267074 53 53 WTF_MAKE_ISO_ALLOCATED_INLINE(TextTrackCueGenericBoxElement); 54 54 public: 55 static Ref<TextTrackCueGenericBoxElement> create(Document& document, TextTrackCueGeneric& cue) 56 { 57 return adoptRef(*new TextTrackCueGenericBoxElement(document, cue)); 58 } 55 static Ref<TextTrackCueGenericBoxElement> create(Document&, TextTrackCueGeneric&); 59 56 60 57 void applyCSSProperties(const IntSize&) override; … … 63 60 TextTrackCueGenericBoxElement(Document&, VTTCue&); 64 61 }; 62 63 Ref<TextTrackCueGenericBoxElement> TextTrackCueGenericBoxElement::create(Document& document, TextTrackCueGeneric& cue) 64 { 65 auto box = adoptRef(*new TextTrackCueGenericBoxElement(document, cue)); 66 box->initialize(); 67 return box; 68 } 65 69 66 70 TextTrackCueGenericBoxElement::TextTrackCueGenericBoxElement(Document& document, VTTCue& cue) -
trunk/Source/WebCore/html/track/VTTCue.cpp
r262695 r267074 125 125 126 126 // ---------------------------- 127 128 Ref<VTTCueBox> VTTCueBox::create(Document& document, VTTCue& cue) 129 { 130 auto box = adoptRef(*new VTTCueBox(document, cue)); 131 box->initialize(); 132 return box; 133 } 127 134 128 135 VTTCueBox::VTTCueBox(Document& document, VTTCue& cue) -
trunk/Source/WebCore/html/track/VTTCue.h
r262695 r267074 53 53 WTF_MAKE_ISO_ALLOCATED(VTTCueBox); 54 54 public: 55 static Ref<VTTCueBox> create(Document& document, VTTCue& cue) 56 { 57 return adoptRef(*new VTTCueBox(document, cue)); 58 } 55 static Ref<VTTCueBox> create(Document&, VTTCue&); 59 56 60 57 void applyCSSProperties(const IntSize&) override;
Note: See TracChangeset
for help on using the changeset viewer.