Port DOMTimer from std::chrono::milliseconds to WTF::Seconds type
[WebKit-https.git] / Source / WebCore / ChangeLog
index 24b7913..abc3134 100644 (file)
@@ -1,3 +1,360 @@
+2017-03-07  Chris Dumez  <cdumez@apple.com>
+
+        Port DOMTimer from std::chrono::milliseconds to WTF::Seconds type
+        https://bugs.webkit.org/show_bug.cgi?id=169236
+
+        Reviewed by Simon Fraser.
+
+        * dom/Document.cpp:
+        (WebCore::Document::minimumDOMTimerInterval):
+        (WebCore::Document::timerAlignmentInterval):
+        * dom/Document.h:
+        * dom/ScriptExecutionContext.cpp:
+        (WebCore::ScriptExecutionContext::adjustMinimumDOMTimerInterval):
+        (WebCore::ScriptExecutionContext::minimumDOMTimerInterval):
+        (WebCore::ScriptExecutionContext::timerAlignmentInterval):
+        * dom/ScriptExecutionContext.h:
+        * inspector/InspectorInstrumentation.cpp:
+        (WebCore::InspectorInstrumentation::didInstallTimerImpl):
+        * inspector/InspectorInstrumentation.h:
+        (WebCore::InspectorInstrumentation::didInstallTimer):
+        * inspector/InspectorTimelineAgent.cpp:
+        (WebCore::InspectorTimelineAgent::didInstallTimer):
+        * inspector/InspectorTimelineAgent.h:
+        * inspector/TimelineRecordFactory.cpp:
+        (WebCore::TimelineRecordFactory::createTimerInstallData):
+        * inspector/TimelineRecordFactory.h:
+        * page/DOMTimer.cpp:
+        (WebCore::shouldForwardUserGesture):
+        (WebCore::userGestureTokenToForward):
+        (WebCore::DOMTimer::DOMTimer):
+        (WebCore::DOMTimer::install):
+        (WebCore::DOMTimer::intervalClampedToMinimum):
+        (WebCore::DOMTimer::alignedFireTime):
+        * page/DOMTimer.h:
+        * page/DOMWindow.cpp:
+        (WebCore::DOMWindow::setTimeout):
+        (WebCore::DOMWindow::setInterval):
+        * page/Page.cpp:
+        (WebCore::Page::setTimerThrottlingState):
+        (WebCore::Page::setDOMTimerAlignmentIntervalIncreaseLimit):
+        (WebCore::Page::updateDOMTimerAlignmentInterval):
+        * page/Page.h:
+        (WebCore::Page::domTimerAlignmentInterval):
+        * page/Settings.cpp:
+        (WebCore::Settings::setMinimumDOMTimerInterval):
+        * page/Settings.h:
+        (WebCore::Settings::minimumDOMTimerInterval):
+        * page/SuspendableTimer.h:
+        (WebCore::SuspendableTimer::startRepeating):
+        (WebCore::SuspendableTimer::startOneShot):
+        (WebCore::SuspendableTimer::augmentFireInterval):
+        (WebCore::SuspendableTimer::augmentRepeatInterval):
+        * platform/Timer.cpp:
+        (WebCore::TimerBase::setNextFireTime):
+        * platform/Timer.h:
+        (WebCore::TimerBase::alignedFireTime):
+        * testing/InternalSettings.cpp:
+        (WebCore::InternalSettings::setMinimumTimerInterval):
+        * testing/InternalSettings.h:
+        * testing/Internals.cpp:
+        (WebCore::Internals::isTimerThrottled):
+        * workers/WorkerGlobalScope.cpp:
+        (WebCore::WorkerGlobalScope::setTimeout):
+        (WebCore::WorkerGlobalScope::setInterval):
+
+2017-03-07  Chris Dumez  <cdumez@apple.com>
+
+        Align initEvent / initCustomEvent / initMessageEvent with the latest specification
+        https://bugs.webkit.org/show_bug.cgi?id=169176
+
+        Reviewed by Alex Christensen.
+
+        Align initEvent / initCustomEvent / initMessageEvent with the latest specification
+        after:
+        - https://github.com/whatwg/dom/pull/417
+        - https://github.com/whatwg/html/pull/2410
+
+        In particular, the following changes were made:
+        - initEvent: The length property now properly returns 1 instead of 3 as only the
+          first parameter is mandatory. We were already behaving correcting the the length
+          property value was wrong because we forgot to drop a hack from the bindings
+          generator.
+        - initCustomEvent: Make all parameters except the first optional. Previously, all
+          parameters were mandatory so this is safe.
+        - initMessageEvent: Drop the custom code and mark the first parameter as mandatory.
+          A side effect of dropping the custom code is that null is no longer considered as
+          valid input for the last parameter. The parameter is of type sequence<> and the
+          new behavior is consistent with the specification and Firefox. If it turns out to
+          break existing content, I'll make the parameter nullable in a follow-up.
+
+        No new tests, updated existing tests.
+
+        * bindings/js/JSMessageEventCustom.cpp:
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (GeneratePropertiesHashTable):
+        * dom/CustomEvent.idl:
+        * dom/MessageEvent.idl:
+
+2017-03-07  Antti Koivisto  <antti@apple.com>
+
+        Differentiate between pending head and body stylesheets in Style::Scope
+        https://bugs.webkit.org/show_bug.cgi?id=169277
+
+        Reviewed by Andreas Kling.
+
+        Split pending stylesheet node set into separate sets for head and body elements and processing instructions.
+
+        This tightens typing and will also be useful later.
+
+        * style/StyleScope.cpp:
+        (WebCore::Style::Scope::~Scope):
+        (WebCore::Style::Scope::addPendingSheet):
+        (WebCore::Style::Scope::removePendingSheet):
+        (WebCore::Style::Scope::didRemovePendingStylesheet):
+        (WebCore::Style::Scope::hasPendingSheet):
+        (WebCore::Style::Scope::hasPendingSheetInBody):
+        (WebCore::Style::Scope::hasProcessingInstructionWithPendingSheet): Deleted.
+        * style/StyleScope.h:
+        (WebCore::Style::Scope::hasPendingSheet): Deleted.
+        (WebCore::Style::Scope::hasPendingSheets): Deleted.
+        * style/StyleTreeResolver.cpp:
+        (WebCore::Style::hasLoadingStylesheet):
+
+            Just test for body stylesheets.
+
+        (WebCore::Style::TreeResolver::resolve):
+
+            Treat all before-body stylesheets uniformly.
+
+2017-03-07  Antoine Quint  <graouts@apple.com>
+
+        [Modern Media Controls] Setting a valid source after an invalid one retains the invalid placard
+        https://bugs.webkit.org/show_bug.cgi?id=169280
+        <rdar://problem/30876078>
+
+        Reviewed by Jon Lee.
+
+        We need to track when a new load start to see if we might have recovered from an error
+        and hide the "invalid" placard.
+
+        Test: media/modern-media-controls/placard-support/placard-support-error-recover.html
+
+        * Modules/modern-media-controls/media/placard-support.js:
+        (PlacardSupport.prototype.get mediaEvents):
+
+2017-03-07  Andy Estes  <aestes@apple.com>
+
+        REGRESSION (r213412): JPEG premultiplication tests fail under GuardMalloc
+        https://bugs.webkit.org/show_bug.cgi?id=169266
+
+        Reviewed by Tim Horton.
+
+        r213412 added functions to create a CGImageRef from a canvas image buffer, which were used
+        to create data: URLs and blobs. If JPEG premultiplication is applied, though,
+        WebCore::cgImage() would return an image with a data provider pointing to stack memory.
+
+        I fixed a similar issue in ImageBuffer::toCGImage() by leaking the reference to a
+        Uint8ClampedArray then creating a CGDataProviderRef with a releaseData function that adopts
+        the leaked reference.
+
+        We could take that approach in cgImage() too by allocating the premultiplied data buffer on
+        the heap then freeing it with a releaseData function, but it's simpler to refactor
+        toCGImage()/cgImage() to return an encoded image as a CFDataRef instead of a CFImageRef.
+        This ensures that a CGDataProviderRef never outlives the data it points to.
+
+        Covered by existing tests.
+
+        * platform/graphics/ImageBuffer.h: Renamed toCGImage() to toCFData().
+        * platform/graphics/cg/ImageBufferCG.cpp:
+        (WebCore::dataURL): Changed to take a CFDataRef.
+        (WebCore::dataVector): Renamed from data(). Changed to take a CFDataRef.
+        (WebCore::ImageBuffer::toDataURL): Changed to call toCFData().
+        (WebCore::ImageBuffer::toData): Ditto.
+        (WebCore::ImageBuffer::toCFData): Changed to return a CFDataRef after encoding the
+        CGImageRef that was previously returned.
+        (WebCore::cfData): Ditto.
+        (WebCore::dataURL): Changed to call cfData().
+        (WebCore::data): Ditto.
+        (WebCore::ImageBuffer::toCGImage): Renamed to ImageBuffer::toCFData().
+        (WebCore::cgImage): Renamed to WebCore::cfData().
+
+2017-03-07  Myles C. Maxfield  <mmaxfield@apple.com>
+
+        Test fix after r213505
+        https://bugs.webkit.org/show_bug.cgi?id=169267
+
+        Unreviewed.
+
+        * platform/graphics/cocoa/FontCacheCoreText.cpp:
+        (WebCore::preparePlatformFont):
+
+2017-03-06  Myles C. Maxfield  <mmaxfield@apple.com>
+
+        Apply well-known-axis variation values at the right time in preparePlatformFont()
+        https://bugs.webkit.org/show_bug.cgi?id=168896
+
+        Reviewed by Jon Lee.
+
+        Simply plumb the FontSelectionRequest to the place where font variations are implemented.
+
+        Test: fast/text/variations/font-selection-properties.html
+
+        * platform/graphics/FontCache.h:
+        * platform/graphics/cocoa/FontCacheCoreText.cpp:
+        (WebCore::preparePlatformFont):
+        (WebCore::fontWithFamily):
+        (WebCore::FontCache::createFontPlatformData):
+        (WebCore::FontCache::systemFallbackForCharacters):
+        * platform/graphics/mac/FontCustomPlatformData.cpp:
+        (WebCore::FontCustomPlatformData::fontPlatformData):
+
+2017-03-06  Myles C. Maxfield  <mmaxfield@apple.com>
+
+        Unreviewed post-review fixup after r213464
+        https://bugs.webkit.org/show_bug.cgi?id=169255
+
+        * platform/graphics/FontCache.h:
+        (WebCore::FontDescriptionKey::FontDescriptionKey):
+        (WebCore::FontDescriptionKey::operator==):
+        (WebCore::FontDescriptionKey::computeHash):
+        (WebCore::FontDescriptionKey::makeFlagsKey):
+        * platform/graphics/cocoa/FontCacheCoreText.cpp:
+        (WebCore::computeNecessarySynthesis):
+
+2017-03-06  Brent Fulgham  <bfulgham@apple.com>
+
+        Validate DOM after potentially destructive actions during parser insert operations
+        https://bugs.webkit.org/show_bug.cgi?id=169222
+        <rdar://problem/30689729>
+
+        Reviewed by Ryosuke Niwa.
+
+        Do not perform an insert operation if the next child's parent is no longer
+        part of the tree. This can happen if JavaScript runs during node removal
+        events and modifies the contents of the document.
+
+        This patch was inspired by a similar Blink change by Marius Mlynski:
+        <https://src.chromium.org/viewvc/blink?view=revision&revision=200690>        
+
+        Tests: fast/parser/scriptexec-during-parserInsertBefore.html
+
+        * html/parser/HTMLConstructionSite.cpp:
+        (WebCore::executeReparentTask):
+        (WebCore::executeInsertAlreadyParsedChildTask):
+
+2017-03-06  Myles C. Maxfield  <mmaxfield@apple.com>
+
+        Update isEmojiGroupCandidate() to the latest version of Unicode
+        https://bugs.webkit.org/show_bug.cgi?id=168198
+
+        Reviewed by Jon Lee.
+
+        In the latest version of Unicode, many more code points are candidates for emoji groups.
+        Therefore, isEmojiGroupCandidate() should be made more permissive. This way, the function
+        is more future-proof.
+
+        Test: editing/deleting/delete-emoji.html
+
+        * platform/text/CharacterProperties.h:
+        (WebCore::icuLibraryUnderstandsSupplementalSymbolsAndPictographs):
+        (WebCore::isEmojiGroupCandidate):
+
+2017-03-06  Youenn Fablet  <youenn@apple.com>
+
+        Use default configuration for libwebrtc peerconnection
+        https://bugs.webkit.org/show_bug.cgi?id=169239
+
+        Reviewed by Alex Christensen.
+
+        * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
+        (WebCore::configurationFromMediaEndpointConfiguration): Using the default configuration instead of the aggressive one.
+
+2017-03-06  Fujii Hironori  <Hironori.Fujii@sony.com>
+
+        [CMake] SN-DBS fails to build: Cannot open include file: 'WebCoreTestSupportPrefix.h'
+        https://bugs.webkit.org/show_bug.cgi?id=169244
+
+        Reviewed by Alex Christensen.
+
+        A distributed build system SN-DBS can not find
+        WebCoreTestSupportPrefix.h without an include path to it.
+
+        * CMakeLists.txt: Add 'WebCore/testing/js' to include paths.
+
+2017-03-06  Fujii Hironori  <Hironori.Fujii@sony.com>
+
+        [cairo] error C2065: 'quality': undeclared identifier since r213412
+        https://bugs.webkit.org/show_bug.cgi?id=169240
+
+        Reviewed by Ryosuke Niwa.
+
+        * platform/graphics/cairo/ImageBufferCairo.cpp:
+        (WebCore::ImageBuffer::toDataURL): Name the unnamed second argument 'quality'.
+
+2017-03-06  Jiewen Tan  <jiewen_tan@apple.com>
+
+        [WebCrypto] Implement ECDH GenerateKey operation
+        https://bugs.webkit.org/show_bug.cgi?id=169093
+        <rdar://problem/23789585>
+
+        Reviewed by Brent Fulgham.
+
+        This patch implements GenerateKey operation of ECDH according to:
+        https://www.w3.org/TR/WebCryptoAPI/#ecdh-operations.
+        Note: Sad that we are not able to support P-521 at this moment due
+        to lack of necessary support in the underlying crypto library.
+
+        Tests: crypto/subtle/ec-generate-key-malformed-parameters.html
+               crypto/subtle/ecdh-generate-key-extractable.html
+               crypto/subtle/ecdh-generate-key-p256.html
+               crypto/subtle/ecdh-generate-key-p384.html
+               crypto/subtle/ecdh-generate-key-single-usage.html
+               crypto/workers/subtle/ec-generate-key.html
+
+        * CMakeLists.txt:
+        * DerivedSources.make:
+        * PlatformGTK.cmake:
+        * PlatformMac.cmake:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/JSCryptoKeyCustom.cpp:
+        (WebCore::JSCryptoKey::algorithm):
+        * bindings/js/JSSubtleCryptoCustom.cpp:
+        (WebCore::normalizeCryptoAlgorithmParameters):
+        (WebCore::jsSubtleCryptoFunctionGenerateKeyPromise):
+        Add support for ECDH.
+        * bindings/js/SerializedScriptValue.cpp:
+        (WebCore::CloneSerializer::write):
+        Structured clonable will be added later on.
+        * crypto/CommonCryptoUtilities.h:
+        Add SPI for EC.
+        * crypto/CryptoAlgorithmParameters.h:
+        * crypto/CryptoKey.h:
+        * crypto/algorithms/CryptoAlgorithmECDH.cpp: Added.
+        (WebCore::CryptoAlgorithmECDH::create):
+        (WebCore::CryptoAlgorithmECDH::identifier):
+        (WebCore::CryptoAlgorithmECDH::generateKey):
+        * crypto/algorithms/CryptoAlgorithmECDH.h: Added.
+        * crypto/gnutls/CryptoKeyECGnuTLS.cpp: Added.
+        (WebCore::CryptoKeyEC::~CryptoKeyEC):
+        (WebCore::CryptoKeyEC::platformGeneratePair):
+        * crypto/keys/CryptoKeyEC.cpp: Added.
+        (WebCore::CryptoKeyEC::CryptoKeyEC):
+        (WebCore::CryptoKeyEC::generatePair):
+        (WebCore::CryptoKeyEC::buildAlgorithm):
+        (WebCore::CryptoKeyEC::exportData):
+        * crypto/keys/CryptoKeyEC.h: Added.
+        (WebCore::EcKeyAlgorithm::EcKeyAlgorithm):
+        (WebCore::EcKeyAlgorithm::namedCurve):
+        * crypto/mac/CryptoAlgorithmRegistryMac.cpp:
+        (WebCore::CryptoAlgorithmRegistry::platformRegisterAlgorithms):
+        Add support for ECDH.
+        * crypto/mac/CryptoKeyECMac.cpp: Added.
+        (WebCore::CryptoKeyEC::~CryptoKeyEC):
+        (WebCore::CryptoKeyEC::platformGeneratePair):
+        * crypto/parameters/CryptoAlgorithmEcKeyParams.h: Added.
+        * crypto/parameters/EcKeyParams.idl: Added.
+
 2017-03-06  Michael Catanzaro  <mcatanzaro@igalia.com>
 
         Unreviewed, fix unused parameter warning after r213464