Move some more assorted classes from ExceptionCode to Exception
[WebKit.git] / Source / WebCore / ChangeLog
index f90a963..9ec1559 100644 (file)
@@ -1,3 +1,246 @@
+2016-10-21  Darin Adler  <darin@apple.com>
+
+        Move some more assorted classes from ExceptionCode to Exception
+        https://bugs.webkit.org/show_bug.cgi?id=163775
+
+        Reviewed by Chris Dumez.
+
+        * Modules/fetch/WorkerGlobalScopeFetch.cpp:
+        (WebCore::WorkerGlobalScopeFetch::fetch): Remove unnecessary calls to
+        WorkerGlobalScope::scriptExcutionObject, which just returns the scope itself.
+
+        * Modules/notifications/Notification.cpp: Added now-needed include.
+        * Modules/webdatabase/DOMWindowWebDatabase.cpp: Ditto.
+
+        * WebCore.xcodeproj/project.pbxproj: Added WindowOrWorkerGlobalScope.idl.
+
+        * bindings/js/JSDedicatedWorkerGlobalScopeCustom.cpp:
+        (WebCore::JSDedicatedWorkerGlobalScope::postMessage): Pass a reference instead
+        of a pointer to handlePostMessage.
+        * bindings/js/JSMessagePortCustom.cpp:
+        (WebCore::JSMessagePort::postMessage): Ditto.
+
+        * bindings/js/JSMessagePortCustom.h: Use pragma once. Change handlePostMessage
+        to take a reference to the object instead of a pointer, and also to use
+        propagateException since postMessage now uses ExceptionOr.
+
+        * bindings/js/JSWorkerCustom.cpp:
+        (WebCore::JSWorker::postMessage): Pass a reference instead of a pointer to
+        handlePostMessage.
+        (WebCore::constructJSWorker): Use the version of toJSNewlyCreated that handles
+        propagating an exception from ExceptionOr.
+
+        * bindings/js/JSWorkerGlobalScopeCustom.cpp:
+        (WebCore::JSWorkerGlobalScope::visitAdditionalChildren): Use auto.
+        Remove unnecessary round trip through the scriptExecutionContext function.
+        (WebCore::JSWorkerGlobalScope::importScripts): Use reserveInitialCapacity and
+        uncheckedAppend to build up the vector of strings. Use propagateException
+        to deal with ExceptionOr result.
+
+        * dom/MessagePort.cpp:
+        (WebCore::MessagePort::MessagePort): Initialize boolean data members in the
+        class definition instead of here.
+        (WebCore::MessagePort::postMessage): Use ExceptionOr.
+        (WebCore::MessagePort::entangle): Use an rvalue reference.
+        (WebCore::MessagePort::dispatchMessages): Use ExceptionOr.
+        (WebCore::MessagePort::disentanglePorts): Ditto. Also use a more efficient
+        idiom that does half as much hashing as the old algorithm, and got rid an
+        unneeded local variable.
+        (WebCore::MessagePort::entanglePorts): Use an rvalue reference.
+        * dom/MessagePort.h: Updated for above changes.
+
+        * fileapi/FileReader.cpp:
+        (WebCore::FileReader::create): Use auto.
+        (WebCore::FileReader::FileReader): Initialize scalars in the class definition.
+        (WebCore::FileReader::~FileReader): Call cancel on the loader directly
+        instead of sharing code with the stop function.
+        (WebCore::FileReader::stop): Moved the body of the terminate function here.
+        (WebCore::FileReader::readAsArrayBuffer): Use ExceptionOr.
+        (WebCore::FileReader::readAsBinaryString): Ditto.
+        (WebCore::FileReader::readAsText): Ditto.
+        (WebCore::FileReader::readAsDataURL): Ditto.
+        (WebCore::FileReader::readInternal): Ditto. Also add a cast now that
+        we derive privately from FileReaderLoaderClient.
+        (WebCore::FileReader::abort): Call stop instead of terminate.
+        (WebCore::FileReader::terminate): Deleted. Moved code into stop.
+        (WebCore::FileReader::didReceiveData): Moved comment to where the constant is.
+        * fileapi/FileReader.h: Updated for above changes. Made more functions private
+        and used final instead of override.
+        * fileapi/FileReader.idl: Use non-legacy exceptions.
+
+        * fileapi/FileReaderSync.cpp:
+        (WebCore::FileReaderSync::readAsArrayBuffer): Use ExceptionOr.
+        (WebCore::FileReaderSync::readAsBinaryString): Ditto.
+        (WebCore::FileReaderSync::readAsText): Ditto.
+        (WebCore::FileReaderSync::readAsDataURL): Ditto.
+        (WebCore::FileReaderSync::startLoading): Ditto.
+        (WebCore::FileReaderSync::startLoadingString): Added. Helper to cut down on
+        repeated code in functions above.
+        * fileapi/FileReaderSync.h: Updated for above changes.
+        * fileapi/FileReaderSync.idl: Use non-legacy exceptions.
+
+        * page/Base64Utilities.cpp:
+        (WebCore::Base64Utilities::btoa): Use ExceptionOr.
+        (WebCore::Base64Utilities::atob): Ditto.
+        * page/Base64Utilities.h: Updated for above changes.
+
+        * page/DOMWindow.cpp:
+        (WebCore::DOMWindow::navigator): Pass a reference to the frame.
+        (WebCore::DOMWindow::postMessage): Use ExceptionOr when calling
+        MessagePort::disentanglePorts. Also udpated for changes to the
+        PostMessageTimer.
+
+        * page/Navigator.cpp:
+        (WebCore::Navigator::Navigator): Take a reference.
+        (WebCore::shouldHideFourDot): Ditto
+        (WebCore::Navigator::appVersion): Pass a reference.
+        (WebCore::Navigator::plugins): Return a reference.
+        (WebCore::Navigator::mimeTypes): Ditto.
+        * page/Navigator.h: Updated for above changes. Also marked the
+        class final and moved derivation from RefCounted to NavigatorBase.
+
+        * page/NavigatorBase.h: Addded derivation from RefCounted since
+        both derived classes want that, and the destructor is already virtual.
+
+        * page/WindowOrWorkerGlobalScope.idl: Use non-legacy exceptions.
+
+        * page/WorkerNavigator.cpp:
+        (WebCore::WorkerNavigator::~WorkerNavigator): Deleted.
+
+        * page/WorkerNavigator.h: Moved derivation from RefCounted to
+        NavigatorBase. Also marked class final.
+
+        * workers/AbstractWorker.cpp:
+        (WebCore::AbstractWorker::resolveURL): Use ExceptionOr.
+        * workers/AbstractWorker.h: Updated for above changes.
+
+        * workers/DedicatedWorkerGlobalScope.cpp:
+        (WebCore::DedicatedWorkerGlobalScope::create): Use RefPtr&&
+        instead of PassRefPtr.
+        (WebCore::DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope):
+        Ditto.
+        (WebCore::DedicatedWorkerGlobalScope::postMessage): Use ExceptionOr.
+        (WebCore::DedicatedWorkerGlobalScope::importScripts): Ditto.
+        * workers/DedicatedWorkerGlobalScope.h: Updated for above changes.
+        * workers/DedicatedWorkerGlobalScope.idl: Use non-legacy exceptions.
+
+        * workers/Worker.cpp:
+        (WebCore::Worker::create): Use ExceptionOr.
+        (WebCore::Worker::postMessage): Ditto.
+        * workers/Worker.h: Updated for above changes.
+        * workers/Worker.idl: Use non-legacy exception.
+
+        * workers/WorkerGlobalScope.cpp:
+        (WebCore::WorkerGlobalScope::WorkerGlobalScope): Moved initialization
+        of m_closing to class definition.
+        (WebCore::WorkerGlobalScope::~WorkerGlobalScope): Removed call to
+        deleted notifyObserversOfStop function.
+        (WebCore::WorkerGlobalScope::importScripts): Use ExceptionOr. Also use
+        reserveInitialCapacity and uncheckedAppend to build a vector.
+        (WebCore::WorkerGlobalScope::addConsoleMessage): Use an rvalue reference.
+        Also moved the body of one of the addMessageToWorkerConsole overloads into
+        one of the overloads of this function, and changed the other to call addMessage.
+        (WebCore::WorkerGlobalScope::addMessage): Moved the body of the other
+        addMessageToWorkerConsole here.
+        (WebCore::WorkerGlobalScope::addMessageToWorkerConsole): Deleted.
+        (WebCore::WorkerGlobalScope::Observer::Observer): Deleted.
+        (WebCore::WorkerGlobalScope::Observer::~Observer): Deleted.
+        (WebCore::WorkerGlobalScope::Observer::stopObserving): Deleted.
+        (WebCore::WorkerGlobalScope::registerObserver): Deleted.
+        (WebCore::WorkerGlobalScope::unregisterObserver): Deleted.
+        (WebCore::WorkerGlobalScope::notifyObserversOfStop): Deleted.
+        * workers/WorkerGlobalScope.h: Removed unneeded includes. Moved many virtual
+        function overrides into the private section. Marked many functions final instead
+        of just override. Removed unused Observer class and m_workerObservers set.
+
+        * workers/WorkerThread.cpp:
+        (WebCore::WorkerThread::stop): Removed call to deleted
+        WorkerGlobalScope::notifyObserversOfStop function.
+
+2016-10-21  Antti Koivisto  <antti@apple.com>
+
+        Tighten ComputedStyleExtractor to use Element instead of Node
+        https://bugs.webkit.org/show_bug.cgi?id=163798
+
+        Reviewed by Andreas Kling.
+
+        Also make its functions non-const as they may compute style.
+
+        * css/CSSComputedStyleDeclaration.cpp:
+        (WebCore::styleElementForNode):
+        (WebCore::ComputedStyleExtractor::ComputedStyleExtractor):
+
+            If we are called with a Node figure out the style Element in constructor.
+
+        (WebCore::ComputedStyleExtractor::getFontSizeCSSValuePreferringKeyword):
+        (WebCore::ComputedStyleExtractor::useFixedFontDefaultSize):
+        (WebCore::ComputedStyleExtractor::styledElement):
+        (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
+        (WebCore::CSSComputedStyleDeclaration::copyProperties):
+        (WebCore::elementOrItsAncestorNeedsStyleRecalc):
+
+            Use composed tree iterator for increased correctness in shadow trees.
+
+        (WebCore::updateStyleIfNeededForElement):
+        (WebCore::computeRenderStyleForProperty):
+        (WebCore::ComputedStyleExtractor::customPropertyValue):
+        (WebCore::ComputedStyleExtractor::customPropertyText):
+        (WebCore::ComputedStyleExtractor::propertyValue):
+        (WebCore::CSSComputedStyleDeclaration::length):
+        (WebCore::CSSComputedStyleDeclaration::item):
+        (WebCore::ComputedStyleExtractor::propertyMatches):
+        (WebCore::ComputedStyleExtractor::copyProperties):
+        (WebCore::ComputedStyleExtractor::getCSSPropertyValuesForShorthandProperties):
+        (WebCore::ComputedStyleExtractor::getCSSPropertyValuesForSidesShorthand):
+        (WebCore::ComputedStyleExtractor::getCSSPropertyValuesForGridShorthand):
+        (WebCore::ComputedStyleExtractor::copyPropertiesInSet):
+        (WebCore::CSSComputedStyleDeclaration::getPropertyValue):
+        (WebCore::ComputedStyleExtractor::getBackgroundShorthandValue):
+        (WebCore::ComputedStyleExtractor::styledNode): Deleted.
+        (WebCore::nodeOrItsAncestorNeedsStyleRecalc): Deleted.
+        (WebCore::updateStyleIfNeededForNode): Deleted.
+        * css/CSSComputedStyleDeclaration.h:
+        * css/SVGCSSComputedStyleDeclaration.cpp:
+        (WebCore::ComputedStyleExtractor::svgPropertyValue):
+        * editing/EditingStyle.cpp:
+        (WebCore::EditingStyle::removeEquivalentProperties):
+        * editing/EditingStyle.h:
+
+2016-10-21  Chris Dumez  <cdumez@apple.com>
+
+        WebGL2RenderingContext.texSubImage3D() should use a union instead of overloading
+        https://bugs.webkit.org/show_bug.cgi?id=163792
+
+        Reviewed by Darin Adler.
+
+        WebGL2RenderingContext.texSubImage3D() should use a union instead of overloading for 
+        - https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7 (for texSubImage3D)
+        - https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14 (for TexImageSource)
+
+        * html/canvas/WebGL2RenderingContext.cpp:
+        (WebCore::WebGL2RenderingContext::texSubImage3D):
+        * html/canvas/WebGL2RenderingContext.h:
+        * html/canvas/WebGL2RenderingContext.idl:
+
+2016-10-21  Zalan Bujtas  <zalan@apple.com>
+
+        Do not mutate the render tree while collecting selection repaint rects.
+        https://bugs.webkit.org/show_bug.cgi?id=163800
+        <rdar://problem/28806886>
+
+        Reviewed by David Hyatt.
+
+        RenderListItem not only mutates the tree while in layout but it also uses
+        the old descendant context to find the insertion point.
+        This patch strictly ensures that we only do it while in layout and never
+        in other cases such as collecting repaint rects.
+        This gets redundant when webkit.org/b/163789 is fixed.
+
+        Test: fast/lists/crash-when-list-marker-is-moved-during-selection.html
+
+        * rendering/RenderListItem.cpp:
+        (WebCore::RenderListItem::insertOrMoveMarkerRendererIfNeeded):
+
 2016-10-21  Dave Hyatt  <hyatt@apple.com>
 
         [CSS Parser] Support horizontal-bt writing mode