Changeset 232044 in webkit
- Timestamp:
- May 21, 2018 8:11:30 PM (6 years ago)
- Location:
- trunk/Source
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r232043 r232044 1 2018-05-21 Chris Nardi <cnardi@chromium.org> 2 3 Remove dead exception in MediaList.appendMedium 4 https://bugs.webkit.org/show_bug.cgi?id=185278 5 6 Reviewed by Chris Dumez. 7 8 MediaList.appendMedium was able to throw an exception, but MediaQuerySet::add() always 9 returned true, making it impossible for that exception to be thrown. This matched the 10 spec, as |appendMedium| is not specified to throw an exception. Remove the dead code 11 surrounding the exception, and make MediaQuerySet::add() return false if the medium is 12 not added. 13 14 No new/modified tests as there should be no functional changes. 15 16 * css/MediaList.cpp: 17 (WebCore::MediaQuerySet::add): 18 (WebCore::MediaList::appendMedium): 19 * css/MediaList.h: 20 * css/MediaList.idl: 21 1 22 2018-05-21 Chris Dumez <cdumez@apple.com> 2 23 -
trunk/Source/WebCore/css/MediaList.cpp
r229654 r232044 97 97 // Only continue if exactly one media query is found, as described above. 98 98 if (result->m_queries.size() != 1) 99 return true;99 return false; 100 100 101 101 // If comparing with any of the media queries in the collection of media … … 103 103 for (size_t i = 0; i < m_queries.size(); ++i) { 104 104 if (m_queries[i] == result->m_queries[0]) 105 return true;105 return false; 106 106 } 107 107 … … 205 205 } 206 206 207 ExceptionOr<void>MediaList::appendMedium(const String& medium)207 void MediaList::appendMedium(const String& medium) 208 208 { 209 209 CSSStyleSheet::RuleMutationScope mutationScope(m_parentRule); 210 210 211 bool success = m_mediaQueries->add(medium); 212 if (!success) { 213 // FIXME: Should this really be InvalidCharacterError? 214 return Exception { InvalidCharacterError }; 215 } 211 if (!m_mediaQueries->add(medium)) 212 return; 216 213 if (m_parentStyleSheet) 217 214 m_parentStyleSheet->didMutate(); 218 return { };219 215 } 220 216 -
trunk/Source/WebCore/css/MediaList.h
r229654 r232044 91 91 WEBCORE_EXPORT String item(unsigned index) const; 92 92 WEBCORE_EXPORT ExceptionOr<void> deleteMedium(const String& oldMedium); 93 WEBCORE_EXPORT ExceptionOr<void>appendMedium(const String& newMedium);93 WEBCORE_EXPORT void appendMedium(const String& newMedium); 94 94 95 95 String mediaText() const { return m_mediaQueries->mediaText(); } -
trunk/Source/WebCore/css/MediaList.idl
r222429 r232044 36 36 37 37 [MayThrowException] void deleteMedium(DOMString oldMedium); 38 [MayThrowException]void appendMedium(DOMString newMedium);38 void appendMedium(DOMString newMedium); 39 39 }; -
trunk/Source/WebKit/ChangeLog
r232040 r232044 1 2018-05-21 Chris Nardi <cnardi@chromium.org> 2 3 Remove dead exception in MediaList.appendMedium 4 https://bugs.webkit.org/show_bug.cgi?id=185278 5 6 Reviewed by Chris Dumez. 7 8 Remove code pertaining to an exception being thrown by appendMedium(). 9 10 * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMediaList.cpp: 11 (webkit_dom_media_list_append_medium): 12 1 13 2018-05-21 Aditya Keerthi <akeerthi@apple.com> 2 14 -
trunk/Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMediaList.cpp
r229973 r232044 195 195 WebCore::MediaList* item = WebKit::core(self); 196 196 WTF::String convertedNewMedium = WTF::String::fromUTF8(newMedium); 197 auto result = item->appendMedium(convertedNewMedium); 198 if (result.hasException()) { 199 auto description = WebCore::DOMException::description(result.releaseException().code()); 200 g_set_error_literal(error, g_quark_from_string("WEBKIT_DOM"), description.legacyCode, description.name); 201 } 197 item->appendMedium(convertedNewMedium); 202 198 } 203 199 -
trunk/Source/WebKitLegacy/mac/ChangeLog
r232024 r232044 1 2018-05-21 Chris Nardi <cnardi@chromium.org> 2 3 Remove dead exception in MediaList.appendMedium 4 https://bugs.webkit.org/show_bug.cgi?id=185278 5 6 Reviewed by Chris Dumez. 7 8 Remove code pertaining to an exception being thrown by appendMedium(). 9 10 * DOM/DOMMediaList.mm: 11 (-[DOMMediaList appendMedium:]): 12 1 13 2018-05-21 Jer Noble <jer.noble@apple.com> 2 14 -
trunk/Source/WebKitLegacy/mac/DOM/DOMMediaList.mm
r207396 r232044 86 86 { 87 87 WebCore::JSMainThreadNullState state; 88 raiseOnDOMError(IMPL->appendMedium(newMedium));88 IMPL->appendMedium(newMedium); 89 89 } 90 90
Note: See TracChangeset
for help on using the changeset viewer.