WebKit Bugzilla
Attachment 340944 Details for
Bug 185278
: Remove dead exception in MediaList.appendMedium
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for landing
bug-185278-20180521221805.patch (text/plain), 6.96 KB, created by
Chris Nardi
on 2018-05-21 19:18:07 PDT
(
hide
)
Description:
Patch for landing
Filename:
MIME Type:
Creator:
Chris Nardi
Created:
2018-05-21 19:18:07 PDT
Size:
6.96 KB
patch
obsolete
>Subversion Revision: 231306 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index bee00c2c6c681b3d725ec9f576ded3cec8bd05ff..87d9de1b0fa643c48d3e0130ace2c46854122134 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,24 @@ >+2018-05-03 Chris Nardi <cnardi@chromium.org> >+ >+ Remove dead exception in MediaList.appendMedium >+ https://bugs.webkit.org/show_bug.cgi?id=185278 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ MediaList.appendMedium was able to throw an exception, but MediaQuerySet::add() always >+ returned true, making it impossible for that exception to be thrown. This matched the >+ spec, as |appendMedium| is not specified to throw an exception. Remove the dead code >+ surrounding the exception, and make MediaQuerySet::add() return false if the medium is >+ not added. >+ >+ No new/modified tests as there should be no functional changes. >+ >+ * css/MediaList.cpp: >+ (WebCore::MediaQuerySet::add): >+ (WebCore::MediaList::appendMedium): >+ * css/MediaList.h: >+ * css/MediaList.idl: >+ > 2018-05-03 Ryan Haddad <ryanhaddad@apple.com> > > Unreviewed, rolling out r231253. >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 6bb98eaeb9de0d45de9fee6354edc6120bd15fb7..7bdfbbc99e93799405b5367be40711dc88c91d87 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,15 @@ >+2018-05-03 Chris Nardi <cnardi@chromium.org> >+ >+ Remove dead exception in MediaList.appendMedium >+ https://bugs.webkit.org/show_bug.cgi?id=185278 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Remove code pertaining to an exception being thrown by appendMedium(). >+ >+ * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMediaList.cpp: >+ (webkit_dom_media_list_append_medium): >+ > 2018-05-03 Ryan Haddad <ryanhaddad@apple.com> > > Unreviewed, rolling out r231253. >diff --git a/Source/WebKitLegacy/mac/ChangeLog b/Source/WebKitLegacy/mac/ChangeLog >index 3676e65a3ed703707de0044039e0201ca5f72df5..9d9035a38200bf9e2deb4d61323e3f26adbdb676 100644 >--- a/Source/WebKitLegacy/mac/ChangeLog >+++ b/Source/WebKitLegacy/mac/ChangeLog >@@ -1,3 +1,15 @@ >+2018-05-03 Chris Nardi <cnardi@chromium.org> >+ >+ Remove dead exception in MediaList.appendMedium >+ https://bugs.webkit.org/show_bug.cgi?id=185278 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Remove code pertaining to an exception being thrown by appendMedium(). >+ >+ * DOM/DOMMediaList.mm: >+ (-[DOMMediaList appendMedium:]): >+ > 2018-05-01 Eric Carlson <eric.carlson@apple.com> > > [MediaStream] remove WK1 support >diff --git a/Source/WebCore/css/MediaList.cpp b/Source/WebCore/css/MediaList.cpp >index 45750af97567ac2ab6b0344c538e5cfd8aaad54c..1ad9644321094ca8222ff6df23be9a47ec5f8414 100644 >--- a/Source/WebCore/css/MediaList.cpp >+++ b/Source/WebCore/css/MediaList.cpp >@@ -96,13 +96,13 @@ bool MediaQuerySet::add(const String& queryString) > > // Only continue if exactly one media query is found, as described above. > if (result->m_queries.size() != 1) >- return true; >+ return false; > > // If comparing with any of the media queries in the collection of media > // queries returns true terminate these steps. > for (size_t i = 0; i < m_queries.size(); ++i) { > if (m_queries[i] == result->m_queries[0]) >- return true; >+ return false; > } > > m_queries.append(result->m_queries[0]); >@@ -204,18 +204,14 @@ ExceptionOr<void> MediaList::deleteMedium(const String& medium) > return { }; > } > >-ExceptionOr<void> MediaList::appendMedium(const String& medium) >+void MediaList::appendMedium(const String& medium) > { > CSSStyleSheet::RuleMutationScope mutationScope(m_parentRule); > >- bool success = m_mediaQueries->add(medium); >- if (!success) { >- // FIXME: Should this really be InvalidCharacterError? >- return Exception { InvalidCharacterError }; >- } >+ if (!m_mediaQueries->add(medium)) >+ return; > if (m_parentStyleSheet) > m_parentStyleSheet->didMutate(); >- return { }; > } > > void MediaList::reattach(MediaQuerySet* mediaQueries) >diff --git a/Source/WebCore/css/MediaList.h b/Source/WebCore/css/MediaList.h >index 07896e02692cf1fe872da2138f34257b52ed853a..4cbd401123924f34e320b0d7d7913f07a1c325b2 100644 >--- a/Source/WebCore/css/MediaList.h >+++ b/Source/WebCore/css/MediaList.h >@@ -90,7 +90,7 @@ public: > unsigned length() const { return m_mediaQueries->queryVector().size(); } > WEBCORE_EXPORT String item(unsigned index) const; > WEBCORE_EXPORT ExceptionOr<void> deleteMedium(const String& oldMedium); >- WEBCORE_EXPORT ExceptionOr<void> appendMedium(const String& newMedium); >+ WEBCORE_EXPORT void appendMedium(const String& newMedium); > > String mediaText() const { return m_mediaQueries->mediaText(); } > WEBCORE_EXPORT ExceptionOr<void> setMediaText(const String&); >diff --git a/Source/WebCore/css/MediaList.idl b/Source/WebCore/css/MediaList.idl >index cf6ac4e83977f8faafb586476cec5cb5de41f29f..21dd7abb590d4051fa828a58ecdd0de399d1bb29 100644 >--- a/Source/WebCore/css/MediaList.idl >+++ b/Source/WebCore/css/MediaList.idl >@@ -35,5 +35,5 @@ > getter DOMString? item(unsigned long index); > > [MayThrowException] void deleteMedium(DOMString oldMedium); >- [MayThrowException] void appendMedium(DOMString newMedium); >+ void appendMedium(DOMString newMedium); > }; >diff --git a/Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMediaList.cpp b/Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMediaList.cpp >index fb1b4abf376af7e106e0d5415544a26d12e4fe41..8731b99d902c9ef4b28194a57284aaa9bdccb248 100644 >--- a/Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMediaList.cpp >+++ b/Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMediaList.cpp >@@ -194,11 +194,7 @@ void webkit_dom_media_list_append_medium(WebKitDOMMediaList* self, const gchar* > g_return_if_fail(!error || !*error); > WebCore::MediaList* item = WebKit::core(self); > WTF::String convertedNewMedium = WTF::String::fromUTF8(newMedium); >- auto result = item->appendMedium(convertedNewMedium); >- if (result.hasException()) { >- auto description = WebCore::DOMException::description(result.releaseException().code()); >- g_set_error_literal(error, g_quark_from_string("WEBKIT_DOM"), description.legacyCode, description.name); >- } >+ item->appendMedium(convertedNewMedium); > } > > gchar* webkit_dom_media_list_get_media_text(WebKitDOMMediaList* self) >diff --git a/Source/WebKitLegacy/mac/DOM/DOMMediaList.mm b/Source/WebKitLegacy/mac/DOM/DOMMediaList.mm >index 003df6f7b838a4b81d0a9168b387891973271f20..2df34205b6bf3a8d177cc13181217efb958d7dda 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMMediaList.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMMediaList.mm >@@ -85,7 +85,7 @@ > - (void)appendMedium:(NSString *)newMedium > { > WebCore::JSMainThreadNullState state; >- raiseOnDOMError(IMPL->appendMedium(newMedium)); >+ IMPL->appendMedium(newMedium); > } > > @end
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 185278
:
339487
|
339493
|
339496
|
339557
|
339564
| 340944