blob: 79dd32fff2e80225287068bbe920910ca11c84e2 [file] [log] [blame]
2016-11-13 Joseph Pecoraro <pecoraro@apple.com>
Use #pragma once in WebCore
https://bugs.webkit.org/show_bug.cgi?id=164686
Reviewed by Michael Catanzaro.
* css/*.h:
* plugins/*.h:
* rendering/*.h:
* style/*.h:
* svg/*.h:
* testing/*.h:
2016-11-12 Dan Bernstein <mitz@apple.com>
Tried to fix the iOS build after r208666.
* platform/SuddenTermination.h:
2016-11-12 Simon Fraser <simon.fraser@apple.com>
Add a way to get the UI-side scrolling tree as text via UIScriptController
https://bugs.webkit.org/show_bug.cgi?id=164697
Reviewed by Zalan Bujtas.
Add dumping to ScrollingTreeNode and subclasses (previously, we could only dump
the scrolling state tree). This re-uses the flags used for state tree dumping.
NodeIDs are not dumped by default because they can depend on earlier tests.
Test: scrollingcoordinator/ios/ui-scrolling-tree.html
* page/scrolling/ScrollingStateNode.h:
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::scrollingTreeAsText):
* page/scrolling/ScrollingTree.h:
* page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
(WebCore::ScrollingTreeFrameScrollingNode::dumpProperties):
* page/scrolling/ScrollingTreeFrameScrollingNode.h:
* page/scrolling/ScrollingTreeNode.cpp:
(WebCore::ScrollingTreeNode::dumpProperties):
(WebCore::ScrollingTreeNode::dump):
* page/scrolling/ScrollingTreeNode.h:
* page/scrolling/ScrollingTreeScrollingNode.cpp:
(WebCore::ScrollingTreeScrollingNode::dumpProperties):
* page/scrolling/ScrollingTreeScrollingNode.h:
* page/scrolling/mac/ScrollingTreeFixedNode.h:
* page/scrolling/mac/ScrollingTreeFixedNode.mm:
(WebCore::ScrollingTreeFixedNode::dumpProperties):
* page/scrolling/mac/ScrollingTreeStickyNode.h:
* page/scrolling/mac/ScrollingTreeStickyNode.mm:
(WebCore::ScrollingTreeStickyNode::dumpProperties):
2016-11-12 Darin Adler <darin@apple.com>
Remove some use of ExceptionCode in MediaStream
https://bugs.webkit.org/show_bug.cgi?id=164690
Reviewed by Sam Weinig.
* Modules/mediastream/MediaDevices.cpp:
(WebCore::MediaDevices::MediaDevices): Take a Document&.
(WebCore::MediaDevices::create): Ditto.
(WebCore::MediaDevices::~MediaDevices): Deleted.
(WebCore::MediaDevices::getUserMedia): Check document for null and
pass a reference to UserMediaRequest::start. Removed unused ExceptionCode
argument to UserMediaRequest::start, since the only exception was for
a null document.
(WebCore::MediaDevices::enumerateDevices): Check document for null and
pass a reference to MediaDevicesRequest::create. Removed exception
handling entirely because MediaDevicesRequest::create was not ever
raising an exception before.
* Modules/mediastream/MediaDevices.h: Updated for above changes.
* Modules/mediastream/MediaDevices.idl: Removed MayThrowException from
enumerateDevices, because it never throws an exception.
* Modules/mediastream/MediaDevicesRequest.cpp:
(WebCore::MediaDevicesRequest::MediaDevicesRequest): Take a Document&.
Removed unused ExceptionCode& argument.
(WebCore::MediaDevicesRequest::create): Ditto.
* Modules/mediastream/MediaDevicesRequest.h: Updated for above changes.
* Modules/mediastream/NavigatorMediaDevices.cpp:
(WebCore::NavigatorMediaDevices::mediaDevices): Pass a reference.
* Modules/mediastream/UserMediaRequest.cpp:
(WebCore::UserMediaRequest::start): Use ExceptionOr.
(WebCore::UserMediaRequest::UserMediaRequest): Take a Document& and
a UserMediaController&.
* Modules/mediastream/UserMediaRequest.h: Updated for above changes.
2016-11-12 Simon Fraser <simon.fraser@apple.com>
[iOS WK2] Share some code with Mac for post-async-scroll state reconciliation
https://bugs.webkit.org/show_bug.cgi?id=164694
Reviewed by Zalan Bujtas.
When an async scroll notifications get back to the main thread in
AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll(), we call
syncViewportConstrainedLayerPositions() to poke the new layer positions on the
GraphicsLayers to match the changes made on the scrolling thread.
However, this was not done on iOS, which will be problematic for a future patch
where we require GraphicsLayer positions and the current fixedPositionViewport rect
to have been computed when in a consistent state.
Fix by factoring some code into reconcileScrollingState(), which is called on iOS/WK2
from WebPage::updateVisibleContentRects() rather than setting the FrameView's scroll offset
directly.
Test: scrollingcoordinator/ios/sync-layer-positions-after-scroll.html
* page/WheelEventDeltaFilter.cpp:
(WebCore::WheelEventDeltaFilter::filteredDelta):
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
(WebCore::AsyncScrollingCoordinator::reconcileScrollingState):
(WebCore::AsyncScrollingCoordinator::syncViewportConstrainedLayerPositions):
(WebCore::AsyncScrollingCoordinator::syncChildPositions): Deleted.
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::reconcileScrollingState):
(WebCore::ScrollingCoordinator::syncViewportConstrainedLayerPositions):
(WebCore::ScrollingCoordinator::syncChildPositions): Deleted.
* page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
(WebCore::ScrollingTreeFrameScrollingNode::layoutViewportForScrollPosition):
* platform/Logging.h:
* platform/ScrollView.cpp:
(WebCore::ScrollView::setScrollOffset):
* platform/graphics/ca/TileController.cpp:
(WebCore::TileController::adjustTileCoverageRect):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::updateLayerPositionsAfterDocumentScroll):
2016-11-12 Zalan Bujtas <zalan@apple.com>
RenderObject::flowThreadState should follow containing block instead of parent.
https://bugs.webkit.org/show_bug.cgi?id=164629
Reviewed by Simon Fraser.
Currently every descendant of a region/multicolumn container is considered to be part of the
flowthread including out-of-flow renderers. They all have the InsideFlowThread flag set.
However since out-of-flow renderers are not really part of the flowthread layout context,
whenever the layout code actually checks for their flowthread containers, we return nullptr and
try to handle this seemingly defective state gracefully (that is, flag indicates "inside the flow thread" state,
but there's no flow tread container).
This patch fixes this confused state by setting the RenderObject::flowThreadState flag based on
the containing block's state instead of the parent's.
Not testable, since we seem to manage out-of-flow elements just fine even
when they have the InsideFlowThread flag set.
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::styleDidChange):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::setStyle):
(WebCore::RenderElement::adjustFlowThreadStateIncludingDescendants): This is an iterative DFS pre-order traversal so
we set the flow state first on containers.
* rendering/RenderElement.h:
* rendering/RenderObject.cpp:
(WebCore::RenderObject::computedFlowThreadState):
(WebCore::RenderObject::initializeFlowThreadStateOnInsertion):
* rendering/RenderObject.h:
2016-11-12 Ryosuke Niwa <rniwa@webkit.org>
document.currentScript should be null when running a script inside a shadow tree
https://bugs.webkit.org/show_bug.cgi?id=164693
Reviewed by Yusuke Suzuki.
Fixed the bug that we were returning the old or outer script element in document.currentScript
while executing a script element inside a shadow tree. Return null instead.
New behavior matches the latest HTML5 specification:
https://html.spec.whatwg.org/multipage/scripting.html#execute-the-script-block
where it says for the classic script type, "if the script element's root is not a shadow root, then set
the script element's node document's currentScript attribute to the script element. Otherwise, set it to null."
No new tests. imported/w3c/web-platform-tests/shadow-dom/Document-prototype-currentScript.html covers it.
* dom/CurrentScriptIncrementer.h:
(WebCore::CurrentScriptIncrementer::CurrentScriptIncrementer): Push nullptr when the script element
is inside a shadow tree.
(WebCore::CurrentScriptIncrementer::~CurrentScriptIncrementer): Changed to use an early exit.
* dom/Document.cpp:
(WebCore::Document::pushCurrentScript): Removed the assertion since the argument can now be nullptr.
2016-11-12 Darin Adler <darin@apple.com>
Remove a few assorted uses of ExceptionCode
https://bugs.webkit.org/show_bug.cgi?id=164683
Reviewed by Chris Dumez.
* Modules/applepay/PaymentContact.h: Removed include of ExceptionCode.h.
Also tidied up the constructor and destructor.
* Modules/indexeddb/IDBFactory.h: Removed typedef of ExceptionCode.
* Modules/indexeddb/IDBKeyRange.h: Ditto.
* bindings/js/JSWebGLRenderingContextBaseCustom.cpp:
(WebCore::getObjectParameter): Removed local ExceptionCode variable that
was always 0.
(WebCore::JSWebGLRenderingContextBase::getAttachedShaders): Ditto.
(WebCore::dataFunctionf): Ditto.
(WebCore::dataFunctioni): Ditto.
(WebCore::dataFunctionMatrix): Ditto.
* dom/ContainerNode.cpp:
(WebCore::ContainerNode::cloneChildNodes): Ditto.
* dom/Document.h: Removed typedef of ExceptionCode.
* dom/TreeWalker.h: Ditto.
* editing/markup.h: Ditto.
* html/ImageData.h: Ditto.
* html/InputType.h: Ditto.
* html/canvas/CanvasRenderingContext2D.h: Ditto.
* html/canvas/WebGLDebugShaders.h: Ditto.
* page/DOMWindow.cpp:
(WebCore::DOMWindow::setTimeout): Fixed typo where this was using
ExceptionCode instead of Exception. The code would return an integer
instead of an exception in this case. I could not produce a test that
exercises this code path; I suspect it is an unreachable error condition.
(WebCore::DOMWindow::setInterval): Ditto.
* replay/MemoizedDOMResult.h: Changed typedef of ExceptionCode into
a using statement. Not sure what the longer term fix is.
* xml/parser/XMLDocumentParserLibxml2.cpp:
(WebCore::PendingCallbacks::appendStartElementNSCallback): Renamed to use
WebKit-style "numXXX" rather than "nb_xxx".
(WebCore::PendingCallbacks::PendingStartElementNSCallback::~PendingStartElementNSCallback):
Ditto.
(WebCore::handleNamespaceAttributes): Ditto. Replaced ExceptionCode out
argument with a boolean return value.
(WebCore::handleElementAttributes): Ditto.
(WebCore::XMLDocumentParser::startElementNs): Ditto. Updated for changes
to the handle functions above.
(WebCore::startElementNsHandler): More of the same.
(WebCore::attributesStartElementNsHandler): Ditto.
2016-11-11 Darin Adler <darin@apple.com>
Remove LegacyException support from bindings script
https://bugs.webkit.org/show_bug.cgi?id=164516
Reviewed by Youenn Fablet.
Besides removing LegacyException support from the bindings script, this patch
also removes most uses of ExceptionCodePlaceholder.h. Also, some call sites of
createElement were using ASSERT_NO_EXCEPTION on an argument that was not even an
ExceptionCode&, so to fix that, this changes most call sites to use specific create
functions for specific element classes, rather than using Document::createElement.
* Modules/mediasource/SourceBuffer.cpp: Removed include of
ExceptionCodePlaceholder.h.
* Modules/mediastream/MediaStreamTrack.cpp: Ditto.
* Modules/websockets/WebSocketChannel.cpp: Ditto.
* bindings/js/JSBlobCustom.cpp: Ditto.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation): Removed support for GetterMayThrowLegacyException,
SetterMayThrowLegacyException, and MayThrowLegacyException.
(GenerateParametersCheck): Ditto.
(GenerateImplementationFunctionCall): Ditto.
(GenerateConstructorDefinition): Ditto.
* bindings/scripts/IDLAttributes.txt: Removed ConstructorMayThrowLegacyException,
GetterMayThrowLegacyException, MayThrowLegacyException, and SetterMayThrowLegacyException.
* bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
* bindings/scripts/test/JS/JSTestDOMJIT.cpp:
* bindings/scripts/test/JS/JSTestEventTarget.cpp:
* bindings/scripts/test/JS/JSTestInterface.cpp:
* bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
* bindings/scripts/test/JS/JSTestNondeterministic.cpp:
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
Updated exepected results.
* bindings/scripts/test/TestImplements.idl: Use non-legacy exceptions.
* bindings/scripts/test/TestInterface.idl: Ditto.
* bindings/scripts/test/TestNamedConstructor.idl: Ditto.
* bindings/scripts/test/TestObj.idl: Ditto.
* bindings/scripts/test/TestSupplemental.idl: Ditto.
* bindings/scripts/test/TestTypedefs.idl: Ditto.
* dom/ContainerNode.h: Removed include of ExceptionCodePlaceholder.h.
* editing/AlternativeTextController.cpp: Ditto.
* editing/AppendNodeCommand.cpp: Ditto.
* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::moveParagraphs): Use specific create function
instead of Document::createElement.
* editing/DeleteFromTextNodeCommand.cpp: Removed include of
ExceptionCodePlaceholder.h.
* editing/Editor.cpp: Ditto.
* editing/EditorCommand.cpp: Ditto.
* editing/FormatBlockCommand.cpp: Ditto.
* editing/IndentOutdentCommand.cpp:
(WebCore::IndentOutdentCommand::tryIndentingAsListItem): Use specific create
function instead of Document::createElement.
* editing/InsertListCommand.cpp: Removed include of ExceptionCodePlaceholder.h.
* editing/InsertNodeBeforeCommand.cpp: Ditto.
* editing/RemoveNodeCommand.cpp: Ditto.
* editing/ReplaceSelectionCommand.cpp: Ditto.
* editing/TextIterator.cpp: Ditto.
* editing/WrapContentsInDummySpanCommand.cpp: Ditto.
* editing/cocoa/EditorCocoa.mm:
(WebCore::Editor::styleForSelectionStart): Use specific create function instead
of Document::createElement.
* editing/htmlediting.cpp:
(WebCore::createTabSpanElement): Ditto.
* editing/ios/EditorIOS.mm:
(WebCore::Editor::WebContentReader::readURL): Ditto.
* editing/mac/EditorMac.mm:
(WebCore::Editor::WebContentReader::readURL): Ditto.
* editing/markup.cpp: Removed include of ExceptionCodePlaceholder.h.
* html/FTPDirectoryDocument.cpp:
(WebCore::FTPDirectoryDocumentParser::appendEntry): Use specific create function
instead of Document::createElement.
(WebCore::FTPDirectoryDocumentParser::createTDForFilename): Ditto.
(WebCore::FTPDirectoryDocumentParser::loadDocumentTemplate): Ditto.
(WebCore::FTPDirectoryDocumentParser::createBasicDocument): Ditto.
* html/HTMLEmbedElement.cpp:
(WebCore::HTMLEmbedElement::create): Added overload that just takes a Document.
* html/HTMLEmbedElement.h: Updated for above.
* html/HTMLMediaElement.cpp: Removed include of ExceptionCodePlaceholder.h.
* html/HTMLMetaElement.cpp:
(WebCore::HTMLMetaElement::create): Added overload that just takes a Document.
* html/HTMLMetaElement.h: Updated for above.
* html/HTMLOutputElement.cpp: Removed include of ExceptionCodePlaceholder.h.
* html/HTMLSelectElement.cpp: Ditto.
(WebCore::HTMLSelectElement::setLength): Use specific create function
instead of Document::createElement.
* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::create): Added overload that just takes a Document.
* html/HTMLSourceElement.h: Updated for above.
* html/HTMLStyleElement.cpp:
(WebCore::HTMLStyleElement::HTMLStyleElement): Moved data member initialization
to class definition.
(WebCore::HTMLStyleElement::create): Added overload that just takes a Document.
* html/HTMLStyleElement.h: Updated for above. Also made finishParsingChildren public.
* html/HTMLTableElement.cpp: Removed include of ExceptionCodePlaceholder.h.
* html/HTMLTextAreaElement.cpp: Ditto.
* html/HTMLVideoElement.cpp:
(WebCore::HTMLVideoElement::create): Added overload that just takes a Document.
* html/HTMLVideoElement.h: Updated for above.
* html/ImageDocument.cpp:
(WebCore::ImageDocument::createDocumentStructure): Use specific create function
instead of Document::createElement.
* html/InputType.cpp: Removed include of ExceptionCodePlaceholder.h.
* html/MediaDocument.cpp:
(WebCore::MediaDocumentParser::createDocumentStructure): Use specific create
function instead of Document::createElement.
(WebCore::MediaDocument::replaceMediaElementTimerFired): Ditto.
* html/PluginDocument.cpp:
(WebCore::PluginDocumentParser::createDocumentStructure): Ditto.
* html/RangeInputType.cpp: Removed include of ExceptionCodePlaceholder.h.
* html/RubyElement.cpp:
(WebCore::RubyElement::create): Added overload that just takes a Document.
* html/RubyElement.h: Updated for above.
* html/RubyTextElement.cpp:
(WebCore::RubyTextElement::create): Added overload that just takes a Document.
* html/RubyTextElement.h: Updated for above.
* html/ValidationMessage.cpp: Removed include of ExceptionCodePlaceholder.h.
* html/canvas/CanvasRenderingContext2D.cpp: Ditto.
* html/shadow/MediaControlElementTypes.cpp: Ditto.
* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlClosedCaptionsTrackListElement::rebuildTrackListMenu):
Use specific create function instead of Document::createElement.
* html/shadow/MediaControls.cpp: Removed include of ExceptionCodePlaceholder.h.
* html/shadow/MediaControlsApple.cpp: Ditto.
* html/track/InbandDataTextTrack.cpp: Ditto.
* html/track/InbandGenericTextTrack.cpp: Ditto.
* html/track/InbandTextTrack.cpp: Ditto.
* html/track/VTTRegion.cpp: Ditto.
* html/track/WebVTTElement.cpp:
(WebCore::WebVTTElement::createEquivalentHTMLElement): Use specific create
function instead of Document::createElement.
* inspector/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::createInspectorStyleSheetForDocument): Ditto.
* page/ContextMenuController.cpp: Removed include of ExceptionCodePlaceholder.h.
* page/DOMWindow.cpp: Ditto.
* page/DragController.cpp: Ditto.
* page/EventHandler.cpp: Ditto.
* page/Page.cpp: Ditto.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: Ditto.
* platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm: Ditto.
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: Ditto.
* platform/mac/PasteboardMac.mm: Ditto.
* platform/mac/WebVideoFullscreenHUDWindowController.mm: Ditto.
* platform/mock/mediasource/MockMediaPlayerMediaSource.cpp: Ditto.
* platform/mock/mediasource/MockMediaSourcePrivate.cpp: Ditto.
* rendering/RenderNamedFlowThread.cpp: Ditto.
* rendering/RenderThemeEfl.cpp: Ditto.
* rendering/RenderThemeMac.mm: Ditto.
* rendering/style/SVGRenderStyle.h: Ditto.
* svg/SVGTRefElement.cpp: Ditto.
* xml/XMLErrors.cpp:
(WebCore::XMLErrors::XMLErrors): Take a reference and initialize data member
in class definition.
(WebCore::createXHTMLParserErrorHeader): Take a reference, and mostly use
specific create functions instead of createElement.
(WebCore::XMLErrors::insertErrorMessageBlock): Ditto.
* xml/XMLErrors.h: Updated for above.
* xml/XMLTreeViewer.cpp: Removed include of ExceptionCodePlaceholder.h.
* xml/parser/XMLDocumentParser.cpp:
(WebCore::XMLDocumentParser::handleError): Pass a reference.
* xml/parser/XMLDocumentParserLibxml2.cpp: Removed include of
ExceptionCodePlaceholder.h.
2016-11-12 Dan Bernstein <mitz@apple.com>
Clean up a couple of macOS *SPI headers
https://bugs.webkit.org/show_bug.cgi?id=164687
Reviewed by Sam Weinig.
* platform/spi/cocoa/NSTouchBarSPI.h: Replaced hardcoded strings with global declarations.
* platform/spi/mac/NSSpellCheckerSPI.h: Addressed FIXME by importing private header, and removed declarations
that already appear in the SDK.
2016-11-12 Wenson Hsieh <wenson_hsieh@apple.com>
The main content heuristic should be robust when handling large media elements
https://bugs.webkit.org/show_bug.cgi?id=164676
<rdar://problem/29211503>
Reviewed by Eric Carlson.
Handles integer overflow gracefully when performing the main content check for very large media elements. If the
heuristic comes across such an element, it will now bail early and reject the video as main content. Also adds a
new API test: VideoControlsManager.VideoControlsManagerPageWithEnormousVideo.
* html/MediaElementSession.cpp:
(WebCore::isElementRectMostlyInMainFrame):
2016-11-12 Chris Dumez <cdumez@apple.com>
Speed up setting attributes of input elements of type 'text'
https://bugs.webkit.org/show_bug.cgi?id=164674
Reviewed by Ryosuke Niwa.
Speed up setting attributes of input elements of type 'text' by calling
updateInnerTextValue() only when needed. It was previously called
whenever an attribute was set, no matter it could impact its text value
or not.
No new tests, no Web-exposed behavior change.
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::parseAttribute):
* html/InputType.cpp:
(WebCore::InputType::attributeChanged):
* html/InputType.h:
* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::attributeChanged):
* html/TextFieldInputType.h:
2016-11-12 Dan Bernstein <mitz@apple.com>
Tried to fix the 32-bit build.
* platform/mac/WebPlaybackControlsManager.mm:
2016-11-12 Dan Bernstein <mitz@apple.com>
Tried to fix the 32-bit build.
* platform/mac/WebPlaybackControlsManager.h:
2016-11-12 Dan Bernstein <mitz@apple.com>
Tried to fix the build.
* platform/mac/WebPlaybackControlsManager.h: Declared conformance to
AVFunctionBarPlaybackControlsControlling, which is expected in WebKit::WebViewImpl.
Added ivar.
* platform/mac/WebPlaybackControlsManager.mm:
Synthesize seekToTime property needed for AVFunctionBarPlaybackControlsControlling
conformance.
(-[WebPlaybackControlsManager isSeeking]): Implement this
AVFunctionBarPlaybackControlsControlling method.
(-[WebPlaybackControlsManager seekToTime:toleranceBefore:toleranceAfter:]): Ditto.
2016-11-12 Dan Bernstein <mitz@apple.com>
Tried to fix the build.
* platform/spi/cocoa/NSTouchBarSPI.h: Removed duplicate @interface declarations.
2016-11-12 Frederic Wang <fwang@igalia.com>
Ensure MathML render tree are clean by the end of FrameView::layout().
https://bugs.webkit.org/show_bug.cgi?id=162824
Reviewed by Darin Adler.
clearNeedsLayout is not called during the layout of invalid MathML markup. We introduce a new
helper function to perform proper layout of such markup and we now call it from the various
MathML layoutBlock functions. Additionally, we ensure that the preferred width is dirty after
computation in RenderMathMLScripts::computePreferredLogicalWidths.
Test: mathml/invalid-markup.html
* rendering/mathml/RenderMathMLBlock.cpp:
(WebCore::RenderMathMLBlock::layoutInvalidMarkup): Helper function to layout invalid markup.
* rendering/mathml/RenderMathMLBlock.h: Declare layoutInvalidMarkup.
* rendering/mathml/RenderMathMLFraction.cpp:
(WebCore::RenderMathMLFraction::layoutBlock): Call layoutInvalidMarkup.
* rendering/mathml/RenderMathMLRoot.cpp:
(WebCore::RenderMathMLRoot::layoutBlock): Ditto.
* rendering/mathml/RenderMathMLScripts.cpp:
(WebCore::RenderMathMLScripts::computePreferredLogicalWidths): Set the preferred width dirty
after computation to avoid that it is computed again and again.
(WebCore::RenderMathMLScripts::layoutBlock): Call layoutInvalidMarkup.
* rendering/mathml/RenderMathMLUnderOver.cpp:
(WebCore::RenderMathMLUnderOver::layoutBlock): Ditto.
2016-11-12 Frederic Wang <fwang@igalia.com>
Remove RenderMathMLOperator::shouldAllowStretching
https://bugs.webkit.org/show_bug.cgi?id=164313
Reviewed by Darin Adler.
RenderMathMLOperator::shouldAllowStretching is an old function from early implementations of
MathML. Its name is now confusing since it also includes non-stretchy large operators.
Moreover, it is not really useful and is actually only used by two functions: useMathOperator
and updateMathOperator. The former is almost equivalent and is used as a replacement of
shouldAllowStretching everywhere else. We rewrite the two remaining calls with the finer
test functions isStretchy() and isLargeOperatorInDisplayStyle().
No new tests, behavior unchanged.
* rendering/mathml/RenderMathMLOperator.cpp:
(WebCore::RenderMathMLOperator::updateMathOperator): Reorder the conditionals to avoid the
use of RenderMathMLOperator::shouldAllowStretching and match useMathOperator.
(WebCore::RenderMathMLOperator::useMathOperator): Rewrite shouldAllowStretching() using
isStretchy() and isLargeOperatorInDisplayStyle().
(WebCore::RenderMathMLOperator::shouldAllowStretching): Deleted.
* rendering/mathml/RenderMathMLOperator.h: Remove declaration of shouldAllowStretching.
2016-11-12 Joseph Pecoraro <pecoraro@apple.com>
Use #pragma once in WebCore
https://bugs.webkit.org/show_bug.cgi?id=164373
Reviewed by Darin Adler.
* Modules/*.h:
* crypto/*.h:
* cssjit/*.h:
* editing/*.h:
* fileapi/*.h:
* history/*.h:
* loader/*.h:
* mathml/*.h:
* page/*.h:
* replay/*.h:
* storage/*.h:
* xml/*.h:
* editing/FrameSelection.cpp:
* loader/ResourceLoadStatisticsStore.cpp:
Remove unused LOG and DEBUG defines.
2016-11-12 Wenson Hsieh <wenson_hsieh@apple.com>
Follow-up: fix the OpenSource build on Mac after r208642
https://bugs.webkit.org/show_bug.cgi?id=164677
Reviewed by Ryosuke Niwa.
The playbackControlsController property should also be `assign`.
* platform/spi/cocoa/AVKitSPI.h:
2016-11-11 Wenson Hsieh <wenson_hsieh@apple.com>
SPI imports in AVKitSPI.h should be guarded by USE(APPLE_INTERNAL_SDK)
https://bugs.webkit.org/show_bug.cgi?id=164672
Reviewed by Dan Bernstein.
Fixes the OpenSource build when ENABLE(WEB_PLAYBACK_CONTROLS_MANAGER) is on.
* platform/spi/cocoa/AVKitSPI.h: Add USE(APPLE_INTERNAL_SDK) guards around AVKit function bar SPI headers.
Additionally, define AVFunctionBarPlaybackControlsProvider in the case where AVKit SPI is unavailable.
2016-11-11 Ryosuke Niwa <rniwa@webkit.org>
event.composedPath() does not include window
https://bugs.webkit.org/show_bug.cgi?id=164609
<rdar://problem/29210383>
Reviewed by Antti Koivisto.
Fixed the bug by including WindowContext be a part of the regular EventPath. This also simplifies
dispatchEventInDOM which used to had a special logic for dispatching an event on the window.
Also fixed a bug in EventDispatcher::dispatchEvent that event.target would be nullptr when an event was
dispatched inside a disconnected shadow tree or prevented from propagating to the document tree.
Preserve the final target by simply saving event.target() prior to invoking the default event handler instead.
Test: fast/shadow-dom/event-path-with-window.html
* dom/EventDispatcher.cpp:
(WebCore::WindowEventContext): Deleted. Moved to EventPath.cpp.
(WebCore::dispatchEventInDOM): Removed the code for WindowContext. The generic event dispatching logic
will do the same work now.
(WebCore::EventDispatcher::dispatchEvent): Restore the original target instead of using that of WindowContext.
* dom/EventPath.cpp:
(WebCore::WindowEventContext): Moved from EventDispatcher.cpp. Also made it a subclass of EventContext.
(WebCore::WindowEventContext::handleLocalEvents): Added.
(WebCore::EventPath::EventPath): When the parent's nullptr, check if the current node is Document. If it is,
follow https://dom.spec.whatwg.org/#interface-document where it says:
"A document’s get the parent algorithm, given an event, returns null if event’s type attribute value is 'load'
or document does not have a browsing context, and the document’s associated Window object otherwise."
(WebCore::EventPath::setRelatedTarget): Skip over WindowContext.
(WebCore::EventPath::retargetTouch): Ditto.
(WebCore::EventPath::computePathUnclosedToTarget): When the target is DOMWindow, use its document as the target.
Also, include any event target that is not a node in the event path.
2016-11-11 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Support all the correct blend modes
https://bugs.webkit.org/show_bug.cgi?id=164669
Reviewed by Dean Jackson.
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
2016-11-11 Alex Christensen <achristensen@webkit.org>
Use SecurityOriginData as keys in StorageManager
https://bugs.webkit.org/show_bug.cgi?id=159834
<rdar://problem/27346948>
Reviewed by Brady Eidson.
No change in behavior.
* page/SecurityOriginData.h:
(WebCore::SecurityOriginData::SecurityOriginData):
(WebCore::SecurityOriginData::isEmpty):
(WebCore::SecurityOriginData::isHashTableDeletedValue):
(WebCore::SecurityOriginDataHashTraits::isEmptyValue):
(WebCore::SecurityOriginDataHash::hash):
(WebCore::SecurityOriginDataHash::equal):
Add some hash functions so a SecurityOriginData can be used as a key in a HashMap.
2016-11-11 Ryosuke Niwa <rniwa@webkit.org>
Hovering over a slotted Text node clears hover state
https://bugs.webkit.org/show_bug.cgi?id=164002
<rdar://problem/29040471>
Reviewed by Simon Fraser.
The bug was caused by HitTestResult::innerElement returning the parent element of a Text node without
taking the shadow root or slots into account. For hit testing, we always want to use the "flat tree"
or "composed tree" (imprecisely but close enough in this case).
Fixed the bug by making HitTestResult::innerElement use parentNodeInComposedTree. Also renamed it to
HitTestResult::targetElement to be consistent with HitTestResult::targetNode.
Tests: fast/shadow-dom/activate-over-slotted-content.html
fast/shadow-dom/hover-over-slotted-content.html
* dom/Document.cpp:
(WebCore::Document::prepareMouseEvent):
* html/MediaElementSession.cpp:
(WebCore::isMainContentForPurposesOfAutoplay):
* page/EventHandler.cpp:
(WebCore::EventHandler::eventMayStartDrag):
(WebCore::EventHandler::hitTestResultAtPoint):
(WebCore::EventHandler::handleWheelEvent):
(WebCore::EventHandler::sendContextMenuEventForKey):
(WebCore::EventHandler::hoverTimerFired):
(WebCore::EventHandler::handleDrag):
(WebCore::EventHandler::handleTouchEvent):
* rendering/HitTestResult.cpp:
(WebCore::HitTestResult::targetElement): Renamed from innerElement.
Now finds the parent element in the composed tree.
* rendering/HitTestResult.h:
(WebCore::HitTestResult::innerNode):
2016-11-11 Brent Fulgham <bfulgham@apple.com>
Unreviewed build fix after r208628
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneDeserializer::readTerminal): Cast pointer arithmetic to
uint32_t to avoid warning.
2016-11-11 Brent Fulgham <bfulgham@apple.com>
Neutered ArrayBuffers are not properly serialized
https://bugs.webkit.org/show_bug.cgi?id=164647
<rdar://problem/29213490>
Reviewed by David Kilzer.
Correct binding logic to handle ImageBuffers being deserialized from neutered ArrayBuffers.
Test: fast/canvas/neutered-imagedata.html
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneDeserializer::readTerminal):
2016-11-11 Wenson Hsieh <wenson_hsieh@apple.com>
[WK2] autocorrect and autocapitalize attributes do not work in contenteditable elements
https://bugs.webkit.org/show_bug.cgi?id=164538
<rdar://problem/8418711>
Reviewed by Ryosuke Niwa.
Adds autocorrect and autocapitalize getters and setters to HTMLElements. These check the `autocorrect` and
`autocapitalize` attributes and return whether or not the element supports autocorrect, and the
autocapitalization type, respectively. By default, autocorrection is enabled and autocapitalization is enabled
on the sentence level for elements. Also refactors/renames WebAutocapitalizeType so that in WebCore, we deal
solely with AutocapitalizeTypes and WebKit1 converts from AutocapitalizeType to WebAutocapitalizeType as needed
for UIKit.
Tests: fast/events/ios/contenteditable-autocapitalize.html
fast/events/ios/contenteditable-autocorrect.html
* WebCore.xcodeproj/project.pbxproj:
* html/Autocapitalize.cpp:
(WebCore::autocapitalizeTypeForAttributeValue):
(WebCore::stringForAutocapitalizeType):
* html/Autocapitalize.h:
* html/AutocapitalizeTypes.h: Renamed from Source/WebCore/html/WebAutocapitalize.h.
Move WebAutocapitalizeType into AutocapitalizeTypes.h as simply AutocapitalizeType.
* html/HTMLElement.cpp:
(WebCore::HTMLElement::autocapitalize):
(WebCore::HTMLElement::autocapitalizeType):
(WebCore::HTMLElement::setAutocapitalize):
(WebCore::HTMLElement::shouldAutocorrect):
(WebCore::HTMLElement::setAutocorrect):
* html/HTMLElement.h:
(WebCore::HTMLElement::autocorrect):
* html/HTMLElement.idl:
* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::shouldAutocorrect):
(WebCore::HTMLFormControlElement::autocapitalizeType):
(WebCore::HTMLFormControlElement::autocorrect): Deleted.
(WebCore::HTMLFormControlElement::setAutocorrect): Deleted.
(WebCore::HTMLFormControlElement::autocapitalize): Deleted.
(WebCore::HTMLFormControlElement::setAutocapitalize): Deleted.
Fold autocorrect/autocapitalize member functions into HTMLElement and remove element-specific code in
HTML(FormControl|Form)Element.cpp.
* html/HTMLFormControlElement.h:
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::shouldAutocorrect):
(WebCore::HTMLFormElement::autocorrect): Deleted.
(WebCore::HTMLFormElement::setAutocorrect): Deleted.
(WebCore::HTMLFormElement::autocapitalizeType): Deleted.
(WebCore::HTMLFormElement::autocapitalize): Deleted.
(WebCore::HTMLFormElement::setAutocapitalize): Deleted.
* html/HTMLFormElement.h:
* html/HTMLFormElement.idl:
* html/HTMLInputElement.idl:
* html/HTMLTextAreaElement.idl:
2016-11-11 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Add support for paths as basic shapes.
https://bugs.webkit.org/show_bug.cgi?id=164661
Reviewed by Dean Jackson.
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeBasicShapePath):
(WebCore::consumeBasicShape):
2016-11-11 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Support margin-box in shape parsing.
https://bugs.webkit.org/show_bug.cgi?id=164658
Reviewed by Sam Weinig.
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeBasicShapeOrBox):
2016-11-11 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Add support for -webkit-mask-source-type
https://bugs.webkit.org/show_bug.cgi?id=164657
Reviewed by Dean Jackson.
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeWebkitMaskSourceType):
(WebCore::consumeBackgroundComponent):
(WebCore::CSSPropertyParser::parseSingleValue):
2016-11-11 Antti Koivisto <antti@apple.com>
Updating class name doesn't update the slotted content's style
https://bugs.webkit.org/show_bug.cgi?id=164577
<rdar://problem/29205873>
Reviewed by Ryosuke Niwa.
Test: fast/shadow-dom/css-scoping-slotted-invalidation.html
Teach style invalidation code for attribute/class/id mutations about slotted rules.
* dom/ShadowRoot.cpp:
(WebCore::assignedShadowRootsIfSlotted):
Helper to find all assigned shadow roots (there may be more than one if slots are assigned to slots).
* dom/ShadowRoot.h:
* style/AttributeChangeInvalidation.cpp:
(WebCore::Style::mayBeAffectedByAttributeChange):
(WebCore::Style::mayBeAffectedByHostRules):
(WebCore::Style::mayBeAffectedBySlottedRules):
(WebCore::Style::AttributeChangeInvalidation::invalidateStyle):
(WebCore::Style::mayBeAffectedByHostStyle): Deleted.
* style/ClassChangeInvalidation.cpp:
(WebCore::Style::mayBeAffectedByHostRules):
(WebCore::Style::mayBeAffectedBySlottedRules):
(WebCore::Style::ClassChangeInvalidation::invalidateStyle):
(WebCore::Style::mayBeAffectedByHostStyle): Deleted.
* style/ClassChangeInvalidation.h:
* style/IdChangeInvalidation.cpp:
(WebCore::Style::mayBeAffectedByHostRules):
(WebCore::Style::mayBeAffectedBySlottedRules):
(WebCore::Style::IdChangeInvalidation::invalidateStyle):
(WebCore::Style::mayBeAffectedByHostStyle): Deleted.
* style/StyleSharingResolver.cpp:
(WebCore::Style::SharingResolver::canShareStyleWithElement):
Fix a bug in style sharing where we were checking wrong element for host rules.
Tested by the included test too (the last empty div).
2016-11-11 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Support the spring animation timing function
https://bugs.webkit.org/show_bug.cgi?id=164654
Reviewed by Dean Jackson.
* css/CSSValueKeywords.in:
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeSpringFunction):
(WebCore::consumeAnimationTimingFunction):
(WebCore::consumeAnimationValue):
2016-11-11 Chris Dumez <cdumez@apple.com>
WorkerGlobalScope's indexedDB property should be on the prototype, not the instance
https://bugs.webkit.org/show_bug.cgi?id=164644
Reviewed by Brady Eidson.
WorkerGlobalScope's indexedDB property should be on the prototype, not the instance
as per:
- https://heycam.github.io/webidl/#es-attributes
This is because WorkerGlobalScope is not marked as [Global] or [PrimaryGlobal] in
the IDL:
- https://html.spec.whatwg.org/multipage/workers.html#the-workerglobalscope-common-interface
DedicatedWorkerGlobalScope is the one that is marked as [Global] and that should
have its attributes on the instance:
- https://html.spec.whatwg.org/multipage/workers.html#dedicated-workers-and-the-dedicatedworkerglobalscope-interface
We were getting this mostly right, except for runtime-enabled attributes / operations
which would end up on the instance instead of the prototype. This patch adds support
for [PrimaryGlobal] / [Global] IDL extended attributes which determine the location
of properties. It also improves support for runtime-enabled properties so that they
can now be on either the instance or the prototype, exactly as if they were not
runtimed-enabled.
This gives us 100% pass rate on:
- http://w3c-test.org/IndexedDB/interfaces.worker.html
No new tests, updated existing test.
* bindings/scripts/CodeGeneratorJS.pm:
(IsGlobalOrPrimaryGlobalInterface):
(InterfaceRequiresAttributesOnInstance):
(AttributeShouldBeOnInstance):
(OperationShouldBeOnInstance):
(GenerateHeader):
(GeneratePropertiesHashTable):
(GenerateImplementation):
* bindings/scripts/IDLAttributes.txt:
* bindings/scripts/test/JS/JSInterfaceName.cpp:
(WebCore::JSInterfaceName::finishCreation):
* bindings/scripts/test/JS/JSInterfaceName.h:
* bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
(WebCore::JSTestActiveDOMObject::finishCreation):
* bindings/scripts/test/JS/JSTestActiveDOMObject.h:
* bindings/scripts/test/JS/JSTestCEReactions.cpp:
(WebCore::JSTestCEReactions::finishCreation):
* bindings/scripts/test/JS/JSTestCEReactions.h:
* bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
(WebCore::JSTestCEReactionsStringifier::finishCreation):
* bindings/scripts/test/JS/JSTestCEReactionsStringifier.h:
* bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
(WebCore::JSTestClassWithJSBuiltinConstructor::finishCreation):
* bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.h:
* bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
(WebCore::JSTestCustomConstructorWithNoInterfaceObject::finishCreation):
* bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h:
* bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
(WebCore::JSTestCustomNamedGetter::finishCreation):
* bindings/scripts/test/JS/JSTestCustomNamedGetter.h:
* bindings/scripts/test/JS/JSTestDOMJIT.cpp:
(WebCore::JSTestDOMJIT::finishCreation):
* bindings/scripts/test/JS/JSTestDOMJIT.h:
* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
(WebCore::JSTestEventConstructor::finishCreation):
* bindings/scripts/test/JS/JSTestEventConstructor.h:
* bindings/scripts/test/JS/JSTestEventTarget.cpp:
(WebCore::JSTestEventTarget::finishCreation):
* bindings/scripts/test/JS/JSTestEventTarget.h:
* bindings/scripts/test/JS/JSTestException.cpp:
(WebCore::JSTestException::finishCreation):
* bindings/scripts/test/JS/JSTestException.h:
* bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
(WebCore::JSTestGenerateIsReachable::finishCreation):
* bindings/scripts/test/JS/JSTestGenerateIsReachable.h:
* bindings/scripts/test/JS/JSTestGlobalObject.cpp:
(WebCore::JSTestGlobalObject::finishCreation):
* bindings/scripts/test/JS/JSTestGlobalObject.h:
* bindings/scripts/test/JS/JSTestInterface.cpp:
(WebCore::JSTestInterface::finishCreation):
* bindings/scripts/test/JS/JSTestInterface.h:
* bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
(WebCore::JSTestInterfaceLeadingUnderscore::finishCreation):
* bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.h:
* bindings/scripts/test/JS/JSTestIterable.cpp:
(WebCore::JSTestIterable::finishCreation):
* bindings/scripts/test/JS/JSTestIterable.h:
* bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
(WebCore::JSTestJSBuiltinConstructor::finishCreation):
* bindings/scripts/test/JS/JSTestJSBuiltinConstructor.h:
* bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
(WebCore::JSTestMediaQueryListListener::finishCreation):
* bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
* bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
(WebCore::JSTestNamedConstructor::finishCreation):
* bindings/scripts/test/JS/JSTestNamedConstructor.h:
* bindings/scripts/test/JS/JSTestNode.cpp:
(WebCore::JSTestNode::finishCreation):
* bindings/scripts/test/JS/JSTestNode.h:
* bindings/scripts/test/JS/JSTestNondeterministic.cpp:
(WebCore::JSTestNondeterministic::finishCreation):
* bindings/scripts/test/JS/JSTestNondeterministic.h:
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::JSTestObj::finishCreation):
* bindings/scripts/test/JS/JSTestObj.h:
* bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
(WebCore::JSTestOverloadedConstructors::finishCreation):
* bindings/scripts/test/JS/JSTestOverloadedConstructors.h:
* bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
(WebCore::JSTestOverloadedConstructorsWithSequence::finishCreation):
* bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.h:
* bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
(WebCore::JSTestOverrideBuiltins::finishCreation):
* bindings/scripts/test/JS/JSTestOverrideBuiltins.h:
* bindings/scripts/test/JS/JSTestSerialization.cpp:
(WebCore::JSTestSerialization::finishCreation):
* bindings/scripts/test/JS/JSTestSerialization.h:
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
(WebCore::JSTestSerializedScriptValueInterface::finishCreation):
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
(WebCore::JSTestTypedefs::finishCreation):
* bindings/scripts/test/JS/JSTestTypedefs.h:
* bindings/scripts/test/TestGlobalObject.idl:
* page/DOMWindow.idl:
* workers/DedicatedWorkerGlobalScope.idl:
2016-11-11 Antti Koivisto <antti@apple.com>
Shadow DOM: Toggling class in `.class ::slotted(*)` does not trigger style recalc
https://bugs.webkit.org/show_bug.cgi?id=160864
Reviewed by Ryosuke Niwa.
Also fix similar issue with ::host
Test: fast/shadow-dom/css-scoping-host-and-slotted-context-invalidation.html
* css/StyleInvalidationAnalysis.cpp:
(WebCore::StyleInvalidationAnalysis::invalidateIfNeeded):
If we have ::slotted rules and encounter a <slot>, invalidate the slotted host children.
(WebCore::StyleInvalidationAnalysis::invalidateStyle):
Invalidate the shadow host if we have ::host rules.
* css/StyleInvalidationAnalysis.h:
* dom/InlineStyleSheetOwner.cpp:
(WebCore::InlineStyleSheetOwner::createSheet):
Fix a bug where it was possible to mutate stylesheets in the inline stylesheet cache.
The included test covers this.
* style/StyleScope.cpp:
(WebCore::Style::Scope::updateActiveStyleSheets):
Handle the full invalidation case.
2016-11-11 Brady Eidson <beidson@apple.com>
IndexedDB 2.0: "close pending flag" and firing blocked events all need fixing.
https://bugs.webkit.org/show_bug.cgi?id=164641
Reviewed by Alex Christensen.
No new tests (Covered by at least 3 existing tests).
* Modules/indexeddb/IDBDatabase.cpp:
(WebCore::IDBDatabase::close):
(WebCore::IDBDatabase::maybeCloseInServer):
* Modules/indexeddb/client/IDBConnectionProxy.cpp:
(WebCore::IDBClient::IDBConnectionProxy::databaseConnectionPendingClose):
* Modules/indexeddb/client/IDBConnectionProxy.h:
* Modules/indexeddb/client/IDBConnectionToServer.cpp:
(WebCore::IDBClient::IDBConnectionToServer::databaseConnectionPendingClose):
* Modules/indexeddb/client/IDBConnectionToServer.h:
* Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
* Modules/indexeddb/server/IDBServer.cpp:
(WebCore::IDBServer::IDBServer::databaseConnectionPendingClose):
* Modules/indexeddb/server/IDBServer.h:
* Modules/indexeddb/server/ServerOpenDBRequest.cpp:
(WebCore::IDBServer::ServerOpenDBRequest::maybeNotifyRequestBlocked):
(WebCore::IDBServer::ServerOpenDBRequest::notifyRequestBlocked): Deleted.
* Modules/indexeddb/server/ServerOpenDBRequest.h:
(WebCore::IDBServer::ServerOpenDBRequest::hasNotifiedBlocked): Deleted.
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::allConnectionsAreClosedOrClosing):
(WebCore::IDBServer::UniqueIDBDatabase::maybeNotifyConnectionsOfVersionChange):
(WebCore::IDBServer::UniqueIDBDatabase::notifyCurrentRequestConnectionClosedOrFiredVersionChangeEvent):
* Modules/indexeddb/server/UniqueIDBDatabase.h:
* Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
(WebCore::IDBServer::UniqueIDBDatabaseConnection::connectionPendingCloseFromClient):
(WebCore::IDBServer::UniqueIDBDatabaseConnection::connectionClosedFromClient):
(WebCore::IDBServer::UniqueIDBDatabaseConnection::connectionIsClosing):
* Modules/indexeddb/server/UniqueIDBDatabaseConnection.h:
* Modules/indexeddb/shared/InProcessIDBServer.cpp:
(WebCore::InProcessIDBServer::databaseConnectionPendingClose):
* Modules/indexeddb/shared/InProcessIDBServer.h:
2016-11-11 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Fix time unit parsing
https://bugs.webkit.org/show_bug.cgi?id=164649
Reviewed by Dean Jackson.
Make sure that a unitless value gets changed to milliseconds properly.
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::consumeTime):
2016-11-11 Keith Rollin <krollin@apple.com>
Reduce number of platformMemoryUsage calls
https://bugs.webkit.org/show_bug.cgi?id=164375
Reviewed by Andreas Kling.
platformMemoryUsage was being called all the time while logging the
results of various memory-purging operations. This logging is
subordinate to the needs of performance and so can be removed.
Behavior is now as follows:
- If memory-pressure relief logging is enabled, logging includes
memory usage information. On Cocoa, this logging is disabled by
default but can be enabled by setting LogMemoryJetsamDetails in
`defaults`.
- Otherwise, if release-logging is enabled (as it is on Cocoa),
abbreviated memory pressure relief logging is performed: the logging
lines are printed but without any memory usage information.
- Otherwise, no logging is performed.
No new tests -- no tests for logging.
* platform/MemoryPressureHandler.cpp:
(WebCore::MemoryPressureHandler::ReliefLogger::logMemoryUsageChange):
* platform/MemoryPressureHandler.h:
(WebCore::MemoryPressureHandler::ReliefLogger::ReliefLogger):
(WebCore::MemoryPressureHandler::ReliefLogger::~ReliefLogger):
2016-11-11 Eric Carlson <eric.carlson@apple.com>
[MediaStream] defer resolution of getUserMedia promise made in a background tab
https://bugs.webkit.org/show_bug.cgi?id=164643
<rdar://problem/29048317>
Reviewed by Brady Eidson.
Test: fast/mediastream/get-user-media-background-tab.html
Do not start producing data when the document does not allow media
to start playing. Instead, register with the document for a callback
when playback is allowed and start then.
* Modules/mediastream/MediaStream.cpp:
(WebCore::MediaStream::~MediaStream):
(WebCore::MediaStream::mediaCanStart):
(WebCore::MediaStream::startProducingData):
(WebCore::MediaStream::stopProducingData):
(WebCore::MediaStream::pageMutedStateDidChange):
* Modules/mediastream/MediaStream.h:
* Modules/webaudio/AudioContext.cpp:
(WebCore::AudioContext::mediaCanStart): Deal with API change.
* Modules/webaudio/AudioContext.h:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaCanStart): Ditto.
* html/HTMLMediaElement.h:
* page/MediaCanStartListener.h:
* page/Page.cpp:
(WebCore::Page::takeAnyMediaCanStartListener): Return the listener and document.
(WebCore::Page::setCanStartMedia): Pass the document to the listener.
* page/Page.h:
2016-11-11 Zalan Bujtas <zalan@apple.com>
RenderFlowThread's containing block cache should be invalidated before calling styleDidChange.
https://bugs.webkit.org/show_bug.cgi?id=164646
Reviewed by Simon Fraser.
We have to invalidate the containing block cache for RenderFlowThreads soon after the containing block context
changes. Invalidating it in RenderBlock::styleDidChange is too late since we might run some code in some
of the subclasses that use this stale containing block cache.
No known behaviour change.
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::styleDidChange): This change could trigger double invalidation.
However running this code twice shouldn't impact performance greatly.
(WebCore::RenderBlock::resetFlowThreadContainingBlockAndChildInfoIncludingDescendants):
(WebCore::RenderBlock::invalidateFlowThreadContainingBlockIncludingDescendants): Deleted.
* rendering/RenderBlock.h:
* rendering/RenderElement.cpp:
(WebCore::RenderElement::setStyle): We don't need to call the invalidation from initializeStyle(), since
we don't yet have cache at that point.
* rendering/RenderInline.cpp:
(WebCore::RenderInline::splitInlines):
2016-11-11 Darin Adler <darin@apple.com>
Move Node from ExceptionCode to ExceptionOr
https://bugs.webkit.org/show_bug.cgi?id=164515
Reviewed by Sam Weinig.
* bindings/js/JSHTMLSelectElementCustom.cpp:
(WebCore::selectElementIndexSetter): Call remove instead of removeByIndex.
Was renamed now that there is no conflict.
* bindings/js/JSNodeCustom.cpp:
(WebCore::JSNode::insertBefore): Use ExceptionOr.
(WebCore::JSNode::replaceChild): Ditto.
(WebCore::JSNode::removeChild): Ditto.
(WebCore::JSNode::appendChild): Ditto.
* dom/Attr.cpp:
(WebCore::Attr::Attr): Take a reference.
(WebCore::Attr::create): Ditto.
(WebCore::Attr::createTextChild): Use a Ref.
(WebCore::Attr::setPrefix): Use ExceptionOr.
(WebCore::Attr::setNodeValue): Ditto.
(WebCore::Attr::attachToElement): Take a reference.
* dom/Attr.h: Updated for above. Also made setPrefix private.
* dom/CharacterData.cpp:
(WebCore::CharacterData::setNodeValue): Use ExceptionOr.
* dom/CharacterData.h: Updated for the above.
* dom/ContainerNode.cpp:
(WebCore::collectChildrenAndRemoveFromOldParent): Use ExceptionOr.
(WebCore::checkAcceptChild): Ditto.
(WebCore::checkAcceptChildGuaranteedNodeTypes): Ditto.
(WebCore::ContainerNode::ensurePreInsertionValidity): Ditto.
(WebCore::checkPreReplacementValidity): Ditto.
(WebCore::ContainerNode::insertBefore): Ditto.
(WebCore::ContainerNode::replaceChild): Ditto.
(WebCore::ContainerNode::removeChild): Ditto.
(WebCore::ContainerNode::appendChild): Ditto.
(WebCore::ContainerNode::appendChildWithoutPreInsertionValidityCheck): Ditto.
(WebCore::ContainerNode::cloneChildNodes): Ditto.
(WebCore::ContainerNode::append): Ditto.
(WebCore::ContainerNode::prepend): Ditto.
* dom/ContainerNode.h: Updated for above changes.
* dom/Document.cpp:
(WebCore::Document::setTitle): Removed unneeded ASSERT_NO_EXCEPTION.
(WebCore::Document::setBodyOrFrameset): Removed unneeded ignored
exception code.
* dom/Element.cpp:
(WebCore::Element::setPrefix): Use ExceptionOr.
(WebCore::Element::setAttributeNode): Updated for changes to Attr.
(WebCore::Element::setAttributeNodeNS): Ditto.
(WebCore::Element::setOuterHTML): Use ExceptionOr.
(WebCore::Element::ensureAttr): Updated for changes to Attr.
(WebCore::Element::insertAdjacent): Use ExceptionOr.
* dom/Element.h: Updated for above.
* dom/Node.cpp:
(WebCore::Node::setNodeValue): Use ExceptionOr.
(WebCore::Node::insertBefore): Ditto.
(WebCore::Node::replaceChild): Ditto.
(WebCore::Node::removeChild): Ditto.
(WebCore::Node::appendChild): Ditto.
(WebCore::Node::convertNodesOrStringsIntoNode): Ditto.
(WebCore::Node::before): Ditto.
(WebCore::Node::after): Ditto.
(WebCore::Node::replaceWith): Ditto.
(WebCore::Node::remove): Ditto.
(WebCore::Node::cloneNodeForBindings): Ditto.
(WebCore::Node::setPrefix): Ditto.
(WebCore::Node::checkSetPrefix): Ditto.
(WebCore::Node::setTextContent): Ditto.
* dom/Node.h: Updated for above.
* dom/Node.idl: Use non-legacy exceptions.
* dom/Range.cpp:
(WebCore::Range::processContents): Use ExceptionOr.
(WebCore::processContentsBetweenOffsets): Ditto.
(WebCore::processNodes): Ditto.
(WebCore::processAncestorsAndTheirSiblings): Ditto.
(WebCore::Range::insertNode): Ditto.
(WebCore::Range::surroundContents): Ditto.
* dom/Text.cpp:
(WebCore::Text::splitText): Use ExceptionOr.
(WebCore::Text::replaceWholeText): Removed unneeded IGNORE_EXCEPTION.
* editing/AppendNodeCommand.cpp:
(WebCore::AppendNodeCommand::doApply): Removed unneeded IGNORE_EXCEPTION.
* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::insertNewDefaultParagraphElementAt): Ditto.
* editing/EditorCommand.cpp:
(WebCore::executeInsertNode): Use ExceptionOr.
* editing/InsertNodeBeforeCommand.cpp:
(WebCore::InsertNodeBeforeCommand::doApply): Removed unneeded IGNORE_EXCEPTION.
* editing/MergeIdenticalElementsCommand.cpp:
(WebCore::MergeIdenticalElementsCommand::doApply): Ditto.
(WebCore::MergeIdenticalElementsCommand::doUnapply): Use ExceptionOr.
* editing/RemoveNodeCommand.cpp:
(WebCore::RemoveNodeCommand::doUnapply): Removed unneeded IGNORE_EXCEPTION.
* editing/ReplaceNodeWithSpanCommand.cpp:
(WebCore::swapInNodePreservingAttributesAndChildren): Removed unneeded
ASSERT_NO_EXCEPTION.
* editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplacementFragment::removeNode): Ditto.
(WebCore::ReplacementFragment::insertNodeBefore): Ditto.
(WebCore::ReplacementFragment::insertFragmentForTestRendering): Ditto.
(WebCore::ReplacementFragment::restoreAndRemoveTestRenderingNodesToFragment): Ditto.
(WebCore::ReplaceSelectionCommand::insertAsListItems): Ditto.
* editing/SplitElementCommand.cpp:
(WebCore::SplitElementCommand::executeApply): Use ExceptionOr.
(WebCore::SplitElementCommand::doUnapply): Removed unneeded IGNORE_EXCEPTION.
* editing/SplitTextNodeCommand.cpp:
(WebCore::SplitTextNodeCommand::insertText1AndTrimText2): Use ExceptionOr.
* editing/WrapContentsInDummySpanCommand.cpp:
(WebCore::WrapContentsInDummySpanCommand::executeApply): Removed unneeded
IGNORE_EXCEPTION.
(WebCore::WrapContentsInDummySpanCommand::doUnapply): Ditto.
* editing/cocoa/EditorCocoa.mm:
(WebCore::Editor::styleForSelectionStart): Removed unneeded ASSERT_NO_EXCEPTION
and IGNORE_EXCEPTION.
* editing/htmlediting.cpp:
(WebCore::createTabSpanElement): Ditto.
* editing/markup.cpp:
(WebCore::fillContainerFromString): Ditto.
(WebCore::createFragmentFromText): Ditto.
(WebCore::removeElementFromFragmentPreservingChildren): Ditto.
(WebCore::replaceChildrenWithFragment): Use ExceptionOr.
(WebCore::replaceChildrenWithText): Ditto.
* editing/ios/EditorIOS.mm:
(WebCore::Editor::WebContentReader::addFragment): Removed unneeded exception
ignoring code.
(WebCore::Editor::setDictationPhrasesAsChildOfElement): Ditto.
(WebCore::Editor::setTextAsChildOfElement): Ditto.
* html/ColorInputType.cpp:
(WebCore::ColorInputType::createShadowSubtree): Removed unneeded
ASSERT_NO_EXCEPTION.
* html/FTPDirectoryDocument.cpp:
(WebCore::FTPDirectoryDocumentParser::appendEntry): Removed unneeded
IGNORE_EXCEPTION.
(WebCore::FTPDirectoryDocumentParser::createTDForFilename): Ditto.
(WebCore::FTPDirectoryDocumentParser::loadDocumentTemplate): Ditto.
(WebCore::FTPDirectoryDocumentParser::createBasicDocument): Ditto.
* html/FileInputType.cpp:
(WebCore::FileInputType::createShadowSubtree): Ditto.
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::setText): Removed unneeded ASSERT_NO_EXCEPTION.
* html/HTMLDetailsElement.cpp:
(WebCore::HTMLDetailsElement::didAddUserAgentShadowRoot): Ditto.
* html/HTMLElement.cpp:
(WebCore::HTMLElement::textToFragment): Use ExceptionOr.
(WebCore::HTMLElement::setOuterText): Ditto.
* html/HTMLKeygenElement.cpp:
(WebCore::HTMLKeygenElement::HTMLKeygenElement): Removed unneeded
ASSERT_NO_EXCEPTION and IGNORE_EXCEPTION.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::createMediaControls): Ditto.
* html/HTMLMeterElement.cpp:
(WebCore::HTMLMeterElement::didAddUserAgentShadowRoot): Ditto.
* html/HTMLOptionElement.cpp:
(WebCore::HTMLOptionElement::createForJSConstructor): Use ExceptionOr.
(WebCore::HTMLOptionElement::setText): Removed unneeded
ASSERT_NO_EXCEPTION and IGNORE_EXCEPTION.
* html/HTMLOptionsCollection.cpp:
(WebCore::HTMLOptionsCollection::remove): Call remove, not removeByIndex,
since we were able to change the name.
* html/HTMLOutputElement.cpp:
(WebCore::HTMLOutputElement::setTextContentInternal): Removed unneeded
ASSERT_NO_EXCEPTION and IGNORE_EXCEPTION.
* html/HTMLProgressElement.cpp:
(WebCore::HTMLProgressElement::didAddUserAgentShadowRoot): Ditto.
* html/HTMLScriptElement.cpp:
(WebCore::HTMLScriptElement::setText): Ditto.
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::add): Use ExceptionOr.
(WebCore::HTMLSelectElement::remove): Renamed from removeByIndex since
there is no conflict with remove any more.
(WebCore::HTMLSelectElement::setOption): Call remove.
* html/HTMLSelectElement.h: Updated for above.
* html/HTMLSelectElement.idl: Got rid of ImplementedAs=removeByIndex.
* html/HTMLSummaryElement.cpp:
(WebCore::HTMLSummaryElement::didAddUserAgentShadowRoot): Removed unneeded
ASSERT_NO_EXCEPTION and IGNORE_EXCEPTION.
* html/HTMLTableElement.cpp:
(WebCore::HTMLTableElement::HTMLTableElement): Initialize data members in
class definition instead of here.
(WebCore::HTMLTableElement::caption): Simplified using childrenOfType.
(WebCore::HTMLTableElement::setCaption): Use ExceptionOr.
(WebCore::HTMLTableElement::setTHead): Ditto.
(WebCore::HTMLTableElement::setTFoot): Ditto.
(WebCore::HTMLTableElement::deleteTFoot): Removed unneeded ASSERT_NO_EXCEPTION
and IGNORE_EXCEPTION.
(WebCore::HTMLTableElement::createTBody): Ditto.
(WebCore::HTMLTableElement::deleteCaption): Ditto.
(WebCore::HTMLTableElement::insertRow): Use ExceptionOr.
* html/HTMLTableElement.h: Updated for above.
* html/HTMLTableRowElement.cpp:
(WebCore::HTMLTableRowElement::insertCell): Use ExceptionOr.
(WebCore::HTMLTableRowElement::deleteCell): Ditto.
* html/HTMLTableSectionElement.cpp:
(WebCore::HTMLTableSectionElement::insertRow): Ditto.
(WebCore::HTMLTableSectionElement::deleteRow): Ditto.
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::didAddUserAgentShadowRoot): Removed unneeded
ASSERT_NO_EXCEPTION and IGNORE_EXCEPTION.
(WebCore::HTMLTextAreaElement::setDefaultValue): Ditto.
(WebCore::HTMLTextAreaElement::updatePlaceholderText): Ditto.
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::setInnerTextValue): Ditto.
* html/HTMLTitleElement.cpp:
(WebCore::HTMLTitleElement::setText): Ditto.
* html/MediaDocument.cpp:
(WebCore::MediaDocumentParser::createDocumentStructure): Ditto.
(WebCore::MediaDocument::replaceMediaElementTimerFired): Ditto.
* html/PluginDocument.cpp:
(WebCore::PluginDocumentParser::createDocumentStructure): Ditto.
* html/RangeInputType.cpp:
(WebCore::RangeInputType::createShadowSubtree): Ditto.
* html/SearchInputType.cpp:
(WebCore::SearchInputType::createShadowSubtree): Ditto.
* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::createShadowSubtree): Ditto.
(WebCore::TextFieldInputType::updatePlaceholderText): Ditto.
(WebCore::TextFieldInputType::createContainer): Ditto.
(WebCore::TextFieldInputType::createAutoFillButton): Ditto.
* html/ValidationMessage.cpp:
(WebCore::ValidationMessage::setMessageDOMAndStartTimer): Ditto.
(WebCore::ValidationMessage::buildBubbleTree): Ditto.
(WebCore::ValidationMessage::deleteBubbleTree): Ditto.
* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlTextTrackContainerElement::updateDisplay): Ditto.
* html/shadow/MediaControls.cpp:
(WebCore::MediaControls::createTextTrackDisplay): Ditto.
* html/shadow/MediaControlsApple.cpp:
(WebCore::MediaControlsApple::MediaControlsApple): Initialize data members
in class definition instead of here.
(WebCore::MediaControlsApple::tryCreateControls): Use ExceptionOr.
* html/shadow/MediaControlsApple.h: Updated for above.
* html/track/VTTCue.cpp:
(WebCore::VTTCue::copyWebVTTNodeToDOMTree): Removed unneeded ASSERT_NO_EXCEPTION
and IGNORE_EXCEPTION.
(WebCore::VTTCue::getDisplayTree): Ditto.
* html/track/VTTRegion.cpp:
(WebCore::VTTRegion::appendTextTrackCueBox): Ditto.
* inspector/DOMEditor.cpp: Use ExceptionOr in action classes.
(WebCore::DOMEditor::DOMEditor): Take a reference.
(WebCore::DOMEditor::insertBefore): Use ExceptionOr.
(WebCore::DOMEditor::removeChild): Ditto.
(WebCore::DOMEditor::setAttribute): Ditto.
(WebCore::DOMEditor::removeAttribute): Ditto.
(WebCore::DOMEditor::setOuterHTML): Ditto.
(WebCore::DOMEditor::replaceWholeText): Ditto.
(WebCore::DOMEditor::replaceChild): Ditto.
(WebCore::DOMEditor::setNodeValue): Ditto.
(WebCore::populateErrorString): Ditto.
* inspector/DOMEditor.h: Updated for above changes.
* inspector/DOMPatchSupport.cpp:
(WebCore::DOMPatchSupport::patchDocument): Updated to use references,
to use ExceptionOr, and to use a struct without a constructor for Digest.
(WebCore::DOMPatchSupport::DOMPatchSupport): Ditto.
(WebCore::DOMPatchSupport::patchNode): Ditto.
(WebCore::DOMPatchSupport::innerPatchNode): Ditto.
(WebCore::DOMPatchSupport::diff): Ditto.
(WebCore::DOMPatchSupport::innerPatchChildren): Ditto.
(WebCore::DOMPatchSupport::createDigest): Ditto.
(WebCore::DOMPatchSupport::insertBeforeAndMarkAsUsed): Ditto.
(WebCore::DOMPatchSupport::removeChildAndMoveToNew): Ditto.
(WebCore::DOMPatchSupport::markNodeAsUsed): Ditto.
* inspector/DOMPatchSupport.h: Updated for above.
* inspector/InspectorCSSAgent.cpp: Use ExceptionOr in the action classes.
(WebCore::InspectorCSSAgent::getStyleSheetText): Use ExceptionOr.
(WebCore::InspectorCSSAgent::setStyleSheetText): Ditto.
(WebCore::InspectorCSSAgent::setStyleText): Ditto.
(WebCore::InspectorCSSAgent::setRuleSelector): Ditto.
(WebCore::InspectorCSSAgent::createInspectorStyleSheetForDocument): Ditto.
(WebCore::InspectorCSSAgent::addRule): Ditto.
* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::didCreateFrontendAndBackend): Ditto.
(WebCore::InspectorDOMAgent::setAttributeValue): Ditto.
(WebCore::InspectorDOMAgent::setAttributesAsText): Ditto.
(WebCore::InspectorDOMAgent::removeAttribute): Ditto.
(WebCore::InspectorDOMAgent::setOuterHTML): Ditto.
(WebCore::InspectorDOMAgent::setNodeValue): Ditto.
(WebCore::InspectorDOMAgent::undo): Ditto.
(WebCore::InspectorDOMAgent::redo): Ditto.
* inspector/InspectorHistory.cpp:
(WebCore::InspectorHistory::Action::Action): Moved to header.
(WebCore::InspectorHistory::Action::~Action): Ditto.
(WebCore::InspectorHistory::Action::toString): Ditto.
(WebCore::InspectorHistory::Action::isUndoableStateMark): Ditto.
(WebCore::InspectorHistory::Action::mergeId): Ditto.
(WebCore::InspectorHistory::Action::merge): Ditto.
(WebCore::InspectorHistory::InspectorHistory): Deleted.
(WebCore::InspectorHistory::~InspectorHistory): Deleted.
(WebCore::InspectorHistory::perform): Updated exception handling.
(WebCore::InspectorHistory::markUndoableState): Ditto.
(WebCore::InspectorHistory::undo): Ditto.
(WebCore::InspectorHistory::redo): Ditto.
* inspector/InspectorHistory.h: Updated for above.
* inspector/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::setDocumentContent): Use reference.
* inspector/InspectorStyleSheet.cpp:
(WebCore::InspectorStyle::text): Use ExceptionOr and renamed from
getText since this now has a return value.
(WebCore::InspectorStyle::populateAllProperties): Updated for above.
(WebCore::InspectorStyle::setText): Use ExceptionOr.
(WebCore::InspectorStyleSheet::setText): Ditto.
(WebCore::InspectorStyleSheet::ruleSelector): Ditto.
(WebCore::InspectorStyleSheet::setRuleSelector): Ditto.
(WebCore::InspectorStyleSheet::addRule): Ditto.
(WebCore::InspectorStyleSheet::deleteRule): Ditto.
(WebCore::InspectorStyleSheet::buildObjectForStyleSheet): Ditto.
(WebCore::InspectorStyleSheet::buildObjectForStyle): Ditto.
(WebCore::InspectorStyleSheet::setStyleText): Ditto.
(WebCore::InspectorStyleSheet::text): Use ExceptionOr and renamed.
(WebCore::InspectorStyleSheet::checkPageStyleSheet): Deleted.
Just wrote this code inline in each place this was called since it's
just a single null check.
(WebCore::InspectorStyleSheetForInlineStyle::text): Use ExceptionOr
and renamed.
(WebCore::InspectorStyleSheetForInlineStyle::setStyleText): Ditto.
(WebCore::InspectorStyle::getText): Deleted.
* inspector/InspectorStyleSheet.h: Updated for above changes.
* page/DragController.cpp:
(WebCore::documentFragmentFromDragData): Removed unneeded
ASSERT_NO_EXCEPTION and IGNORE_EXCEPTION.
* page/ios/FrameIOS.mm:
(WebCore::Frame::initWithSimpleHTMLDocument): Ditto.
* svg/SVGTRefElement.cpp:
(WebCore::SVGTRefElement::updateReferencedText): Ditto.
(WebCore::SVGTRefElement::detachTarget): Ditto.
* xml/XMLTreeViewer.cpp:
(WebCore::XMLTreeViewer::transformDocumentToTreeView): Ditto.
2016-11-10 Jiewen Tan <jiewen_tan@apple.com>
Rename CryptoKeyUsage to CryptoKeyUsageBitmap and CryptoKey::Usage to CryptoKeyUsage
https://bugs.webkit.org/show_bug.cgi?id=164624
<rdar://problem/29210140>
Reviewed by Brent Fulgham.
This patch allows IDLType CryptoKeyUsage to be shared among different IDLs, i.e. CryptoKey.idl,
SubtleCrypto.idl and JsonWebKey.idl such that it can simplify the customized binding codes.
Covered by existing tests.
* CMakeLists.txt:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSCryptoKeySerializationJWK.cpp:
* bindings/js/JSCryptoKeySerializationJWK.h:
* bindings/js/JSSubtleCryptoCustom.cpp:
(WebCore::toCryptoKeyUsageBitmap):
(WebCore::cryptoKeyUsageBitmapFromJSValue):
(WebCore::toKeyData):
(WebCore::jsSubtleCryptoFunctionGenerateKeyPromise):
(WebCore::jsSubtleCryptoFunctionImportKeyPromise):
(WebCore::cryptoKeyUsageFromString): Deleted.
(WebCore::cryptoKeyUsagesFromJSValue): Deleted.
* bindings/js/JSWebKitSubtleCryptoCustom.cpp:
* bindings/js/SerializedScriptValue.cpp:
* crypto/CryptoAlgorithm.cpp:
* crypto/CryptoAlgorithm.h:
* crypto/CryptoKey.cpp:
* crypto/CryptoKey.h:
* crypto/CryptoKey.idl:
* crypto/CryptoKeySerialization.h:
* crypto/CryptoKeyUsage.h:
* crypto/CryptoKeyUsage.idl: Added.
* crypto/gnutls/CryptoKeyRSAGnuTLS.cpp:
* crypto/JsonWebKey.h:
* crypto/JsonWebKey.idl:
* crypto/SubtleCrypto.idl:
* crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
* crypto/algorithms/CryptoAlgorithmAES_CBC.h:
* crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
* crypto/algorithms/CryptoAlgorithmAES_KW.h:
* crypto/algorithms/CryptoAlgorithmHMAC.cpp:
* crypto/algorithms/CryptoAlgorithmHMAC.h:
* crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
* crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h:
* crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
* crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h:
* crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
* crypto/algorithms/CryptoAlgorithmRSA_OAEP.h:
* crypto/keys/CryptoKeyAES.cpp:
* crypto/keys/CryptoKeyAES.h:
* crypto/keys/CryptoKeyHMAC.cpp:
* crypto/keys/CryptoKeyHMAC.h:
* crypto/keys/CryptoKeyRSA.cpp:
* crypto/keys/CryptoKeyRSA.h:
* crypto/keys/CryptoKeySerializationRaw.cpp:
* crypto/keys/CryptoKeySerializationRaw.h:
* crypto/mac/CryptoKeyRSAMac.cpp:
2016-11-11 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Fix basic shape parsing
https://bugs.webkit.org/show_bug.cgi?id=164645
Reviewed by Dean Jackson.
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeBasicShape):
2016-11-11 Zalan Bujtas <zalan@apple.com>
RenderFlowThread::removeLineRegionInfo shouldn't call HashMap::contains before HashMap::remove
https://bugs.webkit.org/show_bug.cgi?id=164639
Reviewed by Simon Fraser.
Also instead of asserting that the incoming renderer is not nullptr, we could just pass a reference in.
No change in functionality.
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::invalidateFlowThreadContainingBlockIncludingDescendants):
(WebCore::canComputeRegionRangeForBox):
(WebCore::RenderBlock::computeRegionRangeForBoxChild):
(WebCore::RenderBlock::estimateRegionRangeForBoxChild):
(WebCore::RenderBlock::updateRegionRangeForBoxChild):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::hasRegionRangeInFlowThread):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::removeFromRenderFlowThreadIncludingDescendants):
* rendering/RenderFlowThread.cpp:
(WebCore::RenderFlowThread::removeFlowChildInfo):
(WebCore::RenderFlowThread::validateRegions):
(WebCore::RenderFlowThread::removeRenderBoxRegionInfo):
(WebCore::RenderFlowThread::removeLineRegionInfo):
(WebCore::RenderFlowThread::clearRenderBoxRegionInfoAndCustomStyle):
(WebCore::RenderFlowThread::setRegionRangeForBox):
(WebCore::RenderFlowThread::hasCachedRegionRangeForBox):
(WebCore::RenderFlowThread::computedRegionRangeForBox):
(WebCore::RenderFlowThread::checkLinesConsistency):
* rendering/RenderFlowThread.h:
* rendering/RenderMultiColumnFlowThread.cpp:
(WebCore::RenderMultiColumnFlowThread::setRegionRangeForBox):
* rendering/RenderMultiColumnFlowThread.h:
* rendering/RenderNamedFlowFragment.cpp:
(WebCore::RenderNamedFlowFragment::clearObjectStyleInRegion):
* rendering/RenderNamedFlowFragment.h:
* rendering/RenderNamedFlowThread.cpp:
(WebCore::RenderNamedFlowThread::clearRenderObjectCustomStyle):
(WebCore::RenderNamedFlowThread::removeFlowChildInfo):
* rendering/RenderNamedFlowThread.h:
* rendering/RenderRegion.cpp:
(WebCore::RenderRegion::removeRenderBoxRegionInfo):
* rendering/RenderRegion.h:
2016-11-11 Megan Gardner <megan_gardner@apple.com>
[Cocoa] Support wide gamut for Drag Image UI
https://bugs.webkit.org/show_bug.cgi?id=164490
Reviewed by Tim Horton.
Fixed an error in the support define for wide gamut on Mac.
The testing infrastructure to test this does not exist, and will be landing in another patch.
* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::extendedSRGBColorSpaceRef):
2016-11-11 Beth Dakin <bdakin@apple.com>
Get touch bar code building for open source builds
https://bugs.webkit.org/show_bug.cgi?id=164610
Reviewed by Wenson Hsieh.
* config.h:
2016-11-11 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Fix SVG markers and colors
https://bugs.webkit.org/show_bug.cgi?id=164640
Reviewed by Dean Jackson.
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertSVGColor):
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseShorthand):
2016-11-10 Wenson Hsieh <wenson_hsieh@apple.com>
Composition state should be cleared when changing focus to a non-editable element
https://bugs.webkit.org/show_bug.cgi?id=164595
<rdar://problem/26412551>
Reviewed by Enrica Casucci.
When canceling or confirming a composition, always ensure that the composition node and composition underlines
being tracked are reset, even when there is no current selection. This prevents us from getting into a bad state
where focus has already changed from an element with a pending composition to a different element and the
composition is canceled, but the Editor still maintains its composition node.
Test: editing/input/focus-change-with-marked-text.html
* editing/Editor.cpp:
(WebCore::Editor::setComposition):
2016-11-11 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Support -webkit-svg-shadow
https://bugs.webkit.org/show_bug.cgi?id=164637
Reviewed by Zalan Bujtas.
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseSingleValue):
2016-11-11 Alejandro G. Castro <alex@igalia.com>
[WebRTC][OpenWebRTC] Implement device permissions handling solution for owr backend in the UI process
https://bugs.webkit.org/show_bug.cgi?id=164010
Reviewed by Philippe Normand.
Move the capture of the sources for the OWR backend to the
WebProcess. In the UI we continue checking if the user allows
access to the audio and video capture. When device handling is
added in the future we will need some persistent ID and API to
pass from the UI process to the Web process.
* platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp:
(WebCore::RealtimeMediaSourceCenterOwr::validateRequestConstraints):
Add the proper audio and video sources to allow the UI message to
be properly rendered. We are adding the specific devices, even
though the dialog just asks for general audio and video. There was
already a FIXME about improving this.
(WebCore::RealtimeMediaSourceCenterOwr::createMediaStream): We are
capturing the devices here when the allowed message arrived from
the UI process. We store the completion handler to use it later
when the aync owr API finishes capture devices process.
(WebCore::RealtimeMediaSourceCenterOwr::mediaSourcesAvailable): We
now call the completion handler in this callback called when the
owr library finishes the capture of the devices. Now this happens
in the WebProcess for OWR port.
* platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.h:
Add an attribute to store the completion handler.
2016-11-11 Manuel Rego Casasnovas <rego@igalia.com>
[css-grid] ASSERTION FAILED: !m_gridIsDirty in WebCore::RenderGrid::gridRowCount
https://bugs.webkit.org/show_bug.cgi?id=163450
Reviewed by Darin Adler.
The issue is that in the test case a simplifiedLayout() is performed.
So in RenderGrid::layoutBlock() we early return and the grid is not populated,
so the m_gridIsDirty flag is not cleared when we try to check the size of the grid
in RenderGrid::layoutPositionedObject().
We should avoid to do a simplified layout if we have to layout
some positioned grid items and the grid is dirty.
The problem was not only the ASSERT, but the current behavior was wrong too.
As we didn't do a proper layout of the grid container, the positioned item
won't be placed on the expected position. Added tests verifying this.
Tests: fast/css-grid-layout/grid-positioned-item-dynamic-change.html
fast/css-grid-layout/grid-simplified-layout-positioned.html
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::canPerformSimplifiedLayout): Check if we can perform or not
a simplified layout.
(WebCore::RenderBlock::simplifiedLayout): Extract initial check
into canPerformSimplifiedLayout().
* rendering/RenderBlock.h: Add new header for canPerformSimplifiedLayout().
* rendering/RenderGrid.cpp: Implement our own version of canPerformSimplifiedLayout()
to verify that the grid is not dirty if we have to layout some positioned items.
(WebCore::RenderGrid::canPerformSimplifiedLayout):
* rendering/RenderGrid.h: Add canPerformSimplifiedLayout() header.
2016-11-11 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Media Controller: media tracks control support
https://bugs.webkit.org/show_bug.cgi?id=164618
<rdar://problem/27989483>
Reviewed by Dean Jackson.
We introduce the TracksSupport class to only enable the media tracks button
in the media controls when text tracks and/or multiple audio tracks are available.
Tests: media/modern-media-controls/tracks-support/tracks-support-audio-tracks.html
media/modern-media-controls/tracks-support/tracks-support-no-tracks.html
media/modern-media-controls/tracks-support/tracks-support-text-tracks.html
* Modules/modern-media-controls/js-files:
* Modules/modern-media-controls/media/media-controller.js:
(MediaController.prototype._updateControlsIfNeeded):
* Modules/modern-media-controls/media/tracks-support.js: Added.
(TracksSupport):
(TracksSupport.prototype.destroy):
(TracksSupport.prototype.get control):
(TracksSupport.prototype.get mediaEvents):
(TracksSupport.prototype.buttonWasClicked):
(TracksSupport.prototype.syncControl):
* WebCore.xcodeproj/project.pbxproj:
2016-11-10 Yusuke Suzuki <utatane.tea@gmail.com>
[DOMJIT] DOMJIT accessor attribute in IDL should say like DOMJIT=Getter
https://bugs.webkit.org/show_bug.cgi?id=164632
Reviewed by Sam Weinig.
Currently, DOMJIT patchpoint is only allowed for getter in attributes.
To make it explicit, we use IDL attribute DOMJIT=Getter instead of
DOMJIT.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
(GenerateImplementation):
* bindings/scripts/IDLAttributes.txt:
* bindings/scripts/test/TestDOMJIT.idl:
* dom/Document.idl:
* dom/Node.idl:
2016-11-10 Sam Weinig <sam@webkit.org>
[SVG] Start moving special casing of SVG out of the bindings - SVGPreserveAspectRatio
https://bugs.webkit.org/show_bug.cgi?id=164622
Reviewed by Darin Adler.
Part 2 of moving special casing of SVG out of the bindings.
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
Add new files.
* bindings/scripts/CodeGenerator.pm:
(GenerateCompileTimeCheckForEnumsIfNeeded):
* bindings/scripts/IDLAttributes.txt:
Allow specifying a different scope for the constants to be declared in.
This allows us to have only one copy of the constants in the implementation
of SVGAngle/SVGAngleValue and SVGPreserveAspectRatio/SVGPreserveAspectRatioValue.
* loader/FrameLoader.cpp:
* rendering/svg/RenderSVGImage.h:
Remove unnecessary #include.
* svg/SVGAngle.h:
Remove redundant enum declaration.
* svg/SVGAngle.idl:
Specify a ConstantsScope of SVGAngleValue.
* rendering/svg/RenderSVGImage.cpp:
(WebCore::RenderSVGImage::updateImageViewport):
* svg/PatternAttributes.h:
(WebCore::PatternAttributes::preserveAspectRatio):
(WebCore::PatternAttributes::setPreserveAspectRatio):
* svg/SVGAnimatedPreserveAspectRatio.cpp:
(WebCore::SVGAnimatedPreserveAspectRatioAnimator::constructFromString):
(WebCore::SVGAnimatedPreserveAspectRatioAnimator::calculateAnimatedValue):
* svg/SVGAnimatedPreserveAspectRatio.h:
* svg/SVGAnimatedType.cpp:
(WebCore::SVGAnimatedType::createPreserveAspectRatio):
* svg/SVGAnimatedType.h:
(WebCore::SVGAnimatedType::preserveAspectRatio):
* svg/SVGFEImageElement.cpp:
(WebCore::SVGFEImageElement::parseAttribute):
* svg/SVGFitToViewBox.cpp:
(WebCore::SVGFitToViewBox::viewBoxToViewTransform):
* svg/SVGFitToViewBox.h:
(WebCore::SVGFitToViewBox::parseAttribute):
* svg/SVGImageElement.cpp:
(WebCore::SVGImageElement::parseAttribute):
* svg/SVGViewSpec.cpp:
(WebCore::SVGViewSpec::preserveAspectRatioString):
(WebCore::SVGViewSpec::lookupOrCreatePreserveAspectRatioWrapper):
(WebCore::SVGViewSpec::reset):
(WebCore::SVGViewSpec::parseViewSpec):
* svg/SVGViewSpec.h:
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::computeIntrinsicDimensions):
* svg/graphics/filters/SVGFEImage.cpp:
(WebCore::FEImage::FEImage):
(WebCore::FEImage::createWithImage):
(WebCore::FEImage::createWithIRIReference):
* svg/graphics/filters/SVGFEImage.h:
Replace SVGPreserveAspectRatio usage with SVGPreserveAspectRatioValue.
* svg/SVGPreserveAspectRatio.cpp: Removed.
* svg/SVGPreserveAspectRatio.h: Replaced.
* svg/SVGPreserveAspectRatio.idl:
* svg/SVGPreserveAspectRatioValue.cpp: Copied from Source/WebCore/svg/SVGPreserveAspectRatio.cpp.
* svg/SVGPreserveAspectRatioValue.h: Copied from Source/WebCore/svg/SVGPreserveAspectRatio.h.
Rename SVGPreserveAspectRatio to SVGPreserveAspectRatioValue and add a new SVGPreserveAspectRatio
that acts as the binding object.
2016-11-10 Yusuke Suzuki <utatane.tea@gmail.com>
[DOMJIT] Document#body should have DOMJIT patchpoint
https://bugs.webkit.org/show_bug.cgi?id=164627
Reviewed by Darin Adler.
This patch implements document.body accessor. To implement it, we need,
1. DOM traversing ability from ASM.
2. Checking HTMLElement.
3. Checking HTMLElement's localName.
The above features are already implemented in CSSJIT.
We extract some of utilities from CSSJIT to share them with DOMJIT.
Test: js/dom/domjit-accessor-document-body.html
* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateWalkToParentElement):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateWalkToNextAdjacentElement):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateWalkToPreviousAdjacentElement):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeMatching):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeValueExactMatching):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeFunctionCallValueMatching):
(WebCore::SelectorCompiler::jumpIfElementIsNotEmpty):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementHasTagName):
(WebCore::SelectorCompiler::testIsElementFlagOnNode): Deleted.
(WebCore::SelectorCompiler::testIsHTMLFlagOnNode): Deleted.
* dom/Document.idl:
* dom/Element.h:
* dom/QualifiedName.h:
* domjit/DOMJITAbstractHeapRepository.yaml:
* domjit/DOMJITHelpers.h:
(WebCore::DOMJIT::branchTestIsElementFlagOnNode):
(WebCore::DOMJIT::branchTestIsHTMLFlagOnNode):
* domjit/JSDocumentDOMJIT.cpp:
(WebCore::DocumentBodyDOMJIT::checkDOM):
(WebCore::loadLocalName):
(WebCore::DocumentBodyDOMJIT::callDOMGetter):
2016-11-10 John Wilander <wilander@apple.com>
Remove unused parameter name to fix build error on iOS
https://bugs.webkit.org/show_bug.cgi?id=163468
No review.
No new tests.
* platform/ios/PasteboardIOS.mm:
(WebCore::Pasteboard::writeTrustworthyWebURLsPboardType):
Removed parameter name 'pasteboardURL' in unimplemented function.
2016-11-10 Chris Dumez <cdumez@apple.com>
Speed up HTMLInputElement validation
https://bugs.webkit.org/show_bug.cgi?id=164603
Reviewed by Ryosuke Niwa.
Speed up HTMLInputElement validation by doing 1 virtual function call
instead of 9 and calling HTMLInputElement::value() only once per
validation instead of 9 times. Calling value() is expensive because
of sanitization.
No new tests, no Web-exposed behavior change.
* html/BaseCheckableInputType.cpp:
(WebCore::BaseCheckableInputType::fallbackValue):
* html/FormAssociatedElement.cpp:
(WebCore::FormAssociatedElement::isValid):
* html/FormAssociatedElement.h:
* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::isValidFormControlElement):
(WebCore::HTMLFormControlElement::updateValidity):
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::isValid):
(WebCore::HTMLInputElement::value):
* html/HTMLInputElement.h:
* html/TextFieldInputType.cpp:
(WebCore::limitLength):
* html/ValidityState.idl:
2016-11-10 John Wilander <wilander@apple.com>
Add link information to data transfer pasteboard for drag and drop links
https://bugs.webkit.org/show_bug.cgi?id=163468
<rdar://problem/20634630>
Reviewed by Brent Fulgham.
Test: editing/pasteboard/drag-link-with-data-transfer-adds-trusted-link-to-pasteboard.html
This test ensures data transfers still work for types 'text' and 'url', i.e. that we don't
regress in-page use of the drag pasteboard.
* page/DragController.cpp:
(WebCore::DragController::startDrag):
Now adds trustworthy link information to the drag pasteboard.
* platform/Pasteboard.h:
New function declaration Pasteboard::writeTrustworthyWebURLsPboardType.
* platform/efl/PasteboardEfl.cpp:
(WebCore::Pasteboard::writeTrustworthyWebURLsPboardType):
Empty, i.e. not implemented.
* platform/gtk/PasteboardGtk.cpp:
(WebCore::Pasteboard::writeTrustworthyWebURLsPboardType):
Empty, i.e. not implemented.
* platform/ios/PasteboardIOS.mm:
(WebCore::Pasteboard::writeTrustworthyWebURLsPboardType):
Calls ASSERT_NOT_REACHED() to make sure we don't use this function before we have
decided on a trustrworthy URL pasteboard type on iOS. Currently not used since we
don't support drag & drop on iOS.
* platform/mac/PasteboardMac.mm:
(WebCore::Pasteboard::writeTrustworthyWebURLsPboardType):
Writes the given URL to the WebURLsWithTitlesPboardType. This pasteboard type
serves as a trusted drop source.
* platform/win/PasteboardWin.cpp:
(WebCore::Pasteboard::writeTrustworthyWebURLsPboardType):
Empty, i.e. not implemented.
2016-11-10 Said Abou-Hallawa <sabouhallawa@apple.com>
REGRESSION(r207182): [iOS] Crash because of passing freed CFDictionaryRef to CG when decoding a sub-sampled large image
https://bugs.webkit.org/show_bug.cgi?id=164617
Reviewed by Tim Horton.
This covered by the test fast/images/image-subsampling.html but it should
run with --guard-malloc --repeat-each=10 to show the bug or to verify the
fix.
imageSourceOptions() returns a non static RetainPtr<CFDictionaryRef> if
the subsamplingLevel is not zero. Because we are assigning the raw pointer
to a local variable in ImageDecoder::createFrameImageAtIndex(), CFRelease()
is called for the CFDictionaryRef immediately after this assignment. This
causes its memory to be freed in this case even before calling CG.
This bug does not happen if the subsamplingLevel is zero because we cache
the returned value in a static NeverDestroyed<RetainPtr<CFDictionaryRef> in
imageSourceOptions(). This cache prevents the CFDictionaryRef from being
freed in ImageDecoder::createFrameImageAtIndex() no matter where CFRelease()
is called.
The fix is hold the returned value in a RetainPtr<CFDictionaryRef>. This
will ensure the CFDictionaryRef raw pointer is valid till the end of
ImageDecoder::createFrameImageAtIndex().
* platform/graphics/cg/ImageDecoderCG.cpp:
(WebCore::ImageDecoder::createFrameImageAtIndex): Ensure the pointer is retained.
2016-11-10 Brent Fulgham <bfulgham@apple.com>
[Win][Direct2D] Add transparency layer support
https://bugs.webkit.org/show_bug.cgi?id=164614
Reviewed by Dean Jackson.
Provide a stackable implementation of transparency layers so that
multiple layers with opacity draw propery.
Tested by fast/layers/opacity-stacking.html and others.
* platform/graphics/win/GraphicsContextDirect2D.cpp:
(WebCore::GraphicsContext::platformContext): Remove unneeded assertion.
(WebCore::GraphicsContextPlatformPrivate::renderTarget): Return current context taking
into account the presence of transparency layers.
(WebCore::GraphicsContextPlatformPrivate::setAlpha): Added.
(WebCore::GraphicsContextPlatformPrivate::currentGlobalAlpha): Get current global
alpha for current layer.
(WebCore::GraphicsContext::colorWithGlobalAlpha): Compute proper color taking into
account the current layer.
(WebCore::drawWithShadowHelper): Helper function to share code.
(WebCore::GraphicsContext::drawWithShadow): Use new helper function.
(WebCore::GraphicsContextPlatformPrivate::beginTransparencyLayer): Added.
(WebCore::GraphicsContext::beginPlatformTransparencyLayer): Call new implementation.
(WebCore::GraphicsContextPlatformPrivate::endTransparencyLayer): Added.
(WebCore::GraphicsContext::endPlatformTransparencyLayer): Call new implementation.
(WebCore::GraphicsContext::clearRect): Clear to transparent color.
(WebCore::GraphicsContext::setPlatformAlpha): Pass new alpha on to any active
transparency layer.
* platform/graphics/win/GraphicsContextPlatformPrivateDirect2D.h:
(WebCore::GraphicsContextPlatformPrivate::renderTarget): Deleted.
2016-11-10 Dean Jackson <dino@apple.com>
Add CSS Color Level 4 to features.
* features.json:
2016-11-10 Zalan Bujtas <zalan@apple.com>
Move update image calls to RenderElement::styleDidChange.
https://bugs.webkit.org/show_bug.cgi?id=164623
Reviewed by Simon Fraser.
There should be no dependency on the image update between ::styleWillChange and ::styleDidChange.
Covered by existing tests.
* rendering/RenderElement.cpp:
(WebCore::RenderElement::initializeStyle):
(WebCore::RenderElement::setStyle):
(WebCore::RenderElement::styleDidChange):
2016-11-10 Joseph Pecoraro <pecoraro@apple.com>
After r207459 ASSERT in CachedResourceLoader under InspectorPageAgent::cachedResource
https://bugs.webkit.org/show_bug.cgi?id=164621
Reviewed by Youenn Fablet.
* inspector/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::cachedResource):
CachedResourceLoader expects a sanitized URL.
2016-11-10 Brady Eidson <beidson@apple.com>
IndexedDB 2.0 Support the IDBDatabase.onclose event.
https://bugs.webkit.org/show_bug.cgi?id=164602
Reviewed by Alex Christensen.
No new tests (Covered by existing tests).
* Modules/indexeddb/IDBDatabase.cpp:
(WebCore::IDBDatabase::connectionToServerLost): Fire "onclose" after "onerror"
* Modules/indexeddb/IDBDatabase.idl:
2016-11-10 Ryosuke Niwa <rniwa@webkit.org>
Copied text would contain text inside CDATA sections and comments
https://bugs.webkit.org/show_bug.cgi?id=164578
<rdar://problem/19834542>
Reviewed by Darin Adler.
The bug was caused by HTMLConverter::_traverseNode always including the content of a Text node.
Since Comment and CDataSection nodes are also Text nodes, we need to exclude them.
In the long term, we should check the visibility of the text as done in MarkupAccumulator.
Test: editing/mac/attributed-string/comment-cdata-section.html
* editing/cocoa/HTMLConverter.mm:
(HTMLConverter::_traverseNode):
2016-11-10 Eric Carlson <eric.carlson@apple.com>
[MediaStream] apply constraints passed to getUserMedia()
https://bugs.webkit.org/show_bug.cgi?id=164561
Reviewed by Youenn Fablet.
<rdar://problem/29191384>
No new tests, updated existing tests.
* Modules/mediastream/UserMediaRequest.cpp:
(WebCore::UserMediaRequest::allow): Pass constraints into createMediaStream instead of applying
them after the stream has been created.
* WebCore.xcodeproj/project.pbxproj: Remove MediaConstraintsMock.cpp/.h.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updatePausedImage): Remove a bogus assert.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::currentReadyState): Drive-by fix: a stream
that is receiving media data is as ready as it will ever be so it's readyState should be
at HAVE_ENOUGH_DATA.
Simplify CaptureDeviceManager by removing all code for constraint validation because some
constraints can't be validated without a live capture device. Ports that are able to resolve
constraints without creating a live source can do so in a derived capture device class.
* platform/mediastream/CaptureDeviceManager.cpp:
(CaptureDeviceManager::bestSourcesForTypeAndConstraints): Return a list of UIDs, not a list
of live sources, because that is all the caller will use. This will allows ports to avoid
source creation in some cases.
(CaptureDeviceManager::sourceWithUID): Add parameters for new source constraints and invalid
constraint.
(CaptureDeviceManager::verifyConstraintsForMediaType): Deleted.
(CaptureDeviceManager::bestDeviceForFacingMode): Deleted.
(facingModeFromString): Deleted.
(CaptureDeviceManager::sessionSupportsConstraint): Deleted.
(CaptureDeviceManager::isSupportedFrameRate): Deleted.
* platform/mediastream/CaptureDeviceManager.h:
(WebCore::CaptureDeviceManager::defaultCaptureSession): Deleted.
* platform/mediastream/MediaConstraints.cpp:
(WebCore::FlattenedConstraint::find): New, make it possible to examine resolved constraints.
* platform/mediastream/MediaConstraints.h:
(WebCore::NumericConstraint::fitnessDistance): Reject invalid constraints.
(WebCore::NumericConstraint::valueForCapabilityRange): New, resolve a constraint for a
capability range.
(WebCore::MediaTrackConstraintSetMap::width): Expose constraints held in the map.
(WebCore::MediaTrackConstraintSetMap::height):
(WebCore::MediaTrackConstraintSetMap::sampleRate):
(WebCore::MediaTrackConstraintSetMap::sampleSize):
(WebCore::MediaTrackConstraintSetMap::aspectRatio):
(WebCore::MediaTrackConstraintSetMap::frameRate):
(WebCore::MediaTrackConstraintSetMap::volume):
(WebCore::MediaTrackConstraintSetMap::echoCancellation):
(WebCore::MediaTrackConstraintSetMap::facingMode):
(WebCore::MediaTrackConstraintSetMap::deviceId):
(WebCore::MediaTrackConstraintSetMap::groupId):
Resolve and apply width, height, and frameRate all at once because the ability to support
one may depend on the value of another.
* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::supportsSizeAndFrameRate):
(WebCore::applyNumericConstraint): Move the guts of the logic into valueForCapabilityRange.
(WebCore::RealtimeMediaSource::applySizeAndFrameRate):
(WebCore::RealtimeMediaSource::selectSettings):
(WebCore::RealtimeMediaSource::supportsConstraints):
(WebCore::RealtimeMediaSource::applyConstraints): Support null success/failure lambdas.
* platform/mediastream/RealtimeMediaSource.h:
* platform/mediastream/RealtimeMediaSourceCenter.h:
* platform/mediastream/mac/AVAudioCaptureSource.h:
* platform/mediastream/mac/AVAudioCaptureSource.mm:
(WebCore::AVAudioCaptureSource::create): Add parameter for creation constraints.
(WebCore::AVAudioCaptureSource::AVAudioCaptureSource): Ditto.
Remove all constraint validation code, it is done by the audio and video capture sources. Add
support for stream creation constraints.
* platform/mediastream/mac/AVCaptureDeviceManager.h:
* platform/mediastream/mac/AVCaptureDeviceManager.mm:
(WebCore::AVCaptureDeviceManager::captureDeviceList):
(WebCore::AVCaptureDeviceManager::createMediaSourceForCaptureDeviceWithConstraints):
(WebCore::AVCaptureDeviceManager::bestSourcesForTypeAndConstraints): Deleted.
(WebCore::AVCaptureDeviceManager::sourceWithUID): Deleted.
(WebCore::AVCaptureDeviceManager::verifyConstraintsForMediaType): Deleted.
(WebCore::AVCaptureDeviceManager::defaultCaptureSession): Deleted.
(WebCore::AVCaptureDeviceManager::sessionSupportsConstraint): Deleted.
(WebCore::AVCaptureDeviceManager::isSupportedFrameRate): Deleted.
(WebCore::AVCaptureDeviceManager::supportedConstraints): Deleted.
* platform/mediastream/mac/AVMediaCaptureSource.h:
(WebCore::AVMediaCaptureSource::constraints): Deleted.
* platform/mediastream/mac/AVMediaCaptureSource.mm:
(WebCore::AVMediaCaptureSource::AVMediaCaptureSource):
(WebCore::AVMediaCaptureSource::~AVMediaCaptureSource):
(WebCore::AVMediaCaptureSource::startProducingData):
(WebCore::AVMediaCaptureSource::stopProducingData):
(WebCore::AVMediaCaptureSource::beginConfiguration):
(WebCore::AVMediaCaptureSource::commitConfiguration):
(WebCore::AVMediaCaptureSource::capabilities):
(WebCore::AVMediaCaptureSource::setupSession):
(WebCore::AVMediaCaptureSource::reset):
Validate and apply constraints, support source creation constraints, initialize capabilities
and supported constraints by examining device capabilities.
* platform/mediastream/mac/AVVideoCaptureSource.h:
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::create):
(WebCore::AVVideoCaptureSource::AVVideoCaptureSource):
(WebCore::updateSizeMinMax):
(WebCore::updateAspectRatioMinMax):
(WebCore::AVVideoCaptureSource::initializeCapabilities):
(WebCore::AVVideoCaptureSource::initializeSupportedConstraints):
(WebCore::AVVideoCaptureSource::applySize):
(WebCore::AVVideoCaptureSource::setPreset):
(WebCore::AVVideoCaptureSource::applyFrameRate):
(WebCore::AVVideoCaptureSource::applySizeAndFrameRate):
(WebCore::AVVideoCaptureSource::setupCaptureSession):
(WebCore::AVVideoCaptureSource::currentFrameCGImage):
(WebCore::AVVideoCaptureSource::bestSessionPresetForVideoDimensions):
(WebCore::AVVideoCaptureSource::supportsSizeAndFrameRate):
* platform/mediastream/mac/MockRealtimeVideoSourceMac.h:
* platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
(WebCore::MockRealtimeVideoSource::create): Apply creation constraints, return null if they
can not be applied successfully.
(WebCore::MockRealtimeVideoSourceMac::MockRealtimeVideoSourceMac):
(WebCore::MockRealtimeVideoSource::createMuted):
Update RealtimeMediaSourceCenters for API changes.
* platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
(WebCore::RealtimeMediaSourceCenterMac::validateRequestConstraints):
(WebCore::RealtimeMediaSourceCenterMac::createMediaStream):
* platform/mediastream/mac/RealtimeMediaSourceCenterMac.h:
* platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp:
(WebCore::RealtimeMediaSourceCenterOwr::validateRequestConstraints):
(WebCore::RealtimeMediaSourceCenterOwr::createMediaStream):
(WebCore::RealtimeMediaSourceCenterOwr::mediaSourcesAvailable):
* platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.h:
Mock media sources support constraint validation and application directly so "mock constraints"
are no longer necessary.
* platform/mock/MediaConstraintsMock.cpp: Removed.
* platform/mock/MediaConstraintsMock.h: Removed.
* platform/mock/MockRealtimeAudioSource.cpp:
(WebCore::MockRealtimeAudioSource::create):
(WebCore::MockRealtimeAudioSource::createMuted):
(WebCore::MockRealtimeAudioSource::updateSettings):
(WebCore::MockRealtimeAudioSource::initializeCapabilities):
(WebCore::MockRealtimeAudioSource::initializeSupportedConstraints):
* platform/mock/MockRealtimeAudioSource.h:
* platform/mock/MockRealtimeMediaSourceCenter.cpp:
(WebCore::MockRealtimeMediaSourceCenter::validateRequestConstraints):
(WebCore::MockRealtimeMediaSourceCenter::createMediaStream):
* platform/mock/MockRealtimeMediaSourceCenter.h:
* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::create):
(WebCore::MockRealtimeVideoSource::createMuted):
* platform/mock/MockRealtimeVideoSource.h:
* platform/mock/RTCPeerConnectionHandlerMock.cpp:
2016-11-10 Alex Christensen <achristensen@webkit.org>
Move SecurityOrigin::databaseIdentifier() to SecurityOriginData
https://bugs.webkit.org/show_bug.cgi?id=164573
Reviewed by Brady Eidson.
No change in behavior.
* Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
(WebCore::WebKitMediaKeySession::mediaKeysStorageDirectory):
* Modules/indexeddb/IDBDatabaseIdentifier.cpp:
(WebCore::IDBDatabaseIdentifier::databaseDirectoryRelativeToRoot):
* Modules/indexeddb/server/IDBServer.cpp:
(WebCore::IDBServer::IDBServer::performCloseAndDeleteDatabasesForOrigins):
* Modules/webdatabase/DatabaseTracker.cpp:
(WebCore::DatabaseTracker::hasEntryForOriginNoLock):
(WebCore::DatabaseTracker::hasEntryForDatabase):
(WebCore::DatabaseTracker::originPath):
(WebCore::DatabaseTracker::fullPathForDatabaseNoLock):
(WebCore::DatabaseTracker::databaseNamesForOriginNoLock):
(WebCore::DatabaseTracker::detailsForNameAndOrigin):
(WebCore::DatabaseTracker::setDatabaseDetails):
(WebCore::DatabaseTracker::originLockFor):
(WebCore::DatabaseTracker::deleteOriginLockFor):
(WebCore::DatabaseTracker::quotaForOriginNoLock):
(WebCore::DatabaseTracker::setQuota):
(WebCore::DatabaseTracker::addDatabase):
(WebCore::DatabaseTracker::deleteOrigin):
(WebCore::DatabaseTracker::deleteDatabase):
(WebCore::DatabaseTracker::removeDeletedOpenedDatabases):
* Modules/webdatabase/SQLTransactionCoordinator.cpp:
(WebCore::getDatabaseIdentifier):
* dom/Document.cpp:
(WebCore::Document::origin):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaPlayerMediaKeysStorageDirectory):
* loader/appcache/ApplicationCacheStorage.cpp:
(WebCore::ApplicationCacheStorage::calculateQuotaForOrigin):
(WebCore::ApplicationCacheStorage::calculateUsageForOrigin):
(WebCore::ApplicationCacheStorage::calculateRemainingSizeForOriginExcludingCache):
(WebCore::ApplicationCacheStorage::storeUpdatedQuotaForOrigin):
(WebCore::ApplicationCacheStorage::store):
(WebCore::ApplicationCacheStorage::ensureOriginRecord):
* page/SecurityOrigin.cpp:
(WebCore::SecurityOrigin::databaseIdentifier): Deleted.
* page/SecurityOrigin.h:
* page/SecurityOriginData.cpp:
(WebCore::SecurityOriginData::databaseIdentifier):
* page/SecurityOriginData.h:
2016-11-10 Zalan Bujtas <zalan@apple.com>
RenderElement::invalidateFlowThreadContainingBlockIncludingDescendants should be on RenderBlock.
https://bugs.webkit.org/show_bug.cgi?id=164601
Reviewed by Simon Fraser.
FlowThread containing blocks are cached at RenderBlocks. It makes no sense to call the invalidate function on a RenderElement.
Move invalidateFlowThreadContainingBlockIncludingDescendants to RenderBlock.
No change in functionality.
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::invalidateFlowThreadContainingBlockIncludingDescendants):
* rendering/RenderBlock.h:
* rendering/RenderElement.cpp:
(WebCore::RenderElement::invalidateFlowThreadContainingBlockIncludingDescendants): Deleted.
* rendering/RenderElement.h:
* rendering/RenderInline.cpp:
(WebCore::RenderInline::splitInlines):
2016-11-10 Brent Fulgham <bfulgham@apple.com>
Local file restrictions should not block sessionStorage access.
https://bugs.webkit.org/show_bug.cgi?id=155609
<rdar://problem/25229461>
Reviewed by Andy Estes.
Re-landing this fix that was lost when the localStorage change was rolled out.
Use of 'sessionStorage' is governed by SecurityOrigin with third party access
set to 'ShouldAllowFromThirdParty::AlwaysAllowFromThirdParty'. We should not
reject local files for this combination of arguments.
Tested by storage/domstorage/sessionstorage/blocked-file-access.html.
* page/SecurityOrigin.cpp:
(WebCore::SecurityOrigin::canAccessStorage): For the case of sessionStorage,
allow local file access.
2016-11-10 Daniel Bates <dabates@apple.com>
REGRESSION (r195004): Scripts and plugins blocked for subsequent loads in same WebContent
process after receiving HTTP 0.9 response
https://bugs.webkit.org/show_bug.cgi?id=164387
<rdar://problem/28987537>
Reviewed by Brent Fulgham.
Fixes an issue where the HTTP 0.9 sandbox persisted across subsequent loads in the same
WebContent process.
Currently when an HTTP 0.9 response is received for a request made to a default port
(e.g. 80) we apply a sandbox policy on the FrameLoader for the main resource that
disallows scripts and plugins. A FrameLoader may be re-used for navigations. Therefore,
the sandbox policy applied to one site may be applied to another site. Moreover the
sandbox policy was applied to the FrameLoader of the main resource regardless of whether
the HTTP response was for a subresource. Instead we should apply the sandbox on a per-
Document basis and only if we receive an HTTP 0.9 response for the document when the
corresponding HTTP request was made to a default port.
As a side benefit of this change, we emit exactly one console message to Web Inspector
when the HTTP 0.9 sandbox is applied to a document as opposed to three console messages.
Moreover, we only emit this console message when the document load is not blocked.
Test: http/tests/security/http-0.9/sandbox-should-not-persist-on-navigation.html
* dom/Document.cpp:
(WebCore::Document::initSecurityContext): Disallow scripts and plugins if an HTTP 0.9
response was received for this document. Note that if this function is called for a
document associated with an HTTP 0.9 response then the corresponding HTTP request was
made to a default port. DocumentLoader::responseReceived() blocks the load for a document
with an HTTP 0.9 response corresponding to an HTTP request made to a non-default port.
This invariant is covered by the tests LayoutTests/http/tests/security/http-0.9/default-port-{plugin, script}-blocked.html.
(WebCore::Document::shouldEnforceHTTP0_9Sandbox): Added. Returns whether an HTTP 0.9 response
was received for this document.
* dom/Document.h:
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::responseReceived): Remove logic to apply sandbox policy to the
FrameLoader associated with the main resource. We will apply the sandbox during initialization
of the document.
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::didReceiveResponse): Ditto.
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::didReceiveResponse): Ditto.
2016-11-04 Jiewen Tan <jiewen_tan@apple.com>
Update SubtleCrypto::importKey to match the latest spec
https://bugs.webkit.org/show_bug.cgi?id=164446
<rdar://problem/29123621>
Reviewed by Brent Fulgham.
This patch does following few things:
1. It updates the SubtleCrypto::importKey method to match the latest spec:
https://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-importKey.
It also refers to the latest Editor's Draft at a certain degree:
https://w3c.github.io/webcrypto/Overview.html#SubtleCrypto-method-importKey.
2. It implements importKey operations of following algorithms: AES-CBC, AES-KW,
HMAC, RSAES-PKCS1-V1_5, RSASSA-PKCS1-V1_5, and RSA-OAEP.
3. It fixes some minor problems of SubtleCrypto::generateKey.
4. It addes move constructors for CryptoKeyAES, CryptoKeyHMAC, CryptoKeyRSA and
CryptoKeyDataRSAComponents.
5. It renames HmacKeyGenParams to HmacKeyParams to serve the purpose of both
HmacKeyGenParams and HmacImportParams which are essentially the same.
6. It enforces the key length in bits of CryptoKeyHMAC to be multiples of 8.
7. It also fixes the following bugs:
https://bugs.webkit.org/show_bug.cgi?id=126033,
https://bugs.webkit.org/show_bug.cgi?id=126034,
https://bugs.webkit.org/show_bug.cgi?id=151308.
P.S. We currently only support Raw and Jwk key format.
Tests: crypto/subtle/aes-cbc-import-jwk-key-length-128.html
crypto/subtle/aes-cbc-import-jwk-key-length-192.html
crypto/subtle/aes-cbc-import-jwk-key-length-256.html
crypto/subtle/aes-cbc-import-jwk-key-minimum.html
crypto/subtle/aes-cbc-import-jwk-key-non-extractable.html
crypto/subtle/aes-cbc-import-raw-key-length-128.html
crypto/subtle/aes-cbc-import-raw-key-length-192.html
crypto/subtle/aes-cbc-import-raw-key-length-256.html
crypto/subtle/aes-import-key-malformed-parameters.html
crypto/subtle/aes-kw-import-jwk-key-length-128.html
crypto/subtle/aes-kw-import-jwk-key-length-192.html
crypto/subtle/aes-kw-import-jwk-key-length-256.html
crypto/subtle/aes-kw-import-raw-key.html
crypto/subtle/generate-key-malformed-parameters.html
crypto/subtle/hmac-import-jwk-key-minimum.html
crypto/subtle/hmac-import-jwk-key-non-extractable.html
crypto/subtle/hmac-import-jwk-key-sha1.html
crypto/subtle/hmac-import-jwk-key-sha224.html
crypto/subtle/hmac-import-jwk-key-sha256.html
crypto/subtle/hmac-import-jwk-key-sha384.html
crypto/subtle/hmac-import-jwk-key-sha512.html
crypto/subtle/hmac-import-malformed-parameters.html
crypto/subtle/hmac-import-raw-key-customized-length.html
crypto/subtle/hmac-import-raw-key.html
crypto/subtle/import-key-malformed-parameters.html
crypto/subtle/rsa-import-key-malformed-parameters.html
crypto/subtle/rsa-oaep-import-jwk-private-key.html
crypto/subtle/rsa-oaep-import-jwk-public-key-sha1.html
crypto/subtle/rsa-oaep-import-jwk-public-key-sha224.html
crypto/subtle/rsa-oaep-import-jwk-public-key-sha256.html
crypto/subtle/rsa-oaep-import-jwk-public-key-sha384.html
crypto/subtle/rsa-oaep-import-jwk-public-key-sha512.html
crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-private-key.html
crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-public-key-leading-zero.html
crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-public-key-minimum.html
crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-public-key-non-extractable.html
crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-public-key.html
crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-private-key.html
crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha1.html
crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha224.html
crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha256.html
crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha384.html
crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha512.html
crypto/workers/subtle/aes-import-jwk-key.html
crypto/workers/subtle/aes-import-raw-key.html
crypto/workers/subtle/hmac-import-jwk-key.html
crypto/workers/subtle/hmac-import-raw-key.html
crypto/workers/subtle/rsa-import-jwk-private-key.html
crypto/workers/subtle/rsa-import-jwk-public-key.html
* CMakeLists.txt:
* DerivedSources.make:
* PlatformEfl.cmake:
* PlatformGTK.cmake:
* PlatformMac.cmake:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSSubtleCryptoCustom.cpp:
(WebCore::normalizeCryptoAlgorithmParameters):
(WebCore::cryptoKeyUsageFromString):
(WebCore::cryptoKeyUsagesFromJSValue):
(WebCore::toKeyData):
(WebCore::jsSubtleCryptoFunctionGenerateKeyPromise):
(WebCore::jsSubtleCryptoFunctionImportKeyPromise):
(WebCore::JSSubtleCrypto::importKey):
* crypto/CryptoAlgorithm.cpp:
(WebCore::CryptoAlgorithm::importKey):
* crypto/CryptoAlgorithm.h:
* crypto/CryptoAlgorithmParameters.h:
* crypto/JsonWebKey.h: Added.
* crypto/JsonWebKey.idl: Added.
* crypto/RsaOtherPrimesInfo.h: Added.
* crypto/RsaOtherPrimesInfo.idl: Added.
* crypto/SubtleCrypto.h:
* crypto/SubtleCrypto.idl:
* crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
(WebCore::CryptoAlgorithmAES_CBC::generateKey):
(WebCore::CryptoAlgorithmAES_CBC::importKey):
* crypto/algorithms/CryptoAlgorithmAES_CBC.h:
* crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
(WebCore::CryptoAlgorithmAES_KW::generateKey):
(WebCore::CryptoAlgorithmAES_KW::importKey):
* crypto/algorithms/CryptoAlgorithmAES_KW.h:
* crypto/algorithms/CryptoAlgorithmHMAC.cpp:
(WebCore::CryptoAlgorithmHMAC::generateKey):
(WebCore::CryptoAlgorithmHMAC::importKey):
* crypto/algorithms/CryptoAlgorithmHMAC.h:
* crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::importKey):
* crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h:
* crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::importKey):
* crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h:
* crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
(WebCore::CryptoAlgorithmRSA_OAEP::importKey):
* crypto/algorithms/CryptoAlgorithmRSA_OAEP.h:
* crypto/keys/CryptoKeyAES.cpp:
(WebCore::CryptoKeyAES::CryptoKeyAES):
(WebCore::CryptoKeyAES::generate):
(WebCore::CryptoKeyAES::importRaw):
(WebCore::CryptoKeyAES::importJwk):
* crypto/keys/CryptoKeyAES.h:
* crypto/keys/CryptoKeyDataRSAComponents.cpp:
(WebCore::CryptoKeyDataRSAComponents::CryptoKeyDataRSAComponents):
* crypto/keys/CryptoKeyDataRSAComponents.h:
* crypto/keys/CryptoKeyHMAC.cpp:
(WebCore::CryptoKeyHMAC::CryptoKeyHMAC):
(WebCore::CryptoKeyHMAC::generate):
(WebCore::CryptoKeyHMAC::importRaw):
(WebCore::CryptoKeyHMAC::importJwk):
(WebCore::CryptoKeyHMAC::buildAlgorithm):
* crypto/keys/CryptoKeyHMAC.h:
* crypto/keys/CryptoKeyRSA.cpp: Added.
(WebCore::CryptoKeyRSA::importJwk):
* crypto/keys/CryptoKeyRSA.h:
* crypto/parameters/CryptoAlgorithmHmacKeyParams.h: Renamed from Source/WebCore/crypto/parameters/CryptoAlgorithmHmacKeyGenParams.h.
* crypto/parameters/CryptoAlgorithmRsaHashedImportParams.h: Added.
* crypto/parameters/HmacKeyParams.idl: Renamed from Source/WebCore/crypto/parameters/HmacKeyGenParams.idl.
* crypto/parameters/RsaHashedImportParams.idl: Added.
2016-11-10 Brady Eidson <beidson@apple.com>
IndexedDB 2.0: REGRESSION(r208467) Fix flaky crashes in IDB GC-related code.
https://bugs.webkit.org/show_bug.cgi?id=164596
Reviewed by Eric Carlson.
No new tests (Covered by existing tests).
We can't just WTFMove the pointers from the deleted-IDBObject maps...
We need to remove the entries, too.
* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::rollbackForVersionChangeAbort):
* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::internalAbort):
2016-11-10 Youenn Fablet <youennf@gmail.com>
MediaStreamTrack should use more Ref<> and less RefPtr<>
https://bugs.webkit.org/show_bug.cgi?id=164560
Reviewed by Eric Carlson.
No change of behavior.
Make MediaStreamTrack take a Ref<>& instead of a reference.
Using Ref<>&& instead of RefPtr<>&& in MediaStreamTrackPrivate.
Updating constness of some methods accordingly.
* Modules/mediastream/MediaEndpointPeerConnection.cpp:
(WebCore::MediaEndpointPeerConnection::createReceiver):
* Modules/mediastream/MediaStreamTrack.cpp:
(WebCore::MediaStreamTrack::create):
(WebCore::MediaStreamTrack::MediaStreamTrack):
(WebCore::MediaStreamTrack::clone):
* Modules/mediastream/MediaStreamTrack.h:
* Modules/webaudio/MediaStreamAudioSource.cpp:
(WebCore::MediaStreamAudioSource::capabilities):
(WebCore::MediaStreamAudioSource::settings):
* Modules/webaudio/MediaStreamAudioSource.h:
* platform/mediastream/MediaEndpoint.cpp:
* platform/mediastream/MediaStreamPrivate.cpp:
(WebCore::MediaStreamPrivate::create):
* platform/mediastream/MediaStreamTrackPrivate.cpp:
(WebCore::MediaStreamTrackPrivate::create):
(WebCore::MediaStreamTrackPrivate::MediaStreamTrackPrivate):
(WebCore::MediaStreamTrackPrivate::clone):
* platform/mediastream/MediaStreamTrackPrivate.h:
(WebCore::MediaStreamTrackPrivate::setMuted):
(WebCore::MediaStreamTrackPrivate::source):
* platform/mediastream/RealtimeMediaSource.h:
* platform/mediastream/mac/AVMediaCaptureSource.h:
* platform/mediastream/mac/AVMediaCaptureSource.mm:
(WebCore::AVMediaCaptureSource::initializeSettings):
(WebCore::AVMediaCaptureSource::settings):
(WebCore::AVMediaCaptureSource::initializeCapabilities):
(WebCore::AVMediaCaptureSource::capabilities):
* platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.h:
(WebCore::RealtimeMediaSourceOwr::capabilities):
(WebCore::RealtimeMediaSourceOwr::settings):
* platform/mock/MockRealtimeMediaSource.cpp:
(WebCore::MockRealtimeMediaSource::initializeCapabilities):
(WebCore::MockRealtimeMediaSource::capabilities):
(WebCore::MockRealtimeMediaSource::initializeSettings):
(WebCore::MockRealtimeMediaSource::settings):
* platform/mock/MockRealtimeMediaSource.h:
2016-11-10 Per Arne Vollan <pvollan@apple.com>
[Win32] Crash in layout tests.
https://bugs.webkit.org/show_bug.cgi?id=164411
Reviewed by Mark Lam.
Use the calling convention expected by the callers of the generated functions.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
* bindings/scripts/test/JS/JSTestDOMJIT.cpp:
(WebCore::unsafeJsTestDOMJITPrototypeFunctionGetAttribute):
(WebCore::unsafeJsTestDOMJITPrototypeFunctionItem):
(WebCore::unsafeJsTestDOMJITPrototypeFunctionHasAttribute):
(WebCore::unsafeJsTestDOMJITPrototypeFunctionGetElementById):
(WebCore::unsafeJsTestDOMJITPrototypeFunctionGetElementsByName):
2016-11-10 Aaron Chu <aaron_chu@apple.com>
Web Inspector: AXI: clarify button roles (e.g. toggle or popup button)
https://bugs.webkit.org/show_bug.cgi?id=130726
<rdar://problem/16420420>
Reviewed by Brian Burg.
Test: accessibility/ax-differentiate-button-types.html
Added special case logic to make sure PopUpButtonRole and ToggleButtonRole to user ButtonRole as role.
Added an "isPopUpButton" property to be exposed to the Inspector's use.
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::computedRoleString):
* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
2016-11-10 Zan Dobersek <zdobersek@igalia.com>
[EME] Add no-op Web-facing APIs
https://bugs.webkit.org/show_bug.cgi?id=164028
Reviewed by Jer Noble.
Add no-op implementation of the Web-facing APIs as defined in
the EME specification. This will be the basis for implementing
the various algorithms the same specification defines, and for
implementing the relevant platform abstractions.
Dictionaries and enumerations defined by the specification are
defined in separate headers, and not in the implementation files
for the class where they are used. This will ease their use
across different implementation files.
BufferSource now exposes the Variant object it holds. This is
needed to support the iterable property on the MediaKeyStatusMap
class.
CodeGeneratorJS is fixed to support JS-to-native conversion of
sequences of dictionaries.
* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.make:
* Modules/encryptedmedia/MediaKeyMessageEvent.cpp: Added.
(WebCore::MediaKeyMessageEvent::MediaKeyMessageEvent):
(WebCore::MediaKeyMessageEvent::eventInterface):
* Modules/encryptedmedia/MediaKeyMessageEvent.h: Added.
* Modules/encryptedmedia/MediaKeyMessageEvent.idl: Added.
* Modules/encryptedmedia/MediaKeyMessageEventInit.h: Added.
(WebCore::MediaKeyMessageEventInit::MediaKeyMessageEventInit):
* Modules/encryptedmedia/MediaKeyMessageType.h: Added.
* Modules/encryptedmedia/MediaKeySession.cpp: Added.
(WebCore::MediaKeySession::create):
(WebCore::MediaKeySession::MediaKeySession):
(WebCore::MediaKeySession::sessionId):
(WebCore::MediaKeySession::expiration):
(WebCore::MediaKeySession::keyStatuses):
(WebCore::MediaKeySession::generateRequest):
(WebCore::MediaKeySession::load):
(WebCore::MediaKeySession::update):
(WebCore::MediaKeySession::close):
(WebCore::MediaKeySession::remove):
(WebCore::MediaKeySession::hasPendingActivity):
(WebCore::MediaKeySession::activeDOMObjectName):
(WebCore::MediaKeySession::canSuspendForDocumentSuspension):
(WebCore::MediaKeySession::stop):
* Modules/encryptedmedia/MediaKeySession.h: Added.
* Modules/encryptedmedia/MediaKeySession.idl: Added.
* Modules/encryptedmedia/MediaKeySessionType.h: Added.
* Modules/encryptedmedia/MediaKeyStatus.h: Added.
* Modules/encryptedmedia/MediaKeyStatusMap.cpp: Added.
(WebCore::MediaKeyStatusMap::size):
(WebCore::MediaKeyStatusMap::has):
(WebCore::MediaKeyStatusMap::get):
(WebCore::MediaKeyStatusMap::Iterator::Iterator):
(WebCore::MediaKeyStatusMap::Iterator::next):
* Modules/encryptedmedia/MediaKeyStatusMap.h: Added.
(WebCore::MediaKeyStatusMap::create):
(WebCore::MediaKeyStatusMap::createIterator):
* Modules/encryptedmedia/MediaKeyStatusMap.idl: Added.
* Modules/encryptedmedia/MediaKeySystemAccess.cpp: Added.
(WebCore::MediaKeySystemAccess::keySystem):
(WebCore::MediaKeySystemAccess::getConfiguration):
(WebCore::MediaKeySystemAccess::createMediaKeys):
* Modules/encryptedmedia/MediaKeySystemAccess.h: Added.
(WebCore::MediaKeySystemAccess::create):
* Modules/encryptedmedia/MediaKeySystemAccess.idl: Added.
* Modules/encryptedmedia/MediaKeySystemConfiguration.h: Added.
* Modules/encryptedmedia/MediaKeySystemConfiguration.idl: Added.
* Modules/encryptedmedia/MediaKeySystemMediaCapability.h: Added.
* Modules/encryptedmedia/MediaKeySystemMediaCapability.idl: Added.
* Modules/encryptedmedia/MediaKeys.cpp: Added.
(WebCore::MediaKeys::createSession):
(WebCore::MediaKeys::setServerCertificate):
* Modules/encryptedmedia/MediaKeys.h: Added.
(WebCore::MediaKeys::create):
* Modules/encryptedmedia/MediaKeys.idl: Added.
* Modules/encryptedmedia/MediaKeysRequirement.h: Added.
* Modules/encryptedmedia/NavigatorEME.cpp: Added.
(WebCore::NavigatorEME::requestMediaKeySystemAccess):
* Modules/encryptedmedia/NavigatorEME.h: Added.
* Modules/encryptedmedia/NavigatorEME.idl: Added.
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/BufferSource.h:
(WebCore::BufferSource::BufferSource):
(WebCore::BufferSource::variant):
* bindings/js/JSMediaKeySessionCustom.cpp: Added.
(WebCore::JSMediaKeySession::closed):
* bindings/js/JSMediaKeySystemAccessCustom.cpp: Added.
(WebCore::JSMediaKeySystemAccess::getConfiguration):
* bindings/scripts/CodeGeneratorJS.pm:
(GetNativeVectorInnerType):
* dom/EventNames.h:
* dom/EventNames.in:
* dom/EventTargetFactory.in:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaKeys):
(WebCore::HTMLMediaElement::setMediaKeys):
* html/HTMLMediaElement.h:
* html/HTMLMediaElement.idl:
* html/MediaEncryptedEvent.cpp: Added.
(WebCore::MediaEncryptedEvent::MediaEncryptedEvent):
(WebCore::MediaEncryptedEvent::eventInterface):
(WebCore::MediaEncryptedEvent::initDataType):
(WebCore::MediaEncryptedEvent::initData):
* html/MediaEncryptedEvent.h: Added.
* html/MediaEncryptedEvent.idl: Added.
* html/MediaEncryptedEventInit.h: Added.
(WebCore::MediaEncryptedEventInit::MediaEncryptedEventInit):
2016-11-10 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Media Controller: update controls based on fullscreen playback on macOS
https://bugs.webkit.org/show_bug.cgi?id=164554
<rdar://problem/29183439>
Reviewed by Dean Jackson.
When toggling fullscreen on macOS, toggle between MacOSInlineMediaControls and MacOSFullscreenMediaControls.
To facilitate this, support objects are created and destroyed when changing the controls in order for the
right control objects to be hooked up to the media controller. A new destroy() method on MediaControllerSupport
subclasses can be overridden to remove event listeners added by support objects in their constructor.
Test: media/modern-media-controls/media-controller/media-controller-fullscreen-change.html
* Modules/modern-media-controls/media/fullscreen-support.js:
(FullscreenSupport.prototype.destroy):
* Modules/modern-media-controls/media/media-controller-support.js:
(MediaControllerSupport.prototype.destroy):
* Modules/modern-media-controls/media/media-controller.js:
(MediaController):
(MediaController.prototype.get layoutTraits):
(MediaController.prototype.handleEvent):
(MediaController.prototype._updateControlsIfNeeded):
(MediaController.prototype._controlsClass):
2016-11-10 Carlos Garcia Campos <cgarcia@igalia.com>
[Linux] Memory values shown by memory pressure handler logger are not useful
https://bugs.webkit.org/show_bug.cgi?id=164589
Reviewed by Michael Catanzaro.
We are currently using the VmSize field from /proc/self/status which is the virtual memory size of the process
and doesn't normally change even when the memory pressure handler manages to release memory. So, most of the
time we see that there's no changes in memory usage in the logs.
We should use the actual memory used by the process, memory that the process can release and then it's relevant
for the memory pressure handler. Using other fields from /proc/self/status we could do something like VmRSS -
(RssFile + RssShme), but there's also /proc/self/statm that provides the same information in a single. The main
different is that statm provides both resident and shared memory directly, but in number of pages, so we need to
multiply by the size of the page.
This patch adds a method to parse /proc/self/statm in its given file, because I plan to use this for the linux
memory sampler that is incorrectly parsing /proc/self/statm.
* platform/Linux.cmake: Add new files to compilation.
* platform/linux/CurrentProcessMemoryStatus.cpp: Added.
(WebCore::systemPageSize): Return the page size.
(WebCore::currentProcessMemoryStatus): Parse /proc/self/statm and fill the given ProcessMemoryStatus.
* platform/linux/CurrentProcessMemoryStatus.h: Added.
* platform/linux/MemoryPressureHandlerLinux.cpp:
(WebCore::MemoryPressureHandler::processMemoryUsage(): Helper function to return the memory used by the process
in bytes.
(WebCore::MemoryPressureHandler::ReliefLogger::platformMemoryUsage): Use processMemoryUsage().
2016-10-14 Carlos Garcia Campos <cgarcia@igalia.com>
MemoryPressureHandler shouldn't know how to release WebCore memory
https://bugs.webkit.org/show_bug.cgi?id=160497
Reviewed by Michael Catanzaro.
All processes should set their own low memory handler, instead of leaving the web process using the default one
that needs to access APIs that are not in platform layer. This patch fixes all the layering violations in the
MemoryPressureHandler. Since the default implementation, that releases the WebCore memory, is shared by the
WebProcess in WebKit2 and WebKit1 ports, it has been moved to its own file to the WebCore layer.
* CMakeLists.txt: Add new files to compilation.
* PlatformMac.cmake: Ditto.
* WebCore.xcodeproj/project.pbxproj: Ditto.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::commitProvisionalLoad): Use WebCore::jettisonExpensiveObjectsOnTopLevelNavigation().
* page/MemoryRelease.cpp: Added.
(WebCore::releaseNoncriticalMemory):
(WebCore::releaseCriticalMemory):
(WebCore::releaseMemory):
(WebCore::platformReleaseMemory):
(WebCore::jettisonExpensiveObjectsOnTopLevelNavigation):
(WebCore::registerMemoryReleaseNotifyCallbacks):
* page/MemoryRelease.h: Added.
* page/cocoa/MemoryReleaseCocoa.mm: Added.
(WebCore::platformReleaseMemory):
(WebCore::jettisonExpensiveObjectsOnTopLevelNavigation):
(WebCore::registerMemoryReleaseNotifyCallbacks):
* platform/MemoryPressureHandler.cpp:
(WebCore::MemoryPressureHandler::MemoryPressureHandler):
(WebCore::MemoryPressureHandler::beginSimulatedMemoryPressure):
(WebCore::MemoryPressureHandler::releaseMemory): Use the current handler if it has been set.
(WebCore::MemoryPressureHandler::platformReleaseMemory): Deleted.
* platform/MemoryPressureHandler.h:
(WebCore::MemoryPressureHandler::setLowMemoryHandler):
(WebCore::MemoryPressureHandler::m_releaseMemoryBlock):
* platform/cocoa/MemoryPressureHandlerCocoa.mm:
(WebCore::MemoryPressureHandler::respondToMemoryPressure): Call releaseMemory() instead of using the handler directly.
(WebCore::MemoryPressureHandler::platformReleaseMemory): Deleted.
* platform/linux/MemoryPressureHandlerLinux.cpp:
* platform/win/MemoryPressureHandlerWin.cpp:
(WebCore::MemoryPressureHandler::respondToMemoryPressure): Call releaseMemory() instead of using the handler directly.
2016-11-08 Sergio Villar Senin <svillar@igalia.com>
[css-grid] Fix fr tracks sizing under min|max-size constraints
https://bugs.webkit.org/show_bug.cgi?id=150674
Reviewed by Darin Adler.
The min|max-sizes must be used to compute the flex fraction for indefinite free
spaces. According to the spec "If using this flex fraction would cause the grid to be
smaller than the grid container’s min-width/height (or larger than the grid container’s
max-width/height), then redo this step, treating the free space as definite and the
available grid space as equal to the grid container’s content box size when it’s sized to
its min-width/height (max-width/height)."
This only affects indefinite heights because during layout both definite sizes and any kind
of widths are properly constrained by min|max-width restrictions.
Tests: fast/css-grid-layout/flex-sizing-columns-min-max-width.html
fast/css-grid-layout/flex-sizing-rows-min-max-height.html
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::computeUsedBreadthOfGridTracks):
(WebCore::RenderGrid::computeFlexSizedTracksGrowth):
* rendering/RenderGrid.h:
2016-11-10 Alejandro G. Castro <alex@igalia.com>
[WebRTC] [OpenWebRTC] RTX default parameters broken after r207952
https://bugs.webkit.org/show_bug.cgi?id=164541
Reviewed by Philippe Normand.
Fixed typo in refactoring.
* platform/mediastream/openwebrtc/MediaEndpointOwr.cpp:
(WebCore::MediaEndpointOwr::getDefaultVideoPayloads):
2016-11-08 Philippe Normand <pnormand@igalia.com>
[WebRTC] white-list turns urls from the RTCConfiguration
https://bugs.webkit.org/show_bug.cgi?id=164506
Reviewed by Alejandro G. Castro.
* Modules/mediastream/RTCConfiguration.cpp:
(WebCore::validateIceServerURL): Add the turns URL scheme to the
list of supported relay and signaling server protocols.
2016-11-09 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: DebuggerManager.Event.Resumed introduces test flakiness
https://bugs.webkit.org/show_bug.cgi?id=161951
<rdar://problem/28295767>
Reviewed by Brian Burg.
Covered by existing tests that would ASSERT otherwise.
* inspector/InspectorClient.cpp:
(WebCore::InspectorClient::doDispatchMessageOnFrontendPage):
When paused on an exception in the inspected page and evaluating
commands in the inspector frontend page (which evaluates JavaScript)
we ASSERT when entering the Global DOM VM with an existing exception.
This makes it so when we evaluate JavaScript in the frontend we
suspend / ignore the state of the VM for the inspected page, and
restore it when we return from the inspector.
2016-11-09 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Associate Worker Resources with the Worker and not the Page
https://bugs.webkit.org/show_bug.cgi?id=164342
<rdar://problem/29075775>
Reviewed by Timothy Hatcher.
Test: inspector/worker/resources-in-worker.html
Provide a way to associate an initiator identifier with a ResourceRequest.
This will allow Web Inspector to identify who started particular resource
loads. This is important to associate Worker(...), importScript(...), and
XMLHttpRequest / Fetch loads with that specific Worker.
* platform/network/ResourceRequestBase.cpp:
(WebCore::ResourceRequestBase::setAsIsolatedCopy):
* platform/network/ResourceRequestBase.h:
(WebCore::ResourceRequestBase::initiatorIdentifier):
(WebCore::ResourceRequestBase::setInitiatorIdentifier):
Optional initiator identifier. Currently used only be Web Inspector.
* dom/ScriptExecutionContext.h:
(WebCore::ScriptExecutionContext::resourceRequestIdentifier):
Non-page execution contexts, like WorkerGlobalScope, should provide
a unique identifier that may be used to distinguish loads initiated
from within that context.
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::createRequest):
* Modules/fetch/FetchLoader.cpp:
(WebCore::FetchLoader::start):
* Modules/fetch/FetchRequest.cpp:
(WebCore::FetchRequest::initializeWith):
XHR / Fetch loads should include the ScriptExecutionContext's
initiator identifier.
* workers/WorkerScriptLoader.cpp:
(WebCore::WorkerScriptLoader::WorkerScriptLoader):
(WebCore::WorkerScriptLoader::loadSynchronously):
(WebCore::WorkerScriptLoader::loadAsynchronously):
(WebCore::WorkerScriptLoader::createResourceRequest):
* workers/WorkerScriptLoader.h:
Provide a way to provide initiator identifier information for
Worker script loads. Currently this is `new Worker(...)` and
`importScripts(...)` resource loads.
* workers/Worker.cpp:
(WebCore::Worker::Worker):
(WebCore::Worker::create):
* workers/Worker.h:
* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::WorkerGlobalScope):
(WebCore::WorkerGlobalScope::importScripts):
* workers/WorkerGlobalScope.h:
Give Worker itself the unique identifier, because `new Worker(...)`
loads happen before the WorkerGlobalScript (ScriptExecutionContext)
is actually created, but we want to associate it with this Worker.
* workers/DedicatedWorkerGlobalScope.cpp:
(WebCore::DedicatedWorkerGlobalScope::create):
(WebCore::DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope):
* workers/DedicatedWorkerGlobalScope.h:
* workers/DedicatedWorkerThread.cpp:
(WebCore::DedicatedWorkerThread::DedicatedWorkerThread):
(WebCore::DedicatedWorkerThread::createWorkerGlobalScope):
* workers/DedicatedWorkerThread.h:
* workers/WorkerInspectorProxy.cpp:
(WebCore::WorkerInspectorProxy::WorkerInspectorProxy):
* workers/WorkerInspectorProxy.h:
* workers/WorkerMessagingProxy.cpp:
(WebCore::WorkerMessagingProxy::WorkerMessagingProxy):
(WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
* workers/WorkerThread.cpp:
(WebCore::WorkerThreadStartupData::WorkerThreadStartupData):
(WebCore::WorkerThread::WorkerThread):
(WebCore::WorkerThread::workerThread):
* workers/WorkerThread.h:
Pass the MainThread's Worker identifier through to the WorkerGlobalScope
created on the WorkerThread. They should be the same identifier.
* inspector/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::willSendRequest):
* inspector/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::buildObjectForFrameTree):
Pass the initiator identifier data to the frontend. This identifier is
equivalent to a "target identifier" in the frontend. Currently the only
non-Page targets are Workers.
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::shouldContinueAfterNotifyingLoadedFromMemoryCache):
When using the memory cache we create a new resource request. Be sure
to copy over useful inspector data, like the initiator identifier,
from the original request.
* platform/network/cf/ResourceRequestCFNet.cpp:
(WebCore::ResourceRequest::updateFromDelegatePreservingOldProperties):
When rebuilding a ResourceRequest from NSURLRequest, copy over the
initiator identifier property that wouldn't otherwise have survived
the transition.
2016-11-09 Brady Eidson <beidson@apple.com>
IndexedDB 2.0: Clean up some exception ordering.
https://bugs.webkit.org/show_bug.cgi?id=164566
Reviewed by Alex Christensen.
No new tests (Covered by existing tests).
* Modules/indexeddb/IDBCursor.cpp:
(WebCore::IDBCursor::advance):
(WebCore::IDBCursor::continueFunction):
* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::createIndex):
2016-11-09 Alex Christensen <achristensen@webkit.org>
Unreviewed, rolling out r208438.
crashes
Reverted changeset:
"[WK2][NETWORK_SESSION] Add support for downloading file
backed blobs"
https://bugs.webkit.org/show_bug.cgi?id=164458
http://trac.webkit.org/changeset/208438
2016-11-09 Said Abou-Hallawa <sabouhallawa@apple.com>
Change the decoding for some animated images to be asynchronous
https://bugs.webkit.org/show_bug.cgi?id=161566
Reviewed by Simon Fraser.
Tests: fast/images/slower-animation-than-decoding-image.html
fast/images/slower-decoding-than-animation-image.html
fast/images/stopped-animation-deleted-image.html
Request the next frame before firing the animation timer. The asynchronous
image decoding work queue notifies the BitmapImage when the frame finishes
decoding. If the timer fires before the frame is decoded, no repaint will
be requested. Only when the image frame is ready, the animation will be
advanced and the image will be repainted.
* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::load): Cache the image settings in CachedImage.
(WebCore::CachedImage::createImage): No need to pass allowSubsampling to BitmapImage. It can be retrieved through Image::imageObserver().
(WebCore::CachedImage::changedInRect): Change the parameter to notifyObservers() to be a pointer.
* loader/cache/CachedImage.h: Cache the settings: allowSubsampling, allowAsyncImageDecoding and showDebugBackground through m_loader.
* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::dataChanged): Fix a logging message.
(WebCore::BitmapImage::draw): Store the current SubsamplingLevel to be used when requesting decoding the image of the next frame.
Draw a debug rectangle if the next frame is missed because it is being decoded and the setting showDebugBackground is on.
(WebCore::BitmapImage::startAnimation): Deleted. Moved to the header file.
(WebCore::BitmapImage::internalStartAnimation): Added. Request asynchronous image decoding for the next frame if required. Return the
result of starting the animation.
(WebCore::BitmapImage::advanceAnimation): Call internalAdvanceAnimation() if the frame image is not being decoded. If it is being decoded
and the setting showDebugBackground is on, force repaint so the debug rectangle is drawn.
(WebCore::BitmapImage::internalAdvanceAnimation): This is the old body of advanceAnimation().
(WebCore::BitmapImage::stopAnimation): Stop the asynchronous image decoding if it is started.
(WebCore::BitmapImage::newFrameNativeImageAvailableAtIndex): This function is called from the async image decoding work queue when finishing decoding a native image frame.
* platform/graphics/BitmapImage.h:
(WebCore::BitmapImage::startAnimation): Added. It is now calls internalStartAnimation().
* platform/graphics/Color.h: Define a constant for the yellow color.
* platform/graphics/ImageFrameCache.cpp:
(WebCore::ImageFrameCache::clearMetadata): Delete unreferenced member.
(WebCore::ImageFrameCache::requestFrameAsyncDecodingAtIndex): Return true if the frame is requested for async decoding.
* platform/graphics/ImageFrameCache.h:
* platform/graphics/ImageObserver.h: Add virtual functions for allowSubsampling, allowAsyncImageDecoding and showDebugBackground.
* platform/graphics/ImageSource.cpp:
(WebCore::ImageSource::maximumSubsamplingLevel): Move checking allowSubsampling() to the caller BitmapImage::draw().
* platform/graphics/ImageSource.h: Remove the setting allowSubsampling(); it can be retrieved from imageObserver().
(WebCore::ImageSource::setAllowSubsampling): Deleted.
* rendering/RenderImageResource.cpp:
(WebCore::RenderImageResource::shutdown): Stop the animation of an image when shutting down the resource.
* rendering/RenderImageResourceStyleImage.cpp:
(WebCore::RenderImageResourceStyleImage::shutdown): Ditto.
svg/graphics/SVGImageClients.h: Change the parameter to ImageObserver::changedInRect() to be a pointer.
(WebCore::SVGImageChromeClient::invalidateContentsAndRootView):
* testing/Internals.cpp:
(WebCore::Internals::setImageFrameDecodingDuration): Sets a fixed frame decoding duration for testing.
* testing/Internals.h:
* testing/Internals.idl: Adds an internal option for ImageFrameDecodingDuration.
2016-11-04 Brent Fulgham <bfulgham@apple.com>
Local HTML should be blocked from localStorage access unless "Disable Local File Restrictions" is checked
https://bugs.webkit.org/show_bug.cgi?id=155185
<rdar://problem/11101440>
Reviewed by Brady Eidson.
Add a new quirk for localStorage that defaults to 'on'. When active, this quirk says that
localStorage access should be granted, without needing to grant universal file access.
If the quirk is turned off, then localStorage is blocked unless the WebKit client explicitly
grants universal file access.
Tests: storage/domstorage/localstorage/blocked-file-access-permitted-by-quirk.html
storage/domstorage/localstorage/blocked-file-access.html
* dom/Document.cpp:
(WebCore::Document::initSecurityContext): Set localStorage quirk mode based on settings.
* page/SecurityOrigin.cpp:
(WebCore::SecurityOrigin::SecurityOrigin): Use more C++11 initializers.
(WebCore::SecurityOrigin::canAccessStorage): If the origin is a local file, and we are NOT in
localStorage quirks mode, and we have not been granted universal file access, prevent access
to DOM localStorage.
(WebCore::SecurityOrigin::setNeedsLocalStorageQuirk): Added.
* page/SecurityOrigin.h:
(WebCore::SecurityOrigin::needsLocalStorageQuirk): Added.
* page/Settings.in:
* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::WorkerGlobalScope): Make sure Workers know what the
localStorage quirks mode is set to.
2016-11-09 Alex Christensen <achristensen@webkit.org>
URLParser should not consider path of URLs with no host to start at the first slash after the colon
https://bugs.webkit.org/show_bug.cgi?id=164555
Reviewed by Tim Horton.
When we see a url that is only scheme:// we treated the // as the path. Firefox did this with unrecognized schemes,
but based on https://github.com/whatwg/url/issues/148 they seem willing to change. We had added similar behavior to
URL::parse, and I added this to URLParser in r206783 which this effectively reverts.
Covered by API and layout tests.
* platform/URLParser.cpp:
(WebCore::URLParser::parse):
Don't move m_userStart to m_pathStart back by two when we see an empty host.
2016-11-09 Alex Christensen <achristensen@webkit.org>
Simplify logic of SecurityOrigin::databaseIdentifier
https://bugs.webkit.org/show_bug.cgi?id=164565
Reviewed by Brady Eidson.
No change in behavior.
SecurityOrigins with the file scheme need a special database identifier to be backwards-compatible with existing storage.
Instead of determining whether this is a file SecurityOrigin at parsing time and only using that information when
making the database identifier, just determine whether we need this quirk when making the database identifier.
I'm planning to move this logic to SecurityOriginData in another patch.
* page/SecurityOrigin.cpp:
(WebCore::SecurityOrigin::SecurityOrigin):
(WebCore::SecurityOrigin::create):
(WebCore::SecurityOrigin::databaseIdentifier):
* page/SecurityOrigin.h:
2016-11-09 Jaehun Lim <ljaehun.lim@samsung.com>
Unreviewed, build fix after r208460
isValidColorString() was renamed isValidSimpleColorString().
* html/ColorInputType.cpp:
(WebCore::ColorInputType::suggestions):
2016-11-09 Anders Carlsson <andersca@apple.com>
Fix STP build.
* WebCorePrefix.h:
2016-11-09 Simon Fraser <simon.fraser@apple.com>
Implement visual-viewport based position:fixed handling for Mac async scrolling
https://bugs.webkit.org/show_bug.cgi?id=164495
Reviewed by Tim Horton.
Educate the scrolling tree about visual and layout viewports. This is runtime-switchable,
so we push the enable flag to via the root state node, then push the layout viewport,
and the min/max scroll position that contstrain it, through frame state nodes.
When a scroll happens, we compute a new layout viewport when the visual viewport hits
an edge, and push that down through setScrollLayerPosition() since it's used to position
fixed and sticky layers.
When the main thread gets notified about an async scroll, we set the new layout viewport
on the FrameView, but do so in such a way that does not trigger layout. This is OK because
we do a RenderLayer update which udpates all the layoutViewport-dependent state, and is
necessary to avoid repaints every main thread update.
The iOS code is made to compile, but not work yet.
Tests: compositing/tiling/visiblerect-accumulated-offset.html
fast/visual-viewport/tiled-drawing/zoomed-fixed-scrolled-down-then-up.html
fast/visual-viewport/tiled-drawing/zoomed-fixed-scrolled-down.html
fast/visual-viewport/tiled-drawing/zoomed-fixed-scrolling-layers-state.html
* page/FrameView.cpp:
(WebCore::FrameView::setLayoutViewportOrigin):
(WebCore::FrameView::updateLayoutViewport):
(WebCore::FrameView::visualViewportRect):
(WebCore::FrameView::unscaledMinimumScrollPosition):
(WebCore::FrameView::scrollPositionChanged):
* page/FrameView.h:
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
(WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate):
(WebCore::AsyncScrollingCoordinator::scheduleUpdateScrollPositionAfterAsyncScroll):
(WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScrollTimerFired):
(WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
(WebCore::AsyncScrollingCoordinator::visualViewportEnabled):
* page/scrolling/AsyncScrollingCoordinator.h:
(WebCore::AsyncScrollingCoordinator::ScheduledScrollUpdate::ScheduledScrollUpdate):
* page/scrolling/ScrollingStateFrameScrollingNode.cpp:
(WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
(WebCore::ScrollingStateFrameScrollingNode::setLayoutViewport):
(WebCore::ScrollingStateFrameScrollingNode::setMinLayoutViewportOrigin):
(WebCore::ScrollingStateFrameScrollingNode::setMaxLayoutViewportOrigin):
(WebCore::ScrollingStateFrameScrollingNode::setVisualViewportEnabled):
(WebCore::ScrollingStateFrameScrollingNode::dumpProperties):
* page/scrolling/ScrollingStateFrameScrollingNode.h:
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::viewportChangedViaDelegatedScrolling):
(WebCore::ScrollingTree::scrollPositionChangedViaDelegatedScrolling):
(WebCore::ScrollingTree::commitTreeState):
* page/scrolling/ScrollingTree.h:
(WebCore::ScrollingTree::visualViewportEnabled):
(WebCore::ScrollingTree::setVisualViewportEnabled):
* page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
(WebCore::ScrollingTreeFrameScrollingNode::commitStateBeforeChildren):
(WebCore::ScrollingTreeFrameScrollingNode::layoutViewportForScrollPosition):
* page/scrolling/ScrollingTreeFrameScrollingNode.h:
(WebCore::ScrollingTreeFrameScrollingNode::layoutViewport):
(WebCore::ScrollingTreeFrameScrollingNode::minLayoutViewportOrigin):
(WebCore::ScrollingTreeFrameScrollingNode::maxLayoutViewportOrigin):
* page/scrolling/ScrollingTreeScrollingNode.cpp:
(WebCore::ScrollingTreeScrollingNode::setScrollPositionWithoutContentEdgeConstraints):
* page/scrolling/ScrollingTreeScrollingNode.h:
* page/scrolling/ThreadedScrollingTree.cpp:
(WebCore::ThreadedScrollingTree::scrollingTreeNodeDidScroll):
* page/scrolling/ThreadedScrollingTree.h:
* page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h:
* page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm:
(WebCore::ScrollingTreeFrameScrollingNodeIOS::setScrollPositionWithoutContentEdgeConstraints):
(WebCore::ScrollingTreeFrameScrollingNodeIOS::setScrollLayerPosition):
* page/scrolling/ios/ScrollingTreeIOS.cpp:
(WebCore::ScrollingTreeIOS::scrollingTreeNodeDidScroll):
* page/scrolling/ios/ScrollingTreeIOS.h:
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
(WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPositionWithoutContentEdgeConstraints):
(WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollLayerPosition):
2016-11-09 Brady Eidson <beidson@apple.com>
IndexedDB 2.0: W3C test IndexedDB/idbtransaction_objectStoreNames.html fails.
https://bugs.webkit.org/show_bug.cgi?id=164528
Reviewed by Alex Christensen.
No new tests (Covered by existing test).
* Modules/indexeddb/IDBDatabase.cpp:
(WebCore::IDBDatabase::transaction): De-dupe the input names.
2016-11-09 Brady Eidson <beidson@apple.com>
IndexedDB 2.0: Implement new IDBCursor.continuePrimaryKey function.
https://bugs.webkit.org/show_bug.cgi?id=164404
Reviewed by Alex Christensen.
Tests: storage/indexeddb/modern/idbcursor-continue-primary-key-1-private.html
storage/indexeddb/modern/idbcursor-continue-primary-key-1.html
Also covered by existing tests.
* Modules/indexeddb/IDBCursor.cpp:
(WebCore::IDBCursor::continuePrimaryKey):
(WebCore::IDBCursor::uncheckedIterateCursor):
* Modules/indexeddb/IDBCursor.h:
* Modules/indexeddb/IDBCursor.idl:
* Modules/indexeddb/IDBKeyData.h:
(WebCore::IDBKeyData::operator>):
(WebCore::IDBKeyData::operator<=):
(WebCore::IDBKeyData::operator>=):
* Modules/indexeddb/server/MemoryCursor.h:
* Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
(WebCore::IDBServer::MemoryIDBBackingStore::iterateCursor):
* Modules/indexeddb/server/MemoryIndexCursor.cpp:
(WebCore::IDBServer::MemoryIndexCursor::iterate):
* Modules/indexeddb/server/MemoryIndexCursor.h:
* Modules/indexeddb/server/MemoryObjectStoreCursor.cpp:
(WebCore::IDBServer::MemoryObjectStoreCursor::iterate):
* Modules/indexeddb/server/MemoryObjectStoreCursor.h:
* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::iterateCursor):
* Modules/indexeddb/server/SQLiteIDBCursor.cpp:
(WebCore::IDBServer::SQLiteIDBCursor::iterate):
* Modules/indexeddb/server/SQLiteIDBCursor.h:
* Modules/indexeddb/shared/IDBIterateCursorData.cpp:
(WebCore::IDBIterateCursorData::isolatedCopy):
* Modules/indexeddb/shared/IDBIterateCursorData.h:
(WebCore::IDBIterateCursorData::encode):
(WebCore::IDBIterateCursorData::decode):
2016-11-09 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Media Controller: set status label according to media state
https://bugs.webkit.org/show_bug.cgi?id=164557
<rdar://problem/29184097>
Reviewed by Dean Jackson.
Correctly set the StatusLabel text based on the media loading and network state.
Tests: http/tests/media/modern-media-controls/status-support/status-support-live-broadcast.html
http/tests/media/modern-media-controls/status-support/status-support-loading.html
media/modern-media-controls/status-support/status-support-error.html
* Modules/modern-media-controls/js-files:
* Modules/modern-media-controls/media/media-controller.js:
(MediaController):
* Modules/modern-media-controls/media/status-support.js: Added.
(StatusSupport.prototype.get control):
(StatusSupport.prototype.get mediaEvents):
(StatusSupport.prototype.syncControl):
(StatusSupport):
* WebCore.xcodeproj/project.pbxproj:
2016-11-09 Zalan Bujtas <zalan@apple.com>
No need to set setFlowThreadState on RenderText in createTextRenderer.
https://bugs.webkit.org/show_bug.cgi?id=164559
Reviewed by Antti Koivisto.
setFlowThreadState in create*Renderer ensures that by the time we issue the initial call to
styleWillChange/styleDidChange through initializeStyle, the state is already set.
However since RenderText does not have its own style, it's sufficient to have the flow state set
through the normal RenderElement::insertChildInternal code path.
No change in functionality.
* style/RenderTreeUpdater.cpp:
(WebCore::createTextRenderer):
2016-11-09 Brady Eidson <beidson@apple.com>
IndexedDB 2.0: Encapsulate cursor iteration parameters for easy future expansion.
https://bugs.webkit.org/show_bug.cgi?id=164504
Reviewed by Darin Adler.
No new tests (Refactor, no behavior change).
This patch literally just takes the "key" and "count" arguments and encapsulates them in a struct.
That struct will then be easily expandable in the future (e.g. bug 164404).
* Modules/indexeddb/IDBCursor.cpp:
(WebCore::IDBCursor::uncheckedIterateCursor):
* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::iterateCursor):
(WebCore::IDBTransaction::iterateCursorOnServer):
* Modules/indexeddb/IDBTransaction.h:
* Modules/indexeddb/client/IDBConnectionProxy.cpp:
(WebCore::IDBClient::IDBConnectionProxy::iterateCursor):
* Modules/indexeddb/client/IDBConnectionProxy.h:
* Modules/indexeddb/client/IDBConnectionToServer.cpp:
(WebCore::IDBClient::IDBConnectionToServer::iterateCursor):
* Modules/indexeddb/client/IDBConnectionToServer.h:
* Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
* Modules/indexeddb/server/IDBBackingStore.h:
* Modules/indexeddb/server/IDBServer.cpp:
(WebCore::IDBServer::IDBServer::iterateCursor):
* Modules/indexeddb/server/IDBServer.h:
* Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
(WebCore::IDBServer::MemoryIDBBackingStore::iterateCursor):
* Modules/indexeddb/server/MemoryIDBBackingStore.h:
* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::iterateCursor):
* Modules/indexeddb/server/SQLiteIDBBackingStore.h:
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::iterateCursor):
(WebCore::IDBServer::UniqueIDBDatabase::performIterateCursor):
* Modules/indexeddb/server/UniqueIDBDatabase.h:
* Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::iterateCursor):
* Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:
* Modules/indexeddb/shared/IDBIterateCursorData.cpp: Added.
(WebCore::IDBIterateCursorData::isolatedCopy):
* Modules/indexeddb/shared/IDBIterateCursorData.h: Added.
(WebCore::IDBIterateCursorData::encode):
(WebCore::IDBIterateCursorData::decode):
* Modules/indexeddb/shared/InProcessIDBServer.cpp:
(WebCore::InProcessIDBServer::iterateCursor):
* Modules/indexeddb/shared/InProcessIDBServer.h:
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
2016-11-09 Ryosuke Niwa <rniwa@webkit.org>
StyledElement::attributeChanged shouldn't do any work when the attribute value didn't change
https://bugs.webkit.org/show_bug.cgi?id=129476
Reviewed by Andreas Kling.
Avoid calling styleAttributeChanged and setPresentationAttributeStyleIsDirty
when the attribute value didn't change as in r164856.
* dom/StyledElement.cpp:
(WebCore::StyledElement::attributeChanged):
2016-11-09 Yusuke Suzuki <utatane.tea@gmail.com>
[DOMJIT] Implement Node::ownerDocument
https://bugs.webkit.org/show_bug.cgi?id=164004
Reviewed by Darin Adler.
Test: js/dom/domjit-accessor-owner-document.html
Still I cannot reproduce this crash in x64 environment, according to the crash log, it accesses 0x8 address.
This can happen if document() accidentally returns nullptr. In the C++ ownerDocument implementation,
if document() returns nullptr, it just returns nullptr. But in the DOMJIT implementation, we assume that
document() won't return nullptr and access the member of it.
This patch aligns the DOMJIT implementation strictly to the C++ one.
* dom/Node.idl:
* domjit/JSNodeDOMJIT.cpp:
(WebCore::NodeOwnerDocumentDOMJIT::checkDOM):
(WebCore::NodeOwnerDocumentDOMJIT::callDOMGetter):
2016-11-09 Sam Weinig <sam@webkit.org>
[SVG] Start moving special casing of SVG out of the bindings - SVGAngle
https://bugs.webkit.org/show_bug.cgi?id=164496
Reviewed by Darin Adler.
There is quite a bit of special casing of SVG types in the bindings that adds
a lot of complexity and is relatively fragile, as it is based on type naming.
Instead of keeping the complexity in the bindings, I am going to move it into
the implementation, where it has also longed to be.
Starting small, with just SVGAngle. It has been split in two, with the existing
SVGAngle being renamed SVGAngleValue, and the bound instance, which used to be name
SVGPropertyTearOff<SVGAngle>, taking the name SVGAngle (and inheriting from
SVGPropertyTearOff<SVGAngleValue>).
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
Add SVGAngleValue.cpp
* bindings/scripts/CodeGenerator.pm:
Remove SVGAngle as a special case.
* svg/SVGAngle.cpp: Removed.
* svg/SVGAngle.h:
Added. Implements the SVGAngle interface explicitly, getting to
the SVGAngleValue through propertyReference().
* svg/SVGAngle.idl:
* svg/SVGAngleValue.cpp: Copied from Source/WebCore/svg/SVGAngle.cpp.
* svg/SVGAngleValue.h: Copied from Source/WebCore/svg/SVGAngle.h.
Move old SVGAngle implementation to SVGAngleValue.
* svg/SVGAnimatedAngle.cpp:
Replace SVGAngle usage with SVGAngleValue.
* svg/SVGAnimatedAngle.h:
Switch SVGAnimatedAngle to be a type alias. This remains SVGAnimatedPropertyTearOff<SVGAngle>
as SVGAnimatedPropertyTearOff has been changed to take the TearOff type as its parameter.
* svg/SVGAnimatedLength.h:
* svg/SVGAnimatedPreserveAspectRatio.h:
* svg/SVGAnimatedRect.h:
Switch to using type aliases and pass the TearOff to SVGAnimatedPropertyTearOff.
* svg/SVGAnimatedType.cpp:
(WebCore::SVGAnimatedType::createAngleAndEnumeration):
* svg/SVGAnimatedType.h:
(WebCore::SVGAnimatedType::angleAndEnumeration):
Use SVGAngleValue.
* svg/SVGComponentTransferFunctionElement.h:
Add missing include of SVGElement.h (need because it removed from SVGPropertyTearOff).
* svg/SVGMarkerElement.cpp:
(WebCore::SVGMarkerElement::parseAttribute):
(WebCore::SVGMarkerElement::setOrient):
Switch to take an SVGAngleValue.
(WebCore::SVGMarkerElement::setOrientToAngle):
Update to pull the value out via propertyReference().
* svg/SVGMarkerElement.h:
Switch to take an SVGAngleValue.
* svg/SVGLengthList.h:
* svg/SVGNumberList.h:
* svg/SVGPathSegList.h:
* svg/SVGPointList.h:
* svg/SVGStringList.h:
* svg/SVGTransformList.h:
Switch to using type aliases in SVGPropertyTraits and add an alias for
ListItemTearOff.
* svg/SVGSVGElement.cpp:
(WebCore::SVGSVGElement::createSVGAngle):
* svg/SVGSVGElement.h:
Change createSVGAngle to return a Ref<SVGAngle> and create one.
* svg/SVGSVGElement.idl:
Annotate IDL to indicate that a new value is being returned.
* svg/SVGTransform.cpp:
Remove unnecessary include of SVGAngle.h.
* svg/SVGViewSpec.cpp:
Add missing include of SVGElement.h (need because it removed from SVGPropertyTearOff).
* svg/properties/SVGAnimatedPropertyTearOff.h:
Change to be parameterized on the TearOffType, rather than the PropertyType itself. Get the
Property type from the TearOffType.
* svg/properties/SVGListProperty.h:
* svg/properties/SVGListPropertyTearOff.h:
Fix assumption that all TearOffTypes are just a SVGPropertyTearOff templatized on a property
type. This is no longer true for SVGAngle. Instead, get the TearOffType for lists via SVGPropertyTraits.
* svg/properties/SVGPropertyTearOff.h:
Make the PropertyType available by exposing it as a type alias.
2016-11-09 Darin Adler <darin@apple.com>
Move Range from ExceptionCode to ExceptionOr
https://bugs.webkit.org/show_bug.cgi?id=164457
Reviewed by Alex Christensen.
* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::rangeForNodeContents): Update to use ExceptionOr,
keeping behavior the same.
(WebCore::characterOffsetsInOrder): Ditto.
(WebCore::setRangeStartOrEndWithCharacterOffset): Changed argument to a
reference instead of a pointer. Use a boolean return value to indicate
success rather than an exception, since the callers don't need to know
which exception it is.
(WebCore::AXObjectCache::rangeForUnorderedCharacterOffsets): Updated for
the above.
(WebCore::AXObjectCache::nextBoundary): Ditto.
(WebCore::AXObjectCache::previousBoundary): Ditto.
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::rangeOfStringClosestToRangeInDirection):
Update to use ExceptionOr, keeping behavior the same.
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::documentBasedSelectedTextRange): Ditto.
* accessibility/atk/WebKitAccessibleUtil.cpp:
(selectionBelongsToObject): Ditto.
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper _convertToNSRange:]): Ditto.
* dom/Node.cpp:
(WebCore::Node::textRects): Ditto.
* dom/Range.cpp:
(WebCore::Range::~Range): Remove old comment that no longer makes sense now
that the detach function no longer does anything.
(WebCore::checkForDifferentRootContainer): Updated to use ExceptionOr,
keeping behavior the same.
(WebCore::Range::setStart): Ditto.
(WebCore::Range::setEnd): Ditto.
(WebCore::Range::isPointInRange): Ditto.
(WebCore::Range::comparePoint): Ditto.
(WebCore::Range::compareNode): Ditto.
(WebCore::top): Added helper function so that compareBoundaryPoints doesn't
need to have two identical loops in it.
(WebCore::Range::compareBoundaryPoints): Updated to use ExceptionOr,
keeping behavior the same.
(WebCore::Range::compareBoundaryPointsForBindings): Ditto. Also use a switch
instead of relying on the order of the values to check for unsupported values.
(WebCore::Range::boundaryPointsValid): Ditto.
(WebCore::Range::deleteContents): Ditto.
(WebCore::Range::intersectsNode): Ditto.
(WebCore::Range::processContents): Ditto.
(WebCore::deleteCharacterData): Ditto.
(WebCore::processContentsBetweenOffsets): Ditto. Also changed to be a
non-member function and private to this file instead of in the class.
(WebCore::processNodes): Ditto. Also changed one argument to be a RefPtr
since the code relies on using it after mutating the DOM.
(WebCore::processAncestorsAndTheirSiblings): Ditto. Changed one argument type
to use ExceptionOr so the caller doesn't have to check the exception first.
(WebCore::Range::extractContents): Ditto.
(WebCore::Range::cloneContents): Ditto.
(WebCore::Range::insertNode): Ditto. Also fixed to only call nodeType once
instead of three times.
(WebCore::Range::toString): Ditto. Also fixed to call nodeType only once
per node instead of twice, to use downcast instead of static_cast, and to
use the word "node" instead of "n" for the local variable name.
(WebCore::Range::createContextualFragment): Ditto.
(WebCore::Range::checkNodeWOffset): Ditto.
(WebCore::Range::setStartAfter): Ditto.
(WebCore::Range::setEndBefore): Ditto.
(WebCore::Range::setEndAfter): Ditto.
(WebCore::Range::selectNode): Ditto.
(WebCore::Range::selectNodeContents): Ditto.
(WebCore::Range::surroundContents): Ditto.
(WebCore::Range::setStartBefore): Ditto.
(WebCore::Range::contains): Ditto. Except added code to handle exception
case to return false without asserting because I saw at least one crash
that seemed to imply this behavior was needed.
(WebCore::rangesOverlap): Ditto.
(WebCore::rangeOfContents): Ditto.
(WebCore::Range::expand): Ditto.
(WebCore::Range::getClientRects): Ditto.
(WebCore::Range::getBoundingClientRect): Ditto.
(WebCore::Range::borderAndTextQuads): Changed to use return value
instead of out argument, since it's a private function used only
within this class so it was easy to update all call sites.
(WebCore::Range::boundingRect): Updated for above. Also renamed since
there was no need for the name "internal" in this.
(WebCore::Range::absoluteBoundingRect): Ditto.
* dom/Range.h: Updated for above.
* dom/Range.idl: Use non-legacy exceptions. Also changed the default value
of the string argument to the expand function to the empty string rather
than "undefined", because the function silently does nothing when passed
any unrecognized string, and so this leaves behavior unchanged. I removed
the comment saying that the "undefined" default is wrong.
* editing/AlternativeTextController.cpp:
(WebCore::AlternativeTextController::applyAlternativeTextToRange): Updated
to use ExceptionOr but behave the same.
* editing/Editor.cpp:
(WebCore::Editor::advanceToNextMisspelling): Ditto.
(WebCore::Editor::markAndReplaceFor): Ditto.
(WebCore::isFrameInRange): Ditto. Also made a few style tweaks.
(WebCore::Editor::countMatchesForText): Ditto.
* editing/EditorCommand.cpp:
(WebCore::unionDOMRanges): Ditto.
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::respondToNodeModification): Ditto.
* editing/InsertListCommand.cpp:
(WebCore::InsertListCommand::doApplyForSingleParagraph): Ditto.
* editing/TextCheckingHelper.cpp:
(WebCore::TextCheckingParagraph::offsetTo): Ditto.
* editing/TextCheckingHelper.h: Updated for above and also deleted
unneeded private function checkingRange, which just churned the
reference count unnecessarily; instead use m_checkingRange directly.
* editing/TextIterator.cpp:
(WebCore::TextIterator::getLocationAndLengthFromRange): Ditto.
* editing/VisiblePosition.cpp:
(WebCore::setStart): Ditto.
(WebCore::setEnd): Ditto.
* editing/VisibleSelection.cpp:
(WebCore::makeSearchRange): Ditto.
* editing/VisibleUnits.cpp:
(WebCore::suffixLengthForRange): Changed argument from RefPtr to
a reference.
(WebCore::prefixLengthForRange): Ditto.
(WebCore::previousBoundary): Updated for ExceptionOr and the change
above.
(WebCore::nextBoundary): Ditto.
* editing/VisibleUnits.h: Updated for above.
* editing/htmlediting.cpp:
(WebCore::comparePositions): Updated to use ExceptionOr but behave
the same.
(WebCore::visiblePositionForIndexUsingCharacterIterator): Ditto.
(WebCore::isNodeVisiblyContainedWithin): Ditto.
* editing/ios/EditorIOS.mm:
(WebCore::Editor::setDictationPhrasesAsChildOfElement): Ditto.
(WebCore::Editor::setTextAsChildOfElement): Ditto.
* editing/mac/EditorMac.mm:
(WebCore::Editor::adjustedSelectionRange): Ditto.
* editing/markup.cpp:
(WebCore::createMarkupInternal): Ditto.
* page/ContextMenuController.cpp:
(WebCore::ContextMenuController::contextMenuItemSelected): Ditto.
* page/DOMSelection.cpp:
(WebCore::DOMSelection::addRange): Ditto.
(WebCore::DOMSelection::deleteFromDocument): Ditto.
(WebCore::DOMSelection::containsNode): Ditto.
* page/EventHandler.cpp:
(WebCore::EventHandler::dispatchMouseEvent): Updated for change to
use ExceptionOr in Ragne::compareNode. Also refactored the function
to make the logic a little mroe straightforward and nest less of it
inside a loop.
* page/Page.cpp:
(WebCore::Page::findStringMatchingRanges): Updated for ExceptionOr
without changing behavior.
* page/TextIndicator.cpp:
(WebCore::hasNonInlineOrReplacedElements): Ditto.
* rendering/RenderNamedFlowThread.cpp:
(WebCore::RenderNamedFlowThread::getRanges): Ditto.
2016-11-09 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Fix grid layout parsing
https://bugs.webkit.org/show_bug.cgi?id=164489
Reviewed by Dean Jackson.
* css/CSSValueKeywords.in:
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeFitContent):
(WebCore::isGridTrackFixedSized):
(WebCore::consumeGridTrackSize):
(WebCore::consumeGridTrackRepeatFunction):
(WebCore::consumeGridTrackList):
(WebCore::isCustomIdentValue):
(WebCore::CSSPropertyParser::consumeGridItemPositionShorthand):
(WebCore::CSSPropertyParser::consumeGridAreaShorthand):
(WebCore::consumeImplicitGridAutoFlow):
(WebCore::CSSPropertyParser::consumeGridShorthand):
2016-11-09 Darin Adler <darin@apple.com>
Move EventTarget from ExceptionCode to ExceptionOr
https://bugs.webkit.org/show_bug.cgi?id=164465
Reviewed by Youenn Fablet.
* Modules/indexeddb/IDBRequest.h: Added now-needed forward
class declarations.
* Modules/webaudio/AudioContext.h: Ditto.
* bindings/js/JSEventListener.cpp:
(WebCore::eventHandlerAttribute): Updated for name change of the
attributeEventListener function.
(WebCore::documentEventHandlerAttribute): Ditto.
* dom/Document.cpp:
(WebCore::Document::getWindowAttributeEventListener): Ditto.
* dom/EventTarget.cpp:
(WebCore::EventTarget::setAttributeEventListener): Updated for
name change.
(WebCore::EventTarget::attributeEventListener): Ditto.
(WebCore::EventTarget::dispatchEventForBindings): Use ExceptionOr.
(WebCore::legacyType): Use null instead of empty for no type, since
it's more efficient to check for null.
(WebCore::EventTarget::fireEventListeners): Check for null.
Also streamlined logic a little bit and removed a very old comment.
(WebCore::EventTarget::eventListeners): Renamed from getEventListeners.
* dom/EventTarget.h: Removed lots of unneeded declarations. Renamed
some functions to remove get prefix. Updated for above changes.
Moved one inline function out of the class header. Made the destructor
for EventTarget be inline to make the destructors for derived classes
slightly more efficient.
* dom/EventTarget.idl: Use non-legacy exception.
* dom/Node.cpp:
(WebCore::Node::didMoveToNewDocument): Updated for name change.
* editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplacementFragment::ReplacementFragment): Ditto.
* inspector/InspectorCSSAgent.h: Added now-needed forward declaration.
* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::getEventListeners): Updated for name change.
* inspector/InspectorInstrumentation.h: Added now-needed forward declaration.
* page/DOMWindow.h: Ditto.
* xml/XMLHttpRequest.h: Ditto.
2016-11-09 Daniel Bates <dabates@apple.com>
Add test infrastructure and tests for existing HTTP 0.9 sandbox machinery
https://bugs.webkit.org/show_bug.cgi?id=164389
<rdar://problem/29101072>
Reviewed by Alex Christensen.
Add test infrastructure to support registering an arbitrary port as the default port
for a protocol. The behavior of various machinery, including the HTTP 0.9 machinery,
can be effected by whether the resource request was made using the default port for
the protocol. We expose window.internals.registerDefaultPortForProtocol() to allow
a test to override the default port associated with a protocol so as to support
testing these code paths using the existing port 8000 server started by run-webkit-httpd.
Without window.internals.registerDefaultPortForProtocol() we would need to teach
run-webkit-httpd to run a web server on port 80, which requires superuser privileges
(since it is a privileged port number) and is more likely to interfere with an
existing web server setup.
Tests: http/tests/security/http-0.9/default-port-plugin-blocked.html
http/tests/security/http-0.9/default-port-script-blocked.html
http/tests/security/http-0.9/iframe-blocked.html
http/tests/security/http-0.9/image-blocked.html
http/tests/security/http-0.9/image-on-HTTP-0.9-default-port-page-allowed-ref-test.html
http/tests/security/http-0.9/image-on-HTTP-0.9-default-port-page-allowed.html
http/tests/security/http-0.9/image-on-HTTP-0.9-page-blocked.html
http/tests/security/http-0.9/worker-connect-src-blocked.html
http/tests/security/http-0.9/worker-importScripts-blocked.html
http/tests/security/http-0.9/xhr-asynchronous-blocked.html
* platform/URL.cpp:
(WebCore::defaultPortForProtocolMapForTesting): Added.
(WebCore::registerDefaultPortForProtocolForTesting): Adds the specified (protocol, port) to the
mapping used for testing.
(WebCore::clearDefaultPortForProtocolMapForTesting): Clears the protocol to default port testing map.
We call this function from Internals::resetToConsistentState() so that the mapping is cleared between
test runs.
(WebCore::defaultPortForProtocol): Modified to check the protocol to default port map for testing
before consulting URLParser::defaultPortForProtocol().
* platform/URL.h:
* testing/Internals.cpp:
(WebCore::Internals::resetToConsistentState): Clear the default port mapping used for testing.
(WebCore::Internals::registerDefaultPortForProtocol): Added.
* testing/Internals.h:
* testing/Internals.idl: Added declaration for registerDefaultPortForProtocol().
2016-11-09 Sam Weinig <sam@webkit.org>
[WebIDL] Add proper parsing for Promises
https://bugs.webkit.org/show_bug.cgi?id=164497
Reviewed by Tim Horton.
* bindings/scripts/IDLParser.pm:
(parseNonAnyType):
(parseStringType):
Require Promise types to declare the type they resolve to.
* bindings/js/JSDOMPromise.h:
Allow DOMPromise to be be parameterized on void. Add an SFINAE guarded
overload of resolve that takes no arguments when in a DOMPromise<void>.
* Modules/applepay/ApplePaySession.idl:
* Modules/fetch/DOMWindowFetch.idl:
* Modules/fetch/FetchBody.idl:
* Modules/fetch/FetchResponse.idl:
* Modules/fetch/WorkerGlobalScopeFetch.idl:
* Modules/mediastream/MediaDevices.idl:
* Modules/mediastream/MediaStreamTrack.idl:
* Modules/mediastream/RTCPeerConnection.idl:
* Modules/mediastream/RTCRtpSender.idl:
* Modules/mediastream/RTCStatsReport.idl:
* Modules/streams/ReadableStream.idl:
* Modules/streams/ReadableStreamDefaultReader.idl:
* Modules/streams/ReadableStreamSource.idl:
* Modules/streams/WritableStream.idl:
* Modules/webaudio/AudioContext.idl:
* bindings/scripts/test/TestNode.idl:
* bindings/scripts/test/TestObj.idl:
* crypto/SubtleCrypto.idl:
* crypto/WebKitSubtleCrypto.idl:
* css/FontFace.idl:
* css/FontFaceSet.idl:
* dom/CustomElementRegistry.idl:
* html/HTMLMediaElement.idl:
Update IDLs to specify the resolve type of promise types.
* Modules/mediastream/MediaEndpointPeerConnection.cpp:
(WebCore::MediaEndpointPeerConnection::replaceTrack):
(WebCore::MediaEndpointPeerConnection::replaceTrackTask):
* Modules/mediastream/MediaStreamTrack.cpp:
(WebCore::MediaStreamTrack::applyConstraints):
* Modules/mediastream/MediaStreamTrack.h:
* Modules/mediastream/PeerConnectionBackend.cpp:
(WebCore::PeerConnectionBackend::setLocalDescriptionSucceeded):
(WebCore::PeerConnectionBackend::setRemoteDescriptionSucceeded):
(WebCore::PeerConnectionBackend::addIceCandidateSucceeded):
* Modules/mediastream/PeerConnectionBackend.h:
* Modules/streams/ReadableStreamSource.h:
(WebCore::ReadableStreamSource::start):
(WebCore::ReadableStreamSource::pull):
(WebCore::ReadableStreamSource::startFinished):
(WebCore::ReadableStreamSource::pullFinished):
* Modules/webaudio/AudioContext.cpp:
(WebCore::AudioContext::addReaction):
(WebCore::AudioContext::setState):
(WebCore::AudioContext::suspend):
(WebCore::AudioContext::resume):
(WebCore::AudioContext::close):
* Modules/webaudio/AudioContext.h:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::rejectPendingPlayPromises):
(WebCore::HTMLMediaElement::resolvePendingPlayPromises):
(WebCore::HTMLMediaElement::play):
* html/HTMLMediaElement.h:
Update implementations to use DOMPromise<void> rather than DOMPromise<nullptr_t>
and use the new resolve() overload.
2016-11-07 Brady Eidson <beidson@apple.com>
Followup to https://bugs.webkit.org/show_bug.cgi?id=164466 - Make an IDBTransaction* be an IDBTransaction&
Rubberstamped by Alex Christensen.
No new tests (No behavior change).
* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::IDBObjectStore):
(WebCore::IDBObjectStore::~IDBObjectStore):
(WebCore::IDBObjectStore::hasPendingActivity):
(WebCore::IDBObjectStore::name):
(WebCore::IDBObjectStore::setName):
(WebCore::IDBObjectStore::keyPath):
(WebCore::IDBObjectStore::indexNames):
(WebCore::IDBObjectStore::transaction):
(WebCore::IDBObjectStore::autoIncrement):
(WebCore::IDBObjectStore::openCursor):
(WebCore::IDBObjectStore::openKeyCursor):
(WebCore::IDBObjectStore::get):
(WebCore::IDBObjectStore::putOrAdd):
(WebCore::IDBObjectStore::doDelete):
(WebCore::IDBObjectStore::clear):
(WebCore::IDBObjectStore::createIndex):
(WebCore::IDBObjectStore::index):
(WebCore::IDBObjectStore::deleteIndex):
(WebCore::IDBObjectStore::doCount):
(WebCore::IDBObjectStore::getAll):
(WebCore::IDBObjectStore::getAllKeys):
(WebCore::IDBObjectStore::markAsDeleted):
(WebCore::IDBObjectStore::rollbackForVersionChangeAbort):
(WebCore::IDBObjectStore::ref):
(WebCore::IDBObjectStore::deref):
* Modules/indexeddb/IDBObjectStore.h:
2016-11-09 Zalan Bujtas <zalan@apple.com>
Move RenderNamedFlowThread nextRendererForElement logic to RenderTreeUpdater.
https://bugs.webkit.org/show_bug.cgi?id=164503
Reviewed by Antti Koivisto.
When we insert a renderer into the render tree, we need to know both its parent
and its next sibling. Normally the parent and the sibling are based on the DOM, but
when this renderer is part of a flow thread, its insertion sibling is not necessarily the DOM sibling.
To find the correct sibling, we call RenderNamedFlowThread's nextRendererForElement().
RenderNamedFlowThread keeps track of its children so that it can compute the next sibling
for the insertion point.
This patch eliminates the need for keeping track of the child renderers of each
flow by moving the 'next sibling' logic to RenderTreePosition.
No change in functionality.
* rendering/RenderElement.cpp:
(WebCore::RenderElement::insertedIntoTree):
(WebCore::RenderElement::willBeDestroyed):
(WebCore::RenderElement::removeFromRenderFlowThread):
(WebCore::RenderElement::renderNamedFlowThreadWrapper): Deleted.
* rendering/RenderElement.h:
* rendering/RenderNamedFlowThread.cpp:
(WebCore::RenderNamedFlowThread::nextRendererForElement): Deleted.
(WebCore::RenderNamedFlowThread::addFlowChild): Deleted.
(WebCore::RenderNamedFlowThread::removeFlowChild): Deleted.
* rendering/RenderNamedFlowThread.h:
* style/RenderTreePosition.cpp:
(WebCore::RenderTreePosition::previousSiblingRenderer):
(WebCore::RenderTreePosition::flowThreadInsertionContext):
* style/RenderTreePosition.h:
(WebCore::RenderTreePosition::RenderTreePosition):
(WebCore::RenderTreePosition::parent):
* style/RenderTreeUpdater.cpp:
(WebCore::registerElementForFlowThreadIfNeeded): We need to registed the element even when it does not create renderer (display: none).
(WebCore::RenderTreeUpdater::createRenderer):
(WebCore::moveToFlowThreadIfNeeded): Deleted.
2016-11-09 Per Arne Vollan <pvollan@apple.com>
[Win][Direct2D] Incomplete image decoding.
https://bugs.webkit.org/show_bug.cgi?id=164511
Reviewed by Darin Adler.
Create native decoder when all image data has been received.
* platform/graphics/win/ImageDecoderDirect2D.cpp:
(WebCore::ImageDecoder::setData):
2016-11-09 Beth Dakin <bdakin@apple.com>
Attempted build fix.
* platform/spi/cocoa/AVKitSPI.h:
2016-11-09 Brady Eidson <beidson@apple.com>
IndexedDB 2.0: Clean up more transaction abort behavior, including tweaks to Index/ObjectStore lifetime.
https://bugs.webkit.org/show_bug.cgi?id=164466
Reviewed by Alex Christensen.
No new tests (Covered by existing tests that now pass).
Previously, IDBIndex ref/deref didn't track a traditional ref count but instead kept the owning object store alive.
Now, IDBObjectStore ref/deref do the same thing for the owning transaction.
Now when a version change transaction is rolled back, some object stores and indexes get pulled out of the "deleted"
set and get promoted back up into the "referenced" set.
Now deleted object stores/indexes are considered opaque roots, as live objects in the deleted state *can* get back
to the owning objects.
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* Modules/indexeddb/IDBIndex.cpp:
(WebCore::IDBIndex::rollbackInfoForVersionChangeAbort):
* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::IDBObjectStore):
(WebCore::IDBObjectStore::indexNames):
(WebCore::IDBObjectStore::transaction):
(WebCore::IDBObjectStore::openCursor):
(WebCore::IDBObjectStore::openKeyCursor):
(WebCore::IDBObjectStore::deleteIndex):
(WebCore::IDBObjectStore::rollbackForVersionChangeAbort):
(WebCore::IDBObjectStore::visitReferencedIndexes):
(WebCore::IDBObjectStore::ref):
(WebCore::IDBObjectStore::deref):
(WebCore::IDBObjectStore::create): Deleted.
* Modules/indexeddb/IDBObjectStore.h:
* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::objectStore):
(WebCore::IDBTransaction::transitionedToFinishing):
(WebCore::IDBTransaction::internalAbort):
(WebCore::IDBTransaction::createObjectStore):
(WebCore::IDBTransaction::deleteObjectStore):
(WebCore::IDBTransaction::visitReferencedObjectStores):
* Modules/indexeddb/IDBTransaction.h:
* Modules/indexeddb/IDBTransaction.idl:
* bindings/js/JSIDBTransactionCustom.cpp: Added.
(WebCore::JSIDBTransaction::visitAdditionalChildren):
2016-11-09 Simon Fraser <simon.fraser@apple.com>
Allow customization of TextStream-based logging for geometry types
https://bugs.webkit.org/show_bug.cgi?id=164460
Reviewed by Zalan Bujtas.
TextStream-based logging was constrained by the requirement to maintain compatibility
with DRT-style output, which includes cumbersome rect logging ("at (5,0) size 40x40")
and dumping LayoutRects as IntRects.
Add some formatting flags so that other TextStream clients (e.g. logging) can have
more readable output, and opt into automatic FormatNumberRespectingIntegers behavior.
TextStreams whose output appears in test results are given flags to avoid behavior
changes, but in the longer term test results should be updated.
* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::replayDisplayListAsText):
* page/scrolling/ScrollingStateNode.cpp:
(WebCore::ScrollingStateNode::scrollingStateTreeAsText):
* platform/graphics/FloatPoint.cpp:
(WebCore::operator<<):
* platform/graphics/FloatRect.cpp:
(WebCore::operator<<):
* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::layerTreeAsText):
* platform/graphics/IntRect.cpp:
(WebCore::operator<<):
* platform/graphics/LayoutPoint.cpp:
(WebCore::operator<<):
* platform/graphics/LayoutRect.cpp:
(WebCore::operator<<):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::replayDisplayListAsText):
* platform/graphics/displaylists/DisplayList.cpp:
(WebCore::DisplayList::DisplayList::asText):
* platform/text/TextStream.cpp:
(WebCore::TextStream::operator<<):
* platform/text/TextStream.h:
(WebCore::TextStream::TextStream):
(WebCore::TextStream::formattingFlags):
(WebCore::TextStream::setFormattingFlags):
(WebCore::TextStream::hasFormattingFlag):
(WebCore::TextStream::increaseIndent):
(WebCore::TextStream::decreaseIndent):
* rendering/RenderTreeAsText.cpp:
(WebCore::externalRepresentation):
(WebCore::counterValueForElement):
2016-11-09 Zalan Bujtas <zalan@apple.com>
RenderFlowThread::flowThreadRelativeWillBeRemoved should take RenderObject& instead of RenderObject*
https://bugs.webkit.org/show_bug.cgi?id=164543
Reviewed by Simon Fraser.
No change in functionality.
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::removeChild):
* rendering/RenderFlowThread.h:
* rendering/RenderMultiColumnFlowThread.cpp:
(WebCore::RenderMultiColumnFlowThread::handleSpannerRemoval):
(WebCore::RenderMultiColumnFlowThread::flowThreadRelativeWillBeRemoved):
* rendering/RenderMultiColumnFlowThread.h:
2016-11-09 Jer Noble <jer.noble@apple.com>
REGRESSION (r208149): Media scrubber is not displayed in media controls
https://bugs.webkit.org/show_bug.cgi?id=164514
Reviewed by Darin Adler.
Fixes broken Media Controls API tests.
Added a new PlatformMediaSessionType; need to add that same type to the TYPE_TRAITS section of
MediaElementSession.h so that is<> and downcast<> work correctly.
* html/MediaElementSession.h:
(isType):
2016-11-09 Wenson Hsieh <wenson_hsieh@apple.com>
When editing IME, `compositionend` events should fire after input events
https://bugs.webkit.org/show_bug.cgi?id=164324
<rdar://problem/29050438>
Reviewed by Darin Adler.
Moves where we dispatch `compositionend` events to after applying editing commands that fire `beforeinput` or
`input` events. Also augments existing layout tests to verify the change.
* editing/Editor.cpp:
(WebCore::Editor::setComposition):
2016-11-09 Wenson Hsieh <wenson_hsieh@apple.com>
Setting foreground color when text is selected should fire an input event with color data
https://bugs.webkit.org/show_bug.cgi?id=164241
<rdar://problem/29032759>
Reviewed by Darin Adler.
Refactors Editor::applyStyle and Editor::applyParagraphStyle to handle beforeinput and input event dispatch.
Instead of going through the ApplyStyleCommand to dispatch input events, override shouldDispatchInputEvents to
return false. This strategy also has the effect of unifying the way input events are dispatched in applyStyle,
in both codepaths where we computeAndSetTypingStyle and where we create and then apply a style command.
Test: fast/events/input-events-selection-forecolor-data.html
* editing/ApplyStyleCommand.h:
* editing/Editor.cpp:
(WebCore::inputEventDataForEditingStyleAndAction):
(WebCore::Editor::applyStyle):
(WebCore::Editor::applyParagraphStyle):
(WebCore::Editor::computeAndSetTypingStyle):
2016-11-08 Dean Jackson <dino@apple.com>
Rendering support for ExtendedColors
https://bugs.webkit.org/show_bug.cgi?id=164443
<rdar://problems/29123243>
Reviewed by Simon Fraser and Darin Adler.
Add support for rendering the new color() syntax, which
ends up as an ExtendedColor.
In order to make rendering code a little more readable, I
changed Color::hasAlpha to Color::isOpaque (since an alpha
of 100% is still an alpha), and added a Color::isVisible
helper (the color isn't completely transparent). These new
helpers support ExtendedColor forms.
Support for painting gradients and blending between colors
is still to come. I also added some FIXME comments
to show other places that don't handle ExtendedColors yet.
Tests: css3/color/backgrounds-and-borders.html
css3/color/box-shadows.html
css3/color/canvas.html
css3/color/composited-solid-backgrounds.html
css3/color/text.html
* css/CSSGradientValue.cpp: Add some notes that this is broken.
(WebCore::interpolate):
(WebCore::CSSGradientValue::knownToBeOpaque):
* editing/EditingStyle.cpp: Use new Color helpers.
(WebCore::isTransparentColorValue):
* editing/mac/EditorMac.mm: Use new Color helpers.
(WebCore::Editor::fontAttributesForSelectionStart):
* html/ColorInputType.cpp: No need to use the Color class at all here.
(WebCore::isValidSimpleColorString): Renamed from isValidColorString.
(WebCore::ColorInputType::sanitizeValue):
(WebCore::ColorInputType::typeMismatchFor):
(WebCore::isValidColorString): Deleted.
* html/canvas/CanvasRenderingContext2D.cpp: New helpers.
(WebCore::CanvasRenderingContext2D::shouldDrawShadows):
(WebCore::CanvasRenderingContext2D::didDraw):
* page/FrameView.cpp: Ditto.
(WebCore::FrameView::recalculateScrollbarOverlayStyle):
(WebCore::FrameView::hasOpaqueBackground):
(WebCore::FrameView::setBaseBackgroundColor):
* platform/graphics/Color.cpp:
(WebCore::differenceSquared): Support ExtendedColor, but also
add a note to indicate that this method and its call sites
should use floats.
(WebCore::Color::serialized): New helper.
(WebCore::Color::cssText): Ditto.
(WebCore::Color::blend): Ditto.
(WebCore::Color::blendWithWhite):
(WebCore::Color::colorWithAlphaMultipliedBy): Implementation of new function.
(WebCore::Color::colorWithAlpha): Ditto.
(WebCore::Color::opaqueColor): New method to return an opaque version of the given color.
(WebCore::blend):
* platform/graphics/Color.h:
(WebCore::Color::isOpaque): New helper that is !hasAlpha().
(WebCore::Color::isVisible): New helper.
(WebCore::Color::alphaAsFloat): Gets the alpha value as a float. This replaces
a bunch of places that were calculating it manually each time. Meanwhile, we
might consider always exposing the primaries as floats... or at least
have that option.
(WebCore::isBlackColor): New helper - it was used in a couple of places.
(WebCore::isWhiteColor): Ditto.
(WebCore::Color::hasAlpha): Deleted.
* platform/graphics/Gradient.cpp: Add FIXME.
(WebCore::Gradient::addColorStop):
* platform/graphics/Gradient.h:
* platform/graphics/GraphicsContext.cpp: Use new helpers.
(WebCore::GraphicsContext::computeLineBoundsAndAntialiasingModeForText):
* platform/graphics/GraphicsContext.h:
(WebCore::GraphicsContext::hasVisibleShadow):
* platform/graphics/Image.cpp: Ditto.
(WebCore::Image::fillWithSolidColor):
* platform/graphics/ShadowBlur.cpp: Ditto.
(WebCore::ShadowBlur::updateShadowBlurValues):
* platform/graphics/ca/GraphicsLayerCA.cpp: Ditto.
(WebCore::GraphicsLayerCA::setContentsToSolidColor):
* platform/graphics/cg/GradientCG.cpp:
(WebCore::Gradient::platformGradient): Add a FIXME to note that we can
add ExtendedColor support simply by using CGColors, rather than fetching
the components ourselves.
* platform/graphics/cg/GraphicsContextCG.cpp: New helpers.
(WebCore::calculateDrawingMode):
* platform/graphics/cocoa/FontCascadeCocoa.mm: New helpers.
(WebCore::FontCascade::drawGlyphs):
* platform/graphics/mac/ColorMac.mm: Use the new helpers and Color::hash().
(WebCore::nsColor):
* platform/graphics/texmap/TextureMapperGL.cpp: New helpers.
(WebCore::TextureMapperGL::drawBorder):
* rendering/BorderEdge.cpp: Ditto.
(WebCore::BorderEdge::obscuresBackgroundEdge):
(WebCore::BorderEdge::obscuresBackground):
* rendering/RenderBox.cpp: Ditto.
(WebCore::RenderBox::getBackgroundPaintedExtent):
(WebCore::RenderBox::backgroundIsKnownToBeOpaqueInRect):
(WebCore::RenderBox::backgroundHasOpaqueTopLayer):
* rendering/RenderBoxModelObject.cpp: Ditto.
(WebCore::RenderBoxModelObject::paintFillLayerExtended):
(WebCore::colorNeedsAntiAliasAtCorner):
(WebCore::willBeOverdrawn):
(WebCore::RenderBoxModelObject::paintTranslucentBorderSides):
(WebCore::RenderBoxModelObject::paintBorder):
(WebCore::RenderBoxModelObject::boxShadowShouldBeAppliedToBackground):
(WebCore::RenderBoxModelObject::paintBoxShadow):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::paintOutline):
* rendering/RenderInline.cpp:
(WebCore::RenderInline::paintOutline):
* rendering/RenderLayerBacking.cpp:
(WebCore::canCreateTiledImage):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::viewHasTransparentBackground):
* rendering/RenderMenuList.cpp:
(RenderMenuList::getItemBackgroundColor):
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::disabledTextColor):
* rendering/RenderView.cpp:
(WebCore::RenderView::paintBoxDecorations):
* rendering/TextDecorationPainter.cpp:
(WebCore::TextDecorationPainter::paintTextDecoration):
* rendering/TextPainter.cpp:
(WebCore::TextPainter::paintTextWithShadows):
* rendering/style/BorderValue.h:
(WebCore::BorderValue::isTransparent):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::visitedDependentColor):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::hasBackground):
* rendering/svg/RenderSVGResource.cpp:
(WebCore::requestPaintingResource):
* rendering/svg/SVGInlineTextBox.cpp:
(WebCore::SVGInlineTextBox::paintSelectionBackground):
* svg/SVGAnimatedColor.cpp: Add a FIXME to note this is broken.
(WebCore::SVGAnimatedColorAnimator::calculateAnimatedValue):
2016-11-09 Antoine Quint <graouts@apple.com>
[Modern Media Controls] UI Library: StatusLabel
https://bugs.webkit.org/show_bug.cgi?id=164544
<rdar://problem/29179541>
Reviewed by Dean Jackson.
We add a new StatusLabel class to display a string of text in place of the TimeControl.
A followup patch will add the logic to display "Error", "Loading" and "Live Broadcast"
test under the right media state.
Tests: media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-status-label.html
media/modern-media-controls/status-label/status-label.html
* Modules/modern-media-controls/controls/macos-inline-media-controls.css:
(.media-controls.mac.inline .time-label,):
(.media-controls.mac.inline .time-label): Deleted.
* Modules/modern-media-controls/controls/macos-inline-media-controls.js:
(MacOSInlineMediaControls.prototype.layout):
* Modules/modern-media-controls/controls/media-controls.js:
(MediaControls.):
* Modules/modern-media-controls/controls/status-label.css: Added.
(.status-label):
* Modules/modern-media-controls/controls/status-label.js: Added.
(StatusLabel.prototype.get text):
(StatusLabel.prototype.set text):
(StatusLabel.prototype.commitProperty):
* Modules/modern-media-controls/js-files:
* WebCore.xcodeproj/project.pbxproj:
2016-11-09 Chris Dumez <cdumez@apple.com>
[Mac] Stop using deprecated AppKit enumeration values
https://bugs.webkit.org/show_bug.cgi?id=164494
Reviewed by Darin Adler.
Stop using deprecated AppKit enumeration values.
* editing/cocoa/HTMLConverter.mm:
(HTMLConverter::computedAttributesForElement):
(HTMLConverter::_processElement):
(HTMLConverter::_addMarkersToList):
* page/mac/EventHandlerMac.mm:
(WebCore::EventHandler::keyEvent):
(WebCore::lastEventIsMouseUp):
(WebCore::EventHandler::passSubframeEventToSubframe):
(WebCore::EventHandler::widgetDidHandleWheelEvent):
(WebCore::EventHandler::sendFakeEventsAfterWidgetTracking):
* page/mac/TextIndicatorWindow.mm:
(WebCore::TextIndicatorWindow::setTextIndicator):
* platform/graphics/mac/IconMac.mm:
(WebCore::Icon::paint):
* platform/mac/CursorMac.mm:
(WebCore::createCustomCursor):
* platform/mac/DragImageMac.mm:
(WebCore::dissolveDragImageToFraction):
(WebCore::createDragImageFromImage):
* platform/mac/EventLoopMac.mm:
(WebCore::EventLoop::cycle):
* platform/mac/PasteboardMac.mm:
(WebCore::Pasteboard::setDragImage):
* platform/mac/PlatformEventFactoryMac.mm:
(WebCore::globalPointForEvent):
(WebCore::pointForEvent):
(WebCore::mouseButtonForEvent):
(WebCore::mouseEventTypeForEvent):
(WebCore::clickCountForEvent):
(WebCore::isKeypadEvent):
(WebCore::windowsKeyCodeForKeyEvent):
(WebCore::isKeyUpEvent):
(WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder):
* platform/mac/ScrollbarThemeMac.mm:
(WebCore::scrollbarControlSizeToNSControlSize):
* platform/mac/ThemeMac.mm:
(-[WebCoreThemeView window]):
(WebCore::controlSizeForFont):
(WebCore::controlSizeFromPixelSize):
(WebCore::setUpButtonCell):
(WebCore::stepperControlSizeForFont):
(WebCore::paintStepper):
(WebCore::ThemeMac::minimumControlSize):
* platform/mac/WebVideoFullscreenHUDWindowController.mm:
(-[WebVideoFullscreenHUDWindow initWithContentRect:styleMask:backing:defer:]):
(-[WebVideoFullscreenHUDWindow performKeyEquivalent:]):
(-[WebVideoFullscreenHUDWindowController init]):
(-[WebVideoFullscreenHUDWindowController keyDown:]):
(-[WebVideoFullscreenHUDWindowController windowDidLoad]):
* platform/mac/WebWindowAnimation.mm:
(WebWindowAnimationDurationFromDuration):
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::updateCachedSystemFontDescription):
(WebCore::RenderThemeMac::controlSizeForFont):
(WebCore::RenderThemeMac::controlSizeForCell):
(WebCore::RenderThemeMac::controlSizeForSystemFont):
(WebCore::RenderThemeMac::paintProgressBar):
(WebCore::RenderThemeMac::popupMenuSize):
(WebCore::RenderThemeMac::sliderThumbHorizontal):
(WebCore::RenderThemeMac::sliderThumbVertical):
2016-11-08 Antoine Quint <graouts@apple.com>
[Modern Media Controls] UI Library: iOS inline controls
https://bugs.webkit.org/show_bug.cgi?id=164513
<rdar://problem/27989475>
Reviewed by Dean Jackson.
We introduce a new IOSInlineMediaControls class which can be used to instantiate media controls
for inline playback on iOS.
Tests: media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-buttons-styles.html
media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-constructor.html
media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-controls-bar-styles.html
media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-layout.html
media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-time-control-styles.html
media/modern-media-controls/ios-inline-media-controls/ios-inline-media-dropping-controls.html
* Modules/modern-media-controls/controls/ios-inline-media-controls.css: Added.
(.media-controls.ios.inline > .controls-bar):
(.media-controls.ios.inline .time-control):
(.media-controls.ios.inline button):
(.media-controls.ios.inline button:active):
(.media-controls.ios.inline > .controls-bar button):
(.media-controls.ios.inline .buttons-container.right):
(.media-controls.ios.inline button.play-pause):
(.media-controls.ios.inline button.skip-back):
(.media-controls.ios.inline .scrubber.slider):
(.media-controls.ios.inline button.airplay):
(.media-controls.ios.inline button.pip):
(.media-controls.ios.inline button.fullscreen):
(.media-controls.ios.inline .time-label):
(.media-controls.ios.inline .scrubber.slider > .fill):
(.media-controls.ios.inline .scrubber.slider > input::-webkit-slider-thumb):
* Modules/modern-media-controls/controls/ios-inline-media-controls.js: Added.
(IOSInlineMediaControls.prototype.layout):
(IOSInlineMediaControls):
* Modules/modern-media-controls/images/iOS/slider-thumb@2x.png: Added.
* Modules/modern-media-controls/js-files:
* WebCore.xcodeproj/project.pbxproj:
2016-11-09 Beth Dakin <bdakin@apple.com>
Support TouchBar in WebKit
https://bugs.webkit.org/show_bug.cgi?id=164437
-and corresponding-
rdar://problem/28876524
Reviewed by Darin Adler.
* WebCore.xcodeproj/project.pbxproj:
* platform/spi/cocoa/AVKitSPI.h:
* platform/spi/cocoa/NSTouchBarSPI.h: Added.
* platform/spi/mac/NSSpellCheckerSPI.h:
2016-11-09 Chris Dumez <cdumez@apple.com>
Use Blob URL instead of webkit-fake-url when pasting an image
https://bugs.webkit.org/show_bug.cgi?id=49141
Reviewed by Darin Adler.
Use Blob URL instead of webkit-fake-url when pasting an image.
Tests: editing/pasteboard/paste-image-as-blob-url.html
editing/pasteboard/paste-image-using-image-data.html
* editing/Editor.h:
* editing/mac/EditorMac.mm:
(WebCore::Editor::WebContentReader::readImage):
(WebCore::Editor::createFragmentForImageAndURL):
2016-11-09 Michael Catanzaro <mcatanzaro@igalia.com>
Fix error message when SQLite initialization fails
https://bugs.webkit.org/show_bug.cgi?id=164462
Reviewed by Darin Adler.
* platform/sql/SQLiteDatabase.cpp:
(WebCore::initializeSQLiteIfNecessary):
2016-11-08 Antoine Quint <graouts@apple.com>
[Modern Media Controls] UI Library: macOS fullscreen controls
https://bugs.webkit.org/show_bug.cgi?id=164414
<rdar://problem/27989474>
Reviewed by Dean Jackson.
We introduce a new MacOSFullscreenMediaControls class which can be used to instantiate media controls
for fullscreen playback on macOS. These controls can be dragged by the user.
Tests: media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-buttons-containers-styles.html
media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-buttons-styles.html
media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-constructor.html
media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-controls-bar-styles.html
media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-right-container-margin.html
media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-time-control-styles.html
media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-volume-styles.html
* Modules/modern-media-controls/controls/button.js:
(Button.prototype.set enabled):
Correctly notify the layoutDelegate when the enabled property changes, regardless of whether
the flag is on.
* Modules/modern-media-controls/controls/icon-button.js:
(IconButton.prototype._updateImage):
(IconButton):
Correctly notify the layout delegate when the image metrics have changed so that it may perform
a layout. This issues became apparent with the new tests on Yosemite and caused some flakyness.
* Modules/modern-media-controls/controls/icon-service.js:
(const.iconService.new.IconService.prototype._fileNameAndPlatformForIconNameAndLayoutTraits):
(const.iconService.new.IconService):
Fix a typo.
* Modules/modern-media-controls/controls/macos-fullscreen-media-controls.css: Added.
(.media-controls.mac.fullscreen > .controls-bar):
(.media-controls.mac.fullscreen .volume.slider):
(.media-controls.mac.fullscreen .buttons-container):
(.media-controls.mac.fullscreen .buttons-container.center):
(.media-controls.mac.fullscreen > .controls-bar button):
(.media-controls.mac.fullscreen button.rewind):
(.media-controls.mac.fullscreen button.play-pause):
(.media-controls.mac.fullscreen button.forward):
(.media-controls.mac.fullscreen .buttons-container.right):
(.media-controls.mac.fullscreen button.airplay):
(.media-controls.mac.fullscreen button.aspect-ratio):
(.media-controls.mac.fullscreen button.pip):
(.media-controls.mac.fullscreen button.tracks):
(.media-controls.mac.fullscreen button.fullscreen):
(.media-controls.mac.fullscreen .time-control):
(.media-controls.mac.fullscreen .time-label):
(.media-controls.mac.fullscreen .scrubber):
* Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js: Added.
(MacOSFullscreenMediaControls.prototype.layout):
(MacOSFullscreenMediaControls):
* Modules/modern-media-controls/controls/macos-media-controls.js:
(MacOSMediaControls):
Allow the layoutTraits property to be set to something other than just LayoutTraits.macOS
so that MacOSFullscreenMediaControls may set the LayoutTraits.Fullscreen bit.
* Modules/modern-media-controls/js-files:
Add a reference to the new macos-fullscreen-media-controls.js file.
* WebCore.xcodeproj/project.pbxproj:
Add references to the new macos-fullscreen-media-controls.js and
macos-fullscreen-media-controls.css files.
2016-11-09 Chris Dumez <cdumez@apple.com>
Shave 16 bytes off HTMLInputElement
https://bugs.webkit.org/show_bug.cgi?id=164488
Reviewed by Sam Weinig.
Shave 16 bytes off HTMLInputElement (232 -> 216) by packing data members
better.
* html/HTMLFormControlElement.h:
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::HTMLTextFormControlElement):
* html/HTMLTextFormControlElement.h:
2016-11-09 Youenn Fablet <youenn@apple.com>
[WebRTC] Introduce asynchronous backend for other RTCPeerConnection API
https://bugs.webkit.org/show_bug.cgi?id=164409
Reviewed by Eric Carlson.
Covered by existing tests.
Following on createOffer changes, applying the same changes to createAnswer, setLocalDescription, setRemoteDescription and addIceCandidate.
Also refactored ICE candidate event generation (done at PeerConnectionBackend).
Updated stop implementation to clean any promise that may be stored in PeerConnectionBackend.
The goal of this is to be more aligned with https://www.w3.org/TR/webrtc/.
Implementation of the various functions such as //www.w3.org/TR/webrtc/#set-description would be done in PeerConnectionBackend.
This will require additional code moved from MediaEndpointPeerConnection up to PeerConnectionBackend.
* Modules/mediastream/MediaEndpointPeerConnection.cpp:
(WebCore::MediaEndpointPeerConnection::createOfferTask):
(WebCore::MediaEndpointPeerConnection::doCreateAnswer):
(WebCore::MediaEndpointPeerConnection::createAnswerTask):
(WebCore::MediaEndpointPeerConnection::doSetLocalDescription):
(WebCore::MediaEndpointPeerConnection::setLocalDescriptionTask):
(WebCore::MediaEndpointPeerConnection::doSetRemoteDescription):
(WebCore::MediaEndpointPeerConnection::setRemoteDescriptionTask):
(WebCore::MediaEndpointPeerConnection::doAddIceCandidate):
(WebCore::MediaEndpointPeerConnection::addIceCandidateTask):
(WebCore::MediaEndpointPeerConnection::doStop):
(WebCore::MediaEndpointPeerConnection::gotIceCandidate):
(WebCore::MediaEndpointPeerConnection::doneGatheringCandidates):
(WebCore::MediaEndpointPeerConnection::createAnswer): Deleted.
(WebCore::MediaEndpointPeerConnection::setLocalDescription): Deleted.
(WebCore::MediaEndpointPeerConnection::setRemoteDescription): Deleted.
(WebCore::MediaEndpointPeerConnection::addIceCandidate): Deleted.
(WebCore::MediaEndpointPeerConnection::stop): Deleted.
(WebCore::MediaEndpointPeerConnection::localDescriptionTypeValidForState): Deleted.
(WebCore::MediaEndpointPeerConnection::remoteDescriptionTypeValidForState): Deleted.
* Modules/mediastream/MediaEndpointPeerConnection.h:
* Modules/mediastream/PeerConnectionBackend.cpp:
(WebCore::PeerConnectionBackend::createOffer):
(WebCore::PeerConnectionBackend::createOfferFailed):
(WebCore::PeerConnectionBackend::createAnswer):
(WebCore::PeerConnectionBackend::createAnswerSucceeded):
(WebCore::PeerConnectionBackend::createAnswerFailed):
(WebCore::isLocalDescriptionTypeValidForState):
(WebCore::PeerConnectionBackend::setLocalDescription):
(WebCore::PeerConnectionBackend::setLocalDescriptionSucceeded):
(WebCore::PeerConnectionBackend::setLocalDescriptionFailed):
(WebCore::isRemoteDescriptionTypeValidForState):
(WebCore::PeerConnectionBackend::setRemoteDescription):
(WebCore::PeerConnectionBackend::setRemoteDescriptionSucceeded):
(WebCore::PeerConnectionBackend::setRemoteDescriptionFailed):
(WebCore::PeerConnectionBackend::addIceCandidate):
(WebCore::PeerConnectionBackend::addIceCandidateSucceeded):
(WebCore::PeerConnectionBackend::addIceCandidateFailed):
(WebCore::PeerConnectionBackend::fireICECandidateEvent):
(WebCore::PeerConnectionBackend::doneGatheringCandidates):
(WebCore::PeerConnectionBackend::stop):
* Modules/mediastream/PeerConnectionBackend.h:
2016-11-09 Eric Carlson <eric.carlson@apple.com>
[MediaStream][Mac] Mark captured video frames as ready for display immediately
https://bugs.webkit.org/show_bug.cgi?id=164482
<rdar://problem/29139073>
Reviewed by Jer Noble.
* platform/cf/CoreMediaSoftLink.cpp: Add new constant.
* platform/cf/CoreMediaSoftLink.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::requestNotificationWhenReadyForMediaData):
New, ask register for a callback when the sample buffer display layer is ready
for more media data.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSampleBuffer): Don't change
the sample timestamps, assume the caller has configured the sample correctly.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::prepareVideoSampleBufferFromTrack): Don't
drop frames when the display layer isn't ready.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::destroyLayer): Call stopRequestingMediaData.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::sampleBufferUpdated):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSampleBufferFromTrack): Deleted.
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::setupCaptureSession): Tell the video output to always discard
late video frames, we don't need them.
(WebCore::AVVideoCaptureSource::processNewFrame): Add a kCMSampleAttachmentKey_DisplayImmediately
attachment.
2016-11-09 Joanmarie Diggs <jdiggs@igalia.com>
AX: [ATK] Wrong selected element at a given index in a list box (redux)
https://bugs.webkit.org/show_bug.cgi?id=164430
Reviewed by Darin Adler.
This essentially undoes the implementation change resulting from r164577.
As stated in the ATK documentation, atk_selection_ref_selection() takes
"a gint specifying the index in the selection set. (e.g. the ith selection
as opposed to the ith child)." r164577 deliberately modified that, causing
atk_selection_ref_selection() to treat the index as if it were the position
with respect to all of the children. There is different API in ATK, namely
atk_object_ref_accessible_child(), when the ith child from the set of all
children is sought.
Tests: accessibility/aria-listbox-no-selection.html
accessibility/native-listbox-no-selection.html
* accessibility/atk/WebKitAccessibleInterfaceSelection.cpp:
(optionFromSelection):
2016-11-09 Gyuyoung Kim <gyuyoung.kim@webkit.org>
[EFL] Use libgcrypt instead of GnuTLS for CryptoDigest
https://bugs.webkit.org/show_bug.cgi?id=164461
Reviewed by Michael Catanzaro.
As GTK port in r208297, EFL port starts to use libgcrypt instead of GnuTLS as well.
No new tests, no behavior change.
* PlatformEfl.cmake:
2016-11-09 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r208422.
Roll r208382 back in since it was not responsible for the API
test failures seen on macOS.
Reverted changeset:
"Unreviewed, rolling out r208382."
https://bugs.webkit.org/show_bug.cgi?id=164319
http://trac.webkit.org/changeset/208422
2016-11-09 Csaba Osztrogonác <ossy@webkit.org>
One more URTBF after r208361.
* PlatformMac.cmake:
2016-11-09 Csaba Osztrogonác <ossy@webkit.org>
Typo fix after r162782
https://bugs.webkit.org/show_bug.cgi?id=164473
Unreviewed trivial fix.
* platform/ThreadGlobalData.cpp:
2016-11-07 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r208382.
This change appears to have caused 3
SerializedCryptoKeyWrapTest API tests to fail on macOS.
Reverted changeset:
"[Readable Streams API] Implement ByteStreamController
error()"
https://bugs.webkit.org/show_bug.cgi?id=164319
http://trac.webkit.org/changeset/208382
2016-11-04 Filip Pizlo <fpizlo@apple.com>
WTF::ParkingLot should stop using std::chrono because std::chrono::duration casts are prone to overflows
https://bugs.webkit.org/show_bug.cgi?id=152045
Reviewed by Andy Estes.
No new layout tests because no new behavior. The new WTF time classes have some unit tests
in TestWebKitAPI.
* fileapi/ThreadableBlobRegistry.cpp:
(WebCore::ThreadableBlobRegistry::blobSize):
* platform/MainThreadSharedTimer.h:
* platform/SharedTimer.h:
* platform/ThreadTimers.cpp:
(WebCore::ThreadTimers::updateSharedTimer):
* platform/cf/MainThreadSharedTimerCF.cpp:
(WebCore::MainThreadSharedTimer::setFireInterval):
* platform/efl/MainThreadSharedTimerEfl.cpp:
(WebCore::MainThreadSharedTimer::setFireInterval):
* platform/glib/MainThreadSharedTimerGLib.cpp:
(WebCore::MainThreadSharedTimer::setFireInterval):
* platform/win/MainThreadSharedTimerWin.cpp:
(WebCore::MainThreadSharedTimer::setFireInterval):
* workers/WorkerRunLoop.cpp:
(WebCore::WorkerRunLoop::runInMode):
2016-11-04 Zalan Bujtas <zalan@apple.com>
RenderFlowThread state reset cleanup.
https://bugs.webkit.org/show_bug.cgi?id=164426
Reviewed by Simon Fraser.
RenderFlowThread state reset is spread across several functions. This patch groups them
together in RenderObject::resetFlowThreadState().
No change in functionality.
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::removeLeftoverAnonymousBlock):
(WebCore::RenderBlock::dropAnonymousBoxChild): This is now part of resetFlowThreadState() since resetFlowThreadState
gets called even when NotifyChildren is false.
* rendering/RenderElement.cpp:
(WebCore::RenderElement::insertChildInternal): Initialize the thread state before we notify the child.
(WebCore::RenderElement::removeChildInternal): Reset the state even when NotifyChildren is false.
(WebCore::RenderElement::willBeRemovedFromTree): This code is moved to removeFromRenderFlowThread().
(WebCore::RenderElement::removeFromRenderFlowThread):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::initializeFlowThreadState): This is in transition for webkit.org/b/164428 (RenderFlowThread state initialization cleanup.)
(WebCore::RenderObject::resetFlowThreadState):
(WebCore::RenderObject::setParent): This was seemingly a random place to put flow state initialization.
(WebCore::RenderObject::willBeRemovedFromTree): resetFlowThreadState() takes care of it now.
* rendering/RenderObject.h:
2016-11-04 Yusuke Suzuki <utatane.tea@gmail.com>
[DOMJIT] Add DOMJIT::Signature annotation to Document::getElementById
https://bugs.webkit.org/show_bug.cgi?id=164356
Reviewed by Filip Pizlo.
This patch implements DOMJIT::Signature annotation for getElementById.
Since getElementById is also implemented in DocumentFragment, we implement
the branchIfDocumentFragment/branchIfNotDocumentFragment for that.
In dromaeo, we have a test like this.
test( "getElementById", function(){
for ( var i = 0; i < num * 30; i++ ) {
ret = document.getElementById("testA" + num).nodeType;
ret = document.getElementById("testB" + num).nodeType;
ret = document.getElementById("testC" + num).nodeType;
ret = document.getElementById("testD" + num).nodeType;
ret = document.getElementById("testE" + num).nodeType;
ret = document.getElementById("testF" + num).nodeType;
}
});
In the above test, JSC already knows the following things.
1. Since nodeType is now handled as CallDOMGetter, we know that it is pure.
2. getElementById look up becomes PureGetById since document is impure object. But it is kept as PureGetById. So it does not write DOMState.
3. `"testA" + num` will be converted to constant string.
4. CallDOM for getElementById said it just reads(DOMState:DOM). And it saids that it returns the same value as long as DOMState is not clobbered.
5. CheckCell leading CallDOM ensures the inlined getElementById node. (CallDOM node).
The key thing is that no node clobbers DOMState during the loop. So CallDOM & CallDOMGetter can be hoisted.
This improves dom-query significantly. Dromaeo dom-query getElementById becomes 40x faster (247796 v.s. 6197).
Dromaeo dom-query getElementById (not in document) becomes 89x faster (630317.8 v.s. 7066.).
Tests: js/dom/domjit-function-get-element-by-id-changed.html
js/dom/domjit-function-get-element-by-id-licm.html
js/dom/domjit-function-get-element-by-id.html
* dom/NonElementParentNode.idl:
* domjit/DOMJITCheckDOM.h:
(WebCore::DOMJIT::TypeChecker<DocumentFragment>::branchIfFail):
* domjit/DOMJITHelpers.h:
(WebCore::DOMJIT::branchIfDocumentFragment):
(WebCore::DOMJIT::branchIfNotDocumentFragment):
2016-11-04 Simon Fraser <simon.fraser@apple.com>
Rename unscaledUnobscuredVisibleContentSize and unscaledVisibleContentSizeIncludingObscuredArea for attempted clarity
https://bugs.webkit.org/show_bug.cgi?id=164438
Reviewed by Tim Horton.
unscaledUnobscuredVisibleContentSize() and unscaledVisibleContentSizeIncludingObscuredArea() were an endless source
of confusion.
Functions with "VisibleContent" in the name are usually expected to return document coordinates (affected by zooming),
so unscaledUnobscuredVisibleContentSize caused cognitive dissonance because of "unscaled" vs "visibleContent", and
"unobscured" vs "visible".
So rename:
unscaledUnobscuredVisibleContentSize -> sizeForUnobscuredContent
unscaledVisibleContentSizeIncludingObscuredArea -> sizeForVisibleContent
sizeForUnobscuredContent() can also be private to ScrollView.
* inspector/InspectorOverlay.cpp:
(WebCore::InspectorOverlay::update):
* platform/ScrollView.cpp:
(WebCore::ScrollView::unobscuredContentRectInternal):
(WebCore::ScrollView::sizeForVisibleContent):
(WebCore::ScrollView::sizeForUnobscuredContent): Don't compute unscaledVisibleContentSizeIncludingObscuredArea
before testing whether we have a platform widget.
(WebCore::ScrollView::layoutSize):
(WebCore::ScrollView::unscaledVisibleContentSizeIncludingObscuredArea): Deleted.
(WebCore::ScrollView::unscaledUnobscuredVisibleContentSize): Deleted.
* platform/ScrollView.h:
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::flushPendingLayerChanges):
(WebCore::RenderLayerCompositor::frameViewDidChangeSize):
(WebCore::RenderLayerCompositor::updateRootLayerPosition):
(WebCore::RenderLayerCompositor::ensureRootLayer):
2016-11-04 Simon Fraser <simon.fraser@apple.com>
Layout viewport wrong with RTL documents
https://bugs.webkit.org/show_bug.cgi?id=164434
Reviewed by Tim Horton.
The layoutViewportRect was computed incorrectly in RTL documents, because
FrameView::unscaledMaximumScrollPosition() was wrong; it erroneously mapped
what it thought was a scrollOffset to a scrollPosition.
Unscaled scroll positions are in the same coordinate space as unscaledDocumentRect,
so we should not call scrollPositionFromOffset() in FrameView::unscaledMaximumScrollPosition().
Changed FrameView::unscaledMinimumScrollPosition() to also just grab the location of
unscaledDocumentRect, for symmetry.
Finally fixed the tiled scrolling indicator's viewport rect for zoomed RTL documents
by using the unscaled scroll origin.
Tests: fast/visual-viewport/rtl-nonzoomed-rects.html
fast/visual-viewport/rtl-zoomed-rects.html
* page/FrameView.cpp:
(WebCore::FrameView::setLayoutViewportOrigin):
(WebCore::FrameView::unscaledScrollOrigin):
(WebCore::FrameView::unscaledMinimumScrollPosition):
(WebCore::FrameView::unscaledMaximumScrollPosition):
* page/FrameView.h:
2016-11-04 Sam Weinig <sam@webkit.org>
[WebIDL] Add support for modern callback syntax
https://bugs.webkit.org/show_bug.cgi?id=164435
Reviewed by Chris Dumez.
Support new callback syntax:
callback Function = void (DOMString arg1, long arg2);
This replaces "callback interface" types with a Callback=FunctionOnly
extended attribute.
* Modules/geolocation/PositionCallback.idl:
* Modules/geolocation/PositionErrorCallback.idl:
* Modules/notifications/NotificationPermissionCallback.idl:
* Modules/quota/StorageErrorCallback.idl:
* Modules/quota/StorageQuotaCallback.idl:
* Modules/quota/StorageUsageCallback.idl:
* Modules/webaudio/AudioBufferCallback.idl:
* Modules/webdatabase/DatabaseCallback.idl:
* Modules/webdatabase/SQLStatementCallback.idl:
* Modules/webdatabase/SQLStatementErrorCallback.idl:
* Modules/webdatabase/SQLTransactionCallback.idl:
* Modules/webdatabase/SQLTransactionErrorCallback.idl:
* dom/RequestAnimationFrameCallback.idl:
* dom/StringCallback.idl:
* html/VoidCallback.idl:
* page/IntersectionObserverCallback.idl:
* css/MediaQueryListListener.idl:
Update to new syntax.
* css/MediaQueryListListener.h:
* css/MediaQueryMatcher.cpp:
(WebCore::MediaQueryMatcher::styleResolverChanged):
Switch to using the now required 'handleEvent' name. This is an implementation detail
that we should change.
* bindings/scripts/CodeGenerator.pm:
Update document processing to allow a callback only file. Update callback
type checks to look for a regex that matches in the new format.
* bindings/scripts/CodeGeneratorJS.pm:
(AddToImplIncludesForIDLType):
(AddToIncludesForIDLType):
(AddToImplIncludes):
(AddToIncludes):
Abstract includes functions to allow passing in an include hash.
(GenerateCallbackFunctionHeader):
(GenerateCallbackFunctionImplementation):
(GenerateCallbackInterfaceHeader):
(GenerateCallbackInterfaceImplementation):
(GenerateCallbackHeaderContent):
(GenerateCallbackImplementationContent):
Refactor callback generation code into GenerateCallbackHeaderContent and GenerateCallbackImplementationContent
to allow using it for both the new callbacks as well as the old callback interfaces.
* bindings/scripts/IDLParser.pm:
(Parse):
(applyTypedefs):
(applyTypedefsToOperation):
(parseCallbackRest):
Parse callbacks into the new IDLCallbackFunction type. Ensure that typedefs are applied as well.
* bindings/scripts/IDLAttributes.txt:
Remove support for Callback=FunctionOnly.
* bindings/scripts/test/JS/JSTestCallback.cpp: Removed.
* bindings/scripts/test/JS/JSTestCallback.h: Removed.
* bindings/scripts/test/JS/JSTestCallbackFunction.cpp:
* bindings/scripts/test/JS/JSTestCallbackFunction.h:
* bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.cpp: Added.
* bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.h: Added.
* bindings/scripts/test/JS/JSTestCallbackInterface.cpp: Copied from Source/WebCore/bindings/scripts/test/JS/JSTestCallback.cpp.
* bindings/scripts/test/JS/JSTestCallbackInterface.h: Copied from Source/WebCore/bindings/scripts/test/JS/JSTestCallback.h.
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
* bindings/scripts/test/TestCallback.idl: Removed.
* bindings/scripts/test/TestCallbackFunction.idl:
* bindings/scripts/test/TestCallbackFunctionWithTypedefs.idl: Added.
* bindings/scripts/test/TestCallbackInterface.idl: Copied from Source/WebCore/bindings/scripts/test/TestCallback.idl.
* bindings/scripts/test/TestObj.idl:
* bindings/scripts/test/TestTypedefs.idl:
Update existing tests and add new ones to test callback functions specifically.
2016-11-04 Alex Christensen <achristensen@webkit.org>
Move isDefaultPortForProtocol from URLParser.cpp back to URL.cpp
https://bugs.webkit.org/show_bug.cgi?id=164439
Reviewed by Daniel Bates.
No change in behaviour.
* platform/URL.cpp:
(WebCore::defaultPortForProtocol):
(WebCore::isDefaultPortForProtocol):
* platform/URLParser.cpp:
(WebCore::URLParser::defaultPortForProtocol):
(WebCore::URLParser::parsePort):
(WebCore::defaultPortForProtocol): Deleted.
(WebCore::isDefaultPortForProtocol): Deleted.
* platform/URLParser.h:
2016-11-04 Wenson Hsieh <wenson_hsieh@apple.com>
Safari does not emit composition end if blurred for dead key / Japanese IME
https://bugs.webkit.org/show_bug.cgi?id=164369
<rdar://problem/29050439>
Reviewed by Ryosuke Niwa.
On Mac, _before_ changing selection, try to finalize the composition by calling Editor::cancelComposition early.
This is because the focused element may have changed after performing the selection change, so we would
otherwise be dispatching the `compositionend` to the new focused element (or no compositionend at all) instead
of the element with the composition.
Doing this allows us to match Chrome and Firefox behavior. After canceling the composition, we then need to also
clear the system IME state. We do this on Mac WK1/WK2 through the cancelComposition() codepath, which ends up
calling into -discardMarkedText, which resets the marked text state. Some minor refactoring was performed to
accomplish this -- currently, discardedComposition sends a CompositionWasCanceled message over to the UI process
that discards the marked text, and then updates the editor state. This patch splits this into two separate
steps -- see the WebKit2 ChangeLog for more details.
Test: fast/events/ime-compositionend-on-selection-change.html
* editing/Editor.cpp:
(WebCore::Editor::selectionWillChange):
* editing/Editor.h:
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::setSelectionWithoutUpdatingAppearance):
* editing/mac/EditorMac.mm:
(WebCore::Editor::selectionWillChange):
* loader/EmptyClients.h:
* page/EditorClient.h:
2016-11-04 Brady Eidson <beidson@apple.com>
IndexedDB 2.0: Clean up more transaction abort and exception throwing behavior from IDBObjectStore.
https://bugs.webkit.org/show_bug.cgi?id=164424
Reviewed by Alex Christensen.
No new tests (Covered by existing tests).
This patch actually turns a handful of PASS to FAIL in the imported tests, but those are parts of the
spec in flux/under discussion.
We'll update either source or the tests as things are resolved.
* Modules/indexeddb/IDBIndex.cpp:
(WebCore::IDBIndex::rollbackInfoForVersionChangeAbort):
* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::get):
(WebCore::IDBObjectStore::putOrAdd):
(WebCore::IDBObjectStore::rollbackForVersionChangeAbort):
2016-11-04 Ryosuke Niwa <rniwa@webkit.org>
Load stylesheets in link elements inside a connected shadow tree
https://bugs.webkit.org/show_bug.cgi?id=160683
<rdar://problem/29040652>
Reviewed by Antti Koivisto.
Allow external stylesheets within a shadow tree by storing the appropriate style scope in HTMLLinkElement
when it's connected to a document instead of always talking to document's style scope.
Tests: fast/shadow-dom/link-element-in-shadow-tree.html
fast/shadow-dom/selected-stylesheet-in-shadow-tree.html
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::HTMLLinkElement):
(WebCore::HTMLLinkElement::~HTMLLinkElement):
(WebCore::HTMLLinkElement::setDisabledState): Exit early when the element is not in a document as invoking
didChangeActiveStyleSheetCandidates would require having a valid m_styleScope and process() already exits
early when inDocument() is false.
(WebCore::HTMLLinkElement::parseAttribute):
(WebCore::HTMLLinkElement::process): Removed the early exit for when the element is in a shadow tree.
(WebCore::HTMLLinkElement::insertedInto): Exit early unless this element has just become connected to
a document instead of whenever its self-inclusive ancestor is inserted into a container.
(WebCore::HTMLLinkElement::removedFrom): Ditto for removal. Also call removeStyleSheetCandidateNode after
calling removePendingSheet since the latter depends on m_styleScope being not null.
(WebCore::HTMLLinkElement::addPendingSheet):
(WebCore::HTMLLinkElement::removePendingSheet):
* html/HTMLLinkElement.h:
* html/HTMLStyleElement.cpp:
(WebCore::HTMLStyleElement::insertedInto): Only call inline style owner's insertedIntoDocument if this
element has just become connected to a document.
(WebCore::HTMLStyleElement::removedFrom): Ditto for the removal.
* style/StyleScope.h:
* svg/SVGStyleElement.cpp:
(WebCore::SVGStyleElement::insertedInto): Ditto.
(WebCore::SVGStyleElement::removedFrom): Ditto for the removal.
2016-11-04 Said Abou-Hallawa <sabouhallawa@apple.com>
Add a setting and preferences to enable/disable async image decoding
https://bugs.webkit.org/show_bug.cgi?id=164417
Reviewed by Simon Fraser.
Add an asyncImageDecodingEnabled setting. This setting controls whether an
image "can" be asynchronously decoded on a separate thread or not. The
function ImageSource::isAsyncDecodingRequired() will be used in conjunction
with this setting to decide whether an image "should" be asynchronously
decoded or not.
* page/Settings.in:
2016-11-04 Tim Horton <timothy_horton@apple.com>
Apply post-landing review comments for r208347
* dom/Element.cpp:
(WebCore::Element::findAnchorElementForLink):
Use attributeWithoutSynchronization.
* page/PrintContext.cpp:
(WebCore::PrintContext::spoolPage):
(WebCore::PrintContext::spoolRect):
(WebCore::PrintContext::collectLinkedDestinations):
(WebCore::PrintContext::outputLinkedDestinations):
* page/PrintContext.h:
Pass Document by reference instead of Node by pointer,
use ElementTraversal instead of NodeTraversal to avoid
having to locally check the type, and null-check renderers.
2016-11-04 Myles C. Maxfield <mmaxfield@apple.com>
Implement WebGL2RenderingContext::copyBufferSubData()
https://bugs.webkit.org/show_bug.cgi?id=164008
Reviewed by Dean Jackson.
Similar to previous work regarding WebGL 2 buffers, this method implements
the ability to copy from one buffer to another without the data leaving
the GPU.
Test: fast/canvas/webgl/copyBufferSubData.html
* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::copyBufferSubData):
* html/canvas/WebGLBuffer.cpp:
(WebCore::WebGLBuffer::associateCopyBufferSubData):
* html/canvas/WebGLBuffer.h:
* platform/graphics/GraphicsContext3D.h:
* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
(WebCore::GraphicsContext3D::copyBufferSubData):
2016-11-04 Simon Fraser <simon.fraser@apple.com>
Rename some ScrollingTree/Node-related functions to reduce the number of uses of "update"
https://bugs.webkit.org/show_bug.cgi?id=164420
Reviewed by Tim Horton.
Rename:
commitNewTreeState -> commitTreeState ("new" was redundant)
updateBeforeChildren -> commitStateBeforeChildren
updateAfterChildren -> commitStateAfterChildren
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::commitTreeState):
(WebCore::ScrollingTree::updateTreeFromStateNode):
(WebCore::ScrollingTree::commitNewTreeState): Deleted.
* page/scrolling/ScrollingTree.h:
* page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
(WebCore::ScrollingTreeFrameScrollingNode::commitStateBeforeChildren):
(WebCore::ScrollingTreeFrameScrollingNode::updateBeforeChildren): Deleted.
* page/scrolling/ScrollingTreeFrameScrollingNode.h:
* page/scrolling/ScrollingTreeNode.h:
(WebCore::ScrollingTreeNode::commitStateAfterChildren):
(WebCore::ScrollingTreeNode::updateAfterChildren): Deleted.
* page/scrolling/ScrollingTreeScrollingNode.cpp:
(WebCore::ScrollingTreeScrollingNode::commitStateBeforeChildren):
(WebCore::ScrollingTreeScrollingNode::commitStateAfterChildren):
(WebCore::ScrollingTreeScrollingNode::updateBeforeChildren): Deleted.
(WebCore::ScrollingTreeScrollingNode::updateAfterChildren): Deleted.
* page/scrolling/ScrollingTreeScrollingNode.h:
* page/scrolling/ThreadedScrollingTree.cpp:
(WebCore::ThreadedScrollingTree::commitTreeState):
(WebCore::ThreadedScrollingTree::commitNewTreeState): Deleted.
* page/scrolling/ThreadedScrollingTree.h:
* page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h:
* page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm:
(WebCore::ScrollingTreeFrameScrollingNodeIOS::commitStateBeforeChildren):
(WebCore::ScrollingTreeFrameScrollingNodeIOS::commitStateAfterChildren):
(WebCore::ScrollingTreeFrameScrollingNodeIOS::updateBeforeChildren): Deleted.
(WebCore::ScrollingTreeFrameScrollingNodeIOS::updateAfterChildren): Deleted.
* page/scrolling/ios/ScrollingTreeIOS.cpp:
(WebCore::ScrollingTreeIOS::commitNewTreeState): Deleted.
* page/scrolling/ios/ScrollingTreeIOS.h:
* page/scrolling/mac/ScrollingCoordinatorMac.mm:
(WebCore::ScrollingCoordinatorMac::commitTreeState):
* page/scrolling/mac/ScrollingTreeFixedNode.h:
* page/scrolling/mac/ScrollingTreeFixedNode.mm:
(WebCore::ScrollingTreeFixedNode::commitStateBeforeChildren):
(WebCore::ScrollingTreeFixedNode::updateBeforeChildren): Deleted.
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
(WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren):
(WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateAfterChildren):
(WebCore::ScrollingTreeFrameScrollingNodeMac::updateBeforeChildren): Deleted.
(WebCore::ScrollingTreeFrameScrollingNodeMac::updateAfterChildren): Deleted.
* page/scrolling/mac/ScrollingTreeStickyNode.h:
* page/scrolling/mac/ScrollingTreeStickyNode.mm:
(WebCore::ScrollingTreeStickyNode::commitStateBeforeChildren):
(WebCore::ScrollingTreeStickyNode::updateBeforeChildren): Deleted.
2016-11-03 Anders Carlsson <andersca@apple.com>
Add new 'other' Apple Pay button style
https://bugs.webkit.org/show_bug.cgi?id=164384
rdar://problem/28302528
Reviewed by Dean Jackson.
* DerivedSources.make:
* WebCorePrefix.h:
Add extension points.
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
Add ApplePayButtonType::Other.
(WebCore::CSSPrimitiveValue::operator ApplePayButtonType):
Add CSSValueOther.
* css/CSSValueKeywords.in:
Add other.
* css/parser/CSSParser.cpp:
(WebCore::isValidKeywordPropertyAndValue):
Add CSSValueOther.
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
Add CSSValueOther.
* rendering/RenderThemeCocoa.mm:
(WebCore::toPKPaymentButtonType):
Handle ApplePayButtonType::Other.
* rendering/style/RenderStyleConstants.h:
Add ApplePayButtonType::Other.
2016-11-04 Antti Koivisto <antti@apple.com>
slotted() pseudo does not work with ID selector
https://bugs.webkit.org/show_bug.cgi?id=160538
<rdar://problem/28534529>
Reviewed by Andreas Kling.
When we saw an id selector while addin rules we immediately threw it into the m_idRules
optimization bucket and bailed out. However selectors containing ::slotted must always end
up in m_slottedPseudoElementRules list no matter what else is there.
Fix by treating id like other selectors and only choosing the bucket after analysing all
the selector components.
Test: fast/shadow-dom/css-scoping-slot-with-id.html
* css/RuleSet.cpp:
(WebCore::RuleSet::addRule): Also made this use switch instead of a series of ifs.
2016-11-04 Brady Eidson <beidson@apple.com>
IndexedDB 2.0: Handle IDBObjectStore rename behavior properly when version change transaction aborts.
https://bugs.webkit.org/show_bug.cgi?id=164416
Reviewed by Beth Dakin.
No new tests (Covered by existing tests).
* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::rollbackForVersionChangeAbort):
2016-11-04 Keith Rollin <krollin@apple.com>
NetworkSession: Add NetworkDataTask implementation for blobs
https://bugs.webkit.org/show_bug.cgi?id=163939
Reviewed by Alex Christensen.
* WebCore.xcodeproj/project.pbxproj: Mark HTTPParsers.h and AsyncFileStream.h as private.
* fileapi/AsyncFileStream.h: Add WEBCORE_EXPORT to AsyncFileStream class.
* platform/network/BlobData.h: Add WEBCORE_EXPORT to length().
* platform/network/HTTPParsers.h: Add WEBCORE_EXPORT to parseRange().
* platform/network/ResourceResponseBase.h: Add WEBCORE_EXPORT to setHTTPHeaderField().
2016-11-04 Brady Eidson <beidson@apple.com>
IndexedDB 2.0: Use IDB-specific exceptions in places where the generic exceptions are currently used.
https://bugs.webkit.org/show_bug.cgi?id=164406
Reviewed by Alex Christensen.
No new tests (Covered by existing tests).
* Modules/indexeddb/IDBIndex.cpp:
(WebCore::IDBIndex::setName):
* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::setName):
2016-11-04 Joanmarie Diggs <jdiggs@igalia.com>
AX: [ATK] Attempting to clear selection on ARIA listboxes results in crash
https://bugs.webkit.org/show_bug.cgi?id=164331
Reviewed by Chris Fleizach.
The ATK code is using is<AccessibilityListBox>() to identify native listboxes.
But is<AccessibilityListBox>() returns the value of isListBox() which returns
true both for AccessibilityListBox instances as well as for AccessibilityObject
instances which have an AccessibilityRole value of ListBoxRole. Because only
native listboxes should be AccessibilityListBoxes, add isNativeListBox() so
that we can distinguish native and ARIA listboxes.
Tests: accessibility/aria-listbox-clear-selection-crash.html
accessibility/listbox-clear-selection.html
* accessibility/AccessibilityListBox.h:
* accessibility/AccessibilityObject.h:
(WebCore::AccessibilityObject::isNativeListBox):
(WebCore::AccessibilityObject::isListBox):
2016-11-04 Brady Eidson <beidson@apple.com>
IndexedDB 2.0: Throw the correct exceptions during IDBObjectStore/IDBIndex renaming.
https://bugs.webkit.org/show_bug.cgi?id=164405
Reviewed by Alex Christensen.
No new tests (Covered by existing tests).
* Modules/indexeddb/IDBIndex.cpp:
(WebCore::IDBIndex::setName):
* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::setName):
2016-11-04 Romain Bellessort <romain.bellessort@crf.canon.fr>
[Readable Streams API] Implement ByteStreamController error()
https://bugs.webkit.org/show_bug.cgi?id=164319
Reviewed by Youenn Fablet.
Implemented error() method of ReadableByteStreamController.
Updated test expectations for error() and added IDL-related tests.
* Modules/streams/ReadableByteStreamController.js:
(error): Implemented.
* Modules/streams/ReadableByteStreamInternals.js:
(privateInitializeReadableByteStreamController):
(isReadableByteStreamController): Added.
(readableByteStreamControllerError): Added.
(readableByteStreamControllerClearPendingPullIntos): Added.
* Modules/streams/ReadableStream.js:
(initializeReadableStream): More detailed error message.
* Modules/streams/ReadableStreamDefaultController.js:
(error): Removed unnecessary variable declaration.
* bindings/js/WebCoreBuiltinNames.h: Added totalQueuedBytes.
2016-11-03 Brady Eidson <beidson@apple.com>
IndexedDB 2.0: Handle IDBIndex rename behavior properly when version change transaction aborts.
https://bugs.webkit.org/show_bug.cgi?id=164403
Reviewed by Alex Christensen.
No new tests (Covered by existing test).
* Modules/indexeddb/IDBIndex.cpp:
(WebCore::IDBIndex::rollbackInfoForVersionChangeAbort): Only rollback the info if this index
already existed before this version change transaction.
2016-11-03 Youenn Fablet <youenn@apple.com>
[WebRTC] Introduce asynchronous backend createOffer API
https://bugs.webkit.org/show_bug.cgi?id=164365
Reviewed by Sam Weinig.
Covered by existing tests.
Removing PeerEndpointBackendClient as it is only RTCPeerConnection.
This allows removing virtual for some functions.
Moving MediaEndpointPeerClient::m_client to PeerEndpointBackendClient::m_peerConnection and making it a reference.
Implementing createOffer at PeerConnectionBackend by splitting it in four sub-functions:
- main createOffer, implemented at PeerConnectionBackend.
- doCreateOffer implemented by subclasses (MediaEndpointPeerConnection).
- createOfferSucceeded/createOfferFailed implemented by PeerConnectionBackend.
* CMakeLists.txt:
* Modules/mediastream/MediaEndpointPeerConnection.cpp:
(WebCore::createMediaEndpointPeerConnection):
(WebCore::MediaEndpointPeerConnection::MediaEndpointPeerConnection):
(WebCore::MediaEndpointPeerConnection::doCreateOffer):
(WebCore::MediaEndpointPeerConnection::createOfferTask):
(WebCore::MediaEndpointPeerConnection::createAnswerTask):
(WebCore::MediaEndpointPeerConnection::setLocalDescriptionTask):
(WebCore::MediaEndpointPeerConnection::setRemoteDescriptionTask):
(WebCore::MediaEndpointPeerConnection::addIceCandidateTask):
(WebCore::MediaEndpointPeerConnection::createReceiver):
(WebCore::MediaEndpointPeerConnection::replaceTrack):
(WebCore::MediaEndpointPeerConnection::replaceTrackTask):
(WebCore::MediaEndpointPeerConnection::markAsNeedingNegotiation):
(WebCore::MediaEndpointPeerConnection::localDescriptionTypeValidForState):
(WebCore::MediaEndpointPeerConnection::remoteDescriptionTypeValidForState):
(WebCore::MediaEndpointPeerConnection::gotIceCandidate):
(WebCore::MediaEndpointPeerConnection::doneGatheringCandidates):
(WebCore::MediaEndpointPeerConnection::iceTransportStateChanged):
(WebCore::MediaEndpointPeerConnection::createOffer): Deleted.
* Modules/mediastream/MediaEndpointPeerConnection.h:
* Modules/mediastream/PeerConnectionBackend.cpp:
(WebCore::PeerConnectionBackend::createOffer):
(WebCore::PeerConnectionBackend::createOfferSucceeded):
(WebCore::PeerConnectionBackend::createOfferFailed):
(WebCore::createPeerConnectionBackend): Deleted.
* Modules/mediastream/PeerConnectionBackend.h:
(WebCore::PeerConnectionBackend::PeerConnectionBackend):
(WebCore::PeerConnectionBackendClient::~PeerConnectionBackendClient): Deleted.
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::RTCPeerConnection):
* Modules/mediastream/RTCPeerConnection.h:
* WebCore.xcodeproj/project.pbxproj:
2016-11-03 Antti Koivisto <antti@apple.com>
REGRESSION (r207717): DumpRenderTree crashed in com.apple.WebCore: WebCore::Style::Scope::flushPendingUpdate + 16
https://bugs.webkit.org/show_bug.cgi?id=164397
<rdar://problem/29100135>
Reviewed by Ryosuke Niwa.
The problem here was that we were leaving stale pointers to Document::m_inDocumentShadowRoots set when
using fast-path document teardown.
(Patch and stories mostly by rniwa).
* dom/Document.cpp:
(WebCore::Document::~Document):
(WebCore::Document::didInsertInDocumentShadowRoot):
(WebCore::Document::didRemoveInDocumentShadowRoot):
Improve asserts.
* dom/Element.cpp:
(WebCore::Element::removeShadowRoot):
Remove the superfluous call to notifyChildNodeRemoved in Element::removeShadowRoot to
avoid invoking notifyChildNodeRemoved during a document teardown, which is incorrect. It's sufficient that
~ShadowRoot calls ContainerNode::removeDetachedChildren(), and in turn removeDetachedChildrenInContainer()
since the latter function tears down nodes via the deletion queue during a document destruction and use
notifyChildNodeRemoved() on nodes that outlive the shadow root.
* dom/ShadowRoot.cpp:
(WebCore::ShadowRoot::~ShadowRoot):
Take care to clean up inDocumentShadowRoots for fast-pathed destruction too.
(WebCore::ShadowRoot::insertedInto):
(WebCore::ShadowRoot::removedFrom):
Improve ShadowRoot's insertedInto and removedFrom so that they only try to add and remove itself from
m_inDocumentShadowRoots when the connected-ness changes.
2016-11-03 Simon Fraser <simon.fraser@apple.com>
Give all the geometry classes a single-argument scale() function for consistency
https://bugs.webkit.org/show_bug.cgi?id=164400
Reviewed by Zalan Bujtas.
Add single-argument scale() to FloatPoint, FloatQuad, FloatSize and LayoutPoint, as well
as adding one to GraphicsContext. Switch callers who passed the same value for sx and sy
to the new functions.
* dom/Document.cpp:
(WebCore::Document::adjustFloatQuadsForScrollAndAbsoluteZoomAndFrameScale):
* dom/MouseRelatedEvent.cpp:
(WebCore::MouseRelatedEvent::init):
(WebCore::MouseRelatedEvent::computeRelativePosition):
* dom/TreeScope.cpp:
(WebCore::TreeScope::nodeFromPoint):
* page/PrintContext.cpp:
(WebCore::PrintContext::spoolPage):
* platform/cocoa/ThemeCocoa.mm:
(WebCore::fitContextToBox):
* platform/graphics/FloatPoint.h:
(WebCore::FloatPoint::scale):
* platform/graphics/FloatQuad.h:
(WebCore::FloatQuad::scale):
* platform/graphics/FloatSize.h:
(WebCore::FloatSize::scale):
* platform/graphics/GraphicsContext.cpp:
(WebCore::GraphicsContext::applyDeviceScaleFactor):
* platform/graphics/GraphicsContext.h:
(WebCore::GraphicsContext::scale):
* platform/graphics/LayoutPoint.h:
(WebCore::LayoutPoint::scale):
* platform/graphics/ca/TileCoverageMap.cpp:
(WebCore::TileCoverageMap::update):
* platform/graphics/ca/TileGrid.cpp:
(WebCore::TileGrid::platformCALayerPaintContents):
* platform/graphics/cg/ImageBufferCG.cpp:
(WebCore::ImageBuffer::drawConsuming):
(WebCore::ImageBuffer::draw):
(WebCore::ImageBuffer::drawPattern):
* platform/mac/ThemeMac.mm:
(WebCore::paintToggleButton):
(WebCore::paintButton):
(WebCore::paintStepper):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::nodeAtPoint):
* rendering/RenderMediaControls.cpp:
(WebCore::getUnzoomedRectAndAdjustCurrentContext):
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::paintMenuList):
(WebCore::RenderThemeMac::paintSliderThumb):
(WebCore::RenderThemeMac::paintSearchField):
(WebCore::RenderThemeMac::paintSearchFieldCancelButton):
(WebCore::RenderThemeMac::paintSearchFieldResultsButton):
* rendering/svg/SVGInlineTextBox.cpp:
(WebCore::SVGInlineTextBox::selectionRectForTextFragment):
(WebCore::SVGInlineTextBox::paintDecorationWithStyle):
(WebCore::SVGInlineTextBox::paintTextWithShadows):
* svg/SVGPathBlender.cpp:
(WebCore::SVGPathBlender::blendAnimatedFloatPoint):
(WebCore::SVGPathBlender::blendArcToSegment):
* svg/SVGPathParser.cpp:
(WebCore::SVGPathParser::parseCurveToCubicSmoothSegment):
(WebCore::SVGPathParser::parseCurveToQuadraticSegment):
(WebCore::SVGPathParser::parseCurveToQuadraticSmoothSegment):
(WebCore::SVGPathParser::decomposeArcToCubic):
* svg/SVGSVGElement.cpp:
(WebCore::SVGSVGElement::localCoordinateSpaceTransform):
2016-11-03 Antti Koivisto <antti@apple.com>
REGRESSION (r207669): Crash under media controls shadow root construction
https://bugs.webkit.org/show_bug.cgi?id=164381
<rdar://problem/28935401>
Reviewed by Simon Fraser.
The problem is that we are running a script for media control UA shadow tree in HTMLMediaElement::insertedInto.
It is not safe to run scripts in insertedInto as the tree is in inconsistent state. Instead finishedInsertingSubtree
callback should be used.
Test: media/media-controls-shadow-construction-crash.html
Seen on https://www.theguardian.com/artanddesign/video/2013/oct/14/banksy-central-park-new-york-video
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::insertedInto):
(WebCore::HTMLMediaElement::finishedInsertingSubtree):
Move configureMediaControls() to finishedInsertingSubtree().
* html/HTMLMediaElement.h:
* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::resolveComposedTree):
Add an assert to make the bad state easier to hit in tests.
2016-11-03 Ryosuke Niwa <rniwa@webkit.org>
Add an assertion to diagnose stress GC bots test failures
https://bugs.webkit.org/show_bug.cgi?id=164396
Reviewed by Antti Koivisto.
Added an assertion for calling ElementQueue::add while ElementQueue::invokeAll is in progress.
This should never happen as long as all DOM API has an appropriate CEReactions IDL attribute.
* dom/CustomElementReactionQueue.cpp:
(WebCore::CustomElementReactionStack::ElementQueue::add):
(WebCore::CustomElementReactionStack::ElementQueue::invokeAll):
* dom/CustomElementReactionQueue.h:
2016-11-03 Said Abou-Hallawa <sabouhallawa@apple.com>
Add the asynchronous image decoding mode
https://bugs.webkit.org/show_bug.cgi?id=155546
Reviewed by Simon Fraser.
The asynchronous image decoding feature targets enhancing the rendering
in two scenarios: the animated images and scrolling a page which large
images. Enabling this feature for these two scenarios will be landed
separately.
The goal of the asynchronous image decoding is to have the decoded image
frame ready before it has to be drawn. Drawing an image does not have to
wait the image frame to be decoded.
* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::frameImageAtIndex): Use the negation of frameHasValidNativeImageAtIndex().
* platform/graphics/BitmapImage.h:
(WebCore::BitmapImage::frameIsBeingDecodedAtIndex): Answers whether a frame is being decoded.
(WebCore::BitmapImage::frameHasValidNativeImageAtIndex): Checks the validity of a frame.
(WebCore::BitmapImage::frameHasInvalidNativeImageAtIndex): Deleted.
* platform/graphics/Image.h:
(WebCore::Image::newFrameNativeImageAvailableAtIndex): Notifies the image with the availability of a frame NativeImage.
* platform/graphics/ImageFrame.h:
(WebCore::ImageFrame::isBeingDecoded): Answers whether the frame is being decoded.
(WebCore::ImageFrame::hasValidNativeImage): Checks the validity of the frame.
(WebCore::ImageFrame::hasInvalidNativeImage): Deleted.
* platform/graphics/ImageFrameCache.cpp:
(WebCore::ImageFrameCache::~ImageFrameCache): Asserts the decoding loop was ended before deleting the ImageFrameCache.
(WebCore::ImageFrameCache::setFrameNativeImageAtIndex): Rename this function to matches the other which take the frame index.
(WebCore::ImageFrameCache::setFrameMetadataAtIndex): Ditto.
(WebCore::ImageFrameCache::replaceFrameNativeImageAtIndex): It setts the ImageFrame's members and updates the decoded size.
(WebCore::ImageFrameCache::cacheFrameNativeImageAtIndex): Replaces the frame NativeImage and notifies the Image with the new frame.
(WebCore::ImageFrameCache::decodingQueue): Ensures the decoding WorkQueue is created and returns it.
(WebCore::ImageFrameCache::startAsyncDecodingQueue): Starts a decoding WorkQueue which loops until m_frameRequestQueue is closed.
(WebCore::ImageFrameCache::requestFrameAsyncDecodingAtIndex): Allows ImageSource to send a request to start asynchronous frame image decoding.
(WebCore::ImageFrameCache::stopAsyncDecodingQueue): Stops the decoding WorkQueue by closing m_frameRequestQueue.
(WebCore::ImageFrameCache::frameAtIndex): Call replaceFrameNativeImageAtIndex().
(WebCore::ImageFrameCache::frameIsBeingDecodedAtIndex): Returns true if a request for the image frame is issued but not finished yet.
(WebCore::ImageFrameCache::frameHasValidNativeImageAtIndex): Checks the validity of a frame.
(WebCore::ImageFrameCache::setFrameNativeImage): Deleted. Was renamed to be setFrameNativeImageAtIndex.
(WebCore::ImageFrameCache::setFrameMetadata): Deleted. Was renamed to be setFrameMetadataAtIndex
(WebCore::ImageFrameCache::frameHasInvalidNativeImageAtIndex): Deleted. Was renamed to be frameHasValidNativeImageAtIndex.
* platform/graphics/ImageFrameCache.h:
(WebCore::ImageFrameCache::create): The decoding queue needs to hold a reference to this class so it can stop decoding safely without blocking.
(WebCore::ImageFrameCache::hasDecodingQueue): Returns true if a decoding queue has started.
* platform/graphics/ImageSource.cpp:
(WebCore::ImageSource::ImageSource): Call ImageFrameCache::create().
(WebCore::ImageSource::clear): Deleting the decoder is unnecessary for asynchronous decoding because ImageFrameCache manages all the memory.
(WebCore::ImageSource::destroyDecodedData):
(WebCore::ImageSource::destroyDecodedDataIfNecessary):
(WebCore::ImageSource::ensureDecoderAvailable):
(WebCore::ImageSource::dataChanged):
(WebCore::ImageSource::isAllDataReceived):
(WebCore::ImageSource::isAsyncDecodingRequired): Answers the question whether the async image decoding is required for this ImageSource.
(WebCore::ImageSource::frameImageAtIndex):
* platform/graphics/ImageSource.h:
(WebCore::ImageSource::decodedSize):
(WebCore::ImageSource::requestFrameAsyncDecodingAtIndex):
(WebCore::ImageSource::stopAsyncDecodingQueue):
(WebCore::ImageSource::isSizeAvailable):
(WebCore::ImageSource::frameCount):
(WebCore::ImageSource::repetitionCount):
(WebCore::ImageSource::filenameExtension):
(WebCore::ImageSource::hotSpot):
(WebCore::ImageSource::size):
(WebCore::ImageSource::sizeRespectingOrientation):
(WebCore::ImageSource::singlePixelSolidColor):
(WebCore::ImageSource::frameIsBeingDecodedAtIndex):
(WebCore::ImageSource::frameIsCompleteAtIndex):
(WebCore::ImageSource::frameHasAlphaAtIndex):
(WebCore::ImageSource::frameHasImageAtIndex):
(WebCore::ImageSource::frameSubsamplingLevelAtIndex):
(WebCore::ImageSource::frameSizeAtIndex):
(WebCore::ImageSource::frameBytesAtIndex):
(WebCore::ImageSource::frameDurationAtIndex):
(WebCore::ImageSource::frameOrientationAtIndex):
Make m_frameCache a type Ref<ImageFrameCache>. Use '->' instead of '.' when accessing its members.
(WebCore::ImageSource::frameHasValidNativeImageAtIndex): Checks the validity of a frame.
(WebCore::ImageSource::frameHasInvalidNativeImageAtIndex): Deleted. Was renamed to be frameHasValidNativeImageAtIndex.
2016-11-03 Myles C. Maxfield <mmaxfield@apple.com>
[WebGL2] Implement getBufferSubData()
https://bugs.webkit.org/show_bug.cgi?id=164111
Reviewed by Dean Jackson.
The call exists in OpenGL 3.2 but in order to have parity with
OpenGL ES 3 we back it with glMapBufferRange() instead.
This patch simply adds surface area to GraphicsContext3D
until we can get an ANGLE implementation of it.
When testing this patch I discovered that r207649 incorrectly
interpreted arguments to bufferData() and bufferSubData() as
byte offsets. Instead, they should be element indices. This
patch fixes those functions to work correctly so that
getBufferSubData() can be tested correctly.
Tests: fast/canvas/webgl/webgl2-buffers.html
fast/canvas/webgl/getBufferSubData-webgl1.html
* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::arrayBufferViewElementSize):
(WebCore::WebGL2RenderingContext::bufferData):
(WebCore::WebGL2RenderingContext::bufferSubData):
(WebCore::WebGL2RenderingContext::getBufferSubData):
* html/canvas/WebGL2RenderingContext.h:
* html/canvas/WebGL2RenderingContext.idl:
* platform/graphics/GraphicsContext3D.h:
* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
(WebCore::GraphicsContext3D::getBufferSubData):
(WebCore::GraphicsContext3D::mapBufferRange):
(WebCore::GraphicsContext3D::unmapBuffer):
2016-11-03 Chris Dumez <cdumez@apple.com>
Unreviewed, mark support for the 'download' attribute as 'Done'.
* features.json:
2016-11-03 Chris Dumez <cdumez@apple.com>
[WK2][Cocoa] Implement user interface for HTML form validation
https://bugs.webkit.org/show_bug.cgi?id=164143
<rdar://problem/28944652>
Reviewed by Simon Fraser.
Add ValidationBubble class to show HTML form validation messages
using native dialogs. It currently has an implementation for both
Mac and iOS. It is in WebCore under platform/ so that it can be
used by both WebKit1 and WebKit2.
Update ownership of ValidationMessageClient so that is is owned
by the Page using a unique_ptr<>, which seems to be the modern
way of handling lifetime for page clients.
Test: fast/forms/validation-messages.html
* WebCore.xcodeproj/project.pbxproj:
* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::focusAndShowValidationMessage):
* html/ValidationMessage.cpp:
(WebCore::ValidationMessage::updateValidationMessage):
* page/Page.cpp:
(WebCore::Page::Page):
(WebCore::Page::~Page):
* page/Page.h:
(WebCore::Page::validationMessageClient):
* page/PageConfiguration.cpp:
* page/PageConfiguration.h:
* platform/ValidationBubble.h: Copied from Tools/DumpRenderTree/mac/UIScriptControllerMac.mm.
(WebCore::ValidationBubble::message):
* platform/ios/ValidationBubbleIOS.mm: Added.
(-[WebValidationBubbleDelegate adaptivePresentationStyleForPresentationController:traitCollection:]):
(WebCore::ValidationBubble::ValidationBubble):
(WebCore::ValidationBubble::~ValidationBubble):
(WebCore::ValidationBubble::show):
(WebCore::ValidationBubble::setAnchorRect):
* platform/mac/ValidationBubbleMac.mm: Added.
(WebCore::ValidationBubble::ValidationBubble):
(WebCore::ValidationBubble::~ValidationBubble):
(WebCore::ValidationBubble::showRelativeTo):
2016-11-03 Brady Eidson <beidson@apple.com>
IndexedDB 2.0: Rename IDBKeyRange.contains to IDBKeyRange.includes.
https://bugs.webkit.org/show_bug.cgi?id=164383
Reviewed by Beth Dakin.
No new tests (Updated existing tests).
* Modules/indexeddb/IDBKeyRange.cpp:
(WebCore::IDBKeyRange::includes):
(WebCore::IDBKeyRange::contains): Deleted.
* Modules/indexeddb/IDBKeyRange.h:
* Modules/indexeddb/IDBKeyRange.idl:
2016-11-03 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r208302.
This change causes LayoutTest crashes under GuardMalloc.
Reverted changeset:
"Load stylesheets in link elements inside a connected shadow
tree"
https://bugs.webkit.org/show_bug.cgi?id=160683
http://trac.webkit.org/changeset/208302
2016-11-03 Chris Dumez <cdumez@apple.com>
Unreviewed, add HTML5 specification for HTML Interactive Form Validation feature.
* features.json:
2016-11-03 Chris Dumez <cdumez@apple.com>
Unreviewed, add HTML Interactive Form Validation to features.json
* features.json:
2016-11-03 Yusuke Suzuki <utatane.tea@gmail.com>
Unreviewed, rolling out due to crash in Amazon web site
https://bugs.webkit.org/show_bug.cgi?id=164380
<rdar://problem/29094221>
* dom/Node.idl:
* domjit/JSNodeDOMJIT.cpp:
(WebCore::NodeOwnerDocumentDOMJIT::checkDOM): Deleted.
(WebCore::NodeOwnerDocumentDOMJIT::callDOMGetter): Deleted.
2016-11-03 Brady Eidson <beidson@apple.com>
IndexedDB 2.0: Support binary keys.
<rdar://problem/28806927> and https://bugs.webkit.org/show_bug.cgi?id=164359
Reviewed by Alex Christensen.
Tests: storage/indexeddb/modern/binary-keys-1-private.html
storage/indexeddb/modern/binary-keys-1.html
Changes to other existing tests.
* Modules/indexeddb/IDBKey.cpp:
(WebCore::IDBKey::createBinary):
(WebCore::IDBKey::IDBKey):
(WebCore::IDBKey::compare):
* Modules/indexeddb/IDBKey.h:
(WebCore::IDBKey::binary):
(WebCore::compareBinaryKeyData):
* Modules/indexeddb/IDBKeyData.cpp:
(WebCore::IDBKeyData::IDBKeyData):
(WebCore::IDBKeyData::maybeCreateIDBKey):
(WebCore::IDBKeyData::isolatedCopy):
(WebCore::IDBKeyData::encode):
(WebCore::IDBKeyData::decode):
(WebCore::IDBKeyData::compare):
(WebCore::IDBKeyData::loggingString):
(WebCore::IDBKeyData::operator==):
* Modules/indexeddb/IDBKeyData.h:
(WebCore::IDBKeyData::hash):
(WebCore::IDBKeyData::encode):
(WebCore::IDBKeyData::decode):
* Modules/indexeddb/IndexedDB.h: Add new enum for the new key type.
* bindings/js/IDBBindingUtilities.cpp:
(WebCore::toJS):
(WebCore::createIDBKeyFromValue):
* platform/ThreadSafeDataBuffer.h:
(WebCore::ThreadSafeDataBufferImpl::ThreadSafeDataBufferImpl):
(WebCore::ThreadSafeDataBuffer::copyData):
(WebCore::ThreadSafeDataBuffer::size):
(WebCore::ThreadSafeDataBuffer::operator==):
(WebCore::ThreadSafeDataBuffer::ThreadSafeDataBuffer):
2016-11-03 Tim Horton <timothy_horton@apple.com>
Printing to PDF should produce internal links when HTML has internal links
https://bugs.webkit.org/show_bug.cgi?id=112081
<rdar://problem/5955705>
Reviewed by Simon Fraser.
Patch originally by David Lattimore.
No new tests, as it's unclear how to test PDF output.
* dom/Element.cpp:
(WebCore::Element::findAnchorElementForLink):
* dom/Element.h:
Add findAnchorElementForLink, which looks up the anchor element corresponding
to the current element's href, and also returns the fragment name as an out parameter.
* page/PrintContext.cpp:
(WebCore::PrintContext::PrintContext):
(WebCore::PrintContext::spoolPage):
(WebCore::PrintContext::spoolRect):
(WebCore::PrintContext::end):
(WebCore::PrintContext::collectLinkedDestinations):
(WebCore::PrintContext::outputLinkedDestinations):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::addPDFURLRect):
Plumb internal links (fragment links) through to GraphicsContext, using
the fragment name from the page.
* page/PrintContext.h:
* platform/graphics/GraphicsContext.cpp:
(WebCore::GraphicsContext::supportsInternalLinks):
(WebCore::GraphicsContext::setDestinationForRect):
(WebCore::GraphicsContext::addDestinationAtPoint):
* platform/graphics/GraphicsContext.h:
* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::GraphicsContext::supportsInternalLinks):
(WebCore::GraphicsContext::setDestinationForRect):
(WebCore::GraphicsContext::addDestinationAtPoint):
Plumb internal links through to the CGContext. Apply the CTM, because
these functions expect positions in global coordinates.
* platform/graphics/win/GraphicsContextDirect2D.cpp:
(WebCore::GraphicsContext::setURLForRect):
* platform/graphics/cairo/GraphicsContextCairo.cpp:
(WebCore::GraphicsContext::setURLForRect):
Adjust setURLForRect to take a FloatRect, like everything else, and
stop rounding.
2016-11-03 Alex Christensen <achristensen@webkit.org>
Unreviewed, rolling out r208298.
https://bugs.webkit.org/show_bug.cgi?id=163939
caused asan crashes
Reverted changeset:
"NetworkSession: Add NetworkDataTask implementation for blobs"
https://bugs.webkit.org/show_bug.cgi?id=163939
http://trac.webkit.org/changeset/208298
2016-11-03 Brent Fulgham <bfulgham@apple.com>
[Win][Direct2D] Native Windows widgets are drawn upside-down
https://bugs.webkit.org/show_bug.cgi?id=164370
Reviewed by Alex Christensen.
When we return from drawing in GDI code, we need to flip the resulting
bitmap so that it draws in the proper orientation in Direct2D.
Tested by existing widget tests.
* platform/graphics/win/GraphicsContextDirect2D.cpp:
(WebCore::GraphicsContext::releaseWindowsContext): Flip before drawing
to our Direct2D context.
2016-11-01 Gavin Barraclough <barraclough@apple.com>
Remove PageThrottler & all related code
https://bugs.webkit.org/show_bug.cgi?id=164302
Reviewed by Ryosuke Niwa.
All relevant information now available from the ActivityState.
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::setMuted):
(WebCore::HTMLMediaElement::updateVolume):
(WebCore::HTMLMediaElement::updatePlayState):
(WebCore::HTMLMediaElement::updateAudioAssertionState): Deleted.
* html/HTMLMediaElement.h:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::completed):
(WebCore::FrameLoader::started):
* loader/FrameLoader.h:
* page/ChromeClient.h:
* page/Page.cpp:
(WebCore::Page::Page):
* page/Page.h:
(WebCore::Page::pageActivityStateChanged): Deleted.
(WebCore::Page::pageThrottler): Deleted.
* page/PageThrottler.cpp: Removed.
* page/PageThrottler.h: Removed.
2016-11-03 Dan Bernstein <mitz@apple.com>
REGRESSION (r206247): Painting milestones can be delayed until the next layer flush
https://bugs.webkit.org/show_bug.cgi?id=164340
<rdar://problem/29074344>
Reviewed by Tim Horton.
To give WebKit a chance to deliver the painting milestones to its client after the commit,
we must tell it about them before or during the commit. To that end, we should not defer
the call to firePaintRelatedMilestonesIfNeeded until after the commit.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::RenderLayerCompositor): Removed
m_paintRelatedMilestonesTimer initializer.
(WebCore::RenderLayerCompositor::didPaintBacking): Call
FrameView::firePaintRelatedMilestonesIfNeeded directly from here.
(WebCore::RenderLayerCompositor::paintRelatedMilestonesTimerFired): Deleted.
* rendering/RenderLayerCompositor.h:
2016-11-03 Antti Koivisto <antti@apple.com>
imported/mozilla/svg/paint-order-01.svg and imported/mozilla/svg/paint-order-02.svg are flaky failures
https://bugs.webkit.org/show_bug.cgi?id=164355
Reviewed by Ryosuke Niwa.
Revert one change from https://trac.webkit.org/changeset/207669 to see if it is causing flakiness in
some XML based tests.
* xml/parser/XMLDocumentParser.cpp:
(WebCore::XMLDocumentParser::end):
2016-11-02 Yusuke Suzuki <utatane.tea@gmail.com>
Unreviewed, fix CLoop build after r208320.
https://bugs.webkit.org/show_bug.cgi?id=162980
Guard with ENABLE(JIT).
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
* bindings/scripts/test/JS/JSTestDOMJIT.cpp:
2016-11-02 Brady Eidson <beidson@apple.com>
Expand upon IndexedDB status in features.json.
* features.json:
2016-11-02 Myles C. Maxfield <mmaxfield@apple.com>
CSS.supports("font-variation-settings", "'wght' 500") erroneously returns false
https://bugs.webkit.org/show_bug.cgi?id=164244
Reviewed by Michael Catanzaro.
Because we weren't passing a Document into CSSParserContext's constructor,
there was no way for our parser to know whether the runtime switch was on
or not. Instead, we can use the CallWith attribute in the IDL file to pass
in a Document.
Test: fast/text/variations/css-supports-runtime-switch.html
* css/DOMCSSNamespace.cpp:
(WebCore::DOMCSSNamespace::supports):
* css/DOMCSSNamespace.h:
* css/DOMCSSNamespace.idl:
2016-11-02 Yusuke Suzuki <utatane.tea@gmail.com>
[DOMJIT] Add DOMJIT::Signature
https://bugs.webkit.org/show_bug.cgi?id=162980
Reviewed by Saam Barati and Sam Weinig.
We introduce DOMJIT::Signature. This signature object is automatically generated by IDL code generator.
It holds (1) types, (2) pointer to the unsafe function (the function without checks), and (3) the effect
of the function. We use constexpr to initialize DOMJIT::Signature without invoking global constructors.
Thus the content is embedded into the binary as the constant values.
We also clean up the IDL code generator related to DOMJIT part. Instead of switching things inside IDL
code generator, we use C++ template to dispatch things at compile time. This template meta programming
is highly utilized in IDL these days.
To make DOMJIT::Signature constexpr, we also need to define DOMJIT abstract heap things in the build time.
To do so, we introduce a tiny Ruby script to calculate the range of abstract heaps. We can offer the abstract
heap tree as YAML format and the script will produce a C++ header holding the calculated abstract heap ranges
* CMakeLists.txt:
* DerivedSources.make:
* ForwardingHeaders/bytecode/SpeculatedType.h: Renamed from Source/WebCore/domjit/DOMJITAbstractHeapRepository.h.
* ForwardingHeaders/domjit/DOMJITSignature.h: Renamed from Source/WebCore/domjit/DOMJITAbstractHeapRepository.cpp.
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSDOMGlobalObject.h:
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
(GeneratePropertiesHashTable):
(GetUnsafeArgumentType):
(GetArgumentTypeFilter):
(GetResultTypeFilter):
(GenerateImplementation):
(UnsafeToNative):
(GenerateHashTableValueArray):
(ComputeFunctionSpecial):
* bindings/scripts/IDLAttributes.txt:
* bindings/scripts/test/JS/JSTestDOMJIT.cpp:
(WebCore::BindingCaller<JSTestDOMJIT>::castForOperation):
(WebCore::TestDOMJITAnyAttrDOMJIT::TestDOMJITAnyAttrDOMJIT):
(WebCore::TestDOMJITBooleanAttrDOMJIT::TestDOMJITBooleanAttrDOMJIT):
(WebCore::TestDOMJITByteAttrDOMJIT::TestDOMJITByteAttrDOMJIT):
(WebCore::TestDOMJITOctetAttrDOMJIT::TestDOMJITOctetAttrDOMJIT):
(WebCore::TestDOMJITShortAttrDOMJIT::TestDOMJITShortAttrDOMJIT):
(WebCore::TestDOMJITUnsignedShortAttrDOMJIT::TestDOMJITUnsignedShortAttrDOMJIT):
(WebCore::TestDOMJITLongAttrDOMJIT::TestDOMJITLongAttrDOMJIT):
(WebCore::TestDOMJITUnsignedLongAttrDOMJIT::TestDOMJITUnsignedLongAttrDOMJIT):
(WebCore::TestDOMJITLongLongAttrDOMJIT::TestDOMJITLongLongAttrDOMJIT):
(WebCore::TestDOMJITUnsignedLongLongAttrDOMJIT::TestDOMJITUnsignedLongLongAttrDOMJIT):
(WebCore::TestDOMJITFloatAttrDOMJIT::TestDOMJITFloatAttrDOMJIT):
(WebCore::TestDOMJITUnrestrictedFloatAttrDOMJIT::TestDOMJITUnrestrictedFloatAttrDOMJIT):
(WebCore::TestDOMJITDoubleAttrDOMJIT::TestDOMJITDoubleAttrDOMJIT):
(WebCore::TestDOMJITUnrestrictedDoubleAttrDOMJIT::TestDOMJITUnrestrictedDoubleAttrDOMJIT):
(WebCore::TestDOMJITDomStringAttrDOMJIT::TestDOMJITDomStringAttrDOMJIT):
(WebCore::TestDOMJITByteStringAttrDOMJIT::TestDOMJITByteStringAttrDOMJIT):
(WebCore::TestDOMJITUsvStringAttrDOMJIT::TestDOMJITUsvStringAttrDOMJIT):
(WebCore::TestDOMJITNodeAttrDOMJIT::TestDOMJITNodeAttrDOMJIT):
(WebCore::TestDOMJITBooleanNullableAttrDOMJIT::TestDOMJITBooleanNullableAttrDOMJIT):
(WebCore::TestDOMJITByteNullableAttrDOMJIT::TestDOMJITByteNullableAttrDOMJIT):
(WebCore::TestDOMJITOctetNullableAttrDOMJIT::TestDOMJITOctetNullableAttrDOMJIT):
(WebCore::TestDOMJITShortNullableAttrDOMJIT::TestDOMJITShortNullableAttrDOMJIT):
(WebCore::TestDOMJITUnsignedShortNullableAttrDOMJIT::TestDOMJITUnsignedShortNullableAttrDOMJIT):
(WebCore::TestDOMJITLongNullableAttrDOMJIT::TestDOMJITLongNullableAttrDOMJIT):
(WebCore::TestDOMJITUnsignedLongNullableAttrDOMJIT::TestDOMJITUnsignedLongNullableAttrDOMJIT):
(WebCore::TestDOMJITLongLongNullableAttrDOMJIT::TestDOMJITLongLongNullableAttrDOMJIT):
(WebCore::TestDOMJITUnsignedLongLongNullableAttrDOMJIT::TestDOMJITUnsignedLongLongNullableAttrDOMJIT):
(WebCore::TestDOMJITFloatNullableAttrDOMJIT::TestDOMJITFloatNullableAttrDOMJIT):
(WebCore::TestDOMJITUnrestrictedFloatNullableAttrDOMJIT::TestDOMJITUnrestrictedFloatNullableAttrDOMJIT):
(WebCore::TestDOMJITDoubleNullableAttrDOMJIT::TestDOMJITDoubleNullableAttrDOMJIT):
(WebCore::TestDOMJITUnrestrictedDoubleNullableAttrDOMJIT::TestDOMJITUnrestrictedDoubleNullableAttrDOMJIT):
(WebCore::TestDOMJITDomStringNullableAttrDOMJIT::TestDOMJITDomStringNullableAttrDOMJIT):
(WebCore::TestDOMJITByteStringNullableAttrDOMJIT::TestDOMJITByteStringNullableAttrDOMJIT):
(WebCore::TestDOMJITUsvStringNullableAttrDOMJIT::TestDOMJITUsvStringNullableAttrDOMJIT):
(WebCore::TestDOMJITNodeNullableAttrDOMJIT::TestDOMJITNodeNullableAttrDOMJIT):
(WebCore::jsTestDOMJITPrototypeFunctionGetAttribute):
(WebCore::jsTestDOMJITPrototypeFunctionGetAttributeCaller):
(WebCore::unsafeJsTestDOMJITPrototypeFunctionGetAttribute):
(WebCore::jsTestDOMJITPrototypeFunctionItem):
(WebCore::jsTestDOMJITPrototypeFunctionItemCaller):
(WebCore::unsafeJsTestDOMJITPrototypeFunctionItem):
(WebCore::jsTestDOMJITPrototypeFunctionHasAttribute):
(WebCore::jsTestDOMJITPrototypeFunctionHasAttributeCaller):
(WebCore::unsafeJsTestDOMJITPrototypeFunctionHasAttribute):
(WebCore::jsTestDOMJITPrototypeFunctionGetElementById):
(WebCore::jsTestDOMJITPrototypeFunctionGetElementByIdCaller):
(WebCore::unsafeJsTestDOMJITPrototypeFunctionGetElementById):
(WebCore::jsTestDOMJITPrototypeFunctionGetElementsByName):
(WebCore::jsTestDOMJITPrototypeFunctionGetElementsByNameCaller):
(WebCore::unsafeJsTestDOMJITPrototypeFunctionGetElementsByName):
* bindings/scripts/test/TestDOMJIT.idl:
* dom/Element.idl:
* domjit/DOMJITAbstractHeapRepository.yaml: Added.
* domjit/DOMJITIDLConvert.h: Added.
(WebCore::DOMJIT::DirectConverter<IDLDOMString>::directConvert<StringConversionConfiguration::Normal>):
* domjit/DOMJITIDLType.h: Added.
* domjit/DOMJITIDLTypeFilter.h: Added.
* domjit/JSDocumentDOMJIT.cpp:
(WebCore::DocumentDocumentElementDOMJIT::callDOMGetter):
* domjit/JSNodeDOMJIT.cpp:
(WebCore::NodeFirstChildDOMJIT::callDOMGetter):
(WebCore::NodeLastChildDOMJIT::callDOMGetter):
(WebCore::NodeNextSiblingDOMJIT::callDOMGetter):
(WebCore::NodePreviousSiblingDOMJIT::callDOMGetter):
(WebCore::NodeParentNodeDOMJIT::callDOMGetter):
(WebCore::NodeOwnerDocumentDOMJIT::callDOMGetter):
* domjit/generate-abstract-heap.rb: Added.
2016-11-02 Simon Fraser <simon.fraser@apple.com>
Followup after r208314.
The style created for reflections contains transforms and a mask, so needs to get explicit
z-index on it. This doesn't change rendering, since this layer has no children.
Fixes assertions in various reflection tests.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::calculateClipRects):
2016-11-02 Simon Fraser <simon.fraser@apple.com>
REGRESSION (r208025) GraphicsContext state stack assertions loading webkit.org
https://bugs.webkit.org/show_bug.cgi?id=164350
rdar://problem/29053414
Reviewed by Dean Jackson.
After r208025 it as possible for KeyframeAnimation::animate() to produce a RenderStyle
with a non-1 opacity, but without the explicit z-index that triggers stacking context.
This confused the RenderLayer paintWithTransparency code, triggering mismsatched GraphicsContext
save/restores.
This occurred when the runningOrFillingForwards state was mis-computed. keyframeAnim->animate()
can spit out a new style when in the StartWaitTimer sometimes, so "!keyframeAnim->waitingToStart() && !keyframeAnim->postActive()"
gave the wrong answser.
Rather than depend on the super-confusing animation state, use a bool out param from animate() to say
when it actually produced a new style, and when true, do the setZIndex(0).
Test: animations/stacking-during-opacity-animation.html
* page/animation/AnimationBase.h:
* page/animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimation::blendProperties): Log after blending so the log shows the blended style.
* page/animation/CompositeAnimation.cpp:
(WebCore::CompositeAnimation::animate):
* page/animation/ImplicitAnimation.cpp:
(WebCore::ImplicitAnimation::animate):
* page/animation/ImplicitAnimation.h:
* page/animation/KeyframeAnimation.cpp:
(WebCore::KeyframeAnimation::animate):
* page/animation/KeyframeAnimation.h:
* platform/graphics/GraphicsContext.cpp:
(WebCore::GraphicsContext::restore):
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
(PlatformCALayer::drawLayerContents): No functional change, but created scope for the
GraphicsContext so that it didn't outlive the CGContextRestoreGState(context).
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::beginTransparencyLayers): New assertion that catches the problem earlier.
2016-11-02 Myles C. Maxfield <mmaxfield@apple.com>
[iOS] [WebGL] Multisample resolve step may operate on stale data
https://bugs.webkit.org/show_bug.cgi?id=164347
Reviewed by Dean Jackson.
When antialiasing is enabled, WebKit internally creates a multisampled FBO
and uses that as the target of all the drawing commands. Then, just before
we actually put the image on the glass, we perform a “resolve” step which
averages all the samples to create the final image. However, it appears
that this resolve step only waits for commands to complete which were
already submitted to the hardware. OpenGL is allowed (indeed, expected) to
batch up drawing commands in main memory so it can submit them to the
hardware in fewer batches, but this means that the hardware may not know
about all the commands that the application submitted. Because of this,
the data the resolve step saw is the result of only some of the previous
draw calls - not all of them.
This doesn’t occur on macOS because we have a different code path there
for performing the resolve step. On iOS 9 and below, WebKit didn’t
implement multisampling in WebGL at all, which explains why this only
occurs on iOS 10.
Luckily, the OpenGL command glFlush() is exactly designed to submit any
pending commands to the hardware.
Test: fast/canvas/webgl/multisample-resolve-consistency.html
* platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
(WebCore::GraphicsContext3D::resolveMultisamplingIfNecessary):
2016-11-02 Brady Eidson <beidson@apple.com>
Give IDBKey(Data) a WTF::Variant overhaul.
https://bugs.webkit.org/show_bug.cgi?id=164332
Reviewed by Alex Christensen and Andy Estes.
No new tests (Refactor, no behavior change).
* Modules/indexeddb/IDBKey.cpp:
(WebCore::IDBKey::IDBKey):
(WebCore::IDBKey::isValid):
(WebCore::IDBKey::compare):
* Modules/indexeddb/IDBKey.h:
(WebCore::IDBKey::array):
(WebCore::IDBKey::string):
(WebCore::IDBKey::date):
(WebCore::IDBKey::number):
(WebCore::IDBKey::IDBKey): Deleted.
* Modules/indexeddb/IDBKeyData.cpp:
(WebCore::IDBKeyData::IDBKeyData):
(WebCore::IDBKeyData::maybeCreateIDBKey):
(WebCore::IDBKeyData::isolatedCopy):
(WebCore::IDBKeyData::encode):
(WebCore::IDBKeyData::decode):
(WebCore::IDBKeyData::compare):
(WebCore::IDBKeyData::loggingString):
(WebCore::IDBKeyData::setArrayValue):
(WebCore::IDBKeyData::setStringValue):
(WebCore::IDBKeyData::setDateValue):
(WebCore::IDBKeyData::setNumberValue):
(WebCore::IDBKeyData::operator==):
* Modules/indexeddb/IDBKeyData.h:
(WebCore::IDBKeyData::hash):
(WebCore::IDBKeyData::string):
(WebCore::IDBKeyData::date):
(WebCore::IDBKeyData::number):
(WebCore::IDBKeyData::array):
(WebCore::IDBKeyData::encode):
(WebCore::IDBKeyData::decode):
2016-11-01 Sam Weinig <sam@webkit.org>
[WebIDL] Move interfaces and typed arrays over to JSDOMConvert
https://bugs.webkit.org/show_bug.cgi?id=164256
Reviewed by Alex Christensen.
- Add the ability to pass an "exception thrower" functor to the convert functions.
This is only implemented for convert<IDLInterface<T>> and convert<IDLNullable<IDLInterface<T>>>
for now, but can be extended for more types as necessary to improve exception messages.
- Add support for using toJSNewlyCreated in JSDOMConvert.
* bindings/generic/IDLTypes.h:
(WebCore::IDLString::extractValueFromNullable):
Use forwarding to simplify extraction function.
(WebCore::IDLInterface::nullValue):
Update nullValue to work for both RefPtr<T> and T*.
(WebCore::IDLInterface::extractValueFromNullable):
Use forwarding to simplify extraction function.
* bindings/js/JSDOMConvert.h:
(WebCore::DefaultExceptionThrower::operator()):
Add a default "exception thrower" which throws a normal type error.
(WebCore::convert):
Add an overload of convert which takes an "exception thrower".
(WebCore::toJSNewlyCreated):
Add new overloaded function toJSNewlyCreated, matching the toJS overload set,
which will return "newly created" values. This only works for types that implement
a toJSNewlyCreated function for themselves.
(WebCore::Converter<IDLNullable<T>>::convert):
Fix the return type of Converter<IDLNullable<T>> to be specialized when
T is an IDLInterface. In that case, we want to match the return type of
inner converter.
Also add implementation of convert overload that takes an "exception thrower".
(WebCore::JSConverter<IDLNullable<T>>::convert):
(WebCore::JSConverter<IDLNullable<T>>::convertNewlyCreated):
Reimplement conversion to use forwarding of the value.
(WebCore::Converter<IDLInterface<T>>::convert):
Add support for an "exception thrower".
(WebCore::Detail::getPtrOrRef):
Add helper functions that extract either a pointer or reference, depending on the type,
and const_casts it allowing the value to be used with toJS functions.
(WebCore::JSConverter<IDLInterface<T>>::convert):
Re-implement to support more varied input values.
(WebCore::JSConverter<IDLInterface<T>>::convertNewlyCreated):
Added. Forwards to overloaded toJSNewlyCreated functions.
* bindings/scripts/CodeGeneratorJS.pm:
(AddToImplIncludesForIDLType):
Add support for adding the right includes for SerializedScriptValue and Dictionary.
(GetArgumentExceptionThrower):
(GetAttributeExceptionThrower):
Add helpers to generate "exception thrower" lambdas for wrappers and typed arrays
being passed to setters and functions.
(GenerateParametersCheck):
Move around special cases so it is clear that it's not wrappers and typed arrays that
need specialization here, it is now just EventListener and XPathNSResolver.
(GetIDLInterfaceName):
Add helper to get the InterfaceName for use in IDLInterface template.
(GetBaseIDLType):
Use new GetIDLInterfaceName helper.
(IsValidContextForJSValueToNative):
Remove IDLOperation as a valid context. It is not.
(JSValueToNative):
Move JSDOMConvert based conversion to the bottom, to show that everything above it
is a special case that should be fixed. I have used explicit c-style if-statements
to make it clear what the types of the exceptional cases are.
(NativeToJSValueDOMConvertNeedsState):
(NativeToJSValueDOMConvertNeedsGlobalObject):
Add wrapper types and typed arrays to the list needing state and globalObject.
(NativeToJSValue):
Move JSDOMConvert based conversion to the bottom, to show that everything above it
is a special case that should be fixed. I have used explicit c-style if-statements
to make it clear what the types of the exceptional cases are.
(JSValueToNativeIsHandledByDOMConvert): Deleted.
(NativeToJSValueIsHandledByDOMConvert): Deleted.
Remove predicates protecting use of JSDOMConvert now that it is the default.
* bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
* bindings/scripts/test/JS/JSTestCEReactions.cpp:
* bindings/scripts/test/JS/JSTestCallback.cpp:
* bindings/scripts/test/JS/JSTestCallbackFunction.cpp:
* bindings/scripts/test/JS/JSTestDOMJIT.cpp:
* bindings/scripts/test/JS/JSTestEventTarget.cpp:
* bindings/scripts/test/JS/JSTestInterface.cpp:
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
* bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
* bindings/scripts/test/JS/JSTestSerialization.cpp:
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
Update test results.
2016-11-02 David Kilzer <ddkilzer@apple.com>
Bug 164333: Add logging for "WebKit encountered an internal error" messages due to Network process crashes
<https://webkit.org/b/164333>
<rdar://problem/29072727>
Reviewed by Alex Christensen.
* page/DiagnosticLoggingKeys.cpp:
(WebCore::DiagnosticLoggingKeys::networkProcessCrashedKey):
- Add implementation for new key method.
* page/DiagnosticLoggingKeys.h:
(WebCore::DiagnosticLoggingKeys::networkProcessCrashedKey):
- Add declaration for new key method.
2016-11-02 Filip Pizlo <fpizlo@apple.com>
The GC should be in a thread
https://bugs.webkit.org/show_bug.cgi?id=163562
Reviewed by Geoffrey Garen and Andreas Kling.
No new tests because existing tests cover this.
We now need to be more careful about using JSLock. This fixes some places that were not
holding it. New assertions in the GC are more likely to catch this than before.
* bindings/js/WorkerScriptController.cpp:
(WebCore::WorkerScriptController::WorkerScriptController):
2016-11-02 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Include DebuggerAgent in Workers - see, pause, and step through scripts
https://bugs.webkit.org/show_bug.cgi?id=164136
<rdar://problem/29028462>
Reviewed by Brian Burg.
Tests: inspector/worker/debugger-pause.html
inspector/worker/debugger-scripts.html
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* inspector/InspectorAllInOne.cpp:
New file.
* inspector/PageDebuggerAgent.h:
* inspector/WorkerDebuggerAgent.cpp: Added.
(WebCore::WorkerDebuggerAgent::WorkerDebuggerAgent):
(WebCore::WorkerDebuggerAgent::~WorkerDebuggerAgent):
(WebCore::WorkerDebuggerAgent::breakpointActionLog):
(WebCore::WorkerDebuggerAgent::injectedScriptForEval):
* inspector/WorkerDebuggerAgent.h: Added.
DebuggerAgent customizations for Workers.
* inspector/WorkerInspectorController.cpp:
(WebCore::WorkerInspectorController::WorkerInspectorController):
Add the new agent.
* inspector/WorkerScriptDebugServer.cpp:
(WebCore::WorkerScriptDebugServer::runEventLoopWhilePaused):
Implement the nested run loop for Workers.
2016-11-02 Simon Fraser <simon.fraser@apple.com>
Add Battery Status to features.json, marked as "Removed".
* features.json:
2016-11-02 Ryosuke Niwa <rniwa@webkit.org>
Load stylesheets in link elements inside a connected shadow tree
https://bugs.webkit.org/show_bug.cgi?id=160683
<rdar://problem/29040652>
Reviewed by Antti Koivisto.
Allow external stylesheets within a shadow tree by storing the appropriate style scope in HTMLLinkElement
when it's connected to a document instead of always talking to document's style scope.
Also improve ShadowRoot's insertedInto and removedFrom so that they only try to add and remove itself from
m_inDocumentShadowRoots when the connected-ness changes.
This patch also removes the superfluous call to notifyChildNodeRemoved in Element::removeShadowRoot to
avoid invoking notifyChildNodeRemoved during a document teardown, which is incorrect. It's sufficient that
~ShadowRoot calls ContainerNode::removeDetachedChildren(), and in turn removeDetachedChildrenInContainer()
since the latter function tears down nodes via the deletion queue during a document destruction and use
notifyChildNodeRemoved() on nodes that outlive the shadow root.
Tests: fast/shadow-dom/link-element-in-shadow-tree.html
fast/shadow-dom/selected-stylesheet-in-shadow-tree.html
* dom/Document.cpp:
(WebCore::Document::didInsertInDocumentShadowRoot): Assert that the shadow root is not in the set.
(WebCore::Document::didRemoveInDocumentShadowRoot): Assert that the shadow root is not in the document as
this function is now called after Node::removedFrom in ShadowRoot::removedFrom.
* dom/Element.cpp:
(WebCore::Element::removeShadowRoot): See the description above.
* dom/ShadowRoot.cpp:
(WebCore::ShadowRoot::insertedInto): Only call didInsertInDocumentShadowRoot when the this shadow root is
newly connected to a document so we can add assertions in didInsertInDocumentShadowRoot.
(WebCore::ShadowRoot::removedFrom): Ditto for the removal.
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::HTMLLinkElement):
(WebCore::HTMLLinkElement::~HTMLLinkElement):
(WebCore::HTMLLinkElement::setDisabledState): Exit early when the element is not in a document as invoking
didChangeActiveStyleSheetCandidates would require having a valid m_styleScope and process() already exits
early when inDocument() is false.
(WebCore::HTMLLinkElement::parseAttribute):
(WebCore::HTMLLinkElement::process): Removed the early exit for when the element is in a shadow tree.
(WebCore::HTMLLinkElement::insertedInto): Exit early unless this element has just become connected to
a document instead of whenever its self-inclusive ancestor is inserted into a container.
(WebCore::HTMLLinkElement::removedFrom): Ditto for removal. Also call removeStyleSheetCandidateNode after
calling removePendingSheet since the latter depends on m_styleScope being not null.
(WebCore::HTMLLinkElement::addPendingSheet):
(WebCore::HTMLLinkElement::removePendingSheet):
* html/HTMLLinkElement.h:
* html/HTMLStyleElement.cpp:
(WebCore::HTMLStyleElement::insertedInto): Only call inline style owner's insertedIntoDocument if this
element has just become connected to a document.
(WebCore::HTMLStyleElement::removedFrom): Ditto for the removal.
* style/StyleScope.h:
* svg/SVGStyleElement.cpp:
(WebCore::SVGStyleElement::insertedInto): Ditto.
(WebCore::SVGStyleElement::removedFrom): Ditto for the removal.
2016-11-02 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Clean up new parser's grid layout ifdefs/runtime checking
https://bugs.webkit.org/show_bug.cgi?id=164341
Reviewed by Dean Jackson.
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeGridTrackRepeatFunction):
(WebCore::consumeGridTrackList):
(WebCore::CSSPropertyParser::parseSingleValue):
2016-11-02 Alex Christensen <achristensen@webkit.org>
Remove Battery Status API from the tree
https://bugs.webkit.org/show_bug.cgi?id=164213
Reviewed by Sam Weinig.
* CMakeLists.txt:
* DerivedSources.cpp:
* Modules/battery: Removed.
* Modules/battery/BatteryClient.h: Removed.
* Modules/battery/BatteryController.cpp: Removed.
* Modules/battery/BatteryController.h: Removed.
* Modules/battery/BatteryManager.cpp: Removed.
* Modules/battery/BatteryManager.h: Removed.
* Modules/battery/BatteryManager.idl: Removed.
* Modules/battery/BatteryStatus.cpp: Removed.
* Modules/battery/BatteryStatus.h: Removed.
* Modules/battery/NavigatorBattery.cpp: Removed.
* Modules/battery/NavigatorBattery.h: Removed.
* Modules/battery/NavigatorBattery.idl: Removed.
* PlatformEfl.cmake:
* dom/EventTargetFactory.in:
* platform/efl/BatteryProviderEfl.cpp: Removed.
* platform/efl/BatteryProviderEfl.h: Removed.
* platform/efl/BatteryProviderEflClient.h: Removed.
* platform/glib/BatteryProviderUPower.cpp: Removed.
* platform/glib/BatteryProviderUPower.h: Removed.
* platform/glib/BatteryProviderUPowerClient.h: Removed.
* testing/Internals.cpp:
(WebCore::Internals::setBatteryStatus): Deleted.
* testing/Internals.h:
* testing/Internals.idl:
2016-11-02 Keith Rollin <krollin@apple.com>
NetworkSession: Add NetworkDataTask implementation for blobs
https://bugs.webkit.org/show_bug.cgi?id=163939
Reviewed by Alex Christensen.
* WebCore.xcodeproj/project.pbxproj: Mark HTTPParsers.h and AsyncFileStream.h as private.
* fileapi/AsyncFileStream.h: Add WEBCORE_EXPORT to AsyncFileStream class.
* platform/network/BlobData.h: Add WEBCORE_EXPORT to length().
* platform/network/HTTPParsers.h: Add WEBCORE_EXPORT to parseRange().
* platform/network/ResourceResponseBase.h: Add WEBCORE_EXPORT to setHTTPHeaderField().
2016-11-02 Olivier Blin <olivier.blin@softathome.com>
[GTK] Use libgcrypt instead of GnuTLS for CryptoDigest and SubtleCrypto HMAC implementation
https://bugs.webkit.org/show_bug.cgi?id=163125
Reviewed by Michael Catanzaro.
No new tests, already covered by existing SubtleCrypto tests.
* PlatformGTK.cmake: Use libgcrypt instead of gnutls.
* crypto/gcrypt/CryptoAlgorithmHMACGCrypt.cpp: Added. Adapted from the GnuTLS backend.
(WebCore::getGCryptDigestAlgorithm):
(WebCore::calculateSignature):
(WebCore::CryptoAlgorithmHMAC::platformSign):
(WebCore::CryptoAlgorithmHMAC::platformVerify):
* platform/crypto/gcrypt/CryptoDigestGCrypt.cpp: Added. Adapted from the GnuTLS backend.
(WebCore::CryptoDigest::CryptoDigest):
(WebCore::CryptoDigest::~CryptoDigest):
(WebCore::CryptoDigest::create):
(WebCore::CryptoDigest::addBytes):
(WebCore::CryptoDigest::computeHash):
2016-11-02 Brent Fulgham <bfulgham@apple.com>
REGRESSION(r203289):Assertion in MathOperator::stretchTo() on Wikipedia Page
https://bugs.webkit.org/show_bug.cgi?id=162933
<rdar://problem/28570590>
Reviewed by Dean Jackson.
A debug assertion is triggered when an empty <mo> tag is used with a "stretchy" flag.
We shouldn't be trying to apply stretch operations on an empty MathML element. Create a
helper function (isStretchy) to encapsulate the fact that only non-empty elements with
the 'MathMLOperatorDictionary::Stretchy' operator flag should have stretching applied.
Test: mathml/empty-mo.html
* rendering/mathml/RenderMathMLOperator.cpp:
(WebCore::RenderMathMLOperator::stretchTo): Revise assertion to use new 'isStretchy' predicate.
* rendering/mathml/RenderMathMLOperator.h:
(WebCore::RenderMathMLOperator::isStretchy): Added.
* rendering/mathml/RenderMathMLRow.cpp:
(WebCore::RenderMathMLRow::computeLineVerticalStretch): Use new 'isStretchy' predicate.
(WebCore::RenderMathMLRow::layoutRowItems): Ditto.
* rendering/mathml/RenderMathMLUnderOver.cpp:
(WebCore::RenderMathMLUnderOver::computeOperatorsHorizontalStretch): Ditto.
(WebCore::RenderMathMLUnderOver::verticalParameters): Ditto.
2016-11-01 Dean Jackson <dino@apple.com>
Filter functions grayscale/invert/opacity/sepia should clamp values over 100%, not fail
https://bugs.webkit.org/show_bug.cgi?id=164310
Reviewed by Sam Weinig.
When bringing up the new CSS parser, I discovered that our old parser was
not conforming to the specification.
Covered by existing tests.
* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parseBuiltinFilterArguments): For these functions, clamp to
100% rather than fail.
2016-11-02 Brent Fulgham <bfulgham@apple.com>
WebKit nullptr dereference Archive Subframe
https://bugs.webkit.org/show_bug.cgi?id=164281
<rdar://problem/28943006>
Reviewed by Andy Estes.
If the page is torn down during a load, we can attempt to use a deallocated
(and nulled) document loader. Most places that use the "active document loader"
null-check it before using, but there was one place that did not. This patch
fixes that oversight.
Test: fast/dom/crash-with-bad-url.html
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadURLIntoChildFrame): Check that the active document
loader is non-null before using.
2016-11-02 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Support scroll-snap-* properties
https://bugs.webkit.org/show_bug.cgi?id=164321
Reviewed by Simon Fraser.
* css/CSSPrimitiveValue.h:
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertScrollSnapPoints):
(WebCore::StyleBuilderConverter::convertSnapCoordinatePair):
(WebCore::StyleBuilderConverter::convertScrollSnapCoordinates):
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumePositionLonghand):
(WebCore::consumePositionX):
(WebCore::consumePositionY):
(WebCore::consumePositionList):
(WebCore::consumeScrollSnapDestination):
(WebCore::consumeScrollSnapPoints):
(WebCore::CSSPropertyParser::parseSingleValue):
2016-11-02 David Kilzer <ddkilzer@apple.com>
Add logging for "WebKit encountered an internal error" messages
<https://webkit.org/b/164272>
<rdar://problem/28546064>
Reviewed by Alex Christensen.
* page/DiagnosticLoggingKeys.cpp:
(WebCore::DiagnosticLoggingKeys::internalErrorKey):
(WebCore::DiagnosticLoggingKeys::invalidSessionIDKey):
(WebCore::DiagnosticLoggingKeys::createSharedBufferFailedKey):
(WebCore::DiagnosticLoggingKeys::synchronousMessageFailedKey):
- Add implementations for new key methods.
* page/DiagnosticLoggingKeys.h:
(WebCore::DiagnosticLoggingKeys::internalErrorKey):
(WebCore::DiagnosticLoggingKeys::invalidSessionIDKey):
(WebCore::DiagnosticLoggingKeys::createSharedBufferFailedKey):
(WebCore::DiagnosticLoggingKeys::synchronousMessageFailedKey):
- Add declarations for new key methods.
2016-11-02 Zalan Bujtas <zalan@apple.com>
[Tables] Simplified layout skips captions.
https://bugs.webkit.org/show_bug.cgi?id=164284
Reviewed by David Hyatt.
This patch ensures that we take care of simplified normalflow captions during layout.
Covered by fast/regions/table-caption-as-region.html
* rendering/RenderTable.cpp:
(WebCore::RenderTable::layoutCaption):
(WebCore::RenderTable::layoutCaptions): _caption_side is 2bits, can't use bitmask.
(WebCore::RenderTable::simplifiedNormalFlowLayout):
(WebCore::RenderTable::layout):
* rendering/RenderTable.h:
2016-11-02 Youenn Fablet <youenn@apple.com>
REGRESSION(r207753-207755): ASSERTION FAILED: m_parsedStyleSheetCache->isInMemoryCache()
https://bugs.webkit.org/show_bug.cgi?id=163905
Reviewed by Antti Koivisto.
Covered by existing tests and http/tests/security/cached-cross-origin-shared-css-stylesheet.html
Small refactoring to do more member fields initialization in StyleSheetContents header.
Refactored StyleSheetContents::m_isInMemoryCache to be a counter instead of a boolean.
This allows StyleSheetContents to be linked to several CachedCSSStyleSheets.
* css/StyleSheetContents.cpp:
(WebCore::StyleSheetContents::StyleSheetContents):
(WebCore::StyleSheetContents::addedToMemoryCache):
(WebCore::StyleSheetContents::removedFromMemoryCache):
* css/StyleSheetContents.h:
* loader/cache/CachedCSSStyleSheet.cpp:
(WebCore::CachedCSSStyleSheet::setBodyDataFrom): Making reuse of saveParsedStyleSheet to handle update of StyleSheetContents cache count.
2016-11-02 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Remove FileSystem::filenameToString() and use FileSystem::stringFromFileSystemRepresentation() everywhere instead
https://bugs.webkit.org/show_bug.cgi?id=164315
Reviewed by Michael Catanzaro.
* platform/FileSystem.h:
* platform/glib/FileSystemGlib.cpp:
(WebCore::stringFromFileSystemRepresentation):
(WebCore::homeDirectoryPath):
(WebCore::listDirectory):
(WebCore::filenameToString): Deleted.
2016-11-02 Manuel Rego Casasnovas <rego@igalia.com>
[css-grid] mimax(auto, <flex>) should be serialized as <flex>
https://bugs.webkit.org/show_bug.cgi?id=164316
Reviewed by Sergio Villar Senin.
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::specifiedValueForGridTrackSize): Add a simple if to serialize
properly this case.
* rendering/style/GridLength.h:
(WebCore::GridLength::isAuto): Add new function to check if GridLength
is or not "auto".
2016-11-02 Romain Bellessort <romain.bellessort@crf.canon.fr>
[Readable Streams API] Enable creation of ReadableByteStreamController
https://bugs.webkit.org/show_bug.cgi?id=164014
Reviewed by Youenn Fablet.
Added support for creating ReadableByteStreamController. IDL is mostly
implemented but methods return TypeError. Tests have been added to ensure
behaviour. This part of Readable Streams API is associated to
a flag (READABLE_BYTE_STREAM_API).
Test: streams/readable-byte-stream-controller.html
* CMakeLists.txt:
* Configurations/FeatureDefines.xcconfig:
* DerivedSources.cpp:
* DerivedSources.make:
* Modules/streams/ReadableByteStreamController.idl: Added.
* Modules/streams/ReadableByteStreamController.js: Added.
(enqueue): Empty method for the moment, throws TypeError.
(error): Empty method for the moment, throws TypeError.
(close): Empty method for the moment, throws TypeError.
(byobRequest): Empty method for the moment, throws TypeError.
(desiredSize): Empty method for the moment, throws TypeError.
* Modules/streams/ReadableByteStreamInternals.js: Added.
(privateInitializeReadableByteStreamController):
* Modules/streams/ReadableStream.js:
(initializeReadableStream):
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSDOMGlobalObject.cpp:
(WebCore::JSDOMGlobalObject::addBuiltinGlobals):
* bindings/js/JSReadableStreamPrivateConstructors.cpp:
(WebCore::constructJSReadableByteStreamController):
(WebCore::constructJSReadableStreamDefaultReader):
(WebCore::JSBuiltinReadableByteStreamControllerPrivateConstructor::initializeExecutable):
(WebCore::createReadableByteStreamControllerPrivateConstructor):
* bindings/js/JSReadableStreamPrivateConstructors.h:
* bindings/js/WebCoreBuiltinNames.h:
2016-11-02 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Media Controller: fullscreen toggle support
https://bugs.webkit.org/show_bug.cgi?id=163728
<rdar://problem/27989486>
Reviewed by Darin Adler.
We introduce the FullscreenSupport class which brings support for entering and
exiting fullscreen by clicking on the fullscreen button in the media controls
and correctly reflecting the media's fullscreen state should it be changed
via the media API.
Tests: media/modern-media-controls/fullscreen-support/fullscreen-support-click.html
media/modern-media-controls/fullscreen-support/fullscreen-support-enabled.html
* Modules/modern-media-controls/js-files:
* Modules/modern-media-controls/media/fullscreen-support.js: Added.
(FullscreenSupport):
(FullscreenSupport.prototype.get control):
(FullscreenSupport.prototype.get mediaEvents):
(FullscreenSupport.prototype.buttonWasClicked):
(FullscreenSupport.prototype.syncControl):
* Modules/modern-media-controls/media/media-controller.js:
(MediaController):
* WebCore.xcodeproj/project.pbxproj:
2016-11-02 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Media Controller: PiP support
https://bugs.webkit.org/show_bug.cgi?id=163730
<rdar://problem/27989485>
Reviewed by Dean Jackson.
We introduce the PiPSupport class which brings support for entering picture-in-picture
by clicking on the PiP button in the media controls and enabling the button only when
picture-in-picture mode is available.
Tests: media/modern-media-controls/pip-support/pip-support-click.html
media/modern-media-controls/pip-support/pip-support-enabled.html
* Modules/modern-media-controls/js-files:
* Modules/modern-media-controls/media/media-controller.js:
(MediaController):
* Modules/modern-media-controls/media/pip-support.js: Added.
(PiPSupport.prototype.get control):
(PiPSupport.prototype.get mediaEvents):
(PiPSupport.prototype.buttonWasClicked):
(PiPSupport.prototype.syncControl):
(PiPSupport):
* WebCore.xcodeproj/project.pbxproj:
2016-11-01 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Support the shadow DOM
https://bugs.webkit.org/show_bug.cgi?id=164240
Reviewed by Dean Jackson.
* css/CSSSelector.cpp:
(WebCore::CSSSelector::selectorText):
Remove ShadowDeep, ShadowSlot and ShadowPseudo in favor of our
ShadowDescendant combinator.
* css/CSSSelector.h:
* css/SelectorChecker.cpp:
(WebCore::SelectorChecker::matchRecursively):
Remove ShadowDeep, ShadowSlot and ShadowPseudo in favor of our
ShadowDescendant combinator.
* css/SelectorFilter.cpp:
(WebCore::SelectorFilter::collectIdentifierHashes):
Remove ShadowDeep, ShadowSlot and ShadowPseudo in favor of our
ShadowDescendant combinator.
* css/SelectorPseudoElementTypeMap.in:
Add support for slotted.
* css/parser/CSSParserValues.cpp:
(WebCore::CSSParserSelector::appendTagHistory):
* css/parser/CSSParserValues.h:
(WebCore::CSSParserSelector::needsImplicitShadowCombinatorForMatching):
Remove ShadowDeep, ShadowSlot and ShadowPseudo in favor of our
ShadowDescendant combinator. Take :slotted out of
needsImplicitShadowCombinatorForMatching(), since our code doesn't do
this for :slotted.
* css/parser/CSSSelectorParser.cpp:
(WebCore::isPseudoClassFunction):
:host can be both an id and a function, so don't restrict it.
(WebCore::CSSSelectorParser::consumePseudo):
Put in a hack for :host (inside the hack we already plan on removing
once we turn on).
(WebCore::CSSSelectorParser::consumeCombinator):
Remove deep shadow combinator support, as we don't support matching
on it.
(WebCore::CSSSelectorParser::prependTypeSelectorIfNeeded):
(WebCore::CSSSelectorParser::splitCompoundAtImplicitShadowCrossingCombinator):
Make the split use our combinator, ShadowDescendant, and no longer do anything
special with :slotted.
* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::fragmentRelationForSelectorRelation):
Remove ShadowDeep, ShadowSlot and ShadowPseudo in favor of our
ShadowDescendant combinator.
2016-11-01 Wenson Hsieh <wenson_hsieh@apple.com>
Turn the Input Events runtime flag on by default
https://bugs.webkit.org/show_bug.cgi?id=164297
Reviewed by Ryosuke Niwa.
Set the initial value of inputEventsEnabled in Settings to true.
* page/Settings.in:
2016-11-01 Brady Eidson <beidson@apple.com>
IndexedDB 2.0: Support IDBIndex getAll/getAllKeys.
<rdar://problem/28806933> and https://bugs.webkit.org/show_bug.cgi?id=164294
Reviewed by Alex Christensen.
Tests: storage/indexeddb/modern/idbindex-getall-1-private.html
storage/indexeddb/modern/idbindex-getall-1.html
storage/indexeddb/modern/idbindex-getallkeys-1-private.html
storage/indexeddb/modern/idbindex-getallkeys-1.html
Existing imported W3C tests.
* Modules/indexeddb/IDBIndex.cpp:
(WebCore::IDBIndex::getAll):
(WebCore::IDBIndex::getAllKeys):
* Modules/indexeddb/IDBIndex.h:
* Modules/indexeddb/IDBIndex.idl:
* Modules/indexeddb/IDBRequest.cpp:
(WebCore::IDBRequest::create):
(WebCore::IDBRequest::createIndexGet):
(WebCore::IDBRequest::createCount): Deleted.
(WebCore::IDBRequest::createGet): Deleted.
* Modules/indexeddb/IDBRequest.h:
* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::requestGetAllIndexRecords):
(WebCore::IDBTransaction::requestIndexRecord):
(WebCore::IDBTransaction::requestCount):
* Modules/indexeddb/IDBTransaction.h:
* Modules/indexeddb/server/IndexValueStore.cpp:
(WebCore::IDBServer::IndexValueStore::allValuesForKey):
* Modules/indexeddb/server/IndexValueStore.h:
* Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
(WebCore::IDBServer::MemoryIDBBackingStore::getAllRecords):
* Modules/indexeddb/server/MemoryIndex.cpp:
(WebCore::IDBServer::MemoryIndex::getAllRecords):
* Modules/indexeddb/server/MemoryIndex.h:
* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::getAllRecords):
(WebCore::IDBServer::queryForGetAllObjectStoreRecords):
(WebCore::IDBServer::SQLiteIDBBackingStore::getAllObjectStoreRecords):
(WebCore::IDBServer::SQLiteIDBBackingStore::getAllIndexRecords):
(WebCore::IDBServer::queryForGetAllRecords): Deleted.
* Modules/indexeddb/server/SQLiteIDBBackingStore.h:
2016-11-01 Ryosuke Niwa <rniwa@webkit.org>
Remove CUSTOM_ELEMENTS build flag
https://bugs.webkit.org/show_bug.cgi?id=164267
Reviewed by Antti Koivisto.
Removed the build flag. Also rebaselined the bindings tests.
* Configurations/FeatureDefines.xcconfig:
* DerivedSources.cpp:
* bindings/generic/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::customElementsEnabled):
* bindings/js/JSCSSStyleDeclarationCustom.cpp:
(WebCore::JSCSSStyleDeclaration::putDelegate):
* bindings/js/JSCustomElementInterface.cpp:
* bindings/js/JSCustomElementInterface.h:
* bindings/js/JSCustomElementRegistryCustom.cpp:
* bindings/js/JSDOMStringMapCustom.cpp:
(WebCore::JSDOMStringMap::deleteProperty):
(WebCore::JSDOMStringMap::putDelegate):
* bindings/js/JSElementCustom.cpp:
(WebCore::toJSNewlyCreated):
* bindings/js/JSHTMLElementCustom.cpp:
(WebCore::constructJSHTMLElement):
* bindings/js/JSHTMLOptionsCollectionCustom.cpp:
(WebCore::JSHTMLOptionsCollection::setLength):
(WebCore::JSHTMLOptionsCollection::indexSetter):
* bindings/js/JSHTMLSelectElementCustom.cpp:
(WebCore::JSHTMLSelectElement::indexSetter):
* bindings/js/JSMainThreadExecState.h:
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
* bindings/scripts/test/JS/JSTestCEReactions.cpp:
(WebCore::setJSTestCEReactionsAttributeWithCEReactionsFunction):
(WebCore::setJSTestCEReactionsReflectAttributeWithCEReactionsFunction):
(WebCore::setJSTestCEReactionsStringifierAttributeFunction):
(WebCore::jsTestCEReactionsPrototypeFunctionMethodWithCEReactions):
* bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
(WebCore::setJSTestCEReactionsStringifierValueFunction):
* css/CSSSelector.cpp:
(WebCore::CSSSelector::selectorText):
* css/CSSSelector.h:
* css/PropertySetCSSStyleDeclaration.cpp:
* css/SelectorChecker.cpp:
(WebCore::SelectorChecker::checkOne):
* css/SelectorCheckerTestFunctions.h:
(WebCore::isDefinedElement):
* css/SelectorPseudoClassAndCompatibilityElementMap.in:
* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::addPseudoClassType):
* dom/CustomElementReactionQueue.cpp:
* dom/CustomElementReactionQueue.h:
* dom/CustomElementRegistry.cpp:
* dom/CustomElementRegistry.h:
* dom/CustomElementRegistry.idl:
* dom/Document.cpp:
(WebCore::createHTMLElementWithNameValidation):
(WebCore::createFallbackHTMLElement):
* dom/Element.cpp:
(WebCore::Element::attributeChanged):
(WebCore::Element::didMoveToNewDocument):
(WebCore::Element::insertedInto):
(WebCore::Element::removedFrom):
* dom/Element.h:
* dom/ElementRareData.cpp:
* dom/ElementRareData.h:
(WebCore::ElementRareData::setCustomElementReactionQueue):
* dom/Node.h:
(WebCore::Node::isFailedCustomElement):
* dom/make_names.pl:
(printWrapperFactoryCppFile):
* html/HTMLElement.idl:
* html/parser/HTMLConstructionSite.cpp:
(WebCore::HTMLConstructionSite::createHTMLElementOrFindCustomElementInterface):
* html/parser/HTMLConstructionSite.h:
* html/parser/HTMLDocumentParser.cpp:
(WebCore::HTMLDocumentParser::runScriptsForPausedTreeBuilder):
* html/parser/HTMLTreeBuilder.cpp:
(WebCore::HTMLTreeBuilder::insertGenericHTMLElement):
(WebCore::HTMLTreeBuilder::didCreateCustomOrCallbackElement):
* html/parser/HTMLTreeBuilder.h:
(WebCore::HTMLTreeBuilder::hasParserBlockingScriptWork):
* page/DOMWindow.cpp:
* page/DOMWindow.h:
* page/DOMWindow.idl:
2016-11-01 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Media Controller: Airplay support
https://bugs.webkit.org/show_bug.cgi?id=163729
<rdar://problem/27989484>
Reviewed by Dean Jackson.
We introduce the AirplaySupport class which brings support for playing the media
via Airplay by clicking on the Airplay button in the media controls and correctly
reflecting when the media is played through Airplay via the media API. The enabled
state of the Airplay button is also tied to Airplay sources being available.
Test: media/modern-media-controls/airplay-support/airplay-support.html
* Modules/modern-media-controls/controls/airplay-button.js:
(AirplayButton.prototype.get on):
* Modules/modern-media-controls/js-files:
* Modules/modern-media-controls/media/airplay-support.js: Added.
(AirplaySupport.prototype.get control):
(AirplaySupport.prototype.get mediaEvents):
(AirplaySupport.prototype.buttonWasClicked):
(AirplaySupport.prototype.handleEvent):
(AirplaySupport.prototype.syncControl):
(AirplaySupport):
* Modules/modern-media-controls/media/media-controller.js:
(MediaController):
* WebCore.xcodeproj/project.pbxproj:
2016-11-01 Dean Jackson <dino@apple.com>
Remove WebKitCSSFilterValue to make Hyatt happy
https://bugs.webkit.org/show_bug.cgi?id=164289
<rdar://problems/29050973>
Reviewed by Simon Fraser.
The new CSS parser should not use WebKitCSSFilterValue. It's non-standard,
very likely only used in our tests, doesn't provide much benefit, and will be
covered by the new CSSOM function interface.
Covered by modifying existing tests.
* DerivedSources.make: Remove WebKitCSSFilterValue.idl.
* WebCore.xcodeproj/project.pbxproj: Make CSSFunctionValue.h private so API testing
can see it.
* bindings/js/JSCSSValueCustom.cpp:
(WebCore::toJSNewlyCreated): No WebKitCSSFilterValue.
* css/CSSComputedStyleDeclaration.cpp: Use CSSFunctionValue or CSSPrimitiveValue to
build up the computed style.
(WebCore::ComputedStyleExtractor::valueForFilter):
* css/CSSValue.cpp: No WebKitCSSFilterValue.
(WebCore::CSSValue::equals):
(WebCore::CSSValue::cssText):
(WebCore::CSSValue::destroy):
(WebCore::CSSValue::cloneForCSSOM):
* css/CSSValue.h:
(WebCore::CSSValue::isFilterImageValue):
(WebCore::CSSValue::isWebKitCSSFilterValue): Deleted.
* css/StyleResolver.cpp: Resolve against CSSFunctionValues with
CSSValueIDs as name, rather than WebKitCSSFilterValue.
(WebCore::filterOperationForType):
(WebCore::StyleResolver::createFilterOperations):
* css/StyleResolver.h:
* css/WebKitCSSFilterValue.cpp: Removed.
* css/WebKitCSSFilterValue.h: Removed.
* css/WebKitCSSFilterValue.idl: Removed.
* css/parser/CSSParser.cpp: Parse into CSSPrimitiveValue and CSSFunctionValue.
(WebCore::isValidPrimitiveFilterFunction):
(WebCore::CSSParser::parseBuiltinFilterArguments):
(WebCore::cssValueKeywordIDForFunctionName):
(WebCore::CSSParser::parseFilter):
(WebCore::filterInfoForName): Deleted.
* css/parser/CSSParser.h:
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeFilterFunction):
2016-11-01 Simon Fraser <simon.fraser@apple.com>
Add ViewportAPI to features.json
* features.json:
2016-11-01 Joseph Pecoraro <pecoraro@apple.com>
Unreviewed build fix for r208240.
* inspector/InspectorInstrumentation.h:
Don't export an inlined function.
2016-11-01 Eric Carlson <eric.carlson@apple.com>
[MediaStream] restrict media capture secure connections
https://bugs.webkit.org/show_bug.cgi?id=164234
<rdar://problem/28944906>
Reviewed by Alex Christensen.
Tests: http/tests/ssl/media-stream/get-user-media-different-host.html
http/tests/ssl/media-stream/get-user-media-nested.html
http/tests/ssl/media-stream/get-user-media-secure-connection.html
* Modules/mediastream/UserMediaRequest.cpp:
(WebCore::isSecure): New.
(WebCore::canCallGetUserMedia): New.
(WebCore::UserMediaRequest::start): When the setting says the require secure a secure connection,
fail immediately if the page or one of its ancestors is not secure.
* page/Settings.cpp:
(WebCore::Settings::mediaCaptureRequiresSecureConnection): New.
(WebCore::Settings::setMediaCaptureRequiresSecureConnection): New.
* page/Settings.h:
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::InternalSettings): Do not require a secure connection for media
capture during tests.
(WebCore::InternalSettings::resetToConsistentState):
(WebCore::InternalSettings::setMediaCaptureRequiresSecureConnection):
* testing/InternalSettings.h:
* testing/InternalSettings.idl:
* testing/Internals.cpp:
(WebCore::Internals::Internals):
2016-11-01 Gavin Barraclough <barraclough@apple.com>
Port Page timer throttling to use ActivityState instead of PageThrottler
https://bugs.webkit.org/show_bug.cgi?id=164291
Reviewed by Geoff Garen & Antti Koivisto.
ActivityState now conveys this information; after this change PageThrottler is redundant and can be removed.
* page/Page.cpp:
(WebCore::Page::updateTimerThrottlingState):
- determine page throttling mode based on IsAudible/IsLoading in ActivityState.
(WebCore::Page::setActivityState):
- call updateTimerThrottlingState if IsAudible/IsLoading change.
* page/Page.h:
(WebCore::Page::pageActivityStateChanged):
- no need to listen for PageActivityState changes from the PageThrottler.
2016-11-01 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Media Controller: Placard support
https://bugs.webkit.org/show_bug.cgi?id=163731
<rdar://problem/28869598>
Reviewed by Dean Jackson.
We introduce the PlacardSupport class which brings support for showing the
appropriate placard when the media is played via AirPlay or in picture-in-picture.
Tests: media/modern-media-controls/placard-support/placard-support-airplay.html
media/modern-media-controls/placard-support/placard-support-pip.html
* Modules/modern-media-controls/js-files:
* Modules/modern-media-controls/media/media-controller.js:
(MediaController):
* Modules/modern-media-controls/media/placard-support.js: Added.
(PlacardSupport):
(PlacardSupport.prototype.get mediaEvents):
(PlacardSupport.prototype.handleEvent):
(PlacardSupport.prototype._updatePlacard):
* WebCore.xcodeproj/project.pbxproj:
2016-11-01 Zalan Bujtas <zalan@apple.com>
ShowRenderTree: Add information about the type of the needsLayout bit.
https://bugs.webkit.org/show_bug.cgi?id=164287
Reviewed by Simon Fraser.
Currently showRenderTree only tells you whether a renderer's "needs layout bit" is set or not.
With certain type of layout bugs, it's essential to know the kind of layout a particular
renderer needs.
This patch extends the renderer output by listing all the layout bits set.
B------- -+ BODY RenderBody (0.00, 0.00) (0.00, 0.00) renderer->(0x) node->(0x) layout->[self][normal child]
Not testable.
* rendering/RenderObject.cpp:
(WebCore::RenderObject::showRenderObject):
2016-11-01 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Use more references in inspector code
https://bugs.webkit.org/show_bug.cgi?id=164283
Reviewed by Timothy Hatcher.
(WebCore::frameForScriptExecutionContext):
(WebCore::InspectorInstrumentation::didInstallTimerImpl):
(WebCore::InspectorInstrumentation::didRemoveTimerImpl):
(WebCore::InspectorInstrumentation::willFireTimerImpl):
(WebCore::InspectorInstrumentation::didLayoutImpl):
(WebCore::InspectorInstrumentation::willPaintImpl):
(WebCore::InspectorInstrumentation::didPaintImpl):
(WebCore::InspectorInstrumentation::didCommitLoadImpl):
(WebCore::InspectorInstrumentation::frameDocumentUpdatedImpl):
(WebCore::InspectorInstrumentation::didDispatchDOMStorageEventImpl):
(WebCore::InspectorInstrumentation::instrumentingAgentsForRenderer):
(WebCore::InspectorInstrumentation::instrumentingAgentsForPage): Deleted.
(WebCore::InspectorInstrumentation::instrumentingAgentsForWorkerGlobalScope): Deleted.
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::frameWindowDiscarded):
(WebCore::InspectorInstrumentation::didInstallTimer):
(WebCore::InspectorInstrumentation::didRemoveTimer):
(WebCore::InspectorInstrumentation::willFireTimer):
(WebCore::InspectorInstrumentation::didLayout):
(WebCore::InspectorInstrumentation::willComposite):
(WebCore::InspectorInstrumentation::didComposite):
(WebCore::InspectorInstrumentation::willPaint):
(WebCore::InspectorInstrumentation::didPaint):
(WebCore::InspectorInstrumentation::continueAfterPingLoader):
(WebCore::InspectorInstrumentation::scriptImported):
(WebCore::InspectorInstrumentation::didCommitLoad):
(WebCore::InspectorInstrumentation::frameDocumentUpdated):
(WebCore::InspectorInstrumentation::frameStartedLoading):
(WebCore::InspectorInstrumentation::frameStoppedLoading):
(WebCore::InspectorInstrumentation::frameScheduledNavigation):
(WebCore::InspectorInstrumentation::frameClearedScheduledNavigation):
(WebCore::InspectorInstrumentation::didDispatchDOMStorageEvent):
(WebCore::InspectorInstrumentation::shouldWaitForDebuggerOnStart):
(WebCore::InspectorInstrumentation::workerStarted):
(WebCore::InspectorInstrumentation::workerTerminated):
(WebCore::InspectorInstrumentation::didHandleMemoryPressure):
(WebCore::InspectorInstrumentation::networkStateChanged):
(WebCore::InspectorInstrumentation::addMessageToConsole):
(WebCore::InspectorInstrumentation::consoleCount):
(WebCore::InspectorInstrumentation::startConsoleTiming):
(WebCore::InspectorInstrumentation::stopConsoleTiming):
(WebCore::InspectorInstrumentation::instrumentingAgentsForContext):
(WebCore::InspectorInstrumentation::instrumentingAgentsForPage):
(WebCore::InspectorInstrumentation::instrumentingAgentsForWorkerGlobalScope):
Convert to references where possible.
* inspector/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::getMatchedStylesForNode):
(WebCore::InspectorCSSAgent::buildObjectForRule):
(WebCore::InspectorCSSAgent::buildArrayForMatchedRuleList):
* inspector/InspectorCSSAgent.h:
* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::frameDocumentUpdated):
* inspector/InspectorDOMAgent.h:
* inspector/InspectorDOMStorageAgent.cpp:
(WebCore::InspectorDOMStorageAgent::didDispatchDOMStorageEvent):
* inspector/InspectorDOMStorageAgent.h:
* inspector/InspectorInstrumentation.cpp:
* inspector/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::frameNavigated):
(WebCore::InspectorPageAgent::didPaint):
* inspector/InspectorPageAgent.h:
* inspector/InspectorReplayAgent.cpp:
(WebCore::InspectorReplayAgent::frameNavigated):
* inspector/InspectorReplayAgent.h:
* inspector/InspectorTimelineAgent.cpp:
(WebCore::InspectorTimelineAgent::didLayout):
(WebCore::InspectorTimelineAgent::didPaint):
* inspector/InspectorTimelineAgent.h:
Pass references through InspectorInstrumentation to the Agents.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::clear):
* page/DOMTimer.cpp:
(WebCore::DOMTimer::install):
(WebCore::DOMTimer::removeById):
(WebCore::DOMTimer::fired):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::willDetachPage):
* page/Frame.cpp:
(WebCore::Frame::setDocument):
* page/FrameView.cpp:
(WebCore::FrameView::layout):
(WebCore::FrameView::willPaintContents):
(WebCore::FrameView::didPaintContents):
* page/Page.cpp:
(WebCore::networkStateChanged):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::paintContents):
* replay/ReplayController.cpp:
(WebCore::ReplayController::frameNavigated):
* replay/ReplayController.h:
* storage/StorageEventDispatcher.cpp:
(WebCore::StorageEventDispatcher::dispatchSessionStorageEventsToFrames):
(WebCore::StorageEventDispatcher::dispatchLocalStorageEventsToFrames):
* workers/Worker.cpp:
(WebCore::Worker::notifyFinished):
* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::importScripts):
(WebCore::WorkerGlobalScope::addConsoleMessage):
(WebCore::WorkerGlobalScope::addMessage):
* workers/WorkerInspectorProxy.cpp:
(WebCore::WorkerInspectorProxy::workerStartMode):
(WebCore::WorkerInspectorProxy::workerStarted):
(WebCore::WorkerInspectorProxy::workerTerminated):
* workers/WorkerInspectorProxy.h:
* workers/WorkerMessagingProxy.cpp:
(WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
Pass references to InspectorInstrumentation.
2016-11-01 Alex Christensen <achristensen@webkit.org>
Percent-encode non-ASCII code points in hosts of URLs with unrecognized schemes
https://bugs.webkit.org/show_bug.cgi?id=164290
Reviewed by Tim Horton.
NSURL fails to parse these URLs, WebKit used to punycode encode them, but now we match Chrome and Firefox,
as well as what will likely become the standard once https://github.com/whatwg/url/issues/148 is resolved.
We continue to parse IPv6 address hosts because otherwise we wouldn't be able to tell where a port
starts in a URL with colons in the IPv6 address and before the port like "a://[b::c]:4"
Covered by new API tests and updated LayoutTests.
* platform/URLParser.cpp:
(WebCore::URLParser::domainToASCII):
(WebCore::URLParser::parseHostAndPort):
2016-11-01 Gavin Barraclough <barraclough@apple.com>
Add IsAudible, IsLoading to ActivityState
https://bugs.webkit.org/show_bug.cgi?id=164286
Reviewed by Geoff Garen.
By computing these values in the UIProcess and passing them to WebContent we can
more closely unify iOS & macOS throttling, and remove the PageThrottler class.
* page/ActivityState.h:
- added IsAudible, IsLoading
2016-10-31 Gavin Barraclough <barraclough@apple.com>
Rename ViewState to ActivityState
https://bugs.webkit.org/show_bug.cgi?id=164254
Reviewed by Andreas Kling.
We plan to add a couple more flags to ViewState that aren't directly related to the view
itself - whether there is an ongoing page load, and whether whether there is audio playback.
This will allow viewState (now activityState) to fully drive throttling decisions.
Renaming this bitfield accordingly.
* Modules/geolocation/GeolocationController.cpp:
(WebCore::GeolocationController::GeolocationController):
(WebCore::GeolocationController::~GeolocationController):
(WebCore::GeolocationController::activityStateDidChange):
(WebCore::GeolocationController::viewStateDidChange): Deleted.
* Modules/geolocation/GeolocationController.h:
* WebCore.xcodeproj/project.pbxproj:
* page/ActivityState.h: Copied from Source/WebCore/page/ViewState.h.
* page/ActivityStateChangeObserver.h: Copied from Source/WebCore/page/ViewStateChangeObserver.h.
(WebCore::ActivityStateChangeObserver::~ActivityStateChangeObserver):
(WebCore::ViewStateChangeObserver::~ViewStateChangeObserver): Deleted.
* page/FocusController.cpp:
(WebCore::FocusController::FocusController):
(WebCore::FocusController::setFocused):
(WebCore::FocusController::setActivityState):
(WebCore::FocusController::setActive):
(WebCore::FocusController::setViewState): Deleted.
* page/FocusController.h:
(WebCore::FocusController::isActive):
(WebCore::FocusController::isFocused):
(WebCore::FocusController::contentIsVisible):
* page/Page.cpp:
(WebCore::Page::Page):
(WebCore::Page::setIsInWindow):
(WebCore::Page::addActivityStateChangeObserver):
(WebCore::Page::removeActivityStateChangeObserver):
(WebCore::Page::updateTimerThrottlingState):
(WebCore::Page::setActivityState):
(WebCore::Page::isVisibleAndActive):
(WebCore::Page::setIsVisible):
(WebCore::Page::addViewStateChangeObserver): Deleted.
(WebCore::Page::removeViewStateChangeObserver): Deleted.
(WebCore::Page::setViewState): Deleted.
* page/Page.h:
(WebCore::Page::isVisible):
(WebCore::Page::isInWindow):
* page/PageThrottler.h:
* page/ViewState.h: Removed.
* page/ViewStateChangeObserver.h: Removed.
2016-11-01 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r208100.
This change caused LayoutTest crashes under GuardMalloc.
Reverted changeset:
"MediaEndpoint::generateDtlsInfo is not needed"
https://bugs.webkit.org/show_bug.cgi?id=164130
http://trac.webkit.org/changeset/208100
2016-11-01 Claudio Saavedra <csaavedra@igalia.com>
Add missing inline include to JSDeviceMotionEventCustom
https://bugs.webkit.org/show_bug.cgi?id=164269
Reviewed by Michael Catanzaro.
Inlined JSObject functions are used through JSObject::get() get here,
so this fixes the build with -fvisibility-inlines-hidden.
* bindings/js/JSDeviceMotionEventCustom.cpp: Include JSObjectInlines.h
2016-11-01 Fujii Hironori <Hironori.Fujii@sony.com>
[CMake] generate-bindings-all.pl uses USES_TERMINAL which leaves a noisy line in interactive Ninja build
https://bugs.webkit.org/show_bug.cgi?id=163868
Reviewed by Michael Catanzaro.
It takes long time for generate-bindings-all.pl to generate all
bindings. So, it shows the progress while running and
USES_TERMINAL option of add_custom_target have been used to invoke
the command. However, USES_TERMINAL leaves a noisy line in
Ninja's neat build log of interactive build.
A new CMake option SHOW_BINDINGS_GENERATION_PROGRESS is added to
stop using USES_TERMINAL only in case of interactive Ninja build.
* bindings/scripts/generate-bindings-all.pl: Added a new switch
--showProgress. Removed $terminalWidth and getTerminalWidth which
are mainly for interactive Ninja build. Added printProgress.
2016-11-01 Ryosuke Niwa <rniwa@webkit.org>
Web Inspector: Add the support for custom elements
https://bugs.webkit.org/show_bug.cgi?id=164266
<rdar://problem/29038883>
Reviewed by Joseph Pecoraro.
Set "customElementState" property on each DOMNode object when building a protocol object for the node.
Also added InspectorInstrumentation::didChangeCustomElementState to track the changes to custom element states.
Tests: inspector/dom/customElementState.html
* dom/Element.cpp:
(WebCore::Element::setIsDefinedCustomElement): Invoke didChangeCustomElementState to update the state.
(WebCore::Element::setIsFailedCustomElement): Ditto.
(WebCore::Element::setIsCustomElementUpgradeCandidate): Ditto.
(WebCore::Element::enqueueToUpgrade): Ditto.
* inspector/InspectorDOMAgent.cpp:
(WebCore::customElementState): Added.
(WebCore::InspectorDOMAgent::buildObjectForNode): Set the custom element state.
(WebCore::InspectorDOMAgent::didChangeCustomElementState): Invoke customElementStateChanged.
* inspector/InspectorDOMAgent.h:
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::didChangeCustomElementStateImpl): Added.
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::didChangeCustomElementState): Added.
2016-10-31 Ryosuke Niwa <rniwa@webkit.org>
Add StaticPasteboard.cpp to the cmake after r207841.
* CMakeLists.txt:
2016-10-31 Zalan Bujtas <zalan@apple.com>
Simple line layout: Clear needs layout flag even when only overflow is getting recomputed.
https://bugs.webkit.org/show_bug.cgi?id=164253
Reviewed by Antti Koivisto.
When a style change triggers visual overflow re-computation, we set StyleDifferenceLayout style diff
but in practice we don't actually make changes to the simple line structure. We just re-compute the visual overflow later.
This patch moves the 'clean the renderes' logic back to RenderBlockFlow::layoutSimpleLines so that
we set the needs layout bit to false regardless of whether we preformed layout.
Covered by fast/events/tabindex-focus-blur-all.html
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::layoutSimpleLines):
* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::create):
2016-10-31 Simon Fraser <simon.fraser@apple.com>
Add basic visual/layout viewport support for fixed position layout
https://bugs.webkit.org/show_bug.cgi?id=164261
Reviewed by Dean Jackson.
This patch adds a new behavior for position:fixed objects on zooming. Instead of
interpolating between two implicit viewports as we do now, have explicit and distinct
layout and visual viewports.
The layout viewport is always the size of the initial containing block (i.e. the RenderView).
Position:fixed and sticky elements are laid out relative to the layout viewport.
The visual viewport is the visible part of the view, in content coordinates.
When the user pans and zooms, the visual viewport changes. If it hits the edge of the
layout viepwort, it pushes the layout viewport in that direction; it's as if the user
is dragging the layout viewport around.
The layout viewport is maintained on FrameView, and has to be recomputed when the
scroll position changes, when the view size changes, and when the content size (which
affets min/max scroll position) changes. Layout viewport size and position are computed
in unzoomed coordinates, requiring some new functions on FrameView to return these.
Updated the TileCoverageMap to show the layout viewport visually.
Subsequent patches will plumb the layout and visual viewports through the scrolling tree.
Tests: fast/visual-viewport/nonzoomed-rects.html
fast/visual-viewport/zoomed-fixed-scroll-down-then-up.html
fast/visual-viewport/zoomed-fixed.html
fast/visual-viewport/zoomed-rects.html
* page/FrameView.cpp:
(WebCore::FrameView::fixedScrollableAreaBoundsInflatedForScrolling):
(WebCore::FrameView::scrollPositionRespectingCustomFixedPosition):
(WebCore::FrameView::computeLayoutViewportOrigin):
(WebCore::FrameView::setLayoutViewportOrigin):
(WebCore::FrameView::updateLayoutViewport):
(WebCore::FrameView::minStableLayoutViewportOrigin):
(WebCore::FrameView::maxStableLayoutViewportOrigin):
(WebCore::FrameView::layoutViewportRect):
(WebCore::FrameView::visualViewportRect):
(WebCore::FrameView::viewportConstrainedVisibleContentRect):
(WebCore::FrameView::rectForFixedPositionLayout):
(WebCore::FrameView::scrollPositionForFixedPosition):
(WebCore::FrameView::unscaledMinimumScrollPosition):
(WebCore::FrameView::unscaledMaximumScrollPosition):
(WebCore::FrameView::scrollPositionChanged):
(WebCore::FrameView::availableContentSizeChanged):
(WebCore::FrameView::performPostLayoutTasks):
(WebCore::FrameView::scrollTo):
(WebCore::FrameView::useCustomFixedPositionLayoutRect):
* page/FrameView.h:
* page/Settings.in:
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
* platform/graphics/TiledBacking.h:
* platform/graphics/ca/TileController.cpp:
(WebCore::TileController::setLayoutViewportRect):
* platform/graphics/ca/TileController.h:
* platform/graphics/ca/TileCoverageMap.cpp:
(WebCore::TileCoverageMap::TileCoverageMap):
(WebCore::TileCoverageMap::update):
* platform/graphics/ca/TileCoverageMap.h:
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::constrainingRectForStickyPosition):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateCompositedBounds):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::requiresCompositingForPosition):
(WebCore::RenderLayerCompositor::computeFixedViewportConstraints):
* rendering/RenderTreeAsText.cpp:
(WebCore::externalRepresentation): Logging here is useful when debugging tests.
* testing/Internals.cpp:
(WebCore::Internals::layoutViewportRect): Expose these rects so tests can dump them.
(WebCore::Internals::visualViewportRect):
* testing/Internals.h:
* testing/Internals.idl:
2016-10-31 Simon Fraser <simon.fraser@apple.com>
Fix bindings tests after r208209.
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::setJSTestObjTypedArrayAttrFunction):
* bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
(WebCore::constructJSTestOverloadedConstructors1):
(WebCore::constructJSTestOverloadedConstructors2):
2016-10-31 Joseph Pecoraro <pecoraro@apple.com>
Warning: Multiple build commands for output file RenderThemeCocoa.h
https://bugs.webkit.org/show_bug.cgi?id=164265
Reviewed by Ryosuke Niwa.
* WebCore.xcodeproj/project.pbxproj:
2016-10-29 Filip Pizlo <fpizlo@apple.com>
JSC should support SharedArrayBuffer
https://bugs.webkit.org/show_bug.cgi?id=163986
Reviewed by Keith Miller.
New tests added in the LayoutTests/workers/sab directory.
This teaches WebCore that a typed array could be shared or not. By default, WebCore will
reject shared typed arrays as if they were not typed arrays. This ensures that we don't get
race conditions in code that can't handle it.
If you postMessage a SharedArrayBuffer or something that wraps it, you will send the shared
memory to the other worker.
* Modules/encryptedmedia/CDMSessionClearKey.cpp:
(WebCore::CDMSessionClearKey::cachedKeyForKeyID):
* Modules/fetch/FetchBody.cpp:
(WebCore::FetchBody::extract):
* Modules/mediastream/RTCDataChannel.cpp:
(WebCore::RTCDataChannel::send):
* Modules/webaudio/AudioBuffer.cpp:
(WebCore::AudioBuffer::getChannelData):
* Modules/websockets/WebSocket.cpp:
(WebCore::WebSocket::send):
* bindings/js/JSBlobCustom.cpp:
(WebCore::constructJSBlob):
* bindings/js/JSCryptoAlgorithmDictionary.cpp:
(WebCore::createRsaKeyGenParams):
* bindings/js/JSCryptoCustom.cpp:
(WebCore::JSCrypto::getRandomValues):
* bindings/js/JSCryptoOperationData.cpp:
(WebCore::cryptoOperationDataFromJSValue):
* bindings/js/JSDOMBinding.h:
(WebCore::toJS):
(WebCore::toPossiblySharedArrayBufferView):
(WebCore::toUnsharedArrayBufferView):
(WebCore::toPossiblySharedInt8Array):
(WebCore::toPossiblySharedInt16Array):
(WebCore::toPossiblySharedInt32Array):
(WebCore::toPossiblySharedUint8Array):
(WebCore::toPossiblySharedUint8ClampedArray):
(WebCore::toPossiblySharedUint16Array):
(WebCore::toPossiblySharedUint32Array):
(WebCore::toPossiblySharedFloat32Array):
(WebCore::toPossiblySharedFloat64Array):
(WebCore::toUnsharedInt8Array):
(WebCore::toUnsharedInt16Array):
(WebCore::toUnsharedInt32Array):
(WebCore::toUnsharedUint8Array):
(WebCore::toUnsharedUint8ClampedArray):
(WebCore::toUnsharedUint16Array):
(WebCore::toUnsharedUint32Array):
(WebCore::toUnsharedFloat32Array):
(WebCore::toUnsharedFloat64Array):
(WebCore::toArrayBufferView): Deleted.
(WebCore::toInt8Array): Deleted.
(WebCore::toInt16Array): Deleted.
(WebCore::toInt32Array): Deleted.
(WebCore::toUint8Array): Deleted.
(WebCore::toUint8ClampedArray): Deleted.
(WebCore::toUint16Array): Deleted.
(WebCore::toUint32Array): Deleted.
(WebCore::toFloat32Array): Deleted.
(WebCore::toFloat64Array): Deleted.
* bindings/js/JSDataCueCustom.cpp:
(WebCore::constructJSDataCue):
* bindings/js/JSDictionary.cpp:
(WebCore::JSDictionary::convertValue):
* bindings/js/JSFileCustom.cpp:
(WebCore::constructJSFile):
* bindings/js/JSMessagePortCustom.cpp:
(WebCore::extractTransferables):
* bindings/js/JSWebGLRenderingContextBaseCustom.cpp:
(WebCore::dataFunctionf):
(WebCore::dataFunctioni):
(WebCore::dataFunctionMatrix):
* bindings/js/JSXMLHttpRequestCustom.cpp:
(WebCore::JSXMLHttpRequest::send):
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneSerializer::dumpArrayBufferView):
(WebCore::CloneSerializer::dumpIfTerminal):
(WebCore::CloneDeserializer::readArrayBufferView):
(WebCore::CloneDeserializer::readTerminal):
(WebCore::SerializedScriptValue::transferArrayBuffers):
* bindings/js/StructuredClone.cpp:
(WebCore::structuredCloneArrayBuffer):
(WebCore::structuredCloneArrayBufferView):
* bindings/scripts/CodeGeneratorJS.pm:
(JSValueToNative):
* css/FontFace.cpp:
(WebCore::FontFace::create):
* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::bufferData):
(WebCore::WebGL2RenderingContext::bufferSubData):
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
(WebCore::MediaPlayerPrivateAVFoundation::extractKeyURIKeyIDAndCertificateFromInitData):
2016-10-31 Simon Fraser <simon.fraser@apple.com>
Make UIScriptController::zoomToScale() work on Mac WK1 and WK2
https://bugs.webkit.org/show_bug.cgi?id=164238
Reviewed by Dean Jackson.
Test: fast/zooming/uiscript-zooming.html
Expose pageScaleFactor() for tests.
* testing/Internals.cpp:
(WebCore::Internals::pageScaleFactor):
* testing/Internals.h:
* testing/Internals.idl:
2016-10-31 Myles C. Maxfield <mmaxfield@apple.com>
Migrate CanvasRenderingContext's internal canvas pointer to a reference
https://bugs.webkit.org/show_bug.cgi?id=164259
Reviewed by Dean Jackson.
It is never nullptr.
No new tests because there is no behavior change.
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::getContext):
* html/canvas/CanvasRenderingContext.cpp:
(WebCore::CanvasRenderingContext::CanvasRenderingContext):
(WebCore::CanvasRenderingContext::wouldTaintOrigin):
(WebCore::CanvasRenderingContext::checkOrigin):
* html/canvas/CanvasRenderingContext.h:
(WebCore::CanvasRenderingContext::ref):
(WebCore::CanvasRenderingContext::deref):
(WebCore::CanvasRenderingContext::canvas):
(WebCore::CanvasRenderingContext::checkOrigin):
* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::CanvasRenderingContext2D):
(WebCore::CanvasRenderingContext2D::unwindStateStack):
(WebCore::CanvasRenderingContext2D::isAccelerated):
(WebCore::CanvasRenderingContext2D::realizeSaves):
(WebCore::CanvasRenderingContext2D::setStrokeStyle):
(WebCore::CanvasRenderingContext2D::setFillStyle):
(WebCore::CanvasRenderingContext2D::setShadowColor):
(WebCore::CanvasRenderingContext2D::resetTransform):
(WebCore::CanvasRenderingContext2D::setStrokeColor):
(WebCore::CanvasRenderingContext2D::setFillColor):
(WebCore::CanvasRenderingContext2D::setShadow):
(WebCore::CanvasRenderingContext2D::clearCanvas):
(WebCore::CanvasRenderingContext2D::transformAreaToDevice):
(WebCore::CanvasRenderingContext2D::rectContainsCanvas):
(WebCore::CanvasRenderingContext2D::calculateCompositingBufferRect):
(WebCore::CanvasRenderingContext2D::compositeBuffer):
(WebCore::CanvasRenderingContext2D::createPattern):
(WebCore::CanvasRenderingContext2D::didDrawEntireCanvas):
(WebCore::CanvasRenderingContext2D::didDraw):
(WebCore::CanvasRenderingContext2D::paintRenderingResultsToCanvas):
(WebCore::CanvasRenderingContext2D::drawingContext):
(WebCore::CanvasRenderingContext2D::getImageData):
(WebCore::CanvasRenderingContext2D::drawFocusIfNeededInternal):
(WebCore::CanvasRenderingContext2D::putImageData):
(WebCore::CanvasRenderingContext2D::setFont):
(WebCore::CanvasRenderingContext2D::toTextDirection):
(WebCore::CanvasRenderingContext2D::direction):
(WebCore::CanvasRenderingContext2D::platformLayer):
* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::WebGL2RenderingContext):
* html/canvas/WebGL2RenderingContext.h:
* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::WebGLRenderingContext):
* html/canvas/WebGLRenderingContext.h:
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::create):
(WebCore::WebGLRenderingContextBase::WebGLRenderingContextBase):
(WebCore::WebGLRenderingContextBase::setupFlags):
(WebCore::WebGLRenderingContextBase::markContextChanged):
(WebCore::WebGLRenderingContextBase::paintRenderingResultsToCanvas):
(WebCore::WebGLRenderingContextBase::reshape):
(WebCore::WebGLRenderingContextBase::isContextLostOrPending):
(WebCore::WebGLRenderingContextBase::readPixels):
(WebCore::WebGLRenderingContextBase::loseContextImpl):
(WebCore::WebGLRenderingContextBase::printWarningToConsole):
(WebCore::WebGLRenderingContextBase::dispatchContextLostEvent):
(WebCore::WebGLRenderingContextBase::maybeRestoreContext):
(WebCore::WebGLRenderingContextBase::clampedCanvasSize):
* html/canvas/WebGLRenderingContextBase.h:
2016-10-31 Brady Eidson <beidson@apple.com>
Address style feedback in https://bugs.webkit.org/show_bug.cgi?id=164097
https://bugs.webkit.org/show_bug.cgi?id=164248
Unreviewed. Addressing review feedback (and then some) from Darin Adler on earlier patch.
No new tests (No behavior change).
* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::commit):
(WebCore::IDBTransaction::createObjectStore):
(WebCore::IDBTransaction::renameObjectStore):
(WebCore::IDBTransaction::createIndex):
(WebCore::IDBTransaction::renameIndex):
(WebCore::IDBTransaction::requestOpenCursor):
(WebCore::IDBTransaction::doRequestOpenCursor):
(WebCore::IDBTransaction::iterateCursor):
(WebCore::IDBTransaction::requestGetAllObjectStoreRecords):
(WebCore::IDBTransaction::requestGetRecord):
(WebCore::IDBTransaction::requestGetValue):
(WebCore::IDBTransaction::requestGetKey):
(WebCore::IDBTransaction::requestIndexRecord):
(WebCore::IDBTransaction::requestCount):
(WebCore::IDBTransaction::requestDeleteRecord):
(WebCore::IDBTransaction::requestClearObjectStore):
(WebCore::IDBTransaction::requestPutOrAdd):
(WebCore::IDBTransaction::deleteObjectStore):
(WebCore::IDBTransaction::deleteIndex):
* Modules/indexeddb/client/IDBConnectionProxy.cpp:
(WebCore::IDBClient::IDBConnectionProxy::createObjectStore):
(WebCore::IDBClient::IDBConnectionProxy::renameObjectStore):
(WebCore::IDBClient::IDBConnectionProxy::renameIndex):
(WebCore::IDBClient::IDBConnectionProxy::deleteObjectStore):
(WebCore::IDBClient::IDBConnectionProxy::clearObjectStore):
(WebCore::IDBClient::IDBConnectionProxy::createIndex):
(WebCore::IDBClient::IDBConnectionProxy::deleteIndex):
(WebCore::IDBClient::IDBConnectionProxy::putOrAdd):
(WebCore::IDBClient::IDBConnectionProxy::getRecord):
(WebCore::IDBClient::IDBConnectionProxy::getAllRecords):
(WebCore::IDBClient::IDBConnectionProxy::getCount):
(WebCore::IDBClient::IDBConnectionProxy::deleteRecord):
(WebCore::IDBClient::IDBConnectionProxy::openCursor):
(WebCore::IDBClient::IDBConnectionProxy::iterateCursor):
* Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
(WebCore::IDBServer::MemoryIDBBackingStore::beginTransaction):
(WebCore::IDBServer::MemoryIDBBackingStore::abortTransaction):
(WebCore::IDBServer::MemoryIDBBackingStore::commitTransaction):
(WebCore::IDBServer::MemoryIDBBackingStore::createObjectStore):
(WebCore::IDBServer::MemoryIDBBackingStore::deleteObjectStore):
(WebCore::IDBServer::MemoryIDBBackingStore::renameObjectStore):
(WebCore::IDBServer::MemoryIDBBackingStore::clearObjectStore):
(WebCore::IDBServer::MemoryIDBBackingStore::createIndex):
(WebCore::IDBServer::MemoryIDBBackingStore::deleteIndex):
(WebCore::IDBServer::MemoryIDBBackingStore::renameIndex):
(WebCore::IDBServer::MemoryIDBBackingStore::keyExistsInObjectStore):
(WebCore::IDBServer::MemoryIDBBackingStore::deleteRange):
(WebCore::IDBServer::MemoryIDBBackingStore::addRecord):
(WebCore::IDBServer::MemoryIDBBackingStore::getRecord):
(WebCore::IDBServer::MemoryIDBBackingStore::getAllRecords):
(WebCore::IDBServer::MemoryIDBBackingStore::getIndexRecord):
(WebCore::IDBServer::MemoryIDBBackingStore::getCount):
(WebCore::IDBServer::MemoryIDBBackingStore::generateKeyNumber):
(WebCore::IDBServer::MemoryIDBBackingStore::openCursor):
(WebCore::IDBServer::MemoryIDBBackingStore::iterateCursor):
* Modules/indexeddb/shared/IDBResultData.cpp:
(WebCore::IDBResultData::error):
(WebCore::IDBResultData::openDatabaseSuccess):
(WebCore::IDBResultData::openDatabaseUpgradeNeeded):
(WebCore::IDBResultData::deleteDatabaseSuccess):
(WebCore::IDBResultData::putOrAddSuccess):
(WebCore::IDBResultData::getRecordSuccess):
(WebCore::IDBResultData::getAllRecordsSuccess):
(WebCore::IDBResultData::getCountSuccess):
(WebCore::IDBResultData::openCursorSuccess):
(WebCore::IDBResultData::iterateCursorSuccess):
2016-10-31 Ryosuke Niwa <rniwa@webkit.org>
Enable custom elements by default everywhere
https://bugs.webkit.org/show_bug.cgi?id=164242
Reviewed by Antti Koivisto.
Set the status of Custom Elements API to "Done".
* features.json:
2016-10-31 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r207967.
This change seems to be the cause of at least one LayoutTest
becoming flaky.
Reverted changeset:
"REGRESSION(r207753-207755): ASSERTION FAILED:
m_parsedStyleSheetCache->isInMemoryCache()"
https://bugs.webkit.org/show_bug.cgi?id=163905
http://trac.webkit.org/changeset/207967
2016-10-31 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Shadow DOM scoped styles are missing
https://bugs.webkit.org/show_bug.cgi?id=164247
<rdar://problem/29035061>
Reviewed by Antti Koivisto.
Test: inspector/css/shadow-scoped-style.html
* css/ElementRuleCollector.cpp:
(WebCore::ElementRuleCollector::matchAuthorRules):
Only match :host pseudo class for NOPSEUDO. It doesn't make sense
with a pseudo element request (:host::before does not make sense).
* css/InspectorCSSOMWrappers.h:
* css/InspectorCSSOMWrappers.cpp:
(WebCore::InspectorCSSOMWrappers::collectFromStyleSheetContents):
(WebCore::InspectorCSSOMWrappers::collectDocumentWrappers):
(WebCore::InspectorCSSOMWrappers::getWrapperForRuleInSheets):
Simplify existing "once per document" wrapper collection.
(WebCore::InspectorCSSOMWrappers::maybeCollectFromStyleSheets):
(WebCore::InspectorCSSOMWrappers::collectScopeWrappers):
Include a path to add style sheets that weren't already collected.
This will be useful when trying the StyleScope stylesheets which
are different for different nodes.
* inspector/InspectorCSSAgent.cpp:
(WebCore::containingStyleScopeForElement):
(WebCore::InspectorCSSAgent::buildObjectForRule):
Collect rules for document and StyleScope sheets separately.
For elements with a shadow root, add the root's sheets as
well in case there are :host rules that affect the element.
2016-10-31 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r208180.
This change caused fast/shadow-dom/slotted-pseudo-element-css-
text.html to crash on macOS and iOS on every test run.
Reverted changeset:
"[CSS Parser] Support the shadow DOM"
https://bugs.webkit.org/show_bug.cgi?id=164240
http://trac.webkit.org/changeset/208180
2016-10-31 Nan Wang <n_wang@apple.com>
AX: aria-sort is not exposed on iOS
https://bugs.webkit.org/show_bug.cgi?id=164245
Reviewed by Chris Fleizach.
Exposed the aria-sort attribute value in accessibilitySortDirection.
Test: accessibility/ios-simulator/aria-sort-ios.html
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper accessibilitySortDirection]):
2016-10-31 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r208178.
The test added with this change fails or times out on macOS
and iOS.
Reverted changeset:
"[Modern Media Controls] Media Controller: Airplay support"
https://bugs.webkit.org/show_bug.cgi?id=163729
http://trac.webkit.org/changeset/208178
2016-10-31 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r208182.
Both of the tests added with this change time out on macOS
Release.
Reverted changeset:
"[Modern Media Controls] Media Controller: Placard support"
https://bugs.webkit.org/show_bug.cgi?id=163731
http://trac.webkit.org/changeset/208182
2016-10-31 Brady Eidson <beidson@apple.com>
IndexedDB 2.0: Support IDBObjectStore getAll/getAllKeys.
<rdar://problem/28806934> and https://bugs.webkit.org/show_bug.cgi?id=164097
Reviewed by Darin Adler.
Tests: storage/indexeddb/modern/idbobjectstore-getall-1-private.html
storage/indexeddb/modern/idbobjectstore-getall-1.html
storage/indexeddb/modern/idbobjectstore-getallkeys-1-private.html
storage/indexeddb/modern/idbobjectstore-getallkeys-1.html
Existing imported W3C tests.
- Add new objects for "IDBGetAllRequestData" and "IDBGetAllResult" to represent these
new requests and responses.
- Add lots of boilerplate code to move these new objects around in the IDB machinery.
- Update "GetRecord" code to be shared with "GetAll" code where necessary.
- Other tweaks here and there.
* WebCore.xcodeproj/project.pbxproj:
* CMakeLists.txt:
* Modules/indexeddb/IDBGetAllResult.cpp: Added.
(WebCore::isolatedCopyOfVariant):
(WebCore::IDBGetAllResult::isolatedCopy):
(WebCore::IDBGetAllResult::addKey):
(WebCore::IDBGetAllResult::addValue):
(WebCore::IDBGetAllResult::keys):
(WebCore::IDBGetAllResult::values):
(WebCore::IDBGetAllResult::allBlobFilePaths):
* Modules/indexeddb/IDBGetAllResult.h: Added.
(WebCore::IDBGetAllResult::IDBGetAllResult):
(WebCore::IDBGetAllResult::type):
(WebCore::IDBGetAllResult::encode):
(WebCore::IDBGetAllResult::decode):
* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::getAll):
(WebCore::IDBObjectStore::getAllKeys):
* Modules/indexeddb/IDBObjectStore.h:
* Modules/indexeddb/IDBObjectStore.idl:
* Modules/indexeddb/IDBRequest.cpp:
(WebCore::IDBRequest::setResult):
* Modules/indexeddb/IDBRequest.h:
* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::requestGetAllObjectStoreRecords):
(WebCore::IDBTransaction::getAllRecordsOnServer):
(WebCore::IDBTransaction::didGetAllRecordsOnServer):
* Modules/indexeddb/IDBTransaction.h:
* Modules/indexeddb/IndexedDB.h:
* Modules/indexeddb/client/IDBConnectionProxy.cpp:
(WebCore::IDBClient::IDBConnectionProxy::getAllRecords):
* Modules/indexeddb/client/IDBConnectionProxy.h:
* Modules/indexeddb/client/IDBConnectionToServer.cpp:
(WebCore::IDBClient::IDBConnectionToServer::getAllRecords):
(WebCore::IDBClient::IDBConnectionToServer::didGetAllRecords):
* Modules/indexeddb/client/IDBConnectionToServer.h:
* Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
* Modules/indexeddb/server/IDBBackingStore.h:
* Modules/indexeddb/server/IDBConnectionToClient.cpp:
(WebCore::IDBServer::IDBConnectionToClient::didGetAllRecords):
* Modules/indexeddb/server/IDBConnectionToClient.h:
* Modules/indexeddb/server/IDBConnectionToClientDelegate.h:
* Modules/indexeddb/server/IDBServer.cpp:
(WebCore::IDBServer::IDBServer::getAllRecords):
* Modules/indexeddb/server/IDBServer.h:
* Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
(WebCore::IDBServer::MemoryIDBBackingStore::getAllRecords):
* Modules/indexeddb/server/MemoryIDBBackingStore.h:
* Modules/indexeddb/server/MemoryObjectStore.cpp:
(WebCore::IDBServer::MemoryObjectStore::getAllRecords):
* Modules/indexeddb/server/MemoryObjectStore.h:
* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::queryForGetAllRecords):
(WebCore::IDBServer::SQLiteIDBBackingStore::getAllRecords):
* Modules/indexeddb/server/SQLiteIDBBackingStore.h:
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::hasAnyPendingCallbacks):
(WebCore::IDBServer::UniqueIDBDatabase::storeCallbackOrFireError):
(WebCore::IDBServer::UniqueIDBDatabase::getAllRecords):
(WebCore::IDBServer::UniqueIDBDatabase::performGetAllRecords):
(WebCore::IDBServer::UniqueIDBDatabase::didPerformGetAllRecords):
(WebCore::IDBServer::UniqueIDBDatabase::performGetAllResultsCallback):
* Modules/indexeddb/server/UniqueIDBDatabase.h:
* Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::getAllRecords):
* Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:
* Modules/indexeddb/shared/IDBGetAllRecordsData.cpp: Added.
(WebCore::IDBGetAllRecordsData::isolatedCopy):
* Modules/indexeddb/shared/IDBGetAllRecordsData.h: Added.
(WebCore::IDBGetAllRecordsData::encode):
(WebCore::IDBGetAllRecordsData::decode):
* Modules/indexeddb/shared/IDBResultData.cpp:
(WebCore::IDBResultData::IDBResultData):
(WebCore::IDBResultData::getAllRecordsSuccess):
(WebCore::IDBResultData::getAllResult):
* Modules/indexeddb/shared/IDBResultData.h:
(WebCore::IDBResultData::encode):
(WebCore::IDBResultData::decode):
* Modules/indexeddb/shared/InProcessIDBServer.cpp:
(WebCore::InProcessIDBServer::didGetAllRecords):
(WebCore::InProcessIDBServer::getAllRecords):
* Modules/indexeddb/shared/InProcessIDBServer.h:
* bindings/js/IDBBindingUtilities.cpp:
(WebCore::deserializeIDBValueToJSValue):
(WebCore::toJS):
* bindings/js/IDBBindingUtilities.h:
2016-10-31 Ryosuke Niwa <rniwa@webkit.org>
GTK+ and EFL build fixes after r208176.
* css/PropertySetCSSStyleDeclaration.cpp:
2016-10-31 Simon Fraser <simon.fraser@apple.com>
Fix #include case.
* page/IntersectionObserverEntry.h:
2016-10-31 Wenson Hsieh <wenson_hsieh@apple.com>
[WK1] Candidate visibility should not update as a result of selection during a dictionary lookup
https://bugs.webkit.org/show_bug.cgi?id=164236
<rdar://problem/28747712>
Reviewed by Beth Dakin.
Moves state that keeps track of whether or not a dictionary lookup is active from the WebPage to the Editor, so
that when clicking a text field or contenteditable in WK1 or WK2, we are able to avoid notifying the
WebEditorClient of the selection change.
Changes to WK2 are covered by existing unit tests in WKWebViewCandidateTests which verify that clicking does not
thrash candidate list visibility. A similar test will be added in the future for the WK1 case in CandidateTests.
* editing/Editor.h:
(WebCore::Editor::setIsGettingDictionaryPopupInfo):
(WebCore::Editor::isGettingDictionaryPopupInfo):
2016-10-31 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Media Controller: Placard support
https://bugs.webkit.org/show_bug.cgi?id=163731
<rdar://problem/28869598>
Reviewed by Dean Jackson.
We introduce the PlacardSupport class which brings support for showing the
appropriate placard when the media is played via AirPlay or in picture-in-picture.
Tests: media/modern-media-controls/placard-support/placard-support-airplay.html
media/modern-media-controls/placard-support/placard-support-pip.html
* Modules/modern-media-controls/js-files:
* Modules/modern-media-controls/media/media-controller.js:
(MediaController):
* Modules/modern-media-controls/media/placard-support.js: Added.
(PlacardSupport):
(PlacardSupport.prototype.get mediaEvents):
(PlacardSupport.prototype.handleEvent):
(PlacardSupport.prototype._updatePlacard):
* WebCore.xcodeproj/project.pbxproj:
2016-10-31 Simon Fraser <simon.fraser@apple.com>
Implement IntersectionObserver
https://bugs.webkit.org/show_bug.cgi?id=159475
Reviewed by Ryosuke Niwa.
Add bindings support for Intersection Observer
<https://wicg.github.io/IntersectionObserver/>
Code is wrapped in ENABLE(INTERSECTION_OBSERVER), and controlled by a runtime
Setting (off by default for now).
A minor bindings change was required to fix the callback code.
IntersectionObserver is just a shell for now.
Tests: intersection-observer/intersection-observer-entry-interface.html
intersection-observer/intersection-observer-interface.html
* CMakeLists.txt:
* Configurations/FeatureDefines.xcconfig:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* bindings/scripts/CodeGeneratorJS.pm:
(ShouldPassWrapperByReference):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::JSTestObjConstructor::construct):
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
(WebCore::JSTestTypedefsConstructor::construct):
* page/IntersectionObserver.cpp: Added.
(WebCore::IntersectionObserver::IntersectionObserver):
(WebCore::IntersectionObserver::observe):
(WebCore::IntersectionObserver::unobserve):
(WebCore::IntersectionObserver::disconnect):
(WebCore::IntersectionObserver::takeRecords):
* page/IntersectionObserver.h: Added.
(WebCore::IntersectionObserver::create):
(WebCore::IntersectionObserver::root):
(WebCore::IntersectionObserver::rootMargin):
(WebCore::IntersectionObserver::thresholds):
* page/IntersectionObserver.idl: Added.
* page/IntersectionObserverCallback.h: Added.
(WebCore::IntersectionObserverCallback::~IntersectionObserverCallback):
* page/IntersectionObserverCallback.idl: Added.
* page/IntersectionObserverEntry.cpp: Added.
(WebCore::IntersectionObserverEntry::IntersectionObserverEntry):
* page/IntersectionObserverEntry.h: Added.
(WebCore::IntersectionObserverEntry::create):
(WebCore::IntersectionObserverEntry::time):
(WebCore::IntersectionObserverEntry::rootBounds):
(WebCore::IntersectionObserverEntry::boundingClientRect):
(WebCore::IntersectionObserverEntry::intersectionRect):
(WebCore::IntersectionObserverEntry::target):
(WebCore::IntersectionObserverEntry::intersectionRatio):
* page/IntersectionObserverEntry.idl: Added.
* page/Settings.in:
2016-10-31 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Support the shadow DOM
https://bugs.webkit.org/show_bug.cgi?id=164240
Reviewed by Dean Jackson.
* css/CSSSelector.cpp:
(WebCore::CSSSelector::selectorText):
Remove ShadowDeep, ShadowSlot and ShadowPseudo in favor of our
ShadowDescendant combinator.
* css/CSSSelector.h:
* css/SelectorChecker.cpp:
(WebCore::SelectorChecker::matchRecursively):
Remove ShadowDeep, ShadowSlot and ShadowPseudo in favor of our
ShadowDescendant combinator.
* css/SelectorFilter.cpp:
(WebCore::SelectorFilter::collectIdentifierHashes):
Remove ShadowDeep, ShadowSlot and ShadowPseudo in favor of our
ShadowDescendant combinator.
* css/SelectorPseudoElementTypeMap.in:
Add support for slotted.
* css/parser/CSSParserValues.cpp:
(WebCore::CSSParserSelector::appendTagHistory):
* css/parser/CSSParserValues.h:
(WebCore::CSSParserSelector::needsImplicitShadowCombinatorForMatching):
Remove ShadowDeep, ShadowSlot and ShadowPseudo in favor of our
ShadowDescendant combinator. Take :slotted out of
needsImplicitShadowCombinatorForMatching(), since our code doesn't do
this for :slotted.
* css/parser/CSSSelectorParser.cpp:
(WebCore::isPseudoClassFunction):
:host can be both an id and a function, so don't restrict it.
(WebCore::CSSSelectorParser::consumePseudo):
Put in a hack for :host (inside the hack we already plan on removing
once we turn on).
(WebCore::CSSSelectorParser::consumeCombinator):
Remove deep shadow combinator support, as we don't support matching
on it.
(WebCore::CSSSelectorParser::prependTypeSelectorIfNeeded):
(WebCore::CSSSelectorParser::splitCompoundAtImplicitShadowCrossingCombinator):
Make the split use our combinator, ShadowDescendant, and no longer do anything
special with :slotted.
* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::fragmentRelationForSelectorRelation):
Remove ShadowDeep, ShadowSlot and ShadowPseudo in favor of our
ShadowDescendant combinator.
2016-10-31 Joseph Pecoraro <pecoraro@apple.com>
Use #pragma once in WebCore
https://bugs.webkit.org/show_bug.cgi?id=164194
Rubber-stamped by Sam Weinig.
* accessibility/*.h:
* bindings/*.h:
* contentextensions/*.h:
* dom/*.h:
* html/*.h:
* page/*.h:
Use #pragma once in headers.
* html/parser/ParsingUtilities.h:
Add missing namespace.
* html/track/VTTScanner.h:
(WebCore::VTTScanner::skipWhile):
(WebCore::VTTScanner::skipUntil):
(WebCore::VTTScanner::collectWhile):
(WebCore::VTTScanner::collectUntil):
Include namespace.
2016-10-31 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Media Controller: Airplay support
https://bugs.webkit.org/show_bug.cgi?id=163729
Reviewed by Dean Jackson.
We introduce the AirplaySupport class which brings support for playing the media
via Airplay by clicking on the Airplay button in the media controls and correctly
reflecting when the media is played through Airplay via the media API. The enabled
state of the Airplay button is also tied to Airplay sources being available.
Test: media/modern-media-controls/airplay-support/airplay-support.html
* Modules/modern-media-controls/controls/airplay-button.js:
(AirplayButton.prototype.get on):
* Modules/modern-media-controls/js-files:
* Modules/modern-media-controls/media/airplay-support.js: Added.
(AirplaySupport.prototype.get control):
(AirplaySupport.prototype.get mediaEvents):
(AirplaySupport.prototype.buttonWasClicked):
(AirplaySupport.prototype.handleEvent):
(AirplaySupport.prototype.syncControl):
(AirplaySupport):
* Modules/modern-media-controls/media/media-controller.js:
(MediaController):
* WebCore.xcodeproj/project.pbxproj:
2016-10-31 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Provide an opportunity to clear ScriptValues associated with debugged target
https://bugs.webkit.org/show_bug.cgi?id=164167
<rdar://problem/29010148>
Reviewed by Mark Lam.
* inspector/InspectorController.cpp:
(WebCore::InspectorController::inspectedPageDestroyed):
Page is going away, discard values.
* inspector/WorkerInspectorController.h:
* inspector/WorkerInspectorController.cpp:
(WebCore::WorkerInspectorController::workerTerminating):
Worker is going away, discard values.
2016-10-31 Ryosuke Niwa <rniwa@webkit.org>
CSSStyleDeclaration should be annotated with CEReactions
https://bugs.webkit.org/show_bug.cgi?id=163968
Reviewed by Antti Koivisto.
Added CEReactions to CSSStyleDeclaration.idl.
Test: fast/custom-elements/reactions/CSSStyleDeclaration.html
* bindings/js/JSCSSStyleDeclarationCustom.cpp:
(WebCore::JSCSSStyleDeclaration::putDelegate):
* css/CSSStyleDeclaration.idl:
* css/PropertySetCSSStyleDeclaration.cpp:
(WebCore::StyleAttributeMutationScope::StyleAttributeMutationScope): Remember the old value when this is
an inline style declaration for a custom element. Also store m_oldValue and m_customElement instead of
a mutation record so that we don't create a superfluous mutation record for custom elements.
(WebCore::StyleAttributeMutationScope::~StyleAttributeMutationScope): Enqueue attributeChangedCallback
when m_customElement is not null.
* dom/CustomElementReactionQueue.cpp:
(WebCore::CustomElementReactionQueue::observesStyleAttribute):
* dom/CustomElementReactionQueue.h:
2016-10-31 Jer Noble <jer.noble@apple.com>
Unreviewed build fix for the build fix; AVStreamDataParser not defined on iOS.
* platform/spi/mac/AVFoundationSPI.h:
2016-10-31 Zalan Bujtas <zalan@apple.com>
LayoutTests/fast/frames/invalid-frameset.html is not clean by the end of FrameView::layout().
https://bugs.webkit.org/show_bug.cgi?id=164230
Reviewed by Simon Fraser.
When a <frameset> has invalid children, in addition to clear the needs layout flag on the children
we also need to do clear the descendants too.
Covered by LayoutTests/fast/frames/invalid-frameset.html.
* rendering/RenderFrameSet.cpp:
(WebCore::RenderFrameSet::positionFrames):
2016-10-31 Jer Noble <jer.noble@apple.com>
Unreviewed build fix after r208151; outputMIMECodecParameterForInputMIMECodecParameter not
defined pre-Sierra.
* platform/spi/mac/AVFoundationSPI.h:
2016-10-31 Zalan Bujtas <zalan@apple.com>
ASSERTION FAILED: !m_trailingWhitespaceWidth in WebCore::SimpleLineLayout::LineState::removeTrailingWhitespace
https://bugs.webkit.org/show_bug.cgi?id=164076
Reviewed by Antti Koivisto.
FontCascade's text measure methods return NaN for zero sized fonts. We could actually early return and not
measure text with zero font size at all.
Test: fast/text/simple-line-layout-with-zero-sized-font.html
* rendering/SimpleLineLayoutTextFragmentIterator.cpp:
(WebCore::SimpleLineLayout::TextFragmentIterator::textWidth):
(WebCore::SimpleLineLayout::TextFragmentIterator::runWidth):
2016-10-31 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Support -webkit-named-image
https://bugs.webkit.org/show_bug.cgi?id=164235
Reviewed by Dean Jackson.
* css/CSSValueKeywords.in:
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::consumeWebkitNamedImage):
(WebCore::CSSPropertyParserHelpers::consumeGeneratedImage):
(WebCore::CSSPropertyParserHelpers::isGeneratedImage):
2016-10-28 Brent Fulgham <bfulgham@apple.com>
Do a better job of protecting Frame objects in the context of JavaScript calls
https://bugs.webkit.org/show_bug.cgi?id=164163
<rdar://problem/28955249>
Reviewed by Darin Adler.
* editing/AlternativeTextController.cpp:
(WebCore::AlternativeTextController::respondToUnappliedSpellCorrection): Protected the Frame.
* editing/Editor.cpp:
(WebCore::Editor::setTextAsChildOfElement): Ditto.
* editing/EditorCommand.cpp:
(WebCore::executeSwapWithMark): Ditto.
* editing/TypingCommand.cpp:
(WebCore::TypingCommand::deleteKeyPressed): Ditto.
(WebCore::TypingCommand::forwardDeleteKeyPressed): Ditto.
* editing/mac/EditorMac.mm:
(WebCore::Editor::replaceNodeFromPasteboard): Ditto.
* page/ContextMenuController.cpp:
(WebCore::ContextMenuController::contextMenuItemSelected): Ditto.
* page/DOMSelection.cpp:
(WebCore::DOMSelection::collapse): Ditto.
(WebCore::DOMSelection::collapseToEnd): Ditto.
(WebCore::DOMSelection::collapseToStart): Ditto.
(WebCore::DOMSelection::setBaseAndExtent): Ditto.
(WebCore::DOMSelection::setPosition): Ditto.
(WebCore::DOMSelection::modify): Ditto.
(WebCore::DOMSelection::extend): Ditto.
(WebCore::DOMSelection::addRange): Ditto.
(WebCore::DOMSelection::deleteFromDocument): Ditto.
* page/DragController.cpp:
(WebCore::setSelectionToDragCaret): Ditto.
(WebCore::DragController::startDrag): Ditto.
* page/Frame.cpp:
(WebCore::Frame::checkOverflowScroll): Ditto.
* page/TextIndicator.cpp:
(WebCore::TextIndicator::createWithRange): Ditto.
2016-10-31 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Make sure to fail on :role(a,b) and :dir(a,b)
https://bugs.webkit.org/show_bug.cgi?id=164233
Reviewed by Dean Jackson.
* css/parser/CSSSelectorParser.cpp:
(WebCore::CSSSelectorParser::consumePseudo):
2016-10-31 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Allow unitless values on background-size in quirks mode
https://bugs.webkit.org/show_bug.cgi?id=164232
Reviewed by Dean Jackson.
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeBackgroundSize):
2016-10-31 Jer Noble <jer.noble@apple.com>
Unreviewed build fix after r208151; _setPreventsSleepDuringVideoPlayback: only defined in non-simulator SDKs.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer):
(WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldDisableSleep):
* platform/spi/mac/AVFoundationSPI.h:
2016-10-31 Nan Wang <n_wang@apple.com>
AX: iOS Voiceover does not announce previously selected value from input type="date" form field
https://bugs.webkit.org/show_bug.cgi?id=164176
Reviewed by Chris Fleizach.
Input type date is a popup button on iOS and its value was not exposed in stringValue() since
it's not considered a text control. Instead, the value was exposed in AXTitle. Fixed this by adding
the case in stringValue() and removing the AXTitle exposure.
Changes are covered in modified test.
* accessibility/AccessibilityObject.h:
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::stringValue):
* accessibility/ios/AccessibilityObjectIOS.mm:
(WebCore::AccessibilityObject::isInputTypePopupButton):
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper accessibilityLabel]):
2016-10-31 Simon Fraser <simon.fraser@apple.com>
Add requestIdleCallback to features.json.
* features.json:
2016-10-31 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Fully support prefixed background-size and box-shadows
https://bugs.webkit.org/show_bug.cgi?id=164228
Reviewed by Zalan Bujtas.
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseSingleValue):
2016-10-31 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Get rid of CSSCustomIdentValue::creates
https://bugs.webkit.org/show_bug.cgi?id=164225
Reviewed by Zalan Bujtas.
Get rid of all instances of CSSCustomIdent::create, since our style
resolution code isn't prepared to handle that value type yet.
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeAnimationName):
(WebCore::consumeTransitionProperty):
(WebCore::consumeAttr):
2016-10-31 Jer Noble <jer.noble@apple.com>
Opt-out of AVPlayer automatic sleep disabling
https://bugs.webkit.org/show_bug.cgi?id=163983
Reviewed by Eric Carlson.
In addition to the DisplaySleepDisabler, notify the MediaPlayerPrivateAVFoundationObjC object whether
it should disable display sleep. Provide all the necessary boilerplate to allow the media player private
to query the HTMLMediaPlayer so that the correct value can be set on AVPlayer upon creation.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::updateSleepDisabling):
* html/HTMLMediaElement.h:
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::setShouldDisableSleep):
(WebCore::MediaPlayer::shouldDisableSleep):
* platform/graphics/MediaPlayer.h:
(WebCore::MediaPlayerClient::mediaPlayerShouldDisableSleep):
* platform/graphics/MediaPlayerPrivate.h:
(WebCore::MediaPlayerPrivateInterface::setShouldDisableSleep):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer):
(WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldDisableSleep):
Drive-by fix: Re-organize the contents of AVFoundationSPI.h so that there's a single top-level
#if USE(APPLE_INTERNAL_SDK) statement, rather than that conditional being sprinkled about the
file.
* platform/spi/mac/AVFoundationSPI.h:
2016-10-31 Jer Noble <jer.noble@apple.com>
REGRESSION (r206300): LayoutTest media/media-source/media-source-duplicate-seeked.html timing out
https://bugs.webkit.org/show_bug.cgi?id=162496
Reviewed by Darin Adler.
The change to MockMediaSourcePrivate in r206300 revealed a true bug: seeks to the MediaSource's duration
will always fail. We should discard out of hand seeks which are greater than the duration, but allow seeks
directly to the duration.
* Modules/mediasource/MediaSource.cpp:
(WebCore::MediaSource::hasBufferedTime):
2016-10-31 Jer Noble <jer.noble@apple.com>
Allow multiple playing videos on a page with 'autoplay' and 'playsinline' attributes
https://bugs.webkit.org/show_bug.cgi?id=162366
<rdar://problem/28639600>
Reviewed by Eric Carlson.
Tests: media/video-concurrent-visible-playback.html
media/video-multiple-concurrent-playback.html
Separate out the concept of "video-only" from "video-with-audio" in PlatformMediaSession::MediaType,
and only set the ConcurrentPlaybackNotPermitted restriction for "video-with-audio". This allows multiple
silent video elements to play back simultaneously.
However, the bug in question also shows bad behavior when both concurrent playback and invisible playback
are not allowed. Namely, an invisible element will attempt to autoplay, interrupt visible elements, and
then fail to play due to it's non-visibility. Add an extra check to canTransitionFromAutoplayToPlay()
which asks the session if autoplay is allowed (which will return false if the element is not visible).
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::canTransitionFromAutoplayToPlay):
(WebCore::HTMLMediaElement::mediaType):
(WebCore::HTMLMediaElement::presentationType):
(WebCore::HTMLMediaElement::updateShouldAutoplay):
(WebCore::mediaElementIsAllowedToAutoplay): Deleted.
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::autoplayPermitted):
* html/MediaElementSession.h:
* platform/audio/PlatformMediaSession.h:
* platform/audio/ios/MediaSessionManagerIOS.mm:
(WebCore::MediaSessionManageriOS::resetRestrictions):
* testing/Internals.cpp:
(WebCore::Internals::setMediaSessionRestrictions):
2016-10-31 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Support unprefixed cross-fade
https://bugs.webkit.org/show_bug.cgi?id=164224
Reviewed by Zalan Bujtas.
* css/CSSValueKeywords.in:
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::consumeCrossFade):
(WebCore::CSSPropertyParserHelpers::consumeGeneratedImage):
2016-10-31 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Simplify background-position-x/y style mapping
https://bugs.webkit.org/show_bug.cgi?id=164223
Reviewed by Zalan Bujtas.
* css/CSSToStyleMap.cpp:
(WebCore::CSSToStyleMap::mapFillXPosition):
(WebCore::CSSToStyleMap::mapFillYPosition):
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertFontSynthesis):
2016-10-31 Darin Adler <darin@apple.com>
Move ChildNode and ParentNode from ExceptionCode to Exception, add support for ExceptionOr<T&>
https://bugs.webkit.org/show_bug.cgi?id=164214
Reviewed by Alex Christensen.
* Modules/fetch/FetchRequest.cpp:
(WebCore::FetchRequest::initializeOptions): Use FetchHeaders& instead of
Ref<FetchHeaders> for return value.
(WebCore::FetchRequest::initializeWith): Ditto.
* Modules/fetch/FetchRequest.h: Updated for above.
* Modules/mediasource/MediaSource.cpp:
(WebCore::MediaSource::addSourceBuffer): Use SourceBuffer& instead of
SourceBuffer* for return value.
* Modules/mediasource/MediaSource.h: Updated for above.
* bindings/js/JSDOMBinding.h: Added overloads of checkSecurityForNode so
it works with a function returning a reference.
* css/CSSPrimitiveValue.cpp:
(WebCore::CSSPrimitiveValue::getCounterValue): Use Counter& instead of
Counter* for return value.
(WebCore::CSSPrimitiveValue::getRectValue): Use Rect& instead of
Rect* for return value.
* css/CSSPrimitiveValue.h: Updated for above.
* dom/ChildNode.idl: Use non-legacy exceptions.
* dom/ContainerNode.cpp:
(WebCore::ContainerNode::querySelector): Use ExceptionOr.
(WebCore::ContainerNode::querySelectorAll): Ditto.
(WebCore::ContainerNode::append): Ditto.
(WebCore::ContainerNode::prepend): Ditto.
* dom/ContainerNode.h: Updated for above.
* dom/Document.cpp:
(WebCore::Document::selectorQueryForString): Use ExceptionOr.
* dom/Document.h: Updated for above.
* dom/Element.cpp:
(WebCore::Element::attachShadow): Return ShadowRoot& instead of
Ref<ShadowRoot> since the shadow root is owned by the element, not
the caller.
(WebCore::Element::matches): Updated for change to make the
selectorQueryForString function use ExceptionOr.
(WebCore::Element::closest): Ditto.
(WebCore::contextNodeForInsertion): Return ContainerNode& instead of
ContainerNode*.
(WebCore::contextElementForInsertion): Updated for above.
* dom/Element.h: Updated for above.
* dom/Element.idl: Changed return type for closest and for
insertAdjacentElement to be nullable since both can return null.
* dom/ExceptionOr.h: Added a specialization for ExceptionOr<T&>.
* dom/Node.cpp:
(WebCore::Node::convertNodesOrStringsIntoNode): Use ExceptionOr.
(WebCore::Node::before): Ditto.
(WebCore::Node::after): Ditto.
(WebCore::Node::replaceWith): Ditto.
* dom/Node.h: Updated for above changes.
* dom/ParentNode.idl: Use non-legacy exceptions.
* dom/SelectorQuery.cpp:
(WebCore::SelectorDataList::queryAll): Changed return type to Ref.
(WebCore::SelectorQueryCache::add): Use ExceptionOr.
* dom/SelectorQuery.h: Updated for above changes.
* html/HTMLFrameOwnerElement.cpp:
(WebCore::HTMLFrameOwnerElement::getSVGDocument): Return
Document& instead of Document*.
* html/HTMLFrameOwnerElement.h: Updated for above change.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::addTextTrack): Return TextTrack&
instead of Ref<TextTrack>.
* html/HTMLMediaElement.h: Updated for above.
* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::partOfSnapshotOverlay):
Updated for new exceptions.
* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::querySelector): Ditto.
(WebCore::InspectorDOMAgent::querySelectorAll): Ditto.
(WebCore::InspectorDOMAgent::performSearch): Ditto.
(WebCore::InspectorDOMAgent::highlightSelector): Ditto.
* inspector/InspectorNodeFinder.cpp:
(WebCore::InspectorNodeFinder::performSearch): Put a null check
here so callers don't have to do it. Pass references to the
individual functions since the pointer can't be null.
(WebCore::InspectorNodeFinder::searchUsingDOMTreeTraversal):
Updated to use reference and streamlined code a bit, using
containsIgnoringASCIICase instead of findIgnoringCase.
(WebCore::InspectorNodeFinder::matchesAttribute): Ditto.
(WebCore::InspectorNodeFinder::matchesElement): Ditto.
(WebCore::InspectorNodeFinder::searchUsingXPath): Ditto.
(WebCore::InspectorNodeFinder::searchUsingCSSSelectors): Ditto.
Also updated for new exceptions in querySelectorAll.
* inspector/InspectorNodeFinder.h: Updated for above.
* page/Crypto.cpp:
(WebCore::Crypto::webkitSubtle): Return WebKitSubtleCrypto&
insetad of WebKitSubtleCrypto*.
* page/Crypto.h: Updated for above.
* testing/Internals.h: Removed declarations for functions already
removed: ensureShadowRoot and createShadowRoot.
2016-10-31 Darin Adler <darin@apple.com>
Convert Document from ExceptionCode to Exception
https://bugs.webkit.org/show_bug.cgi?id=164212
Reviewed by Alex Christensen.
* Modules/websockets/WebSocketChannel.cpp:
(WebCore::WebSocketChannel::processBuffer): Removed IGNORE_EXCEPTION.
* dom/ContainerNode.cpp:
(WebCore::ContainerNode::takeAllChildrenFrom): Use releaseReturnValue
instead of ASSERT_NO_EXCEPTION.
(WebCore::ContainerNode::parserInsertBefore): Removed ASSERT_NO_EXCEPTION.
(WebCore::ContainerNode::parserAppendChild): Ditto.
* dom/DOMImplementation.cpp:
(WebCore::DOMImplementation::createDocumentType): Updated for new
exception handling.
(WebCore::DOMImplementation::createDocument): Ditto.
* dom/Document.cpp:
(WebCore::createHTMLElementWithNameValidation): Return ExceptionOr.
(WebCore::Document::createElementForBindings): Ditto.
(WebCore::Document::createCDATASection): Ditto.
(WebCore::Document::createProcessingInstruction): Ditto.
(WebCore::Document::importNode): Ditto.
(WebCore::Document::adoptNode): Ditto.
(WebCore::Document::createElementNS): Ditto.
(WebCore::Document::setXMLVersion): Ditto.
(WebCore::Document::setBodyOrFrameset): Ditto.
(WebCore::Document::processHttpEquiv): Ditto.
(WebCore::Document::createEvent): Ditto.
(WebCore::Document::cookie): Ditto.
(WebCore::Document::setCookie): Ditto.
(WebCore::Document::setDomain): Ditto.
(WebCore::Document::parseQualifiedName): Ditto. Also added an overload
that constructs a QualifiedName directly that most call sites can use.
(WebCore::Document::createAttribute): Return ExceptionOr.
(WebCore::Document::createAttributeNS): Ditto.
(WebCore::Document::createTouch): Removed unneeded ExceptionCode&.
* dom/Document.h: Updated for above.
* dom/Document.idl: Use non-legacy exceptions. Removed exception
entirely from createTouch.
* dom/Element.cpp:
(WebCore::Element::parseAttributeName): Updated to use the new
Document::parseQualifiedName.
* editing/EditorCommand.cpp:
(WebCore::executeFormatBlock): Ditto.
* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::setNodeName): Updated for the new
exception handling.
* inspector/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::getCookies): Ditto.
* page/ios/FrameIOS.mm:
(WebCore::Frame::initWithSimpleHTMLDocument): Use the
HTMLHtmlElement::create and HTMLBodyElement::create instead of using
createElementNS to make the simple document.
* svg/animation/SVGSMILElement.cpp:
(WebCore::SVGSMILElement::constructAttributeName): Renamed, made this
a member function, updated to use the new Document::parseQualifiedName,
and also moved the code to get the attribute in here.
(WebCore::SVGSMILElement::constructAttributeName): Added. Helper function
for the two places we update the attribute name from attributeNameAttr.
(WebCore::SVGSMILElement::insertedInto): Use updateAttributeName.
(WebCore::SVGSMILElement::svgAttributeChanged): Ditto.
* svg/animation/SVGSMILElement.h: Updated for the above.
* xml/parser/XMLDocumentParserLibxml2.cpp:
(WebCore::XMLDocumentParser::processingInstruction): Updated to understand
ExceptionOr rather than an out argument.
(WebCore::XMLDocumentParser::startDocument): Removed ASSERT_NO_EXCEPTION.
2016-10-31 Wenson Hsieh <wenson_hsieh@apple.com>
Holding down a key to choose an accented character should fire "insertReplacementText" input events
https://bugs.webkit.org/show_bug.cgi?id=164209
<rdar://problem/29019305>
Reviewed by Darin Adler.
For TypingCommands that correspond to "insertReplacementText" inputTypes, vend dataTransfers for resulting
beforeinput and input events if the edited area is not an input field or textarea. To do this, convert the plain
text representation of the content to be inserted to HTML text using a helper function,
MarkupAccumulator::appendCharactersReplacingEntities, that is used when creating markup for Text nodes.
Tests: fast/events/before-input-prevent-insert-replacement.html
fast/events/input-event-insert-replacement.html
* editing/TypingCommand.cpp:
(WebCore::TypingCommand::inputEventData):
(WebCore::TypingCommand::inputEventDataTransfer):
* editing/TypingCommand.h:
2016-10-30 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Miscellaneous bug fixes
https://bugs.webkit.org/show_bug.cgi?id=164211
Reviewed by Darin Adler.
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::consumeTransformOrigin):
Make sure to properly reject invalid transform-origin-z values.
* css/parser/CSSSelectorParser.cpp:
(WebCore::CSSSelectorParser::consumeAttribute):
Make attribute selector parsing strict about requiring a ] to end
the selector.
(WebCore::CSSSelectorParser::consumePseudo):
Force the nth-child "of" syntax to have whitespace after "of" but
before the selector. It is unclear if this should be a requirement
or not (spec is ambiguous), but for now we match the old parser.
(WebCore::CSSSelectorParser::consumeCombinator):
Fix a bug that caused the double child combinator to match even
when there was whitespace between the two > symbols.
2016-10-31 Youenn Fablet <youenn@apple.com>
RTCOfferAnswerOptions does not need to be refcounted
https://bugs.webkit.org/show_bug.cgi?id=164216
Reviewed by Darin Adler.
Covered by existing tests.
Making RTCOffer/Answer options dictionaries as per specification.
Removing code that handles RTCOffer/Answer options dictionary since this is done by the binding generator.
Updated users of the options accordingly.
* CMakeLists.txt:
* Modules/mediastream/MediaEndpointPeerConnection.cpp:
(WebCore::MediaEndpointPeerConnection::createOffer):
(WebCore::MediaEndpointPeerConnection::createOfferTask):
(WebCore::MediaEndpointPeerConnection::createAnswer):
(WebCore::MediaEndpointPeerConnection::createAnswerTask):
* Modules/mediastream/MediaEndpointPeerConnection.h:
* Modules/mediastream/PeerConnectionBackend.h:
* Modules/mediastream/RTCOfferAnswerOptions.cpp: Removed.
* Modules/mediastream/RTCOfferAnswerOptions.h:
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::queuedCreateOffer):
(WebCore::RTCPeerConnection::queuedCreateAnswer):
* Modules/mediastream/RTCPeerConnection.h:
* Modules/mediastream/RTCPeerConnection.idl:
* WebCore.xcodeproj/project.pbxproj:
2016-10-31 Youenn Fablet <youenn@apple.com>
fast/mediastream/RTCPeerConnection-* tests crashing under ASan
https://bugs.webkit.org/show_bug.cgi?id=164215
Reviewed by Philippe Normand.
Covered by ASAN bot tests.
* platform/mediastream/SDPProcessorScriptResource.cpp:
(WebCore::SDPProcessorScriptResource::scriptString):
2016-10-28 Philippe Normand <pnormand@igalia.com>
[OpenWebRTC] Initialize library one time only
https://bugs.webkit.org/show_bug.cgi?id=164118
Reviewed by Darin Adler.
* platform/mediastream/openwebrtc/OpenWebRTCUtilities.cpp:
(WebCore::initializeOpenWebRTC): Prevent multiple initialisations of the library.
2016-10-30 Brent Fulgham <bfulgham@apple.com>
Unreviewed fix: Correct ChangeLog after my bad merge.
* ChangeLog
2016-10-30 Darin Adler <darin@apple.com>
Move Element, NamedNodeMap, and DOMStringMap from ExceptionCode to Exception
https://bugs.webkit.org/show_bug.cgi?id=164206
Reviewed by Chris Dumez.
* bindings/js/JSDOMStringMapCustom.cpp:
(WebCore::JSDOMStringMap::getOwnPropertyNames): Use modern for loop, and
updates since the names function now returns a vector.
(WebCore::JSDOMStringMap::putDelegate): Use propagateException. Also return
true any time an exception is raised. Since true tells the caller to return
without doing any work, we always want to return that on an exception.
* dom/DatasetDOMStringMap.cpp:
(WebCore::DatasetDOMStringMap::names): Renamed from getNames and made this
return a Vector instead of populating a passed-in vector.
(WebCore::DatasetDOMStringMap::setItem): Use ExceptionOr.
* dom/DatasetDOMStringMap.h: Updated for above.
* dom/Document.cpp:
(WebCore::Document::adoptNode): Updated to use ExceptionOr for
removeAttributeNode. Changed to use remove rather than removeChild for
better clarity.
* dom/Element.cpp:
(WebCore::Element::setAttribute): Use ExceptionOr.
(WebCore::Element::createShadowRoot): Deleted. Unused.
(WebCore::Element::attachShadow): Use ExceptionOr.
(WebCore::Element::shadowRootForBindings): Tweaked a bit.
(WebCore::Element::userAgentShadowRoot): Removed unneeded if statemment.
(WebCore::Element::ensureUserAgentShadowRoot): Tweaked a bit.
(WebCore::Element::setAttributeNode): Use ExceptionOr.
(WebCore::Element::setAttributeNodeNS): Ditto.
(WebCore::Element::removeAttributeNode): Ditto.
(WebCore::Element::parseAttributeName): Ditto. Also changed return result
to be a QualifiedName instead of using an out argument.
(WebCore::Element::setAttributeNS): Ditto.
(WebCore::Element::mergeWithNextTextNode): Ditto.
(WebCore::Element::setOuterHTML): Ditto.
(WebCore::Element::setInnerHTML): Ditto.
(WebCore::Element::matches): Ditto.
(WebCore::Element::closest): Ditto.
(WebCore::Element::insertAdjacent): Ditto.
(WebCore::Element::insertAdjacentElement): Ditto.
(WebCore::contextNodeForInsertion): Ditto.
(WebCore::contextElementForInsertion): Added. Helper for the
insertAdjacentHTML function to eliminate a local variable.
(WebCore::Element::insertAdjacentHTML): Use ExceptionOr.
(WebCore::Element::insertAdjacentText): Ditto.
* dom/Element.h: Updated for above.
* dom/Element.idl: Use non-legacy exceptions.
* dom/NamedNodeMap.cpp:
(WebCore::NamedNodeMap::removeNamedItem): Use ExceptionOr.
(WebCore::NamedNodeMap::supportedPropertyNames): Updated to check
which strings should be removed without copying the strings.
(WebCore::NamedNodeMap::removeNamedItemNS): Use ExceptionOr.
(WebCore::NamedNodeMap::setNamedItem): Ditto. Removed overload for
legacy bindings; move that to the bindings themselves.
* dom/NamedNodeMap.h: Updated for above.
* dom/NamedNodeMap.idl: Use non-legacy exceptions.
* html/HTMLElement.cpp:
(WebCore::HTMLElement::setOuterText): Updated since mergeWithNextTextNode
now uses ExceptionOr.
* inspector/DOMEditor.cpp: Updated to use ExceptionOr.
* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::toErrorString): Added an overload for
Exception.
(WebCore::InspectorDOMAgent::setAttributesAsText): Updated to use ExceptionOr.
* inspector/InspectorDOMAgent.h: Updated for above.
* inspector/InspectorStyleSheet.cpp:
(WebCore::InspectorStyleSheetForInlineStyle::setStyleText): Updated to
use the correct version of setAttribute; there was never a risk that there
would be an exception, but now that's clearer.
* testing/Internals.cpp:
(WebCore::Internals::ensureShadowRoot): Deleted. Was unused.
(WebCore::Internals::createShadowRoot): Ditto.
* testing/Internals.idl: Updated for above.
* xml/parser/XMLDocumentParserLibxml2.cpp:
(WebCore::handleNamespaceAttributes): Use updated parseAttributeName,
which uses ExceptionOr and a return value instead of an out argument.
(WebCore::handleElementAttributes): Ditto.
2016-10-30 Sam Weinig <sam@webkit.org>
[WebIDL] Restructure IDLParser structs to better match modern WebIDL concepts
https://bugs.webkit.org/show_bug.cgi?id=164208
Reviewed by Darin Adler.
Restructure IDLParsers structs to match modern WebIDL conventions:
- Rename structs to have more WebCore like naming, consistently using
the prefix IDL.
- Remove domSignature. Sinking it's properties into the structs that
contained it.
- Add IDLArgument, replacing the use of domSignatures for arguments.
IDLArgument is the subset of domSignatures needed for arguments.
- Rename domFunction to IDLOperation (matching WebILD nomenclature),
replace signature with its own name, type (for returnType), specials,
and extended attributes properties.
- Give IDLAttribute it's own name, type and extended attributes properties.
- Add IDLDictionaryMember, replacing the use of domSignature as the
type of members in IDLDictionary. Give it name, type, isRequired,
default and extendedAttributes properties.
- Renamed Typedef to be IDLTypedef. Remove the extended attributes
property as those are not allowed in typedefs per-PebIDL.
Also fix some parsing issues:
- Stop parsing 'in' directives in function arguments.
- Stop parsing extended attributes in typedefs.
- Support applying typedefs to types deep in aggregate types
(e.g. (sequence<(LONG or STRING)> or DOMString)?).
* bindings/scripts/CodeGenerator.pm:
* bindings/scripts/IDLParser.pm:
* bindings/scripts/generate-bindings.pl:
Update for new struct types.
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
* bindings/scripts/test/TestTypedefs.idl:
Remove test which tested extended attributes in typedefs,
and add a test which tests typedefs used in deep type structures.
* page/make_settings.pl:
Don't generate the 'in' prefix for arguments in IDL files.
2016-10-30 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Fix nth-child serialization
https://bugs.webkit.org/show_bug.cgi?id=164210
Reviewed by Darin Adler.
Our nth-child serialization preserves what the author originally
typed. Even though this is not spec-compliant (the latest CSS Syntax
spec has a dumbed down serialization process that doesn't preserve what
the author originally typed), I think it's better behavior to preserve
this text.
* css/parser/CSSParserToken.cpp:
(WebCore::CSSParserToken::serialize):
Fix a bug in the serialization of number tokens that started with
a plus sign. Make sure the plus sign is preserved.
* css/parser/CSSSelectorParser.cpp:
(WebCore::CSSSelectorParser::consumePseudo):
Grab the range of tokens from after the ( and up to the ) or the "of"
and then serialize them. Strip whitepsace from the ends and set that
as the selector argument.
2016-10-30 Brent Fulgham <bfulgham@apple.com>
[Win][Direct2D] Correct bookkeeping for begin/end draw pairs
https://bugs.webkit.org/show_bug.cgi?id=163898
Reviewed by Darin Adler.
Simon pointed out that GraphicsContext objects are generally only created at
the time we intend to do drawing, so calling 'BeginDraw' as part of object
construction, and 'EndDraw' at time of destruction should be sufficient.
As usual, he was correct.
This patch gets rid of unneeded code and greatly simplifies the Direct2D
drawing path.
Tested by existing layout tests.
* platform/graphics/GraphicsContext.h:
* platform/graphics/win/GradientDirect2D.cpp:
(WebCore::Gradient::fill):Remove unneeded use
of 'RenderTargetScopedDrawing.h'.
* platform/graphics/win/GraphicsContextDirect2D.cpp:
(WebCore::GraphicsContext::releaseWindowsContext): Remove unneeded use
of RenderTargetScopedDrawing class.
(WebCore::GraphicsContextPlatformPrivate::GraphicsContextPlatformPrivate): Enter
the 'BeginDraw' state at object creation.
(WebCore::GraphicsContextPlatformPrivate::~GraphicsContextPlatformPrivate): End
draw state at object destruction.
(WebCore::GraphicsContextPlatformPrivate::clip): Remove unneeded call to 'beginDraw'.
(WebCore::GraphicsContextPlatformPrivate::beginDraw): Renamed from 'beginDrawIfNeeded'.
(WebCore::GraphicsContextPlatformPrivate::endDraw): Get rid of draw state flags.
(WebCore::GraphicsContext::beginDraw): Renamed from 'beginDrawIfNeeded'.
(WebCore::GraphicsContext::flush): Added.
(WebCore::GraphicsContext::drawWithoutShadow): Remove unneeded use of
RenderTargetScopedDrawing class.
(WebCore::GraphicsContext::drawWithShadow): Ditto.
(WebCore::GraphicsContext::platformFillRoundedRect): Ditto.
(WebCore::GraphicsContext::fillRectWithRoundedHole): Ditto.
(WebCore::GraphicsContext::didBeginDraw): Deleted.
(WebCore::GraphicsContextPlatformPrivate::beginDrawIfNeeded): Deleted.
(WebCore::GraphicsContext::beginDrawIfNeeded): Deleted.
* platform/graphics/win/GraphicsContextPlatformPrivateDirect2D.h:
(WebCore::GraphicsContextPlatformPrivate::didBeginDraw): Deleted.
* platform/graphics/win/ImageBufferDataDirect2D.cpp:
(WebCore::ImageBufferData::getData): Remove unneeded use of RenderTargetScopedDrawing class.
(WebCore::ImageBufferData::putData):
* platform/graphics/win/ImageBufferDirect2D.cpp:
(WebCore::ImageBuffer::flushContext): Call new GraphicsContext 'flush' command.
(WebCore::ImageBuffer::draw): Remove unneeded use of RenderTargetScopedDrawing class.
* platform/graphics/win/NativeImageDirect2D.cpp: Ditto.
* platform/graphics/win/RenderTargetScopedDrawing.h: Removed.
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::nativeImage): Remove unneeded use of RenderTargetScopedDrawing class.
2016-10-30 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Clean up the two types of descendant relations in CSSSelector
https://bugs.webkit.org/show_bug.cgi?id=164203
Reviewed by Zalan Bujtas.
This patch gets rid of the separate boolean for double child and allows it
to be a unique relation type. Rename Descendant to DescendantSpace and
name the new relation DescendantDoubleChild.
* css/CSSSelector.cpp:
(WebCore::CSSSelector::CSSSelector):
(WebCore::CSSSelector::selectorText):
* css/CSSSelector.h:
(WebCore::CSSSelector::hasDescendantRelation):
(WebCore::CSSSelector::hasDescendantOrChildRelation):
(WebCore::CSSSelector::CSSSelector):
(WebCore::CSSSelector::setDescendantUseDoubleChildSyntax): Deleted.
* css/RuleFeature.cpp:
(WebCore::RuleFeatureSet::recursivelyCollectFeaturesFromSelector):
* css/SelectorChecker.cpp:
(WebCore::SelectorChecker::matchRecursively):
(WebCore::SelectorChecker::determineLinkMatchType):
* css/SelectorFilter.cpp:
(WebCore::SelectorFilter::collectIdentifierHashes):
* css/parser/CSSParserValues.cpp:
(WebCore::CSSParserSelector::appendTagHistory):
* css/parser/CSSParserValues.h:
(WebCore::CSSParserSelector::setDescendantUseDoubleChildSyntax): Deleted.
* css/parser/CSSSelectorParser.cpp:
(WebCore::isDescendantCombinator):
(WebCore::CSSSelectorParser::consumeComplexSelector):
(WebCore::CSSSelectorParser::consumeCombinator):
* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::fragmentRelationForSelectorRelation):
2016-10-30 Frederic Wang <fwang@igalia.com>
Unreviewed gardening
Fix build error on WinCairo.
* platform/graphics/opentype/OpenTypeMathData.cpp:
2016-10-30 Frederic Wang <fwang@igalia.com>
Use HarfBuzz ot-math API to parse the OpenType MATH table
https://bugs.webkit.org/show_bug.cgi?id=162671
Reviewed by Michael Catanzaro.
No new tests, already covered by existing tests.
* platform/graphics/opentype/OpenTypeMathData.cpp: Add alternative implementation relying on
HarfBuzz's new OpenType MATH API.
* platform/graphics/opentype/OpenTypeMathData.h: Ditto.
(WebCore::OpenTypeMathData::hasMathData):
(WebCore::OpenTypeMathData::HbFontDeleter::operator()):
2016-10-29 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Support unprefixed image-sets
https://bugs.webkit.org/show_bug.cgi?id=164198
Reviewed by Dean Jackson.
* css/CSSValueKeywords.in:
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::consumeImage):
2016-10-30 Yusuke Suzuki <utatane.tea@gmail.com>
[DOM] Introduce WebCore::jsDynamicDowncast
https://bugs.webkit.org/show_bug.cgi?id=164137
Reviewed by Darin Adler.
In WebCore, we have several extended JSTypes, like JSElementType.
For these types, WebCore offers the faster casting function compared
to JSC::jsDynamicCast. For example, for JSElementType, we have
jsElementCast.
The problem is that we may fall into the slow code if we choose
JSC::jsDynamicCast by accident. Selecting the appropriate function
requires special care in the IDL code generator when we would like
to use faster casting functions.
This patch implements a new casting function, WebCore::jsDynamicDowncast.
It is a thin wrapper to the JSC::jsDynamicCast. But it selects the
faster casting functions correctly by template specialization.
We do not choose the way specializing JSC::jsDynamicCast directly.
If we forget to include the header that specializes JSC::jsDyanmicCast,
it does not cause any compile errors, but it causes performance regression.
This bug is hard to figure out. To avoid this problem, we add a new function.
Outside JSC, only Tools' DumpRenderTree uses JSC::jsDynamicCast.
This code has FIXME that we should use JSC APIs instead of directly calling
JSC thingy. So this should be solved in the layer of JSC APIs and changing
this jsDynamicCast to WebCore's jsDynamicDowncast and exposing WebCore's thingy
are not good change. So we leave the code as is.
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSApplePaySessionCustom.cpp:
(WebCore::JSApplePaySession::completeShippingMethodSelection):
(WebCore::JSApplePaySession::completeShippingContactSelection):
(WebCore::JSApplePaySession::completePaymentMethodSelection):
* bindings/js/JSDOMBinding.cpp:
(WebCore::reportException):
* bindings/js/JSDOMBinding.h:
(WebCore::castThisValue):
(WebCore::toArrayBufferView):
* bindings/js/JSDOMIterator.h:
(WebCore::IteratorTraits>::next):
* bindings/js/JSDOMWindowShell.cpp:
(WebCore::JSDOMWindowShell::toWrapped):
* bindings/js/JSDictionary.cpp:
(WebCore::JSDictionary::convertValue):
* bindings/js/JSDocumentCustom.h:
(WebCore::jsDocumentCast):
* bindings/js/JSDynamicDowncast.h: Added.
(WebCore::JSDynamicCastTrait::cast):
(WebCore::JSDynamicCastTrait<JSNode>::cast):
(WebCore::JSDynamicCastTrait<JSElement>::cast):
(WebCore::JSDynamicCastTrait<JSDocument>::cast):
(WebCore::JSDynamicCastTrait<JSEvent>::cast):
(WebCore::jsDynamicDowncast):
* bindings/js/JSElementCustom.h:
(WebCore::jsElementCast):
* bindings/js/JSEventCustom.h:
(WebCore::jsEventCast):
* bindings/js/JSEventListener.cpp:
(WebCore::setDocumentEventHandlerAttribute):
* bindings/js/JSEventTargetCustom.cpp:
(WebCore::jsEventTargetCast):
* bindings/js/JSMediaStreamTrackCustom.cpp:
(WebCore::JSMediaStreamTrack::getSettings):
(WebCore::JSMediaStreamTrack::getCapabilities):
* bindings/js/JSNodeCustom.h:
(WebCore::jsNodeCast):
* bindings/js/JSPluginElementFunctions.cpp:
(WebCore::pluginElementPropertyGetter):
* bindings/js/JSReadableStreamPrivateConstructors.cpp:
(WebCore::constructJSReadableStreamDefaultReader):
* bindings/js/JSReadableStreamSourceCustom.cpp:
(WebCore::startReadableStream):
(WebCore::JSReadableStreamSource::start):
(WebCore::pullReadableStream):
* bindings/js/JSWorkerGlobalScopeBase.cpp:
(WebCore::toJSDedicatedWorkerGlobalScope):
* bindings/js/ScriptModuleLoader.cpp:
(WebCore::ScriptModuleLoader::evaluate):
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneSerializer::serialize):
* bindings/js/StructuredClone.cpp:
(WebCore::structuredCloneArrayBufferView):
* bindings/scripts/CodeGeneratorJS.pm:
(GetCastingHelperForThisObject):
(GenerateImplementation):
* bindings/scripts/test/JS/JSInterfaceName.cpp:
(WebCore::jsInterfaceNameConstructor):
(WebCore::setJSInterfaceNameConstructor):
(WebCore::JSInterfaceName::toWrapped):
* bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
(WebCore::BindingCaller<JSTestActiveDOMObject>::castForAttribute):
(WebCore::BindingCaller<JSTestActiveDOMObject>::castForOperation):
(WebCore::jsTestActiveDOMObjectConstructor):
(WebCore::setJSTestActiveDOMObjectConstructor):
(WebCore::JSTestActiveDOMObject::toWrapped):
* bindings/scripts/test/JS/JSTestCEReactions.cpp:
(WebCore::BindingCaller<JSTestCEReactions>::castForAttribute):
(WebCore::BindingCaller<JSTestCEReactions>::castForOperation):
(WebCore::jsTestCEReactionsConstructor):
(WebCore::setJSTestCEReactionsConstructor):
(WebCore::JSTestCEReactions::toWrapped):
* bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
(WebCore::BindingCaller<JSTestCEReactionsStringifier>::castForAttribute):
(WebCore::BindingCaller<JSTestCEReactionsStringifier>::castForOperation):
(WebCore::jsTestCEReactionsStringifierConstructor):
(WebCore::setJSTestCEReactionsStringifierConstructor):
(WebCore::JSTestCEReactionsStringifier::toWrapped):
* bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
(WebCore::jsTestClassWithJSBuiltinConstructorConstructor):
(WebCore::setJSTestClassWithJSBuiltinConstructorConstructor):
(WebCore::JSTestClassWithJSBuiltinConstructor::toWrapped):
* bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
(WebCore::jsTestCustomConstructorWithNoInterfaceObjectConstructor):
(WebCore::setJSTestCustomConstructorWithNoInterfaceObjectConstructor):
(WebCore::JSTestCustomConstructorWithNoInterfaceObject::toWrapped):
* bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
(WebCore::BindingCaller<JSTestCustomNamedGetter>::castForOperation):
(WebCore::jsTestCustomNamedGetterConstructor):
(WebCore::setJSTestCustomNamedGetterConstructor):
(WebCore::JSTestCustomNamedGetter::toWrapped):
* bindings/scripts/test/JS/JSTestDOMJIT.cpp:
(WebCore::BindingCaller<JSTestDOMJIT>::castForAttribute):
(WebCore::jsTestDOMJITConstructor):
(WebCore::setJSTestDOMJITConstructor):
* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
(WebCore::BindingCaller<JSTestEventConstructor>::castForAttribute):
(WebCore::jsTestEventConstructorConstructor):
(WebCore::setJSTestEventConstructorConstructor):
* bindings/scripts/test/JS/JSTestEventTarget.cpp:
(WebCore::BindingCaller<JSTestEventTarget>::castForOperation):
(WebCore::jsTestEventTargetConstructor):
(WebCore::setJSTestEventTargetConstructor):
(WebCore::JSTestEventTarget::toWrapped):
* bindings/scripts/test/JS/JSTestException.cpp:
(WebCore::BindingCaller<JSTestException>::castForAttribute):
(WebCore::jsTestExceptionConstructor):
(WebCore::setJSTestExceptionConstructor):
(WebCore::JSTestException::toWrapped):
* bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
(WebCore::jsTestGenerateIsReachableConstructor):
(WebCore::setJSTestGenerateIsReachableConstructor):
(WebCore::JSTestGenerateIsReachable::toWrapped):
* bindings/scripts/test/JS/JSTestGlobalObject.cpp:
(WebCore::BindingCaller<JSTestGlobalObject>::castForAttribute):
(WebCore::BindingCaller<JSTestGlobalObject>::castForOperation):
(WebCore::jsTestGlobalObjectConstructor):
(WebCore::setJSTestGlobalObjectConstructor):
(WebCore::JSTestGlobalObject::toWrapped):
* bindings/scripts/test/JS/JSTestInterface.cpp:
(WebCore::BindingCaller<JSTestInterface>::castForAttribute):
(WebCore::BindingCaller<JSTestInterface>::castForOperation):
(WebCore::jsTestInterfaceConstructor):
(WebCore::setJSTestInterfaceConstructor):
(WebCore::JSTestInterface::toWrapped):
* bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
(WebCore::BindingCaller<JSTestInterfaceLeadingUnderscore>::castForAttribute):
(WebCore::jsTestInterfaceLeadingUnderscoreConstructor):
(WebCore::setJSTestInterfaceLeadingUnderscoreConstructor):
(WebCore::JSTestInterfaceLeadingUnderscore::toWrapped):
* bindings/scripts/test/JS/JSTestIterable.cpp:
(WebCore::BindingCaller<JSTestIterable>::castForOperation):
(WebCore::jsTestIterableConstructor):
(WebCore::setJSTestIterableConstructor):
(WebCore::JSTestIterable::toWrapped):
* bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
(WebCore::BindingCaller<JSTestJSBuiltinConstructor>::castForAttribute):
(WebCore::BindingCaller<JSTestJSBuiltinConstructor>::castForOperation):
(WebCore::jsTestJSBuiltinConstructorConstructor):
(WebCore::setJSTestJSBuiltinConstructorConstructor):
* bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
(WebCore::BindingCaller<JSTestMediaQueryListListener>::castForOperation):
(WebCore::jsTestMediaQueryListListenerConstructor):
(WebCore::setJSTestMediaQueryListListenerConstructor):
(WebCore::JSTestMediaQueryListListener::toWrapped):
* bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
(WebCore::jsTestNamedConstructorConstructor):
(WebCore::setJSTestNamedConstructorConstructor):
(WebCore::JSTestNamedConstructor::toWrapped):
* bindings/scripts/test/JS/JSTestNode.cpp:
(WebCore::BindingCaller<JSTestNode>::castForAttribute):
(WebCore::BindingCaller<JSTestNode>::castForOperation):
(WebCore::jsTestNodeConstructor):
(WebCore::setJSTestNodeConstructor):
* bindings/scripts/test/JS/JSTestNondeterministic.cpp:
(WebCore::BindingCaller<JSTestNondeterministic>::castForAttribute):
(WebCore::BindingCaller<JSTestNondeterministic>::castForOperation):
(WebCore::jsTestNondeterministicConstructor):
(WebCore::setJSTestNondeterministicConstructor):
(WebCore::JSTestNondeterministic::toWrapped):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::BindingCaller<JSTestObj>::castForAttribute):
(WebCore::BindingCaller<JSTestObj>::castForOperation):
(WebCore::jsTestObjConstructor):
(WebCore::setJSTestObjConstructor):
(WebCore::JSTestObj::toWrapped):
* bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
(WebCore::jsTestOverloadedConstructorsConstructor):
(WebCore::setJSTestOverloadedConstructorsConstructor):
(WebCore::JSTestOverloadedConstructors::toWrapped):
* bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
(WebCore::jsTestOverloadedConstructorsWithSequenceConstructor):
(WebCore::setJSTestOverloadedConstructorsWithSequenceConstructor):
(WebCore::JSTestOverloadedConstructorsWithSequence::toWrapped):
* bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
(WebCore::BindingCaller<JSTestOverrideBuiltins>::castForOperation):
(WebCore::jsTestOverrideBuiltinsConstructor):
(WebCore::setJSTestOverrideBuiltinsConstructor):
(WebCore::JSTestOverrideBuiltins::toWrapped):
* bindings/scripts/test/JS/JSTestSerialization.cpp:
(WebCore::BindingCaller<JSTestSerialization>::castForAttribute):
(WebCore::BindingCaller<JSTestSerialization>::castForOperation):
(WebCore::jsTestSerializationConstructor):
(WebCore::setJSTestSerializationConstructor):
(WebCore::JSTestSerialization::toWrapped):
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
(WebCore::BindingCaller<JSTestSerializedScriptValueInterface>::castForAttribute):
(WebCore::jsTestSerializedScriptValueInterfaceConstructor):
(WebCore::setJSTestSerializedScriptValueInterfaceConstructor):
(WebCore::JSTestSerializedScriptValueInterface::toWrapped):
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
(WebCore::BindingCaller<JSTestTypedefs>::castForAttribute):
(WebCore::BindingCaller<JSTestTypedefs>::castForOperation):
(WebCore::jsTestTypedefsConstructor):
(WebCore::setJSTestTypedefsConstructor):
(WebCore::JSTestTypedefs::toWrapped):
* bridge/objc/WebScriptObject.mm:
(-[WebScriptObject setValue:forKey:]):
* bridge/runtime_array.cpp:
(JSC::RuntimeArray::lengthGetter):
* bridge/runtime_method.cpp:
(JSC::RuntimeMethod::lengthGetter):
* html/HTMLMediaElement.cpp:
(WebCore::controllerJSValue):
(WebCore::HTMLMediaElement::updateCaptionContainer):
(WebCore::HTMLMediaElement::didAddUserAgentShadowRoot):
* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::buildObjectForEventListener):
2016-10-29 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Add font-variant-* keyword property support
https://bugs.webkit.org/show_bug.cgi?id=164195
Reviewed by Zalan Bujtas.
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
2016-10-29 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Fix text-emphasis-position parsing
https://bugs.webkit.org/show_bug.cgi?id=164197
Reviewed by Zalan Bujtas.
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
(WebCore::CSSParserFastPaths::isKeywordPropertyID):
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeTextEmphasisPosition):
(WebCore::CSSPropertyParser::parseSingleValue):
2016-10-29 Darin Adler <darin@apple.com>
Convert more of DOM from ExceptionCode to Exception
https://bugs.webkit.org/show_bug.cgi?id=164173
Reviewed by Ryosuke Niwa.
* Modules/mediastream/MediaDevices.cpp:
(WebCore::MediaDevices::getUserMedia): Use ExceptionOr.
(WebCore::MediaDevices::enumerateDevices): Ditto.
* Modules/mediastream/MediaDevices.h: Updated for above.
* Modules/mediastream/MediaDevices.idl: Use non-legacy exceptions.
* Modules/mediastream/MediaEndpointSessionDescription.cpp:
Added now-needed include of ExceptionCode.h.
* Modules/mediastream/RTCConfiguration.cpp:
(WebCore::parseIceServer): Use ExceptionOr.
(WebCore::RTCConfiguration::create): Ditto.
(WebCore::RTCConfiguration::initialize): Ditto.
* Modules/mediastream/RTCConfiguration.h: Updated for above.
* Modules/mediastream/RTCConfiguration.idl: Use non-legacy exceptions.
* Modules/mediastream/RTCDTMFSender.cpp:
(WebCore::RTCDTMFSender::create): Use ExceptionOr.
(WebCore::RTCDTMFSender::insertDTMF): Ditto.
* Modules/mediastream/RTCDTMFSender.h: Updated for above.
* Modules/mediastream/RTCDTMFSender.idl: Use non-legacy exceptions.
* Modules/mediastream/RTCDataChannel.cpp:
(WebCore::RTCDataChannel::create): Use ExceptionOr.
(WebCore::RTCDataChannel::setBinaryType): Ditto.
(WebCore::RTCDataChannel::send): Ditto.
(WebCore::RTCDataChannel::didReceiveRawData): Ditto.
* Modules/mediastream/RTCDataChannel.h: Updated for above.
Also changed return values to use const AtomicString& and
unsigned instead of unsigned long. Also made more private.
Also changed BinaryType into an enum class.
* Modules/mediastream/RTCDataChannel.idl: Use non-legacy exceptions.
* Modules/mediastream/RTCIceCandidate.cpp:
(WebCore::RTCIceCandidate::create): Use ExceptionOr.
* Modules/mediastream/RTCIceCandidate.h: Updated for above.
* Modules/mediastream/RTCIceCandidate.idl: Use non-legacy exception.
* Modules/mediastream/RTCOfferAnswerOptions.cpp:
(WebCore::RTCOfferOptions::create): Use ExceptionOr.
(WebCore::RTCAnswerOptions::create): Ditto.
* Modules/mediastream/RTCOfferAnswerOptions.h: Updated for above.
Also removed all virtual functions since nothing here is polymorphic
and initalized data members in the header.
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::initializeWith): Use ExceptionOr.
(WebCore::RTCPeerConnection::addTrack): Ditto.
(WebCore::RTCPeerConnection::removeTrack): Ditto.
(WebCore::RTCPeerConnection::addTransceiver): Ditto.
(WebCore::RTCPeerConnection::completeAddTransceiver): Ditto.
(WebCore::RTCPeerConnection::queuedCreateOffer): Ditto.
(WebCore::RTCPeerConnection::queuedCreateAnswer): Ditto.
(WebCore::RTCPeerConnection::setConfiguration): Ditto.
(WebCore::RTCPeerConnection::createDataChannel): Ditto.
* Modules/mediastream/RTCPeerConnection.h: Updated for above.
* Modules/mediastream/RTCPeerConnection.idl: Use non-legacy exceptions.
* Modules/mediastream/RTCRtpSender.cpp:
(WebCore::RTCRtpSender::replaceTrack): Use ExceptionOr.
* Modules/mediastream/RTCRtpSender.h: Updated for above.
* Modules/mediastream/RTCRtpSender.idl: Use non-legacy exception.
* Modules/mediastream/RTCSessionDescription.cpp:
(WebCore::RTCSessionDescription::create): Use ExceptoinOr.
* Modules/mediastream/RTCSessionDescription.h: Updated for above.
(WebCore::RTCSessionDescription::~RTCSessionDescription):
* Modules/mediastream/RTCSessionDescription.idl: Use non-legacy exceptions.
* Modules/navigatorcontentutils/NavigatorContentUtils.cpp:
(WebCore::verifyCustomHandlerURL): Just return a boolean, no exception.
(WebCore::verifyProtocolHandlerScheme): Ditto.
(WebCore::NavigatorContentUtils::registerProtocolHandler): Use ExceptionOr.
(WebCore::NavigatorContentUtils::isProtocolHandlerRegistered): Ditto.
(WebCore::NavigatorContentUtils::unregisterProtocolHandler): Ditto.
* Modules/navigatorcontentutils/NavigatorContentUtils.h: Updated for above.
* Modules/navigatorcontentutils/NavigatorContentUtils.idl: Use non-legacy exceptions.
* bindings/js/JSMediaDevicesCustom.cpp:
(WebCore::JSMediaDevicesGetUserMediaPromiseFunction): Use propagateException.
* bindings/scripts/CodeGeneratorJS.pm:
(NeedsExplicitPropagateExceptionCall): Added. Helper function to decide whether
we need to call propagateException explicitly, if return value processing is not
going to propagate the exception for us.
(GenerateParametersCheck): Moved the code from GenerateReturnParameters inline
because it's almost as short as the function call. Use the newly created
NeedsExplicitPropagateExceptionCall function, which properly handles the case
where the return value is a promise.
(GenerateReturnParameters): Deleted.
* dom/CharacterData.cpp:
(WebCore::CharacterData::substringData): Use ExceptionOr.
(WebCore::CharacterData::insertData): Ditto.
(WebCore::CharacterData::deleteData): Ditto.
(WebCore::CharacterData::replaceData): Ditto.
* dom/CharacterData.h: Updated for above.
* dom/CharacterData.idl: Use non-legacy exceptions.
* dom/DataTransferItemList.h: Tried to use ExceptionOr, but this seems
like dead code that doesn't compile.
* dom/DataTransferItemList.idl: Use non-legacy exceptions.
* dom/MessagePort.idl: Use non-legacy exceptions, except this has
already been converted and was a custom binding.
* dom/MutationObserver.cpp:
(WebCore::MutationObserver::observe): Use ExceptionOr.
* dom/MutationObserver.h: Updated for above.
* dom/MutationObserver.idl: Use non-legacy exception.
* dom/Range.cpp:
(WebCore::deleteCharacterData): Updated use of calls that now use
ExceptionOr.
(WebCore::Range::processContentsBetweenOffsets): Ditto.
(WebCore::Range::insertNode): Ditto.
* dom/ShadowRoot.cpp:
(WebCore::ShadowRoot::setInnerHTML): Use ExceptionOr.
* dom/ShadowRoot.h: Updated for above.
* dom/ShadowRoot.idl: Use non-legacy exception.
* dom/Text.cpp:
(WebCore::Text::splitText): Use ExceptionOr.
(WebCore::Text::replaceWholeText): Removed unused ExceptionCode&.
* dom/Text.h: Updated for above.
* dom/Text.idl: Use non-legacy exception.
* editing/ApplyBlockElementCommand.cpp:
(WebCore::isNewLineAtPosition): Rewrote to use data rather than
substringData; more efficient.
* editing/DeleteFromTextNodeCommand.cpp:
(WebCore::DeleteFromTextNodeCommand::doApply): Updated to work with
functions that return ExceptionOr.
(WebCore::DeleteFromTextNodeCommand::doUnapply): Removed IGNORE_EXCEPTION.
* editing/InsertIntoTextNodeCommand.cpp:
(WebCore::InsertIntoTextNodeCommand::InsertIntoTextNodeCommand):
Use WTFMove to avoid a little bit of reference count churn.
(WebCore::InsertIntoTextNodeCommand::doApply): Removed IGNORE_EXCEPTION.
(WebCore::InsertIntoTextNodeCommand::doReapply): Removed ExceptionCode.
(WebCore::InsertIntoTextNodeCommand::doUnapply): Removed IGNORE_EXCEPTION.
* editing/SplitTextNodeCommand.cpp:
(WebCore::SplitTextNodeCommand::doApply): Updated to work with functions
that return ExceptionCode.
(WebCore::SplitTextNodeCommand::doUnapply): Removed ASSERT_NO_EXCEPTION.
(WebCore::SplitTextNodeCommand::insertText1AndTrimText2): Updated to work
with functions that return ExceptionCode.
* html/HTMLTextFormControlElement.cpp:
Added now-needed include of ExceptionCode.h.
* inspector/DOMEditor.cpp: Removed ExceptionCode out argument from calls
to replaceWholeText, which never throws an exception.
2016-10-29 Dean Jackson <dino@apple.com>
Parse color() function
https://bugs.webkit.org/show_bug.cgi?id=164146
<rdar://problems/29007218>
Reviewed by Darin Adler.
Support the new CSS color() function:
https://drafts.csswg.org/css-color/#color-function
There are separate code paths for the old and new CSS parser.
Tests: css3/color/color-function-computed-style.html
css3/color/color-function-parsing.html
* css/CSSComputedStyleDeclaration.cpp: Use Color directly, not via rgb().
(WebCore::ComputedStyleExtractor::currentColorOrValidColor):
(WebCore::ComputedStyleExtractor::valueForShadow):
(WebCore::ComputedStyleExtractor::propertyValue):
* css/CSSValueKeywords.in: Note that there is a color function, but the
keyword is already defined. Also add keywords for the color spaces.
* css/SVGCSSValueKeywords.in: sRGB is used outside of SVG now.
* css/parser/CSSParser.cpp: Old CSS parser code to handle color().
(WebCore::isPercent): Helper to tell if a ValueWithCalculation is a percentage or not.
(WebCore::CSSParser::parseColorInt): Renamed.
(WebCore::CSSParser::parseColorDouble): Helper to get a Number/Percentage into a double
(WebCore::CSSParser::parseRGBParameters):
(WebCore::CSSParser::parseColorFunctionParameters):
(WebCore::CSSParser::parseHSLParameters):
(WebCore::CSSParser::parseColorFromValue):
(WebCore::CSSParser::colorIntFromValue): Deleted.
* css/parser/CSSParser.h:
* css/parser/CSSPropertyParserHelpers.cpp: New CSS parser code to handle color().
(WebCore::CSSPropertyParserHelpers::parseColorFunctionParameters):
(WebCore::CSSPropertyParserHelpers::parseColorFunction):
* platform/graphics/Color.h:
(WebCore::Color::isValid): An extended color is valid.
(WebCore::Color::rgb): Move the code to a standalone inline
so that I could add a longer comment.
* platform/graphics/ExtendedColor.cpp:
(WebCore::ExtendedColor::cssText): Alpha output is only needed if != 1.
* platform/graphics/cg/ColorCG.cpp: Handle ExtendedColor -> CGColor.
(WebCore::leakCGColor):
(WebCore::cachedCGColor):
2016-10-29 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Disable -webkit-text-size-adjust when the context says to.
https://bugs.webkit.org/show_bug.cgi?id=164191
Reviewed by Dean Jackson.
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseSingleValue):
2016-10-29 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Match old parser's image-rendering values
https://bugs.webkit.org/show_bug.cgi?id=164190
Reviewed by Dean Jackson.
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
2016-10-29 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Support -webkit-text value for background-clip and -webkit-background-clip
https://bugs.webkit.org/show_bug.cgi?id=164189
Reviewed by Dean Jackson.
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeBackgroundBox):
(WebCore::consumePrefixedBackgroundBox):
2016-10-29 Joseph Pecoraro <pecoraro@apple.com>
Remove some unnecessary includes
https://bugs.webkit.org/show_bug.cgi?id=164174
Reviewed by Darin Adler.
2016-10-29 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Support -webkit-aspect-ratio
https://bugs.webkit.org/show_bug.cgi?id=164187
Reviewed by Simon Fraser.
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeWebkitAspectRatio):
(WebCore::CSSPropertyParser::parseSingleValue):
2016-10-29 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Support the caps lock indicator appearance
https://bugs.webkit.org/show_bug.cgi?id=164186
Reviewed by Simon Fraser.
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
2016-10-29 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Support the alt property
https://bugs.webkit.org/show_bug.cgi?id=164184
Reviewed by Simon Fraser.
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeAlt):
(WebCore::CSSPropertyParser::parseSingleValue):
2016-10-29 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Add support for -webkit-hyphenate-limit-* properties
https://bugs.webkit.org/show_bug.cgi?id=164183
Reviewed by Simon Fraser.
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeHyphenateLimit):
(WebCore::CSSPropertyParser::parseSingleValue):
2016-10-29 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Fix transform-origin and perspective-origin to parse as shorthands
https://bugs.webkit.org/show_bug.cgi?id=164178
Reviewed by Zalan Bujtas.
* css/CSSPropertyNames.in:
Patch the transform-origin-x/y and perspective-origin-x/y properties
to use new converters that can handle keywords.
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertPositionComponentX):
(WebCore::StyleBuilderConverter::convertPositionComponentY):
Add the new converters. They just call convertPositionComponent method
that we already use for object-position and background-position.
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::consumeTransformOrigin):
(WebCore::CSSPropertyParser::consumePerspectiveOrigin):
Changed to treat the properties as shorthands and add the longhand
properties once parsed.
(WebCore::CSSPropertyParser::parseSingleValue):
(WebCore::CSSPropertyParser::parseShorthand):
* css/parser/CSSPropertyParser.h:
Move the parsing into the shorthand method, since we're still treating
these properties as shorthands.
2016-10-29 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Support -webkit-background-composite
https://bugs.webkit.org/show_bug.cgi?id=164179
Reviewed by Zalan Bujtas.
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeBackgroundComponent):
(WebCore::CSSPropertyParser::parseSingleValue):
2016-10-29 Youenn Fablet <youenn@apple.com>
REGRESSION (r207754): LayoutTest http/tests/security/svg-image-with-css-cross-domain.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=163922
Reviewed by Alex Christensen.
Test: http/tests/security/cached-svg-image-with-css-cross-domain.html
Raw data was not copied in cloned CachedCSSStyleSheet while it is used by some of its clients.
Updated CachedCSSStyleSheet and CachedImage cloning to copy its raw data.
* loader/cache/CachedCSSStyleSheet.cpp:
(WebCore::CachedCSSStyleSheet::setBodyDataFrom):
* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::setBodyDataFrom):
* loader/cache/CachedResource.h:
(WebCore::CachedResource::mayTryReplaceEncodedData):
2016-10-29 Youenn Fablet <youenn@apple.com>
REGRESSION (Safari 10 / r189445): WKWebView and WebView no longer allow async XMLHttpRequest timeout to exceed 60 seconds
https://bugs.webkit.org/show_bug.cgi?id=163814
<rdar://problem/28917420>
Reviewed by Darin Adler.
Tests: http/tests/xmlhttprequest/resetting-timeout-to-zero.html
http/tests/xmlhttprequest/timeout-greater-than-default-network-timeout.html
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::setTimeout): If the XHR timeout is active, resetting the timeout to zero should lead to using the default network timeout.
Since it is difficult to update the timeout once the request is sent, we mimic the default network timeout with a 60 seconds XHR timeout.
(WebCore::XMLHttpRequest::createRequest): Setting network timeout to infinity if the XHR timeout is active.
2016-10-29 Youenn Fablet <youenn@apple.com>
MediaEndpoint::generateDtlsInfo is not needed
https://bugs.webkit.org/show_bug.cgi?id=164130
Reviewed by Eric Carlson.
No change of behavior.
Removing MediaEndpoint::generateDtlsInfo as it can be called directly from createMediaEndpointOwr.
* Modules/mediastream/MediaEndpointPeerConnection.cpp:
(WebCore::MediaEndpointPeerConnection::MediaEndpointPeerConnection):
* platform/mediastream/MediaEndpoint.cpp:
* platform/mediastream/MediaEndpoint.h:
* platform/mediastream/openwebrtc/MediaEndpointOwr.cpp:
(WebCore::createMediaEndpointOwr):
* platform/mediastream/openwebrtc/MediaEndpointOwr.h:
* platform/mock/MockMediaEndpoint.cpp:
(WebCore::MockMediaEndpoint::MockMediaEndpoint):
(WebCore::MockMediaEndpoint::generateDtlsInfo): Deleted.
* platform/mock/MockMediaEndpoint.h:
2016-10-28 Wenson Hsieh <wenson_hsieh@apple.com>
Unreviewed, add Input Events to the features list.
* features.json:
2016-10-28 Darin Adler <darin@apple.com>
Fix mismerge that broke a CEReactions test.
* html/HTMLOptionsCollection.idl: Add back CEReactions to the remove function.
2016-10-28 Darin Adler <darin@apple.com>
Move all classes in the HTML directory from ExceptionCode to Exception
https://bugs.webkit.org/show_bug.cgi?id=163876
Reviewed by Sam Weinig.
* bindings/js/JSDOMBinding.cpp:
(WebCore::shouldAllowAccessToNode): Deleted.
(WebCore::BindingSecurity::shouldAllowAccessToFrame): Moved function into the
BindingSecurity namespace. Also changed arguments to references.
(WebCore::BindingSecurity::shouldAllowAccessToDOMWindow): Ditto.
(WebCore::BindingSecurity::shouldAllowAccessToNode): Changed argument type
from pointer to reference.
* bindings/js/JSDOMBinding.h: Removed top level shouldAllowAccessTo functions,
moving all of them into the BindingSecurity namespace. Changed BindingSecurity
from a class into a namespace. Added new checkSecurityForNode functions that
can be used directly to implement CheckSecurityForNode; they turn the node
into a null, which is no change in behavior from what bindings already did.
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess): Changed argument
type for passed-in string to const String& instead of String&.
(WebCore::JSDOMWindow::getOwnPropertySlot): Updated for BindingSecurity changes.
(WebCore::JSDOMWindow::getOwnPropertySlotByIndex): Ditto.
(WebCore::JSDOMWindow::put): Ditto.
* bindings/js/JSHTMLCanvasElementCustom.cpp:
(WebCore::attributesFor3DContext): Renamed from get3DContextAttributes and
changed to use a return value instead of an out argument.
(WebCore::JSHTMLCanvasElement::getContext): Updated for the above.
(WebCore::JSHTMLCanvasElement::toDataURL): Rewrote to handle ExceptionOr
and also to use Optional<double> instead of const double*.
* bindings/js/JSHTMLFrameElementCustom.cpp:
(WebCore::JSHTMLFrameElement::setLocation): Moved the logic from
allowSettingJavascriptURL in here and updated for BindingSecurity changes.
* bindings/js/JSHTMLOptionsCollectionCustom.cpp:
(WebCore::JSHTMLOptionsCollection::setLength): Use propagateException.
Also streamlined the code a bit.
(WebCore::JSHTMLOptionsCollection::indexSetter): Updated for new name and
argument types for selectElementIndexSetter.
* bindings/js/JSHTMLSelectElementCustom.cpp:
(WebCore::selectElementIndexSetter): Updated name and argument types and
to use propagateException.
(WebCore::JSHTMLSelectElement::indexSetter): Updated for above.
* bindings/js/JSHTMLSelectElementCustom.h: Ditto.
* bindings/js/JSLocationCustom.cpp:
(WebCore::JSLocation::getOwnPropertySlotDelegate): Updated for changes to
BindingSecurity.
(WebCore::JSLocation::putDelegate): Ditto. Also rearranged logic a bit.
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::canAccessFromCurrentOrigin): Updated for
changes to BindingSecurity.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation): Removed old support for CheckSecurityForNode.
(NativeToJSValue): Added new support for CheckSecurityForNode, which uses
the new checkSecurityForNode function, and works properly with ExceptionOr.
* bindings/scripts/test/JS/JSTestObj.cpp: Updated for change below.
* dom/ChildNode.idl: Move the remove function to non-legacy exception.
Needed now because this needs to match the one in HTMLSelectElement.
* dom/Element.cpp:
(WebCore::Element::dispatchMouseForceWillBegin): Refactored a little bit.
(WebCore::Element::mergeWithNextTextNode): Support ExceptionOr for remove.
(WebCore::Element::setOuterHTML): Support ExceptionOr for
createFragmentForInnerOuterHTML.
(WebCore::Element::setInnerHTML): Ditto.
(WebCore::Element::insertAdjacentHTML): Ditto.
* dom/Node.cpp:
(WebCore::Node::remove): Use ExceptionOr.
(WebCore::Node::normalize): Remove use of IGNORE_EXCEPTION.
* dom/Node.h: Use ExceptionOr for remove.
* dom/Range.cpp:
(WebCore::Range::insertNode): Updated for change to remove.
(WebCore::Range::createContextualFragment): Updated for change
to WebCore::createContextualFragment.
* dom/ShadowRoot.cpp:
(WebCore::ShadowRoot::setInnerHTML): Use ExceptionOr for
createFragmentForInnerOuterHTML and replaceChildrenWithFragment.
* editing/AppendNodeCommand.cpp:
(WebCore::AppendNodeCommand::doUnapply): Remove IGNORE_EXCEPTION.
* editing/InsertNodeBeforeCommand.cpp:
(WebCore::InsertNodeBeforeCommand::doUnapply): Ditto.
* editing/MergeIdenticalElementsCommand.cpp:
(WebCore::MergeIdenticalElementsCommand::doApply): Ditto.
* editing/RemoveNodeCommand.cpp:
(WebCore::RemoveNodeCommand::doApply): Ditto.
* editing/SplitElementCommand.cpp:
(WebCore::SplitElementCommand::doUnapply): Ditto.
* editing/SplitTextNodeCommand.cpp:
(WebCore::SplitTextNodeCommand::doUnapply): Ditto.
* editing/WrapContentsInDummySpanCommand.cpp:
(WebCore::WrapContentsInDummySpanCommand::doUnapply): Ditto.
* editing/Editor.cpp:
(WebCore::Editor::insertDictationPhrases): Deleted. Moved this
iOS-specific function to EditorIOS.mm.
(WebCore::Editor::setDictationPhrasesAsChildOfElement): Ditto.
(WebCore::Editor::confirmMarkedText): Ditto.
(WebCore::Editor::setTextAsChildOfElement): Ditto.
(WebCore::Editor::ensureLastEditCommandHasCurrentSelectionIfOpenForMoreTyping): Ditto.
* editing/ios/EditorIOS.mm:
(WebCore::Editor::fontForSelection): Remove ASSERT_NO_EXCEPTION.
(WebCore::Editor::fontAttributesForSelectionStart): Ditto.
(WebCore::Editor::insertDictationPhrases): Moved here from Editor.cpp.
(WebCore::Editor::setDictationPhrasesAsChildOfElement): Ditto. Also
updated code that used remove to not pass an ExceptionCode.
(WebCore::Editor::confirmMarkedText): Ditto.
(WebCore::Editor::setTextAsChildOfElement): Ditto.
(WebCore::Editor::ensureLastEditCommandHasCurrentSelectionIfOpenForMoreTyping): Ditto.
* editing/mac/EditorMac.mm:
(WebCore::Editor::fontForSelection): Remove ASSERT_NO_EXCEPTION.
(WebCore::Editor::fontAttributesForSelectionStart): Ditto.
* editing/markup.cpp:
(WebCore::createFragmentForInnerOuterHTML): Use ExceptionOr.
(WebCore::createContextualFragment): Ditto.
(WebCore::replaceChildrenWithFragment): Ditto.
(WebCore::replaceChildrenWithText): Ditto.
* editing/markup.h: Updated for above changes.
* html/BaseChooserOnlyDateAndTimeInputType.cpp:
(WebCore::BaseChooserOnlyDateAndTimeInputType::updateAppearance):
Removed ASSERT_NO_EXCEPTION.
* html/BaseDateAndTimeInputType.cpp:
(WebCore::BaseDateAndTimeInputType::setValueAsDate): Use ExceptionOr.
(WebCore::BaseDateAndTimeInputType::setValueAsDecimal): Ditto.
* html/BaseDateAndTimeInputType.h: Updated for above changes.
* html/DateTimeLocalInputType.cpp:
(WebCore::DateTimeLocalInputType::setValueAsDate): Use ExceptionOr.
* html/DateTimeLocalInputType.h: Updated for above changes.
* html/DOMTokenList.cpp:
(WebCore::DOMTokenList::validateToken): Use ExceptionOr.
(WebCore::DOMTokenList::validateTokens): Ditto.
(WebCore::DOMTokenList::addInternal): Ditto.
(WebCore::DOMTokenList::add): Ditto.
(WebCore::DOMTokenList::removeInternal): Ditto.
(WebCore::DOMTokenList::remove): Ditto.
(WebCore::DOMTokenList::toggle): Ditto.
(WebCore::DOMTokenList::replace): Ditto.
(WebCore::DOMTokenList::supports): Ditto.
* html/DOMTokenList.h: Updated for above changes.
* html/DOMTokenList.idl: Use non-legacy exceptions.
* html/DOMURL.cpp:
(WebCore::DOMURL::DOMURL): Just take the two URL objects and let
the create functions do all the processing.
(WebCore::DOMURL::create): Use ExceptionOr, and move the processing
of the URLs here out of the constructors.
(WebCore::DOMURL::setHref): Use ExceptionOr.
* html/DOMURL.h: Updated for above changes.
* html/DOMURL.idl: Use non-legacy exceptions.
* html/FTPDirectoryDocument.cpp:
(WebCore::FTPDirectoryDocumentParser::appendEntry): Remove
IGNORE_EXCEPTION and use releaseReturnValue().
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::toDataURL): Use ExceptionOr.
* html/HTMLCanvasElement.h: Updated for above changes.
* html/HTMLCanvasElement.idl: Use non-legacy exception.
* html/HTMLElement.cpp:
(WebCore::HTMLElement::textToFragment): Use ExceptionOr.
(WebCore::HTMLElement::setInnerText): Ditto.
(WebCore::HTMLElement::setOuterText): Ditto.
(WebCore::HTMLElement::setContentEditable): Ditto.
(WebCore::HTMLElement::translateAttributeMode): Deleted.
(WebCore::HTMLElement::translate): Moved the logic from the
translateAttributeMode function in here.
* html/HTMLElement.h: Updated for above changes.
* html/HTMLElement.idl: Use non-legacy exceptions.
* html/HTMLEmbedElement.idl: Use non-legacy exception.
* html/HTMLFrameElement.idl: Ditto.
* html/HTMLFrameOwnerElement.cpp:
(WebCore::HTMLFrameOwnerElement::getSVGDocument): Use ExceptionOr.
* html/HTMLFrameOwnerElement.h: Updated for above.
* html/HTMLIFrameElement.idl: Use non-legacy exception.
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::stepUp): Use ExceptionOr.
(WebCore::HTMLInputElement::stepDown): Ditto.
(WebCore::HTMLInputElement::setValue): Ditto.
(WebCore::HTMLInputElement::setValueAsDate): Ditto.
(WebCore::HTMLInputElement::setValueAsNumber): Ditto.
(WebCore::HTMLInputElement::setSize): Ditto.
(WebCore::HTMLInputElement::maxLengthAttributeChanged): Use the
new internalSetMaxLength function; old code relied on a setMaxLength
that was different from the one exposed to bindings.
(WebCore::HTMLInputElement::minLengthAttributeChanged): Ditto.
(WebCore::HTMLInputElement::setRangeText): Use ExceptionOr.
* html/HTMLInputElement.h: Updated for above changes. Also use
data member initialization for InputElementClickState instead of
a constructor.
* html/HTMLInputElement.idl: Use non-legacy exception.
* html/HTMLMarqueeElement.cpp:
(WebCore::HTMLMarqueeElement::setLoop): Use ExceptionOr.
(WebCore::HTMLMarqueeElement::renderMarquee): Tweaked.
* html/HTMLMarqueeElement.h: Updated for above changes.
* html/HTMLMarqueeElement.idl: Ditto.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::TrackGroup::TrackGroup):
Initialize most data members in class definition rather than
the constructor.
(WebCore::HTMLMediaElement::HTMLMediaElement): Ditto.
(WebCore::HTMLMediaElement::~HTMLMediaElement): Updated since
removeMediaElement now takes a reference.
(WebCore::HTMLMediaElement::updateActiveTextTrackCues): Use
a modern for loop to streamline code.
(WebCore::HTMLMediaElement::textTrackModeChanged): Updated since
track now returns a reference.
(WebCore::HTMLMediaElement::setCurrentTimeForBindings): Renamed
to prevent ambiguity with the other version that has slightly
different semantics and overloading and changed to use ExceptionOr.
(WebCore::HTMLMediaElement::playInternal): Updated to use reference.
(WebCore::HTMLMediaElement::setVolume): Use ExceptionOr.
(WebCore::HTMLMediaElement::mediaPlayerDidAddAudioTrack): Take a
reference instead of a PassRefPtr.
(WebCore::HTMLMediaElement::mediaPlayerDidAddTextTrack): Ditto.
(WebCore::HTMLMediaElement::mediaPlayerDidAddVideoTrack): Ditto.
(WebCore::HTMLMediaElement::mediaPlayerDidRemoveAudioTrack): Ditto.
(WebCore::HTMLMediaElement::mediaPlayerDidRemoveTextTrack): Ditto.
(WebCore::HTMLMediaElement::mediaPlayerDidRemoveVideoTrack): Ditto.
(WebCore::HTMLMediaElement::addTextTrack): Use ExceptionOr.
(WebCore::HTMLMediaElement::didAddTextTrack): Use a reference.
(WebCore::HTMLMediaElement::didRemoveTextTrack): Ditto.
(WebCore::HTMLMediaElement::maxBufferedTime): Update to use different
interface to time ranges that does not need to deal with exceptions.
(WebCore::HTMLMediaElement::setController): Pass references.
(WebCore::HTMLMediaElement::outOfBandTrackSources): Use reference.
* html/HTMLMediaElement.h: Updated for above.
* html/HTMLMediaElement.idl: Use non-legacy exceptions.
* html/HTMLObjectElement.idl: Use non-legacy exception.
* html/HTMLOptionElement.cpp:
(WebCore::HTMLOptionElement::createForJSConstructor): Use ExceptionOr.
* html/HTMLOptionElement.h: Updated for above change.
* html/HTMLOptionElement.idl: Use non-legacy exception.
* html/HTMLOptionsCollection.cpp:
(WebCore::HTMLOptionsCollection::setLength): Use ExceptionOr.
* html/HTMLOptionsCollection.h: Updated for above change.
* html/HTMLOptionsCollection.idl: Use non-legacy exception.
* html/HTMLProgressElement.cpp:
(WebCore::HTMLProgressElement::setValue): Removed non-finite handling
because that is now handled by the bindings.
(WebCore::HTMLProgressElement::setMax): Ditto.
* html/HTMLProgressElement.h: Updated for above.
* html/HTMLProgressElement.idl: Changed attributes to be double instead
of unrestricted double, and this was able to remove exceptions.
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::removeByIndex): Drop IGNORE_EXCEPTION.
(WebCore::HTMLSelectElement::remove): Use ExceptionOr.
(WebCore::HTMLSelectElement::setOption): Ditto.
(WebCore::HTMLSelectElement::setLength): Ditto.
* html/HTMLSelectElement.h: Updated for above changes.
* html/HTMLSelectElement.idl: Use non-legacy exceptions.
* html/HTMLTableElement.cpp:
(WebCore::HTMLTableElement::setCaption): Use ExceptionOr.
(WebCore::HTMLTableElement::setTHead): Ditto.
(WebCore::HTMLTableElement::setTFoot): Ditto.
(WebCore::HTMLTableElement::createTHead): Streamline a bit.
(WebCore::HTMLTableElement::deleteTHead): Ditto.
(WebCore::HTMLTableElement::createTFoot): Ditto.
(WebCore::HTMLTableElement::deleteTFoot): Ditto.
(WebCore::HTMLTableElement::createTBody): Ditto.
(WebCore::HTMLTableElement::createCaption): Ditto.
(WebCore::HTMLTableElement::insertRow): Use ExceptionOr.
(WebCore::HTMLTableElement::deleteRow): Ditto.
* html/HTMLTableElement.h: Updated for above changes.
* html/HTMLTableElement.idl: Use non-legacy exceptions.
* html/HTMLTableRowElement.cpp:
(WebCore::findTable): Added.
(WebCore::HTMLTableRowElement::rowIndex): Streamline a bit using the
findTable function above.
(WebCore::findRows): Added.
(WebCore::HTMLTableRowElement::sectionRowIndex): Streamline a bit using
the findRows function above.
(WebCore::HTMLTableRowElement::insertCell): Use ExceptionOr.
(WebCore::HTMLTableRowElement::deleteCell): Ditto.
(WebCore::HTMLTableRowElement::setCells): Deleted.
* html/HTMLTableRowElement.h: Updated for the above. The setCells function
was dead code.
* html/HTMLTableRowElement.idl: Use non-legacy exceptions.
* html/HTMLTableSectionElement.cpp:
(WebCore::HTMLTableSectionElement::additionalPresentationAttributeStyle):
Tweaked a bit to use early return.
(WebCore::HTMLTableSectionElement::insertRow): Use ExceptionOr.
(WebCore::HTMLTableSectionElement::deleteRow): Ditto.
(WebCore::HTMLTableSectionElement::numRows): Use childrenOfType.
(WebCore::HTMLTableSectionElement::align): Deleted.
(WebCore::HTMLTableSectionElement::setAlign): Deleted.
(WebCore::HTMLTableSectionElement::ch): Deleted.
(WebCore::HTMLTableSectionElement::setCh): Deleted.
(WebCore::HTMLTableSectionElement::chOff): Deleted.
(WebCore::HTMLTableSectionElement::setChOff): Deleted.
(WebCore::HTMLTableSectionElement::vAlign): Deleted.
(WebCore::HTMLTableSectionElement::setVAlign): Deleted.
* html/HTMLTableSectionElement.h: Updated for the above.
* html/HTMLTableSectionElement.idl: Use non-legacy exception.
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::maxLengthAttributeChanged): Use the new
internalSetMaxLength function; old code relied on a setMaxLength
that was different from the one exposed to bindings.
(WebCore::HTMLTextAreaElement::minLengthAttributeChanged): Ditto.
(WebCore::HTMLTextAreaElement::updatePlaceholderText): Removed
ASSERT_NO_EXCEPTION.
* html/HTMLTextAreaElement.idl: Use non-legacy exceptions.
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::setRangeText): Use ExceptionOr.
(WebCore::HTMLTextFormControlElement::setInnerTextValue): Ditto.
(WebCore::HTMLTextFormControlElement::setMaxLength): Ditto.
(WebCore::HTMLTextFormControlElement::setMinLength): Ditto.
* html/HTMLTextFormControlElement.h: Updated for above changes.
Also renamed the setMin/MaxLength function overloads for internal use
to internSetMin/MaxLength and made them protected.
* html/HTMLTrackElement.cpp:
(WebCore::HTMLTrackElement::~HTMLTrackElement): Call clearElement on the
track to break the connection. Before this was done as a side effect of
clearClient, but that is called in other cases where we do not want to
clear the link back to the track element.
(WebCore::HTMLTrackElement::insertedInto): Removed code that uses the
track function for its side effect of creating a track; no longer needed.
Rewrote this so it's more symmetric with removedFrom.
(WebCore::HTMLTrackElement::removedFrom): Pass reference. Also reordered
and removed an unnecessary check for null parent.
(WebCore::HTMLTrackElement::parseAttribute): Use track.
(WebCore::HTMLTrackElement::kind): Ditto.
(WebCore::HTMLTrackElement::track): Renamed ensureTrack to this. Also
removed the redundant code to call setTrackElement; we no longer change
the track element on a track until the track element is destroyed.
(WebCore::HTMLTrackElement::scheduleLoad): Use track.
(WebCore::HTMLTrackElement::loadTimerFired): Ditto.
(WebCore::HTMLTrackElement::setReadyState): Ditto.
(WebCore::HTMLTrackElement::readyState): Ditto.
(WebCore::HTMLTrackElement::mediaElement): Rearranged to use early return.
* html/HTMLTrackElement.h: Updated for above changes.
* html/HTMLVideoElement.cpp:
(WebCore::HTMLVideoElement::webkitEnterFullscreen): Use ExceptionOr.
* html/HTMLVideoElement.h: Removed the functions used just for
capitalization reasons; that's now handled in the bindings.
* html/HTMLVideoElement.idl: Use non-legacy bindings and ImplementedAs.
* html/ImageData.cpp:
(WebCore::ImageData::create): Return ExceptionOr.
* html/ImageData.h: Updated for above changes.
* html/ImageData.idl: Use non-legacy exceptions.
* html/InputType.cpp:
(WebCore::InputType::setValueAsDate): Use ExceptionOr.
(WebCore::InputType::setValueAsDouble): Ditto.
(WebCore::InputType::setValueAsDecimal): Ditto.
(WebCore::InputType::applyStep): Ditto.
(WebCore::InputType::stepUp): Ditto.
(WebCore::InputType::stepUpFromRenderer): Removed IGNORE_EXCEPTION.
* html/InputType.h: Updated for the above.
* html/MediaController.cpp:
(MediaController::addMediaElement): Take a reference instead of a pointer.
(MediaController::removeMediaElement): Ditto.
(MediaController::containsMediaElement): Ditto.
(MediaController::setVolume): Use ExceptionOr.
(MediaController::bringElementUpToSpeed): Take a reference.
* html/MediaController.h: Updated for above changes. Also made lots of
function overrides private.
* html/MediaController.idl: Use non-legacy exception.
* html/MediaControllerInterface.h: Use ExceptionOr for setVolume.
* html/NumberInputType.cpp:
(WebCore::RealNumberRenderSize::max): Use aggregate initialization instead
of a constructor.
(WebCore::calculateRenderSize): Ditto.
(WebCore::NumberInputType::setValueAsDouble): Use ExceptionOr.
(WebCore::NumberInputType::setValueAsDecimal): Ditto.
* html/NumberInputType.h: Updated for above changes.
* html/RangeInputType.cpp:
(WebCore::RangeInputType::RangeInputType): Initialize scalar data member
in class definition instead of here.
(WebCore::RangeInputType::setValueAsDecimal): Use ExceptionOr.
(WebCore::RangeInputType::handleKeydownEvent): Removed IGNORE_EXCEPTION.
* html/RangeInputType.h: Updated for above changes.
* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::updatePlaceholderText): Removed
ASSERT_NO_EXCEPTION.
* html/TimeRanges.cpp:
(WebCore::TimeRanges::start): Use ExceptionOr.
(WebCore::TimeRanges::end): Ditto.
* html/TimeRanges.h: Updated for the above.
* html/TimeRanges.idl: Use non-legacy exceptions.
* html/URLUtils.idl: Use non-legacy exception.
* html/ValidationMessage.cpp:
(WebCore::ValidationMessage::setMessageDOMAndStartTimer): Removed
ASSERT_NO_EXCEPTION, IGNORE_EXCEPTION, and other exception-ignoring idioms.
* html/parser/HTMLTreeBuilder.cpp:
(WebCore::HTMLTreeBuilder::processStartTagForInBody): Ditto.
* html/shadow/MediaControlElementTypes.cpp:
(WebCore::MediaControlVolumeSliderElement::defaultEventHandler): Ditto.
* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlPanelElement::setPosition): Ditto.
(WebCore::MediaControlPanelElement::resetPosition): Ditto.
(WebCore::MediaControlStatusDisplayElement::update): Ditto.
(WebCore::MediaControlClosedCaptionsTrackListElement::updateDisplay): Ditto.
(WebCore::MediaControlFullscreenVolumeMinButtonElement::defaultEventHandler): Ditto.
(WebCore::MediaControlFullscreenVolumeMaxButtonElement::defaultEventHandler): Ditto.
* html/shadow/MediaControls.cpp:
(WebCore::MediaControls::updateCurrentTimeDisplay): Ditto.
* html/shadow/MediaControlsApple.cpp:
(WebCore::MediaControlsApple::updateCurrentTimeDisplay): Ditto.
* html/track/LoadableTextTrack.cpp:
(WebCore::LoadableTextTrack::LoadableTextTrack): Take reference.
(WebCore::LoadableTextTrack::~LoadableTextTrack): Deleted.
(WebCore::LoadableTextTrack::clearClient): Deleted override. We no longer
want to clear m_trackElement when clearing the client.
(WebCore::LoadableTextTrack::setTrackElement): Deleted.
(WebCore::LoadableTextTrack::id): Changed to use
attributeWithoutSynchronization for better performance and idAttr instead
of a string constant.
* html/track/LoadableTextTrack.h: Updated for above changes. Added a new
clearElement function. Made the element and isDefault functions private.
* html/track/VTTCue.cpp:
(WebCore::VTTCue::~VTTCue): Removed ASSERT_NO_EXCEPTION, IGNORE_EXCEPTION,
and other exception-ignoring idioms.
(WebCore::VTTCue::removeDisplayTree): Ditto.
* html/track/VTTRegion.cpp:
(WebCore::VTTRegion::displayLastTextTrackCueBox): Ditto.
(WebCore::VTTRegion::willRemoveTextTrackCueBox): Ditto.
* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::pushNodeByBackendIdToFrontend):
Rewrote to avoid multiplehash table lookups and added a FIXME about
the peculiar code here.
(WebCore::InspectorDOMAgent::resolveNode): Streamlined.
(WebCore::InspectorDOMAgent::nodeAsScriptValue): Use the new
checkSecurityForNode instead of the old shouldAllowAccessToNode.
* platform/graphics/ImageBuffer.h: Take Optional<double> instead of
const double* in toDataURL. Renamed ImageDataToDataURL to just dataURL.
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::addAudioTrack): Take a reference instead of PassRefPtr.
(WebCore::MediaPlayer::removeAudioTrack): Ditto.
(WebCore::MediaPlayer::addTextTrack): Ditto.
(WebCore::MediaPlayer::removeTextTrack): Ditto.
(WebCore::MediaPlayer::addVideoTrack): Ditto.
(WebCore::MediaPlayer::removeVideoTrack): Ditto.
* platform/graphics/MediaPlayer.h: Updated for the above.
* platform/graphics/PlatformTimeRanges.h: Exported a couple of functions
that are now used in WebKit.
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
(WebCore::MediaPlayerPrivateAVFoundation::clearTextTracks): Use a modern for loop.
(WebCore::MediaPlayerPrivateAVFoundation::processNewAndRemovedTextTracks):
Fixed a bug that would cause this function to fail to process half the tracks.
Also updated for the change from PassRefPtr to references.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::determineChangedTracksFromNewTracksAndOldItems): Pass references.
(WebCore::MediaPlayerPrivateAVFoundationObjC::audioSourceProvider): Ditto.
(WebCore::MediaPlayerPrivateAVFoundationObjC::processMetadataTrack): Ditto.
(WebCore::assetMetadataKeyNames): Tweaked formatting.
(WebCore::itemKVOProperties): Ditto.
(WebCore::playerKVOProperties): Ditto.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::updateTracksOfType): Pass references.
* platform/graphics/cairo/ImageBufferCairo.cpp:
(WebCore::ImageBuffer::toDataURL): Use Optional<double>
* platform/graphics/cg/ImageBufferCG.cpp:
(WebCore::createBitmapImageAfterScalingIfNeeded): Use auto.
(WebCore::encodeImage): Ditto. Also renamed from CGImageEncodeToData.
(WebCore::dataURL): Ditto. Also renamed from CGImageToDataURL and from
ImageDataToDataURL.
(WebCore::ImageBuffer::toDataURL): Ditto.
* platform/graphics/efl/ImageBufferEfl.cpp:
(WebCore::encodeImageJPEG): Use Optional<double>
(WebCore::ImageBuffer::toDataURL): Ditto.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideo): Pass
a reference instead of pointer.
(WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfAudio): Ditto.
(WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfText): Ditto.
(WebCore::MediaPlayerPrivateGStreamer::processMpegTsSection): Ditto.
(WebCore::MediaPlayerPrivateGStreamer::processTableOfContents): Ditto.
* platform/graphics/gtk/ImageBufferGtk.cpp:
(WebCore::encodeImage): Use Optional<double>
(WebCore::ImageBuffer::toDataURL): Ditto.
2016-10-28 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Allow @font-face src descriptor's format function to contain identifiers
https://bugs.webkit.org/show_bug.cgi?id=164169
Reviewed by Simon Fraser.
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeFontFaceSrcURI):
2016-10-28 Jer Noble <jer.noble@apple.com>
WebAudio does not resume when moving from background to foreground tab.
https://bugs.webkit.org/show_bug.cgi?id=164043
Reviewed by Darin Adler.
Test: webaudio/page-canstartmedia.html
* Modules/webaudio/AudioContext.cpp:
(WebCore::AudioContext::mediaCanStart):
2016-10-28 Wenson Hsieh <wenson_hsieh@apple.com>
iOS autocorrection does not trigger an input event of inputType "insertReplacementText"
https://bugs.webkit.org/show_bug.cgi?id=164077
<rdar://problem/28987810>
Reviewed by Simon Fraser.
Fixes candidate insertion on iOS, so that it fires input events of type "insertReplacementText" and adds two
iOS unit tests covering this change as well as the test infrastructure needed to support these tests. See
comments below for more details.
Tests: fast/events/ios/before-input-events-prevent-candidate-insertion.html
fast/events/ios/input-events-insert-replacement-text.html
* dom/TextEvent.h:
Adds isAutocompletion() to TextEvent, as well as the TextEventInputAutocompletion text input type. When the
Editor handles this TextEvent, it will use this information when creating or modifying the corresponding typing
command.
* dom/TextEventInputType.h:
* editing/Editor.cpp:
(WebCore::Editor::insertText):
(WebCore::Editor::insertTextWithoutSendingTextEvent):
* editing/Editor.h:
* editing/TypingCommand.cpp:
(WebCore::editActionForTypingCommand):
Now takes whether the command is autocorrection into account. If so, the corresponding edit action should be
EditActionInsertReplacement rather than EditActionTypingInsertText.
(WebCore::TypingCommand::TypingCommand):
(WebCore::TypingCommand::deleteSelection):
(WebCore::TypingCommand::deleteKeyPressed):
(WebCore::TypingCommand::forwardDeleteKeyPressed):
(WebCore::TypingCommand::insertText):
(WebCore::TypingCommand::insertLineBreak):
(WebCore::TypingCommand::insertParagraphSeparatorInQuotedContent):
(WebCore::TypingCommand::insertParagraphSeparator):
(WebCore::TypingCommand::inputEventData):
(WebCore::TypingCommand::willAddTypingToOpenCommand):
* editing/TypingCommand.h:
Adds a new TypingCommand option, IsAutocompletion.
2016-10-28 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r207700.
https://bugs.webkit.org/show_bug.cgi?id=164168
We are ready after r208086 (Requested by alexchristensen on
#webkit).
Reverted changeset:
"Unreviewed, rolling out r207582."
https://bugs.webkit.org/show_bug.cgi?id=163819
http://trac.webkit.org/changeset/207700
2016-10-28 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Allow unknown properties in will-change
https://bugs.webkit.org/show_bug.cgi?id=164165
Reviewed by Simon Fraser.
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeWillChange):
2016-10-28 Alex Christensen <achristensen@webkit.org>
Partially revert 207805 after resolution in URL spec issue 87
https://bugs.webkit.org/show_bug.cgi?id=164142
Reviewed by Andy Estes.
Covered by updated layout tests and API tests.
* platform/URLParser.cpp:
(WebCore::URLParser::isSingleDotPathSegment):
(WebCore::URLParser::isDoubleDotPathSegment):
(WebCore::URLParser::consumeSingleDotPathSegment):
(WebCore::URLParser::consumeDoubleDotPathSegment):
Treat %2e%2e as .. and %2e as . but only if it is entirety of the path segment.
There are tests for URLs like http://host/abc%2edef which have not changed because
the %2e is not the entirety of the path segment.
2016-10-28 Alex Christensen <achristensen@webkit.org>
URLParser should not try to interpret host of URLs with unrecognized schemes as IPv4 address
https://bugs.webkit.org/show_bug.cgi?id=164154
Reviewed by Andy Estes.
This is needed to match behavior of all browsers.
This is being discussed in the spec at https://github.com/whatwg/url/issues/148
Covered by new API tests.
* platform/URLParser.cpp:
(WebCore::URLParser::parseHostAndPort):
Only try to parse and canonicalize the host as an IPv4 address if the scheme is special (http, wss, etc.)
2016-10-28 Chris Dumez <cdumez@apple.com>
DOMStringMap reports properties as non-enumerable
https://bugs.webkit.org/show_bug.cgi?id=164114
Reviewed by Sam Weinig.
DOMStringMap's named properties should be configurable, enumerable
and writable as per:
- https://heycam.github.io/webidl/#getownproperty-guts (2.7-9)
- https://html.spec.whatwg.org/multipage/dom.html#domstringmap
Firefox and Chrome agree with the specification. However, WebKit
was doing the complete opposite.
No new tests, updated existing test.
* bindings/js/JSDOMStringMapCustom.cpp:
(WebCore::JSDOMStringMap::getOwnPropertySlotDelegate):
2016-10-28 Ryosuke Niwa <rniwa@webkit.org>
Add CEReactions to the remaining HTML DOM APIs
https://bugs.webkit.org/show_bug.cgi?id=163969
Reviewed by Chris Dumez.
Added CEReactions to the remaining DOM and HTML APIs as needed.
Tests: fast/custom-elements/reactions-for-indieui.html
fast/custom-elements/reactions/Document.html
fast/custom-elements/reactions/HTMLAnchorElement.html
fast/custom-elements/reactions/HTMLOptionElement.html
fast/custom-elements/reactions/HTMLOptionsCollection.html
fast/custom-elements/reactions/HTMLOutputElement.html
fast/custom-elements/reactions/HTMLSelectElement.html
fast/custom-elements/reactions/HTMLTableElement.html
fast/custom-elements/reactions/HTMLTableRowElement.html
fast/custom-elements/reactions/HTMLTableSectionElement.html
fast/custom-elements/reactions/HTMLTitleElement.html
fast/custom-elements/reactions/ShadowRoot.html
* bindings/js/JSHTMLOptionsCollectionCustom.cpp:
(WebCore::JSHTMLOptionsCollection::setLength):
(WebCore::JSHTMLOptionsCollection::indexSetter):
* bindings/js/JSHTMLSelectElementCustom.cpp:
(WebCore::JSHTMLSelectElement::indexSetter):
* dom/CharacterData.idl:
* dom/Document.idl:
* dom/Element.idl:
* dom/ShadowRoot.idl:
* html/HTMLAnchorElement.idl:
* html/HTMLDocument.idl:
* html/HTMLOptionElement.idl:
* html/HTMLOptionsCollection.idl:
* html/HTMLOutputElement.idl:
* html/HTMLSelectElement.idl:
* html/HTMLTableElement.idl:
* html/HTMLTableRowElement.idl:
* html/HTMLTableSectionElement.idl:
* html/HTMLTitleElement.idl:
2016-10-28 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Media Controller: volume control support
https://bugs.webkit.org/show_bug.cgi?id=163727
Reviewed by Dean Jackson.
We introduce the VolumeSupport class which brings support for modifying the media
volume by interacting with the mute volume slider in the media controls and correctly
reflecting the media's volume should it be changed via the media API.
Tests: media/modern-media-controls/volume-support/volume-support-click.html
media/modern-media-controls/volume-support/volume-support-drag.html
media/modern-media-controls/volume-support/volume-support-media-api-mute.html
media/modern-media-controls/volume-support/volume-support-media-api.html
* Modules/modern-media-controls/js-files:
* Modules/modern-media-controls/media/media-controller.js:
(MediaController):
* Modules/modern-media-controls/media/volume-support.js: Added.
(VolumeSupport.prototype.get control):
(VolumeSupport.prototype.get mediaEvents):
(VolumeSupport.prototype.controlValueWillStartChanging):
(VolumeSupport.prototype.controlValueDidChange):
(VolumeSupport.prototype.syncControl):
(VolumeSupport):
* WebCore.xcodeproj/project.pbxproj:
2016-10-28 Yusuke Suzuki <utatane.tea@gmail.com>
[DOMJIT] Rename CallDOM to CallDOMGetter
https://bugs.webkit.org/show_bug.cgi?id=164157
Reviewed by Keith Miller.
No behavior change.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
* bindings/scripts/test/JS/JSTestDOMJIT.h:
* domjit/JSDocumentDOMJIT.cpp:
(WebCore::DocumentDocumentElementDOMJIT::callDOMGetter):
(WebCore::DocumentDocumentElementDOMJIT::callDOM): Deleted.
* domjit/JSNodeDOMJIT.cpp:
(WebCore::createCallDOMGetterForOffsetAccess):
(WebCore::NodeFirstChildDOMJIT::callDOMGetter):
(WebCore::NodeLastChildDOMJIT::callDOMGetter):
(WebCore::NodeNextSiblingDOMJIT::callDOMGetter):
(WebCore::NodePreviousSiblingDOMJIT::callDOMGetter):
(WebCore::NodeParentNodeDOMJIT::callDOMGetter):
(WebCore::NodeNodeTypeDOMJIT::callDOMGetter):
(WebCore::NodeOwnerDocumentDOMJIT::callDOMGetter):
(WebCore::createCallDOMForOffsetAccess): Deleted.
(WebCore::NodeFirstChildDOMJIT::callDOM): Deleted.
(WebCore::NodeLastChildDOMJIT::callDOM): Deleted.
(WebCore::NodeNextSiblingDOMJIT::callDOM): Deleted.
(WebCore::NodePreviousSiblingDOMJIT::callDOM): Deleted.
(WebCore::NodeParentNodeDOMJIT::callDOM): Deleted.
(WebCore::NodeNodeTypeDOMJIT::callDOM): Deleted.
(WebCore::NodeOwnerDocumentDOMJIT::callDOM): Deleted.
2016-10-28 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Fix font-family parsing inside @font-face
https://bugs.webkit.org/show_bug.cgi?id=164155
Reviewed by Simon Fraser.
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseFontFaceDescriptor):
Use the full font-family parsing that returns a CSSValueList,
since we can handle multiple families.
2016-10-28 Per Arne Vollan <pvollan@apple.com>
[Win][Direct2D] Implement ImageBufferData::putData.
https://bugs.webkit.org/show_bug.cgi?id=164151
Reviewed by Brent Fulgham.
* platform/graphics/win/ImageBufferDataDirect2D.cpp:
(WebCore::ImageBufferData::getData):
(WebCore::ImageBufferData::putData):
2016-10-28 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Support hanging-punctuation
https://bugs.webkit.org/show_bug.cgi?id=164153
Reviewed by Simon Fraser.
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeHangingPunctuation):
(WebCore::CSSPropertyParser::parseSingleValue):
2016-10-28 Yusuke Suzuki <utatane.tea@gmail.com>
[DOMJIT] Implement Document::documentElement
https://bugs.webkit.org/show_bug.cgi?id=164113
Reviewed by Sam Weinig.
Test: js/dom/domjit-accessor-document-element.html
This patch implements document.documentElement DOMJIT accessor.
Similar to ownerDocument accessor, the way to access to document.documentElement
from JIT code is already prepared for CSSJIT. DOMJIT just utilizes the existing
functionality: using documentElementMemoryOffset().
document.documentElement is frequently called in jQuery. Especially, every time
we call jQuery.attr(), this is called.
To implement Document accessor, we clean up some code in DOMJITHelpers.
We create the cpp file for DOMJITHelpers and move some helpers to it.
And we also implement DOMJIT::checkDOM<DOMInterface> for convenience.
It returns appropriate CheckDOM patchpoint implementation.
This patch improves Dromaeo jslib-attr-jquery.html 10% (481.64 v.s. 532.54).
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsScopeRoot):
* dom/Document.idl:
* domjit/DOMJITAbstractHeapRepository.h:
* domjit/DOMJITCheckDOM.h: Copied from Source/WebCore/domjit/DOMJITAbstractHeapRepository.h.
(WebCore::DOMJIT::TypeChecker<Node>::branchIfFail):
(WebCore::DOMJIT::TypeChecker<Document>::branchIfFail):
(WebCore::DOMJIT::TypeChecker<Event>::branchIfFail):
(WebCore::DOMJIT::TypeChecker<Element>::branchIfFail):
(WebCore::DOMJIT::checkDOM):
* domjit/DOMJITHelpers.cpp: Copied from Source/WebCore/domjit/DOMJITAbstractHeapRepository.h.
(WebCore::DOMJIT::loadDocument):
(WebCore::DOMJIT::loadDocumentElement):
* domjit/DOMJITHelpers.h:
(WebCore::DOMJIT::toWrapperSlow):
(WebCore::DOMJIT::loadDocument): Deleted.
* domjit/JSDocumentDOMJIT.cpp: Added.
(WebCore::DocumentDocumentElementDOMJIT::checkDOM):
(WebCore::DocumentDocumentElementDOMJIT::callDOM):
* domjit/JSNodeDOMJIT.cpp:
(WebCore::createCallDOMForOffsetAccess):
(WebCore::NodeFirstChildDOMJIT::checkDOM):
(WebCore::NodeLastChildDOMJIT::checkDOM):
(WebCore::NodeNextSiblingDOMJIT::checkDOM):
(WebCore::NodePreviousSiblingDOMJIT::checkDOM):
(WebCore::NodeParentNodeDOMJIT::checkDOM):
(WebCore::NodeNodeTypeDOMJIT::checkDOM):
(WebCore::NodeOwnerDocumentDOMJIT::checkDOM):
(WebCore::NodeOwnerDocumentDOMJIT::callDOM):
(WebCore::toWrapperSlow): Deleted.
(WebCore::checkNode): Deleted.
2016-10-28 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Support initial-letter
https://bugs.webkit.org/show_bug.cgi?id=164150
Reviewed by Simon Fraser.
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeInitialLetter):
(WebCore::CSSPropertyParser::parseSingleValue):
2016-10-28 Simon Fraser <simon.fraser@apple.com>
Remove some unused code in RenderLayerCompositor::computeExtent()
https://bugs.webkit.org/show_bug.cgi?id=163934
Reviewed by Zalan Bujtas.
viewportRect was never used.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::computeExtent):
2016-10-28 Sam Weinig <sam@webkit.org>
[WebIDL] Update parser and code generators to only access type information through the type property
https://bugs.webkit.org/show_bug.cgi?id=164141
Reviewed by Anders Carlsson.
Update IDLParser structs:
- domSignature: Rename idlType to type. Specify that type is a domType.
- domInterface: Remove name and parent. Specify that type and parentType are a domTypes.
- domFunction: Specify that signature is a domSignature.
- domAttribute: Remove unused type. Specify that signature is a domSignature.
- domIterable: Remove idlKeyType and valueKeyType. Specify that keyType and valueType are a domTypes
- domConstant: Specify that type is a domType.
- domEnum: Specify that type is a domType.
- domDictionary: Remove name and parent. Specify that type and parentType are a domTypes.
- Typedef: Rename idlType to type and specify that it is a domType.
* bindings/scripts/IDLParser.pm:
Remove redundant properties and specify type info in structs where possible.
* bindings/scripts/CodeGenerator.pm:
(IsSVGTypeNeedingTearOffForType): Renamed to remove ForType suffix.
(IsSVGTypeWithWritablePropertiesNeedingTearOffForType): Renamed to remove ForType suffix.
(GetSVGTypeNeedingTearOffForType): Renamed to remove ForType suffix.
(GetSVGWrappedTypeNeedingTearOffForType): Renamed to remove ForType suffix.
Update to always access type information through type accessors. Remove use of removed
properties.
* bindings/scripts/CodeGeneratorJS.pm:
(IsNullableType): Deleted.
(StripNullable): Deleted.
Remove unused functions.
Update to always access type information through type accessors. Remove use of removed
properties.
* bindings/scripts/generate-bindings.pl:
Update to always access type information through type accessors. Remove use of removed
properties.
2016-10-28 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Support bopomofo Ruby
https://bugs.webkit.org/show_bug.cgi?id=164148
Reviewed by Simon Fraser.
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
2016-10-28 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Add support for -webkit-canvas images
https://bugs.webkit.org/show_bug.cgi?id=164144
Reviewed by Simon Fraser.
* css/CSSValueKeywords.in:
* css/parser/CSSParser.cpp:
(WebCore::CSSParserContext::CSSParserContext):
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::consumeWebkitCanvas):
(WebCore::CSSPropertyParserHelpers::consumeGeneratedImage):
(WebCore::CSSPropertyParserHelpers::isGeneratedImage):
2016-10-27 Geoffrey Garen <ggaren@apple.com>
One file per class for Executable.h/.cpp
https://bugs.webkit.org/show_bug.cgi?id=164099
Reviewed by Saam Barati.
* ForwardingHeaders/runtime/Executable.h: Removed.
* ForwardingHeaders/runtime/FunctionExecutable.h: Copied from Source/WebCore/ForwardingHeaders/runtime/Executable.h.
* bindings/js/JSLazyEventListener.cpp:
* bindings/js/JSMainThreadExecStateInstrumentation.h:
2016-10-28 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Clean up gradient parsing
https://bugs.webkit.org/show_bug.cgi?id=164139
Reviewed by Dean Jackson.
* css/CSSGradientValue.cpp:
(WebCore::positionFromValue):
(WebCore::CSSGradientValue::computeEndPoint):
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::consumeDeprecatedGradient):
(WebCore::CSSPropertyParserHelpers::consumeGradientColorStops):
(WebCore::CSSPropertyParserHelpers::consumeDeprecatedRadialGradient):
(WebCore::CSSPropertyParserHelpers::consumeRadialGradient):
(WebCore::CSSPropertyParserHelpers::consumeLinearGradient):
2016-10-28 Dean Jackson <dino@apple.com>
New CSS Parser should use Colors not RGBA32s
https://bugs.webkit.org/show_bug.cgi?id=164124
<rdar://problem/29000373>
Reviewed by Darin Adler.
The old parser has moved from using RGBA32 values to using
Colors directly. This was so we could support ExtendedColors
via the new color() syntax.
Update the new CSS parser to do the same.
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::parseRGBParameters):
(WebCore::CSSPropertyParserHelpers::parseHSLParameters):
(WebCore::CSSPropertyParserHelpers::parseHexColor):
(WebCore::CSSPropertyParserHelpers::parseColorFunction):
(WebCore::CSSPropertyParserHelpers::consumeColor):
2016-10-28 Dean Jackson <dino@apple.com>
Allow new CSS parser to handle insertRule, etc via parseRule
https://bugs.webkit.org/show_bug.cgi?id=164122
<rdar://problem/29000101>
Reviewed by Darin Adler.
Call the new CSS parser from CSSParser::parseRule if enabled. This
allows style added via the CSSOM insertRule to go through
the parser.
I tested this across our layout tests that use insertRule. It
works fine, but does cause some filter tests to fail. This is
because the new parser does not generate WebKitCSSFilterValues,
but I think the CSSFunctionValue is good enough. I'll remove
WebKitCSSFilterValue separately.
* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parseRule): Call CSSParserImpl::parseRule.
2016-10-28 Simon Fraser <simon.fraser@apple.com>
Wrong blur radius for filter: drop-shadow()
https://bugs.webkit.org/show_bug.cgi?id=163667
Reviewed by Darin Adler.
The "stdDev" parameter to <feDropShadow> and <feGaussianBlur> represents the standard
deviation (σ) of the Gaussian blur function. CSS filters drop-shadow() and blur() follow
this with their radius parameter.
However, CSS box-shadow and text-shadow use 2σ to describe the blur radius, since this
is conveniently close to the number of pixels the effect of the blur extends out.
feDropShadow, which is used by non-accelerated filter: drop-shadow(), was using
the wrong blur radius because it passed its stdDev directly to ShadowBlur. ShadowBlur
was written for CSS box-shadow, so expected its input "blur radius" to be twice the
stdDev.
Tests: css3/filters/drop-shadow-blur-radius.html
svg/filters/feDropShadow-blur-radius.html
* platform/graphics/filters/FEDropShadow.cpp:
(WebCore::FEDropShadow::platformApplySoftware):
2016-10-28 Youenn Fablet <youenn@apple.com>
Expose RTCPeerConnection unprefixed
https://bugs.webkit.org/show_bug.cgi?id=164060
Reviewed by Darin Adler.
Covered by rebased and activated tests.
* Modules/mediastream/RTCPeerConnection.idl:
2016-10-28 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Support the marquee properties
https://bugs.webkit.org/show_bug.cgi?id=164132
Reviewed by Zalan Bujtas.
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeWebkitMarqueeIncrement):
(WebCore::consumeWebkitMarqueeRepetition):
(WebCore::consumeWebkitMarqueeSpeed):
(WebCore::CSSPropertyParser::parseSingleValue):
(WebCore::CSSPropertyParser::parseShorthand):
2016-10-28 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Miscellaneous bug fixes
https://bugs.webkit.org/show_bug.cgi?id=164131
Reviewed by Zalan Bujtas.
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::propertyValue):
* css/CSSPropertyNames.in:
The prefix was incorrectly dropped from -webkit-column-progression.
Put it back.
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertPositionComponent):
(WebCore::StyleBuilderConverter::convertObjectPosition):
Fix object-position parsing so that the position components can
be ids.
* css/StyleBuilderCustom.h:
(WebCore::StyleBuilderCustom::applyValueContent):
The new parser doesn't make a list for content:none, since none can't be
a component of a list anyway. Add code to handle this case in the
apply function.
* css/parser/CSSParser.cpp:
(WebCore::isValidKeywordPropertyAndValue):
Put the prefix back on -webkit-column-progression.
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
(WebCore::CSSParserFastPaths::isKeywordPropertyID):
Same.
* css/parser/CSSParserImpl.cpp:
(WebCore::CSSParserImpl::parsePageSelector):
Make sure match type is checked, since our code asserts if it isn't.
* css/parser/CSSPropertyParser.cpp:
(WebCore::validWidthOrHeightKeyword):
(WebCore::consumeLineGrid):
(WebCore::CSSPropertyParser::parseSingleValue):
Add support for the line-grid properties and for -webkit-nbsp-mode.
2016-10-28 Antti Koivisto <antti@apple.com>
Always use iOS preload behavior
https://bugs.webkit.org/show_bug.cgi?id=164127
Reviewed by Andreas Kling.
On non-iOS platforms we were delaying issuing lower priority preload (images mostly) until document has body.
This should be unnecessary as networking layer prioritization should ensure higher priority resources are
loaded earlier. Testing on iOS has showed that more aggressive behavior is a win.
This patch switches to iOS behavior on all platforms (and simplified the logic).
* html/parser/HTMLResourcePreloader.cpp:
(WebCore::HTMLResourcePreloader::preload):
* loader/LinkLoader.cpp:
(WebCore::LinkLoader::preloadIfNeeded):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::performPostLoadActions):
(WebCore::CachedResourceLoader::preload):
(WebCore::CachedResourceLoader::isPreloaded):
(WebCore::CachedResourceLoader::checkForPendingPreloads): Deleted.
(WebCore::CachedResourceLoader::requestPreload): Deleted.
(WebCore::CachedResourceLoader::clearPendingPreloads): Deleted.
* loader/cache/CachedResourceLoader.h:
2016-10-28 Youenn Fablet <youenn@apple.com>
[Fetch] Ensure redirection count is no more than 20 in case of cross origin requests
https://bugs.webkit.org/show_bug.cgi?id=164117
Reviewed by Sam Weinig.
Tests: imported/w3c/web-platform-tests/fetch/api/redirect/redirect-count-cross-origin-worker.html
imported/w3c/web-platform-tests/fetch/api/redirect/redirect-count-cross-origin.html
Introducing a ResourceLoaderOptions that defines the maximum redirection count.
By default, it is set to 20 as per fetch specification.
This option is used by SubresourceLoader to cancel load if its redirection count is above that maximum.
DocumentThreadableLoader stopping redirections to make preflight if needed, it now uses the maxRedirectCount loader option to ensure
that the total number of redirections is 20.
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::redirectReceived):
* loader/ResourceLoaderOptions.h:
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::willSendRequestInternal):
* loader/SubresourceLoader.h:
2016-10-28 Fujii Hironori <Hironori.Fujii@sony.com>
generate-bindings-all.pl should recompile supplemented IDL if its supplemental IDL are added or removed
https://bugs.webkit.org/show_bug.cgi?id=164054
Reviewed by Michael Catanzaro.
generate-bindings-all.pl determines which IDL to recompile by
comparing timestamps of generated files, source IDL and its
dependencies. But this is not enough. If a new supplemental IDL
is added, its supplemented IDL needs to be recompiled even though
the timestamp of the supplemental IDL is older than the
generated files.
* bindings/scripts/generate-bindings-all.pl: Read supplemental
dependency file both before and after invoking preprocess-idls.pl.
Recompile IDL files if its supplemental dependencies are added or
removed.
2016-10-28 Youenn Fablet <youenn@apple.com>
PeerMediaDescription does not need to be refcounted
https://bugs.webkit.org/show_bug.cgi?id=164059
Reviewed by Darin Adler.
No change of behavior.
* Modules/mediastream/MediaEndpointPeerConnection.cpp:
(WebCore::MediaEndpointPeerConnection::createOfferTask):
(WebCore::MediaEndpointPeerConnection::createAnswerTask):
(WebCore::createSourceMap):
(WebCore::MediaEndpointPeerConnection::setLocalDescriptionTask):
(WebCore::MediaEndpointPeerConnection::setRemoteDescriptionTask):
(WebCore::MediaEndpointPeerConnection::addIceCandidateTask):
(WebCore::MediaEndpointPeerConnection::gotIceCandidate):
* Modules/mediastream/MediaEndpointPeerConnection.h:
* Modules/mediastream/SDPProcessor.cpp:
(WebCore::configurationFromJSON):
(WebCore::configurationToJSON):
(WebCore::SDPProcessor::generateCandidateLine):
(WebCore::SDPProcessor::parseCandidateLine):
* platform/mediastream/IceCandidate.h:
* platform/mediastream/MediaEndpointSessionConfiguration.h:
(WebCore::MediaEndpointSessionConfiguration::mediaDescriptions):
(WebCore::MediaEndpointSessionConfiguration::addMediaDescription):
(WebCore::MediaEndpointSessionConfiguration::clone):
* platform/mediastream/PeerMediaDescription.h:
(WebCore::PeerMediaDescription::addPayload):
(WebCore::PeerMediaDescription::addSsrc):
(WebCore::PeerMediaDescription::clearSsrcs):
(WebCore::PeerMediaDescription::addIceCandidate):
(WebCore::PeerMediaDescription::create): Deleted.
(WebCore::PeerMediaDescription::~PeerMediaDescription): Deleted.
(WebCore::PeerMediaDescription::type): Deleted.
(WebCore::PeerMediaDescription::setType): Deleted.
(WebCore::PeerMediaDescription::port): Deleted.
(WebCore::PeerMediaDescription::setPort): Deleted.
(WebCore::PeerMediaDescription::address): Deleted.
(WebCore::PeerMediaDescription::setAddress): Deleted.
(WebCore::PeerMediaDescription::mode): Deleted.
(WebCore::PeerMediaDescription::setMode): Deleted.
(WebCore::PeerMediaDescription::mid): Deleted.
(WebCore::PeerMediaDescription::setMid): Deleted.
(WebCore::PeerMediaDescription::payloads): Deleted.
(WebCore::PeerMediaDescription::setPayloads): Deleted.
(WebCore::PeerMediaDescription::rtcpMux): Deleted.
(WebCore::PeerMediaDescription::setRtcpMux): Deleted.
(WebCore::PeerMediaDescription::rtcpAddress): Deleted.
(WebCore::PeerMediaDescription::setRtcpAddress): Deleted.
(WebCore::PeerMediaDescription::rtcpPort): Deleted.
(WebCore::PeerMediaDescription::setRtcpPort): Deleted.
(WebCore::PeerMediaDescription::mediaStreamId): Deleted.
(WebCore::PeerMediaDescription::setMediaStreamId): Deleted.
(WebCore::PeerMediaDescription::mediaStreamTrackId): Deleted.
(WebCore::PeerMediaDescription::setMediaStreamTrackId): Deleted.
(WebCore::PeerMediaDescription::dtlsSetup): Deleted.
(WebCore::PeerMediaDescription::setDtlsSetup): Deleted.
(WebCore::PeerMediaDescription::dtlsFingerprintHashFunction): Deleted.
(WebCore::PeerMediaDescription::setDtlsFingerprintHashFunction): Deleted.
(WebCore::PeerMediaDescription::dtlsFingerprint): Deleted.
(WebCore::PeerMediaDescription::setDtlsFingerprint): Deleted.
(WebCore::PeerMediaDescription::cname): Deleted.
(WebCore::PeerMediaDescription::setCname): Deleted.
(WebCore::PeerMediaDescription::ssrcs): Deleted.
(WebCore::PeerMediaDescription::iceUfrag): Deleted.
(WebCore::PeerMediaDescription::setIceUfrag): Deleted.
(WebCore::PeerMediaDescription::icePassword): Deleted.
(WebCore::PeerMediaDescription::setIcePassword): Deleted.
(WebCore::PeerMediaDescription::iceCandidates): Deleted.
(WebCore::PeerMediaDescription::clone): Deleted.
(WebCore::PeerMediaDescription::PeerMediaDescription): Deleted.
* platform/mediastream/mac/MediaEndpointMac.cpp:
(WebCore::MediaEndpointMac::addRemoteCandidate):
(WebCore::MediaEndpointMac::OnIceCandidate):
* platform/mediastream/mac/MediaEndpointMac.h:
* platform/mediastream/openwebrtc/MediaEndpointOwr.cpp:
(WebCore::MediaEndpointOwr::updateSendConfiguration):
* platform/mediastream/openwebrtc/MediaEndpointOwr.h:
* platform/mock/MockMediaEndpoint.cpp:
(WebCore::MockMediaEndpoint::updateConfigurationMids):
2016-10-28 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Media Controller: scrubbing support
https://bugs.webkit.org/show_bug.cgi?id=163726
<rdar://problem/27989481>
Reviewed by Dean Jackson.
We introduce the ScrubberSupport class which brings support for scrubbing the media
by interacting with the scrubber in the media controls and correctly reflecting
the media's current time as set via the media API.
Tests: media/modern-media-controls/scrubber-support/scrubber-support-click.html
media/modern-media-controls/scrubber-support/scrubber-support-drag.html
media/modern-media-controls/scrubber-support/scrubber-support-media-api.html
* Modules/modern-media-controls/js-files:
* Modules/modern-media-controls/media/media-controller.js:
(MediaController):
* Modules/modern-media-controls/media/scrubbing-support.js: Added.
(ScrubbingSupport.prototype.get control):
(ScrubbingSupport.prototype.get mediaEvents):
(ScrubbingSupport.prototype.controlValueWillStartChanging):
(ScrubbingSupport.prototype.controlValueDidChange):
(ScrubbingSupport.prototype.controlValueDidStopChanging):
(ScrubbingSupport.prototype.syncControl):
(ScrubbingSupport):
* WebCore.xcodeproj/project.pbxproj:
2016-10-28 Alex Christensen <achristensen@webkit.org>
Fix Windows WebGL build after r208022
https://bugs.webkit.org/show_bug.cgi?id=164091
* platform/graphics/opengl/Extensions3DOpenGLCommon.h:
* platform/graphics/opengl/Extensions3DOpenGLES.cpp:
(WebCore::Extensions3DOpenGLES::Extensions3DOpenGLES):
* platform/graphics/opengl/Extensions3DOpenGLES.h:
* platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp:
(WebCore::GraphicsContext3D::getExtensions):
2016-10-27 Youenn Fablet <youenn@apple.com>
[Fetch API] Fetch ReadableStream should only clone the second branch
https://bugs.webkit.org/show_bug.cgi?id=164058
Reviewed by Darin Adler.
Covered by rebased tests.
* Modules/streams/ReadableStreamInternals.js:
(readableStreamTeePullFunction):
2016-10-27 Alex Christensen <achristensen@webkit.org>
Update ANGLE
https://bugs.webkit.org/show_bug.cgi?id=164101
Reviewed by Darin Adler.
ShCheckVariablesWithinPackingLimits has changed signatures from taking a ShVariableInfo* and length
to taking a std::vector<sh::ShaderVariable> which requires more information about the shader variables
than we kept in GraphicsContext3D::SymbolInfo. I removed the SymbolInfo class because it was redundant
with ANGLE's sh::ShaderVariable and now unused.
Covered by existing WebGL tests.
* CMakeLists.txt:
* PlatformMac.cmake:
* PlatformWin.cmake:
* platform/graphics/ANGLEWebKitBridge.cpp:
(WebCore::appendSymbol):
(WebCore::getStructInfo):
(WebCore::getSymbolInfo):
(WebCore::ANGLEWebKitBridge::compileShaderSource):
* platform/graphics/ANGLEWebKitBridge.h:
(WebCore::ANGLEShaderSymbol::isSampler): Deleted.
* platform/graphics/GraphicsContext3D.h:
(WebCore::GraphicsContext3D::SymbolInfo::SymbolInfo): Deleted.
(WebCore::GraphicsContext3D::SymbolInfo::operator==): Deleted.
* platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
(WebCore::Extensions3DOpenGLCommon::getTranslatedShaderSourceANGLE):
* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
(WebCore::GraphicsContext3D::checkVaryingsPacking):
(WebCore::GraphicsContext3D::precisionsMatch):
(WebCore::GraphicsContext3D::mappedSymbolName):
(WebCore::GraphicsContext3D::originalSymbolName):
2016-10-27 Simon Fraser <simon.fraser@apple.com>
Remove RenderStyle::isRunningAcceleratedAnimation()
https://bugs.webkit.org/show_bug.cgi?id=164109
Reviewed by David Hyatt.
RenderStyle::isRunningAcceleratedAnimation() was added in r40876 to handle interrupted
accelerated transitions, and to allow RenderLayer::currentTransform() to know when it
has to manually get the animated style.
The latter can now use isRunningAcceleratedAnimationOnRenderer(), and interrupting
accelerated transitions seems to work fine without it, so remove it.
* page/animation/ImplicitAnimation.cpp:
(WebCore::ImplicitAnimation::animate):
* page/animation/KeyframeAnimation.cpp:
(WebCore::KeyframeAnimation::animate):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::currentTransform):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::isRunningAcceleratedAnimation): Deleted.
(WebCore::RenderStyle::setIsRunningAcceleratedAnimation): Deleted.
* rendering/style/StyleRareNonInheritedData.cpp:
(WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
(WebCore::StyleRareNonInheritedData::operator==):
* rendering/style/StyleRareNonInheritedData.h:
2016-10-27 Myles C. Maxfield <mmaxfield@apple.com>
Teach WebGL code about new buffer targets in WebGL2
https://bugs.webkit.org/show_bug.cgi?id=163924
Reviewed by Dean Jackson.
WebGL 2 adds new buffer targets. Instead of completely reimplementing
the functions again for WebGL 2, we can simply check if we are using
a new kind of context to conditionally enable support.
Test: fast/canvas/webgl/webgl2-buffer-targets.html
* html/canvas/WebGL2RenderingContext.h:
* html/canvas/WebGL2RenderingContext.idl:
* html/canvas/WebGLBuffer.cpp:
(WebCore::WebGLBuffer::associateBufferDataImpl):
(WebCore::WebGLBuffer::associateBufferSubDataImpl):
(WebCore::WebGLBuffer::setTarget):
* html/canvas/WebGLBuffer.h:
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::bindBuffer):
(WebCore::WebGLRenderingContextBase::getBufferParameter):
(WebCore::WebGLRenderingContextBase::validateBufferDataParameters):
* html/canvas/WebGLRenderingContextBase.h:
2016-10-27 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Enhance grid-auto-flow parsing to allow dense first.
https://bugs.webkit.org/show_bug.cgi?id=164110
Reviewed by Simon Fraser.
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertGridAutoFlow):
2016-10-27 Simon Fraser <simon.fraser@apple.com>
constify the CSSValue arguments to StyleBuilderConverter functions
https://bugs.webkit.org/show_bug.cgi?id=164106
Reviewed by Zalan Bujtas.
Make almost all the CSSValue& arguments const (this makes it clear that they
are in params, not out params). Only a few that are CSSImageValues are non-const,
because they fall into a non-const code path.
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertLengthOrAuto):
(WebCore::StyleBuilderConverter::convertLengthSizing):
(WebCore::StyleBuilderConverter::convertLengthMaxSizing):
(WebCore::StyleBuilderConverter::convertComputedLength):
(WebCore::StyleBuilderConverter::convertLineWidth):
(WebCore::StyleBuilderConverter::convertSpacing):
(WebCore::StyleBuilderConverter::convertToRadiusLength):
(WebCore::StyleBuilderConverter::convertRadius):
(WebCore::StyleBuilderConverter::convertObjectPosition):
(WebCore::StyleBuilderConverter::convertTextDecoration):
(WebCore::StyleBuilderConverter::convertNumber):
(WebCore::StyleBuilderConverter::convertNumberOrAuto):
(WebCore::StyleBuilderConverter::convertWebkitHyphenateLimitLines):
(WebCore::StyleBuilderConverter::convertTransform):
(WebCore::StyleBuilderConverter::convertString):
(WebCore::StyleBuilderConverter::convertStringOrAuto):
(WebCore::StyleBuilderConverter::convertStringOrNone):
(WebCore::StyleBuilderConverter::valueToEmphasisPosition):
(WebCore::StyleBuilderConverter::convertTextEmphasisPosition):
(WebCore::StyleBuilderConverter::convertTextAlign):
(WebCore::StyleBuilderConverter::convertClipPath):
(WebCore::StyleBuilderConverter::convertResize):
(WebCore::StyleBuilderConverter::convertMarqueeRepetition):
(WebCore::StyleBuilderConverter::convertMarqueeSpeed):
(WebCore::StyleBuilderConverter::convertQuotes):
(WebCore::StyleBuilderConverter::convertTextUnderlinePosition):
(WebCore::StyleBuilderConverter::convertReflection):
(WebCore::StyleBuilderConverter::convertInitialLetter):
(WebCore::StyleBuilderConverter::convertTextStrokeWidth):
(WebCore::StyleBuilderConverter::convertLineBoxContain):
(WebCore::StyleBuilderConverter::convertTextDecorationSkip):
(WebCore::StyleBuilderConverter::convertScrollSnapPoints):
(WebCore::StyleBuilderConverter::convertSnapCoordinatePair):
(WebCore::StyleBuilderConverter::convertScrollSnapCoordinates):
(WebCore::StyleBuilderConverter::createGridTrackBreadth):
(WebCore::StyleBuilderConverter::createGridTrackSize):
(WebCore::StyleBuilderConverter::createGridTrackList):
(WebCore::StyleBuilderConverter::createGridPosition):
(WebCore::StyleBuilderConverter::convertGridTrackSizeList):
(WebCore::StyleBuilderConverter::convertGridTrackSize):
(WebCore::StyleBuilderConverter::convertGridPosition):
(WebCore::StyleBuilderConverter::convertGridAutoFlow):
(WebCore::StyleBuilderConverter::convertWordSpacing):
(WebCore::StyleBuilderConverter::convertPerspective):
(WebCore::StyleBuilderConverter::convertMarqueeIncrement):
(WebCore::StyleBuilderConverter::convertFilterOperations):
(WebCore::StyleBuilderConverter::convertFontFeatureSettings):
(WebCore::StyleBuilderConverter::convertFontVariationSettings):
(WebCore::StyleBuilderConverter::convertTouchCallout):
(WebCore::StyleBuilderConverter::convertTapHighlightColor):
(WebCore::StyleBuilderConverter::convertOverflowScrolling):
(WebCore::StyleBuilderConverter::convertSVGLength):
(WebCore::StyleBuilderConverter::convertSVGLengthVector):
(WebCore::StyleBuilderConverter::convertStrokeDashArray):
(WebCore::StyleBuilderConverter::convertPaintOrder):
(WebCore::StyleBuilderConverter::convertOpacity):
(WebCore::StyleBuilderConverter::convertSVGURIReference):
(WebCore::StyleBuilderConverter::convertSVGColor):
(WebCore::StyleBuilderConverter::convertSelfOrDefaultAlignmentData):
(WebCore::StyleBuilderConverter::convertContentAlignmentData):
(WebCore::StyleBuilderConverter::convertGlyphOrientation):
(WebCore::StyleBuilderConverter::convertGlyphOrientationOrAuto):
(WebCore::StyleBuilderConverter::convertLineHeight):
(WebCore::StyleBuilderConverter::convertFontSynthesis):
(WebCore::StyleBuilderConverter::convertPageBreakBetween):
(WebCore::StyleBuilderConverter::convertPageBreakInside):
(WebCore::StyleBuilderConverter::convertColumnBreakBetween):
(WebCore::StyleBuilderConverter::convertColumnBreakInside):
(WebCore::StyleBuilderConverter::convertRegionBreakBetween):
(WebCore::StyleBuilderConverter::convertRegionBreakInside):
(WebCore::StyleBuilderConverter::convertHangingPunctuation):
2016-10-27 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Add support for a reference box to -webkit-clip-path
https://bugs.webkit.org/show_bug.cgi?id=164107
Reviewed by Simon Fraser.
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeBasicShape):
(WebCore::consumeBasicShapeOrBox):
(WebCore::consumeWebkitClipPath):
2016-10-27 Yusuke Suzuki <utatane.tea@gmail.com>
[DOM] Add JSEventType
https://bugs.webkit.org/show_bug.cgi?id=164096
Reviewed by Darin Adler.
Event is inherited by many Event classes. But, Event's accessors and interfaces are
frequently called. For example, event.{type, target, srcElement} for accessors. And
event.stopPropagation() and event.preventDefault() functions.
However, since the user-visible event instance is typically the instance of the subclass,
jsDynamicCast<JSEvent*>() walks several classes before it succeeds. It is costly.
In this patch, we add a new WebCore JSType JSEventType for JSEvent and add a new
function jsEventCast. That supports a super fast cast operation. And it paves the way
for implementing DOM accessors of Event in DOMJIT.
No behavior change.
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSDOMWrapper.h:
* bindings/js/JSEventCustom.h: Added.
(WebCore::jsEventCast):
* bindings/scripts/CodeGeneratorJS.pm:
(GetJSTypeForNode):
(GenerateHeader):
(GetCastingHelperForThisObject):
* bindings/scripts/test/JS/JSTestEventConstructor.h:
(WebCore::JSTestEventConstructor::createStructure):
* dom/Event.idl:
* domjit/DOMJITHelpers.h:
(WebCore::DOMJIT::branchIfEvent):
(WebCore::DOMJIT::branchIfNotEvent):
2016-10-27 Simon Fraser <simon.fraser@apple.com>
Rename StyleRareNonInheritedData::opacity to m_opacity
https://bugs.webkit.org/show_bug.cgi?id=164104
Reviewed by Dave Hyatt.
Pure rename.
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::changeRequiresLayerRepaint):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::opacity):
(WebCore::RenderStyle::setOpacity):
* rendering/style/StyleRareNonInheritedData.cpp:
(WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
(WebCore::StyleRareNonInheritedData::operator==):
* rendering/style/StyleRareNonInheritedData.h:
(WebCore::StyleRareNonInheritedData::hasOpacity):
2016-10-27 Simon Fraser <simon.fraser@apple.com>
If an animation's keyframes affect stacking context properties, create stacking context while the animation is running
https://bugs.webkit.org/show_bug.cgi?id=164094
Reviewed by Dean Jackson.
The CSS animations spec <https://drafts.csswg.org/css-animations-1/> now makes it
clear that a keyframe animation animating properties which can affect stacking context
should establish stacking context while it's running, or filling-forwards. This is part
of the "the user agent must act as if the will-change property...includes all the properties
animated by the animation" clause.
Implement by having CompositeAnimation::animate() track whether running animations should
create stacking context, replacing existing code in AnimationController::updateAnimations()
which only looked at opacity and transform. Transitions are also checked to see if they need
to trigger stacking context.
This allows for the removal of a 0.9999 hack when blending opacity.
Tests: animations/stacking-context-fill-forwards.html
animations/stacking-context-not-fill-forwards.html
animations/stacking-context-unchanged-while-running.html
* page/animation/AnimationController.cpp:
(WebCore::AnimationController::updateAnimations):
* page/animation/CSSPropertyAnimation.cpp:
* page/animation/CompositeAnimation.cpp:
(WebCore::CompositeAnimation::animate):
* page/animation/KeyframeAnimation.cpp:
(WebCore::KeyframeAnimation::KeyframeAnimation):
(WebCore::KeyframeAnimation::computeStackingContextImpact):
(WebCore::KeyframeAnimation::animate):
* page/animation/KeyframeAnimation.h:
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::currentTransform):
* rendering/style/WillChangeData.cpp:
(WebCore::WillChangeData::propertyCreatesStackingContext):
(WebCore::propertyCreatesStackingContext): Deleted.
* rendering/style/WillChangeData.h:
2016-10-27 Sam Weinig <sam@webkit.org>
[WebIDL] Move code generators off of domSignature::type and onto domSignature::idlType
https://bugs.webkit.org/show_bug.cgi?id=164089
Reviewed by Alex Christensen.
Make more IDLParser structures contain domTypes for type descriptions, rather than strings:
- domInterface gains type and parentType.
- domConstant gains type.
- domEnum gains type.
- domDictionary gains type and parentType.
With these structs now containing domTypes, we can update the CodeGenerators to operate on
domTypes exclusively, rather than types as strings. This allows us to consistently have access
to information such as subtypes and nullability.
* bindings/scripts/CodeGenerator.pm:
Update helpers to operate of domTypes. The one exception is SkipIncludeHeader, which
still operates on a type name, since it is called late in code generation on the textual
form of type names in the include list.
* bindings/scripts/CodeGeneratorJS.pm:
Update to use domTypes.
* bindings/scripts/IDLParser.pm:
- Add domType accessors to domInterface, domConstant, domEnum, and domDictionary
and populate them.
- Remove type accessors from domSignature (domType is accessible from idlType).
- Remove special cases for sequence and FrozenArray, now that they are always
accessed as domTypes.
* html/HTMLEmbedElement.idl:
* html/HTMLFrameElement.idl:
* html/HTMLFrameOwnerElement.cpp:
(WebCore::HTMLFrameOwnerElement::getSVGDocument):
* html/HTMLFrameOwnerElement.h:
* html/HTMLIFrameElement.idl:
* html/HTMLObjectElement.idl:
Fix interfaces declaring getSVGDocument() to correctly have it return
a Document, rather than an SVGDocument, which does exist anymore. To
make the bindings happy, also change the signature of HTMLFrameOwnerElement::getSVGDocument
to return a Document.
* bindings/scripts/test/JS/JSTestEventTarget.cpp:
* bindings/scripts/test/JS/JSTestInterface.cpp:
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
* bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
Update test results to remove some redundant headers (Already included JSFoo.h, so no need for Foo.h).
2016-10-27 Myles C. Maxfield <mmaxfield@apple.com>
[macOS] [WebGL2] Temporarily upgrade WebGL 2's internal OpenGL context from version 2.1 to 3.2
https://bugs.webkit.org/show_bug.cgi?id=164091
Reviewed by Dean Jackson.
In order to test WebGL2 correctly, I had to upgrade the macOS's OpenGL
context to a 3.2-compatible context to make sure the new symbols are
accepted. Eventually, this 3.2-compatible context will have to be
reverted and replaced with an ANGLE context. The current 3.2-compatible
context is just for testing.
Test: fast/canvas/webgl/webgl2-context-creation.html
* html/canvas/WebGLBuffer.cpp: Use "nullptr" instead of 0.
(WebCore::WebGLBuffer::associateBufferData):
* html/canvas/WebGLRenderingContextBase.cpp: Use make_unique() instead
of the unique_ptr constructor.
(WebCore::WebGLRenderingContextBase::create):
* platform/graphics/GraphicsContext3D.h: GraphicsContext should know
if it is using a 3.2-compatible context because some parts of 2.1 are
removed in these contexts, and replaced with new things which aren't
in 2.1.
* platform/graphics/mac/GraphicsContext3DMac.mm:
(WebCore::setPixelFormat): Use kCGLPFAOpenGLProfile to specify an
OpenGL 3.2 context.
(WebCore::GraphicsContext3D::GraphicsContext3D): GL_CLAMP is deprecated
in OpenGL 3.2. Fortunately, GL_CLAMP_TO_EDGE isn't deprecated and does
exactly what we want. In OpenGL3.2, point sprites are always enabled,
so there's no need to enable them in those contexts.
(WebCore::GraphicsContext3D::isGLES2Compliant):
* platform/graphics/opengl/Extensions3DOpenGL.cpp: In OpenGL 3.2,
glGetString() no longer accepts GL_EXTENSIONS. Instead, glGetStringi()
is used instead. Unfortunately, glGetString() is not available in
OpenGL 2.1 contexts, so we need to use one or the other based on the
version of the context we're using.
(WebCore::Extensions3DOpenGL::Extensions3DOpenGL):
(WebCore::Extensions3DOpenGL::getExtensions):
* platform/graphics/opengl/Extensions3DOpenGL.h:
* platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
(WebCore::Extensions3DOpenGLCommon::Extensions3DOpenGLCommon):
(WebCore::Extensions3DOpenGLCommon::initializeAvailableExtensions):
Instead of modifying getExtensions() to use glGetStringi(), it makes
better sense to modify this function because getExtensions() returns
a string. Building up a string just to split it up again is silly, so
modifying this function instead makes more sense.
* platform/graphics/opengl/Extensions3DOpenGLCommon.h:
* platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
(WebCore::GraphicsContext3D::getIntegerv): GL_MAX_VARYING_FLOATS is
removed in OpenGL 3.2 contexts. However, it is replaced by
GL_MAX_VARYING_COMPONENTS, though this is deprecated but not removed.
In the more recent OpenGL context versions, GL_MAX_VARYING_VECTORS is
recommended instead, but that isn't available in OpenGL 3.2.
(WebCore::GraphicsContext3D::getExtensions):
2016-10-27 Megan Gardner <megan_gardner@apple.com>
Add support for wide gamut for ShareableBitmap for image popovers
https://bugs.webkit.org/show_bug.cgi?id=164001
Reviewed by Simon Fraser.
Add a function to return a CGColorSpaceRef for extended sRGB.
This is currently untestable, so no tests added.
* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::extendedSRGBColorSpaceRef):
2016-10-25 Brent Fulgham <bfulgham@apple.com>
[Win][Direct2D] Create a RAII Helper Class for the Render Target
https://bugs.webkit.org/show_bug.cgi?id=164005
Reviewed by Alex Christensen.
Tested by existing SVG, image, and Canvas layout tests.
* platform/graphics/GraphicsContext.h:
* platform/graphics/win/GradientDirect2D.cpp:
(WebCore::Gradient::fill): Use new convenience helper class.
* platform/graphics/win/GraphicsContextDirect2D.cpp:
(WebCore::GraphicsContext::didBeginDraw):
(WebCore::GraphicsContextPlatformPrivate::GraphicsContextPlatformPrivate):
(WebCore::GraphicsContextPlatformPrivate::~GraphicsContextPlatformPrivate): Add an
assertion that we are in a valid state when cleaning up the graphics context.
(WebCore::GraphicsContextPlatformPrivate::clip): Clipping can only happen in a Draw operation.
Open a new BeginDraw if asked to Clip. The Begin must stay active when this method returns,
as the Clip layer is only valid during a Draw operation.
(WebCore::GraphicsContextPlatformPrivate::beginDraw): Added.
(WebCore::GraphicsContextPlatformPrivate::endDraw): Added.
(WebCore::GraphicsContext::beginDrawIfNeeded): Added.
(WebCore::GraphicsContext::endDraw): Added.
(WebCore::GraphicsContext::drawWithoutShadow): Revise to use new RenderTargetHelper class.
(WebCore::GraphicsContext::drawWithShadow): Ditto.
(WebCore::GraphicsContext::platformFillRoundedRect): Ditto.
(WebCore::GraphicsContext::fillRectWithRoundedHole): Ditto.
(WebCore::GraphicsContext::setDidBeginDraw): Deleted.
* platform/graphics/win/GraphicsContextPlatformPrivateDirect2D.h:
(WebCore::GraphicsContextPlatformPrivate::didBeginDraw): Revise to use count instead of
a separate boolean.
* platform/graphics/win/ImageBufferDataDirect2D.cpp:
(WebCore::ImageBufferData::getData): Revise to use new RenderTargetHelper class.
* platform/graphics/win/NativeImageDirect2D.cpp:
(WebCore::drawNativeImage): Ditto.
* platform/graphics/win/RenderTargetHelper.h: Added.
(WebCore::RenderTargetHelper::RenderTargetHelper):
(WebCore::RenderTargetHelper::~RenderTargetHelper):
(WebCore::RenderTargetHelper::endDraw):
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::nativeImage): Revise to use new RenderTargetHelper class.
2016-10-27 Wenson Hsieh <wenson_hsieh@apple.com>
Support "insertFromDrop" and "deleteByDrag" for the InputEvent spec
https://bugs.webkit.org/show_bug.cgi?id=163948
<rdar://problem/28921433>
Reviewed by Darin Adler.
Implements support for "insertFromDrop" and "deleteByDrag" inputTypes. These are fired when dragging and
dropping text in editable areas. To do this, we introduce EditActionInsertFromDrop and EditActionDeleteByDrag
(renamed from EditActionDrag, which is no longer necessary after this patch).
When moving text from an editable element to another, we will use a DeleteSelectionCommand to delete the text
from the source element and a ReplaceSelectionCommand to insert the text into the destination element. This
means that we currently fire two input events on the source and destination elements (i.e. given by the start
and end selections) after both child editing commands of the MoveSelectionCommand have been applied. Instead, we
need to fire events in this order:
1. beforeinput ("deleteByDrag") on the source
2. Update DOM
3. input ("deleteByDrag") on the source
4. beforeinput ("insertFromDrop") on the destination
5. Update DOM
6. input ("insertFromDrop") on the destination
To accomplish this, we allow an edit command to defer dispatching input events to its child commands via
CompositeEditCommand::shouldDispatchInputEvents, which the MoveSelectionCommand overrides. Additionally,
when applying the MoveSelectionCommand, we now apply() the child DeleteSelectionCommand and
ReplaceSelectionCommand instead of using doApply(). This allows these children to separately dispatch input
events, and also handle preventDefault() separately.
Tests: fast/events/before-input-events-prevent-drag-and-drop.html
fast/events/input-events-drag-and-drop.html
fast/events/input-events-insert-by-drop.html
* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::apply):
(WebCore::CompositeEditCommand::composition):
Searches for the top-level command and returns its composition. Also ASSERTs that the m_command of all child
commands along the way is null. In places where we used to ASSERT that command.composition() should be null, we
now perform the assertion here instead.
* editing/CompositeEditCommand.h:
(WebCore::CompositeEditCommand::shouldDispatchInputEvents):
This is true by default, which means that if apply() is called for a composite edit command that does not
override this to return false, it will try to dispatch input events. In most cases, the parent command will call
on the child command to doApply(), bypassing this check.
(WebCore::CompositeEditCommand::composition): Deleted.
* editing/EditAction.h:
* editing/EditCommand.cpp:
(WebCore::inputTypeNameForEditingAction):
(WebCore::EditCommand::isEditingTextAreaOrTextInput):
(WebCore::EditCommand::setStartingSelection):
(WebCore::EditCommand::setEndingSelection):
(WebCore::EditCommand::setParent):
* editing/Editor.cpp:
(WebCore::Editor::willApplyEditing):
(WebCore::Editor::appliedEditing):
After applying editing, only adjust the current selection and notify clients of selection change if the applied
command was a top-level command; otherwise, these actions should wait until all child commands of the top-level
command have been applied. In particular, we should not register the applied command as an undo step.
* editing/MoveSelectionCommand.cpp:
(WebCore::MoveSelectionCommand::doApply):
(WebCore::MoveSelectionCommand::editingAction):
* editing/MoveSelectionCommand.h:
* page/DragController.cpp:
(WebCore::DragController::concludeEditDrag):
For the cases where we're not deleting text from the drag source (i.e. we're just applying a
ReplaceSelectionCommand) pass in EditActionInsertFromDrop as the EditAction when creating the command.
2016-10-27 Per Arne Vollan <pvollan@apple.com>
[Win][Direct2D] Implement GraphicsContext::releaseWindowsContext.
https://bugs.webkit.org/show_bug.cgi?id=163988
Reviewed by Brent Fulgham.
This method is needed to draw native controls.
* platform/graphics/win/GraphicsContextDirect2D.cpp:
(WebCore::GraphicsContext::releaseWindowsContext):
2016-10-27 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Worker should recover if Inspector is closed and never sent Worker.initialized command
https://bugs.webkit.org/show_bug.cgi?id=164073
Reviewed by Brian Burg.
Test: inspector/worker/worker-recover-if-inspector-close.html
* workers/WorkerInspectorProxy.cpp:
(WebCore::WorkerInspectorProxy::disconnectFromWorkerInspectorController):
Ensure we stop the debugger only task loop if needed when the last debugger
message comes in.
2016-10-27 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Include ConsoleAgent in Workers - real console.log support
https://bugs.webkit.org/show_bug.cgi?id=163844
<rdar://problem/28903328>
Reviewed by Brian Burg.
Test: inspector/worker/console-basic.html
This introduces a real ConsoleAgent in the Worker InspectorController.
We no longer need to pass partial ConsoleMessage objects to be logged
through the Page, we can just send the full ConsoleMessages to a
frontend once it connects to the Worker.
In order to guarantee that the Worker InspectorController is properly
all Workers will start paused if there is an Inspector attached to
the Page. The frontend _must_ call the new Worker.initialized method
after sending its setup commands to the Worker. This ensures we get
handle all initialization commands (like Agent.enable(), and
setting state like breakpoints) before any script executes in the
Worker. This mirrors the Inspector.initialized method that does the
same thing for JSContext auto-attach of the Main target.
In the backend, the wait until initialized state is just running
the WorkerThread's RunLoop in a special debugger mode to only process
debugger commands until we are ready. This will effectively be
the same as pausing so it is generalized into WorkerThread.
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* inspector/InspectorAllInOne.cpp:
New files.
* inspector/InspectorWorkerAgent.cpp:
(WebCore::InspectorWorkerAgent::initialized):
(WebCore::InspectorWorkerAgent::shouldWaitForDebuggerOnStart):
* inspector/InspectorWorkerAgent.h:
Add the new initialized method. This just uses the proxy to send
a message to be handled on the Worker Thread and unpause.
* inspector/WorkerConsoleAgent.cpp:
(WebCore::WorkerConsoleAgent::WorkerConsoleAgent):
(WebCore::WorkerConsoleAgent::addInspectedNode):
* inspector/WorkerConsoleAgent.h:
* inspector/WorkerInspectorController.cpp:
(WebCore::WorkerInspectorController::WorkerInspectorController):
Add a ConsoleAgent to WorkerInspectorController.
* workers/WorkerInspectorProxy.h:
* workers/WorkerInspectorProxy.cpp:
(WebCore::WorkerInspectorProxy::workerStartMode):
(WebCore::WorkerInspectorProxy::resumeWorkerIfPaused):
(WebCore::WorkerInspectorProxy::connectToWorkerInspector):
(WebCore::WorkerInspectorProxy::disconnectFromWorkerInspector):
(WebCore::WorkerInspectorProxy::sendMessageToWorkerInspector):
Use the debugger mode when sending messages to the WorkerThread.
* workers/Worker.cpp:
(WebCore::Worker::notifyFinished):
* workers/WorkerMessagingProxy.cpp:
(WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
(WebCore::WorkerMessagingProxy::postConsoleMessageToWorkerObject): Deleted.
* workers/WorkerMessagingProxy.h:
* workers/WorkerReportingProxy.h:
* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::addConsoleMessage):
(WebCore::WorkerGlobalScope::addMessage):
* workers/WorkerGlobalScope.h:
* workers/WorkerGlobalScopeProxy.h:
Remove legacy partial console support.
* workers/WorkerRunLoop.h:
* workers/WorkerRunLoop.cpp:
(WebCore::WorkerRunLoop::debuggerMode):
* workers/WorkerThread.h:
* workers/WorkerThread.cpp:
(WebCore::WorkerThread::workerThread):
(WebCore::WorkerThread::startRunningDebuggerTasks):
(WebCore::WorkerThread::stopRunningDebuggerTasks):
General code for spinning the WorkerThread and only processing debugger
(Inspector) commands. Use this when starting the thread to ensure the
frontend initializes the Worker's Agents before any JavaScript executes.
* page/PageConsoleClient.cpp:
* workers/WorkerConsoleClient.cpp:
(WebCore::WorkerConsoleClient::count):
(WebCore::WorkerConsoleClient::time):
(WebCore::WorkerConsoleClient::timeEnd):
* inspector/InspectorConsoleInstrumentation.h: Removed.
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::startConsoleTimingImpl):
(WebCore::InspectorInstrumentation::stopConsoleTimingImpl):
(WebCore::InspectorInstrumentation::shouldWaitForDebuggerOnStartImpl):
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::shouldWaitForDebuggerOnStart):
(WebCore::InspectorInstrumentation::addMessageToConsole):
(WebCore::InspectorInstrumentation::consoleCount):
(WebCore::InspectorInstrumentation::takeHeapSnapshot):
(WebCore::InspectorInstrumentation::startConsoleTiming):
(WebCore::InspectorInstrumentation::stopConsoleTiming):
(WebCore::InspectorInstrumentation::consoleTimeStamp):
(WebCore::InspectorInstrumentation::startProfiling):
(WebCore::InspectorInstrumentation::stopProfiling):
Implement a few more basic console APIs that required ConsoleAgent.
2016-10-27 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Include RuntimeAgent in Workers - evaluate in Worker context
https://bugs.webkit.org/show_bug.cgi?id=163835
<rdar://problem/28901465>
Reviewed by Brian Burg.
Tests: inspector/unit-tests/target-manager.html
inspector/worker/runtime-basic.html
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* inspector/InspectorAllInOne.cpp:
New file.
* inspector/InspectorWebAgentBase.h:
(WebCore::WorkerAgentContext::WorkerAgentContext):
New agent context creation struct for Workers.
* inspector/WorkerInspectorController.cpp:
(WebCore::WorkerInspectorController::WorkerInspectorController):
Create a RuntimeAgent for Workers.
* inspector/WorkerRuntimeAgent.cpp: Added.
(WebCore::WorkerRuntimeAgent::WorkerRuntimeAgent):
(WebCore::WorkerRuntimeAgent::didCreateFrontendAndBackend):
(WebCore::WorkerRuntimeAgent::willDestroyFrontendAndBackend):
(WebCore::WorkerRuntimeAgent::injectedScriptForEval):
* inspector/WorkerRuntimeAgent.h: Added.
Workers currently only ever have a single execution context.
2016-10-27 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Introduce Page WorkerAgent and Worker InspectorController
https://bugs.webkit.org/show_bug.cgi?id=163817
<rdar://problem/28899063>
Reviewed by Brian Burg.
Test: inspector/worker/worker-create-and-terminate.html
From the perspective of an Inspector frontend, Workers are
like a special JavaScript context, separate from the page, that
may have its own set of Agents. This patch adds the necessary
backend infrastructure to provide WorkerGlobalObject with an
InspectorController and the means to communicate with a frontend
through a Page's WorkerAgent.
Pages now get a WorkerAgent. This informs the frontend about
created and terminated Workers. It also provides a communication
channel to dispatch and return inspector protocol messages to
each of the Workers. The Page side always interacts with the
WorkerInspectorProxy on the main thread. The Page's Worker Agent
can sends and receives messages to WorkerInspectorControllers.
WorkerGlobalScopes now get a WorkerInspectorController which
will eventually contain its own set of agents. There are no
agents yet, but they will be added individually in follow-up
patches. The Worker side always interacts with the
WorkerGlobalScope on the worker thread. WorkerInspectorController
dispatches messages on its agents.
All communication with Worker agents goes through Worker.sendMessageToWorker,
which tunnels the command request to the Worker's InspectorController
and agents. At the protocol level, worker agent command responses and
worker agent events are sent as events through Worker.dispatchMessageFromWorker.
On the frontend, the message dispatcher code will pair up replies with
their commands, and no-reply messages as events, like normal. So calling
worker agent methods in the frontend will be no different from the
existing callback/promise-based ways.
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* inspector/InspectorAllInOne.cpp:
Add new files.
* bindings/js/WorkerScriptController.cpp:
(WebCore::WorkerScriptController::WorkerScriptController):
(WebCore::WorkerScriptController::initScript):
* bindings/js/WorkerScriptController.h:
Some cleanup.
* inspector/InspectorController.cpp:
(WebCore::InspectorController::InspectorController):
* inspector/InspectorController.h:
* inspector/InstrumentingAgents.cpp:
(WebCore::InstrumentingAgents::reset):
* inspector/InstrumentingAgents.h:
(WebCore::InstrumentingAgents::inspectorWorkerAgent):
(WebCore::InstrumentingAgents::setInspectorWorkerAgent):
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::workerStartedImpl):
(WebCore::InspectorInstrumentation::workerTerminatedImpl):
(WebCore::InspectorInstrumentation::instrumentingAgentsForWorkerGlobalScope):
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::workerStarted):
(WebCore::InspectorInstrumentation::workerTerminated):
(WebCore::InspectorInstrumentation::instrumentingAgentsForContext):
Give the Page a WorkerAgent and Instrumentation methods for
Worker creation and termination.
* inspector/InspectorWorkerAgent.h: Added.
* inspector/InspectorWorkerAgent.cpp: Added.
(WebCore::InspectorWorkerAgent::InspectorWorkerAgent):
(WebCore::InspectorWorkerAgent::didCreateFrontendAndBackend):
(WebCore::InspectorWorkerAgent::willDestroyFrontendAndBackend):
(WebCore::InspectorWorkerAgent::enable):
(WebCore::InspectorWorkerAgent::disable):
(WebCore::InspectorWorkerAgent::workerStarted):
(WebCore::InspectorWorkerAgent::workerTerminated):
(WebCore::InspectorWorkerAgent::connectToAllWorkerInspectorProxiesForPage):
(WebCore::InspectorWorkerAgent::disconnectFromAllWorkerInspectorProxies):
(WebCore::InspectorWorkerAgent::connectToWorkerInspectorProxy):
(WebCore::InspectorWorkerAgent::disconnectFromWorkerInspectorProxy):
Handle connecting to Workers. This performs the "connectFrontend"
and "disconnectFrontend" dance with each Worker's InspectorController.
We only connect to workers when the Worker domain is enabled.
(WebCore::InspectorWorkerAgent::sendMessageToWorker):
(WebCore::InspectorWorkerAgent::sendMessageFromWorkerToFrontend):
Proxying messages to individual messages happens through the
WorkerInspectorProxy. That takes care of passing messages
across threads for us.
* workers/WorkerInspectorProxy.cpp: Added.
(WebCore::WorkerInspectorProxy::allWorkerInspectorProxies):
(WebCore::WorkerInspectorProxy::WorkerInspectorProxy):
(WebCore::WorkerInspectorProxy::~WorkerInspectorProxy):
(WebCore::WorkerInspectorProxy::workerStarted):
(WebCore::WorkerInspectorProxy::workerTerminated):
(WebCore::WorkerInspectorProxy::connectToWorkerInspector):
(WebCore::WorkerInspectorProxy::disconnectFromWorkerInspector):
(WebCore::WorkerInspectorProxy::sendMessageToWorkerInspector):
(WebCore::WorkerInspectorProxy::sendMessageFromWorkerToFrontend):
* workers/WorkerInspectorProxy.h: Added.
(WebCore::WorkerInspectorProxy::PageChannel::~PageChannel):
(WebCore::WorkerInspectorProxy::url):
(WebCore::WorkerInspectorProxy::identifier):
(WebCore::WorkerInspectorProxy::scriptExecutionContext):
The WorkerInspectorProxy simplifies the cross thread communication
between the Page Inspector and Worker Inspector. It also provides
a clean interface between the two sides.
* inspector/WorkerToPageFrontendChannel.h: Added.
* inspector/WorkerInspectorController.h: Added.
* inspector/WorkerInspectorController.cpp: Added.
(WebCore::WorkerInspectorController::WorkerInspectorController):
(WebCore::WorkerInspectorController::~WorkerInspectorController):
(WebCore::WorkerInspectorController::workerTerminating):
(WebCore::WorkerInspectorController::connectFrontend):
(WebCore::WorkerInspectorController::disconnectFrontend):
(WebCore::WorkerInspectorController::dispatchMessageFromFrontend):
(WebCore::WorkerInspectorController::functionCallHandler):
(WebCore::WorkerInspectorController::evaluateHandler):
(WebCore::WorkerInspectorController::vm):
A basic InspectorController for a WorkerGlobalScope.
No agents yet, they will come soon.
* inspector/WorkerScriptDebugServer.h:
* inspector/WorkerScriptDebugServer.cpp:
(WebCore::WorkerScriptDebugServer::WorkerScriptDebugServer):
(WebCore::WorkerScriptDebugServer::attachDebugger):
(WebCore::WorkerScriptDebugServer::detachDebugger):
(WebCore::WorkerScriptDebugServer::recompileAllJSFunctions):
(WebCore::WorkerScriptDebugServer::runEventLoopWhilePaused):
(WebCore::WorkerScriptDebugServer::reportException):
(WebCore::WorkerScriptDebugServer::interruptAndRunTask):
A basic WorkerScriptDebug server for a WorkerGlobalScope.
Not really used until we implement DebuggerAgent, but needed for InspectorEnvironment.
* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::WorkerGlobalScope):
* workers/WorkerGlobalScope.h:
(WebCore::WorkerGlobalScope::inspectorController):
Give the WorkerGlobalScope an InspectorController.
* workers/WorkerThread.cpp:
(WebCore::WorkerThread::stop):
Ensure the Worker InspectorController is immediately on
the WorkerThread when it is about to be closed.
* workers/WorkerMessagingProxy.cpp:
(WebCore::WorkerMessagingProxy::WorkerMessagingProxy):
(WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
(WebCore::WorkerMessagingProxy::postMessageToPageInspector):
(WebCore::WorkerMessagingProxy::workerGlobalScopeDestroyedInternal):
(WebCore::WorkerMessagingProxy::terminateWorkerGlobalScope):
* workers/WorkerMessagingProxy.h:
* workers/WorkerReportingProxy.h:
Call into the WorkerInspectorProxy for any inspector related logic,
such as creation, termination, and messages received from the Worker.
2016-10-27 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Implement CSS variables
https://bugs.webkit.org/show_bug.cgi?id=164075
Reviewed by Dean Jackson.
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
Add CSSCustomPropertyValue.cpp to the project.
* css/CSSCustomPropertyValue.cpp: Added.
(WebCore::CSSCustomPropertyValue::checkVariablesForCycles):
(WebCore::CSSCustomPropertyValue::resolveVariableReferences):
* css/CSSCustomPropertyValue.h:
These functions abstract the old and new implementations of CSS
variables so that the callers don't have to worry about it.
* css/CSSValue.cpp:
(WebCore::CSSValue::equals):
Make sure CSSVariableReferenceValue and CSSPendingSubstitutionValue
have equals implemented.
(WebCore::CSSValue::isInvalidCustomPropertyValue): Deleted.
This code was dead and never called.
* css/CSSValue.h:
(WebCore::CSSValue::isCustomPropertyValue):
(WebCore::CSSValue::hasVariableReferences):
Add a helper function for asking if a CSSValue has variable references.
This abstracts the old and new implementations so that callers can
ask if the value has variables without caring which implementation is
being used.
* css/CSSValueList.cpp:
(WebCore::CSSValueList::checkVariablesForCycles):
* css/CSSValueList.h:
In order to abstract the old and new variables implementations, custom
properties now store CSSCustomPropertyValue as their values instead of
raw values. The old implementation needs to be patched to deal with this
wrapper being present now.
* css/CSSVariableData.cpp:
(WebCore::CSSVariableData::checkVariablesForCycles):
(WebCore::CSSVariableData::checkVariablesForCyclesWithRange):
(WebCore::CSSVariableData::resolveVariableFallback):
(WebCore::CSSVariableData::resolveVariableReference):
(WebCore::CSSVariableData::resolveVariableReferences):
(WebCore::CSSVariableData::resolveTokenRange):
* css/CSSVariableData.h:
Implementation of cycle checking and variable resolution. The logic of
this implementation is the same as the old. It walks CSSParserTokens
instead of the old CSSParser structures.
* css/CSSVariableReferenceValue.cpp:
(WebCore::CSSVariableReferenceValue::customCSSText):
Add support for serialization caching, just like the old implementation
had in CSSVariableDependentValue.
(WebCore::CSSVariableReferenceValue::checkVariablesForCycles):
* css/CSSVariableReferenceValue.h:
Add cycle checking and variable resolution helper functions.
* css/CSSVariableValue.cpp:
(WebCore::CSSVariableValue::buildParserValueListSubstitutingVariables):
Patched to account for the change in storage of custom properties to
have custom property value wrappers.
* css/StyleProperties.cpp:
(WebCore::StyleProperties::getPropertyValue):
(WebCore::StyleProperties::borderSpacingValue):
(WebCore::StyleProperties::getLayeredShorthandValue):
(WebCore::StyleProperties::getShorthandValue):
(WebCore::StyleProperties::getCommonValue):
(WebCore::StyleProperties::getPropertyCSSValue):
(WebCore::StyleProperties::asText):
Clean up the resolution of pending substitution values. Instead of hacking
it into every possible StyleShorthandProperty crawling function, obtain
the shorthand for the property up front, access the first longhand, and
if we see a pending substitution value, perform the substitution.
* css/StyleResolver.cpp:
(WebCore::StyleResolver::MatchResult::addMatchedProperties):
(WebCore::StyleResolver::applyProperty):
(WebCore::StyleResolver::resolvedVariableValue):
* css/StyleResolver.h:
Add support for the new implementation in all the same places as the old.
* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parseInlineStyleDeclaration):
(WebCore::CSSParser::parseValueWithVariableReferences):
(WebCore::CSSParser::parseVariableDependentValue): Deleted.
* css/parser/CSSParser.h:
Rename parseVariableDependentValue to parseValueWithVariableReferences,
since it is operating on three distinct value types now. Turn on new
parser support for parseInlineStyleDeclaration.
* css/parser/CSSParserImpl.cpp:
(WebCore::filterProperties):
(WebCore::CSSParserImpl::parseVariableValue): Deleted.
(WebCore::CSSParserImpl::parseCustomPropertySet): Deleted.
* css/parser/CSSParserImpl.h:
Remove parser functions that aren't relevant to our implementation
of CSS variables.
* css/parser/CSSVariableParser.cpp:
(WebCore::classifyVariableRange):
Add support for the CSS4 'revert' keyword to the new variable parser.
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::checkVariablesInCustomProperties):
Modified to store CSSCustomPropertyValues as the values always now and
to use the method abstractions on CSSCustomPropertyValue to resolve
cycles and perform substitutions.
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::setCustomPropertyValue):
(WebCore::RenderStyle::getCustomPropertyValue):
* rendering/style/StyleCustomPropertyData.h:
(WebCore::StyleCustomPropertyData::operator==):
(WebCore::StyleCustomPropertyData::setCustomPropertyValue):
(WebCore::StyleCustomPropertyData::getCustomPropertyValue):
Tighten up the map to store CSSCustomPropertyValue instead of just
CSSValue.
2016-10-27 Zalan Bujtas <zalan@apple.com>
RenderMultiColumnFlowThread::processPossibleSpannerDescendant should take RenderObject& instead of RenderObject*
https://bugs.webkit.org/show_bug.cgi?id=164072
Reviewed by Simon Fraser.
No change in functionality.
* rendering/RenderFlowThread.h:
* rendering/RenderMultiColumnFlowThread.cpp:
(WebCore::findSetRendering):
(WebCore::isValidColumnSpanner):
(WebCore::RenderMultiColumnFlowThread::processPossibleSpannerDescendant):
(WebCore::RenderMultiColumnFlowThread::flowThreadDescendantInserted):
(WebCore::RenderMultiColumnFlowThread::findSetRendering): Deleted.
* rendering/RenderMultiColumnFlowThread.h:
* rendering/RenderMultiColumnSet.cpp:
(WebCore::precedesRenderer):
(WebCore::RenderMultiColumnSet::containsRendererInFlowThread):
* rendering/RenderMultiColumnSet.h:
* rendering/RenderMultiColumnSpannerPlaceholder.cpp:
(WebCore::RenderMultiColumnSpannerPlaceholder::createAnonymous):
(WebCore::RenderMultiColumnSpannerPlaceholder::RenderMultiColumnSpannerPlaceholder):
* rendering/RenderMultiColumnSpannerPlaceholder.h:
* rendering/RenderObject.cpp:
(WebCore::RenderObject::insertedIntoTree):
2016-10-27 Brent Fulgham <bfulgham@apple.com>
Prevent hit tests from being performed on an invalid render tree
https://bugs.webkit.org/show_bug.cgi?id=163877
<rdar://problem/28675761>
Reviewed by Simon Fraser.
Changeset r200971 added code to ensure that layout is up-to-date before hit testing, but did
so only for the main frame. It was still possible to enter cross-frame hit testing with a
subframe needing style recalc. In that situation, the subframe's updateLayout() would get
called, which could trigger a compositing change that marked the parent frame as needing style
recalc. A subsequent layout on the parent frame (for example by hit testing traversing into
a second subframe) could then mutate the parent frame's layer tree while hit testing was
traversing it.
This patch modifies the hit test logic to ensure that a recursive layout is performed so that
we always perform hit tests on a clean set of frames. It also adds some assertions to warn
us if we encounter this invalid state.
Tested by fast/layers/prevent-hit-test-during-layout.html.
* dom/Document.cpp:
(WebCore::Document::scheduleStyleRecalc): Assert that we are not hit testing
during style recalculation.
* page/EventHandler.cpp:
(WebCore::EventHandler::hitTestResultAtPoint): Ensure that we have a clean render tree
when hit testing.
* page/FrameView.cpp:
(WebCore::FrameView::setNeedsLayout): Assert that we are not in the process of hit testing
when we schedule a layout.
* rendering/RenderView.cpp:
(WebCore::RenderView::hitTest): Mark RenderView as in an active hit test.
* rendering/RenderView.h:
2016-10-27 Zan Dobersek <zdobersek@igalia.com>
BufferSource should behave as an union
https://bugs.webkit.org/show_bug.cgi?id=164056
Reviewed by Chris Dumez.
WebIDL typedefs BufferSource as (ArrayBufferView or ArrayBuffer).
To follow that definition, IDLBufferSource is now type-aliased
to IDLUnion<IDLInterface<ArrayBufferView>, IDLInterface<ArrayBuffer>>.
Converter<IDLBufferSource> template specialization can now be
removed since the default specialization for IDLUnion will be
used.
C++ implementations still work through a BufferSource object.
That class now has an implicit constructor that consumes the
Variant object. The data() and length() methods on the class
now iterate the variant to find an existing object that can
provide a pointer to the data or the length of it.
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::appendBuffer):
* bindings/generic/IDLTypes.h:
* bindings/js/BufferSource.h:
(WebCore::BufferSource::BufferSource):
(WebCore::BufferSource::data):
(WebCore::BufferSource::length):
* bindings/js/JSDOMConvert.h:
(WebCore::Converter<IDLBufferSource>::convert): Deleted.
2016-10-27 Chris Dumez <cdumez@apple.com>
Merge Element::ShadowRootMode and ShadowRoot::Mode enumerations
https://bugs.webkit.org/show_bug.cgi?id=164063
Reviewed by Sam Weinig.
Merge Element::ShadowRootMode and ShadowRoot::Mode enumerations now
that we support having IDL string enumerations in their own IDL file.
No new tests, no Web-exposed behavior change.
* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* css/ElementRuleCollector.cpp:
(WebCore::ElementRuleCollector::collectMatchingRules):
(WebCore::ElementRuleCollector::matchAuthorShadowPseudoElementRules):
(WebCore::ElementRuleCollector::collectMatchingShadowPseudoElementRules):
* css/SelectorChecker.cpp:
(WebCore::SelectorChecker::matchRecursively):
* dom/CustomElementRegistry.cpp:
(WebCore::enqueueUpgradeInShadowIncludingTreeOrder):
* dom/Element.cpp:
(WebCore::Element::bindingsOffsetParent):
(WebCore::Element::addShadowRoot):
(WebCore::Element::attachShadow):
(WebCore::Element::shadowRootForBindings):
(WebCore::Element::userAgentShadowRoot):
(WebCore::Element::ensureUserAgentShadowRoot):
* dom/Element.h:
* dom/Element.idl:
* dom/InlineStyleSheetOwner.cpp:
(WebCore::parserContextForElement):
* dom/Node.cpp:
(WebCore::Node::isUnclosedNode):
(WebCore::Node::assignedSlotForBindings):
(WebCore::Node::isInUserAgentShadowTree):
* dom/ShadowRoot.cpp:
(WebCore::ShadowRoot::ShadowRoot):
* dom/ShadowRoot.h:
* dom/ShadowRoot.idl:
* dom/ShadowRootMode.h: Added.
* dom/ShadowRootMode.idl: Copied from Source/WebCore/dom/ShadowRoot.idl.
* dom/SlotAssignment.cpp:
(WebCore::SlotAssignment::didChangeSlot):
* html/HTMLSummaryElement.cpp:
(WebCore::HTMLSummaryElement::create):
* inspector/InspectorDOMAgent.cpp:
(WebCore::shadowRootType):
* rendering/HitTestResult.cpp:
(WebCore::moveOutOfUserAgentShadowTree):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::selectionPseudoStyle):
* rendering/RenderLayer.cpp:
(WebCore::rendererForScrollbar):
* style/StyleScope.cpp:
(WebCore::Style::Scope::shouldUseSharedUserAgentShadowTreeStyleResolver):
(WebCore::Style::Scope::didChangeStyleSheetEnvironment):
* svg/SVGElement.cpp:
(WebCore::SVGElement::correspondingUseElement):
* testing/Internals.cpp:
(WebCore::Internals::shadowRootType):
2016-10-27 Chris Dumez <cdumez@apple.com>
Element parameter to CanvasRenderingContext2D.drawFocusIfNeeded() should not be nullable
https://bugs.webkit.org/show_bug.cgi?id=164062
Reviewed by Darin Adler.
Element parameter to CanvasRenderingContext2D.drawFocusIfNeeded() should not be nullable:
- https://html.spec.whatwg.org/#canvasuserinterface
Firefox and Chrome agree with the specification.
Test: fast/canvas/draw-focus-if-needed-null-element.html
* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::drawFocusIfNeeded):
(WebCore::CanvasRenderingContext2D::drawFocusIfNeededInternal):
* html/canvas/CanvasRenderingContext2D.h:
* html/canvas/CanvasRenderingContext2D.idl:
2016-10-27 Yusuke Suzuki <utatane.tea@gmail.com>
[DOMJIT][CSSJIT] Share code with DOMJIT
https://bugs.webkit.org/show_bug.cgi?id=164006
Reviewed by Mark Lam.
Move CSSJIT's getDocument function to DOMJIT and share it with DOMJIT.
And rename it to "loadDocument", it is closer name to the JSC's convention.
No behavior change.
* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateSpecialFailureInQuirksModeForActiveAndHoverIfNeeded):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeValueExactMatching):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementHasTagName):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsRoot):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsScopeRoot):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsTarget):
(WebCore::SelectorCompiler::getDocument): Deleted.
* domjit/DOMJITHelpers.h:
(WebCore::DOMJIT::loadDocument):
* domjit/JSNodeDOMJIT.cpp:
(WebCore::NodeOwnerDocumentDOMJIT::callDOM):
2016-10-27 Youenn Fablet <youenn@apple.com>
REGRESSION(r207753-207755): ASSERTION FAILED: m_parsedStyleSheetCache->isInMemoryCache()
https://bugs.webkit.org/show_bug.cgi?id=163905
Reviewed by Antti Koivisto.
Covered by existing tests and http/tests/security/cached-cross-origin-shared-css-stylesheet.html
Small refactoring to do more member fields initialization in StyleSheetContents header.
Refactored StyleSheetContents::m_isInMemoryCache to be a counter instead of a boolean.
This allows StyleSheetContents to be linked to several CachedCSSStyleSheets.
* css/StyleSheetContents.cpp:
(WebCore::StyleSheetContents::StyleSheetContents):
(WebCore::StyleSheetContents::addedToMemoryCache):
(WebCore::StyleSheetContents::removedFromMemoryCache):
* css/StyleSheetContents.h:
* loader/cache/CachedCSSStyleSheet.cpp:
(WebCore::CachedCSSStyleSheet::setBodyDataFrom): Making reuse of saveParsedStyleSheet to handle update of StyleSheetContents cache count.
2016-10-27 Sergio Villar Senin <svillar@igalia.com>
Unreviewed. Build fix for gcc.
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
(WebCore::MediaPlayerPrivateGStreamerMSE::maxTimeSeekable):
2016-10-27 Youenn Fablet <youenn@apple.com>
MediaPayload does not need to be refcounted
https://bugs.webkit.org/show_bug.cgi?id=164015
Reviewed by Eric Carlson.
No change of behavior.
Making MediaPayload a struct and no-longer ref-counted.
Small performance improvements in MediaEndpointOwr.
* Modules/mediastream/MediaEndpointPeerConnection.h:
* Modules/mediastream/SDPProcessor.cpp:
(WebCore::configurationFromJSON):
(WebCore::configurationToJSON):
* platform/mediastream/MediaEndpoint.h:
* platform/mediastream/MediaPayload.h:
(WebCore::MediaPayload::addParameter):
(WebCore::MediaPayload::create): Deleted.
(WebCore::MediaPayload::~MediaPayload): Deleted.
(WebCore::MediaPayload::type): Deleted.
(WebCore::MediaPayload::setType): Deleted.
(WebCore::MediaPayload::encodingName): Deleted.
(WebCore::MediaPayload::setEncodingName): Deleted.
(WebCore::MediaPayload::clockRate): Deleted.
(WebCore::MediaPayload::setClockRate): Deleted.
(WebCore::MediaPayload::channels): Deleted.
(WebCore::MediaPayload::setChannels): Deleted.
(WebCore::MediaPayload::ccmfir): Deleted.
(WebCore::MediaPayload::setCcmfir): Deleted.
(WebCore::MediaPayload::nackpli): Deleted.
(WebCore::MediaPayload::setNackpli): Deleted.
(WebCore::MediaPayload::nack): Deleted.
(WebCore::MediaPayload::setNack): Deleted.
(WebCore::MediaPayload::parameters): Deleted.
(WebCore::MediaPayload::clone): Deleted.
(WebCore::MediaPayload::MediaPayload): Deleted.
* platform/mediastream/PeerMediaDescription.h:
(WebCore::PeerMediaDescription::payloads):
(WebCore::PeerMediaDescription::addPayload):
(WebCore::PeerMediaDescription::setPayloads):
(WebCore::PeerMediaDescription::clone):
* platform/mediastream/openwebrtc/MediaEndpointOwr.cpp:
(WebCore::MediaEndpointOwr::getDefaultAudioPayloads):
(WebCore::MediaEndpointOwr::getDefaultVideoPayloads):
(WebCore::MediaEndpointOwr::filterPayloads):
* platform/mock/MockMediaEndpoint.cpp:
(WebCore::MockMediaEndpoint::getDefaultAudioPayloads):
(WebCore::MockMediaEndpoint::getDefaultVideoPayloads):
(WebCore::MockMediaEndpoint::filterPayloads):
2016-10-26 Dan Bernstein <mitz@apple.com>
Improved the last build fix.
Darin pointed out I could have kept the function inline and just removed the WEBCORE_EXPORT.
* Modules/mediastream/UserMediaRequest.cpp:
(WebCore::UserMediaRequest::document): Deleted.
* Modules/mediastream/UserMediaRequest.h:
(WebCore::UserMediaRequest::document):
2016-10-26 Chris Dumez <cdumez@apple.com>
[Web IDL] Add support for having string enumerations in their own IDL file
https://bugs.webkit.org/show_bug.cgi?id=164025
Reviewed by Darin Adler.
Add support for having string enumerations in their own IDL file to facilitate
sharing them. Use this new support to implement IDBTransactionMode enumeration
for IndexedDB:
- https://www.w3.org/TR/IndexedDB/#idl-def-IDBTransactionMode
No new tests, rebaselined existing tests.
* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.make:
* Modules/indexeddb/IDBDatabase.cpp:
(WebCore::IDBDatabase::transaction):
(WebCore::IDBDatabase::startVersionChangeTransaction):
* Modules/indexeddb/IDBDatabase.h:
* Modules/indexeddb/IDBDatabase.idl:
* Modules/indexeddb/IDBOpenDBRequest.cpp:
(WebCore::IDBOpenDBRequest::onUpgradeNeeded):
* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::IDBTransaction):
* Modules/indexeddb/IDBTransaction.h:
(WebCore::IDBTransaction::mode):
(WebCore::IDBTransaction::isVersionChange):
(WebCore::IDBTransaction::isReadOnly):
* Modules/indexeddb/IDBTransaction.idl:
* Modules/indexeddb/IDBTransactionMode.h: Added.
* Modules/indexeddb/IDBTransactionMode.idl: Copied from Source/WebCore/Modules/indexeddb/IDBTransaction.idl.
* Modules/indexeddb/IndexedDB.h:
* Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
(WebCore::IDBServer::MemoryBackingStoreTransaction::MemoryBackingStoreTransaction):
(WebCore::IDBServer::MemoryBackingStoreTransaction::objectStoreRenamed):
(WebCore::IDBServer::MemoryBackingStoreTransaction::indexRenamed):
(WebCore::IDBServer::MemoryBackingStoreTransaction::abort):
* Modules/indexeddb/server/MemoryBackingStoreTransaction.h:
(WebCore::IDBServer::MemoryBackingStoreTransaction::isVersionChange):
(WebCore::IDBServer::MemoryBackingStoreTransaction::isWriting):
* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::beginTransaction):
(WebCore::IDBServer::SQLiteIDBBackingStore::abortTransaction):
(WebCore::IDBServer::SQLiteIDBBackingStore::commitTransaction):
(WebCore::IDBServer::SQLiteIDBBackingStore::createObjectStore):
(WebCore::IDBServer::SQLiteIDBBackingStore::deleteObjectStore):
(WebCore::IDBServer::SQLiteIDBBackingStore::renameObjectStore):
(WebCore::IDBServer::SQLiteIDBBackingStore::clearObjectStore):
(WebCore::IDBServer::SQLiteIDBBackingStore::createIndex):
(WebCore::IDBServer::SQLiteIDBBackingStore::deleteIndex):
(WebCore::IDBServer::SQLiteIDBBackingStore::renameIndex):
(WebCore::IDBServer::SQLiteIDBBackingStore::deleteRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::deleteRange):
(WebCore::IDBServer::SQLiteIDBBackingStore::addRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::generateKeyNumber):
(WebCore::IDBServer::SQLiteIDBBackingStore::revertGeneratedKeyNumber):
(WebCore::IDBServer::SQLiteIDBBackingStore::maybeUpdateKeyGeneratorNumber):
* Modules/indexeddb/server/SQLiteIDBTransaction.cpp:
(WebCore::IDBServer::SQLiteIDBTransaction::begin):
* Modules/indexeddb/server/SQLiteIDBTransaction.h:
(WebCore::IDBServer::SQLiteIDBTransaction::mode):
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::enqueueTransaction):
(WebCore::IDBServer::UniqueIDBDatabase::takeNextRunnableTransaction):
* Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
(WebCore::IDBServer::UniqueIDBDatabaseConnection::establishTransaction):
* Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::UniqueIDBDatabaseTransaction):
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::originalDatabaseInfo):
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::isVersionChange):
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::isReadOnly):
* Modules/indexeddb/shared/IDBTransactionInfo.cpp:
(WebCore::IDBTransactionInfo::clientTransaction):
(WebCore::IDBTransactionInfo::versionChange):
(WebCore::IDBTransactionInfo::loggingString):
* Modules/indexeddb/shared/IDBTransactionInfo.h:
(WebCore::IDBTransactionInfo::mode):
* WebCore.xcodeproj/project.pbxproj:
* bindings/scripts/CodeGenerator.pm:
(ProcessDocument):
(IsEnumType):
(GetEnumByName):
(IsExternalEnumType):
(ValidEnumValues):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateEnumeration):
(AddToImplIncludesForIDLType):
(GetEnumerationClassName):
(GenerateEnumerationHeader):
(GenerateEnumerationImplementation):
(GenerateEnumerationImplementationContent):
(GenerateEnumerationsImplementationContent):
(GenerateEnumerationHeaderContent):
(GenerateEnumerationsHeaderContent):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjPrototypeFunctionMethodWithEnumArgCaller):
(WebCore::jsTestObjPrototypeFunctionMethodWithStandaloneEnumArg):
(WebCore::jsTestObjPrototypeFunctionMethodWithStandaloneEnumArgCaller):
* bindings/scripts/test/JS/JSTestStandaloneEnumeration.cpp: Added.
(WebCore::convertEnumerationToJS):
(WebCore::parseEnumeration<TestStandaloneEnumeration>):
(WebCore::convertEnumeration<TestStandaloneEnumeration>):
(WebCore::expectedEnumerationValues<TestStandaloneEnumeration>):
* bindings/scripts/test/JS/JSTestStandaloneEnumeration.h: Added.
* bindings/scripts/test/TestObj.idl:
* bindings/scripts/test/TestStandaloneEnumeration.idl: Copied from Source/WebCore/Modules/indexeddb/IDBTransaction.idl.
* inspector/InspectorIndexedDBAgent.cpp:
2016-10-26 Dan Bernstein <mitz@apple.com>
Fixed the WebKit2 build.
* Modules/mediastream/UserMediaRequest.cpp:
(WebCore::UserMediaRequest::document): Moved the definition of this function to here from…
* Modules/mediastream/UserMediaRequest.h:
(WebCore::UserMediaRequest::document): …here, so that the WebKit2 build doesn’t encounter an
exported inline function.
2016-10-26 Yusuke Suzuki <utatane.tea@gmail.com>
[DOMJIT] Implement Node::ownerDocument
https://bugs.webkit.org/show_bug.cgi?id=164004
Reviewed by Darin Adler.
Test: js/dom/domjit-accessor-owner-document.html
Implement Node.ownerDocument DOMJIT accessor.
According to the result of the profiler, jQuery's prop()
function is frequently called in Ember.js SpeedoMeter.
And this function calls jQuery.isXMLDoc(). And this isXMLDoc()
function calls element.ownerDocument accessor. And our WebKit
inspector also uses ownerDocument accessor frequently.
Interesting thing is this ownerDocument functionality is used
in CSSJIT, so CSSJIT has similar helper function to look up the
owner document of the element. As a result, all the necessary
functionality is already implemented, DOMJIT just utilizes it.
For example, Node::treeScopeMemoryOffset() and
TreeScope::documentScopeMemoryOffset() is implemented before this
patch.
In the future, we will convert CSSJIT's Assembler& to CCallHelpers&
and share the code with DOMJIT[1].
[1]: https://bugs.webkit.org/show_bug.cgi?id=164006
* dom/Node.idl:
* domjit/DOMJITAbstractHeapRepository.h:
* domjit/JSNodeDOMJIT.cpp:
(WebCore::NodeOwnerDocumentDOMJIT::checkDOM):
(WebCore::NodeOwnerDocumentDOMJIT::callDOM):
2016-10-26 Chris Dumez <cdumez@apple.com>
Replace IDBKeyPath with a WTF::Variant
https://bugs.webkit.org/show_bug.cgi?id=163909
Reviewed by Darin Adler.
Replace IDBKeyPath class with the IDBKeyPathVariant type entirely
and rename IDBKeyPathVariant to IDBKeyPath.
Unfortunately, IDBKeyPath still needs some special handling when
returned to the JavaScript because we do not have a toJS() accepting
a WTF::Variant as input yet.
There should be no significant behavior change except that
IDBIndex.keyPath / IDBObjectStore.keyPath now returns an array of
Strings instead of a DOMStringList object when the IDBKeyPath
contains a vector. This is a progression and matches the
specification:
- https://www.w3.org/TR/IndexedDB/#widl-IDBIndex-keyPath
- https://www.w3.org/TR/IndexedDB/#widl-IDBObjectStore-keyPath
No new tests, rebaselined existing tests.
* Modules/indexeddb/IDBCursor.cpp:
(WebCore::IDBCursor::update):
* Modules/indexeddb/IDBDatabase.h:
* Modules/indexeddb/IDBGetResult.cpp:
(WebCore::IDBGetResult::isolatedCopy):
* Modules/indexeddb/IDBKeyPath.cpp:
(WebCore::isIDBKeyPathValid):
(WebCore::IDBKeyPathIsolatedCopy):
* Modules/indexeddb/IDBKeyPath.h:
(WebCore::IDBKeyPathIsolatedCopy):
* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::keyPath):
(WebCore::IDBObjectStore::putOrAdd):
(WebCore::IDBObjectStore::createIndex):
* Modules/indexeddb/IDBObjectStore.h:
* Modules/indexeddb/server/IDBSerialization.cpp:
(WebCore::serializeIDBKeyPath):
(WebCore::deserializeIDBKeyPath):
* Modules/indexeddb/server/IDBSerialization.h:
* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::extractExistingDatabaseInfo):
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd):
* Modules/indexeddb/shared/IDBDatabaseInfo.cpp:
(WebCore::IDBDatabaseInfo::createNewObjectStore):
* Modules/indexeddb/shared/IDBDatabaseInfo.h:
* Modules/indexeddb/shared/IDBIndexInfo.cpp:
(WebCore::IDBIndexInfo::IDBIndexInfo):
(WebCore::IDBIndexInfo::isolatedCopy):
* Modules/indexeddb/shared/IDBIndexInfo.h:
* Modules/indexeddb/shared/IDBObjectStoreInfo.cpp:
(WebCore::IDBObjectStoreInfo::IDBObjectStoreInfo):
(WebCore::IDBObjectStoreInfo::createNewIndex):
(WebCore::IDBObjectStoreInfo::isolatedCopy):
* Modules/indexeddb/shared/IDBObjectStoreInfo.h:
(WebCore::IDBObjectStoreInfo::keyPath):
* bindings/js/IDBBindingUtilities.cpp:
(WebCore::injectIDBKeyIntoScriptValue):
(WebCore::maybeCreateIDBKeyFromScriptValueAndKeyPath):
(WebCore::canInjectIDBKeyIntoScriptValue):
(WebCore::createKeyPathArray):
(WebCore::toJS):
* bindings/js/IDBBindingUtilities.h:
* inspector/InspectorIndexedDBAgent.cpp:
2016-10-26 Zalan Bujtas <zalan@apple.com>
Ignore out-of-flow siblings when searching for a spanner candidate.
https://bugs.webkit.org/show_bug.cgi?id=164042.
<rdar://problem/28758456>
Reviewed by Simon Fraser.
While searching for the spanner candidates in a flow thread, we have to take into account
whether renderers are in- or out-of-flow.
What it means is that while traversing the renderer tree to find the the candidate
renderer (next sibling/ancestor's next child in pre-order traversal), we have to check if the candidate
is in the same layout context too.
Test: fast/multicol/crash-when-spanner-candidate-is-out-of-flow.html
* rendering/RenderMultiColumnFlowThread.cpp:
(WebCore::spannerPlacehoderCandidate):
(WebCore::RenderMultiColumnFlowThread::processPossibleSpannerDescendant):
2016-10-26 Brian Burg <bburg@apple.com>
Web Inspector: remove unused bool return value from FrontendChannel::sendMessageToFrontend
https://bugs.webkit.org/show_bug.cgi?id=164046
Reviewed by Joseph Pecoraro.
* inspector/InspectorClient.cpp:
(WebCore::InspectorClient::doDispatchMessageOnFrontendPage):
* inspector/InspectorClient.h:
* testing/Internals.cpp:
(WebCore::InspectorStubFrontend::sendMessageToFrontend):
2016-10-26 Chris Dumez <cdumez@apple.com>
The URLSearchParams constructor should take a union in parameter
https://bugs.webkit.org/show_bug.cgi?id=163906
Reviewed by Darin Adler.
The URLSearchParams constructor should take a union in parameter:
- https://url.spec.whatwg.org/#urlsearchparams
No new tests, no web-exposed behavior change.
* html/URLSearchParams.h:
(WebCore::URLSearchParams::create):
* html/URLSearchParams.idl:
2016-10-26 Sam Weinig <sam@webkit.org>
[WebIDL] Move more string conversions over to JSDOMConvert
https://bugs.webkit.org/show_bug.cgi?id=164021
Reviewed by Tim Horton.
* bindings/js/JSCSSStyleDeclarationCustom.cpp:
(WebCore::JSCSSStyleDeclaration::putDelegate):
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::open):
(WebCore::JSDOMWindow::showModalDialog):
(WebCore::handlePostMessage):
* bindings/js/JSHTMLCanvasElementCustom.cpp:
(WebCore::JSHTMLCanvasElement::toDataURL):
* bindings/js/JSHistoryCustom.cpp:
(WebCore::JSHistory::pushState):
(WebCore::JSHistory::replaceState):
Switch to convert functions.
* bindings/js/JSApplePaySessionCustom.cpp:
(WebCore::JSApplePaySession::completeShippingMethodSelection):
(WebCore::JSApplePaySession::completeShippingContactSelection):
* bindings/js/JSCryptoAlgorithmDictionary.cpp:
(WebCore::createAesKeyGenParams):
(WebCore::createRsaKeyGenParams):
* bindings/js/JSDocumentCustom.cpp:
(WebCore::JSDocument::getCSSCanvasContext):
* bindings/js/JSMockContentFilterSettingsCustom.cpp:
(WebCore::JSMockContentFilterSettings::setDecisionPoint):
(WebCore::toDecision):
* bindings/js/JSNodeFilterCustom.cpp:
(WebCore::JSNodeFilter::acceptNode):
* bindings/js/JSDOMBinding.cpp:
(WebCore::toSmallerInt):
(WebCore::toSmallerUInt):
(WebCore::toInt8EnforceRange):
(WebCore::toUInt8EnforceRange):
(WebCore::toInt8Clamp):
(WebCore::toUInt8Clamp):
(WebCore::toInt8):
(WebCore::toUInt8):
(WebCore::toInt16EnforceRange):
(WebCore::toUInt16EnforceRange):
(WebCore::toInt16Clamp):
(WebCore::toUInt16Clamp):
(WebCore::toInt16):
(WebCore::toUInt16):
Use updated IntegerConversionConfiguration naming.
(WebCore::valueToStringTreatingNullAsEmptyString): Deleted.
(WebCore::valueToStringWithUndefinedOrNullCheck): Deleted.
(WebCore::valueToUSVStringTreatingNullAsEmptyString): Deleted.
(WebCore::valueToUSVStringWithUndefinedOrNullCheck): Deleted.
* bindings/js/JSDOMBinding.h:
Remove unused functions.
* bindings/js/JSDOMConvert.h:
(WebCore::convert):
Add StringConversionConfiguration, to match IntegerConversionConfiguration which moved here,
and make them both enum classes. Remove SFINAE based overloading of convert<>, which is not
needed if we get rid of the default parameter, which we can, since the two parameter convert
routes to the right place.
(WebCore::Converter<IDLNullable<T>>::convert):
Add overloads converts that take a Integer/String configuration.
(WebCore::Converter<IDLByte>::convert):
(WebCore::Converter<IDLOctet>::convert):
(WebCore::Converter<IDLShort>::convert):
(WebCore::Converter<IDLUnsignedShort>::convert):
(WebCore::Converter<IDLLong>::convert):
(WebCore::Converter<IDLUnsignedLong>::convert):
(WebCore::Converter<IDLLongLong>::convert):
(WebCore::Converter<IDLUnsignedLongLong>::convert):
Use updated IntegerConversionConfiguration naming.
(WebCore::Converter<IDLDOMString>::convert):
(WebCore::Converter<IDLUSVString>::convert):
Add a configuration parameter, similar to the one used for integers
that changes the behavior of string conversions to return an empty
string for null.
* bindings/js/JSDOMIterator.h:
(WebCore::iteratorCreate):
(WebCore::IteratorTraits>::asJS):
(WebCore::appendForEachArguments):
Simplify a bit by extracting the SFINAE helpers into a EnableIfMap and EnableIfSet.
* bindings/scripts/CodeGeneratorJS.pm:
(GetIntegerConversionConfiguration):
(GetStringConversionConfiguration):
(JSValueToNativeIsHandledByDOMConvert):
(JSValueToNative):
Add support for converting more string types and passing the StringConversionConfiguration.
2016-10-26 Dan Bernstein <mitz@apple.com>
When pasting web archive, width specifiers in srcset attribute change into density specifiers
https://bugs.webkit.org/show_bug.cgi?id=164027
<rdar://problem/28964948>
Reviewed by Tim Horton.
Updated editing/pasteboard/img-srcset-copy-paste-canonicalization.html.
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::completeURLsInAttributeValue): Use 'w' when writing out a width
specifier.
2016-10-26 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Media Controller: playback support
https://bugs.webkit.org/show_bug.cgi?id=163678
<rdar://problem/27989479>
Reviewed by Dean Jackson.
We introduce the PlaybackSupport class which brings support for playing and pausing
the media by clicking on the play/pause button in the media controls and correctly
reflecting the media's playback state as the media is played or paused via the media API.
* Modules/modern-media-controls/js-files:
* Modules/modern-media-controls/media/media-controller.js:
(MediaController):
* Modules/modern-media-controls/media/playback-support.js: Copied from Source/WebCore/Modules/modern-media-controls/media/media-controller.js.
(PlaybackSupport.prototype.get control):
(PlaybackSupport.prototype.get mediaEvents):
(PlaybackSupport.prototype.buttonWasClicked):
(PlaybackSupport.prototype.syncControl):
(PlaybackSupport):
* WebCore.xcodeproj/project.pbxproj:
2016-10-26 Chris Dumez <cdumez@apple.com>
Regression(r203848): 百度糯米 app fails to load content due to a JavaScript error
https://bugs.webkit.org/show_bug.cgi?id=163967
<rdar://problem/28707838>
Reviewed by Ryosuke Niwa.
Add quirk for 百度糯米 app making the 2 last parameters to Event.prototype.initEvent()
optional.
No new tests, change only impacts this specific application.
* bindings/scripts/CodeGeneratorJS.pm:
(GeneratePropertiesHashTable):
* dom/Event.cpp:
(WebCore::Event::initEventForBindings):
* dom/Event.h:
* dom/Event.idl:
* platform/RuntimeApplicationChecks.h:
* platform/RuntimeApplicationChecks.mm:
(WebCore::IOSApplication::isBaiduNuomi):
2016-10-26 Chris Dumez <cdumez@apple.com>
First parameter to TextTrack.addCue() / removeCue() should not be nullable
https://bugs.webkit.org/show_bug.cgi?id=164020
Reviewed by Eric Carlson.
First parameter to TextTrack.addCue() / removeCue() should not be nullable:
- https://html.spec.whatwg.org/#texttrack
Firefox and Chrome agree with the specification.
Test: media/track/texttrack-addCue-null.html
* html/track/InbandDataTextTrack.cpp:
(WebCore::InbandDataTextTrack::removeDataCue):
(WebCore::InbandDataTextTrack::removeCue):
* html/track/InbandDataTextTrack.h:
* html/track/InbandGenericTextTrack.cpp:
(WebCore::InbandGenericTextTrack::addGenericCue):
(WebCore::InbandGenericTextTrack::removeGenericCue):
(WebCore::InbandGenericTextTrack::removeCue):
* html/track/InbandGenericTextTrack.h:
* html/track/TextTrack.cpp:
(WebCore::TextTrack::addCue):
(WebCore::TextTrack::removeCue):
* html/track/TextTrack.h:
* html/track/TextTrack.idl:
2016-10-26 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Media Controller: elapsed and remaining time support
https://bugs.webkit.org/show_bug.cgi?id=163679
<rdar://problem/28851675>
Reviewed by Dean Jackson.
We introduce the ElapsedTimeSupport and RemainingTimeSupport classes which bring
support for displaying the elapsed and remaining time in the time control.
Tests: media/modern-media-controls/elapsed-time-support/elapsed-time-support.html
media/modern-media-controls/remaining-time-support/remaining-time-support.html
* Modules/modern-media-controls/js-files:
* Modules/modern-media-controls/media/elapsed-time-support.js: Added.
(ElapsedTimeSupport.prototype.get control):
(ElapsedTimeSupport.prototype.get mediaEvents):
(ElapsedTimeSupport.prototype.syncControl):
(ElapsedTimeSupport):
* Modules/modern-media-controls/media/media-controller.js:
(MediaController):
* Modules/modern-media-controls/media/remaining-time-support.js: Added.
(RemainingTimeSupport.prototype.get control):
(RemainingTimeSupport.prototype.get mediaEvents):
(RemainingTimeSupport.prototype.syncControl):
(RemainingTimeSupport):
* WebCore.xcodeproj/project.pbxproj:
2016-10-26 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Unify CSSCustomPropertyValue and CSSCustomPropertyDeclaration
https://bugs.webkit.org/show_bug.cgi?id=164019
Reviewed by Zalan Bujtas.
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* css/CSSCustomPropertyDeclaration.cpp: Removed.
* css/CSSCustomPropertyDeclaration.h: Removed.
Get rid of CSSCustomPropertyDeclaration.
* css/CSSCustomPropertyValue.h:
Add new constructors to handle the new variable data format (either a CSSValueId or a
CSSVariableData object that holds parser tokens).
* css/CSSValue.cpp:
(WebCore::CSSValue::cssText):
(WebCore::CSSValue::destroy):
* css/CSSValue.h:
(WebCore::CSSValue::isCustomPropertyDeclaration): Deleted.
Get rid of CSSCustomPropertyDeclaration cases.
* css/CSSVariableData.h:
Switch to CSSCustomPropertyValue.
* css/StyleResolver.cpp:
(WebCore::StyleResolver::applyProperty):
We've renamed the old parser variable data to deprecatedValue to make it clear it's going
to be removed eventually.
* css/parser/CSSParserImpl.cpp:
(WebCore::filterProperties):
(WebCore::CSSParserImpl::consumeVariableValue):
* css/parser/CSSVariableParser.cpp:
(WebCore::CSSVariableParser::parseDeclarationValue):
* css/parser/CSSVariableParser.h:
Switch to CSSCustomPropertyValue.
2016-10-26 Youenn Fablet <youenn@apple.com>
Enable SDPProcessor for Mac bots
https://bugs.webkit.org/show_bug.cgi?id=163940
Reviewed by Eric Carlson.
Covered by activated tests.
Activating processing of SDPProcessor scripts for Mac bots.
Moving platform/mediastream/openwebrtc/SDPProcessorScriptResource.cpp to platform/mediastream/SDPProcessorScriptResource.cpp.
This file is not tied to openwebrtc and allows retrieving the SDPProcessor script resource file content.
* DerivedSources.make:
* PlatformGTK.cmake:
* WebCore.xcodeproj/project.pbxproj:
* platform/mediastream/SDPProcessorScriptResource.cpp:
(WebCore::SDPProcessorScriptResource::scriptString):
* platform/mediastream/openwebrtc/SDPProcessorScriptResource.cpp: Removed.
2016-10-26 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Get functional pseudos parsing
https://bugs.webkit.org/show_bug.cgi?id=164018
Reviewed by Zalan Bujtas.
* css/parser/CSSParserValues.cpp:
(WebCore::CSSParserSelector::parsePseudoClassSelectorFromStringView):
Remove the ( check so that we can parse strings that end in (.
* css/parser/CSSSelectorParser.cpp:
(WebCore::CSSSelectorParser::consumePseudo):
Put in a hack that adds a ( to the end of the string so that it will be found in the map.
2016-10-26 Zan Dobersek <zdobersek@igalia.com>
Unreviewed. Fixing compiler warnings in PlaybackPipeline
that are popping up in GTK+ builds.
* platform/graphics/gstreamer/mse/PlaybackPipeline.cpp:
(WebCore::PlaybackPipeline::addSourceBuffer):
(WebCore::PlaybackPipeline::attachTrack):
2016-10-26 Youenn Fablet <youennf@gmail.com>
IceCandidate does not need to be refcounted
https://bugs.webkit.org/show_bug.cgi?id=163944
Reviewed by Eric Carlson.
No change of behavior.
Simplifying IceCandidate class into a simple structure, no longer refcounted.
Updated call sites accordingly.
Updated SDP parsing of candidates to return a Variant instead of having both a return and an out parameter.
* Modules/mediastream/MediaEndpointPeerConnection.cpp:
(WebCore::MediaEndpointPeerConnection::addIceCandidateTask):
(WebCore::MediaEndpointPeerConnection::gotIceCandidate):
* Modules/mediastream/MediaEndpointPeerConnection.h:
* Modules/mediastream/SDPProcessor.cpp:
(WebCore::createCandidateObject):
(WebCore::createCandidate):
(WebCore::iceCandidateFromJSON):
(WebCore::configurationToJSON):
(WebCore::SDPProcessor::parseCandidateLine):
* Modules/mediastream/SDPProcessor.h:
(WebCore::SDPProcessor::ParsingResult::parsingStatus):
(WebCore::SDPProcessor::ParsingResult::candidate):
* platform/mediastream/IceCandidate.h:
* platform/mediastream/MediaEndpoint.cpp:
* platform/mediastream/MediaEndpoint.h:
* platform/mediastream/PeerMediaDescription.h:
(WebCore::PeerMediaDescription::iceCandidates):
(WebCore::PeerMediaDescription::addIceCandidate):
(WebCore::PeerMediaDescription::clone):
* platform/mediastream/openwebrtc/MediaEndpointOwr.cpp:
(WebCore::MediaEndpointOwr::updateSendConfiguration):
(WebCore::MediaEndpointOwr::addRemoteCandidate):
(WebCore::MediaEndpointOwr::dispatchNewIceCandidate):
(WebCore::MediaEndpointOwr::internalAddRemoteCandidate):
* platform/mediastream/openwebrtc/MediaEndpointOwr.h:
* platform/mock/MockMediaEndpoint.cpp:
(WebCore::MockMediaEndpoint::addRemoteCandidate):
(WebCore::MockMediaEndpoint::dispatchFakeIceCandidates):
* platform/mock/MockMediaEndpoint.h:
2016-10-26 Andreas Kling <akling@apple.com>
Fix mach port leak in ResourceUsageThread.
<https://webkit.org/b/164012>
Reviewed by Antti Koivisto.
The threads returned by task_threads() need to be deallocated.
* page/cocoa/ResourceUsageThreadCocoa.mm:
(WebCore::cpuUsage):
2016-10-26 Nael Ouedraogo <nael.ouedraogo@crf.canon.fr>
WebRTC: The RTCTrackEventInit dictionary needs required members
https://bugs.webkit.org/show_bug.cgi?id=158536
Reviewed by Chris Dumez.
Update RTCTrackEvent IDL as per specification.
No additional test required, rebase existing tests.
* Modules/mediastream/RTCTrackEvent.idl:
2016-10-26 Enrique Ocaña González <eocanha@igalia.com>
[GStreamer][GTK+][MSE] Unreviewed debug build fix.
* platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::AppendPipeline::resetPipeline):
* platform/graphics/gstreamer/mse/AppendPipeline.h:
2016-10-26 Enrique Ocaña González <eocanha@igalia.com>
[cmake][GStreamer][MSE][EME] Build MSE and EME code after refactoring
https://bugs.webkit.org/show_bug.cgi?id=162928
Reviewed by Xabier Rodriguez-Calvar.
Consolidate all the source file tree changes after refactoring.
This patch is co-authored with Philippe Normand <philn@igalia.com> (EME support).
* platform/GStreamer.cmake:
2016-10-26 Enrique Ocaña González <eocanha@igalia.com>
[MSE][GStreamer] Enable QUOTA_EXCEEDED_ERR support for GStreamer
https://bugs.webkit.org/show_bug.cgi?id=162922
Reviewed by Xabier Rodriguez-Calvar.
QUOTA_EXCEEDED_ERR should be reported by SourceBuffer when appropriate, at least on the
GStreamer implementation.
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::appendBufferInternal):
2016-10-26 Enrique Ocaña González <eocanha@igalia.com>
[MSE] Expose additional MediaSource methods to MediaSourcePrivate
https://bugs.webkit.org/show_bug.cgi?id=162920
Reviewed by Xabier Rodriguez-Calvar.
The GStreamer MSE platform implementation needs to report duration changes and trigger
monitorSourceBuffers() calls.
* Modules/mediasource/MediaSource.cpp:
(WebCore::MediaSource::durationChanged):
* Modules/mediasource/MediaSource.h:
* platform/graphics/MediaSourcePrivateClient.h:
2016-10-26 Enrique Ocaña González <eocanha@igalia.com>
[GStreamer][EME] ClearKey decryption support
https://bugs.webkit.org/show_bug.cgi?id=162918
Reviewed by Xabier Rodriguez-Calvar.
This patch is authored by Philippe Normand <philn@igalia.com>.
* platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp: Added.
(webkit_media_clear_key_decrypt_class_init):
(webkit_media_clear_key_decrypt_init):
(webKitMediaClearKeyDecryptorFinalize):
(webKitMediaClearKeyDecryptorRequestDecryptionKey):
(webKitMediaClearKeyDecryptorHandleKeyResponse):
(webKitMediaClearKeyDecryptorSetupCipher):
(webKitMediaClearKeyDecryptorDecrypt):
(webKitMediaClearKeyDecryptorReleaseCipher):
* platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.h: Added.
2016-10-26 Enrique Ocaña González <eocanha@igalia.com>
[GStreamer][EME] Base class for decryption support
https://bugs.webkit.org/show_bug.cgi?id=162915
Reviewed by Xabier Rodriguez-Calvar.
Add common encryption base class.
This patch is authored by Philippe Normand <philn@igalia.com>.
* platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp: Added.
(webkit_media_common_encryption_decrypt_class_init):
(webkit_media_common_encryption_decrypt_init):
(webKitMediaCommonEncryptionDecryptorFinalize):
(webkitMediaCommonEncryptionDecryptTransformCaps):
(webkitMediaCommonEncryptionDecryptTransformInPlace):
(webkitMediaCommonEncryptionDecryptSinkEventHandler):
(webKitMediaCommonEncryptionDecryptorChangeState):
(webKitMediaCommonEncryptionDecryptDefaultSetupCipher):
(webKitMediaCommonEncryptionDecryptDefaultReleaseCipher):
* platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.h: Added.
2016-10-26 Enrique Ocaña González <eocanha@igalia.com>
[GStreamer][EME] Utility function to create decryptor
https://bugs.webkit.org/show_bug.cgi?id=162914
Reviewed by Xabier Rodriguez-Calvar.
Add a utility function to find a suitable GStreamer decryptor element.
This patch is authored by Philippe Normand <philn@igalia.com>.
* platform/graphics/gstreamer/GStreamerUtilities.cpp:
(WebCore::createGstDecryptor):
(WebCore::gstRegistryHasElementForMediaType): Deleted.
* platform/graphics/gstreamer/GStreamerUtilities.h:
2016-10-26 Enrique Ocaña González <eocanha@igalia.com>
[GStreamer][MSE][EME] Remove MSE code from regular player and add EME support
https://bugs.webkit.org/show_bug.cgi?id=162911
Now that the MSE responsibility has been refactored to the dedicated
MediaPlayerPrivateGStreamerMSE subclass, the regular player no longer needs the MSE code,
just to expose some more methods to the subclass. Float timestamps have been migrated to
double. Also, small changes to accomodate the EME support are needed.
This patch is co-authored with Philippe Normand <philn@igalia.com> (EME support) and
Žan Doberšek <zandobersek@gmail.com> (double timestamps).
Reviewed by Xabier Rodriguez-Calvar.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::busMessageCallback):
(WebCore::MediaPlayerPrivateGStreamer::registerMediaEngine):
(WebCore::initializeGStreamerAndRegisterWebKitElements):
(WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer):
(WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer):
(WebCore::MediaPlayerPrivateGStreamer::load):
(WebCore::MediaPlayerPrivateGStreamer::playbackPosition):
(WebCore::MediaPlayerPrivateGStreamer::durationMediaTime):
(WebCore::MediaPlayerPrivateGStreamer::currentMediaTime):
(WebCore::MediaPlayerPrivateGStreamer::seek):
(WebCore::MediaPlayerPrivateGStreamer::doSeek):
(WebCore::MediaPlayerPrivateGStreamer::paused):
(WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideo):
(WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfAudio):
(WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfText):
(WebCore::MediaPlayerPrivateGStreamer::buffered):
(WebCore::MediaPlayerPrivateGStreamer::handleMessage):
(WebCore::MediaPlayerPrivateGStreamer::processMpegTsSection):
(WebCore::MediaPlayerPrivateGStreamer::fillTimerFired):
(WebCore::MediaPlayerPrivateGStreamer::maxTimeSeekable):
(WebCore::MediaPlayerPrivateGStreamer::maxTimeLoaded):
(WebCore::MediaPlayerPrivateGStreamer::didLoadingProgress):
(WebCore::MediaPlayerPrivateGStreamer::sourceChanged):
(WebCore::MediaPlayerPrivateGStreamer::didEnd):
(WebCore::MediaPlayerPrivateGStreamer::durationChanged):
(WebCore::MediaPlayerPrivateGStreamer::supportsType):
(WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
(WebCore::MediaPlayerPrivateGStreamer::handleSyncMessage):
(WebCore::MediaPlayerPrivateGStreamer::setAudioStreamProperties): Deleted.
(WebCore::MediaPlayerPrivateGStreamer::commitLoad): Deleted.
(WebCore::MediaPlayerPrivateGStreamer::pause): Deleted.
(WebCore::MediaPlayerPrivateGStreamer::videoChangedCallback): Deleted.
(WebCore::MediaPlayerPrivateGStreamer::videoSinkCapsChangedCallback): Deleted.
(WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideoCaps): Deleted.
(WebCore::MediaPlayerPrivateGStreamer::setRate): Deleted.
(WebCore::MediaPlayerPrivateGStreamer::processTableOfContentsEntry): Deleted.
(WebCore::MediaPlayerPrivateGStreamer::totalBytes): Deleted.
(WebCore::MediaPlayerPrivateGStreamer::loadNextLocation): Deleted.
(WebCore::MediaPlayerPrivateGStreamer::loadStateChanged): Deleted.
(WebCore::MediaPlayerPrivateGStreamer::timeChanged): Deleted.
(WebCore::mimeTypeSet): Deleted.
(WebCore::MediaPlayerPrivateGStreamer::createAudioSink): Deleted.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
(WebCore::MediaPlayerPrivateGStreamer::configurePlaySink):
(WebCore::MediaPlayerPrivateGStreamer::isMediaSource):
(WebCore::MediaPlayerPrivateGStreamer::createWeakPtr): Deleted.
2016-10-26 Enrique Ocaña González <eocanha@igalia.com>
[GStreamer][EME] Add EME support to base private player
https://bugs.webkit.org/show_bug.cgi?id=162908
Reviewed by Xabier Rodriguez-Calvar.
Add encryption key management support.
This patch is authored by Philippe Normand <philn@igalia.com>.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::registerWebKitGStreamerElements):
(WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage):
(WebCore::MediaPlayerPrivateGStreamerBase::needKey):
(WebCore::MediaPlayerPrivateGStreamerBase::setCDMSession):
(WebCore::MediaPlayerPrivateGStreamerBase::keyAdded):
(WebCore::MediaPlayerPrivateGStreamerBase::createSession):
(WebCore::MediaPlayerPrivateGStreamerBase::dispatchDecryptionKey):
(WebCore::MediaPlayerPrivateGStreamerBase::supportsKeySystem):
(WebCore::MediaPlayerPrivateGStreamerBase::extendedSupportsType):
(WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase): Deleted.
(WebCore::MediaPlayerPrivateGStreamerBase::setPipeline): Deleted.
(WebCore::MediaPlayerPrivateGStreamerBase::setStreamVolumeElement): Deleted.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
(WebCore::MediaPlayerPrivateGStreamerBase::pipeline):
2016-10-26 Enrique Ocaña González <eocanha@igalia.com>
[GStreamer][MSE] WebKitMediaSourceGStreamer refactoring
https://bugs.webkit.org/show_bug.cgi?id=162902
Reviewed by Xabier Rodriguez-Calvar.
Move WebKitMediaSourceGStreamer to the mse directory, split public and private header
sections, manage stream data throttling and seek synchronization, audio/video/text stream
counting, improve GStreamer duration query, stream initialization, remove
MediaSourceClientGStreamer logic (factored out to its own class in another patch) and
interaction with MediaPlayerPrivateGStreamerMSE, PlaybackPipeline and
SourceBufferPrivateGStreamer.
* platform/graphics/gstreamer/WebKitMediaSourceGStreamer.cpp: Removed.
* platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp: Added.
(disabledAppsrcNeedData):
(disabledAppsrcEnoughData):
(disabledAppsrcSeekData):
(enabledAppsrcEnoughData):
(enabledAppsrcSeekData):
(getStreamByAppsrc):
(webkit_media_src_init):
(webKitMediaSrcFinalize):
(webKitMediaSrcSetProperty):
(webKitMediaSrcGetProperty):
(webKitMediaSrcDoAsyncStart):
(webKitMediaSrcDoAsyncDone):
(webKitMediaSrcChangeState):
(webKitMediaSrcGetSize):
(webKitMediaSrcQueryWithParent):
(webKitMediaSrcUpdatePresentationSize):
(webKitMediaSrcLinkStreamToSrcPad):
(webKitMediaSrcLinkParser):
(webKitMediaSrcFreeStream):
(webKitMediaSrcCheckAllTracksConfigured):
(webKitMediaSrcUriGetType):
(webKitMediaSrcGetProtocols):
(webKitMediaSrcGetUri):
(webKitMediaSrcSetUri):
(webKitMediaSrcUriHandlerInit):
(seekNeedsDataMainThread):
(notifyReadyForMoreSamplesMainThread):
(applicationMessageCallback):
(webKitMediaSrcSetMediaPlayerPrivate):
(webKitMediaSrcSetReadyForSamples):
(webKitMediaSrcPrepareSeek):
(WTF::adoptGRef):
(WTF::refGPtr<WebKitMediaSrc>):
(WTF::derefGPtr<WebKitMediaSrc>):
* platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.h: Renamed from Source/WebCore/platform/graphics/gstreamer/WebKitMediaSourceGStreamer.h.
* platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamerPrivate.h: Added.
2016-10-26 Enrique Ocaña González <eocanha@igalia.com>
[GStreamer][MSE] Playback pipeline
https://bugs.webkit.org/show_bug.cgi?id=162901
Reviewed by Xabier Rodriguez-Calvar.
Encapsulate the responsibility to interact with the GStreamer playback pipeline and the
different streams managed by the WebKitMediaSrc element into a new PlaybackPipeline class.
* platform/graphics/gstreamer/mse/PlaybackPipeline.cpp: Added.
(getStreamByTrackId):
(getStreamBySourceBufferPrivate):
(pushSample):
(WebCore::PlaybackPipeline::create):
(WebCore::PlaybackPipeline::PlaybackPipeline):
(WebCore::PlaybackPipeline::~PlaybackPipeline):
(WebCore::PlaybackPipeline::setWebKitMediaSrc):
(WebCore::PlaybackPipeline::webKitMediaSrc):
(WebCore::PlaybackPipeline::addSourceBuffer):
(WebCore::PlaybackPipeline::removeSourceBuffer):
(WebCore::PlaybackPipeline::attachTrack):
(WebCore::PlaybackPipeline::reattachTrack):
(WebCore::PlaybackPipeline::notifyDurationChanged):
(WebCore::PlaybackPipeline::markEndOfStream):
(WebCore::PlaybackPipeline::flushAndEnqueueNonDisplayingSamples):
(WebCore::PlaybackPipeline::enqueueSample):
(WebCore::PlaybackPipeline::pipeline):
* platform/graphics/gstreamer/mse/PlaybackPipeline.h: Added.
2016-10-26 Enrique Ocaña González <eocanha@igalia.com>
[GStreamer][MSE][EME] MSE specialization of Media Player Private for GStreamer
https://bugs.webkit.org/show_bug.cgi?id=162900
Reviewed by Xabier Rodriguez-Calvar.
Refactor MSE-specific logic to its own GStreamer player. This new MSE player coordinates
data appending, media playback and interaction with MediaSource by delegating to
AppendPipeline (one instance per SourceBuffer), PlaybackPipeline and
MediaSourceClientGStreamerMSE/MediaSourcePrivateClient respectively.
This patch is co-authored with Philippe Normand <philn@igalia.com> (EME support).
* platform/graphics/MediaPlayer.cpp:
(WebCore::buildMediaEnginesVector):
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp: Added.
(dumpReadyState):
(WebCore::MediaPlayerPrivateGStreamerMSE::registerMediaEngine):
(WebCore::initializeGStreamerAndRegisterWebKitMSEElement):
(WebCore::MediaPlayerPrivateGStreamerMSE::isAvailable):
(WebCore::MediaPlayerPrivateGStreamerMSE::MediaPlayerPrivateGStreamerMSE):
(WebCore::MediaPlayerPrivateGStreamerMSE::~MediaPlayerPrivateGStreamerMSE):
(WebCore::MediaPlayerPrivateGStreamerMSE::load):
(WebCore::MediaPlayerPrivateGStreamerMSE::pause):
(WebCore::MediaPlayerPrivateGStreamerMSE::durationMediaTime):
(WebCore::MediaPlayerPrivateGStreamerMSE::seek):
(WebCore::MediaPlayerPrivateGStreamerMSE::configurePlaySink):
(WebCore::MediaPlayerPrivateGStreamerMSE::changePipelineState):
(WebCore::MediaPlayerPrivateGStreamerMSE::notifySeekNeedsDataForTime):
(WebCore::MediaPlayerPrivateGStreamerMSE::doSeek):
(WebCore::MediaPlayerPrivateGStreamerMSE::maybeFinishSeek):
(WebCore::MediaPlayerPrivateGStreamerMSE::updatePlaybackRate):
(WebCore::MediaPlayerPrivateGStreamerMSE::seeking):
(WebCore::MediaPlayerPrivateGStreamerMSE::setReadyState):
(WebCore::MediaPlayerPrivateGStreamerMSE::waitForSeekCompleted):
(WebCore::MediaPlayerPrivateGStreamerMSE::seekCompleted):
(WebCore::MediaPlayerPrivateGStreamerMSE::setRate):
(WebCore::MediaPlayerPrivateGStreamerMSE::buffered):
(WebCore::MediaPlayerPrivateGStreamerMSE::sourceChanged):
(WebCore::MediaPlayerPrivateGStreamerMSE::updateStates):
(WebCore::MediaPlayerPrivateGStreamerMSE::asyncStateChangeDone):
(WebCore::MediaPlayerPrivateGStreamerMSE::isTimeBuffered):
(WebCore::MediaPlayerPrivateGStreamerMSE::setMediaSourceClient):
(WebCore::MediaPlayerPrivateGStreamerMSE::mediaSourceClient):
(WebCore::MediaPlayerPrivateGStreamerMSE::durationChanged):
(WebCore::mimeTypeCache):
(WebCore::MediaPlayerPrivateGStreamerMSE::getSupportedTypes):
(WebCore::MediaPlayerPrivateGStreamerMSE::trackDetected):
(WebCore::MediaPlayerPrivateGStreamerMSE::supportsType):
(WebCore::MediaPlayerPrivateGStreamerMSE::dispatchDecryptionKey):
(WebCore::MediaPlayerPrivateGStreamerMSE::markEndOfStream):
(WebCore::MediaPlayerPrivateGStreamerMSE::currentMediaTime):
(WebCore::MediaPlayerPrivateGStreamerMSE::maxTimeSeekable):
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h: Added.
(WebCore::MediaPlayerPrivateGStreamerMSE::mediaSourcePrivateClient):
2016-10-26 Enrique Ocaña González <eocanha@igalia.com>
[GStreamer][MSE] MediaSourceGStreamer refactoring
https://bugs.webkit.org/show_bug.cgi?id=162899
Reviewed by Žan Doberšek.
Move MediaSourceGStreamer to the mse directory, manage SourceBufferPrivates and delegate WebKitMediaSrc operations to the MSE private player.
* platform/graphics/gstreamer/mse/MediaSourceGStreamer.cpp: Renamed from Source/WebCore/platform/graphics/gstreamer/MediaSourceGStreamer.cpp.
(WebCore::MediaSourceGStreamer::open):
(WebCore::MediaSourceGStreamer::MediaSourceGStreamer):
(WebCore::MediaSourceGStreamer::~MediaSourceGStreamer):
(WebCore::MediaSourceGStreamer::addSourceBuffer):
(WebCore::MediaSourceGStreamer::removeSourceBuffer):
(WebCore::MediaSourceGStreamer::durationChanged):
(WebCore::MediaSourceGStreamer::markEndOfStream):
(WebCore::MediaSourceGStreamer::unmarkEndOfStream):
(WebCore::MediaSourceGStreamer::readyState):
(WebCore::MediaSourceGStreamer::setReadyState):
(WebCore::MediaSourceGStreamer::waitForSeekCompleted):
(WebCore::MediaSourceGStreamer::seekCompleted):
(WebCore::MediaSourceGStreamer::sourceBufferPrivateDidChangeActiveState):
(WebCore::MediaSourceGStreamer::buffered):
* platform/graphics/gstreamer/mse/MediaSourceGStreamer.h: Renamed from Source/WebCore/platform/graphics/gstreamer/MediaSourceGStreamer.h.
2016-10-26 Enrique Ocaña González <eocanha@igalia.com>
[GStreamer][MSE] SourceBufferPrivateGStreamer refactoring
https://bugs.webkit.org/show_bug.cgi?id=162898
Reviewed by Xabier Rodriguez-Calvar.
Moved SourceBufferPrivateGStreamer to an mse directory and added unimplemented features (abort, enqueueing and sample flow control).
* platform/graphics/gstreamer/SourceBufferPrivateGStreamer.cpp: Removed.
* platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp: Added.
(WebCore::SourceBufferPrivateGStreamer::create):
(WebCore::SourceBufferPrivateGStreamer::SourceBufferPrivateGStreamer):
(WebCore::SourceBufferPrivateGStreamer::~SourceBufferPrivateGStreamer):
(WebCore::SourceBufferPrivateGStreamer::setClient):
(WebCore::SourceBufferPrivateGStreamer::append):
(WebCore::SourceBufferPrivateGStreamer::abort):
(WebCore::SourceBufferPrivateGStreamer::resetParserState):
(WebCore::SourceBufferPrivateGStreamer::removedFromMediaSource):
(WebCore::SourceBufferPrivateGStreamer::readyState):
(WebCore::SourceBufferPrivateGStreamer::setReadyState):
(WebCore::SourceBufferPrivateGStreamer::flushAndEnqueueNonDisplayingSamples):
(WebCore::SourceBufferPrivateGStreamer::enqueueSample):
(WebCore::SourceBufferPrivateGStreamer::isReadyForMoreSamples):
(WebCore::SourceBufferPrivateGStreamer::setReadyForMoreSamples):
(WebCore::SourceBufferPrivateGStreamer::notifyReadyForMoreSamples):
(WebCore::SourceBufferPrivateGStreamer::setActive):
(WebCore::SourceBufferPrivateGStreamer::stopAskingForMoreSamples):
(WebCore::SourceBufferPrivateGStreamer::notifyClientWhenReadyForMoreSamples):
(WebCore::SourceBufferPrivateGStreamer::didReceiveInitializationSegment):
(WebCore::SourceBufferPrivateGStreamer::didReceiveSample):
(WebCore::SourceBufferPrivateGStreamer::didReceiveAllPendingSamples):
* platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.h: Renamed from Source/WebCore/platform/graphics/gstreamer/SourceBufferPrivateGStreamer.h.
2016-10-26 Enrique Ocaña González <eocanha@igalia.com>
[GStreamer][MSE] MediaSourceClientGStreamerMSE
https://bugs.webkit.org/show_bug.cgi?id=162896
Reviewed by Xabier Rodriguez-Calvar.
This class encapsulates the MediaSource interaction responsibility for the
GStreamer platform.
* platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp: Added.
(WebCore::MediaSourceClientGStreamerMSE::create):
(WebCore::MediaSourceClientGStreamerMSE::MediaSourceClientGStreamerMSE):
(WebCore::MediaSourceClientGStreamerMSE::~MediaSourceClientGStreamerMSE):
(WebCore::MediaSourceClientGStreamerMSE::addSourceBuffer):
(WebCore::MediaSourceClientGStreamerMSE::duration):
(WebCore::MediaSourceClientGStreamerMSE::durationChanged):
(WebCore::MediaSourceClientGStreamerMSE::abort):
(WebCore::MediaSourceClientGStreamerMSE::append):
(WebCore::MediaSourceClientGStreamerMSE::markEndOfStream):
(WebCore::MediaSourceClientGStreamerMSE::removedFromMediaSource):
(WebCore::MediaSourceClientGStreamerMSE::flushAndEnqueueNonDisplayingSamples):
(WebCore::MediaSourceClientGStreamerMSE::enqueueSample):
(WebCore::MediaSourceClientGStreamerMSE::webKitMediaSrc):
(WebCore::MediaSourceClientGStreamerMSE::clearPlayerPrivate):
* platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.h: Added.
2016-10-26 Enrique Ocaña González <eocanha@igalia.com>
[GStreamer] GStreamer Media Sample
https://bugs.webkit.org/show_bug.cgi?id=162894
Reviewed by Xabier Rodriguez-Calvar.
Implement the MediaSample interface for the GStreamer platform.
* platform/graphics/gstreamer/mse/GStreamerMediaSample.cpp: Added.
(WebCore::GStreamerMediaSample::GStreamerMediaSample):
(WebCore::GStreamerMediaSample::create):
(WebCore::GStreamerMediaSample::createFakeSample):
(WebCore::GStreamerMediaSample::applyPtsOffset):
(WebCore::GStreamerMediaSample::offsetTimestampsBy):
(WebCore::GStreamerMediaSample::~GStreamerMediaSample):
* platform/graphics/gstreamer/mse/GStreamerMediaSample.h: Added.
(WebCore::GStreamerMediaSample::presentationTime):
(WebCore::GStreamerMediaSample::decodeTime):
(WebCore::GStreamerMediaSample::duration):
(WebCore::GStreamerMediaSample::trackID):
(WebCore::GStreamerMediaSample::setTrackID):
(WebCore::GStreamerMediaSample::sizeInBytes):
(WebCore::GStreamerMediaSample::sample):
(WebCore::GStreamerMediaSample::presentationSize):
(WebCore::GStreamerMediaSample::setTimestamps):
(WebCore::GStreamerMediaSample::isDivisable):
(WebCore::GStreamerMediaSample::divide):
(WebCore::GStreamerMediaSample::flags):
(WebCore::GStreamerMediaSample::platformSample):
(WebCore::GStreamerMediaSample::dump):
2016-10-26 Enrique Ocaña González <eocanha@igalia.com>
[GStreamer] GStreamer Media Description
https://bugs.webkit.org/show_bug.cgi?id=162893
Reviewed by Xabier Rodriguez-Calvar.
Implement the MediaDescription interface for the GStreamer platform.
* platform/graphics/gstreamer/mse/GStreamerMediaDescription.cpp: Added.
(WebCore::GStreamerMediaDescription::codec):
(WebCore::GStreamerMediaDescription::isVideo):
(WebCore::GStreamerMediaDescription::isAudio):
(WebCore::GStreamerMediaDescription::isText):
* platform/graphics/gstreamer/mse/GStreamerMediaDescription.h: Added.
(WebCore::GStreamerMediaDescription::create):
(WebCore::GStreamerMediaDescription::~GStreamerMediaDescription):
(WebCore::GStreamerMediaDescription::GStreamerMediaDescription):
2016-10-26 Enrique Ocaña González <eocanha@igalia.com>
[GStreamer][MSE][EME] Append Pipeline
https://bugs.webkit.org/show_bug.cgi?id=162874
Reviewed by Žan Doberšek.
This patch is co-authored with Xabier Rodriguez-Calvar <calvaris@igalia.com> (data starve
and last sample detection, debug features) and Philippe Normand <philn@igalia.com> (EME
support).
* platform/graphics/gstreamer/mse/AppendPipeline.cpp: Added.
(WebCore::dumpAppendState):
(WebCore::appendPipelineElementMessageCallback):
(WebCore::appendPipelineApplicationMessageCallback):
(WebCore::AppendPipeline::AppendPipeline):
(WebCore::AppendPipeline::~AppendPipeline):
(WebCore::AppendPipeline::clearPlayerPrivate):
(WebCore::AppendPipeline::handleElementMessage):
(WebCore::AppendPipeline::handleApplicationMessage):
(WebCore::AppendPipeline::handleAppsrcNeedDataReceived):
(WebCore::AppendPipeline::handleAppsrcAtLeastABufferLeft):
(WebCore::AppendPipeline::id):
(WebCore::AppendPipeline::setAppendState):
(WebCore::AppendPipeline::parseDemuxerSrcPadCaps):
(WebCore::AppendPipeline::appsinkCapsChanged):
(WebCore::AppendPipeline::checkEndOfAppend):
(WebCore::AppendPipeline::appsinkNewSample):
(WebCore::AppendPipeline::appsinkEOS):
(WebCore::AppendPipeline::didReceiveInitializationSegment):
(WebCore::AppendPipeline::trackId):
(WebCore::AppendPipeline::resetPipeline):
(WebCore::AppendPipeline::setAppsrcDataLeavingProbe):
(WebCore::AppendPipeline::removeAppsrcDataLeavingProbe):
(WebCore::AppendPipeline::abort):
(WebCore::AppendPipeline::pushNewBuffer):
(WebCore::AppendPipeline::reportAppsrcAtLeastABufferLeft):
(WebCore::AppendPipeline::reportAppsrcNeedDataReceived):
(WebCore::AppendPipeline::handleNewAppsinkSample):
(WebCore::AppendPipeline::connectDemuxerSrcPadToAppsinkFromAnyThread):
(WebCore::AppendPipeline::connectDemuxerSrcPadToAppsink):
(WebCore::AppendPipeline::disconnectDemuxerSrcPadFromAppsinkFromAnyThread):
(WebCore::appendPipelineAppsinkCapsChanged):
(WebCore::appendPipelineAppsrcDataLeaving):
(WebCore::appendPipelinePadProbeDebugInformation):
(WebCore::appendPipelineAppsrcNeedData):
(WebCore::appendPipelineDemuxerPadAdded):
(WebCore::appendPipelineDemuxerPadRemoved):
(WebCore::appendPipelineAppsinkNewSample):
(WebCore::appendPipelineAppsinkEOS):
* platform/graphics/gstreamer/mse/AppendPipeline.h: Added.
(WebCore::AppendPipeline::appendState):
(WebCore::AppendPipeline::mediaSourceClient):
(WebCore::AppendPipeline::sourceBufferPrivate):
(WebCore::AppendPipeline::bus):
(WebCore::AppendPipeline::pipeline):
(WebCore::AppendPipeline::appsrc):
(WebCore::AppendPipeline::appsink):
(WebCore::AppendPipeline::demuxerSrcPadCaps):
(WebCore::AppendPipeline::appsinkCaps):
(WebCore::AppendPipeline::track):
(WebCore::AppendPipeline::streamType):
2016-10-26 Enrique Ocaña González <eocanha@igalia.com>
[GStreamer] Drain query support
https://bugs.webkit.org/show_bug.cgi?id=162872
Reviewed by Žan Doberšek.
Under some circumstances, GStreamer deadlocks completely during MSE seeks on OpenGL ES
systems. This is because the video sink still holds samples. Proper DRAIN support
fixes this issue and is also good for all the platforms, not only OpenGL ES.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::triggerDrain):
(WebCore::MediaPlayerPrivateGStreamerBase::drainCallback):
(WebCore::MediaPlayerPrivateGStreamerBase::createVideoSink):
(WebCore::MediaPlayerPrivateGStreamerBase::createVideoSinkGL): Deleted.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
* platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
(VideoRenderRequestScheduler::drain):
(webkitVideoSinkQuery):
(webkitVideoSinkEvent):
(webkit_video_sink_class_init):
(VideoRenderRequestScheduler::stop): Deleted.
(webkitVideoSinkProposeAllocation): Deleted.
2016-10-26 Enrique Ocaña González <eocanha@igalia.com>
[GStreamer] Track enhancements for MSE support
https://bugs.webkit.org/show_bug.cgi?id=162869
Reviewed by Xabier Rodriguez-Calvar.
Add 'id' field to Audio/VideoTrackPrivateGStreamer. Make TrackPrivateBaseGStreamer
work anyway in cases where the demuxer isn't contained in a GstPlaybin.
* platform/graphics/gstreamer/AudioTrackPrivateGStreamer.cpp:
(WebCore::AudioTrackPrivateGStreamer::AudioTrackPrivateGStreamer):
* platform/graphics/gstreamer/AudioTrackPrivateGStreamer.h:
* platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
(WebCore::TrackPrivateBaseGStreamer::tagsChanged):
(WebCore::TrackPrivateBaseGStreamer::notifyTrackOfActiveChanged):
* platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp:
(WebCore::VideoTrackPrivateGStreamer::VideoTrackPrivateGStreamer):
* platform/graphics/gstreamer/VideoTrackPrivateGStreamer.h:
2016-10-26 Youenn Fablet <youenn@apple.com>
Make CachedResourceLoader originsMatch check more efficient
https://bugs.webkit.org/show_bug.cgi?id=163938
Reviewed by Darin Adler.
No change of behavior.
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::shouldUpdateCachedResourceWithCurrentRequest):
(WebCore::originsMatch): Moved to SecurityOrigin.cpp.
* page/SecurityOrigin.cpp:
(WebCore::areOriginsMatching): Helper routine to check whether origins are matching.
(WebCore::originsMatch): Ensuring string comparison provides the same result as this function.
* page/SecurityOrigin.h:
(WebCore::SecurityOrigin::protocol):
(WebCore::SecurityOrigin::host):
(WebCore::SecurityOrigin::domain):
2016-10-25 Yusuke Suzuki <utatane.tea@gmail.com>
[DOMJIT] Tell IDL result type to DFG to drop type checks in AI
https://bugs.webkit.org/show_bug.cgi?id=163900
Reviewed by Sam Weinig.
Add TestDOMJIT.idl for bindings generation tests.
* bindings/scripts/CodeGeneratorJS.pm:
(GetResultTypeFilter):
(GenerateImplementation):
* bindings/scripts/test/JS/JSTestDOMJIT.cpp: Added.
(WebCore::JSTestDOMJITPrototype::create):
(WebCore::JSTestDOMJITPrototype::createStructure):
(WebCore::JSTestDOMJITPrototype::JSTestDOMJITPrototype):
(WebCore::JSTestDOMJITConstructor::prototypeForStructure):
(WebCore::JSTestDOMJITConstructor::initializeProperties):
(WebCore::JSTestDOMJITPrototype::finishCreation):
(WebCore::JSTestDOMJIT::JSTestDOMJIT):
(WebCore::JSTestDOMJIT::createPrototype):
(WebCore::JSTestDOMJIT::prototype):
(WebCore::BindingCaller<JSTestDOMJIT>::castForAttribute):
(WebCore::jsTestDOMJITAnyAttr):
(WebCore::jsTestDOMJITAnyAttrGetter):
(WebCore::TestDOMJITAnyAttrDOMJIT::TestDOMJITAnyAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITAnyAttr):
(WebCore::jsTestDOMJITBooleanAttr):
(WebCore::jsTestDOMJITBooleanAttrGetter):
(WebCore::TestDOMJITBooleanAttrDOMJIT::TestDOMJITBooleanAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITBooleanAttr):
(WebCore::jsTestDOMJITByteAttr):
(WebCore::jsTestDOMJITByteAttrGetter):
(WebCore::TestDOMJITByteAttrDOMJIT::TestDOMJITByteAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITByteAttr):
(WebCore::jsTestDOMJITOctetAttr):
(WebCore::jsTestDOMJITOctetAttrGetter):
(WebCore::TestDOMJITOctetAttrDOMJIT::TestDOMJITOctetAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITOctetAttr):
(WebCore::jsTestDOMJITShortAttr):
(WebCore::jsTestDOMJITShortAttrGetter):
(WebCore::TestDOMJITShortAttrDOMJIT::TestDOMJITShortAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITShortAttr):
(WebCore::jsTestDOMJITUnsignedShortAttr):
(WebCore::jsTestDOMJITUnsignedShortAttrGetter):
(WebCore::TestDOMJITUnsignedShortAttrDOMJIT::TestDOMJITUnsignedShortAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITUnsignedShortAttr):
(WebCore::jsTestDOMJITLongAttr):
(WebCore::jsTestDOMJITLongAttrGetter):
(WebCore::TestDOMJITLongAttrDOMJIT::TestDOMJITLongAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITLongAttr):
(WebCore::jsTestDOMJITUnsignedLongAttr):
(WebCore::jsTestDOMJITUnsignedLongAttrGetter):
(WebCore::TestDOMJITUnsignedLongAttrDOMJIT::TestDOMJITUnsignedLongAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITUnsignedLongAttr):
(WebCore::jsTestDOMJITLongLongAttr):
(WebCore::jsTestDOMJITLongLongAttrGetter):
(WebCore::TestDOMJITLongLongAttrDOMJIT::TestDOMJITLongLongAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITLongLongAttr):
(WebCore::jsTestDOMJITUnsignedLongLongAttr):
(WebCore::jsTestDOMJITUnsignedLongLongAttrGetter):
(WebCore::TestDOMJITUnsignedLongLongAttrDOMJIT::TestDOMJITUnsignedLongLongAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITUnsignedLongLongAttr):
(WebCore::jsTestDOMJITFloatAttr):
(WebCore::jsTestDOMJITFloatAttrGetter):
(WebCore::TestDOMJITFloatAttrDOMJIT::TestDOMJITFloatAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITFloatAttr):
(WebCore::jsTestDOMJITUnrestrictedFloatAttr):
(WebCore::jsTestDOMJITUnrestrictedFloatAttrGetter):
(WebCore::TestDOMJITUnrestrictedFloatAttrDOMJIT::TestDOMJITUnrestrictedFloatAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITUnrestrictedFloatAttr):
(WebCore::jsTestDOMJITDoubleAttr):
(WebCore::jsTestDOMJITDoubleAttrGetter):
(WebCore::TestDOMJITDoubleAttrDOMJIT::TestDOMJITDoubleAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITDoubleAttr):
(WebCore::jsTestDOMJITUnrestrictedDoubleAttr):
(WebCore::jsTestDOMJITUnrestrictedDoubleAttrGetter):
(WebCore::TestDOMJITUnrestrictedDoubleAttrDOMJIT::TestDOMJITUnrestrictedDoubleAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITUnrestrictedDoubleAttr):
(WebCore::jsTestDOMJITDomStringAttr):
(WebCore::jsTestDOMJITDomStringAttrGetter):
(WebCore::TestDOMJITDomStringAttrDOMJIT::TestDOMJITDomStringAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITDomStringAttr):
(WebCore::jsTestDOMJITByteStringAttr):
(WebCore::jsTestDOMJITByteStringAttrGetter):
(WebCore::TestDOMJITByteStringAttrDOMJIT::TestDOMJITByteStringAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITByteStringAttr):
(WebCore::jsTestDOMJITUsvStringAttr):
(WebCore::jsTestDOMJITUsvStringAttrGetter):
(WebCore::TestDOMJITUsvStringAttrDOMJIT::TestDOMJITUsvStringAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITUsvStringAttr):
(WebCore::jsTestDOMJITNodeAttr):
(WebCore::jsTestDOMJITNodeAttrGetter):
(WebCore::TestDOMJITNodeAttrDOMJIT::TestDOMJITNodeAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITNodeAttr):
(WebCore::jsTestDOMJITBooleanNullableAttr):
(WebCore::jsTestDOMJITBooleanNullableAttrGetter):
(WebCore::TestDOMJITBooleanNullableAttrDOMJIT::TestDOMJITBooleanNullableAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITBooleanNullableAttr):
(WebCore::jsTestDOMJITByteNullableAttr):
(WebCore::jsTestDOMJITByteNullableAttrGetter):
(WebCore::TestDOMJITByteNullableAttrDOMJIT::TestDOMJITByteNullableAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITByteNullableAttr):
(WebCore::jsTestDOMJITOctetNullableAttr):
(WebCore::jsTestDOMJITOctetNullableAttrGetter):
(WebCore::TestDOMJITOctetNullableAttrDOMJIT::TestDOMJITOctetNullableAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITOctetNullableAttr):
(WebCore::jsTestDOMJITShortNullableAttr):
(WebCore::jsTestDOMJITShortNullableAttrGetter):
(WebCore::TestDOMJITShortNullableAttrDOMJIT::TestDOMJITShortNullableAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITShortNullableAttr):
(WebCore::jsTestDOMJITUnsignedShortNullableAttr):
(WebCore::jsTestDOMJITUnsignedShortNullableAttrGetter):
(WebCore::TestDOMJITUnsignedShortNullableAttrDOMJIT::TestDOMJITUnsignedShortNullableAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITUnsignedShortNullableAttr):
(WebCore::jsTestDOMJITLongNullableAttr):
(WebCore::jsTestDOMJITLongNullableAttrGetter):
(WebCore::TestDOMJITLongNullableAttrDOMJIT::TestDOMJITLongNullableAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITLongNullableAttr):
(WebCore::jsTestDOMJITUnsignedLongNullableAttr):
(WebCore::jsTestDOMJITUnsignedLongNullableAttrGetter):
(WebCore::TestDOMJITUnsignedLongNullableAttrDOMJIT::TestDOMJITUnsignedLongNullableAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITUnsignedLongNullableAttr):
(WebCore::jsTestDOMJITLongLongNullableAttr):
(WebCore::jsTestDOMJITLongLongNullableAttrGetter):
(WebCore::TestDOMJITLongLongNullableAttrDOMJIT::TestDOMJITLongLongNullableAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITLongLongNullableAttr):
(WebCore::jsTestDOMJITUnsignedLongLongNullableAttr):
(WebCore::jsTestDOMJITUnsignedLongLongNullableAttrGetter):
(WebCore::TestDOMJITUnsignedLongLongNullableAttrDOMJIT::TestDOMJITUnsignedLongLongNullableAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITUnsignedLongLongNullableAttr):
(WebCore::jsTestDOMJITFloatNullableAttr):
(WebCore::jsTestDOMJITFloatNullableAttrGetter):
(WebCore::TestDOMJITFloatNullableAttrDOMJIT::TestDOMJITFloatNullableAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITFloatNullableAttr):
(WebCore::jsTestDOMJITUnrestrictedFloatNullableAttr):
(WebCore::jsTestDOMJITUnrestrictedFloatNullableAttrGetter):
(WebCore::TestDOMJITUnrestrictedFloatNullableAttrDOMJIT::TestDOMJITUnrestrictedFloatNullableAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITUnrestrictedFloatNullableAttr):
(WebCore::jsTestDOMJITDoubleNullableAttr):
(WebCore::jsTestDOMJITDoubleNullableAttrGetter):
(WebCore::TestDOMJITDoubleNullableAttrDOMJIT::TestDOMJITDoubleNullableAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITDoubleNullableAttr):
(WebCore::jsTestDOMJITUnrestrictedDoubleNullableAttr):
(WebCore::jsTestDOMJITUnrestrictedDoubleNullableAttrGetter):
(WebCore::TestDOMJITUnrestrictedDoubleNullableAttrDOMJIT::TestDOMJITUnrestrictedDoubleNullableAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITUnrestrictedDoubleNullableAttr):
(WebCore::jsTestDOMJITDomStringNullableAttr):
(WebCore::jsTestDOMJITDomStringNullableAttrGetter):
(WebCore::TestDOMJITDomStringNullableAttrDOMJIT::TestDOMJITDomStringNullableAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITDomStringNullableAttr):
(WebCore::jsTestDOMJITByteStringNullableAttr):
(WebCore::jsTestDOMJITByteStringNullableAttrGetter):
(WebCore::TestDOMJITByteStringNullableAttrDOMJIT::TestDOMJITByteStringNullableAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITByteStringNullableAttr):
(WebCore::jsTestDOMJITUsvStringNullableAttr):
(WebCore::jsTestDOMJITUsvStringNullableAttrGetter):
(WebCore::TestDOMJITUsvStringNullableAttrDOMJIT::TestDOMJITUsvStringNullableAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITUsvStringNullableAttr):
(WebCore::jsTestDOMJITNodeNullableAttr):
(WebCore::jsTestDOMJITNodeNullableAttrGetter):
(WebCore::TestDOMJITNodeNullableAttrDOMJIT::TestDOMJITNodeNullableAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITNodeNullableAttr):
(WebCore::jsTestDOMJITConstructor):
(WebCore::setJSTestDOMJITConstructor):
(WebCore::JSTestDOMJIT::getConstructor):
(WebCore::JSTestDOMJIT::visitChildren):
* bindings/scripts/test/JS/JSTestDOMJIT.h: Added.
(WebCore::JSTestDOMJIT::create):
(WebCore::JSTestDOMJIT::createStructure):
(WebCore::JSTestDOMJIT::wrapped):
(WebCore::JSTestDOMJIT::finishCreation):
* bindings/scripts/test/TestDOMJIT.idl: Added.
2016-10-25 Brent Fulgham <bfulgham@apple.com>
[Win] Unreviewed build fix.
* platform/graphics/GraphicsContext.h: Add missing declaration.
2016-10-25 Ryosuke Niwa <rniwa@webkit.org>
Updating attribute by textContent must create a single mutation record and custom element reaction
https://bugs.webkit.org/show_bug.cgi?id=164003
Reviewed by Chris Dumez.
The bug was caused by setTextContent not invoking setNodeValue for Attr nodes.
Use setNodeValue to match the specification: https://dom.spec.whatwg.org/#dom-node-textcontent
Test: fast/dom/MutationObserver/text-content-on-attr.html
* dom/Node.cpp:
(WebCore::Node::setTextContent):
2016-10-25 Brent Fulgham <bfulgham@apple.com>
[Win][Direct2D] Use smart pointers for Direct2D Path types
https://bugs.webkit.org/show_bug.cgi?id=163994
Reviewed by Alex Christensen.
Tested by existing path tests.
* platform/graphics/Path.h:
(WebCore::Path::platformPath): Use a COMPtr for m_path.
* platform/graphics/win/GraphicsContextDirect2D.cpp:
(WebCore::GraphicsContext::systemFactory): Present better D2D debug output
when running a debug build.
(WebCore::GraphicsContext::platformInit): Initialize a D2D device from a
native GDI device context.
(WebCore::GraphicsContext::platformStrokeStyle): Added.
(WebCore::GraphicsContext::clipBounds): Simplify clip boundary calculations and
avoid doing math on infinities.
* platform/graphics/win/PathDirect2D.cpp:
(WebCore::scratchRenderTarget): Added.
(WebCore::Path::~Path): Switch to COMPtr implementation.
(WebCore::Path::ensurePlatformPath): Ditto.
(WebCore::Path::appendGeometry): Ditto.
(WebCore::Path::operator=): Ditto.
(WebCore::Path::initializePathState): Ditto.
(WebCore::Path::strokeContains): Provide an implementation.
(WebCore::Path::transform): Ditto.
(WebCore::Path::addEllipse): No need for explicit construction of the
D2D1::Point2F object.
(WebCore::Path::clear): Switch to COMPtr implementation.
2016-10-25 Nan Wang <n_wang@apple.com>
LayoutTest accessibility/mac/meter-gauge-value-description.html failing
https://bugs.webkit.org/show_bug.cgi?id=163997
<rdar://problem/28948637>
Reviewed by Chris Fleizach.
I hand-edited the Localizable.strings file in a previous patch and my changes
were replaced by running update-webkit-localizable-strings script. Changed the
key to be the same as the value to keep consistency with other entries.
Re-enabled the failing test.
* English.lproj/Localizable.strings:
* platform/LocalizedStrings.cpp:
(WebCore::AXMeterGaugeRegionOptimumText):
(WebCore::AXMeterGaugeRegionSuboptimalText):
(WebCore::AXMeterGaugeRegionLessGoodText):
2016-10-25 Filip Pizlo <fpizlo@apple.com>
HeapTimer should not hardcode all of its subclasses and USE(CF) shouldn't be a bizarre special case
https://bugs.webkit.org/show_bug.cgi?id=163947
Reviewed by Geoffrey Garen.
No new tests because no new behavior.
* platform/ios/WebSafeGCActivityCallbackIOS.h:
* platform/ios/WebSafeIncrementalSweeperIOS.h:
2016-10-25 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Improvements to selector parsing
https://bugs.webkit.org/show_bug.cgi?id=163964
Reviewed by Zalan Bujtas.
* css/CSSSelector.cpp:
(WebCore::CSSSelector::setAttribute):
(WebCore::CSSSelector::setNth):
* css/CSSSelector.h:
(WebCore::CSSSelector::setAttributeValueMatchingIsCaseInsensitive):
* css/StyleSheetContents.cpp:
(WebCore::StyleSheetContents::StyleSheetContents):
(WebCore::StyleSheetContents::parserAppendRule):
(WebCore::StyleSheetContents::ruleAt):
(WebCore::StyleSheetContents::ruleCount):
(WebCore::StyleSheetContents::clearRules):
(WebCore::StyleSheetContents::wrapperInsertRule):
(WebCore::StyleSheetContents::wrapperDeleteRule):
* css/StyleSheetContents.h:
* css/parser/CSSParser.cpp:
(WebCore::CSSParserContext::CSSParserContext):
(WebCore::CSSParser::parseSelector):
* css/parser/CSSParserValues.h:
(WebCore::CSSParserSelector::setAttribute):
(WebCore::CSSParserSelector::setArgument):
(WebCore::CSSParserSelector::setNth):
* css/parser/CSSSelectorParser.cpp:
(WebCore::consumeLangArgumentList):
(WebCore::CSSSelectorParser::consumeCompoundSelector):
(WebCore::CSSSelectorParser::consumeAttribute):
(WebCore::isPseudoClassFunction):
(WebCore::isPseudoElementFunction):
(WebCore::CSSSelectorParser::consumePseudo):
(WebCore::CSSSelectorParser::consumeCombinator):
2016-10-25 Beth Dakin <bdakin@apple.com>
Numbered list should be represented without ‘…’
https://bugs.webkit.org/show_bug.cgi?id=163992
-and corresponding-
rdar://problem/28911337
Reviewed by Darin Adler.
* English.lproj/Localizable.strings:
* platform/LocalizedStrings.cpp:
(WebCore::insertListTypeNumbered):
2016-10-25 Daniel Bates <dabates@apple.com>
REGRESSION (r178265): XSS Auditor fails to block document.write() of incomplete tag
https://bugs.webkit.org/show_bug.cgi?id=163978
<rdar://problem/25962131>
Reviewed by Darin Adler.
During the tokenization process of an HTML tag the start and end positions of each of its
attributes is tracked so that the XSS Auditor can request a snippet around a suspected
injected attribute. We need to take care to consider document.write() boundaries when
tracking the start and end positions of each HTML tag and attribute so that the XSS Auditor
receives the correct snippet. Following r178265 we no longer consider document.write()
boundaries when tracking the start and end positions of attributes. So, the substring
represented by the start and end positions of an attribute may correspond to some other
attribute in the tag. Therefore the XSS Auditor may fail to block an injection because the
snippet it requested may not be the snippet that it intended to request.
Tests: http/tests/security/xssAuditor/dom-write-location-dom-write-open-img-onerror.html
http/tests/security/xssAuditor/dom-write-location-open-img-onerror.html
http/tests/security/xssAuditor/nested-dom-write-location-open-img-onerror.html
* html/parser/HTMLSourceTracker.cpp:
(WebCore::HTMLSourceTracker::startToken): Set the attribute base offset to be the token
start position.
(WebCore::HTMLSourceTracker::source): Use the specified attribute start position as-is. We no
longer adjust it here because it was adjusted with respect to the attribute base offset, which
takes into account document.write() boundaries.
* html/parser/HTMLToken.h:
(WebCore::HTMLToken::setAttributeBaseOffset): Added.
(WebCore::HTMLToken::beginAttribute): Subtract attribute base offset from the specified offset.
(WebCore::HTMLToken::endAttribute): Ditto.
* html/parser/HTMLTokenizer.h:
(WebCore::HTMLTokenizer::setTokenAttributeBaseOffset): Added.
2016-10-25 Chris Dumez <cdumez@apple.com>
IDBDatabase.transaction() should take a union in parameter
https://bugs.webkit.org/show_bug.cgi?id=163966
Reviewed by Sam Weinig.
IDBDatabase.transaction() should take a union in parameter:
- https://www.w3.org/TR/IndexedDB/#widl-IDBDatabase-transaction-IDBTransaction-DOMString-sequence-DOMString--storeNames-IDBTransactionMode-mode
No new tests, no expected Web-exposed behavior change.
* Modules/indexeddb/IDBDatabase.cpp:
(WebCore::IDBDatabase::transaction):
* Modules/indexeddb/IDBDatabase.h:
* Modules/indexeddb/IDBDatabase.idl:
2016-10-25 Brady Eidson <beidson@apple.com>
IndexedDB 2.0: Support IDBObjectStore openKeyCursor.
<rdar://problem/28806930> and https://bugs.webkit.org/show_bug.cgi?id=163954
Reviewed by Andy Estes.
No new tests (Covered by changes to existing tests)
* Modules/indexeddb/IDBCursor.cpp:
(WebCore::IDBCursor::create):
* Modules/indexeddb/IDBCursor.h:
* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::openCursor):
(WebCore::IDBObjectStore::openKeyCursor):
* Modules/indexeddb/IDBObjectStore.h:
* Modules/indexeddb/IDBObjectStore.idl:
* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::requestOpenCursor):
* Modules/indexeddb/server/MemoryObjectStoreCursor.cpp:
(WebCore::IDBServer::MemoryObjectStoreCursor::currentData): Only grab the current value
if the cursor is KeyAndValue.
* Modules/indexeddb/server/SQLiteIDBCursor.cpp:
(WebCore::IDBServer::SQLiteIDBCursor::SQLiteIDBCursor):
(WebCore::IDBServer::SQLiteIDBCursor::internalAdvanceOnce): Only save off the data for an
object store cursor if it's both KeyAndValue.
* Modules/indexeddb/server/SQLiteIDBCursor.h:
* Modules/indexeddb/shared/IDBCursorInfo.cpp:
(WebCore::IDBCursorInfo::objectStoreCursor): Allow for a KeyOnly ObjectStoreCursor.
* Modules/indexeddb/shared/IDBCursorInfo.h:
2016-10-25 Wenson Hsieh <wenson_hsieh@apple.com>
Support InputEvent.dataTransfer for the InputEvent spec
https://bugs.webkit.org/show_bug.cgi?id=163213
<rdar://problem/28700407>
Reviewed by Ryosuke Niwa.
Adds support for the dataTransfer attribute of InputEvent, which contains both HTML and plain text
representations of inserted content corresponding to input types "insertFromPaste", "insertFromDrop" and
"insertReplacementText". The specification calls for the data transfer's drag data item list to contain this
information via two entries with type strings "text/html" and "text/plain". However, WebKit does not yet support
the DataTransfer.items -- in lieu of this, we will provide this information for now via getData("text/plain")
and getData("text/html"), respectively.
To support this attribute, we need a special type of DataTransfer which is readonly and returns canned data
given a type string. To implement this, we introduce StaticPasteboard, a type of Pasteboard which is initialized
with a map of type string to data. When asked for its data via getData, the StaticPasteboard searches its map
for the requested type and returns the result, if any.
An editing command may now create a new DataTransfer via DataTransfer::createForInputEvent from HTML and
plaintext strings, and then vend this information to its dispatched input events by overriding
CompositeEditCommand::inputEventDataTransfer.
Some further work will be needed to ensure that all information exposed via this DataTransfer does not contain
hidden content. To do this, we should create a new Document, "paste" the contents of our copied HTML string into
it, then simulate selecting the content and generating markup from the selection to create a sanitized
DocumentFragment corresponding to the original copied HTML. This will be addressed in a future patch.
Tests: fast/events/input-events-paste-rich-datatransfer.html
fast/events/input-events-spell-checking-datatransfer.html
* PlatformEfl.cmake:
* PlatformGTK.cmake:
* PlatformWin.cmake:
Add StaticPasteboard.cpp.
* WebCore.xcodeproj/project.pbxproj:
* dom/DataTransfer.cpp:
(WebCore::DataTransfer::DataTransfer):
(WebCore::DataTransfer::createForInputEvent):
Initializes a new DataTransfer for the purposes of input events. This takes a HTML and plain text
representations of the data being inserted and creates a new readonly DataTransfer backed by a StaticPasteboard
that only knows how to map the "text/plain" data type to the given plaintext string and "text/html" to the
given HTML text.
* dom/DataTransfer.h:
* dom/InputEvent.cpp:
(WebCore::InputEvent::create):
(WebCore::InputEvent::InputEvent):
(WebCore::InputEvent::dataTransfer):
* dom/InputEvent.h:
* dom/InputEvent.idl:
Add the InputEvent.dataTransfer attribute.
* dom/Node.cpp:
* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::inputEventDataTransfer):
Add a new hook for CompositeEditCommands to vend a DataTransfer for the purposes of input events. By default,
this is null.
* editing/CompositeEditCommand.h:
* editing/Editor.cpp:
(WebCore::dispatchBeforeInputEvent):
(WebCore::dispatchInputEvent):
(WebCore::dispatchBeforeInputEvents):
(WebCore::dispatchInputEvents):
(WebCore::Editor::willApplyEditing):
(WebCore::Editor::appliedEditing):
* editing/ReplaceRangeWithTextCommand.cpp:
(WebCore::ReplaceRangeWithTextCommand::willApplyCommand):
(WebCore::ReplaceRangeWithTextCommand::doApply):
(WebCore::ReplaceRangeWithTextCommand::inputEventDataTransfer):
* editing/ReplaceRangeWithTextCommand.h:
* editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplaceSelectionCommand::willApplyCommand):
Initialize the ReplacementFragment here before applying the command, adjusting the DocumentFragment to be
inserted in the process.
(WebCore::ReplaceSelectionCommand::doApply):
(WebCore::ReplaceSelectionCommand::inputEventDataTransfer):
(WebCore::ReplaceSelectionCommand::ensureReplacementFragment):
Returns the ReplacementFragment used to apply the command, initializing it if necessary and stripping extraneous
nodes off of the document fragment in the process. Since ReplaceSelectionCommand may be used as a top-level
editing command or a child of another CompositeEditCommand such as the ReplaceRangeWithTextCommand, the
ReplacementFragment may be initialized either in willApplyCommand or in doApply.
* editing/ReplaceSelectionCommand.h:
* editing/SpellingCorrectionCommand.cpp:
(WebCore::SpellingCorrectionCommand::willApplyCommand):
(WebCore::SpellingCorrectionCommand::doApply):
(WebCore::SpellingCorrectionCommand::inputEventDataTransfer):
* editing/SpellingCorrectionCommand.h:
Using the replacement text fragment, create and return a DataTransfer for input events.
* platform/Pasteboard.h:
* platform/StaticPasteboard.cpp: Added.
(WebCore::StaticPasteboard::create):
(WebCore::StaticPasteboard::StaticPasteboard):
(WebCore::StaticPasteboard::hasData):
(WebCore::StaticPasteboard::types):
(WebCore::StaticPasteboard::readString):
* platform/StaticPasteboard.h: Copied from Source/WebCore/dom/InputEvent.cpp.
* platform/efl/PasteboardEfl.cpp:
(WebCore::Pasteboard::writeMarkup):
(WebCore::Pasteboard::write):
(WebCore::Pasteboard::read):
* platform/gtk/PasteboardGtk.cpp:
(WebCore::Pasteboard::writeMarkup):
* platform/ios/PasteboardIOS.mm:
(WebCore::Pasteboard::writeMarkup):
* platform/mac/PasteboardMac.mm:
(WebCore::Pasteboard::Pasteboard):
(WebCore::Pasteboard::writeMarkup):
* platform/win/PasteboardWin.cpp:
(WebCore::Pasteboard::write):
(WebCore::Pasteboard::read):
To account for virtual methods on Pasteboard, add implementations for methods that were previously defined but
unimplemented on these platforms.
2016-10-25 Andy Estes <aestes@apple.com>
Implement rel=noopener
https://bugs.webkit.org/show_bug.cgi?id=155166
<rdar://problem/25193787>
Reviewed by Brent Fulgham.
Added support for rel=noopener to a and area elements.
Tests: fast/dom/Window/a-rel-noopener.html
fast/dom/Window/area-rel-noopener.html
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::HTMLAnchorElement): Stopped initializing m_linkRelations to 0.
(WebCore::HTMLAnchorElement::parseAttribute): Declared static AtomicStrings for "noreferrer"
and "noopener", and created a SpaceSplitString from the rel attribute value to test for these
two values.
(WebCore::HTMLAnchorElement::hasRel): Updated to use OptionSet::contains().
(WebCore::HTMLAnchorElement::relList): Added a check for "noopener".
(WebCore::HTMLAnchorElement::handleClick): Passed NewFrameOpenerPolicy::Suppress to
FrameLoader::urlSelected() if rel=noopener was specified.
* html/HTMLAnchorElement.h: Changed the Relation enum to an enum class, removed unused enum
values, and changed m_linkRelations from a 30-bit unsigned integer to an OptionSet<Relation>
(HTMLAnchorElement is still 128 bytes on 64-bit).
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::urlSelected): Changed to only compute a NewFrameOpenerPolicy from the
referrer policy if an explicit NewFrameOpenerPolicy isn't specified. Removed the version of
urlSelected() that did not take a downloadAttribute parameter.
* loader/FrameLoader.h: Added an Optional<NewFrameOpenerPolicy> parameter to urlSelected(),
and set a default argument for downloadAttribute instead of having a second version of
urlSelected().
2016-10-25 Eric Carlson <eric.carlson@apple.com>
[MediaStream] Add "has capture device" bit to media state flags
https://bugs.webkit.org/show_bug.cgi?id=163952
Reviewed by Jer Noble.
No new tests, updated fast/mediastream/MediaStream-page-muted.html, media/muted-video-is-playing-audio.html,
and webaudio/web-audio-is-playing.html.
* Modules/mediastream/MediaStream.cpp:
(WebCore::MediaStream::mediaState): Set HasMediaCaptureDevice, only set HasActiveMediaCaptureDevice when
actually producing data.
* page/MediaProducer.h: Add HasMediaCaptureDevice bit.
* testing/Internals.cpp:
(WebCore::Internals::pageMediaState): Return a string representing MediaStateFlags.
(WebCore::Internals::isPagePlayingAudio): Deleted.
* testing/Internals.h:
* testing/Internals.idl:
2016-10-25 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r207827 and r207828.
https://bugs.webkit.org/show_bug.cgi?id=163965
Caused LayoutTest webaudio/web-audio-is-playing.html to time
out on macOS. (Requested by ryanhaddad on #webkit).
Reverted changesets:
"[MediaStream] Add "has capture device" bit to media state
flags"
https://bugs.webkit.org/show_bug.cgi?id=163952
http://trac.webkit.org/changeset/207827
"[MediaStream] Add "has capture device" bit to media state
flags"
https://bugs.webkit.org/show_bug.cgi?id=163952
http://trac.webkit.org/changeset/207828
2016-10-25 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Media Controller: skip back support
https://bugs.webkit.org/show_bug.cgi?id=163725
<rdar://problem/27989480>
Reviewed by Dean Jackson.
We introduce the SkipBackSupport class which brings support for skipping back
30 seconds into the media by clicking on the skip back button in the media controls.
Test: http/tests/media/modern-media-controls/skip-back-support/skip-back-support-button-click.html
* Modules/modern-media-controls/js-files:
* Modules/modern-media-controls/media/media-controller.js:
(MediaController):
* Modules/modern-media-controls/media/skip-back-support.js: Copied from Source/WebCore/Modules/modern-media-controls/media/media-controller.js.
(SkipBackSupport.prototype.get control):
(SkipBackSupport.prototype.buttonWasClicked):
(SkipBackSupport):
* WebCore.xcodeproj/project.pbxproj:
2016-10-25 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r207578.
https://bugs.webkit.org/show_bug.cgi?id=163962
Broke quip.com so that user can no longer type a space
(Requested by rniwa on #webkit).
Reverted changeset:
"Add a plain space instead of &nbsp; between text nodes"
https://bugs.webkit.org/show_bug.cgi?id=123163
http://trac.webkit.org/changeset/207578
2016-10-25 Chris Dumez <cdumez@apple.com>
LOG_WITH_STREAM() macro should not have a semi colon at the end
https://bugs.webkit.org/show_bug.cgi?id=163951
Reviewed by Simon Fraser.
* platform/LogMacros.h:
2016-10-25 Chris Dumez <cdumez@apple.com>
IDBObjectStore.createIndex() should take a union in parameter
https://bugs.webkit.org/show_bug.cgi?id=163935
Reviewed by Darin Adler.
IDBObjectStore.createIndex() should take a union in parameter:
- https://www.w3.org/TR/IndexedDB/#idl-def-IDBObjectStore
No new tests, no expected Web-exposed behavior change.
* Modules/indexeddb/IDBDatabase.cpp:
(WebCore::IDBDatabase::createObjectStore):
* Modules/indexeddb/IDBKeyPath.cpp:
(WebCore::isIDBKeyPathValid):
(WebCore::IDBKeyPath::isValid): Deleted.
* Modules/indexeddb/IDBKeyPath.h:
(WebCore::IDBKeyPath::isNull):
* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::createIndex):
* Modules/indexeddb/IDBObjectStore.h:
* Modules/indexeddb/IDBObjectStore.idl:
2016-10-24 Sam Weinig <sam@webkit.org>
[WebIDL] Move more types over to the new JSConverter based toJS functions
https://bugs.webkit.org/show_bug.cgi?id=163920
Reviewed by Darin Adler.
- Adds WebIDL-extension type IDLDate, and use it for Date conversions.
- Move JSDOMIterator over to using IDLType based conversions. Make them more
explicit by adding a traits template argument which describes the iterator.
- Add correct parsing for WebIDL iterable, parsing the parameter types into
domTypes.
- Support non-Optional nullable types via trait-like functions on IDLTypes.
* bindings/generic/IDLTypes.h:
(WebCore::IDLType::isNullValue):
(WebCore::IDLType::extractValueFromNullable):
(WebCore::IDLString::isNullValue):
(WebCore::IDLString::extractValueFromNullable):
(WebCore::IDLInterface::isNullValue):
(WebCore::IDLInterface::extractValueFromNullable):
(WebCore::IDLDate::isNullValue):
(WebCore::IDLDate::extractValueFromNullable):
Add isNullValue and extractValueFromNullable functions to allow non-Optional
based nullable types.
* Modules/plugins/QuickTimePluginReplacement.mm:
(WebCore::QuickTimePluginReplacement::installReplacement):
* bindings/js/IDBBindingUtilities.cpp:
(WebCore::toJS):
* bindings/js/JSCSSStyleDeclarationCustom.cpp:
(WebCore::stylePropertyGetter):
* bindings/js/JSCustomElementInterface.cpp:
(WebCore::JSCustomElementInterface::invokeAttributeChangedCallback):
Switch to IDLType based toJS.
* bindings/js/JSDOMBinding.cpp:
(WebCore::jsStringOrNull): Deleted.
(WebCore::jsDateOrNull): Deleted.
* bindings/js/JSDOMBinding.h:
(WebCore::jsPair): Deleted.
(WebCore::toJSNullableString): Deleted.
Remove now unusued toJS functions.
* bindings/js/JSDOMConvert.h:
(WebCore::JSConverter<IDLNullable<T>>::convert):
Use new functions to detect and extract nullable values.
(WebCore::Converter<IDLBufferSource>::convert):
Moved to be with the other converters.
(WebCore::Converter<IDLDate>::convert):
(WebCore::JSConverter<IDLDate>::convert):
Added.
* bindings/js/JSDOMIterator.h:
(WebCore::jsPair):
(WebCore::iteratorCreate):
(WebCore::IteratorTraits>::asJS):
(WebCore::appendForEachArguments):
(WebCore::iteratorForEach):
(WebCore::IteratorTraits>::destroy):
(WebCore::IteratorTraits>::next):
(WebCore::IteratorTraits>::finishCreation):
(WebCore::IteratorInspector::decltype): Deleted.
(WebCore::IteratorInspector::test): Deleted.
(WebCore::JSDOMIterator<JSWrapper>::asJS): Deleted.
(WebCore::JSDOMIterator<JSWrapper>::destroy): Deleted.
(WebCore::JSDOMIterator<JSWrapper>::next): Deleted.
(WebCore::JSDOMIteratorPrototype<JSWrapper>::next): Deleted.
(WebCore::JSDOMIteratorPrototype<JSWrapper>::finishCreation): Deleted.
Switch to new Traits based model, and have the generated code pass in
the type (map or set) and key/value types. With the explicit types known,
we can use the new toJS functions.
Also, moved the jsPair functions here from JSDOMBinding.h, since this was
the only place it was used.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementationIterableFunctions):
Add iterator trait definition and update for new parameters to JSDOMIterator
and JSDOMIteratorPrototype.
(GetBaseIDLType):
Add IDLDate, and move IDLBufferSource up to the simple path.
(JSValueToNativeIsHandledByDOMConvert):
Allow Date.
(JSValueToNative):
Remove special case for Date.
(NativeToJSValueIsHandledByDOMConvert):
Allow Date and remove restriction of nullable string-like types.
(NativeToJSValueDOMConvertNeedsState):
Add Date to list of types needing state.
(NativeToJSValue):
Remove special cases for Date and nullable-strings.
* bindings/scripts/IDLParser.pm:
(parseOptionalIterableInterface):
Add correct parsing of iterable.
* bindings/scripts/test/JS/JSTestIterable.cpp:
* bindings/scripts/test/JS/JSTestNode.cpp:
* bindings/scripts/test/JS/JSTestObj.cpp:
Update test results.
2016-10-25 Eric Carlson <eric.carlson@apple.com>
[MediaStream] Add "has capture device" bit to media state flags
https://bugs.webkit.org/show_bug.cgi?id=163952
Reviewed by Jer Noble.
No new tests, updated fast/mediastream/MediaStream-page-muted.html and media/muted-video-is-playing-audio.html.
* Modules/mediastream/MediaStream.cpp:
(WebCore::MediaStream::mediaState): Set HasMediaCaptureDevice, only set HasActiveMediaCaptureDevice when
actually producing data.
* page/MediaProducer.h: Add HasMediaCaptureDevice bit.
* testing/Internals.cpp:
(WebCore::Internals::pageMediaState): Return a string representing MediaStateFlags.
(WebCore::Internals::isPagePlayingAudio): Deleted.
* testing/Internals.h:
* testing/Internals.idl:
2016-10-25 Brady Eidson <beidson@apple.com>
IndexedDB 2.0: Support new IDBTransaction interfaces.
<rdar://problem/28806928> and https://bugs.webkit.org/show_bug.cgi?id=163927
Reviewed by Sam Weinig.
Tests: storage/indexeddb/modern/idbtransaction-objectstores-1-private.html
storage/indexeddb/modern/idbtransaction-objectstores-1.html
At least partially passing results on 5 previously failed W3C tests.
The "new IDBTransaction interfaces" really just means adding the property IDBTransaction.objectStoreNames.
* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::objectStoreNames):
* Modules/indexeddb/IDBTransaction.h:
* Modules/indexeddb/IDBTransaction.idl:
2016-10-25 Youenn Fablet <youenn@apple.com>
MediaEndpointConfiguration does not need to be refcounted
https://bugs.webkit.org/show_bug.cgi?id=163888
Reviewed by Eric Carlson.
No change of behavior.
Updating MediaEndpoint to take a MediaEndpointConfiguration&& instead of a RefPtr<MediaEndpointConfiguration>&&.
This allows ensuring that the configuration is not null and removes the need to ref-count it.
Removing ref-counting from MediaEndpointConfiguration and its related IceServer that is now a struct.
Updated MediaEndpointOwr and mock implementations accordingly.
* Modules/mediastream/MediaEndpointPeerConnection.cpp:
(WebCore::MediaEndpointPeerConnection::setConfiguration):
* platform/mediastream/MediaEndpoint.cpp:
* platform/mediastream/MediaEndpoint.h:
* platform/mediastream/MediaEndpointConfiguration.cpp:
(WebCore::MediaEndpointConfiguration::MediaEndpointConfiguration):
* platform/mediastream/MediaEndpointConfiguration.h:
(WebCore::MediaEndpointConfiguration::iceServers):
* platform/mediastream/openwebrtc/MediaEndpointOwr.cpp:
(WebCore::MediaEndpointOwr::setConfiguration):
(WebCore::MediaEndpointOwr::ensureTransportAgentAndTransceivers):
* platform/mediastream/openwebrtc/MediaEndpointOwr.h:
* platform/mock/MockMediaEndpoint.cpp:
* platform/mock/MockMediaEndpoint.h:
2016-10-25 Youenn Fablet <youenn@apple.com>
CachedResourceLoader should set headers of the HTTP request prior checking for the cache
https://bugs.webkit.org/show_bug.cgi?id=163103
Reviewed by Darin Adler.
No expected change of behavior.
Moved referrer, user-agent, and origin headers setting to CachedResourceRequest/CachedResourceLoader before checking the cache.
This allows simplifying vary header checks and is more inline with the fetch specification.
To compute the referrer value, we need to know whether the request is cross-origin.
A helper function isRequestCrossOrigin is added for that purpose and is also used in CachedResource to set its initial response tainting.
We should disable setting user-agent and origin headers by FrameLoader for subresources since this is now done in CachedResourceLoader.
This could be done as a follow-up patch.
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::CachedResource):
(WebCore::CachedResource::load):
(WebCore::CachedResource::varyHeaderValuesMatch):
(WebCore::addAdditionalRequestHeadersToRequest): Deleted.
(WebCore::CachedResource::addAdditionalRequestHeaders): Deleted.
* loader/cache/CachedResource.h:
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::updateHTTPRequestHeaders):
(WebCore::CachedResourceLoader::requestResource):
(WebCore::CachedResourceLoader::determineRevalidationPolicy):
* loader/cache/CachedResourceLoader.h:
* loader/cache/CachedResourceRequest.cpp:
(WebCore::CachedResourceRequest::updateForAccessControl):
(WebCore::CachedResourceRequest::updateReferrerOriginAndUserAgentHeaders):
(WebCore::isRequestCrossOrigin):
* loader/cache/CachedResourceRequest.h:
(WebCore::CachedResourceRequest::setOrigin):
2016-10-25 Andreas Kling <akling@apple.com>
More PassRefPtr purging in WebCore.
<https://webkit.org/b/163895>
Reviewed by Antti Koivisto.
Remove PassRefPtr usage in RenderStyle, RenderTheme and Scrollbar, then fix up all the fallout.
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::contentToCSSValue):
(WebCore::shapePropertyValue):
(WebCore::ComputedStyleExtractor::propertyValue):
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertQuotes):
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::usesMenuList):
(WebCore::HTMLSelectElement::platformHandleKeydownEvent):
(WebCore::HTMLSelectElement::menuListDefaultEventHandler):
* html/InputType.cpp:
(WebCore::InputType::themeSupportsDataListUI):
* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::shouldHaveSpinButton):
(WebCore::TextFieldInputType::shouldHaveCapsLockIndicator):
* loader/SubframeLoader.cpp:
(WebCore::SubframeLoader::loadPlugin):
* page/FrameView.cpp:
(WebCore::FrameView::createScrollbar):
* page/FrameView.h:
* page/animation/CSSPropertyAnimation.cpp:
(WebCore::RefCountedPropertyWrapper::RefCountedPropertyWrapper):
(WebCore::PropertyWrapperClipPath::PropertyWrapperClipPath):
(WebCore::PropertyWrapperShape::PropertyWrapperShape):
(WebCore::StyleImagePropertyWrapper::StyleImagePropertyWrapper):
(WebCore::FillLayerRefCountedPropertyWrapper::FillLayerRefCountedPropertyWrapper):
(WebCore::FillLayerStyleImagePropertyWrapper::FillLayerStyleImagePropertyWrapper):
* platform/PopupMenuClient.h:
* platform/ScrollView.cpp:
(WebCore::ScrollView::createScrollbar):
* platform/ScrollView.h:
* platform/Scrollbar.cpp:
(WebCore::Scrollbar::createNativeScrollbar):
* platform/Scrollbar.h:
* rendering/FilterEffectRenderer.cpp:
(WebCore::FilterEffectRenderer::buildReferenceFilter):
* rendering/FilterEffectRenderer.h:
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::createScrollbar):
(WebCore::RenderLayer::createLocalTransformState):
(WebCore::RenderLayer::hitTestLayerByApplyingTransform):
* rendering/RenderLayer.h:
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::createScrollbar):
* rendering/RenderListBox.h:
* rendering/RenderMenuList.cpp:
(RenderMenuList::createScrollbar):
* rendering/RenderMenuList.h:
* rendering/RenderScrollbar.cpp:
(WebCore::RenderScrollbar::createCustomScrollbar):
* rendering/RenderScrollbar.h:
* rendering/RenderSearchField.cpp:
(WebCore::RenderSearchField::createScrollbar):
* rendering/RenderSearchField.h:
* rendering/RenderTheme.h:
(WebCore::RenderTheme::defaultTheme):
* rendering/RenderThemeEfl.cpp:
(WebCore::RenderThemeEfl::create):
(WebCore::RenderTheme::themeForPage):
* rendering/RenderThemeEfl.h:
* rendering/RenderThemeGtk.cpp:
(WebCore::RenderTheme::themeForPage):
* rendering/RenderThemeIOS.mm:
(WebCore::RenderTheme::themeForPage):
* rendering/RenderThemeMac.mm:
(WebCore::RenderTheme::themeForPage):
* rendering/RenderThemeWin.cpp:
(WebCore::RenderTheme::themeForPage):
* rendering/RenderWidget.cpp:
(WebCore::RenderWidget::setWidget):
* rendering/RenderWidget.h:
* rendering/style/CursorData.h:
(WebCore::CursorData::CursorData):
(WebCore::CursorData::setImage):
* rendering/style/FillLayer.h:
(WebCore::FillLayer::setImage):
* rendering/style/QuotesData.cpp:
(WebCore::QuotesData::create):
* rendering/style/QuotesData.h:
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::addCursor):
(WebCore::RenderStyle::setCursorList):
(WebCore::RenderStyle::setQuotes):
(WebCore::RenderStyle::setWillChange):
(WebCore::RenderStyle::setContent):
(WebCore::RenderStyle::setListStyleImage):
(WebCore::RenderStyle::setBorderImageSource):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::setMaskImage):
(WebCore::RenderStyle::setMaskBoxImageSource):
(WebCore::RenderStyle::setBoxReflect):
(WebCore::RenderStyle::setShapeOutside):
(WebCore::RenderStyle::setClipPath):
* rendering/style/StyleCachedImage.cpp:
(WebCore::StyleCachedImage::cssValue):
* rendering/style/StyleCachedImage.h:
* rendering/style/StyleGeneratedImage.cpp:
(WebCore::StyleGeneratedImage::cssValue):
* rendering/style/StyleGeneratedImage.h:
* rendering/style/StyleImage.h:
* rendering/style/StyleMultiColData.h:
* rendering/style/StyleRareInheritedData.h:
2016-10-24 Ryosuke Niwa <rniwa@webkit.org>
Custom elements reactions should have a queue per element
https://bugs.webkit.org/show_bug.cgi?id=163878
Reviewed by Antti Koivisto.
This patch splits the custom elements reaction queue into per element to match the latest HTML specifications:
https://html.spec.whatwg.org/multipage/scripting.html#custom-element-reaction-queue
and introduces the backup element queue:
https://html.spec.whatwg.org/multipage/scripting.html#backup-element-queue
In terms of code changes, CustomElementReactionStack now holds onto ElementQueue, an ordered list of elements,
and make each ElementRareData keep its own CustomElementReactionQueue. CustomElementReactionQueue is created
for each custom element when it is synchronously constructed or enqueued to upgrade.
Because each reaction queue is now specific to each element, CustomElementReactionQueue instead of
CustomElementReactionQueueItem stores JSCustomElementInterface.
The backup element queue is created as a singleton returned by CustomElementReactionStack's backupElementQueue,
and ensureBackupQueue() schedules a new mirotask to process the backup queue when there isn't already one.
ensureCurrentQueue() now returns a reference to CustomElementReactionQueue instead of a pointer since it can
fallback to the backup queue when the stack is empty as specified:
https://html.spec.whatwg.org/multipage/scripting.html#enqueue-an-element-on-the-appropriate-element-queue
Note that ensureCurrentQueue() may insert the same element multiple times into the element queue for now since
avoiding this duplication would require either doing O(n) iteration on m_elements or adding a HashSet.
We can revisit this in the future if the reaction queue is found to grow beyond a few entries since elements in
the element queue will have duplicates only when each reaction queue has more than one item.
Tests: fast/custom-elements/backup-element-queue.html
fast/custom-elements/custom-element-reaction-queue.html
* bindings/js/JSCustomElementInterface.cpp:
(WebCore::JSCustomElementInterface::upgradeElement):
* dom/CustomElementReactionQueue.cpp:
(WebCore::CustomElementReactionQueueItem::CustomElementReactionQueueItem):
(WebCore::CustomElementReactionQueueItem::invoke): Removed the check for isFailedCustomElement since the queue
is explicitly cleared in Element::setIsFailedCustomElement.
(WebCore::CustomElementReactionQueue::CustomElementReactionQueue): Now takes JSCustomElementInterface since
each item in the queue no longer stores Element or JSCustomElementInterface.
(WebCore::CustomElementReactionQueue::clear):
(WebCore::CustomElementReactionQueue::enqueueElementUpgrade):
(WebCore::CustomElementReactionQueue::enqueueElementUpgradeIfDefined):
(WebCore::CustomElementReactionQueue::enqueueConnectedCallbackIfNeeded):
(WebCore::CustomElementReactionQueue::enqueueDisconnectedCallbackIfNeeded):
(WebCore::CustomElementReactionQueue::enqueueAdoptedCallbackIfNeeded):
(WebCore::CustomElementReactionQueue::enqueueAttributeChangedCallbackIfNeeded):
(WebCore::CustomElementReactionQueue::enqueuePostUpgradeReactions):
(WebCore::CustomElementReactionQueue::invokeAll):
(WebCore::CustomElementReactionStack::ElementQueue::add): Added.
(WebCore::CustomElementReactionStack::ElementQueue::invokeAll): Added.
(WebCore::CustomElementReactionStack::ensureCurrentQueue):
(WebCore::BackupElementQueueMicrotask): Added.
(WebCore::CustomElementReactionStack::ensureBackupQueue): Added.
(WebCore::CustomElementReactionStack::processBackupQueue): Added.
(WebCore::CustomElementReactionStack::backupElementQueue): Added.
* dom/CustomElementReactionQueue.h:
* dom/CustomElementRegistry.cpp:
(WebCore::enqueueUpgradeInShadowIncludingTreeOrder):
* dom/Document.cpp:
(WebCore::createFallbackHTMLElement):
* dom/Element.cpp:
(WebCore::Element::setIsDefinedCustomElement): Create a new reaction queue if there isn't already one; when
this element had been upgraded, the reaction queue have already been created in Element::enqueueToUpgrade.
(WebCore::Element::setIsFailedCustomElement): Clear the reaction queue when the upgrading had failed.
(WebCore::Element::enqueueToUpgrade): Added.
(WebCore::Element::reactionQueue): Added.
* dom/Element.h:
* dom/ElementRareData.h:
(WebCore::ElementRareData::customElementReactionQueue): Replaced customElementInterface.
(WebCore::ElementRareData::setCustomElementReactionQueue): Replaced setCustomElementReactionQueue.
2016-10-24 Jiewen Tan <jiewen_tan@apple.com>
Update SubtleCrypto::generateKey to match the latest spec
https://bugs.webkit.org/show_bug.cgi?id=163718
<rdar://problem/28864380>
Reviewed by Chris Dumez.
This patch does following few things:
1. It updates the SubtleCrypto::generateKey method to match the latest spec:
https://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-generateKey.
It also refers to the latest Editor's Draft at a certain degree:
https://w3c.github.io/webcrypto/Overview.html#SubtleCrypto-method-generateKey.
2. It implements generateKey operations of following algorithms: AES-CBC, AES-KW,
HMAC, RSAES-PKCS1-V1_5, RSASSA-PKCS1-V1_5, and RSA-OAEP.
3. It replaces SPECIALIZE_TYPE_TRAITS_CRYPTO_ALGORITHM_PARAMETERS with
SPECIALIZE_TYPE_TRAITS_CRYPTO_ALGORITHM_PARAMETERS_DEPRECATED for deprecated params.
4. It fixes https://bugs.webkit.org/show_bug.cgi?id=129750 as well.
Tests: crypto/subtle/aes-cbc-generate-key-length-128.html
crypto/subtle/aes-cbc-generate-key-length-192.html
crypto/subtle/aes-cbc-generate-key-length-256.html
crypto/subtle/aes-generate-key-malformed-parameters.html
crypto/subtle/aes-kw-generate-key.html
crypto/subtle/generate-key-malformed-paramters.html
crypto/subtle/hmac-generate-key-customized-length.html
crypto/subtle/hmac-generate-key-hash-object.html
crypto/subtle/hmac-generate-key-malformed-parameters.html
crypto/subtle/hmac-generate-key-sha1.html
crypto/subtle/hmac-generate-key-sha224.html
crypto/subtle/hmac-generate-key-sha256.html
crypto/subtle/hmac-generate-key-sha384.html
crypto/subtle/hmac-generate-key-sha512.html
crypto/subtle/rsa-generate-key-malformed-parameters.html
crypto/subtle/rsa-oaep-generate-key.html
crypto/subtle/rsaes-pkcs1-v1_5-generate-key-extractable.html
crypto/subtle/rsaes-pkcs1-v1_5-generate-key.html
crypto/subtle/rsassa-pkcs1-v1_5-generate-key.html
crypto/webkitSubtle/hmac-generate-key.html:
crypto/workers/subtle/aes-generate-key.html
crypto/workers/subtle/hmac-generate-key.html
crypto/workers/subtle/rsa-generate-key.html
* CMakeLists.txt:
* DerivedSources.make:
* Modules/encryptedmedia/CDMSessionClearKey.cpp:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSSubtleCryptoCustom.cpp: Added.
(WebCore::toHashIdentifier):
(WebCore::normalizeCryptoAlgorithmParameters):
(WebCore::cryptoKeyUsagesFromJSValue):
(WebCore::createAlgorithm):
(WebCore::rejectWithException):
(WebCore::jsSubtleCryptoFunctionGenerateKeyPromise):
(WebCore::JSSubtleCrypto::generateKey):
* bindings/js/JSWebKitSubtleCryptoCustom.cpp:
(WebCore::JSWebKitSubtleCrypto::generateKey):
* crypto/CryptoAlgorithm.cpp:
(WebCore::CryptoAlgorithm::generateKey):
* crypto/CryptoAlgorithm.h:
* crypto/CryptoAlgorithmParameters.h: Added.
(WebCore::CryptoAlgorithmParameters::CryptoAlgorithmParameters):
(WebCore::CryptoAlgorithmParameters::~CryptoAlgorithmParameters):
(WebCore::CryptoAlgorithmParameters::parametersClass):
* crypto/CryptoAlgorithmParameters.idl: Added.
* crypto/CryptoAlgorithmParametersDeprecated.h:
* crypto/CryptoKey.cpp:
(WebCore::CryptoKey::setUsagesBitmap):
* crypto/CryptoKey.h:
* crypto/CryptoKeyPair.idl:
* crypto/SubtleCrypto.idl:
* crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
(WebCore::CryptoAlgorithmAES_CBC::generateKey):
* crypto/algorithms/CryptoAlgorithmAES_CBC.h:
* crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
(WebCore::CryptoAlgorithmAES_KW::generateKey):
* crypto/algorithms/CryptoAlgorithmAES_KW.h:
* crypto/algorithms/CryptoAlgorithmHMAC.cpp:
(WebCore::CryptoAlgorithmHMAC::generateKey):
* crypto/algorithms/CryptoAlgorithmHMAC.h:
* crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::generateKey):
* crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h:
* crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::generateKey):
* crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h:
* crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
(WebCore::CryptoAlgorithmRSA_OAEP::generateKey):
* crypto/algorithms/CryptoAlgorithmRSA_OAEP.h:
* crypto/gnutls/CryptoKeyRSAGnuTLS.cpp:
(WebCore::CryptoKeyRSA::generatePair):
* crypto/keys/CryptoKeyAES.cpp:
(WebCore::CryptoKeyAES::generate):
* crypto/keys/CryptoKeyHMAC.cpp:
(WebCore::CryptoKeyHMAC::generate):
* crypto/keys/CryptoKeyRSA.h:
* crypto/mac/CryptoKeyRSAMac.cpp:
(WebCore::CryptoKeyRSA::generatePair):
* crypto/parameters/AesKeyGenParams.idl: Added.
* crypto/parameters/CryptoAlgorithmAesCbcParamsDeprecated.h:
* crypto/parameters/CryptoAlgorithmAesKeyGenParams.h: Added.
* crypto/parameters/CryptoAlgorithmAesKeyGenParamsDeprecated.h:
* crypto/parameters/CryptoAlgorithmHmacKeyGenParams.h: Added.
* crypto/parameters/CryptoAlgorithmHmacKeyParamsDeprecated.h:
* crypto/parameters/CryptoAlgorithmHmacParamsDeprecated.h:
* crypto/parameters/CryptoAlgorithmRsaHashedKeyGenParams.h: Added.
* crypto/parameters/CryptoAlgorithmRsaKeyGenParams.h: Added.
(WebCore::CryptoAlgorithmRsaKeyGenParams::arrayToVector):
* crypto/parameters/CryptoAlgorithmRsaKeyGenParamsDeprecated.h:
* crypto/parameters/CryptoAlgorithmRsaKeyParamsWithHashDeprecated.h:
* crypto/parameters/CryptoAlgorithmRsaOaepParamsDeprecated.h:
* crypto/parameters/CryptoAlgorithmRsaSsaParamsDeprecated.h:
* crypto/parameters/HmacKeyGenParams.idl: Added.
* crypto/parameters/RsaHashedKeyGenParams.idl: Added.
* crypto/parameters/RsaKeyGenParams.idl: Added.
2016-10-24 Chris Dumez <cdumez@apple.com>
IDBDatabase.createObjectStore() should take a IDBObjectStoreParameters dictionary in parameter
https://bugs.webkit.org/show_bug.cgi?id=163916
Reviewed by Darin Adler.
IDBDatabase.createObjectStore() should take a IDBObjectStoreParameters dictionary in parameter:
- https://www.w3.org/TR/IndexedDB/#idl-def-IDBDatabase
- https://www.w3.org/TR/IndexedDB/#idl-def-IDBObjectStoreParameters
Align our IDL with the specification.
No new tests, no expected Web-exposed behavior change.
* Modules/indexeddb/IDBDatabase.cpp:
(WebCore::IDBDatabase::createObjectStore):
* Modules/indexeddb/IDBDatabase.h:
* Modules/indexeddb/IDBDatabase.idl:
* Modules/indexeddb/IDBKeyPath.cpp:
(WebCore::IDBKeyPath::IDBKeyPath):
* Modules/indexeddb/IDBKeyPath.h:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/IDBBindingUtilities.cpp:
(WebCore::idbKeyPathFromValue): Deleted.
* bindings/js/IDBBindingUtilities.h:
* bindings/js/JSIDBDatabaseCustom.cpp: Removed.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateParametersCheck):
(GenerateConstructorDefinition):
* dom/MessageEvent.cpp:
(WebCore::MessageEvent::MessageEvent):
(WebCore::MessageEvent::create):
* dom/MessageEvent.h:
* testing/TypeConversions.h:
(WebCore::TypeConversions::setTypeConversionsDictionary):
2016-10-24 Alex Christensen <achristensen@webkit.org>
URLParser should match old URL::parse with %2E in path
https://bugs.webkit.org/show_bug.cgi?id=163929
Reviewed by Alexey Proskuryakov.
Covered by updated API tests, which show that URLParser now matches URL::parse in these cases.
Also covered by newly failing web platform tests, which were failing before URLParser was enabled.
If https://github.com/whatwg/url/issues/87 is resolved we can change behavior to match.
* platform/URLParser.cpp:
(WebCore::URLParser::isSingleDotPathSegment):
(WebCore::URLParser::isDoubleDotPathSegment):
(WebCore::URLParser::consumeSingleDotPathSegment):
(WebCore::URLParser::consumeDoubleDotPathSegment):
(WebCore::URLParser::parse):
(WebCore::URLParser::isPercentEncodedDot): Deleted.
2016-10-24 Zalan Bujtas <zalan@apple.com>
Do not update selection rect on dirty lineboxes.
https://bugs.webkit.org/show_bug.cgi?id=163862
<rdar://problem/28813156>
Reviewed by Simon Fraser.
In certain cases RenderBlock::updateFirstLetter() triggers
unwanted render tree mutation while the caller assumes intact renderers.
This patch ensures that no renderers gets destroyed while computing the preferred widths
when we are outside of layout context.
Test: fast/css-generated-content/dynamic-first-letter-selection-clear-crash.html
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::computePreferredLogicalWidths):
(WebCore::RenderBlock::updateFirstLetter):
* rendering/RenderBlock.h:
* rendering/RenderListItem.cpp:
(WebCore::RenderListItem::insertOrMoveMarkerRendererIfNeeded):
* rendering/RenderRubyRun.cpp:
(WebCore::RenderRubyRun::updateFirstLetter):
* rendering/RenderRubyRun.h:
* rendering/RenderTable.cpp:
(WebCore::RenderTable::updateFirstLetter):
* rendering/RenderTable.h:
* rendering/svg/RenderSVGText.cpp:
(WebCore::RenderSVGText::updateFirstLetter):
* rendering/svg/RenderSVGText.h:
2016-10-24 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r207795.
Introduced API test failures on iOS and macOS.
Reverted changeset:
"URLParser should match old URL::parse with %2E in path"
https://bugs.webkit.org/show_bug.cgi?id=163929
http://trac.webkit.org/changeset/207795
2016-10-24 Yusuke Suzuki <utatane.tea@gmail.com>
Unreviewed, attempt to fix Windows build after r207787
https://bugs.webkit.org/show_bug.cgi?id=163657
Make the constructor public in DOMJIT::AbstractHeapRepository to make Windows bot green.
It's a bit unfortunate that we need to introduce a workaround here.
* domjit/DOMJITAbstractHeapRepository.h:
2016-10-24 Chris Dumez <cdumez@apple.com>
event.(dataTransfer|clipboardData).getData('text/html') (onpaste, ondrop)
https://bugs.webkit.org/show_bug.cgi?id=19893
<rdar://problem/6055546>
Reviewed by Ryosuke Niwa.
We now write selection as HTML as well to the pasteboard so that
event.(dataTransfer|clipboardData).getData('text/html') now works.
I have verified manually that it is still possible to copy text from
Safari and paste it to Excel 2011 Mac after this change. The text is
now pasted as HTML instead of text, which is fine because Excel can
display HTML.
No new tests, unskipped existing tests.
* editing/Editor.h:
* editing/mac/EditorMac.mm:
(WebCore::Editor::selectionInHTMLFormat):
(WebCore::Editor::writeSelectionToPasteboard):
* platform/Pasteboard.h:
* platform/mac/PasteboardMac.mm:
(WebCore::Pasteboard::write):
2016-10-24 Alex Christensen <achristensen@webkit.org>
URLParser should match old URL::parse with %2E in path
https://bugs.webkit.org/show_bug.cgi?id=163929
Reviewed by Alexey Proskuryakov.
Covered by updated API tests, which show that URLParser now matches URL::parse in these cases.
Also covered by newly failing web platform tests, which were failing before URLParser was enabled.
If https://github.com/whatwg/url/issues/87 is resolved we can change behavior to match.
* platform/URLParser.cpp:
(WebCore::URLParser::isSingleDotPathSegment):
(WebCore::URLParser::isDoubleDotPathSegment):
(WebCore::URLParser::consumeSingleDotPathSegment):
(WebCore::URLParser::consumeDoubleDotPathSegment):
(WebCore::URLParser::parse):
(WebCore::URLParser::isPercentEncodedDot): Deleted.
2016-10-24 Per Arne Vollan <pvollan@apple.com>
[Win] CMake build type is not set.
https://bugs.webkit.org/show_bug.cgi?id=163917
Reviewed by Alex Christensen.
The CMAKE_BUILD_TYPE variable should be set to Debug or Release.
* WebCore.vcxproj/WebCore.proj:
2016-10-24 Yusuke Suzuki <utatane.tea@gmail.com>
Unreviewed, attempt to fix Windows build after r207787
https://bugs.webkit.org/show_bug.cgi?id=163657
According to the similar code in WebKit, I guess that
Visual C++ requires friend class declaration is done
in the private section to access private members.
And I also changed ::instance to ::shared to align to
the existing WebCore code.
* domjit/DOMJITAbstractHeapRepository.cpp:
(WebCore::DOMJIT::AbstractHeapRepository::shared):
(WebCore::DOMJIT::AbstractHeapRepository::instance): Deleted.
* domjit/DOMJITAbstractHeapRepository.h:
* domjit/JSNodeDOMJIT.cpp:
(WebCore::NodeFirstChildDOMJIT::callDOM):
(WebCore::NodeLastChildDOMJIT::callDOM):
(WebCore::NodeNextSiblingDOMJIT::callDOM):
(WebCore::NodePreviousSiblingDOMJIT::callDOM):
(WebCore::NodeParentNodeDOMJIT::callDOM):
2016-10-24 Simon Fraser <simon.fraser@apple.com>
Fix the lifetime of strings used in LOG_WITH_STREAM
https://bugs.webkit.org/show_bug.cgi?id=163923
Reviewed by Brent Fulgham.
Make sure the const char* passed to WTFLog() outlives the call.
Removed logFunctionResult which wasn't used anywhere else, and encourages this bad
pattern.
* platform/LogMacros.h:
* platform/Logging.cpp:
(WebCore::logFunctionResult): Deleted.
2016-10-24 Chris Dumez <cdumez@apple.com>
Reduce special handling for typed arrays in JSDOMConvert.h
https://bugs.webkit.org/show_bug.cgi?id=163907
Reviewed by Sam Weinig.
Reduce special handling for typed arrays in JSDOMConvert.h by adding a toWrapped() static
function on JSGenericTypedArrayView, similarly to other wrapper types.
No new tests, no web-exposed behavior change.
* bindings/js/JSDOMConvert.h:
(WebCore::Converter<IDLInterface<JSC::GenericTypedArrayView<Adaptor>>>::convert): Deleted.
2016-10-24 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r207783.
This change appears to have caused fast/selectors/invalid-
functional-pseudo-class.html to crash on iOS and macOS
Reverted changeset:
"[CSS Parser] Fix :lang argument parsing"
https://bugs.webkit.org/show_bug.cgi?id=163913
http://trac.webkit.org/changeset/207783
2016-10-24 Brady Eidson <beidson@apple.com>
IndexedDB 2.0: Support new IDBKeyRange interfaces.
<rdar://problem/28806929> and https://bugs.webkit.org/show_bug.cgi?id=163910
Reviewed by Andy Estes.
No new tests (Covered by additions to existing test)
The "new IDBKeyRanges interfaces" really just means adding the instance method IDBKeyRange.contains.
* Modules/indexeddb/IDBKeyRange.cpp:
(WebCore::IDBKeyRange::contains):
* Modules/indexeddb/IDBKeyRange.h:
* Modules/indexeddb/IDBKeyRange.idl:
2016-10-23 Yusuke Suzuki <utatane.tea@gmail.com>
[DOMJIT] Add a way for DOMJIT::Patchpoint to express effects
https://bugs.webkit.org/show_bug.cgi?id=163657
Reviewed by Saam Barati.
CallDOMPatchpoint now has the way to tell its effects to DFG and FTL compilers.
WebCore DOMJIT::AbstractHeapRepository will construct the hierarchy of the abstract
heap. And then it encodes these information into the pairs of the integers.
And this patch also changes the DOMJIT::PatchpointParams' parameter order.
So we change them in all the DOMJIT::CallDOMPatchpoint sites.
* CMakeLists.txt:
* ForwardingHeaders/domjit/DOMJITAbstractHeap.h: Copied from Source/JavaScriptCore/domjit/DOMJITCallDOMPatchpoint.h.
* ForwardingHeaders/domjit/DOMJITEffect.h: Copied from Source/JavaScriptCore/domjit/DOMJITCallDOMPatchpoint.h.
* ForwardingHeaders/domjit/DOMJITHeapRange.h: Copied from Source/JavaScriptCore/domjit/DOMJITCallDOMPatchpoint.h.
* WebCore.xcodeproj/project.pbxproj:
* domjit/DOMJITAbstractHeapRepository.cpp: Copied from Source/JavaScriptCore/domjit/DOMJITCallDOMPatchpoint.h.
(WebCore::DOMJIT::AbstractHeapRepository::AbstractHeapRepository):
(WebCore::DOMJIT::AbstractHeapRepository::instance):
* domjit/DOMJITAbstractHeapRepository.h: Copied from Source/JavaScriptCore/domjit/DOMJITCallDOMPatchpoint.h.
* domjit/DOMJITHelpers.h:
(WebCore::DOMJITHelpers::branchIfNotWorldIsNormal): Deleted.
(WebCore::DOMJITHelpers::branchIfNotWeakIsLive): Deleted.
(WebCore::DOMJITHelpers::tryLookUpWrapperCache): Deleted.
(WebCore::DOMJITHelpers::toWrapper): Deleted.
(WebCore::DOMJITHelpers::branchIfDOMWrapper): Deleted.
(WebCore::DOMJITHelpers::branchIfNotDOMWrapper): Deleted.
(WebCore::DOMJITHelpers::branchIfNode): Deleted.
(WebCore::DOMJITHelpers::branchIfNotNode): Deleted.
(WebCore::DOMJITHelpers::branchIfElement): Deleted.
(WebCore::DOMJITHelpers::branchIfNotElement): Deleted.
(WebCore::DOMJITHelpers::branchIfDocumentWrapper): Deleted.
(WebCore::DOMJITHelpers::branchIfNotDocumentWrapper): Deleted.
* domjit/JSNodeDOMJIT.cpp:
(WebCore::createCallDOMForOffsetAccess):
(WebCore::checkNode):
(WebCore::NodeFirstChildDOMJIT::checkDOM):
(WebCore::NodeFirstChildDOMJIT::callDOM):
(WebCore::NodeLastChildDOMJIT::checkDOM):
(WebCore::NodeLastChildDOMJIT::callDOM):
(WebCore::NodeNextSiblingDOMJIT::checkDOM):
(WebCore::NodeNextSiblingDOMJIT::callDOM):
(WebCore::NodePreviousSiblingDOMJIT::checkDOM):
(WebCore::NodePreviousSiblingDOMJIT::callDOM):
(WebCore::NodeParentNodeDOMJIT::checkDOM):
(WebCore::NodeParentNodeDOMJIT::callDOM):
(WebCore::NodeNodeTypeDOMJIT::checkDOM):
(WebCore::NodeNodeTypeDOMJIT::callDOM):
2016-10-24 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Fix :lang argument parsing
https://bugs.webkit.org/show_bug.cgi?id=163913
Reviewed by Zalan Bujtas.
* css/SelectorPseudoClassAndCompatibilityElementMap.in:
Modify the map to support versions of the function pseudos
without the left paren included.
* css/parser/CSSParserValues.cpp:
(WebCore::CSSParserSelector::setLangArgumentList):
* css/parser/CSSParserValues.h:
Add a helper to just directly pass an AtomicString Vector through.
* css/parser/CSSSelectorParser.cpp:
(WebCore::consumeLangArgumentList):
(WebCore::CSSSelectorParser::consumePseudo):
Add a new consumeLangArgumentList to collect the languages into
an AtomicString Vector.
2016-10-24 Alex Christensen <achristensen@webkit.org>
Fix AppleWin build after r207720.
* html/canvas/OESVertexArrayObject.cpp:
2016-10-24 Alex Christensen <achristensen@webkit.org>
Fix AppleWin build after r207720.
* bindings/js/JSWebGLRenderingContextBaseCustom.cpp:
2016-10-24 Alex Christensen <achristensen@webkit.org>
Fix Windows build after r207767 and r207769
* css/CSSAllInOne.cpp:
* platform/network/curl/ResourceHandleManager.cpp:
(WebCore::getProtectionSpace):
2016-10-24 Per Arne Vollan <pvollan@apple.com>
[Win] AVCF based media engine does not block cross-site/cross-domain loads.
https://bugs.webkit.org/show_bug.cgi?id=163783
Reviewed by Brent Fulgham.
Prevent cross-site/cross-domain loads by setting appropriate AVCF options.
No new tests; covered by media/video-canvas-source.html. Media tests are
currently skipped on Windows.
* platform/graphics/avfoundation/cf/AVFoundationCFSoftLinking.h:
* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
(WebCore::MediaPlayerPrivateAVFoundationCF::resolvedURL):
(WebCore::MediaPlayerPrivateAVFoundationCF::hasSingleSecurityOrigin):
(WebCore::AVFWrapper::createAssetForURL):
* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h:
2016-10-24 Anders Carlsson <andersca@apple.com>
Fix build with newer versions of clang
https://bugs.webkit.org/show_bug.cgi?id=163908
rdar://problem/28852016
Reviewed by Tim Horton.
Use the macros that names the soft-linked functions in such a way that they won't conflict with actual functions.
* platform/ios/PlatformScreenIOS.mm:
(WebCore::screenIsMonochrome):
(WebCore::screenHasInvertedColors):
(WebCore::screenSize):
(WebCore::availableScreenSize):
(WebCore::screenScaleFactor):
2016-10-24 Joseph Pecoraro <pecoraro@apple.com>
Remove unnecessary unused variable stubs
https://bugs.webkit.org/show_bug.cgi?id=163688
Reviewed by Simon Fraser.
* Modules/applepay/cocoa/PaymentCocoa.mm:
(WebCore::toDictionary):
* Modules/applepay/cocoa/PaymentContactCocoa.mm:
(WebCore::toDictionary):
2016-10-24 Alex Christensen <achristensen@webkit.org>
Try to fix Windows build after r207767
https://bugs.webkit.org/show_bug.cgi?id=163891
* DerivedSources.cpp:
2016-10-24 Zan Dobersek <zdobersek@igalia.com>
[CodeGenerator] Only allow a single interface or standalone dictionary per WebIDL file
https://bugs.webkit.org/show_bug.cgi?id=163889
Reviewed by Chris Dumez.
Assert that there's only one interface or standalone dictionary
per WebIDL input file, and exit from the generator otherwise.
This avoids potential linking issues where multiple enumeration
and dictionary bindings code can be generated if the source
WebIDL for them is specified in a file that contains multiple
interfaces or standalone dictionaries.
Additionally, the generator now also exits if it fails to
generate code for any interface of standalone dictionary. This
should avoid processing WebIDL files that are empty in
substance.
TestException.idl and TestInterface.idl files have their second
interfaces removed. In place of those a new testing IDL file is
added, TestInterfaceLeadingUnderscore.idl. Like the two removed
interfaces, it tests that the leading underscode in the
identifier is removed by the generator.
* bindings/scripts/CodeGenerator.pm:
(ProcessDocument):
* bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp: Added.
(WebCore::JSTestInterfaceLeadingUnderscorePrototype::create):
(WebCore::JSTestInterfaceLeadingUnderscorePrototype::createStructure):
(WebCore::JSTestInterfaceLeadingUnderscorePrototype::JSTestInterfaceLeadingUnderscorePrototype):
(WebCore::JSTestInterfaceLeadingUnderscoreConstructor::prototypeForStructure):
(WebCore::JSTestInterfaceLeadingUnderscoreConstructor::initializeProperties):
(WebCore::JSTestInterfaceLeadingUnderscorePrototype::finishCreation):
(WebCore::JSTestInterfaceLeadingUnderscore::JSTestInterfaceLeadingUnderscore):
(WebCore::JSTestInterfaceLeadingUnderscore::createPrototype):
(WebCore::JSTestInterfaceLeadingUnderscore::prototype):
(WebCore::JSTestInterfaceLeadingUnderscore::destroy):
(WebCore::BindingCaller<JSTestInterfaceLeadingUnderscore>::castForAttribute):
(WebCore::jsTestInterfaceLeadingUnderscoreReadonly):
(WebCore::jsTestInterfaceLeadingUnderscoreReadonlyGetter):
(WebCore::jsTestInterfaceLeadingUnderscoreConstructor):
(WebCore::setJSTestInterfaceLeadingUnderscoreConstructor):
(WebCore::JSTestInterfaceLeadingUnderscore::getConstructor):
(WebCore::JSTestInterfaceLeadingUnderscoreOwner::isReachableFromOpaqueRoots):
(WebCore::JSTestInterfaceLeadingUnderscoreOwner::finalize):
(WebCore::toJSNewlyCreated):
(WebCore::toJS):
(WebCore::JSTestInterfaceLeadingUnderscore::toWrapped):
* bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.h: Renamed from Source/WebCore/bindings/scripts/test/JS/JSreadonly.h.
(WebCore::JSTestInterfaceLeadingUnderscore::create):
(WebCore::JSTestInterfaceLeadingUnderscore::createStructure):
(WebCore::JSTestInterfaceLeadingUnderscore::finishCreation):
(WebCore::wrapperOwner):
(WebCore::wrapperKey):
(WebCore::toJS):
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSattribute.cpp: Removed.
* bindings/scripts/test/JS/JSattribute.h: Removed.
* bindings/scripts/test/JS/JSreadonly.cpp: Removed.
* bindings/scripts/test/TestException.idl:
* bindings/scripts/test/TestInterface.idl:
* bindings/scripts/test/TestInterfaceLeadingUnderscore.idl: Copied from Source/WebCore/bindings/scripts/test/TestException.idl.
2016-10-21 Alex Christensen <achristensen@webkit.org>
URL::port should return Optional<uint16_t>
https://bugs.webkit.org/show_bug.cgi?id=163806
Reviewed by Darin Adler.
A URL without a port is different than a URL with port 0.
This matches the spec, Chrome, and Firefox.
Covered by newly-passing web platform tests.
* Modules/indexeddb/IDBDatabaseIdentifier.h:
(WebCore::IDBDatabaseIdentifier::IDBDatabaseIdentifier):
(WebCore::IDBDatabaseIdentifier::isHashTableDeletedValue):
(WebCore::IDBDatabaseIdentifier::hash):
(WebCore::IDBDatabaseIdentifier::isValid):
(WebCore::IDBDatabaseIdentifier::isEmpty):
* Modules/websockets/WebSocket.cpp:
(WebCore::WebSocket::connect):
* Modules/websockets/WebSocketHandshake.cpp:
(WebCore::hostName):
* contentextensions/ContentExtensionsBackend.cpp:
(WebCore::ContentExtensions::ContentExtensionsBackend::processContentExtensionRulesForLoad):
(WebCore::ContentExtensions::applyBlockedStatusToRequest):
* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::userDidClickSnapshot):
(WebCore::HTMLPlugInImageElement::subframeLoaderWillCreatePlugIn):
* html/URLUtils.h:
(WebCore::URLUtils<T>::protocol):
(WebCore::URLUtils<T>::host):
(WebCore::URLUtils<T>::port):
* loader/CrossOriginAccessControl.cpp:
(WebCore::isValidCrossOriginRedirectionURL):
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::responseReceived):
(WebCore::isRemoteWebArchive):
(WebCore::DocumentLoader::maybeLoadEmpty):
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::makeSimpleCrossOriginAccessRequest):
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::didReceiveResponse):
* loader/cache/CachedResource.cpp:
(WebCore::shouldCacheSchemeIndefinitely):
(WebCore::CachedResource::freshnessLifetime):
* page/Location.cpp:
(WebCore::Location::protocol):
(WebCore::Location::host):
(WebCore::Location::port):
* page/Page.cpp:
(WebCore::Page::userStyleSheetLocationChanged):
* page/SecurityOrigin.cpp:
(WebCore::shouldTreatAsUniqueOrigin):
(WebCore::SecurityOrigin::SecurityOrigin):
(WebCore::SecurityOrigin::isSecure):
(WebCore::SecurityOrigin::canDisplay):
(WebCore::SecurityOrigin::toRawString):
(WebCore::SecurityOrigin::create):
(WebCore::SecurityOrigin::databaseIdentifier):
* page/SecurityOrigin.h:
(WebCore::SecurityOrigin::port):
* page/SecurityOriginData.cpp:
(WebCore::SecurityOriginData::debugString):
* page/SecurityOriginData.h:
(): Deleted.
* page/SecurityOriginHash.h:
(WebCore::SecurityOriginHash::hash):
* page/csp/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::allowObjectFromSource):
(WebCore::ContentSecurityPolicy::allowChildFrameFromSource):
(WebCore::ContentSecurityPolicy::allowResourceFromSource):
(WebCore::ContentSecurityPolicy::allowConnectToSource):
(WebCore::ContentSecurityPolicy::allowBaseURI):
(WebCore::stripURLForUseInReport):
(WebCore::ContentSecurityPolicy::upgradeInsecureRequestIfNeeded):
* page/csp/ContentSecurityPolicySource.cpp:
(WebCore::ContentSecurityPolicySource::ContentSecurityPolicySource):
(WebCore::ContentSecurityPolicySource::portMatches):
* page/csp/ContentSecurityPolicySource.h:
* page/csp/ContentSecurityPolicySourceList.cpp:
(WebCore::ContentSecurityPolicySourceList::parse):
(WebCore::ContentSecurityPolicySourceList::parseSource):
(WebCore::ContentSecurityPolicySourceList::parsePort):
* page/csp/ContentSecurityPolicySourceList.h:
* platform/SchemeRegistry.h:
* platform/URL.cpp:
(WebCore::URL::protocol):
(WebCore::URL::port):
(WebCore::URL::serialize):
(WebCore::portAllowed):
(WebCore::defaultPortsMap): Deleted.
(WebCore::defaultPortForProtocol): Deleted.
(WebCore::isDefaultPortForProtocol): Deleted.
* platform/URL.h:
(WebCore::URL::hasPort): Deleted.
* platform/URLParser.cpp:
(WebCore::defaultPortForProtocol):
(WebCore::isDefaultPortForProtocol):
(WebCore::URLParser::parsePort):
(WebCore::isDefaultPort): Deleted.
* platform/network/CredentialStorage.cpp:
(WebCore::originStringFromURL):
* platform/network/ResourceHandle.cpp:
(WebCore::ResourceHandle::create):
(WebCore::ResourceHandle::loadResourceSynchronously):
* platform/network/cf/SocketStreamHandleImplCFNet.cpp:
(WebCore::SocketStreamHandleImpl::platformClose):
(WebCore::SocketStreamHandleImpl::port):
* workers/WorkerLocation.cpp:
(WebCore::WorkerLocation::protocol):
(WebCore::WorkerLocation::host):
(WebCore::WorkerLocation::port):
2016-10-24 Zan Dobersek <zdobersek@igalia.com>
[CodeGeneratorJS] Support enums for standalone dictionaries
https://bugs.webkit.org/show_bug.cgi?id=163885
Reviewed by Youenn Fablet.
Add support for enumerations in WebIDL files that specify
standalone dictionaries. Implementation of this is pretty
straight-forward and mirrors interface and callback generators
by calling GenerateEnumerations{Header,Implementation}Content()
functions in GenerateDictionary{Header,Implementation}().
In GenerateEnumerationsImplementationContent(), the
NeverDestroyed.h header is added to the implementation includes
since that class is used to hold an array of possible enum
values.
A test enum is added to the TestStandaloneDictionary.idl file
and the baselines are updated to reflect the new capability.
* bindings/scripts/CodeGenerator.pm:
(ProcessDocument):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateDictionary):
(GenerateEnumerationsImplementationContent):
(GenerateDictionaryHeader):
(GenerateDictionaryImplementation):
* bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
(WebCore::convertEnumerationToJS):
(WebCore::parseEnumeration<TestStandaloneDictionary::EnumInStandaloneDictionaryFile>):
(WebCore::convertEnumeration<TestStandaloneDictionary::EnumInStandaloneDictionaryFile>):
(WebCore::expectedEnumerationValues<TestStandaloneDictionary::EnumInStandaloneDictionaryFile>):
(WebCore::convertDictionary<DictionaryImplName>):
* bindings/scripts/test/JS/JSTestStandaloneDictionary.h:
* bindings/scripts/test/TestStandaloneDictionary.idl:
2016-10-24 Dave Hyatt <hyatt@apple.com>
Remove CSSCharsetRule from the CSS OM
https://bugs.webkit.org/show_bug.cgi?id=163891
Reviewed by Darin Adler.
Remove CSSCharsetRule from the CSS OM. All other browser engines have made this
change. This eliminates the weird overloading of isCharsetRule to match both
CSSCharsetRule and StyleRuleCharset (only used by the new parser).
Fix the destroy() method in StyleRuleBase to clean up StyleRuleCharsets created
by the new parser properly.
* CMakeLists.txt:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSCSSRuleCustom.cpp:
(WebCore::toJSNewlyCreated):
* css/CSSCharsetRule.cpp: Removed.
* css/CSSCharsetRule.h: Removed.
* css/CSSCharsetRule.idl: Removed.
* css/CSSPropertySourceData.h:
* css/CSSStyleSheet.cpp:
(WebCore::CSSStyleSheet::item):
(WebCore::CSSStyleSheet::rules):
* css/CSSStyleSheet.h:
* css/StyleRule.cpp:
(WebCore::StyleRuleBase::destroy):
* inspector/InspectorStyleSheet.cpp:
(WebCore::asCSSRuleList):
2016-10-24 Zan Dobersek <zdobersek@igalia.com>
[CodeGeneratorJS] Standalone dictionaries have misplaced build guards
https://bugs.webkit.org/show_bug.cgi?id=163881
Reviewed by Chris Dumez.
Build guards that are generated from the Conditional attribute
on WebIDL dictionary declarations properly guard the relevant
convertDictionary() functions for WebIDL files that also specify
interfaces. But for standalone dictionaries these build guards
should guard the complete header and implementation files, much
like this is done for files that originate from interfaces or
callbacks.
Before this patch, guarding a standalone dictionary resulted in
malformed output because GenerateHeaderContentHeader() and
GenerateImplementationContentHeader() functions both generated
the #if macro that would guard the whole file, but
GenerateDictionary{Header,Implementation}() didn't generate the
closing #endif.
CodeGeneratorJS.pm now passes the conditional string, if any,
to GenerateDictionary{Header,Implementation}Content() functions
in case of a non-standalone dictionary. Otherwise, the
conditional string, if any, is used to guard the complete
header and implementation files.
Generator tests are updated to cover various build guard
combinations on dictionaries in TestObj.idl, and the standalone
dictionary WebIDL file now has a Conditional attribute to check
that the build guards cover complete generated header and
implementation files.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateDictionaryHeaderContent):
(GenerateDictionariesHeaderContent):
(GenerateDictionaryImplementationContent):
(GenerateDictionariesImplementationContent):
(GenerateDictionaryHeader):
(GenerateDictionaryImplementation):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::convertDictionary<TestObj::ConditionalDictionaryA>):
(WebCore::convertDictionary<TestObj::ConditionalDictionaryB>):
(WebCore::convertDictionary<TestObj::ConditionalDictionaryC>):
* bindings/scripts/test/JS/JSTestObj.h:
* bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
* bindings/scripts/test/JS/JSTestStandaloneDictionary.h:
* bindings/scripts/test/TestObj.idl:
* bindings/scripts/test/TestStandaloneDictionary.idl:
2016-10-24 Eric Carlson <eric.carlson@apple.com>
[MediaStream] Separate media capture and audio playback muting
https://bugs.webkit.org/show_bug.cgi?id=163855
<rdar://problem/28827186>
Reviewed by Darin Adler.
Test: fast/mediastream/MediaStream-page-muted.html
Change page.muted from a bool to a bitfield so audio and media capture muted are independent.
Fix a couple of bugs in the mock media capture device uncovered by new test case.
* Modules/mediastream/MediaStream.cpp:
(WebCore::MediaStream::pageMutedStateDidChange): page.isMuted -> page.mutedState.
* Modules/webaudio/AudioContext.cpp:
(WebCore::AudioContext::pageMutedStateDidChange): Ditto.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::updateVolume): Ditto.
(WebCore::HTMLMediaElement::effectiveMuted): Ditto.
* page/MediaProducer.h: Add MutedState enum.
* page/Page.cpp:
(WebCore::Page::Page):
(WebCore::Page::setMuted): Take MutedStateFlags instead of bool. m_muted -> m_mutedState.
* page/Page.h:
* platform/mock/MockRealtimeMediaSource.cpp:
(WebCore::MockRealtimeMediaSource::startProducingData): Call setMuted.
(WebCore::MockRealtimeMediaSource::stopProducingData): Ditto.
* platform/mock/MockRealtimeMediaSource.h:
* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::stopProducingData): Call correct base class method.
* testing/Internals.cpp:
(WebCore::Internals::setPageMuted): Change parameter from a bool to a string.
* testing/Internals.h:
* testing/Internals.idl:
2016-10-24 Darin Adler <darin@apple.com>
Try to fix Windows build.
* bindings/js/JSWebGL2RenderingContextCustom.cpp: Rearranged includes
so they are inside the conditional as they should be.
2016-10-24 Youenn Fablet <youenn@apple.com>
Activate WEB_RTC compilation flags for Mac bots
https://bugs.webkit.org/show_bug.cgi?id=163886
Reviewed by Eric Carlson.
Covered by existing tests.
Fixing compilation errors due to missing WEBCORE_EXPORT, missing method and missing override keywords.
* Configurations/FeatureDefines.xcconfig:
* DerivedSources.make:
* Modules/mediastream/MediaEndpointPeerConnection.h:
* Modules/mediastream/RTCPeerConnection.h:
* Modules/mediastream/RTCPeerConnection.idl:
* Modules/mediastream/SDPProcessor.cpp:
(WebCore::SDPProcessor::generate):
(WebCore::SDPProcessor::parse):
* WebCore.xcodeproj/project.pbxproj:
* platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
(WebCore::MockRealtimeVideoSource::createMuted):
2016-10-24 Brady Eidson <beidson@apple.com>
IndexedDB 2.0: Support IDBIndex name assignment.
<rdar://problem/28806932> and https://bugs.webkit.org/show_bug.cgi?id=163805
Reviewed by Alex Christensen.
Tests: storage/indexeddb/modern/index-rename-1-private.html
storage/indexeddb/modern/index-rename-1.html
Touches a *lot* of code sites, but none of them are particularly interesting.
They are all just getting the new name spread out to all of the various objects that need it.
* Modules/indexeddb/IDBDatabase.cpp:
(WebCore::IDBDatabase::renameIndex):
* Modules/indexeddb/IDBDatabase.h:
* Modules/indexeddb/IDBIndex.cpp:
(WebCore::IDBIndex::IDBIndex):
(WebCore::IDBIndex::setName):
(WebCore::IDBIndex::rollbackInfoForVersionChangeAbort):
* Modules/indexeddb/IDBIndex.h:
* Modules/indexeddb/IDBIndex.idl:
* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::rollbackForVersionChangeAbort):
(WebCore::IDBObjectStore::renameReferencedIndex):
(WebCore::IDBObjectStore::rollbackInfoForVersionChangeAbort): Deleted.
* Modules/indexeddb/IDBObjectStore.h:
* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::internalAbort):
(WebCore::IDBTransaction::renameIndex):
(WebCore::IDBTransaction::renameIndexOnServer):
(WebCore::IDBTransaction::didRenameIndexOnServer):
* Modules/indexeddb/IDBTransaction.h:
* Modules/indexeddb/client/IDBConnectionProxy.cpp:
(WebCore::IDBClient::IDBConnectionProxy::renameIndex):
* Modules/indexeddb/client/IDBConnectionProxy.h:
* Modules/indexeddb/client/IDBConnectionToServer.cpp:
(WebCore::IDBClient::IDBConnectionToServer::renameIndex):
(WebCore::IDBClient::IDBConnectionToServer::didRenameIndex):
* Modules/indexeddb/client/IDBConnectionToServer.h:
* Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
* Modules/indexeddb/client/TransactionOperation.h:
(WebCore::IDBClient::createTransactionOperation):
* Modules/indexeddb/server/IDBBackingStore.h:
* Modules/indexeddb/server/IDBConnectionToClient.cpp:
(WebCore::IDBServer::IDBConnectionToClient::didRenameIndex):
* Modules/indexeddb/server/IDBConnectionToClient.h:
* Modules/indexeddb/server/IDBConnectionToClientDelegate.h:
* Modules/indexeddb/server/IDBServer.cpp:
(WebCore::IDBServer::IDBServer::renameIndex):
* Modules/indexeddb/server/IDBServer.h:
* Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
(WebCore::IDBServer::MemoryBackingStoreTransaction::indexRenamed):
(WebCore::IDBServer::MemoryBackingStoreTransaction::abort):
* Modules/indexeddb/server/MemoryBackingStoreTransaction.h:
* Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
(WebCore::IDBServer::MemoryIDBBackingStore::renameIndex):
* Modules/indexeddb/server/MemoryIDBBackingStore.h:
* Modules/indexeddb/server/MemoryIndex.h:
(WebCore::IDBServer::MemoryIndex::rename):
* Modules/indexeddb/server/MemoryObjectStore.cpp:
(WebCore::IDBServer::MemoryObjectStore::renameIndex):
* Modules/indexeddb/server/MemoryObjectStore.h:
* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::renameIndex):
* Modules/indexeddb/server/SQLiteIDBBackingStore.h:
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::renameIndex):
(WebCore::IDBServer::UniqueIDBDatabase::performRenameIndex):
(WebCore::IDBServer::UniqueIDBDatabase::didPerformRenameIndex):
* Modules/indexeddb/server/UniqueIDBDatabase.h:
* Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
(WebCore::IDBServer::UniqueIDBDatabaseConnection::didRenameIndex):
* Modules/indexeddb/server/UniqueIDBDatabaseConnection.h:
* Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::renameIndex):
* Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:
* Modules/indexeddb/shared/IDBIndexInfo.h:
(WebCore::IDBIndexInfo::rename):
* Modules/indexeddb/shared/IDBObjectStoreInfo.cpp:
(WebCore::IDBObjectStoreInfo::infoForExistingIndex):
* Modules/indexeddb/shared/IDBObjectStoreInfo.h:
* Modules/indexeddb/shared/IDBResultData.cpp:
(WebCore::IDBResultData::renameIndexSuccess):
* Modules/indexeddb/shared/IDBResultData.h:
* Modules/indexeddb/shared/InProcessIDBServer.cpp:
(WebCore::InProcessIDBServer::didRenameIndex):
(WebCore::InProcessIDBServer::renameIndex):
* Modules/indexeddb/shared/InProcessIDBServer.h:
2016-10-24 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Fix -webkit-box-reflect parsing
https://bugs.webkit.org/show_bug.cgi?id=163890
Reviewed by Zalan Bujtas.
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeReflect):
Do a WTFMove on the mask instead of a .releaseNonNull(), since mask can be a nullptr.
Exactly matches the old parser.
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::CalcParser::consumeValue):
(WebCore::CSSPropertyParserHelpers::CalcParser::consumeNumber):
(WebCore::CSSPropertyParserHelpers::consumeInteger):
(WebCore::CSSPropertyParserHelpers::consumeNumber):
(WebCore::CSSPropertyParserHelpers::consumeLength):
(WebCore::CSSPropertyParserHelpers::consumePercent):
(WebCore::CSSPropertyParserHelpers::consumeAngle):
(WebCore::CSSPropertyParserHelpers::consumeTime):
(WebCore::CSSPropertyParserHelpers::consumeUrl):
(WebCore::CSSPropertyParserHelpers::consumeColor):
(WebCore::CSSPropertyParserHelpers::consumeDeprecatedGradientPoint):
(WebCore::CSSPropertyParserHelpers::consumeDeprecatedGradientColorStop):
(WebCore::CSSPropertyParserHelpers::consumeCrossFade):
(WebCore::CSSPropertyParserHelpers::consumeImageSet):
Clean up all instances of CSSPrimitiveValue::create to use the CSSValuePool.
2016-10-21 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Concatenate JS and CSS files into a single JS and CSS resources
https://bugs.webkit.org/show_bug.cgi?id=163785
<rdar://problem/28890058>
Reviewed by Darin Adler.
Concatenate CSS and JS resources for modern media controls into single JS and CSS files
during build and load these single resources alone at runtime.
* Modules/modern-media-controls/js-files: Added.
* WebCore.xcodeproj/project.pbxproj:
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::mediaControlsStyleSheet):
(WebCore::RenderThemeMac::mediaControlsScript):
2016-10-24 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Unprefix -webkit-writing-mode
https://bugs.webkit.org/show_bug.cgi?id=163870
Reviewed by Zalan Bujtas.
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::propertyValue):
Change -webkit-writing mode to writing-mode.
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::operator WritingMode):
(WebCore::CSSPrimitiveValue::operator SVGWritingMode): Deleted.
Eliminate the SVGWritingMode converters. Add support for the unique SVG-specific
values to the WritingMode converters.
* css/CSSPropertyNames.in:
Alias -webkit-writing-mode to writing-mode. Move writing-mode up to be
high priority like -webkit-writing mode was. Alias -epub-writing-mode to writing-mode
instead of to -webkit-writing-mode.
* css/SVGCSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::svgPropertyValue):
Remove writing-mode from SVG computed style, since the base CSSComputedStyleDeclaration handles it.
* css/StyleBuilderCustom.h:
(WebCore::StyleBuilderCustom::applyValueWritingMode):
(WebCore::StyleBuilderCustom::applyValueWebkitWritingMode): Deleted.
Renamed applyValueWebkitWritingMode to applyValueWritingMode. Removed the SVG code, since
the underlying converter for WritingMode now handles those values.
* css/StyleResolver.cpp:
(WebCore::extractDirectionAndWritingMode):
Rename -webkit-writing-mode to writing-mode.
* css/parser/CSSParser.cpp:
(WebCore::isValidKeywordPropertyAndValue):
Eliminate -webkit-writing-mode and make sure writing-mode handles both the SVG values
and the normal values.
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
(WebCore::CSSParserFastPaths::isKeywordPropertyID):
Same deal here.
* html/track/TextTrackCueGeneric.cpp:
(WebCore::TextTrackCueGenericBoxElement::applyCSSProperties):
* html/track/VTTCue.cpp:
(WebCore::VTTCueBox::applyCSSProperties):
Cue stuff was setting -webkit-writing-mode, so make it set writing-mode instead now.
* rendering/RenderLineBreak.cpp:
(WebCore::RenderLineBreak::collectSelectionRects):
* rendering/RenderText.cpp:
(WebCore::RenderText::collectSelectionRects):
Switch the SVG-specific code here over to accessing the RenderStyle writing-mode and not
the SVG-specific one.
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::isVerticalWritingMode):
Add a helper function for asking if something is vertical writing mode.
* rendering/style/SVGRenderStyle.cpp:
* rendering/style/SVGRenderStyle.h:
* rendering/style/SVGRenderStyleDefs.h:
(WebCore::SVGRenderStyle::diff):
Remove the SVG writing mode code.
* rendering/svg/RenderSVGInlineText.cpp:
(WebCore::RenderSVGInlineText::computeNewScaledFontForStyle):
Make sure to force SVG font descriptions to be horizontal, since SVG controls
its own glyph orientation.
* rendering/svg/SVGRenderTreeAsText.cpp:
(WebCore::writeSVGInlineTextBox):
* rendering/svg/SVGTextChunk.cpp:
(WebCore::SVGTextChunk::SVGTextChunk):
* rendering/svg/SVGTextLayoutEngine.cpp:
(WebCore::SVGTextLayoutEngine::layoutInlineTextBox):
* rendering/svg/SVGTextQuery.cpp:
(WebCore::SVGTextQuery::executeQuery):
Changed to access the RenderStyle writing mode instead of the SVG-specific one.
2016-10-23 Antti Koivisto <antti@apple.com>
Avoid unnecessary full style resolution in getComputedStyle for non-inherited properties
https://bugs.webkit.org/show_bug.cgi?id=163875
Reviewed by Andreas Kling.
Test: fast/css/getComputedStyle/getComputedStyle-style-resolution.html
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::hasValidStyleForProperty):
For non-inherited properties we don't need to update style even if some ancestor style is invalid
as long as explicit 'inherit' is not being used.
We still need to update if we find out that the whole subtree we are in is invalid.
(WebCore::updateStyleIfNeededForProperty):
Pass the property.
(WebCore::ComputedStyleExtractor::customPropertyValue):
(WebCore::ComputedStyleExtractor::propertyValue):
(WebCore::CSSComputedStyleDeclaration::length):
(WebCore::elementOrItsAncestorNeedsStyleRecalc): Deleted.
(WebCore::updateStyleIfNeededForElement): Deleted.
* css/StyleResolver.cpp:
(WebCore::StyleResolver::colorFromPrimitiveValue):
Mark style as using explicit inheritance if 'currentcolor' value is used.
2016-10-24 Youenn Fablet <youenn@apple.com>
ASSERTION FAILED: canvas()->securityOrigin()->toString() == cachedImage.origin()->toString()
https://bugs.webkit.org/show_bug.cgi?id=163242
Reviewed by Darin Adler.
Test: http/tests/security/cross-origin-cached-images-canvas.html
We were previously on Origin HTTP header to check whether requests were made from different origins.
This is fine for CORS enabled requests but not for GET no CORS requests since they will not have any Origin header.
Now that CachedResource and CachedResourceRequest own their origin, it is best to use these directly.
* loader/cache/CachedResourceLoader.cpp:
(WebCore::isRequestMatchingResourceOrigin):
(WebCore::CachedResourceLoader::shouldUpdateCachedResourceWithCurrentRequest):
2016-10-24 Youenn Fablet <youenn@apple.com>
Remove CachedResource::passesSameOriginPolicyCheck
https://bugs.webkit.org/show_bug.cgi?id=163593
Reviewed by Andreas Kling.
No change of behavior.
Removing no-longer used code.
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::redirectReceived):
(WebCore::CachedResource::passesAccessControlCheck): Deleted.
(WebCore::CachedResource::passesSameOriginPolicyCheck): Deleted.
(WebCore::CachedResource::responseForSameOriginPolicyChecks): Deleted.
* loader/cache/CachedResource.h:
(WebCore::CachedResource::response):
2016-10-24 Youenn Fablet <youenn@apple.com>
Redirections should be upgraded if CSP policy says so
https://bugs.webkit.org/show_bug.cgi?id=163544
Reviewed by Darin Adler.
Test: http/tests/security/contentSecurityPolicy/upgrade-insecure-requests/basic-upgrade-after-redirect.https.html
Introducing CachedResourceLoader::updateRequestAfterRedirection to do the checks that CachedResourceLoader is doing
to the initial request, but for redirection requests.
Implemented URL upgrade according CSP policy, as specified by fetch algorithm.
Minor refactoring in CachedResourceRequest to share some code.
Fixing some constness issues.
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::willSendRequestInternal):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::allowedByContentSecurityPolicy):
(WebCore::CachedResourceLoader::canRequestAfterRedirection):
(WebCore::CachedResourceLoader::updateRequestAfterRedirection):
* loader/cache/CachedResourceLoader.h:
* loader/cache/CachedResourceRequest.cpp:
(WebCore::upgradeInsecureResourceRequestIfNeeded):
(WebCore::CachedResourceRequest::upgradeInsecureRequestIfNeeded):
* loader/cache/CachedResourceRequest.h:
2016-10-22 Sam Weinig <sam@webkit.org>
[WebIDL] Add IDLType based toJS conversion
https://bugs.webkit.org/show_bug.cgi?id=163861
Reviewed by Darin Adler.
Adds toJS<IDLType>() functions to be the new way of converting
from implementation types to JS types. These are implemented via
a similar mechanism to the convert<IDL>() functions, though specializations
of a JSConverter struct (rather than the Converter structs). This allows
us to support arbitrarily complex aggregate types easily (e.g. sequence<(Node or DOMString?)>).
* Modules/geolocation/Geoposition.idl:
* dom/Event.idl:
Add typedef for DOMTimeStamp. Eventually, our IDLParser should do this for us, but
for now it allows us to simplify the type system.
* bindings/js/JSDOMBinding.h:
(WebCore::JSValueTraits::arrayJSValue): Deleted.
(WebCore::JSValueTraits<String>::arrayJSValue): Deleted.
(WebCore::JSValueTraits<double>::arrayJSValue): Deleted.
(WebCore::JSValueTraits<float>::arrayJSValue): Deleted.
(WebCore::jsArray): Deleted.
(WebCore::jsFrozenArray): Deleted.
(WebCore::NativeValueTraits<String>::nativeValue): Deleted.
(WebCore::NativeValueTraits<unsigned>::nativeValue): Deleted.
(WebCore::NativeValueTraits<float>::nativeValue): Deleted.
(WebCore::NativeValueTraits<double>::nativeValue): Deleted.
(WebCore::toNullableJSNumber): Deleted.
(WebCore::toJSArray): Deleted.
(WebCore::toJSBoolean): Deleted.
(WebCore::toJSNumber): Deleted.
(WebCore::toJSString): Deleted.
Remove many now-unneeded conversion functions.
* bindings/js/JSDOMConvert.h:
(WebCore::toJS):
Add 5 primary toJS functions which take combinations of the following
arguments: ExecState, JSDOMGlobalObject, ThrowScope. All take the value
to be converted as well, except in the case of the throwScope ones, where
they take the value in an ExceptionOr<>.
To simplify the implementations of the JSConverter specializations, avoiding
the need for each one to implement their conversion up to 3 times (one for just
the value, one for the value and the ExecState, and one for the value, the ExecState
and the global object), each JSConverter instead specifies whether it's converter
needs an ExecState or global object via a static constexpr. We then use the
JSConverterOverloader template, to call the correct function. This can probably be
improved in the future, by inferring the number of arguments needed via SFINAE, but
this seemed like a more straightforward first cut.
(WebCore::JSConverter<IDLNullable<T>>::convert):
(WebCore::JSConverter<IDLBoolean>::convert):
(WebCore::JSConverter<IDLInterface<T>>::convert):
(WebCore::JSConverter<IDLAny>::convert):
(WebCore::JSConverter<IDLByte>::convert):
(WebCore::JSConverter<IDLOctet>::convert):
(WebCore::JSConverter<IDLShort>::convert):
(WebCore::JSConverter<IDLUnsignedShort>::convert):
(WebCore::JSConverter<IDLLong>::convert):
(WebCore::JSConverter<IDLUnsignedLong>::convert):
(WebCore::JSConverter<IDLLongLong>::convert):
(WebCore::JSConverter<IDLUnsignedLongLong>::convert):
(WebCore::JSConverter<IDLFloat>::convert):
(WebCore::JSConverter<IDLUnrestrictedFloat>::convert):
(WebCore::JSConverter<IDLDouble>::convert):
(WebCore::JSConverter<IDLUnrestrictedDouble>::convert):
(WebCore::JSConverter<IDLDOMString>::convert):
(WebCore::JSConverter<IDLUSVString>::convert):
(WebCore::JSConverter<IDLSequence<T>>::convert):
(WebCore::JSConverter<IDLFrozenArray<T>>::convert):
(WebCore::JSConverter<IDLEnumeration<T>>::convert):
(WebCore::JSConverter<IDLUnion<T...>>::convert):
There is slightly more duplication than I would have liked, for instance we have a
specialization for each numeric type, even though they are all the same, but that is
something that can be improved going forward.
(WebCore::Converter<IDLUnion<T...>>::convert)
Fix the normal IDLUnion converter to work with boolean types. This was caught by the
test case I added via TypeConversions.idl.
* bindings/js/JSDOMStringMapCustom.cpp:
(WebCore::JSDOMStringMap::getOwnPropertySlotDelegate):
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::setTimeout):
(WebCore::JSDOMWindow::setInterval):
* bindings/js/JSDataTransferCustom.cpp:
(WebCore::JSDataTransfer::types):
* bindings/js/JSMediaStreamTrackCustom.cpp:
(WebCore::JSMediaStreamTrack::getCapabilities):
* bindings/js/JSMutationCallback.cpp:
(WebCore::JSMutationCallback::call):
* bindings/js/JSSVGLengthCustom.cpp:
(WebCore::JSSVGLength::value):
Switch to use new toJS<> functions.
* bindings/scripts/CodeGeneratorJS.pm:
(AddStringifierOperationIfNeeded):
Fix stringifier function signature to contain an idlType.
(GenerateEnumerationsHeaderContent):
Remove now unnecessary JSValueTraits specializations.
(JSValueToNativeIsHandledByDOMConvert):
Renamed from IsHandledByDOMConvert, since that name is now ambiguous.
(JSValueToNative):
Update for new name of IsHandledByDOMConvert.
(NativeToJSValueIsHandledByDOMConvert):
Predicate guarding what types currently work with the new conversion system.
(NativeToJSValueDOMConvertNeedsState):
Predicate for determining if the ExecState is needed in the conversion function.
(NativeToJSValueDOMConvertNeedsGlobalObject):
Predicate for determining if the global object is needed in the conversion function.
(NativeToJSValue):
Move things around a little bit and start converting use the new toJS<> when possible.
* bindings/scripts/IDLParser.pm:
(parseAttributeOrOperationRest):
Fix a missing place where were not setting the idlType.
* bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
* bindings/scripts/test/JS/JSTestCEReactions.cpp:
* bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
* bindings/scripts/test/JS/JSTestCallback.cpp:
* bindings/scripts/test/JS/JSTestCallbackFunction.cpp:
* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
* bindings/scripts/test/JS/JSTestException.cpp:
* bindings/scripts/test/JS/JSTestGlobalObject.cpp:
* bindings/scripts/test/JS/JSTestInterface.cpp:
* bindings/scripts/test/JS/JSTestNode.cpp:
* bindings/scripts/test/JS/JSTestNondeterministic.cpp:
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestObj.h:
* bindings/scripts/test/JS/JSTestSerialization.cpp:
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
* bindings/scripts/test/JS/JSattribute.cpp:
Update test results.
* testing/TypeConversions.h:
(WebCore::TypeConversions::testUnion):
(WebCore::TypeConversions::setTestUnion):
(WebCore::TypeConversions::typeConversionsDictionarySequenceValue):
(WebCore::TypeConversions::typeConversionsDictionaryUnionValue):
* testing/TypeConversions.idl:
Add a testUnion attribute, now that we can return unions to JS.
2016-10-23 Zalan Bujtas <zalan@apple.com>
Unreviewed, rolling out r207727.
broke 15 selection test cases.
Reverted changeset:
"Do not update selection rect on dirty lineboxes."
https://bugs.webkit.org/show_bug.cgi?id=163862
http://trac.webkit.org/changeset/207727
2016-10-23 Chris Dumez <cdumez@apple.com>
addEventListener() / removeEventListener() should use a union for last parameter
https://bugs.webkit.org/show_bug.cgi?id=163863
Reviewed by Darin Adler.
addEventListener() / removeEventListener() should use a union for last parameter:
- https://dom.spec.whatwg.org/#eventtarget
No new tests, no Web-exposed behavior change.
* bindings/js/JSDOMConvert.h:
* dom/EventTarget.cpp:
(WebCore::EventTarget::addEventListenerForBindings):
(WebCore::EventTarget::removeEventListenerForBindings):
* dom/EventTarget.h:
* dom/EventTarget.idl:
2016-10-23 Zalan Bujtas <zalan@apple.com>
Do not update selection rect on dirty lineboxes.
https://bugs.webkit.org/show_bug.cgi?id=163862
<rdar://problem/28813156>
Reviewed by Simon Fraser.
In addition to checking whether the renderer needs layout, we also need to check if its preferred
width is clean and stop computing the selection rects, if needed (while adding a renderer to the tree,
there's a transition phase where the parent's preferred width dirty bit is already set, but it does
not yet need layout).
Tests: fast/css-generated-content/dynamic-first-letter-selection-clear-crash.html
* rendering/RenderObject.cpp:
(WebCore::RenderObject::canUpdateSelectionOnRootLineBoxes):
2016-10-22 Myles C. Maxfield <mmaxfield@apple.com>
ASSERTION FAILED: m_fonts in &WebCore::FontCascade::primaryFont
https://bugs.webkit.org/show_bug.cgi?id=163459
Reviewed by Darin Adler.
The CSS Units and Values spec states that font-relative units, when used
in the font-size property, are resolved against the parent element. When
calc() is specified, we were trying to resolve them against the current
element, which is impossible because of the circular dependency. Instead,
we should resolve against the parent style the same way as when calc()
isn't specified.
Test: fast/text/font-size-calc.html
* css/StyleBuilderCustom.h:
(WebCore::StyleBuilderCustom::applyValueFontSize):
2016-10-22 Chris Dumez <cdumez@apple.com>
[Web IDL] Two types are distinguishable for overload resolution if at most one of the two includes a nullable type
https://bugs.webkit.org/show_bug.cgi?id=163791
Reviewed by Sam Weinig.
Update overload resolution in the bindings generator so that 2 nullable types
are no longer considered as distinguishable, as per Web IDL:
- https://heycam.github.io/webidl/#dfn-distinguishable
* bindings/scripts/CodeGeneratorJS.pm:
(AreTypesDistinguishableForOverloadResolution):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjPrototypeFunctionOverloadWithNullableNonDistinguishingParameter1):
(WebCore::jsTestObjPrototypeFunctionOverloadWithNullableNonDistinguishingParameter1Caller):
(WebCore::jsTestObjPrototypeFunctionOverloadWithNullableNonDistinguishingParameter2):
(WebCore::jsTestObjPrototypeFunctionOverloadWithNullableNonDistinguishingParameter2Caller):
(WebCore::jsTestObjPrototypeFunctionOverloadWithNullableNonDistinguishingParameter):
* bindings/scripts/test/TestObj.idl:
2016-10-22 Chris Dumez <cdumez@apple.com>
WebGLRenderingContextBase.texSubImage2D() should use a union instead of overloading
https://bugs.webkit.org/show_bug.cgi?id=163859
Reviewed by Darin Adler.
WebGLRenderingContextBase.texSubImage2D() should use a union instead of overloading:
- https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14
No new tests, no Web-exposed behavior change.
* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::texSubImage2D):
* html/canvas/WebGL2RenderingContext.h:
* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::texSubImage2D):
* html/canvas/WebGLRenderingContext.h:
* html/canvas/WebGLRenderingContextBase.h:
* html/canvas/WebGLRenderingContextBase.idl:
2016-10-22 Dan Bernstein <mitz@apple.com>
Dynamically-added backdrop filter to clip-path'd element with 3D transform renders incorrectly (without clip)
https://bugs.webkit.org/show_bug.cgi?id=163497
Reviewed by Simon Fraser.
Test: css3/filters/backdrop/dynamic-with-clip-path.html
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::ensureStructuralLayer): Added MaskLayerChanged to
structuralLayerChangeFlags to ensure that the mask layer is updated.
2016-10-22 Simon Fraser <simon.fraser@apple.com>
Backdrop filter doesn't show if removed then re-added
https://bugs.webkit.org/show_bug.cgi?id=163860
Reviewed by Dan Bernstein.
When a backdrop filter is removed the re-added, updateBackdropFiltersRect() never
runs the second time because m_backdropFiltersRect doesn't change. However, we need
to run that code to size and position the newly re-created backdrop layer, so run
it explicitly if we just created the backdrop layer. This is similar to how
updateContentsImage() calls updateContentsRects().
Test: css3/filters/backdrop/add-remove-add-backdrop-filter.html
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::setBackdropFilters):
(WebCore::GraphicsLayerCA::updateBackdropFilters):
2016-10-22 Simon Fraser <simon.fraser@apple.com>
Fix repainting of slow repaint objects in WK1 when page scale is applied
https://bugs.webkit.org/show_bug.cgi?id=163854
Reviewed by Zalan Bujtas.
RenderObject::repaintSlowRepaintObject() always set the repaint container to the RenderView
if it was null. This is before the call to clippedOverflowRectForRepaint(). If that function
is called with a null repaintContainer, it maps the rect up through the RenderView's transform
(which represents page scale), which is what we want here. Passing the RenderView itself
stops the transform from being applied, which led to the bug.
WebKit2 doesn't suffer from this bug because containerForRepaint() always returns the
composited RenderView.
Test: fast/repaint/zoomed-fixed-background.html
* rendering/RenderObject.cpp:
(WebCore::RenderObject::repaintSlowRepaintObject):
2016-10-22 Darin Adler <darin@apple.com>
Move HTML canvas and tracks from ExceptionCode to Exception
https://bugs.webkit.org/show_bug.cgi?id=163853
Reviewed by Chris Dumez.
* WebCore.xcodeproj/project.pbxproj: Added CanvasPath.idl.
* bindings/js/JSWebGL2RenderingContextCustom.cpp: Tweaked a bit.
* bindings/js/JSWebGLRenderingContextBaseCustom.cpp:
(WebCore::JSWebGLRenderingContextBase::getExtension): Tweaked a bit.
(WebCore::JSWebGLRenderingContextBase::getFramebufferAttachmentParameter):
Removed unneeded exception handling.
(WebCore::JSWebGLRenderingContextBase::getParameter): Ditto.
(WebCore::JSWebGLRenderingContextBase::getProgramParameter): Ditto.
(WebCore::JSWebGLRenderingContextBase::getShaderParameter): Ditto.
(WebCore::JSWebGLRenderingContextBase::getSupportedExtensions): Use a
modern for loop.
(WebCore::JSWebGLRenderingContextBase::getUniform): Removed unneeded
exception handling.
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::getContext): Pass a reference.
(WebCore::HTMLCanvasElement::reset): Use is<CanvasRenderingContext2D>.
(WebCore::HTMLCanvasElement::setUsesDisplayListDrawing): Ditto.
(WebCore::HTMLCanvasElement::setTracksDisplayListReplay) Ditto.:
(WebCore::HTMLCanvasElement::displayListAsText): Ditto.
(WebCore::HTMLCanvasElement::replayDisplayListAsText): Ditto.
(WebCore::HTMLCanvasElement::clearImageBuffer): Ditto.
* html/canvas/CanvasGradient.cpp:
(WebCore::CanvasGradient::CanvasGradient): Streamlined.
(WebCore::CanvasGradient::addColorStop): Use ExceptionOr.
* html/canvas/CanvasGradient.h: Updated for above changes.
* html/canvas/CanvasGradient.idl: Use non-legacy exception.
* html/canvas/CanvasPath.cpp:
(WebCore::CanvasPath::arcTo): Use ExceptionOr.
(WebCore::CanvasPath::arc): Ditto.
(WebCore::CanvasPath::ellipse): Ditto.
* html/canvas/CanvasPath.h: Updated for above changes.
* html/canvas/CanvasPath.idl: Use non-legacy exceptions.
* html/canvas/CanvasPattern.cpp:
(WebCore::CanvasPattern::create): Use Ref&&.
(WebCore::CanvasPattern::CanvasPattern): Ditto.
(WebCore::CanvasPattern::parseRepetitionType): Return a boolean
instead of using an ExceptionCode.
* html/canvas/CanvasPattern.h: Updated for above changes.
* html/canvas/CanvasRenderingContext.cpp:
(CanvasRenderingContext::wouldTaintOrigin): Reordered function so
that it's safe to call it on an image element without a cached
image, or a cached image without an underlying image.
* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::CanvasRenderingContext2D):
Take a reference.
(WebCore::CanvasRenderingContext2D::drawImage): Use ExceptionOr.
(WebCore::CanvasRenderingContext2D::drawImageFromRect): Ditto.
(WebCore::CanvasRenderingContext2D::createLinearGradient): Ditto.
(WebCore::CanvasRenderingContext2D::createRadialGradient): Ditto.
(WebCore::CanvasRenderingContext2D::createPattern): Ditto.
(WebCore::CanvasRenderingContext2D::createImageData): Ditto.
(WebCore::CanvasRenderingContext2D::getImageData): Ditto.
(WebCore::CanvasRenderingContext2D::webkitGetImageDataHD): Ditto.
(WebCore::CanvasRenderingContext2D::putImageData): Removed unneeded
ExceptionCode because this does not throw exceptions; the only one
was for non-finite numeric values but this is now handled by bindings.
(WebCore::CanvasRenderingContext2D::webkitPutImageDataHD): Ditto.
* html/canvas/CanvasRenderingContext2D.h: Updated for above.
* html/canvas/CanvasRenderingContext2D.idl: Use non-legacy exceptions
and removed exceptions entirely in other cases.
* html/canvas/OESVertexArrayObject.cpp:
(WebCore::OESVertexArrayObject::OESVertexArrayObject): Take a reference.
(WebCore::OESVertexArrayObject::~OESVertexArrayObject): Deleted.
(WebCore::OESVertexArrayObject::isVertexArrayOES): Use && instead of
multiple return statements.
(WebCore::OESVertexArrayObject::bindVertexArrayOES): Removed unneeded
ExceptionCode since this does not throw an exception.
* html/canvas/OESVertexArrayObject.h: Updated for above.
* html/canvas/OESVertexArrayObject.idl: Removed unneeded exception.
* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::getFramebufferAttachmentParameter):
Removed unneeded ExceptionCode since this does not throw an exception.
(WebCore::WebGL2RenderingContext::texSubImage2DBase): Ditto.
(WebCore::WebGL2RenderingContext::texSubImage2DImpl): Ditto.
(WebCore::WebGL2RenderingContext::texSubImage2D): Removed unneeded
ExceptionCode for some overloads, for the others, use ExceptionOr
for the security exception. Moved security exception code here from
the validate functions.
(WebCore::WebGL2RenderingContext::validateTexFuncParameters): Removed
unneeded ExceptionCode.
(WebCore::WebGL2RenderingContext::getParameter): Ditto.
* html/canvas/WebGL2RenderingContext.h: Updated for above.
* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::getExtension): Pass a reference.
(WebCore::WebGLRenderingContext::getFramebufferAttachmentParameter):
Remvoed unneeded ExceptionCode since this does not throw an exception.
(WebCore::WebGLRenderingContext::texSubImage2DBase): Ditto.
(WebCore::WebGLRenderingContext::texSubImage2DImpl): Ditto.
(WebCore::WebGLRenderingContext::texSubImage2D): Removed unneeded
ExceptionCode for some overloads, for the others, use ExceptionOr
for the security exception. Moved security exception code here from
the validate functions.
(WebCore::WebGLRenderingContext::getParameter): Removed unneeded
ExceptionCode.
* html/canvas/WebGLRenderingContext.h: Updated for above changes.
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::texImage2DBase):
Remvoed unneeded ExceptionCode since this does not throw an exception.
(WebCore::WebGLRenderingContextBase::texImage2DImpl): Ditto.
(WebCore::WebGLRenderingContextBase::texImage2D): Removed unneeded
ExceptionCode for some overloads, for the others, use ExceptionOr
for the security exception. Moved security exception code here from
the validate functions.
(WebCore::WebGLRenderingContextBase::validateHTMLImageElement):
Moved the security exception out of here to the call sites.
(WebCore::WebGLRenderingContextBase::validateHTMLCanvasElement): Ditto.
(WebCore::WebGLRenderingContextBase::validateHTMLVideoElement): Ditto.
* html/canvas/WebGLRenderingContextBase.h: Updated for above changes.
* html/canvas/WebGLRenderingContextBase.idl: Use non-legacy exceptions
in some cases and no exceptions at all in many others.
* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlTextTrackContainerElement::updateDisplay):
Use a reference instead of a pointer.
* html/track/DataCue.h: Use pragma once.
* html/track/DataCue.idl: Use non-legacy exception for constructor
attribute, even though it is custom and so it has no effect.
* html/track/InbandDataTextTrack.cpp:
(WebCore::InbandDataTextTrack::create): Use RefPtr&&.
(WebCore::InbandDataTextTrack::InbandDataTextTrack): Ditto.
(WebCore::InbandDataTextTrack::addDataCue): Stop using
ASSERT_NO_EXCEPTION.
(WebCore::InbandDataTextTrack::removeDataCue): Stop using
IGNORE_EXCEPTION.
(WebCore::InbandDataTextTrack::removeCue): Use ExceptionOr.
Also use remove instead of find/remove.
* html/track/InbandDataTextTrack.h: Updated for above changes.
* html/track/InbandGenericTextTrack.cpp:
(WebCore::GenericTextTrackCueMap::GenericTextTrackCueMap): Deleted.
(WebCore::GenericTextTrackCueMap::~GenericTextTrackCueMap): Deleted.
(WebCore::GenericTextTrackCueMap::add): Take references intead of
pointers.
(WebCore::GenericTextTrackCueMap::find): Ditto. Also use get
instead of find.
(WebCore::GenericTextTrackCueMap::remove): Ditto. Also use take
instead of double hashing to both find and remove.
(WebCore::InbandGenericTextTrack::updateCueFromCueData): Stop using
IGNORE_EXCEPTION. Also got rid of code that is converting a double
to a long and then back to a double by using lround. Instead just
use std::round, which keeps it a double. But also, why does this need
to round?!
(WebCore::InbandGenericTextTrack::addGenericCue): Updated to use
reference to work with m_cueMap.
(WebCore::InbandGenericTextTrack::updateGenericCue): Ditto.
(WebCore::InbandGenericTextTrack::removeGenericCue): Ditto.
(WebCore::InbandGenericTextTrack::removeCue): Use ExceptionOr.
(WebCore::InbandGenericTextTrack::newCuesParsed): Removed
ASSERT_NO_EXCEPTION.
* html/track/InbandGenericTextTrack.h: Updated for above changes.
* html/track/InbandWebVTTTextTrack.cpp:
(WebCore::InbandWebVTTTextTrack::newCuesParsed): Removed
ASSERT_NO_EXCEPTION.
* html/track/TextTrack.cpp:
(WebCore::TextTrack::addCue): Use ExcepctionOr.
(WebCore::TextTrack::removeCue): Ditto.
(WebCore::TextTrack::addRegion): Ditto.
(WebCore::TextTrack::removeRegion): Ditto.
* html/track/TextTrack.h: Updated for above changes.
* html/track/TextTrack.idl: Ditto.
* html/track/TextTrackCue.cpp:
(WebCore::TextTrackCue::cueShadowPseudoId): Moved this here
since it does not need to be inlined in the header.
(WebCore::TextTrackCue::~TextTrackCue): Deleted.
(WebCore::TextTrackCue::setStartTime): Removed ExceptionCode&
since the exceptions were for non-finite values, but this is
now handled by the bindings.
(WebCore::TextTrackCue::setEndTime): Ditto.
* html/track/TextTrackCue.h: Updated for the above.
* html/track/TextTrackCue.idl: Removed SetterMayThrowLegacyException
and made startTime and endTime be double rather than unrestricted double.
* html/track/TextTrackCueGeneric.cpp:
(WebCore::TextTrackCueGenericBoxElement::applyCSSProperties):
Use a reference instead of a pointer.
(WebCore::TextTrackCueGeneric::TextTrackCueGeneric): Initialize
m_defaultPosition in the class definition instead of here.
(WebCore::TextTrackCueGeneric::createDisplayTree): Return a Ref.
(WebCore::TextTrackCueGeneric::setLine): Use ExceptionOr.
(WebCore::TextTrackCueGeneric::setPosition): Ditto.
(WebCore::TextTrackCueGeneric::setFontSize): Updated since
displayTreeInternal() now returns a reference.
* html/track/TextTrackCueGeneric.h: Updated for above changes.
Also fixed some arguument types and made some more things private.
* html/track/VTTCue.cpp:
(WebCore::VTTCue::createDisplayTree): Return a Ref.
(WebCore::VTTCue::displayTreeInternal): Return a reference.
(WebCore::VTTCue::setVertical): Use ExceptionOr.
(WebCore::VTTCue::setLine): Ditto.
(WebCore::VTTCue::setPosition): Ditto.
(WebCore::VTTCue::setSize): Ditto.
(WebCore::VTTCue::setAlign): Ditto.
(WebCore::VTTCue::getDisplayTree): Return a reference.
(WebCore::VTTCue::removeDisplayTree): Updated since
displayTreeInternal returns a reference.
(WebCore::VTTCue::setFontSize): Ditto.
* html/track/VTTCue.h: Updated for the above.
* html/track/VTTCue.idl: Use non-legacy exceptions and also
restricted doubles.
* html/track/VTTRegion.cpp:
(WebCore::VTTRegion::VTTRegion): Moved default values all into
the class definition.
(WebCore::VTTRegion::setWidth): Removed the check for non-finite
since the bindings now handle that. Use ExcpetionOr.
(WebCore::VTTRegion::setHeight): Ditto.
(WebCore::VTTRegion::setRegionAnchorX): Ditto.
(WebCore::VTTRegion::setRegionAnchorY): Ditto.
(WebCore::VTTRegion::setViewportAnchorX): Ditto.
(WebCore::VTTRegion::setViewportAnchorY): Ditto.
(WebCore::upKeyword): Added. Shared by the code below.
(WebCore::VTTRegion::scroll): Rewrote to be simpler.
(WebCore::VTTRegion::setScroll): Rewrote to be simpler.
(WebCore::VTTRegion::updateParametersFromRegion): Read and
write data members directly to avoid awkward code that is otherwise
required just to copy from one object to the other. Also take a
const& instead of a pointer for the thing to update from.
(WebCore::VTTRegion::parseSettingValue): Use upKeyword.
(WebCore::VTTRegion::appendTextTrackCueBox): Take a Ref&&.
(WebCore::VTTRegion::getDisplayTree): Do the downcast to Document
here instead of using the helper function.
(WebCore::VTTRegion::prepareRegionDisplayTree): Ditto.
* html/track/VTTRegion.h: Updated for the above.
* html/track/VTTRegion.idl: Use non-legacy exceptions and also
use restricted dobules, not unrestricted.
2016-10-22 Chris Dumez <cdumez@apple.com>
WebGLRenderingContextBase.texImage2D() should use a union instead of overloading
https://bugs.webkit.org/show_bug.cgi?id=163856
Reviewed by Darin Adler.
WebGLRenderingContextBase.texImage2D() should use a union instead of overloading:
- https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::texImage2D):
* html/canvas/WebGLRenderingContextBase.h:
* html/canvas/WebGLRenderingContextBase.idl:
2016-10-22 Antti Koivisto <antti@apple.com>
REGRESSION(r207669): Dromaeo/jslib-style-jquery.html regressed >20%
https://bugs.webkit.org/show_bug.cgi?id=163851
Reviewed by Darin Adler.
The test calls Scope::flushPendingUpdate a lot and nothing ever happens there.
Add a separate invalidity bit for descendant scopes and inline the fast path.
* style/StyleScope.cpp:
(WebCore::Style::Scope::flushPendingSelfUpdate):
(WebCore::Style::Scope::flushPendingDescendantUpdates):
(WebCore::Style::Scope::scheduleUpdate):
(WebCore::Style::Scope::flushPendingUpdate): Deleted.
* style/StyleScope.h:
(WebCore::Style::Scope::hasPendingUpdate):
(WebCore::Style::Scope::flushPendingUpdate):
2016-10-22 Darin Adler <darin@apple.com>
Move SVG from ExceptionCode to Exception
https://bugs.webkit.org/show_bug.cgi?id=163837
Reviewed by Chris Dumez.
* WebCore.xcodeproj/project.pbxproj: Added SVGGraphicsElement.idl.
* bindings/js/JSSVGLengthCustom.cpp:
(WebCore::JSSVGLength::value): Use toJSNumber.
(WebCore::JSSVGLength::setValue): Use propagateException.
(WebCore::JSSVGLength::convertToSpecifiedUnits): Ditto.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation): Properly handle SetterMayThrowException
in the special case for SVG setters.
* rendering/style/SVGRenderStyle.h:
(WebCore::SVGRenderStyle::initialBaselineShiftValue): Removed
ASSERT_NO_EXCEPTION, no longer needed.
(WebCore::SVGRenderStyle::initialKerning): Ditto.
* svg/SVGAltGlyphElement.cpp:
(WebCore::SVGAltGlyphElement::setGlyphRef): Use ExceptionOr.
(WebCore::SVGAltGlyphElement::setFormat): Ditto.
(WebCore::SVGAltGlyphElement::hasValidGlyphElements): Tweaked a bit.
* svg/SVGAltGlyphElement.h: Updated for above changes.
* svg/SVGAltGlyphElement.idl: Use non-legacy exceptions.
* svg/SVGAngle.cpp:
(WebCore::SVGAngle::valueAsString): Removed unneeded String globals.
(WebCore::parseAngleType): Rewrote to be simpler and more direct.
(WebCore::SVGAngle::setValueAsString): Use ExceptionOr.
(WebCore::SVGAngle::newValueSpecifiedUnits): Ditto.
(WebCore::SVGAngle::convertToSpecifiedUnits): Ditto.
* svg/SVGAngle.h: Updated for above changes. Initialized data members
here in the class definite and removed constructor; default now works.
* svg/SVGAngle.idl: Use non-legacy exceptions.
* svg/SVGAnimateElementBase.cpp:
(WebCore::SVGAnimateElementBase::calculateAnimatedValue): Update since
CalcMode is now an enum class.
* svg/SVGAnimateMotionElement.cpp:
(WebCore::SVGAnimateMotionElement::SVGAnimateMotionElement): Ditto.
* svg/SVGAnimateTransformElement.cpp:
(WebCore::SVGAnimateTransformElement::hasValidAttributeType): Update
since AttributeType is now an enum class.
* svg/SVGAnimatedAngle.cpp:
(WebCore::SVGAnimatedAngleAnimator::calculateDistance): Removed
ASSERT_NO_EXCEPTION, no longer needed.
* svg/SVGAnimatedBoolean.idl: Use non-legacy exception.
* svg/SVGAnimatedEnumeration.idl: Ditto.
* svg/SVGAnimatedInteger.idl: Ditto.
* svg/SVGAnimatedLength.cpp:
(WebCore::sharedSVGLength): Deleted.
(WebCore::SVGAnimatedLengthAnimator::addAnimatedTypes): Removed
ASSERT_NO_EXCEPTION, no longer needed.
(WebCore::parseLengthFromString): Ditto. Also rewrote to not use
a shared SVGLength; no benefit to doing that.
(WebCore::SVGAnimatedLengthAnimator::calculateAnimatedValue): Ditto.
* svg/SVGAnimatedLengthList.cpp:
(WebCore::SVGAnimatedLengthListAnimator::addAnimatedTypes): Ditto.
(WebCore::SVGAnimatedLengthListAnimator::calculateAnimatedValue): Ditto.
* svg/SVGAnimatedNumber.idl: Use non-legacy exception.
* svg/SVGAnimatedString.idl: Ditto.
* svg/SVGAnimatedType.cpp:
(WebCore::SVGAnimatedType::setValueAsString): Updated since
setValueAsString now uses ExceptionOr.
* svg/SVGAnimationElement.cpp:
(WebCore::SVGAnimationElement::SVGAnimationElement): Initialized scalars
in the class definition instead of here.
(WebCore::SVGAnimationElement::getSimpleDuration): Removed uneeded ExceptionCode&.
(WebCore::SVGAnimationElement::setCalcMode): Updated since CalcMode is now an enum class.
(WebCore::SVGAnimationElement::setAttributeType): Updated since AttributeType
is now an enum class.
(WebCore::SVGAnimationElement::shouldApplyAnimation): Ditto.
(WebCore::SVGAnimationElement::calculateKeyTimesForCalcModePaced): Ditto.
(WebCore::SVGAnimationElement::calculatePercentForSpline): Ditto.
(WebCore::SVGAnimationElement::calculatePercentFromKeyPoints): Ditto.
(WebCore::SVGAnimationElement::calculatePercentForFromTo): Ditto.
(WebCore::SVGAnimationElement::currentValuesFromKeyPoints): Ditto.
(WebCore::SVGAnimationElement::currentValuesForValuesAnimation): Ditto.
(WebCore::SVGAnimationElement::startedActiveInterval): Ditto.
(WebCore::SVGAnimationElement::updateAnimation): Ditto.
(WebCore::SVGAnimationElement::checkInvalidCSSAttributeType): Ditto.
* svg/SVGAnimationElement.h: Changed CalcMode into an enum class.
Updated for above changes.
* svg/SVGAnimationElement.idl: Removed MayThrowLegacyException from
getSimpleDuration.
* svg/SVGColor.cpp:
(WebCore::SVGColor::SVGColor): Updated to take scalar in the straightforward
manner instead of constt SVGColorType&.
(WebCore::SVGColor::setRGBColor): Use ExceptionOr.
(WebCore::SVGColor::setRGBColorICCColor): Ditto.
(WebCore::SVGColor::setColor): Ditto.
* svg/SVGColor.h: Updated for above changes. Removed unneeded destructor.
* svg/SVGColor.idl: Use non-legacy exceptions.
* svg/SVGGlyphRefElement.cpp:
(WebCore::SVGGlyphRefElement::SVGGlyphRefElement): Initialize data members
in class definition, not here.
(WebCore::parseFloat): Added helper. Used in parseAttribute.
(WebCore::SVGGlyphRefElement::parseAttribute): Updated to use parseFloat helper.
(WebCore::SVGGlyphRefElement::glyphRef): Deleted.
(WebCore::SVGGlyphRefElement::setGlyphRef): Deleted.
(WebCore::SVGGlyphRefElement::setX): Removed unused Exception& argument.
(WebCore::SVGGlyphRefElement::setY): Ditto.
(WebCore::SVGGlyphRefElement::setDx): Ditto.
(WebCore::SVGGlyphRefElement::setDy): Ditto.
* svg/SVGGlyphRefElement.h: Updated for above changes.
* svg/SVGGlyphRefElement.idl: Use Reflect on glyphRef. Removed incorrect
SetterMayThrowLegacyException attributes for x, y, dx, and dy. Longer term
it might be nice to use [Reflect] on these too.
* svg/SVGGraphicsElement.idl: Use non-legacy exception.
* svg/SVGLength.cpp:
(WebCore::parseLengthType): Changed argument type since caller does not
need to know how many characters are consumed.
(WebCore::SVGLength::SVGLength): Removed IGNORE_EXCEPTION and ASSERT_NO_EXCEPTION.
Also removed the copy constructor, letting the compiler generate the default.
(WebCore::SVGLength::setValueAsString): Use ExceptionOr.
(WebCore::SVGLength::construct): Updated since setValueAsString uses ExceptionOr.
(WebCore::SVGLength::value): Ditto.
(WebCore::SVGLength::valueForBindings): Use ExceptionOr. Also renamed to
disambiguate with the version used outside of bindings.
(WebCore::SVGLength::setValue): Use ExceptionOr.
(WebCore::SVGLength::newValueSpecifiedUnits): Ditto.
(WebCore::SVGLength::convertToSpecifiedUnits): Ditto.
(WebCore::SVGLength::fromCSSPrimitiveValue): Updated since newValueSpecifiedUnits
uses ExceptionOr.
(WebCore::SVGLength::lengthModeForAnimatedLengthAttribute): Rewrote map generation
code to be more efficient and not unrolled. Only do one hash table lookup.
* svg/SVGLength.h: Updated for above changes.
* svg/SVGLength.idl: Use non-legacy exceptions.
* svg/SVGLengthContext.cpp:
(WebCore::SVGLengthContext::valueForLength): Update since function
uses ExceptionOr.
(WebCore::SVGLengthContext::convertValueToUserUnits): Use ExceptionOr.
(WebCore::SVGLengthContext::convertValueFromUserUnits): Ditto.
(WebCore::SVGLengthContext::convertValueFromUserUnitsToPercentage): Ditto.
(WebCore::SVGLengthContext::convertValueFromPercentageToUserUnits): Ditto.
(WebCore::SVGLengthContext::convertValueFromUserUnitsToEMS): Ditto.
(WebCore::SVGLengthContext::convertValueFromEMSToUserUnits): Ditto.
(WebCore::SVGLengthContext::convertValueFromUserUnitsToEXS): Ditto.
(WebCore::SVGLengthContext::convertValueFromEXSToUserUnits): Ditto.
* svg/SVGLengthContext.h: Updatedfor above changes.
* svg/SVGLengthList.cpp:
(WebCore::SVGLengthList::parse): Updated since setValueAsString uses
ExceptionOr now.
* svg/SVGLengthList.h: Removed unneeded constructor.
* svg/SVGLengthList.idl: Use non-legacy exceptions.
* svg/SVGLocatable.cpp:
(WebCore::SVGLocatable::getTransformToElement): Use ExceptionOr.
* svg/SVGLocatable.h: Updated for above change.
* svg/SVGMarkerElement.h:
(WebCore::SVGPropertyTraits<SVGMarkerOrientType>::fromString):
Updated since setValueAsString uses ExceptionOr now.
* svg/SVGMatrix.h: Use ExceptionOr.
* svg/SVGMatrix.idl: Use non-legacy exceptions.
* svg/SVGNumberList.h: Removed unneeded constructor.
* svg/SVGNumberList.idl: Use non-legacy exceptions.
* svg/SVGPaint.cpp:
(WebCore::SVGPaint::setPaint): Use ExceptionOr.
* svg/SVGPaint.h: Updated for above chagne.
* svg/SVGPaint.idl: Use non-legacy exception.
* svg/SVGPathSegList.h: Tweaked a bit.
* svg/SVGPathSegList.idl: Use non-legacy exceptions.
* svg/SVGPointList.h: Removed unneeded constructor.
* svg/SVGPointList.idl: Use non-legacy exceptions.
* svg/SVGPreserveAspectRatio.cpp:
(WebCore::SVGPreserveAspectRatio::setAlign): Use ExceptionOr.
(WebCore::SVGPreserveAspectRatio::setMeetOrSlice): Ditto.
* svg/SVGPreserveAspectRatio.h: Updated for above changes.
* svg/SVGPreserveAspectRatio.idl: Use non-legacy exceptions.
* svg/SVGSVGElement.cpp:
(WebCore::SVGSVGElement::currentView): Pass a reference.
* svg/SVGStringList.h: Tweaked a bit.
* svg/SVGStringList.idl: Use non-legacy exceptions.
* svg/SVGStyleElement.cpp:
(WebCore::SVGStyleElement::setType): Removed unneeded ExceptionCode&.
(WebCore::SVGStyleElement::setMedia): Ditto.
(WebCore::SVGStyleElement::setTitle): Deleted.
* svg/SVGStyleElement.h: Updated for above changes, and made the title
function override be private.
* svg/SVGStyleElement.idl: Use Reflect for title. Removed unneeded
SetterMayThrowLegacyException on all attributes.
* svg/SVGTextContentElement.cpp:
(WebCore::SVGTextContentElement::textLengthAnimated): Removed
ASSERT_NO_EXCEPTION, won't work any more.
(WebCore::SVGTextContentElement::getSubStringLength): Use ExceptionOr.
Also remove redundant call to updateLayoutIgnorePendingStylesheets,
called by getNumberOfChars.
(WebCore::SVGTextContentElement::getStartPositionOfChar): Ditto.
(WebCore::SVGTextContentElement::getEndPositionOfChar): Ditto.
(WebCore::SVGTextContentElement::getExtentOfChar): Ditto.
(WebCore::SVGTextContentElement::getRotationOfChar): Ditto.
(WebCore::SVGTextContentElement::selectSubString): Ditto.
* svg/SVGTextContentElement.h: Updated for above changes.
* svg/SVGTextContentElement.idl: Use non-legacy exceptions.
* svg/SVGTransformList.h: Removed unneeded constructor.
* svg/SVGTransformList.idl: Use non-legacy exceptions.
* svg/SVGViewSpec.cpp:
(WebCore::SVGViewSpec::SVGViewSpec): Updated to take a reference.
(WebCore::SVGViewSpec::setZoomAndPan): Use ExceptionOr.
(WebCore::SVGViewSpec::setTransformString): Deleted.
(WebCore::SVGViewSpec::viewBoxString): Use m_viewBox directly.
(WebCore::SVGViewSpec::preserveAspectRatioString): Use
m_preserveAspectRatio directly.
(WebCore::SVGViewSpec::viewTarget): Use is<SVGElement>.
(WebCore::SVGViewSpec::lookupOrCreateViewBoxWrapper): Use
m_contextElement directly.
(WebCore::SVGViewSpec::lookupOrCreatePreserveAspectRatioWrapper):
Ditto.
(WebCore::SVGViewSpec::lookupOrCreateTransformWrapper): Ditto.
(WebCore::SVGViewSpec::parseViewSpec): Set m_viewTargetString directly.
* svg/SVGViewSpec.h: Updated for above changes. Removed unneeded virtual
destructor, unneeded using for ref/deref, unused functions including
setTransformString, setViewTargetString, non-exception setZoomAndPan,
contextElement, viewBoxBaseValue, and preserveAspectRatioBaseValue.
* svg/SVGViewSpec.idl: Use non-legacy exceptions. Also specify
ImplementationLacksVTable.
* svg/properties/SVGAnimatedEnumerationPropertyTearOff.h:
Use ExceptionOr.
* svg/properties/SVGAnimatedStaticPropertyTearOff.h: Ditto.
* svg/properties/SVGListProperty.h: Ditto.
* svg/properties/SVGListPropertyTearOff.h: Ditto.
* svg/properties/SVGPathSegListPropertyTearOff.cpp:
(WebCore::SVGPathSegListPropertyTearOff::clear): Ditto.
(WebCore::SVGPathSegListPropertyTearOff::getItem): Ditto.
(WebCore::SVGPathSegListPropertyTearOff::replaceItem): Ditto.
(WebCore::SVGPathSegListPropertyTearOff::removeItem): Ditto.
* svg/properties/SVGPathSegListPropertyTearOff.h: Ditto.
* svg/properties/SVGPropertyTearOff.h: Ditto. Also added an overload
of create that knows how to deal with exceptions.
* svg/properties/SVGStaticListPropertyTearOff.h: Ditto.
* svg/properties/SVGTransformListPropertyTearOff.h: Ditto.
2016-10-22 Chris Dumez <cdumez@apple.com>
WebGLRenderingContextBase.bufferData() should use a union instead of overloading
https://bugs.webkit.org/show_bug.cgi?id=163795
Reviewed by Darin Adler.
WebGLRenderingContextBase.bufferData() / bufferSubData() should use a union
instead of overloading:
- https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14
No new tests, no web-exposed behavior change.
* bindings/js/JSDOMConvert.h:
(WebCore::Converter<IDLInterface<T>>::convert):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
* bindings/scripts/test/JS/JSInterfaceName.h:
* bindings/scripts/test/JS/JSTestActiveDOMObject.h:
* bindings/scripts/test/JS/JSTestCEReactions.h:
* bindings/scripts/test/JS/JSTestCEReactionsStringifier.h:
* bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.h:
* bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h:
* bindings/scripts/test/JS/JSTestCustomNamedGetter.h:
* bindings/scripts/test/JS/JSTestEventConstructor.h:
* bindings/scripts/test/JS/JSTestEventTarget.h:
* bindings/scripts/test/JS/JSTestException.h:
* bindings/scripts/test/JS/JSTestGenerateIsReachable.h:
* bindings/scripts/test/JS/JSTestGlobalObject.h:
* bindings/scripts/test/JS/JSTestInterface.h:
* bindings/scripts/test/JS/JSTestIterable.h:
* bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
* bindings/scripts/test/JS/JSTestNamedConstructor.h:
* bindings/scripts/test/JS/JSTestNode.h:
* bindings/scripts/test/JS/JSTestNondeterministic.h:
* bindings/scripts/test/JS/JSTestObj.h:
* bindings/scripts/test/JS/JSTestOverloadedConstructors.h:
* bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.h:
* bindings/scripts/test/JS/JSTestOverrideBuiltins.h:
* bindings/scripts/test/JS/JSTestSerialization.h:
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
* bindings/scripts/test/JS/JSTestTypedefs.h:
* bindings/scripts/test/JS/JSattribute.h:
* bindings/scripts/test/JS/JSreadonly.h:
* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::bufferData):
(WebCore::WebGL2RenderingContext::bufferSubData):
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::bufferData):
(WebCore::WebGLRenderingContextBase::bufferSubData):
* html/canvas/WebGLRenderingContextBase.h:
* html/canvas/WebGLRenderingContextBase.idl:
2016-10-22 Darin Adler <darin@apple.com>
[Cocoa] REGRESSION (r204508): Crash in init_WebCreateFragment when pasting (seen in multiple apps using legacy WebKit)
https://bugs.webkit.org/show_bug.cgi?id=163839
Reviewed by Dan Bernstein.
* editing/cocoa/EditorCocoa.mm: Use the appropriate SOFT_LINK macros to find
the WebKitLegacy platform in the correct location for iOS and macOS.
2016-10-22 Nael Ouedraogo <nael.ouedraogo@crf.canon.fr>
Bindings error message for missing required dictionary member should be more explicit
https://bugs.webkit.org/show_bug.cgi?id=163665
Reviewed by Darin Adler.
Add throwRequiredMemberTypeError function to throw a TypeError exception with an error
message indicating the missing required member.
No new test required, rebase existing tests.
* bindings/js/JSDOMBinding.cpp:
(WebCore::throwRequiredMemberTypeError):
* bindings/js/JSDOMBinding.h:
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateDictionaryImplementationContent):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::convertDictionary<TestObj::DictionaryThatShouldNotTolerateNull>):
2016-10-22 Ryosuke Niwa <rniwa@webkit.org>
Upgrading custom element should enqueue attributeChanged and connected callbacks
https://bugs.webkit.org/show_bug.cgi?id=163840
Reviewed by Darin Adler.
When upgrading a custom element, enqueue attributeChanged and connectedCallbacks as needed as specified
in step 3 and 4 of: https://html.spec.whatwg.org/multipage/scripting.html#concept-upgrade-an-element
Test: fast/custom-elements/upgrading-enqueue-reactions.html
* bindings/js/JSCustomElementInterface.cpp:
(WebCore::JSCustomElementInterface::upgradeElement): Enqueue
* dom/CustomElementReactionQueue.cpp:
(WebCore::CustomElementReactionQueueItem::invoke): Don't invoke callbacks when the custom element had
failed to upgrade.
(WebCore::CustomElementReactionQueue::enqueuePostUpgradeReactions): Added.
(WebCore::CustomElementReactionQueue::invokeAll): Upgrading a custom element may enqueue more reactions.
Keep invoking reactions until the queue becomes empty.
* dom/CustomElementReactionQueue.h:
* dom/Range.idl: Added a forgotten CEReactions here.
2016-10-21 David Kilzer <ddkilzer@apple.com>
Bug 163762: IntSize::area() should used checked arithmetic
<https://webkit.org/b/163762>
Reviewed by Darin Adler.
No new tests since no change in nominal behavior.
* platform/graphics/IntSize.h:
(WebCore::IntSize::area): Change to return a
Checked<unsigned, T> value. Use WTF:: namespace to avoid
including another header.
* platform/graphics/IntRect.h:
(WebCore::IntRect::area): Ditto.
The remaining changes are to use the Checked<unsigned> return
value of IntSize::area() and IntRect::area() correctly in
context, in addition to items noted below.
* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::isTopLevelFullPagePlugin):
Declare contentWidth and contentHeight as float values to
prevent overflow when computing the area, and to make the
inequality comparison in the return statement uses the same type
for both sides.
* html/ImageData.cpp:
(WebCore::ImageData::ImageData):
* html/MediaElementSession.cpp:
(WebCore::isElementRectMostlyInMainFrame):
* platform/graphics/ImageBackingStore.h:
(WebCore::ImageBackingStore::setSize): Restructure logic to
compute area only once.
(WebCore::ImageBackingStore::clear):
* platform/graphics/ImageFrame.h:
(WebCore::ImageFrame::frameBytes):
* platform/graphics/ImageSource.cpp:
(WebCore::ImageSource::maximumSubsamplingLevel):
* platform/graphics/ca/LayerPool.cpp:
(WebCore::LayerPool::backingStoreBytesForSize):
* platform/graphics/cg/ImageDecoderCG.cpp:
(WebCore::ImageDecoder::frameBytesAtIndex):
* platform/graphics/filters/FEGaussianBlur.cpp:
(WebCore::FEGaussianBlur::platformApplySoftware):
* platform/graphics/filters/FilterEffect.cpp:
(WebCore::FilterEffect::asUnmultipliedImage):
(WebCore::FilterEffect::asPremultipliedImage):
(WebCore::FilterEffect::copyUnmultipliedImage):
(WebCore::FilterEffect::copyPremultipliedImage):
(WebCore::FilterEffect::createUnmultipliedImageResult):
(WebCore::FilterEffect::createPremultipliedImageResult):
* platform/graphics/win/ImageBufferDataDirect2D.cpp:
(WebCore::ImageBufferData::getData): Update overflow check,
rename local variable to numBytes, and compute numBytes once.
* platform/graphics/win/ImageDecoderDirect2D.cpp:
(WebCore::ImageDecoder::frameBytesAtIndex):
* platform/image-decoders/ImageDecoder.cpp:
(WebCore::ImageDecoder::frameBytesAtIndex):
* platform/ios/LegacyTileLayerPool.mm:
(WebCore::LegacyTileLayerPool::bytesBackingLayerWithPixelSize):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::requiresCompositingForCanvas):
* rendering/shapes/Shape.cpp:
(WebCore::Shape::createRasterShape):
2016-10-21 Gavin Barraclough <barraclough@apple.com>
WebPageProxy should not need PageActivityState
https://bugs.webkit.org/show_bug.cgi?id=163821
Reviewed by Geoff Garen.
The PageActivityState is currently plumbed back from WebCore up to the UI process, to
determine whether to enabled process suppression. However the information it contains
(whether a page load is ongoing, whether audio is playing) is already available via
other means. Remove this use of PageActivityState.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaState):
- Fix a bug in how we compute IsPlayingAudio - if the volume of the MediaElement is
set to zero, then audio is not playing (we were already checking muted).
* page/ChromeClient.h:
- removed setPageActivityState
* page/Page.cpp:
(WebCore::Page::setPageActivityState): Deleted.
- setPageActivityState -> pageActivityStateChanged, remove call to ChromeClient
* page/Page.h:
(WebCore::Page::pageActivityStateChanged):
- setPageActivityState -> pageActivityStateChanged
* page/PageThrottler.cpp:
(WebCore::PageThrottler::setActivityFlag):
- setPageActivityState -> pageActivityStateChanged
2016-10-21 Chris Dumez <cdumez@apple.com>
[Web ID] Overload resolution is wrong if one of the types is a nullable union
https://bugs.webkit.org/show_bug.cgi?id=163816
Reviewed by Alex Christensen.
Overload resolution was wrong if one of the types was a nullable union. This
is because we never considered the union type itself, only its subtypes.
Therefore, we checked if any of the union's subtypes were nullable but we
failed to check if the union itself was nullable.
See:
- https://heycam.github.io/webidl/#es-overloads (Step 11.3.)
No new tests, extended bindings tests.
* bindings/scripts/CodeGeneratorJS.pm:
(GetOverloadThatMatchesIgnoringUnionSubtypes):
(GenerateOverloadedFunctionOrConstructor):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjPrototypeFunctionOverloadWithNullableUnion1):
(WebCore::jsTestObjPrototypeFunctionOverloadWithNullableUnion1Caller):
(WebCore::jsTestObjPrototypeFunctionOverloadWithNullableUnion2):
(WebCore::jsTestObjPrototypeFunctionOverloadWithNullableUnion2Caller):
(WebCore::jsTestObjPrototypeFunctionOverloadWithNullableUnion):
(WebCore::jsTestObjPrototypeFunctionOverloadWithOptionalUnion1):
(WebCore::jsTestObjPrototypeFunctionOverloadWithOptionalUnion1Caller):
(WebCore::jsTestObjPrototypeFunctionOverloadWithOptionalUnion2):
(WebCore::jsTestObjPrototypeFunctionOverloadWithOptionalUnion2Caller):
(WebCore::jsTestObjPrototypeFunctionOverloadWithOptionalUnion):
* bindings/scripts/test/TestObj.idl:
2016-10-21 Eric Carlson <eric.carlson@apple.com>
[MediaStream] Dynamically generate media capture sandbox extensions
https://bugs.webkit.org/show_bug.cgi?id=154861
<rdar://problem/24909411>
Reviewed by Tim Horton.
No new tests, some of these changes are covered by existing tests and some can only be tested
with physical capture devices.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: AVSampleBufferAudioRenderer
and AVSampleBufferRenderSynchronizer are now declared in AVFoundationSPI.h.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::MediaPlayerPrivateMediaStreamAVFObjC): Initialize
AVSampleBufferRenderSynchronizer.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::isAvailable): Fail if AVSampleBufferRenderSynchronizer
isn't available.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueAudioSampleBufferFromTrack): Take a MediaSample&
instead of a PlatformSample&.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSampleBufferFromTrack): Ditto.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayer): Add the sample buffer display
later to the synchronizer.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::destroyLayer): Remove the sample buffer display
later from the synchronizer.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::play): Start the synchronizer.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::pause): Stash the current clock time in
m_pausedTime, but leave the clock running. Pause the synchronizer.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::currentMediaTime): Return the clock time
when playing, m_pausedTime time when paused because we leave the clock running forever.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::sampleBufferUpdated):
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: AVSampleBufferAudioRenderer
is now declared in AVFoundationSPI.h.
* platform/spi/mac/AVFoundationSPI.h: Add AVSampleBufferAudioRenderer and AVSampleBufferRenderSynchronizer.
2016-10-21 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r207582.
https://bugs.webkit.org/show_bug.cgi?id=163819
Not quite ready rdar://problem/28897179 (Requested by
alexchristensen on #webkit).
Reverted changeset:
"Re-enable URLParser for non-Safari Cocoa apps after r207321"
https://bugs.webkit.org/show_bug.cgi?id=163690
http://trac.webkit.org/changeset/207582
2016-10-21 Gavin Barraclough <barraclough@apple.com>
WebPage should take UserActivity directly for user input
https://bugs.webkit.org/show_bug.cgi?id=163813
Reviewed by Anders Carlsson.
When we receive mouse/keyboard events in a page, we want to prevent AppNap. We currently do so
via the PageThrottler. This patch is to just make the WebPage drive the UserActivity directly.
Two reasons to do so: (1) to cleanup & simplify for further refactoring. (2) The current code
isn't really achieving the desired effect. The page setting the flag in the throttler to get
the activity to be set is now a less effective way of achieving this goal, since the
PageActivityState bounces back across to the UI process & then messages back to the WebContent
process to take the UserActivity. These extra hops defeat the purpose of making sure the boost
from the initial message isn't lost.
* page/PageThrottler.cpp:
(WebCore::PageThrottler::PageThrottler):
(WebCore::m_userInputHysteresis): Deleted.
* page/PageThrottler.h:
(WebCore::PageThrottler::didReceiveUserInput): Deleted.
- removed PageActivityState::UserInputActivity, didReceiveUserInput, m_userInputHysteresis.
2016-10-21 Wenson Hsieh <wenson_hsieh@apple.com>
Support (insertFrom|deleteBy)Composition and (insert|delete)CompositionText inputTypes for InputEvents
https://bugs.webkit.org/show_bug.cgi?id=163460
<rdar://problem/28784142>
Reviewed by Darin Adler.
Adds basic support for the composition inputTypes in the InputEvent spec. See w3.org/TR/input-events,
github.com/w3c/input-events/issues/41 and github.com/w3c/input-events/issues/42 for more details. While input
events are fired in the correct order with respect to each other, additional work will be required to ensure
that input events are fired in the correct order with respect to composition(start|update|end) events and
textInput events. This is held off until the expected ordering of events is officially defined in the spec.
Tests: fast/events/before-input-events-prevent-insert-composition.html
fast/events/before-input-events-prevent-recomposition.html
fast/events/input-events-ime-composition.html
fast/events/input-events-ime-recomposition.html
* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::apply):
* editing/CompositeEditCommand.h:
(WebCore::CompositeEditCommand::isBeforeInputEventCancelable):
Adds a new virtual method hook for subclasses to mark their `beforeinput` events as non-cancelable (see
TypingCommand::isBeforeInputEventCancelable). By default, `beforeinput` events are cancelable.
* editing/EditAction.h:
Adds 4 new EditActions corresponding to the 4 composition-related inputTypes. These are:
EditActionTypingDeletePendingComposition => "deleteCompositionText"
EditActionTypingDeleteFinalComposition => "deleteByComposition"
EditActionTypingInsertPendingComposition => "insertCompositionText"
EditActionTypingInsertFinalComposition => "insertFromComposition"
* editing/EditCommand.cpp:
(WebCore::inputTypeNameForEditingAction):
* editing/Editor.cpp:
(WebCore::dispatchBeforeInputEvent):
(WebCore::dispatchBeforeInputEvents):
(WebCore::Editor::willApplyEditing):
(WebCore::Editor::insertTextWithoutSendingTextEvent):
(WebCore::Editor::setComposition):
In setComposition(text, mode), tweak the logic for committing a composition to always delete the selection
before inserting the final composition text. In setComposition(text, underlines, start, end), catch the case
where we're beginning to recompose an existing range in the DOM and delete the recomposed text first.
* editing/TypingCommand.cpp:
(WebCore::editActionForTypingCommand):
(WebCore::TypingCommand::TypingCommand):
(WebCore::TypingCommand::deleteSelection):
Adds a TextCompositionType parameter so that call sites (see Editor::setComposition) can indicate what state the
edited composition is in. This allows us to differentiate between deletion of finalized composition text in
preparation of recomposing a range in the DOM, and deletion of composition text that has not yet been committed
in preparation for inserting a finalized composition into the DOM.
(WebCore::TypingCommand::deleteKeyPressed):
(WebCore::TypingCommand::forwardDeleteKeyPressed):
(WebCore::TypingCommand::insertText):
(WebCore::TypingCommand::insertLineBreak):
(WebCore::TypingCommand::insertParagraphSeparatorInQuotedContent):
(WebCore::TypingCommand::insertParagraphSeparator):
(WebCore::TypingCommand::isBeforeInputEventCancelable):
(WebCore::TypingCommand::inputEventData):
(WebCore::TypingCommand::willAddTypingToOpenCommand):
* editing/TypingCommand.h:
2016-10-21 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Make sure shadow user agent sheets parse in UASheetMode
https://bugs.webkit.org/show_bug.cgi?id=163810
Reviewed by Dean Jackson.
* dom/InlineStyleSheetOwner.cpp:
(WebCore::parserContextForElement):
(WebCore::makeInlineStyleSheetCacheKey):
(WebCore::InlineStyleSheetOwner::createSheet):
(WebCore::parserContextForForElement): Deleted.
2016-10-21 Jer Noble <jer.noble@apple.com>
YouTube stalls when seeking beyond buffered range
https://bugs.webkit.org/show_bug.cgi?id=162813
Reviewed by Eric Carlson.
When seeking a MediaPlayerPrivateMediaSourceAVFObjC, we will first seek the AVSampleBufferRenderSynchronizer,
flush and enqueue non-displaying frames, enqueue regular frames, then begin playback. The above stall will occur
when we enqueue so many non- displaying frames that the display layer is not ready for normal ones before
playback begins. Then, when the synchronizer attempts to synchronize the enqueued audio and video renderers, the
only available samples are back at the original media time, and so it "seeks" by updating the CMTimebase back to
the original media time, causing playback to appear "stalled". The overall solution is to "flush" the contents
of the renderers before the seek, so that the synchronizer doesn't reset the currentTime, and to only restart
the synchronizer when there are visible (or audible) samples available for display.
Breaking the fix down into sections:
= Don't enqueue too many non-displaying samples at once:
- Rename SourceBufferPrivate::flushAndEnqueueNonDisplayingSamples() to SourceBufferPrivate::flush(), and no longer
pass in an array of non-displaying samples.
- Add a new virtual method to MediaSample, createNonDisplayingCopy(), used by SourceBuffer to enqueue non-displaying
samples.
- in SourceBuffer::reenqueueMediaForTime(), use that new createNonDisplayingCopy() method to enqueue non-displaying
samples in the same queue as regular samples.
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::provideMediaData):
(WebCore::SourceBuffer::reenqueueMediaForTime):
* platform/MediaSample.h:
(WebCore::MediaSample::isNonDisplaying):
* platform/graphics/SourceBufferPrivate.h:
(WebCore::SourceBufferPrivate::flush):
(WebCore::SourceBufferPrivate::flushAndEnqueueNonDisplayingSamples): Renamed -> flush().
* platform/graphics/avfoundation/MediaSampleAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:
(WebCore::CMSampleBufferIsNonDisplaying):
(WebCore::MediaSampleAVFObjC::flags):
(WebCore::MediaSampleAVFObjC::createNonDisplayingCopy):
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
(WebCore::SourceBufferPrivateAVFObjC::willSeek):
(WebCore::createNonDisplayingCopy): Moved to MediaSampleAVFObjC.
(WebCore::SourceBufferPrivateAVFObjC::flushAndEnqueueNonDisplayingSamples): Renamed -> flush().
* platform/mock/mediasource/MockBox.h:
* platform/mock/mediasource/MockSourceBufferPrivate.cpp:
(WebCore::MockMediaSample::flags):
(WebCore::MockMediaSample::createNonDisplayingCopy):
* platform/mock/mediasource/MockSourceBufferPrivate.h:
= Don't start playing until all renderers have visible/audible samples:
- SourceBufferPrivateAVFObjC will notify its associated MediaPlayerPrivateMediaSourceAVFObjC when
it flushes and receives visible/audible samples.
- The MediaPlayer will store audio renderers as keys to a HashMap which allows it to track which
have available samples.
- This requires changing all the places where we loop over the available renderers.
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
(WebCore::SourceBufferPrivateAVFObjC::enqueueSample):
(WebCore::SourceBufferPrivateAVFObjC::flush):
(WebCore::SourceBufferPrivateAVFObjC::willSeek):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::allRenderersHaveAvailableSamples):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setHasAvailableVideoFrame): Deleted.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVolume):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setMuted):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setHasAvailableVideoFrame):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setHasAvailableAudioSample):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::updateAllRenderersHaveAvailableSamples):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::addAudioRenderer):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::removeAudioRenderer):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setPreservesPitch):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seeking):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::shouldBePlaying):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekInternal):
* platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
(WebCore::MediaSourcePrivateAVFObjC::willSeek):
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
= Don't display new samples mid-seek.
- MediaSource should clear its m_pendingSeekTime ivar, which is used whyn SourceBuffer queries whether or not a
seek is pending, when instructing its SourceBuffers to seekToTime().
- This allows SourceBuffer to decline to enqueue new samples during a MediaSource seek operation.
* Modules/mediasource/MediaSource.cpp:
(WebCore::MediaSource::completeSeek):
2016-10-20 Dean Jackson <dino@apple.com>
SVG should not paint selection within a mask
https://bugs.webkit.org/show_bug.cgi?id=163772
<rdar://problem/28705129>
Reviewed by Simon Fraser.
When masking content, we shouldn't paint the text
selection as we are rendering into the masking
offscreen buffer.
Test: svg/masking/mask-should-not-paint-selection.html
* rendering/PaintPhase.h: Add a new behavior - PaintBehaviorSkipSelectionHighlight.
* rendering/svg/SVGInlineTextBox.cpp:
(WebCore::SVGInlineTextBox::paint): Don't update the selectionStyle if
PaintBehaviorSkipSelectionHighlight is true.
* rendering/svg/SVGRenderingContext.cpp:
(WebCore::SVGRenderingContext::renderSubtreeToImageBuffer): Add PaintBehaviorSkipSelectionHighlight
to the PaintInfo.
2016-10-21 Chris Dumez <cdumez@apple.com>
[Web IDL] MediaControlsHost has invalid operation overloads
https://bugs.webkit.org/show_bug.cgi?id=163793
Reviewed by Darin Adler.
MediaControlsHost has invalid operation overloads:
- sortedTrackListForMenu()
- displayNameForTrack()
The parameter is nullable for both overloads which is not valid IDL.
- sortedTrackListForMenu(): The parameter is no longer nullable. This is a minor
behavior change and it should be safe since this is Apple-specific and only
called from mediaControlsApple.js which uses HTMLMediaElement.videoTracks and
HTMLMediaElement.audioTracks as input, both of which are not nullable.
Note that we could have also kept one of the parameters as nullable to not
change behavior but allowing null does not seem useful here.
- displayNameForTrack(): Use a union instead of overloading, no behavior change.
* Modules/mediacontrols/MediaControlsHost.cpp:
(WebCore::MediaControlsHost::sortedTrackListForMenu):
(WebCore::MediaControlsHost::displayNameForTrack):
* Modules/mediacontrols/MediaControlsHost.h:
* Modules/mediacontrols/MediaControlsHost.idl:
2016-10-21 Jeremy Jones <jeremyj@apple.com>
Implement basic pointer lock behavior for WebKit and WebKit2.
https://bugs.webkit.org/show_bug.cgi?id=162745
Reviewed by Simon Fraser.
When ENABLE_POINTER_LOCK is enabled, these tests now pass with DumpRenderTree.
LayoutTests/pointer-lock/lock-already-locked.html
LayoutTests/pointer-lock/lock-element-not-in-dom.html
LayoutTests/pointer-lock/locked-element-iframe-removed-from-dom.html
LayoutTests/pointer-lock/mouse-event-api.html
Export pointer lock symbols and cancel pointer lock on "escape".
* dom/Document.h: Export symbols.
* dom/Element.h: Export symbols.
* page/EventHandler.cpp:
(WebCore::EventHandler::keyEvent): Cancel pointer lock on "escape".
* page/PointerLockController.cpp: Add missing include.
* page/PointerLockController.h: Export symbols.
2016-10-21 Jer Noble <jer.noble@apple.com>
WebCore::PlatformMediaSession::stopSession + 13
https://bugs.webkit.org/show_bug.cgi?id=163799
Reviewed by Eric Carlson.
Because m_sessions can be mutated by removeSession() while iterating over m_sessions, and because
PlatformMediaSessions are not refcounted, it is not enough to copy m_sessions into a copied Vector
before iterating. Instead, wrap iteration of m_sessions in a convenience function, which sets an
iteration counter which, when cleared, removes all null entries from m_session. In parallel, modify
removeSession() to check this iteration counter, and replace the session with a null value rather
than mutating the m_sessions vector itself.
* platform/audio/PlatformMediaSessionManager.cpp:
(WebCore::PlatformMediaSessionManager::has):
(WebCore::PlatformMediaSessionManager::activeAudioSessionRequired):
(WebCore::PlatformMediaSessionManager::canProduceAudio):
(WebCore::PlatformMediaSessionManager::removeSession):
(WebCore::PlatformMediaSessionManager::sessionWillBeginPlayback):
(WebCore::PlatformMediaSessionManager::sessionWillEndPlayback):
(WebCore::PlatformMediaSessionManager::currentSessionsMatching):
(WebCore::PlatformMediaSessionManager::applicationWillEnterBackground):
(WebCore::PlatformMediaSessionManager::applicationDidEnterForeground):
(WebCore::PlatformMediaSessionManager::systemWillSleep):
(WebCore::PlatformMediaSessionManager::systemDidWake):
(WebCore::PlatformMediaSessionManager::stopAllMediaPlaybackForDocument):
(WebCore::PlatformMediaSessionManager::stopAllMediaPlaybackForProcess):
(WebCore::PlatformMediaSessionManager::forEachSession):
(WebCore::PlatformMediaSessionManager::anyOfSessions):
* platform/audio/PlatformMediaSessionManager.h:
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
https://bugs.webkit.org/show_bug.cgi?id=163797
Reviewed by Zalan Bujtas.
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
2016-10-20 Brent Fulgham <bfulgham@apple.com>
[Win][Direct2D] Correct some memory leaks and other minor bugs
https://bugs.webkit.org/show_bug.cgi?id=163769
Reviewed by Alex Christensen.
Several D2D handles were being leaked.
Direct2D sometimes returns an infinite rect containing { -inf, -inf, FloatMax, FloatMax },
sometimes { -FloatMax, -FloatMax, inf, inf }, and various combinations thereof. This caused
most SVG drawing to decide no screen rect was contained in the "infinite rect" so nothing
would be drawn.
Tested by existing layout tests.
* platform/graphics/GraphicsContext.h:
* platform/graphics/win/FloatRectDirect2D.cpp:
(WebCore::isInfiniteRect): Recognize various infinite rects in Windows.
(WebCore::FloatRect::FloatRect): Convert a Windows infinite rect to the style
we use inside WebKit.
* platform/graphics/win/FontCascadeDirect2D.cpp:
(WebCore::FontCascade::drawGlyphs): Use cached brushes if possible.
* platform/graphics/win/GlyphPageTreeNodeDirect2D.cpp:
(WebCore::GlyphPage::fill): Don't terminate on this error case.
* platform/graphics/win/GradientDirect2D.cpp:
(WebCore::Gradient::generateGradient): Don't leak gradients.
* platform/graphics/win/GraphicsContextDirect2D.cpp:
(WebCore::GraphicsContextPlatformPrivate::brushWithColor): Added.
(WebCore::GraphicsContext::brushWithColor): Added.
(WebCore::GraphicsContextPlatformPrivate::concatCTM): Perform transform multiplication
in the right order (hint: it's not distributive).
(WebCore::GraphicsContext::drawWithShadow): Use convenience method.
(WebCore::GraphicsContext::fillRect): Ditto.
(WebCore::GraphicsContext::platformFillRoundedRect): Ditto.
(WebCore::GraphicsContext::clearRect): Ditto.
(WebCore::GraphicsContext::setPlatformStrokeColor): Ditto.
(WebCore::GraphicsContext::setPlatformFillColor): Ditto.
* platform/graphics/win/PathDirect2D.cpp:
(WebCore::Path::polygonPathFromPoints): No need to convert manually.
(WebCore::Path::~Path): Don't leak ID2D1Geometry entities.
(WebCore::Path::appendGeometry): Ditto.
(WebCore::Path::createGeometryWithFillMode): Ditto.
(WebCore::Path::Path): Ditto.
(WebCore::Path::operator=): Ditto.
(WebCore::Path::strokeBoundingRect): Provide an implementation.
(WebCore::Path::addRect): No need for manual casting here.
2016-10-21 Wenson Hsieh <wenson_hsieh@apple.com>
Fix minor style issue in the signature of StaticRange::create
https://bugs.webkit.org/show_bug.cgi?id=163786
<rdar://problem/28853079>
Reviewed by Alex Christensen.
Change `Ref<WebCore::Node> &&` to `Ref<Node>&&`.
* dom/StaticRange.cpp:
(WebCore::StaticRange::create):
2016-10-21 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Add support for -webkit-line-box-contain
https://bugs.webkit.org/show_bug.cgi?id=163794
Reviewed by Zalan Bujtas.
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeLineBoxContain):
(WebCore::CSSPropertyParser::parseSingleValue):
2016-10-21 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Add support for @-webkit-region rules
https://bugs.webkit.org/show_bug.cgi?id=163787
Reviewed by Zalan Bujtas.
* css/StyleRule.cpp:
(WebCore::StyleRuleRegion::StyleRuleRegion):
* css/StyleRule.h:
* css/parser/CSSAtRuleID.cpp:
(WebCore::cssAtRuleID):
* css/parser/CSSAtRuleID.h:
* css/parser/CSSParserImpl.cpp:
(WebCore::CSSParserImpl::consumeAtRule):
(WebCore::CSSParserImpl::consumePageRule):
(WebCore::CSSParserImpl::consumeRegionRule):
* css/parser/CSSParserImpl.h:
2016-10-21 David Kilzer <ddkilzer@apple.com>
Bug 163757: Use IntSize::unclampedArea() in PDFDocumentImage::updateCachedImageIfNeeded()
<https://webkit.org/b/163757>
Reviewed by Brent Fulgham.
No new tests since there is no change in nominal behavior.
* platform/graphics/cg/PDFDocumentImage.cpp:
(WebCore::PDFDocumentImage::updateCachedImageIfNeeded): Use
IntSize::unclampedArea() where manual calculations were used
previously. Also gets rid of more safeCast<size_t>() use.
2016-10-21 Chris Dumez <cdumez@apple.com>
[Web IDL] Support unions in our overload resolution algorithm
https://bugs.webkit.org/show_bug.cgi?id=163764
Reviewed by Darin Adler.
Support unions in our overload resolution algorithm as per:
- https://heycam.github.io/webidl/#es-overloads
- https://heycam.github.io/webidl/#dfn-distinguishable
* bindings/scripts/CodeGeneratorJS.pm:
(IsIDLTypeDistinguishableWithUnionForOverloadResolution):
(AreTypesDistinguishableForOverloadResolution):
(GetOverloadThatMatches):
(GenerateOverloadedFunctionOrConstructor):
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/TestObj.idl:
2016-10-21 Chris Dumez <cdumez@apple.com>
AudioNode.connect(): First parameter should not be nullable
https://bugs.webkit.org/show_bug.cgi?id=163773
Reviewed by Darin Adler.
AudioNode.connect()'s first parameter should not be nullable:
- https://webaudio.github.io/web-audio-api/#idl-def-AudioNode.
We were throwing a SYNTAX_ERR when passing null, we now throw
a TypeError instead.
No new tests, updated existing test.
* Modules/webaudio/AudioBasicInspectorNode.cpp:
(WebCore::AudioBasicInspectorNode::connect):
* Modules/webaudio/AudioBasicInspectorNode.h:
* Modules/webaudio/AudioNode.cpp:
(WebCore::AudioNode::connect):
* Modules/webaudio/AudioNode.h:
* Modules/webaudio/AudioNode.idl:
2016-10-21 Wenson Hsieh <wenson_hsieh@apple.com>
Implement InputEvent.getTargetRanges() for the input events spec
https://bugs.webkit.org/show_bug.cgi?id=162947
<rdar://problem/28853079>
Reviewed by Darin Adler.
Implements InputEvent.getTargetRanges(). See individual method changes below for more details. Adds a new hook
for subclasses of CompositeEditCommand to vend a list of target StaticRanges when retrieving target ranges for
an editing command on a contenteditable area.
Tests: fast/events/before-input-delete-empty-list-target-ranges.html
fast/events/before-input-delete-text-target-ranges.html
fast/events/before-input-replace-text-target-ranges.html
* CMakeLists.txt:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
Add StaticRange.idl, StaticRange.cpp and StaticRange.h.
* bindings/generic/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setInputEventsEnabled):
(WebCore::RuntimeEnabledFeatures::inputEventsEnabled):
Add a new runtime bindings flag for InputEvents and guard both InputEvent and StaticRange behind it.
* dom/DOMAllInOne.cpp:
* dom/InputEvent.cpp:
(WebCore::InputEvent::InputEvent):
* dom/InputEvent.h:
* dom/InputEvent.idl:
* dom/StaticRange.cpp: Copied from Source/WebCore/dom/InputEvent.cpp.
(WebCore::StaticRange::StaticRange):
(WebCore::StaticRange::create):
(WebCore::StaticRange::createFromRange):
Convenience method for creating a StaticRange from a Range's start/end container and offset.
(WebCore::StaticRange::startContainer):
(WebCore::StaticRange::endContainer):
(WebCore::StaticRange::collapsed):
* dom/StaticRange.h: Copied from Source/WebCore/dom/InputEvent.cpp.
(WebCore::StaticRange::startOffset):
(WebCore::StaticRange::endOffset):
* dom/StaticRange.idl: Copied from Source/WebCore/editing/ReplaceRangeWithTextCommand.h.
* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::willApplyCommand):
(WebCore::CompositeEditCommand::targetRanges):
Virtual method that returns a list of target ranges which are associated with this command.
(WebCore::CompositeEditCommand::targetRangesForBindings):
Non-virtual method that calls the above targetRanges(). Takes whether or not the CompositeEditCommand is editing
a textarea or plain text input into account.
(WebCore::CompositeEditCommand::moveParagraphs):
* editing/CompositeEditCommand.h:
* editing/EditCommand.cpp:
(WebCore::EditCommand::frame):
* editing/EditCommand.h:
(WebCore::EditCommand::document):
* editing/Editor.cpp:
(WebCore::dispatchBeforeInputEvent):
(WebCore::dispatchInputEvent):
(WebCore::dispatchBeforeInputEvents):
Changed the `beforeinput` event dispatch to use the regular Node::dispatchEvent instead of dispatchScopedEvent.
This is because if the page prevents the `beforeinput` event, we need to know immediately in order to bail from
the default action.
(WebCore::dispatchInputEvents):
(WebCore::Editor::willApplyEditing):
Added a list of static ranges as a parameter when calling on the Editor to dispatch `beforeinput` events.
By default, this uses the composite edit command's targetRangesForBindings(), though it may be special cased
by subclasses of CompositeEditCommand (see ReplaceRangeWithTextCommand, SpellingCorrectionCommand, and
TypingCommand).
* editing/Editor.h:
* editing/ReplaceRangeWithTextCommand.cpp:
(WebCore::ReplaceRangeWithTextCommand::targetRanges):
* editing/ReplaceRangeWithTextCommand.h:
* editing/SpellingCorrectionCommand.cpp:
(WebCore::SpellingCorrectionCommand::targetRanges):
* editing/SpellingCorrectionCommand.h:
* editing/TypingCommand.cpp:
(WebCore::editActionIsDeleteByTyping):
(WebCore::TypingCommand::shouldDeferWillApplyCommandUntilAddingTypingCommand):
(WebCore::TypingCommand::willApplyCommand):
(WebCore::TypingCommand::willAddTypingToOpenCommand):
(WebCore::TypingCommand::deleteKeyPressed):
(WebCore::TypingCommand::forwardDeleteKeyPressed):
Moves the firing of the `beforeinput` until after the selection range to delete has been computed.
* editing/TypingCommand.h:
2016-10-21 Antti Koivisto <antti@apple.com>
Style resolver should be updated lazily
https://bugs.webkit.org/show_bug.cgi?id=163721
Reviewed by Andreas Kling.
Currently when stylesheets change in some way we generally update style resolvers and
invalidate style immediately. We should do this lazily to avoid unnecessary work.
Also improve naming of the stylesheet invalidation functions and use more optimal functions in some places.
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::updateStyleIfNeededForNode):
* css/CSSStyleSheet.cpp:
(WebCore::CSSStyleSheet::didMutateRules):
(WebCore::CSSStyleSheet::didMutate):
(WebCore::CSSStyleSheet::setDisabled):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::StyleResolver):
Initialize root style font with null font selector.
This avoids hitting a CSSFontSelector assert in fast/media/mq-relative-constraints-08.html where
media query evaluation requires font information before it is ready.
Exposed by increased laziness in this patch.
* dom/Document.cpp:
(WebCore::Document::setContentLanguage):
(WebCore::Document::updateLayoutIgnorePendingStylesheets):
(WebCore::Document::isPageBoxVisible):
(WebCore::Document::pageSizeAndMarginsInPixels):
(WebCore::Document::processHttpEquiv):
(WebCore::Document::setSelectedStylesheetSet):
(WebCore::Document::didInsertInDocumentShadowRoot):
(WebCore::Document::didRemoveInDocumentShadowRoot):
* dom/Document.h:
(WebCore::Document::inDocumentShadowRoots):
Track all shadow roots in the document. This allows us to find and flush style scopes cheaply.
* dom/Element.cpp:
(WebCore::Element::computedStyle):
* dom/ExtensionStyleSheets.cpp:
(WebCore::ExtensionStyleSheets::ExtensionStyleSheets):
(WebCore::ExtensionStyleSheets::clearPageUserSheet):
(WebCore::ExtensionStyleSheets::updatePageUserSheet):
(WebCore::ExtensionStyleSheets::invalidateInjectedStyleSheetCache):
(WebCore::ExtensionStyleSheets::addUserStyleSheet):
(WebCore::ExtensionStyleSheets::addAuthorStyleSheetForTesting):
(WebCore::ExtensionStyleSheets::addDisplayNoneSelector):
(WebCore::ExtensionStyleSheets::maybeAddContentExtensionSheet):
(WebCore::ExtensionStyleSheets::styleResolverChangedTimerFired): Deleted.
Since updates are now done lazily we don't need a special timer for extension stylesheets.
* dom/ExtensionStyleSheets.h:
* dom/ProcessingInstruction.cpp:
(WebCore::ProcessingInstruction::checkStyleSheet):
(WebCore::ProcessingInstruction::sheetLoaded):
(WebCore::ProcessingInstruction::removedFrom):
* dom/ShadowRoot.cpp:
(WebCore::ShadowRoot::ShadowRoot):
(WebCore::ShadowRoot::insertedInto):
(WebCore::ShadowRoot::removedFrom):
(WebCore::ShadowRoot::styleScope):
* dom/ShadowRoot.h:
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::setDisabledState):
(WebCore::HTMLLinkElement::parseAttribute):
(WebCore::HTMLLinkElement::process):
(WebCore::HTMLLinkElement::removePendingSheet):
* html/HTMLStyleElement.cpp:
(WebCore::HTMLStyleElement::parseAttribute):
* inspector/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::createInspectorStyleSheetForDocument):
(WebCore::InspectorCSSAgent::forcePseudoState):
(WebCore::InspectorCSSAgent::resetPseudoStates):
* inspector/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::setEmulatedMedia):
* page/Frame.cpp:
(WebCore::Frame::setPrinting):
* page/FrameView.cpp:
(WebCore::FrameView::layout):
(WebCore::FrameView::setPagination):
(WebCore::FrameView::setViewportSizeForCSSViewportUnits):
* page/Page.cpp:
(WebCore::Page::setViewMode):
(WebCore::Page::setNeedsRecalcStyleInAllFrames):
(WebCore::Page::invalidateInjectedStyleSheetCacheInAllFrames):
* style/StyleScope.cpp:
(WebCore::Style::Scope::setPreferredStylesheetSetName):
(WebCore::Style::Scope::setSelectedStylesheetSetName):
(WebCore::Style::Scope::removePendingSheet):
(WebCore::Style::Scope::removeStyleSheetCandidateNode):
(WebCore::Style::Scope::activeStyleSheetsForInspector):
(WebCore::Style::Scope::flushPendingUpdate):
Also flush descendant shadow roots.
(WebCore::Style::Scope::scheduleUpdate):
(WebCore::Style::Scope::didChangeActiveStyleSheetCandidates):
Make lazy.
(WebCore::Style::Scope::didChangeStyleSheetContents):
Make lazy.
(WebCore::Style::Scope::didChangeStyleSheetEnvironment):
Environment changes also affect author shadow roots.
(WebCore::Style::Scope::styleSheetsForStyleSheetList):
(WebCore::Style::Scope::scheduleActiveSetUpdate): Deleted.
(WebCore::Style::Scope::didChangeCandidatesForActiveSet): Deleted.
(WebCore::Style::Scope::didChangeContentsOrInterpretation): Deleted.
Improved naming of these and split didChangeContentsOrInterpretation into two separate functions.
* style/StyleScope.h:
(WebCore::Style::Scope::styleSheetsForStyleSheetList): Deleted.
(WebCore::Style::Scope::setPreferredStylesheetSetName): Deleted.
(WebCore::Style::Scope::setSelectedStylesheetSetName): Deleted.
* svg/SVGFontFaceElement.cpp:
(WebCore::SVGFontFaceElement::rebuildFontFace):
(WebCore::SVGFontFaceElement::removedFrom):
* testing/Internals.cpp:
(WebCore::Internals::resetToConsistentState):
Ensure that cationsStyleSheetOverride really becomes empty. Some tests rely on not having suprise
inserted stylesheets. Previously this was racy and the patch affected order of things.
(WebCore::Internals::styleChangeType):
* xml/XMLTreeViewer.cpp:
(WebCore::XMLTreeViewer::transformDocumentToTreeView):
* xml/parser/XMLDocumentParser.cpp:
(WebCore::XMLDocumentParser::end):
* xml/parser/XMLDocumentParserLibxml2.cpp:
(WebCore::XMLDocumentParser::doEnd):
2016-10-21 Xabier Rodriguez Calvar <calvaris@igalia.com> and Adam Bergkvist <adam.bergkvist@ericsson.com>
WebRTC: [OpenWebRTC] Move SDPProcessorScriptResource(Gtk) to openwebrtc directory
https://bugs.webkit.org/show_bug.cgi?id=163778
Reviewed by Philippe Normand.
Move SDPProcessorScriptResourceGtk from the platform gtk directory to the port generic
openwebrtc directory to make it usable by other ports. Also drop the Gtk-suffix.
No change of behavior.
* PlatformGTK.cmake:
* platform/mediastream/gtk/SDPProcessorScriptResourceGtk.cpp:
(WebCore::SDPProcessorScriptResource::scriptString): Deleted.
* platform/mediastream/openwebrtc/SDPProcessorScriptResource.cpp: Renamed from Source/WebCore/platform/mediastream/gtk/SDPProcessorScriptResourceGtk.cpp.
(WebCore::SDPProcessorScriptResource::scriptString):
2016-10-21 Miguel Gomez <magomez@igalia.com>
[GTK] Several tests crashing on debug bot in (anonymous namespace)::MediaPlayerPrivateGStreamerBase::repaint
https://bugs.webkit.org/show_bug.cgi?id=163511
Reviewed by Carlos Garcia Campos.
Perform the video repaint in the main thread when accelerated compositing is disabled. Added a new method to
MediaPlayerClient to get whether accelerated compositing is enabled from the MediaPlayer. This is needed
because mediaPlayerAcceleratedCompositingEnabled() will return false while HTMLMediaElement doesn't have a
RenderVideo, even when accelerated compositing is enabled.
Covered by existent tests.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaPlayerAcceleratedCompositingEnabled):
* html/HTMLMediaElement.h:
* platform/graphics/MediaPlayer.h:
(WebCore::MediaPlayerClient::mediaPlayerAcceleratedCompositingEnabled):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase):
(WebCore::MediaPlayerPrivateGStreamerBase::repaint):
(WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
2016-10-21 Adam Bergkvist <adam.bergkvist@ericsson.com>
WebRTC: [GTK] Add MediaEndpointOwr - an OpenWebRTC WebRTC backend
https://bugs.webkit.org/show_bug.cgi?id=163327
Reviewed by Philippe Normand.
Add MediaEndpointOwr which is a MediaEndpoint implementation (WebRTC backend) based on
OpenWebRTC [1]. The WebRTC backend can be tested with a manual test. Automatic testing
is still done with MockMediaEndpoint.
[1] http://www.openwebrtc.org/
Testing: Added manual test (webrtc-one-tab-p2p.html)
* CMakeLists.txt:
* platform/GStreamer.cmake:
* platform/mediastream/openwebrtc/MediaEndpointOwr.cpp: Added.
(WebCore::createMediaEndpointOwr):
(WebCore::MediaEndpointOwr::MediaEndpointOwr):
(WebCore::MediaEndpointOwr::~MediaEndpointOwr):
(WebCore::MediaEndpointOwr::setConfiguration):
(WebCore::cryptoDataCallback):
(WebCore::MediaEndpointOwr::generateDtlsInfo):
(WebCore::MediaEndpointOwr::getDefaultAudioPayloads):
(WebCore::MediaEndpointOwr::getDefaultVideoPayloads):
(WebCore::payloadsContainType):
(WebCore::MediaEndpointOwr::filterPayloads):
(WebCore::MediaEndpointOwr::updateReceiveConfiguration):
(WebCore::findRtxPayload):
(WebCore::MediaEndpointOwr::updateSendConfiguration):
(WebCore::MediaEndpointOwr::addRemoteCandidate):
(WebCore::MediaEndpointOwr::replaceMutedRemoteSourceMid):
(WebCore::MediaEndpointOwr::createMutedRemoteSource):
(WebCore::MediaEndpointOwr::replaceSendSource):
(WebCore::MediaEndpointOwr::stop):
(WebCore::MediaEndpointOwr::transceiverIndexForSession):
(WebCore::MediaEndpointOwr::sessionMid):
(WebCore::MediaEndpointOwr::matchTransceiverByMid):
(WebCore::MediaEndpointOwr::dispatchNewIceCandidate):
(WebCore::MediaEndpointOwr::dispatchGatheringDone):
(WebCore::MediaEndpointOwr::processIceTransportStateChange):
(WebCore::MediaEndpointOwr::dispatchDtlsFingerprint):
(WebCore::MediaEndpointOwr::unmuteRemoteSource):
(WebCore::MediaEndpointOwr::prepareSession):
(WebCore::MediaEndpointOwr::prepareMediaSession):
(WebCore::parseHelperServerUrl):
(WebCore::MediaEndpointOwr::ensureTransportAgentAndTransceivers):
(WebCore::MediaEndpointOwr::internalAddRemoteCandidate):
(WebCore::gotCandidate):
(WebCore::candidateGatheringDone):
(WebCore::iceConnectionStateChange):
(WebCore::gotIncomingSource):
* platform/mediastream/openwebrtc/MediaEndpointOwr.h: Added.
(WebCore::OwrTransceiver::create):
(WebCore::OwrTransceiver::~OwrTransceiver):
(WebCore::OwrTransceiver::mid):
(WebCore::OwrTransceiver::session):
(WebCore::OwrTransceiver::owrIceState):
(WebCore::OwrTransceiver::setOwrIceState):
(WebCore::OwrTransceiver::gotEndOfRemoteCandidates):
(WebCore::OwrTransceiver::markGotEndOfRemoteCandidates):
(WebCore::OwrTransceiver::OwrTransceiver):
* platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.h:
(WebCore::RealtimeMediaSourceOwr::RealtimeMediaSourceOwr):
(WebCore::RealtimeMediaSourceOwr::swapOutShallowSource):
Add support for an initially muted source. This is used for early
creation of remote sources.
2016-10-21 Javier Fernandez <jfernandez@igalia.com>
[css-grid] Content Alignment broken with indefinite sized grid container
https://bugs.webkit.org/show_bug.cgi?id=163724
Reviewed by Manuel Rego Casasnovas.
The Grid Tracks sizing algorithm receives as parameter the
available space to be used as space for tracks. We hold a variable
to store the remaining free space for each dimension.
When the grid container size is indefinite we can't compute the
available free space after computing track sizes until such
indefinite size is resolved.
No new tests, just added some additional test cases.
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::layoutBlock): Compute freeSpace for Rows
after doing layout and resolving the indefinite height.
2016-10-21 Jer Noble <jer.noble@apple.com>
CRASH in SourceBuffer::sourceBufferPrivateDidReceiveSample + 2169
https://bugs.webkit.org/show_bug.cgi?id=163735
Reviewed by Eric Carlson.
Test: media/media-source/media-source-sample-wrong-track-id.html
When SourceBuffer receives a sample in sourceBufferPrivateDidReceiveSample() containing
a trackID not previously seen in an initialization segment, it creates a default TrackBuffer
object to contain that track's samples. One of the fields in TrackBuffer, description, is
normally filled out when an initialization segment is received, but with this default
TrackBuffer, it's still null when it's checked later in sourceBufferPrivateDidReceiveSample().
Rather than adding a null-check on trackBuffer.description, drop any sample that has a
trackID which was not present during a previous initialization segment.
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
2016-10-20 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Configures but fails to link with ENABLE_OPENGL=OFF
https://bugs.webkit.org/show_bug.cgi?id=163449
Reviewed by Michael Catanzaro.
Only define sharingGLContext in PlatformDisplay if EGL or GLX are enabled.
* platform/graphics/PlatformDisplay.cpp:
* platform/graphics/PlatformDisplay.h:
* platform/graphics/wayland/PlatformDisplayWayland.cpp:
(WebCore::PlatformDisplayWayland::initialize):
* platform/graphics/x11/PlatformDisplayX11.cpp:
(WebCore::PlatformDisplayX11::~PlatformDisplayX11):
2016-10-20 Filip Pizlo <fpizlo@apple.com>
The tracking of the coarse-grain Heap state (allocating or not, collector or not, eden vs full) should respect the orthogonality between allocating and collecting
https://bugs.webkit.org/show_bug.cgi?id=163738
Reviewed by Geoffrey Garen.
No new tests because no change in behavior.
* bindings/js/GCController.cpp:
(WebCore::GCController::garbageCollectNow):
2016-10-20 Chris Dumez <cdumez@apple.com>
[Bindings] Start using signature->idlType instead of signature->type in the overload resolution code
https://bugs.webkit.org/show_bug.cgi?id=163767
Reviewed by Darin Adler.
Start using signature->idlType instead of signature->type in the overload resolution code
to prepare for union type support.
* bindings/scripts/CodeGeneratorJS.pm:
(ComputeEffectiveOverloadSet):
(AreTypesDistinguishableForOverloadResolution):
(GetDistinguishingArgumentIndex):
(GetOverloadThatMatches):
(GenerateOverloadedFunctionOrConstructor):
2016-10-20 Myles C. Maxfield <mmaxfield@apple.com>
Implement WebGL2 bufferData() and bufferSubData() methods
https://bugs.webkit.org/show_bug.cgi?id=163759
Reviewed by Dean Jackson.
These new overloads simply clip the input array buffer.
Test: fast/canvas/webgl/bufferData-offset-length.html
* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::bufferData):
(WebCore::WebGL2RenderingContext::bufferSubData):
* html/canvas/WebGL2RenderingContext.h:
* html/canvas/WebGL2RenderingContext.idl:
2016-10-20 Chris Dumez <cdumez@apple.com>
"Download Linked File" context menu action should use 'download' attribute as suggested filename
https://bugs.webkit.org/show_bug.cgi?id=163742
<rdar://problem/28840734>
Reviewed by Darin Adler.
Add convenience method to HitTestResult to return the URL element's
download attribute.
* rendering/HitTestResult.cpp:
(WebCore::HitTestResult::URLElementDownloadAttribute):
* rendering/HitTestResult.h:
2016-10-20 Nan Wang <n_wang@apple.com>
AX: VoiceOver is not detecting ARIA treeview if it contains role="presentation"
https://bugs.webkit.org/show_bug.cgi?id=163763
Reviewed by Chris Fleizach.
Test: accessibility/mac/aria-tree-with-presentation-role.html
Web authors sometimes use presentation role in the aria tree to hide elements. We should
consider this a valid case if they specify tree items and groups correctly.
* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::hierarchicalLevel):
* accessibility/AccessibilityTree.cpp:
(WebCore::AccessibilityTree::nodeHasTreeItemChild):
(WebCore::AccessibilityTree::isTreeValid):
* accessibility/AccessibilityTree.h:
2016-10-20 Myles C. Maxfield <mmaxfield@apple.com>
Many WebGL functions which don't throw are marked as possibly throwing
https://bugs.webkit.org/show_bug.cgi?id=163747
Reviewed by Dean Jackson.
Mechanically remove the exception code.
No new tests because there is no behavior change.
* bindings/js/JSWebGLRenderingContextBaseCustom.cpp:
(WebCore::getObjectParameter):
(WebCore::JSWebGLRenderingContextBase::getAttachedShaders):
(WebCore::JSWebGLRenderingContextBase::getProgramParameter):
(WebCore::JSWebGLRenderingContextBase::getShaderParameter):
(WebCore::JSWebGLRenderingContextBase::getUniform):
(WebCore::dataFunctionf):
(WebCore::dataFunctioni):
(WebCore::dataFunctionMatrix):
* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::texSubImage2D):
* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::texSubImage2D):
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::activeTexture):
(WebCore::WebGLRenderingContextBase::attachShader):
(WebCore::WebGLRenderingContextBase::bindAttribLocation):
(WebCore::WebGLRenderingContextBase::bindBuffer):
(WebCore::WebGLRenderingContextBase::bindFramebuffer):
(WebCore::WebGLRenderingContextBase::bindRenderbuffer):
(WebCore::WebGLRenderingContextBase::bindTexture):
(WebCore::WebGLRenderingContextBase::bufferData):
(WebCore::WebGLRenderingContextBase::bufferSubData):
(WebCore::WebGLRenderingContextBase::compileShader):
(WebCore::WebGLRenderingContextBase::createShader):
(WebCore::WebGLRenderingContextBase::detachShader):
(WebCore::WebGLRenderingContextBase::disableVertexAttribArray):
(WebCore::WebGLRenderingContextBase::drawArrays):
(WebCore::WebGLRenderingContextBase::drawElements):
(WebCore::WebGLRenderingContextBase::enableVertexAttribArray):
(WebCore::WebGLRenderingContextBase::framebufferRenderbuffer):
(WebCore::WebGLRenderingContextBase::framebufferTexture2D):
(WebCore::WebGLRenderingContextBase::getActiveAttrib):
(WebCore::WebGLRenderingContextBase::getActiveUniform):
(WebCore::WebGLRenderingContextBase::getAttachedShaders):
(WebCore::WebGLRenderingContextBase::getBufferParameter):
(WebCore::WebGLRenderingContextBase::getProgramParameter):
(WebCore::WebGLRenderingContextBase::getProgramInfoLog):
(WebCore::WebGLRenderingContextBase::getRenderbufferParameter):
(WebCore::WebGLRenderingContextBase::getShaderParameter):
(WebCore::WebGLRenderingContextBase::getShaderInfoLog):
(WebCore::WebGLRenderingContextBase::getShaderPrecisionFormat):
(WebCore::WebGLRenderingContextBase::getShaderSource):
(WebCore::WebGLRenderingContextBase::getTexParameter):
(WebCore::WebGLRenderingContextBase::getUniform):
(WebCore::WebGLRenderingContextBase::getUniformLocation):
(WebCore::WebGLRenderingContextBase::getVertexAttrib):
(WebCore::WebGLRenderingContextBase::linkProgram):
(WebCore::WebGLRenderingContextBase::readPixels):
(WebCore::WebGLRenderingContextBase::shaderSource):
(WebCore::WebGLRenderingContextBase::videoFrameToImage):
(WebCore::WebGLRenderingContextBase::texImage2D):
(WebCore::WebGLRenderingContextBase::uniform1f):
(WebCore::WebGLRenderingContextBase::uniform1fv):
(WebCore::WebGLRenderingContextBase::uniform1i):
(WebCore::WebGLRenderingContextBase::uniform1iv):
(WebCore::WebGLRenderingContextBase::uniform2f):
(WebCore::WebGLRenderingContextBase::uniform2fv):
(WebCore::WebGLRenderingContextBase::uniform2i):
(WebCore::WebGLRenderingContextBase::uniform2iv):
(WebCore::WebGLRenderingContextBase::uniform3f):
(WebCore::WebGLRenderingContextBase::uniform3fv):
(WebCore::WebGLRenderingContextBase::uniform3i):
(WebCore::WebGLRenderingContextBase::uniform3iv):
(WebCore::WebGLRenderingContextBase::uniform4f):
(WebCore::WebGLRenderingContextBase::uniform4fv):
(WebCore::WebGLRenderingContextBase::uniform4i):
(WebCore::WebGLRenderingContextBase::uniform4iv):
(WebCore::WebGLRenderingContextBase::uniformMatrix2fv):
(WebCore::WebGLRenderingContextBase::uniformMatrix3fv):
(WebCore::WebGLRenderingContextBase::uniformMatrix4fv):
(WebCore::WebGLRenderingContextBase::useProgram):
(WebCore::WebGLRenderingContextBase::validateProgram):
(WebCore::WebGLRenderingContextBase::vertexAttribPointer):
(WebCore::WebGLRenderingContextBase::restoreCurrentFramebuffer):
(WebCore::WebGLRenderingContextBase::restoreCurrentTexture2D):
* html/canvas/WebGLRenderingContextBase.h:
* html/canvas/WebGLRenderingContextBase.idl:
2016-10-19 Myles C. Maxfield <mmaxfield@apple.com>
[macOS] [iOS] Disable variation fonts on macOS El Capitan and iOS 9
https://bugs.webkit.org/show_bug.cgi?id=163374
Reviewed by Darin Adler.
Because of platform lack of support for variations in in-memory fonts,
this feature should be disabled on the affected OSes.
No tests because there is no behavior change (on the relevant platforms).
* Configurations/FeatureDefines.xcconfig:
2016-10-20 Brady Eidson <beidson@apple.com>
IndexedDB 2.0: Support IDBObjectStore name assignment.
<rdar://problem/28806931> and https://bugs.webkit.org/show_bug.cgi?id=163749
Reviewed by Alex Christensen.
Tests: storage/indexeddb/modern/objectstore-rename-1-private.html
storage/indexeddb/modern/objectstore-rename-1.html
Touches a *lot* of code sites, but none of them are particularly interesting.
They are all just getting the new name spread out to all of the various objects that need it.
* Modules/indexeddb/IDBDatabase.cpp:
(WebCore::IDBDatabase::renameObjectStore):
* Modules/indexeddb/IDBDatabase.h:
* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::setName):
* Modules/indexeddb/IDBObjectStore.h:
* Modules/indexeddb/IDBObjectStore.idl:
* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::renameObjectStore):
(WebCore::IDBTransaction::renameObjectStoreOnServer):
(WebCore::IDBTransaction::didRenameObjectStoreOnServer):
* Modules/indexeddb/IDBTransaction.h:
* Modules/indexeddb/client/IDBConnectionProxy.cpp:
(WebCore::IDBClient::IDBConnectionProxy::renameObjectStore):
* Modules/indexeddb/client/IDBConnectionProxy.h:
* Modules/indexeddb/client/IDBConnectionToServer.cpp:
(WebCore::IDBClient::IDBConnectionToServer::renameObjectStore):
(WebCore::IDBClient::IDBConnectionToServer::didRenameObjectStore):
* Modules/indexeddb/client/IDBConnectionToServer.h:
* Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
* Modules/indexeddb/server/IDBBackingStore.h:
* Modules/indexeddb/server/IDBConnectionToClient.cpp:
(WebCore::IDBServer::IDBConnectionToClient::didDeleteObjectStore):
(WebCore::IDBServer::IDBConnectionToClient::didRenameObjectStore):
* Modules/indexeddb/server/IDBConnectionToClient.h:
* Modules/indexeddb/server/IDBConnectionToClientDelegate.h:
* Modules/indexeddb/server/IDBServer.cpp:
(WebCore::IDBServer::IDBServer::renameObjectStore):
* Modules/indexeddb/server/IDBServer.h:
* Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
(WebCore::IDBServer::MemoryBackingStoreTransaction::objectStoreRenamed):
(WebCore::IDBServer::MemoryBackingStoreTransaction::abort):
* Modules/indexeddb/server/MemoryBackingStoreTransaction.h:
* Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
(WebCore::IDBServer::MemoryIDBBackingStore::renameObjectStore):
* Modules/indexeddb/server/MemoryIDBBackingStore.h:
* Modules/indexeddb/server/MemoryObjectStore.h:
(WebCore::IDBServer::MemoryObjectStore::rename):
* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::renameObjectStore):
* Modules/indexeddb/server/SQLiteIDBBackingStore.h:
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::renameObjectStore):
(WebCore::IDBServer::UniqueIDBDatabase::performRenameObjectStore):
(WebCore::IDBServer::UniqueIDBDatabase::didPerformRenameObjectStore):
* Modules/indexeddb/server/UniqueIDBDatabase.h:
* Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
(WebCore::IDBServer::UniqueIDBDatabaseConnection::didRenameObjectStore):
* Modules/indexeddb/server/UniqueIDBDatabaseConnection.h:
* Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::renameObjectStore):
* Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:
* Modules/indexeddb/shared/IDBDatabaseInfo.cpp:
(WebCore::IDBDatabaseInfo::renameObjectStore):
* Modules/indexeddb/shared/IDBDatabaseInfo.h:
* Modules/indexeddb/shared/IDBObjectStoreInfo.h:
(WebCore::IDBObjectStoreInfo::rename):
* Modules/indexeddb/shared/IDBResultData.cpp:
(WebCore::IDBResultData::renameObjectStoreSuccess):
* Modules/indexeddb/shared/IDBResultData.h:
* Modules/indexeddb/shared/InProcessIDBServer.cpp:
(WebCore::InProcessIDBServer::didRenameObjectStore):
(WebCore::InProcessIDBServer::renameObjectStore):
* Modules/indexeddb/shared/InProcessIDBServer.h:
2016-10-20 Chris Dumez <cdumez@apple.com>
Make table.deleteRow(-1) a no-op when there are no rows
https://bugs.webkit.org/show_bug.cgi?id=163746
Reviewed by Alex Christensen.
Make table.deleteRow(-1) a no-op when there are no rows, instead of throwing:
- https://github.com/whatwg/html/pull/1924
This is more consistent with the behavior of tbody.deleteRow(-1) and
tr.deleteCell(-1). This is also consistent with Gecko. Blink is doing the
same change via:
- https://codereview.chromium.org/2427963004/
No new tests, updated existing tests.
* html/HTMLTableElement.cpp:
(WebCore::HTMLTableElement::deleteRow):
2016-10-20 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Make sure to handle prefixed transform-style
https://bugs.webkit.org/show_bug.cgi?id=163756
Reviewed by Dean Jackson.
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
2016-10-20 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Fix crash when parsing -webkit-margin-collapse
https://bugs.webkit.org/show_bug.cgi?id=163753
Reviewed by Dean Jackson.
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseShorthand):
2016-10-20 Chris Dumez <cdumez@apple.com>
Passing a number as the pixel parameter to texImage2D() doesn't thrown an exception
https://bugs.webkit.org/show_bug.cgi?id=163715
Reviewed by Darin Adler.
Enable strict type checking for typed arrays in the bindings, similarly
do what we do for other wrapper types, as per Web IDL.
No new tests, updated existing tests.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
(GenerateParametersCheck):
2016-10-20 Myles C. Maxfield <mmaxfield@apple.com>
Improve error message when passing a null ArrayBuffer to bufferData()
https://bugs.webkit.org/show_bug.cgi?id=163745
Reviewed by Dean Jackson.
Test: fast/canvas/webgl/bufferData-nullable-array-buffer-view.html
Update the idl file to accept a nullable ArrayBuffer, and throw
the relevant error with a more helpful error string.
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::bufferData):
* html/canvas/WebGLRenderingContextBase.h:
* html/canvas/WebGLRenderingContextBase.idl:
2016-10-20 Zalan Bujtas <zalan@apple.com>
Stop searching for first-letter containers at multi-column boundary.
https://bugs.webkit.org/show_bug.cgi?id=163739
<rdar://problem/28810750>
We should not cross the multi-column boundary while searching for the first-letter container.
While moving first-letter renderers to a multi-column parent, it could result in finding the wrong
container and end up adding a new wrapper under the original container (from where we are moving the renderers).
Reviewed by David Hyatt.
Test: fast/css-generated-content/first-letter-move-to-multicolumn-crash.html
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::moveChildrenTo):
* rendering/RenderTextFragment.cpp:
(WebCore::RenderTextFragment::blockForAccompanyingFirstLetter):
2016-10-19 Dean Jackson <dino@apple.com>
Support CSS Shapes Level 1 without a prefix
https://bugs.webkit.org/show_bug.cgi?id=163709
<rdar://problem/28859369>
Reviewed by Myles Maxfield.
Support the unprefixed form of CSS Shapes, now that
it is in CR.
We have a few failing tests:
- Some image-based shaping failures, now skipped.
https://bugs.webkit.org/show_bug.cgi?id=163706
- Some false negatives, where my understanding
of the CSS OM seems to suggest that the W3C tests
are incorrect.
https://bugs.webkit.org/show_bug.cgi?id=163708
Tests: imported/w3c/csswg-test/css-shapes-1
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::propertyValue):
* css/CSSPropertyNames.in:
* css/CSSValueKeywords.in:
* css/parser/CSSParser.cpp:
(WebCore::isSimpleLengthPropertyID):
(WebCore::CSSParser::parseValue):
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseSingleValue):
* page/animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
2016-10-20 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Fix region, column and page break parsing
https://bugs.webkit.org/show_bug.cgi?id=163743
Reviewed by Simon Fraser.
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
Add the missing values for break support.
* css/parser/CSSPropertyParser.cpp:
(WebCore::isLegacyBreakProperty):
(WebCore::CSSPropertyParser::parseValueStart):
Add a special case for handling legacy break properties. Blink treats them like
shorthands, but we can't do that without breaking the old parser, so for now
we add a special case.
(WebCore::mapFromPageBreakBetween):
(WebCore::mapFromColumnBreakBetween):
(WebCore::mapFromRegionBreakBetween):
Updated to have the AvoidXXX values (where XXX is Column/Page/Region).
(WebCore::CSSPropertyParser::parseShorthand):
Remove the consumeLegacyBreak from the shorthand function, since we can't treat
the legacy break properties as shorthands yet.
2016-10-20 Sam Weinig <sam@webkit.org>
Add convenience function that combines WTF::visit(...) with WTF::makeVisitor(...)
https://bugs.webkit.org/show_bug.cgi?id=163713
Reviewed by Dan Bernstein.
Switch uses of WTF::visit to use WTF::switchOn.
* dom/MessageEvent.cpp:
(WebCore::MessageEvent::source):
* dom/Node.cpp:
(WebCore::nodeSetPreTransformedFromNodeOrStringVector):
(WebCore::Node::convertNodesOrStringsIntoNode):
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::add):
* html/track/TrackEvent.cpp:
(WebCore::TrackEvent::TrackEvent):
* testing/TypeConversions.h:
(WebCore::TypeConversions::typeConversionsDictionaryUnionType):
2016-10-20 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Fix font family parsing and add CSS region property parsing
https://bugs.webkit.org/show_bug.cgi?id=163741
Reviewed by Zalan Bujtas.
* css/parser/CSSParser.cpp:
(WebCore::isKeywordPropertyID):
(WebCore::parseKeywordValue):
(WebCore::CSSParser::parseValue):
Modify the old CSSParser to have its own keyword check, since keywords were
incorrectly added to the new parser when this check was consolidated. Column
and region breaks are considered keyword properties by the old parser, but
not by the new parser, since the new parser special cases them and maps them
into the generic break property.
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
(WebCore::CSSParserFastPaths::isKeywordPropertyID):
Update for regions to make sure all the region properties are there. Remove the
column and region break properties, since they're not supposed to be here in the
new parser.
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeFamilyName):
Fix font parsing to make font family values so that fonts work.
(WebCore::consumeFlowProperty):
Add a function for handling -webkit-flow-from and -webkit-flow-into.
(WebCore::CSSPropertyParser::parseSingleValue):
Add support for the region properties.
(WebCore::mapFromRegionBreakBetween):
(WebCore::mapFromColumnRegionOrPageBreakInside):
(WebCore::mapFromLegacyBreakProperty):
(WebCore::CSSPropertyParser::consumeLegacyBreakProperty):
(WebCore::mapFromColumnOrPageBreakInside): Deleted.
Update to handle the region break properties in the same way that column break
properties are handled.
2016-10-20 Jer Noble <jer.noble@apple.com>
CRASH in WebCore::MediaSource::seekToTime + 185
https://bugs.webkit.org/show_bug.cgi?id=163652
Reviewed by Eric Carlson.
Test: media/media-source/media-source-seek-detach-crash.html
Add isClosed() checks (which are effectively m_private null-checks) everywhere m_private is
dereferenced. The one place where m_private is cleared without setting the state to closed
is stop(), so make stop() set the state to closed as well (without firing any events).
* Modules/mediasource/MediaSource.cpp:
(WebCore::MediaSource::seekToTime):
(WebCore::MediaSource::completeSeek):
(WebCore::MediaSource::monitorSourceBuffers):
(WebCore::MediaSource::streamEndedWithError):
(WebCore::MediaSource::stop):
2016-10-20 Andreas Kling <akling@apple.com>
Drop StyleResolver and SelectorQueryCache when entering PageCache.
<https://webkit.org/b/154238>
Reviewed by Antti Koivisto.
Stop keeping these around for cached pages to save lots of memory.
We can easily rebuild them if a cached navigation occurs, and this
way we also don't need to worry about invalidating style for cached
pages in all the right places.
Restoring a cached page will now lead to a forced style recalc.
We don't try to defer this (beyond a zero-timer) since it's going
to happen anyway, and it's nicer to front-load the cost rather than
stuttering on the first user content interaction.
* dom/Document.cpp:
(WebCore::Document::setPageCacheState):
* history/CachedPage.cpp:
(WebCore::CachedPage::restore):
(WebCore::CachedPage::clear):
* history/CachedPage.h:
(WebCore::CachedPage::markForVisitedLinkStyleRecalc): Deleted.
(WebCore::CachedPage::markForFullStyleRecalc): Deleted.
* history/PageCache.cpp:
(WebCore::PageCache::markPagesForVisitedLinkStyleRecalc): Deleted.
(WebCore::PageCache::markPagesForFullStyleRecalc): Deleted.
* history/PageCache.h:
* page/Frame.cpp:
(WebCore::Frame::setPageAndTextZoomFactors):
* page/Page.cpp:
(WebCore::Page::setViewScaleFactor):
(WebCore::Page::setDeviceScaleFactor):
(WebCore::Page::setPagination):
(WebCore::Page::setPaginationLineGridEnabled):
(WebCore::Page::setVisitedLinkStore):
2016-10-20 Carlos Alberto Lopez Perez <clopez@igalia.com>
[GTK] Build fix after r207616
https://bugs.webkit.org/show_bug.cgi?id=163333
Reviewed by Carlos Garcia Campos.
EGL_PLATFORM_X11_KHR and EGL_PLATFORM_WAYLAND_KHR are not defined
on the EGL headers shipped by Mesa 10.3 (shipped by Debian 8)
* platform/graphics/wayland/PlatformDisplayWayland.cpp:
(WebCore::PlatformDisplayWayland::initialize):
* platform/graphics/x11/PlatformDisplayX11.cpp:
(WebCore::PlatformDisplayX11::initializeEGLDisplay):
2016-10-20 Fujii Hironori <Hironori.Fujii@sony.com>
[CMake] CMake does not support the dep files for implicit dependency
https://bugs.webkit.org/show_bug.cgi?id=161433
Reviewed by Brent Fulgham.
Created a Perl script to generate all IDL bindings for CMake.
This script can regenerate outdated bindings by based on the
supplemental dependency and dep files created by
'--write-dependencies' switch of generate-bindings.pl.
add_custom_target is used to invoke the script instead of
add_custom_command because Ninja deletes all output files before
executing the command in case of add_custom_command.
USES_TERMINAL option of add_custom_target has two effects:
1) Not buffering output of the command
2) Invoking the command in the special Ninja pool which inhibits parallel build
One needs to use CMake 3.2 or later to enable this feature.
* CMakeLists.txt: Specified target names for
GENERATE_BINDINGS. Added dependency for the targets.
* bindings/scripts/generate-bindings-all.pl: Added.
2016-10-20 Adam Jackson <ajax@redhat.com>
Prefer eglGetPlatformDisplay to eglGetDisplay
https://bugs.webkit.org/show_bug.cgi?id=163333
Reviewed by Carlos Garcia Campos.
eglGetDisplay forces the implementation to guess what kind of void* it's been handed. Different implementations
do different things, in particular glvnd and Mesa behave differently. Fortunately there exists API to tell EGL
what kind of display it is, so let's use it.
* platform/graphics/wayland/PlatformDisplayWayland.cpp:
(WebCore::PlatformDisplayWayland::initialize):
* platform/graphics/x11/PlatformDisplayX11.cpp:
(WebCore::PlatformDisplayX11::initializeEGLDisplay):
2016-10-20 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Avoid including egl.h headers in internal headers
https://bugs.webkit.org/show_bug.cgi?id=163722
Reviewed by Žan Doberšek.
egl.h includes eglplatform.h that decides the native types for the platform at compile time. However, we support
to build with X11 and Wayland at the same time and decide what to use at runtime. Currently GLContext.h includes
eglplatform.h after wayland-egl.h if Wayland is enabled. That means that the wayland native types are used by
default from all cpp files including GLContext.h. It currently works in X11 because we cast the value anyway and
for example EGLNativeWindowType is a pointer in Wayland that can be casted to unsigned long in X11 to represent
the X Window. This is very fragile in any case, we should avoid adding egl headers in our headers and only
include it in cpp files. But we also need to ensure we don't use X11 and Wayland in the same cpp file.
* PlatformGTK.cmake:
* platform/graphics/GLContext.cpp:
(WebCore::GLContext::createContextForWindow):
* platform/graphics/GLContext.h:
* platform/graphics/egl/GLContextEGL.cpp:
(WebCore::GLContextEGL::createWindowContext):
(WebCore::GLContextEGL::createContext):
(WebCore::GLContextEGL::~GLContextEGL):
* platform/graphics/egl/GLContextEGL.h:
* platform/graphics/egl/GLContextEGLWayland.cpp: Added.
(WebCore::GLContextEGL::GLContextEGL):
(WebCore::GLContextEGL::createWindowSurfaceWayland):
(WebCore::GLContextEGL::createWaylandContext):
(WebCore::GLContextEGL::destroyWaylandWindow):
* platform/graphics/egl/GLContextEGLX11.cpp: Added.
(WebCore::GLContextEGL::GLContextEGL):
(WebCore::GLContextEGL::createWindowSurfaceX11):
(WebCore::GLContextEGL::createPixmapContext):
* platform/graphics/glx/GLContextGLX.cpp:
(WebCore::GLContextGLX::createWindowContext):
(WebCore::GLContextGLX::createContext):
(WebCore::GLContextGLX::GLContextGLX):
* platform/graphics/glx/GLContextGLX.h:
* platform/graphics/wayland/PlatformDisplayWayland.cpp:
* platform/graphics/x11/PlatformDisplayX11.cpp:
2016-10-20 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Avoid strstr() when checking (E)GL extensions
https://bugs.webkit.org/show_bug.cgi?id=161958
Reviewed by Žan Doberšek.
Add static method GLContext::isExtensionSupported() to properly search extenstions in the given extension
list, and use it instead of strstr().
* platform/graphics/GLContext.cpp:
(WebCore::GLContext::isExtensionSupported):
* platform/graphics/GLContext.h:
* platform/graphics/egl/GLContextEGL.cpp:
(WebCore::GLContextEGL::createSurfacelessContext):
* platform/graphics/glx/GLContextGLX.cpp:
(WebCore::hasSGISwapControlExtension):
2016-10-20 Per Arne Vollan <pvollan@apple.com>
[Win][Direct2D] Implement ImageBufferData::getData.
https://bugs.webkit.org/show_bug.cgi?id=163668
Reviewed by Brent Fulgham.
Render data to a bitmap in system memory, which data can be read from.
* platform/graphics/win/ImageBufferDataDirect2D.cpp:
(WebCore::ImageBufferData::getData):
* platform/graphics/win/ImageBufferDirect2D.cpp:
(WebCore::ImageBuffer::ImageBuffer):
2016-10-20 Carlos Garcia Campos <cgarcia@igalia.com>
Wrong use of EGL_DEPTH_SIZE
https://bugs.webkit.org/show_bug.cgi?id=155536
Reviewed by Michael Catanzaro.
What happens here is that the driver doesn't implement EGL_DEPTH_SIZE and the default value, which is 0, is
returned. Then XCreatePixmap fails because 0 is not a valid depth. The thing is that even if EGL_DEPTH_SIZE or
EGL_BUFFER_SIZE returned a valid depth, it still might not be supported by the default screen and XCreatePixmap
can fail. What we need to ensure is that the depth we pass is compatible with the X display, not only with the
EGL config, to avoid failures when creating the pixmap. So, we can use EGL_NATIVE_VISUAL_ID instead, and
then ask X for the visual info for that id. If it isn't found then we just return before creating the pixmap,
but if the visual is found then we can be sure that the depth of the visual will not make the pixmap creation
fail. However, with the driver I'm using it doesn't matter how we create the pixmap that eglCreatePixmapSurface
always fails, again with X errors that are fatal by default. Since the driver is not free, I assume it doesn't
support eglCreatePixmapSurface or it's just buggy, so the only option we have here is trap the x errors and
ignore them. It turns out that the X errors are not fatal in this case, because eglCreatePixmapSurface ends up
returning a surface, and since these are offscreen contexts, it doesn't really matter if they contain an
invalid pixmap, because we never do swap buffer on them, so just ignoring the X errors fixes the crashes and
makes everythig work. This patch adds a helper class XErrorTrapper that allows to trap XErrors and decide what
to do with them (ignore, warn or crash) or even not consider a particular set of errors as errors.
* PlatformEfl.cmake: Add new file to compilation.
* PlatformGTK.cmake: Ditto.
* platform/graphics/egl/GLContextEGL.cpp:
(WebCore::GLContextEGL::createPixmapContext): Use EGL_NATIVE_VISUAL_ID instead of EGL_DEPTH_SIZE to figure out
the depth to be passed to XCreatePixmap. Also use the XErrorTrapper class to ignore all BadDrawable errors
produced by eglCreatePixmapSurface() and only show a warning about all other X errors.
* platform/graphics/x11/XErrorTrapper.cpp: Added.
(WebCore::xErrorTrappersMap):
(WebCore::XErrorTrapper::XErrorTrapper):
(WebCore::XErrorTrapper::~XErrorTrapper):
(WebCore::XErrorTrapper::errorCode):
(WebCore::XErrorTrapper::errorEvent):
* platform/graphics/x11/XErrorTrapper.h: Added.
(WebCore::XErrorTrapper::XErrorTrapper):
2016-10-20 Nael Ouedraogo <nael.ouedraogo@crf.canon.fr>
WebRTC: The MediaStreamTrackEvent init dictionary needs a required track member
https://bugs.webkit.org/show_bug.cgi?id=146232
Update MediaStreamTrackEvent IDL as per specification.
Reviewed by Darin Adler.
No additional test required, rebase existings tests.
* Modules/mediastream/MediaStreamTrackEvent.idl:
2016-10-19 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Media Controller: mute support
https://bugs.webkit.org/show_bug.cgi?id=163677
<rdar://problem/28851582>
Reviewed by Dean Jackson.
We introduce the MuteSupport class which brings support for muting the media
by clicking on the mute button in the media controls and correctly reflecting
the media's muted state should the media be muted via the media API.
Tests: media/modern-media-controls/mute-support/mute-support-button-click.html
media/modern-media-controls/mute-support/mute-support-media-api.html
media/modern-media-controls/mute-support/mute-support-muted.html
* Modules/modern-media-controls/media/media-controller.js:
(MediaController):
* Modules/modern-media-controls/media/mute-support.js: Copied from Source/WebCore/Modules/modern-media-controls/media/media-controller.js.
(MuteSupport.prototype.get control):
(MuteSupport.prototype.get mediaEvents):
(MuteSupport.prototype.buttonWasClicked):
(MuteSupport.prototype.syncControl):
(MuteSupport):
* WebCore.xcodeproj/project.pbxproj:
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::mediaControlsScript):
2016-10-19 Alex Christensen <achristensen@webkit.org>
Revert r207151
https://bugs.webkit.org/show_bug.cgi?id=163675
Reviewed by Brent Fulgham.
This code is still useful for comparison with Windows. I'll remove it again soon.
No new tests. No change in behavior.
* WebCore.xcodeproj/project.pbxproj:
* WebCorePrefix.h:
* loader/DocumentLoader.h:
* loader/EmptyClients.h:
* loader/FrameLoaderClient.h:
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::didReceiveAuthenticationChallenge):
* loader/ResourceLoader.h:
* loader/SubresourceLoader.h:
* loader/cf/ResourceLoaderCFNet.cpp:
* loader/cocoa/SubresourceLoaderCocoa.mm:
(WebCore::SubresourceLoader::willCacheResponse):
* loader/mac/DocumentLoaderMac.cpp:
* loader/mac/ResourceLoaderMac.mm:
(WebCore::ResourceLoader::willCacheResponse):
* page/mac/PageMac.mm:
(WebCore::Page::platformInitialize):
(WebCore::Page::addSchedulePair):
(WebCore::Page::removeSchedulePair):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::WebCoreNSURLAuthenticationChallengeClient::create):
(WebCore::WebCoreNSURLAuthenticationChallengeClient::WebCoreNSURLAuthenticationChallengeClient):
(WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForResponseToAuthenticationChallenge):
* platform/mac/WebCoreSystemInterface.h:
* platform/network/NetworkStorageSession.h:
* platform/network/ProtectionSpace.h:
* platform/network/ProtectionSpaceBase.cpp:
* platform/network/ResourceHandle.cpp:
* platform/network/ResourceHandle.h:
* platform/network/ResourceHandleClient.cpp:
* platform/network/ResourceHandleClient.h:
* platform/network/ResourceHandleInternal.h:
(WebCore::ResourceHandleInternal::ResourceHandleInternal):
* platform/network/ResourceRequestBase.cpp:
* platform/network/cf/AuthenticationCF.cpp:
(WebCore::AuthenticationChallenge::AuthenticationChallenge):
(WebCore::AuthenticationChallenge::setAuthenticationClient): Deleted.
(WebCore::AuthenticationChallenge::authenticationClient): Deleted.
(WebCore::AuthenticationChallenge::platformCompare): Deleted.
(WebCore::createCF): Deleted.
(WebCore::core): Deleted.
* platform/network/cf/AuthenticationCF.h:
* platform/network/cf/AuthenticationChallenge.h:
* platform/network/cf/CookieJarCFNet.cpp:
* platform/network/cf/CredentialStorageCFNet.cpp:
(WebCore::CredentialStorage::getFromPersistentStorage):
(WebCore::CredentialStorage::saveToPersistentStorage):
* platform/network/cf/LoaderRunLoopCF.cpp:
* platform/network/cf/LoaderRunLoopCF.h:
* platform/network/cf/NetworkStorageSessionCFNet.cpp:
(WebCore::NetworkStorageSession::cookieStorage):
* platform/network/cf/ProtectionSpaceCFNet.cpp:
* platform/network/cf/ProtectionSpaceCFNet.h:
* platform/network/cf/ResourceError.h:
* platform/network/cf/ResourceErrorCF.cpp:
* platform/network/cf/ResourceHandleCFNet.cpp:
(WebCore::shouldSniffConnectionProperty):
(WebCore::ResourceHandle::createCFURLConnection):
(WebCore::ResourceHandle::start):
(WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
(WebCore::ResourceHandle::tryHandlePasswordBasedAuthentication):
(WebCore::ResourceHandle::receivedCredential):
(WebCore::ResourceHandle::schedule):
(WebCore::ResourceHandle::unschedule):
* platform/network/cf/ResourceHandleCFURLConnectionDelegate.cpp:
* platform/network/cf/ResourceHandleCFURLConnectionDelegate.h:
* platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::setupRequest):
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse):
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::canRespondToProtectionSpace):
* platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.h:
* platform/network/cf/ResourceRequest.h:
(WebCore::ResourceRequest::encodingRequiresPlatformData):
* platform/network/cf/ResourceRequestCFNet.cpp:
(WebCore::findCFURLRequestSetContentDispositionEncodingFallbackArrayFunction):
(WebCore::findCFURLRequestCopyContentDispositionEncodingFallbackArrayFunction):
(WebCore::ResourceRequest::doUpdatePlatformRequest):
(WebCore::ResourceRequest::doUpdatePlatformHTTPBody):
(WebCore::ResourceRequest::doUpdateResourceRequest):
(WebCore::ResourceRequest::setStorageSession):
* platform/network/cf/ResourceRequestCFNet.h:
* platform/network/cf/ResourceResponse.h:
* platform/network/cf/ResourceResponseCFNet.cpp:
(WebCore::ResourceResponse::cfURLResponse):
* platform/network/cf/SynchronousLoaderClientCFNet.cpp:
* platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:
(WebCore::SynchronousResourceHandleCFURLConnectionDelegate::setupRequest):
(WebCore::SynchronousResourceHandleCFURLConnectionDelegate::setupConnectionScheduling):
(WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveResponse):
(WebCore::SynchronousResourceHandleCFURLConnectionDelegate::willCacheResponse):
(WebCore::SynchronousResourceHandleCFURLConnectionDelegate::canRespondToProtectionSpace):
* platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.h:
* platform/network/cocoa/CredentialCocoa.h:
* platform/network/cocoa/CredentialCocoa.mm:
(WebCore::Credential::Credential):
(WebCore::Credential::cfCredential):
* platform/network/cocoa/ProtectionSpaceCocoa.h:
* platform/network/cocoa/ProtectionSpaceCocoa.mm:
(WebCore::ProtectionSpace::ProtectionSpace):
(WebCore::ProtectionSpace::cfSpace):
* platform/network/cocoa/ResourceRequestCocoa.mm:
(WebCore::ResourceRequest::nsURLRequest):
* platform/network/cocoa/ResourceResponseCocoa.mm:
(WebCore::ResourceResponse::platformCertificateInfo):
(WebCore::ResourceResponse::nsURLResponse):
(WebCore::ResourceResponse::ResourceResponse):
* platform/network/ios/QuickLook.h:
* platform/network/ios/QuickLook.mm:
(-[WebQuickLookHandleAsDelegate initWithConnectionDelegate:]):
(-[WebQuickLookHandleAsDelegate connection:didReceiveDataArray:]):
(-[WebQuickLookHandleAsDelegate connection:didReceiveData:lengthReceived:]):
(-[WebQuickLookHandleAsDelegate connectionDidFinishLoading:]):
(-[WebQuickLookHandleAsDelegate connection:didFailWithError:]):
(-[WebQuickLookHandleAsDelegate detachHandle]):
(WebCore::QuickLookHandle::create):
(WebCore::QuickLookHandle::cfResponse):
* platform/network/mac/AuthenticationMac.mm:
(-[WebCoreAuthenticationClientAsChallengeSender setCFChallenge:]):
(-[WebCoreAuthenticationClientAsChallengeSender cfChallenge]):
(WebCore::core):
(WebCore::mac):
* platform/network/mac/CookieJarMac.mm:
(WebCore::setCookiesFromDOM):
(WebCore::addCookie):
(WebCore::cookieStorage):
* platform/network/mac/CredentialStorageMac.mm:
* platform/network/mac/FormDataStreamMac.h:
* platform/network/mac/FormDataStreamMac.mm:
* platform/network/mac/ResourceErrorMac.mm:
(NSErrorFromCFError):
(WebCore::ResourceError::ResourceError):
(WebCore::ResourceError::nsError):
(WebCore::ResourceError::operator NSError *):
* platform/network/mac/ResourceHandleMac.mm:
(WebCore::ResourceHandle::getConnectionTimingData):
* platform/network/mac/ResourceRequestMac.mm: Added.
(WebCore::ResourceRequest::ResourceRequest):
(WebCore::ResourceRequest::updateNSURLRequest):
* platform/network/mac/SynchronousLoaderClient.mm:
* platform/network/mac/WebCoreResourceHandleAsDelegate.h:
* platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.h:
* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
* platform/network/mac/WebCoreURLResponse.mm:
* platform/win/TemporaryLinkStubs.cpp:
* testing/js/WebCoreTestSupportPrefix.h:
2016-10-19 Jer Noble <jer.noble@apple.com>
REGRESSION (r206025): All YouTube videos play with black bars on all four sides
https://bugs.webkit.org/show_bug.cgi?id=163308
Reviewed by Darin Adler.
Test: media/media-source/media-source-resize.html
After r206025, we do not fire resize events when the size change notification happens equal-
to-or-before the current time, which can happen at the very beginning of a stream. Take care
of this case by checking that the target time isn't actually in the past inside of
sizeWillChangeAtTime(), and also always skip the boundary time observer when there was no
previous size (such as after a flush due to a seek).
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::sizeWillChangeAtTime):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setNaturalSize):
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::flushAndEnqueueNonDisplayingSamples):
(WebCore::SourceBufferPrivateAVFObjC::enqueueSample):
2016-10-19 Nan Wang <n_wang@apple.com>
AX: [Mac] Mark element AXAPI should comform to specs
https://bugs.webkit.org/show_bug.cgi?id=163707
Reviewed by Chris Fleizach.
Created a new role for mark elements on Mac and exposed the role
description.
Changes are covered in modified test expectaions.
* English.lproj/Localizable.strings:
* accessibility/AccessibilityObject.h:
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::determineAccessibilityRole):
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
* accessibility/mac/AccessibilityObjectMac.mm:
(WebCore::AccessibilityObject::accessibilityPlatformIncludesObject):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(createAccessibilityRoleMap):
(-[WebAccessibilityObjectWrapper roleDescription]):
* platform/LocalizedStrings.cpp:
(WebCore::AXMarkText):
* platform/LocalizedStrings.h:
2016-10-19 Alex Christensen <achristensen@webkit.org>
Re-enable URLParser for non-Safari Cocoa apps after r207321
https://bugs.webkit.org/show_bug.cgi?id=163690
Reviewed by Darin Adler.
I disabled the URLParser for non-Safari applications in r207305
to give me time to make URLParser more compatible, which I did in r207321
Updated some API tests which will be investigated in
https://bugs.webkit.org/show_bug.cgi?id=163127
* platform/URLParser.cpp:
(WebCore::URLParser::setEnabled):
(WebCore::URLParser::enabled):
* testing/js/WebCoreTestSupport.cpp:
(WebCoreTestSupport::setURLParserEnabled): Deleted.
* testing/js/WebCoreTestSupport.h:
2016-10-19 Myles C. Maxfield <mmaxfield@apple.com>
CSS font-variation-settings does not handle uppercase axis names in variable fonts
https://bugs.webkit.org/show_bug.cgi?id=163546
Reviewed by Dean Jackson.
Remove the extra toASCIILower() call.
Test: fast/text/variations/case-axis-names.html
* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parseFontVariationTag):
2016-10-19 Anders Carlsson <andersca@apple.com>
Remove m_redirectURLs from HistoryItem
https://bugs.webkit.org/show_bug.cgi?id=163704
Reviewed by Dan Bernstein.
* history/HistoryItem.cpp:
(WebCore::HistoryItem::HistoryItem):
(WebCore::HistoryItem::reset):
* history/HistoryItem.h:
2016-10-19 Joone Hur <joone.hur@intel.com>
Add a plain space instead of &nbsp; between text nodes
https://bugs.webkit.org/show_bug.cgi?id=123163
Reviewed by Ryosuke Niwa.
When we rebalance white spaces, &nbsp; can be added as space
under some conditions. This patch adds a condition that the next
sibling text node should not exist.
No new tests, updated existing test.
* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::rebalanceWhitespaceOnTextSubstring):
* editing/htmlediting.cpp:
(WebCore::stringWithRebalancedWhitespace):
* editing/htmlediting.h:
2016-10-19 Sam Weinig <sam@webkit.org>
Add support for sequences and dictionaries in unions
https://bugs.webkit.org/show_bug.cgi?id=163695
Reviewed by Chris Dumez.
Tests:
- Updated js/dom/webidl-type-mapping.html
* bindings/generic/IDLTypes.h:
Add additional helper predicates and fix formatting.
* bindings/js/JSDOMBinding.h:
Export hasIteratorMethod for use in testing.
* bindings/js/JSDOMConvert.h:
- Change return type of Converter<IDLDictionary<T>> to T, from Optional<T>.
- Add support for unions conversion step 12 (parts 1-3).
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateDefaultValue):
Support complex default value computations for unions using the convert infrastructure.
(GenerateParametersCheck):
(GenerateConstructorDefinition):
Remove incorrect .value() calls now that Converter<IDLDictionary<T>> returns T.
* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
* bindings/scripts/test/JS/JSTestObj.cpp:
Update bindings test results.
* testing/TypeConversions.h:
(WebCore::TypeConversions::setTypeConversionsDictionary):
(WebCore::TypeConversions::typeConversionsDictionaryLongValue):
(WebCore::TypeConversions::typeConversionsDictionaryStringValue):
(WebCore::TypeConversions::typeConversionsDictionarySequenceValue):
(WebCore::TypeConversions::typeConversionsDictionaryUnionType):
* testing/TypeConversions.idl:
Add some complex types to allow testing IDL conversions from tests.
2016-10-19 Ryosuke Niwa <rniwa@webkit.org>
Annotate more DOM and HTML IDLs with CEReactions
https://bugs.webkit.org/show_bug.cgi?id=163653
Reviewed by Darin Adler.
Added CEReactions to more IDL files.
Test: fast/custom-elements/reactions-for-webkit-extensions.html
* bindings/js/JSDOMStringMapCustom.cpp:
(WebCore::JSDOMStringMap::deleteProperty): Instantiate CustomElementReactionStack, which is equivalent to
adding CEReactions in IDL.
(WebCore::JSDOMStringMap::putDelegate): Ditto.
* dom/Document.idl:
* dom/Element.idl:
* html/HTMLElement.idl:
* page/DOMSelection.idl:
2016-10-19 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r207557.
This change caused animations/font-variations tests to time
out on pre-Sierra Macs.
Reverted changeset:
"[macOS] [iOS] Disable variation fonts on macOS El Capitan and
iOS 9"
https://bugs.webkit.org/show_bug.cgi?id=163374
http://trac.webkit.org/changeset/207557
2016-10-19 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Support -webkit-border-fit
https://bugs.webkit.org/show_bug.cgi?id=163687
Reviewed by Zalan Bujtas.
Add support for -webkit-border-fit to isValidKeywordPropertyAndValue.
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
2016-10-19 Dave Hyatt <hyatt@apple.com>
[CSS Parser] class and id parsing need to be case-insensitive in HTML quirks mode
https://bugs.webkit.org/show_bug.cgi?id=163685
Reviewed by Zalan Bujtas.
Class and ID parsing should be case-insensitive in quirks mode. Apply the same hack
that the old parser did and lowercase the class and ids in place.
* css/parser/CSSSelectorParser.cpp:
(WebCore::CSSSelectorParser::consumeId):
(WebCore::CSSSelectorParser::consumeClass):
2016-10-19 Nan Wang <n_wang@apple.com>
AX: crash: com.apple.WebCore: WebCore::AccessibilityObject::findMatchingObjects + 600
https://bugs.webkit.org/show_bug.cgi?id=163682
Reviewed by Chris Fleizach.
There's a null pointer crash when we ask for startObject->parentObjectUnignored() in
AccessibilityObject::findMatchingObject. Added a null check for the startObject to fix that.
Test: accessibility/mac/search-predicate-crash.html
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::findMatchingObjects):
2016-10-19 David Kilzer <ddkilzer@apple.com>
Bug 163670: Refine assertions in WebCore::ImageData constructors
<https://webkit.org/b/163670>
<rdar://problem/27497338>
Reviewed by Brent Fulgham.
No new tests because there is no change in nominal behavior.
* html/ImageData.cpp:
(WebCore::ImageData::ImageData(const IntSize&)): Change to use
ASSERT() since the worst-case scenario here is a nullptr deref.
Switch to IntSize::area() to compute the area.
(WebCore::ImageData::ImageData(const IntSize&, Ref<Uint8ClampedArray>&&)):
Add ASSERT() identical to the previous constructor, and change
ASSERT_WITH_SECURITY_IMPLICATION() to only fire when m_data is
not nullptr and the length check fails. Switch to
IntSize::area() to compute the area.
2016-10-19 Myles C. Maxfield <mmaxfield@apple.com>
[macOS] [iOS] Disable variation fonts on macOS El Capitan and iOS 9
https://bugs.webkit.org/show_bug.cgi?id=163374
Reviewed by Darin Adler.
Because of platform lack of support for variations in in-memory fonts,
this feature should be disabled on the affected OSes.
No tests because there is no behavior change (on the relevant platforms).
* Configurations/FeatureDefines.xcconfig:
2016-10-19 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Fix background-position parsing
https://bugs.webkit.org/show_bug.cgi?id=163681
Reviewed by Dean Jackson.
The new parser has a more efficient parsed representation of background positions. When
background-position is "center" or when no length unit is specified for a dimension,
then rather than creating a pair, the new parser makes a singleton primitive value.
Patch the StyleBuilder code to handle this case, resolving center to (left,50%) or
(top,50%) as appropriate and also handling top/left without any associated length.
* css/CSSToStyleMap.cpp:
(WebCore::CSSToStyleMap::mapFillXPosition):
(WebCore::CSSToStyleMap::mapFillYPosition):
2016-10-19 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Media Controller: click-to-start support
https://bugs.webkit.org/show_bug.cgi?id=163659
<rdar://problem/28845656>
Reviewed by Dean Jackson.
We introduce the MediaControllerSupport class which will allow a number of media controller
features to be implemented by subclasses each devoted to implementing a specific subset of
media controller features. With this bug, we add the correct behavior for click-to-start,
only showing the start button under the right circumstances.
A MediaController object indicates which media control to attach click event listeners to
through the `control` property, and a list of media events it should register on the media
element through the `mediaEvents` property. Then, as the user interacts with the specified
control and the media, the Button delegation method `buttonWasClicked()` and the `syncControl()`
methods are called to allow for the media state to be correctly set and represented in the
media controls. Custom event handling for the specified events can also be achieved by
subclassing the `handleEvent()` method.
Tests: media/modern-media-controls/start-support/start-support-audio.html
media/modern-media-controls/start-support/start-support-autoplay.html
media/modern-media-controls/start-support/start-support-click-to-start.html
media/modern-media-controls/start-support/start-support-error.html
media/modern-media-controls/start-support/start-support-fullscreen.html
media/modern-media-controls/start-support/start-support-manual-play.html
media/modern-media-controls/start-support/start-support-no-source.html
* Modules/modern-media-controls/media/media-controller-support.js: Added.
(MediaControllerSupport):
(MediaControllerSupport.prototype.get control):
(MediaControllerSupport.prototype.get mediaEvents):
(MediaControllerSupport.prototype.buttonWasClicked):
(MediaControllerSupport.prototype.handleEvent):
(MediaControllerSupport.prototype.syncControl):
* Modules/modern-media-controls/media/media-controller.js:
(MediaController):
(MediaController.prototype.buttonWasClicked): Deleted.
* Modules/modern-media-controls/media/start-support.js: Added.
(StartSupport.prototype.get control):
(StartSupport.prototype.get mediaEvents):
(StartSupport.prototype.buttonWasClicked):
(StartSupport.prototype.handleEvent):
(StartSupport.prototype.syncControl):
(StartSupport.prototype._shouldShowStartButton):
(StartSupport):
2016-10-19 Aaron Chu <aaron_chu@apple.com>
Web Inspector: AXI: expose computed tree node and heading level
https://bugs.webkit.org/show_bug.cgi?id=130825
<rdar://problem/16442349>
Reviewed by Joseph Pecoraro.
Exposing two new accessibility properties: Heading Level and Hierarchical Level.
Updated Test: LayoutTest/inspector/dom/getAccessibilityPropertiesForNode.html
* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
2016-10-19 Adam Bergkvist <adam.bergkvist@ericsson.com>
WebRTC: Implement MediaEndpointPeerConnection::stop()
https://bugs.webkit.org/show_bug.cgi?id=163660
Reviewed by Philippe Normand.
Make MediaEndpointPeerConnection::stop() stop its MediaEndpoint.
Testing: This fix deals with cleanup and tearing down resources down in the platform layer
and is not covered by automated tests. It is however observable in the manual test added
in [1] where the remote videos should stop when the connections are closed.
[1] http://webkit.org/b/163327
* Modules/mediastream/MediaEndpointPeerConnection.cpp:
(WebCore::MediaEndpointPeerConnection::stop):
2016-10-19 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Fix -webkit-mask-box-image parsing
https://bugs.webkit.org/show_bug.cgi?id=163676
Reviewed by Dean Jackson.
-webkit-mask-box-image is not a shorthand in our current code, so treat it the same as the legacy
-webkit-border-image.
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseSingleValue):
(WebCore::CSSPropertyParser::parseShorthand):
2016-10-19 Carlos Alberto Lopez Perez <clopez@igalia.com>
[GTK][EFL] Build fix after r207543.
https://bugs.webkit.org/show_bug.cgi?id=163671
Unreviewed.
Fix typo on the filename of the included header:
Mac filesystem is case insensitive, but Linux filesystems are case sensitive.
* css/parser/CSSPropertyParser.cpp:
2016-10-19 Zalan Bujtas <zalan@apple.com>
Use anonymous table row for new child at RenderTableRow::addChild() if available.
https://bugs.webkit.org/show_bug.cgi?id=163651
<rdar://problem/28705022>
Reviewed by David Hyatt.
We should try to prevent the continuation siblings from getting separated and inserted into
wrapper renderers. It makes finding these continuation siblings difficult.
This patch adds a checks for anonymous table rows so that we could find a closer common ancestor of
beforeChild/new child.
Test: fast/table/crash-when-table-has-continuation-and-content-inserted.html
* rendering/RenderObject.cpp:
(WebCore::RenderObject::showRenderObject): Add continuation information.
* rendering/RenderTableRow.cpp:
(WebCore::RenderTableRow::addChild):
2016-10-19 Joseph Pecoraro <pecoraro@apple.com>
Cleanup WebCore/workers
https://bugs.webkit.org/show_bug.cgi?id=163635
Reviewed by Chris Dumez.
* workers/*:
Cleanup like pragma once, nullptr, remove stale includes, declarations.
2016-10-19 Chris Dumez <cdumez@apple.com>
MouseEvent's coordinates should be 0 for simulated clicks
https://bugs.webkit.org/show_bug.cgi?id=163648
Reviewed by Darin Adler.
MouseEvent's coordinates should be 0 / 0 for simulated clicks triggered
by JavaScript (i.e. via element.click()). This behavior matches Chrome
and Firefox.
WebKit was computing actual coordinates for the element which was
expensive, especially because computing screenX / screenY required
a synchronous IPC with the UI process.
Test: fast/events/element-click-no-coords.html
* dom/Element.cpp:
(WebCore::Element::dispatchSimulatedClick):
* dom/SimulatedClick.cpp:
(WebCore::simulateMouseEvent):
(WebCore::simulateClick):
* dom/SimulatedClick.h:
* html/HTMLElement.cpp:
(WebCore::HTMLElement::click):
2016-10-19 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Fix transform parsing
https://bugs.webkit.org/show_bug.cgi?id=163671
Reviewed by Dean Jackson.
The new parser turned function names into CSSValueIDs and made CSSFunctionValue store them. This
meant it could be used to handle transform values, with the function name representing the
transform operation efficiently as a CSSValueID.
The old parser, however, creates WebKitCSSTransformValues. This value does not exist in the new
parser. Rather than forcing the old and new parser over to CSSFunctionValues, I opted to
just make the new parser build WebkitCSSTransformValues too.
The main reason I did this is that WebkitCSSTransformValue is actually exposed to the Web via
IDL. To be safe, I am not eliminating it (even though Blink has).
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeTranslate3d):
(WebCore::consumeNumbers):
(WebCore::consumePerspective):
(WebCore::transformOperationForCSSValueID):
(WebCore::consumeTransformValue):
2016-10-19 Darin Adler <darin@apple.com>
Move XPath from ExceptionCode to Exception
https://bugs.webkit.org/show_bug.cgi?id=163656
Reviewed by Chris Dumez.
* dom/Document.cpp:
(WebCore::Document::createExpression): Use ExceptionOr.
(WebCore::Document::createNSResolver): Return Ref.
(WebCore::Document::evaluate): Use ExceptionOr.
* dom/Document.h: Updated for above changes.
* dom/Document.idl: Use non-legacy exceptions for the functions above.
* inspector/InspectorNodeFinder.cpp:
(WebCore::InspectorNodeFinder::searchUsingXPath): Call XPath functions
with new interface.
* xml/DOMParser.cpp:
(WebCore::DOMParser::DOMParser): Marked inline.
(WebCore::DOMParser::create): Moved here from header.
(WebCore::DOMParser::parseFromString): Use ExceptionOr.
* xml/DOMParser.h: Updated for above changes.
* xml/DOMParser.idl: Use non-legacy exception.
* xml/XPathEvaluator.cpp:
(WebCore::XPathEvaluator::createExpression): Use ExceptionOr.
(WebCore::XPathEvaluator::evaluate): Ditto.
* xml/XPathEvaluator.h: Updated for above changes.
* xml/XPathEvaluator.idl: Use non-legacy exceptions.
* xml/XPathExpression.cpp:
(WebCore::XPathExpression::createExpression): Use ExceptionOr.
(WebCore::XPathExpression::evaluate): Ditto.
* xml/XPathExpression.h: Updated for above changes.
* xml/XPathExpression.idl: Use non-legacy exceptions.
* xml/XPathGrammar.y: Added include of XPathStep.h.
* xml/XPathParser.cpp:
(WebCore::XPath::Parser::Parser): Initialize three scalar data members
in the class definition rather than here.
(WebCore::XPath::Parser::parseStatement): Use ExceptionOr.
* xml/XPathParser.h: Updated for above changes.
* xml/XPathResult.cpp:
(WebCore::XPathResult::XPathResult): Use a reference rather than a
pointer for the document. Alao initialize two scalar data members
in the class definition rather than here.
(WebCore::XPathResult::convertTo): Use ExceptionOr.
(WebCore::XPathResult::numberValue): Ditto.
(WebCore::XPathResult::stringValue): Ditto.
(WebCore::XPathResult::booleanValue): Ditto.
(WebCore::XPathResult::singleNodeValue): Ditto.
(WebCore::XPathResult::snapshotLength): Ditto.
(WebCore::XPathResult::iterateNext): Ditto.
(WebCore::XPathResult::snapshotItem): Ditto.
* xml/XPathResult.h: Updated for the changes above.
* xml/XPathResult.idl: Use non-legacy exceptions.
2016-10-19 Nan Wang <n_wang@apple.com>
AX: [Mac] Meter element should use AXValueDescription to descrbe the status of the value
https://bugs.webkit.org/show_bug.cgi?id=163610
Reviewed by Chris Fleizach.
Exposed the goodness of the meter value in AXValueDescription.
Test: accessibility/mac/meter-gauge-value-description.html
* English.lproj/Localizable.strings:
* accessibility/AccessibilityProgressIndicator.cpp:
(WebCore::AccessibilityProgressIndicator::gaugeRegionValueDescription):
* accessibility/AccessibilityProgressIndicator.h:
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper valueDescriptionForMeter]):
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
* platform/LocalizedStrings.cpp:
(WebCore::AXMeterGaugeRegionOptimumText):
(WebCore::AXMeterGaugeRegionSuboptimalText):
(WebCore::AXMeterGaugeRegionLessGoodText):
* platform/LocalizedStrings.h:
2016-10-19 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Fix named color parsing
https://bugs.webkit.org/show_bug.cgi?id=163662
Reviewed by Zalan Bujtas.
Named color parsing in the old parser for extended colors relied on constructing a Color with the
name and doing a lookup that way.
The new parser allows the back end to hold a primitive identifier value for extended colors.
StyleColor contains a helper function for looking up the correct color.
This patch switches both the old and the new parsers over to the new StyleColor function.
Also remove some asserts from the CSSSelectorList, since the new parser allows it to be empty and
detects parsing failure that way.
* css/CSSSelectorList.cpp:
(WebCore::CSSSelectorList::CSSSelectorList):
(WebCore::CSSSelectorList::operator=):
* css/StyleColor.cpp:
(WebCore::StyleColor::isColorKeyword):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::colorFromPrimitiveValue):
(WebCore::colorForCSSValue): Deleted.
2016-10-19 Youenn Fablet <youenn@apple.com>
Remove SecurityOrigin::taintsCanvas
https://bugs.webkit.org/show_bug.cgi?id=163594
Reviewed by Darin Adler.
No change of behavior.
* html/canvas/CanvasRenderingContext.cpp:
(WebCore::CanvasRenderingContext::wouldTaintOrigin):
* page/SecurityOrigin.cpp:
(WebCore::SecurityOrigin::canReceiveDragData):
(WebCore::SecurityOrigin::taintsCanvas): Deleted.
* page/SecurityOrigin.h:
2016-10-18 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Fix compound selector parsing.
https://bugs.webkit.org/show_bug.cgi?id=163649
Reviewed by Darin Adler.
The new CSS parser is failing to handle compound selectors. The code has an assumption that the
first value in the RelationType enum is SubSelector. This patch changes the enum to have the same
name used in Blink, RelationType, and to make the ordering be exactly the same.
* css/CSSSelector.h:
(WebCore::CSSSelector::relation):
(WebCore::CSSSelector::setRelation):
* css/SelectorChecker.cpp:
(WebCore::SelectorChecker::matchRecursively):
(WebCore::canMatchHoverOrActiveInQuirksMode):
(WebCore::SelectorChecker::determineLinkMatchType):
* css/SelectorFilter.cpp:
(WebCore::SelectorFilter::collectIdentifierHashes):
* css/parser/CSSParserValues.cpp:
(WebCore::CSSParserSelector::insertTagHistory):
(WebCore::CSSParserSelector::appendTagHistory):
* css/parser/CSSParserValues.h:
(WebCore::CSSParserSelector::setRelation):
* css/parser/CSSSelectorParser.cpp:
(WebCore::CSSSelectorParser::consumeComplexSelector):
(WebCore::CSSSelectorParser::consumeCombinator):
* css/parser/CSSSelectorParser.h:
* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::fragmentRelationForSelectorRelation):
(WebCore::SelectorCompiler::constructFragmentsInternal):
2016-10-19 Javier Fernandez <jfernandez@igalia.com>
Web Inspector: Debugger buttons positioned incorrectly, align-content default value is unexpected
https://bugs.webkit.org/show_bug.cgi?id=163572
Reviewed by Sergio Villar Senin.
We only allow the new CSS Box Alignment syntax when the Grid Layout
feature is enabled. Due to flexbox backward compatibility we have
implemented a different code path for the style initial/default values
assignment. However, we have incorrectly resolved both align-content
and justify-content to 'flex-start' when grid layout is disabled.
This patch changes the approach, so we set 'normal' (the value specified
by the new syntax) for both properties, but using the values defined in
the old syntax (Flexbox specification) at computed style resolution.
Since 'stretch' is the default value for the align-content property, this
issue implies that any flexbox line with an undefined height will be
laid out incorrectly, if not explicitly set via CSS, because flex items
can't use the available height, even though they use 'stretch' for their
'align-self' properties.
Test: css3/flexbox/flexbox-lines-must-be-stretched-by-default.html
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::valueForContentPositionAndDistributionWithOverflowAlignment):
(WebCore::ComputedStyleExtractor::propertyValue):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::initialContentAlignment):
2016-10-19 Carlos Alberto Lopez Perez <clopez@igalia.com>
[GTK] REGRESSION(r207396) Build broken with Clang.
https://bugs.webkit.org/show_bug.cgi?id=163599
Suggested and reviewed by Darin Adler.
* css/CSSPrimitiveValue.cpp:
(WebCore::CSSPrimitiveValue::getStringValue):
2016-10-19 Darin Adler <darin@apple.com>
Try to fix build.
* page/PerformanceUserTiming.cpp: Add back class name; needed by some compiler versions.
2016-10-19 Carlos Garcia Campos <cgarcia@igalia.com>
Unreviewed. Fix the build after r207522.
* page/PerformanceUserTiming.cpp: Include PerformanceTiming.h.
2016-10-19 Carlos Garcia Campos <cgarcia@igalia.com>
Unreviewed. Fix the build after r207519.
The build error is:
IDL ATTRIBUTE CHECKER ERROR: Unknown IDL attribute [PassContext] is found at TestRunner.idl.
Because PassContext was removed from IDLAttributes.txt in rr207519, but it's implemented by
CodeGeneratorTestRunner.pm and used by TestRunner.idl.
* bindings/scripts/IDLAttributes.txt: Bring back PassContext.
2016-10-19 Carlos Garcia Campos <cgarcia@igalia.com>
Unreviewed. Fix the build with GCC 4.9 after r207463.
Add constructors to MediaConstraintsData.
* Modules/mediastream/MediaConstraintsImpl.h:
(WebCore::MediaConstraintsData::MediaConstraintsData):
2016-10-19 Jer Noble <jer.noble@apple.com>
[Mac][MSE] Movies with a 'mehd' box have a zero-duration
https://bugs.webkit.org/show_bug.cgi?id=163641
Reviewed by Darin Adler.
Test: media/media-source/media-source-init-segment-duration.html
The canonical (ISO/IEC 14496-12:2012) way to signal the duration of a fragmented media file is to add a
'mehd' box to the 'mvex' container box specifying the duration of the fragment. Support this through the
AVAsset -overallDurationHint property.
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::didParseStreamDataAsAsset):
* platform/spi/mac/AVFoundationSPI.h:
2016-10-18 Darin Adler <darin@apple.com>
Move many miscellaneous classes from ExceptionCode to Exception
https://bugs.webkit.org/show_bug.cgi?id=163645
Reviewed by Ryosuke Niwa.
* bindings/js/JSCryptoCustom.cpp:
(WebCore::JSCrypto::getRandomValues): Use propagateException.
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::handlePostMessage): Ditto.
(WebCore::JSDOMWindow::setTimeout): Use toJSNumber.
(WebCore::JSDOMWindow::setInterval): Ditto.
* bindings/js/JSStorageCustom.cpp:
(WebCore::JSStorage::nameGetter): Use propagateException.
(WebCore::JSStorage::deleteProperty): Ditto.
(WebCore::JSStorage::getOwnPropertyNames): Ditto.
(WebCore::JSStorage::putDelegate): Ditto.
* loader/appcache/DOMApplicationCache.cpp:
(WebCore::DOMApplicationCache::update): Use ExceptionOr.
(WebCore::DOMApplicationCache::swapCache): Ditto.
* loader/appcache/DOMApplicationCache.h: Update for above changes.
* loader/appcache/DOMApplicationCache.idl: Use non-legacy exceptions.
* page/Crypto.cpp:
(WebCore::Crypto::getRandomValues): Use ExceptionOr.
(WebCore::Crypto::webkitSubtle): Ditto.
* page/Crypto.h: Updated for above changes.
* page/Crypto.idl: Use non-legacy exceptions.
* page/DOMWindow.cpp:
(WebCore::DOMWindow::DOMWindow): Initialize many data members in
the class definition instead of here.
(WebCore::DOMWindow::page): Use nullptr.
(WebCore::DOMWindow::screen): Ditto.
(WebCore::DOMWindow::crypto): Ditto.
(WebCore::DOMWindow::locationbar): Ditto.
(WebCore::DOMWindow::menubar): Ditto.
(WebCore::DOMWindow::personalbar): Ditto.
(WebCore::DOMWindow::scrollbars): Ditto.
(WebCore::DOMWindow::statusbar): Ditto.
(WebCore::DOMWindow::toolbar): Ditto.
(WebCore::DOMWindow::applicationCache): Ditto.
(WebCore::DOMWindow::sessionStorage): Use ExceptionOr.
(WebCore::DOMWindow::localStorage): Ditto.
(WebCore::DOMWindow::postMessage): Ditto.
(WebCore::DOMWindow::frameElement): Use nullptr.
(WebCore::DOMWindow::self): Ditto.
(WebCore::DOMWindow::opener): Ditto.
(WebCore::DOMWindow::parent): Ditto.
(WebCore::DOMWindow::top): Ditto.
(WebCore::DOMWindow::getComputedStyle): Use Ref.
(WebCore::DOMWindow::setTimeout): Use ExceptionOr.
(WebCore::DOMWindow::setInterval): Ditto.
(WebCore::didAddStorageEventListener): Use a reference instead of a
pointer, and ignore return value instead of using IGNORE_EXCEPTION.
(WebCore::DOMWindow::addEventListener): Pass reference to function above.
(WebCore::DOMWindow::dispatchEvent): Use enum class version of PageStatus.
* page/DOMWindow.h: Updated for changes above. Also changed indentatation.
* page/DOMWindow.idl: Use non-legacy exceptions.
* page/EventSource.cpp:
(WebCore::EventSource::create): Use ExceptionOr.
* page/EventSource.h: Updated for change above.
* page/EventSource.idl: Use non-legacy exception.
* page/Location.cpp:
(WebCore::Location::setProtocol): Use ExceptionOr.
* page/Location.h: Updated for change above.
* page/Location.idl: Use non-legacy exception.
* page/Performance.cpp:
(WebCore::Performance::Performance): Remove unnecessary initialization of
smart pointer to null, and moved initialization of m_resourceTimingBufferSize
to the header.
(WebCore::Performance::navigation): Made non-const and return a reference.
(WebCore::Performance::timing): Ditto.
(WebCore::Performance::addResourceTiming): Change LoadTiming argument to use
a const& instead of passing in a copy.
(WebCore::Performance::webkitMark): Use ExceptionOr and make_unique.
(WebCore::Performance::webkitClearMarks): Ditto.
(WebCore::Performance::webkitMeasure): Ditto.
(WebCore::Performance::webkitClearMeasures): Ditto.
(WebCore::Performance::reduceTimeResolution): Use std::floor.
* page/Performance.h: Updated for above changes. Removed unneeded includes.
Made more things private. Removed unneeded reference counting of UserTiming.
* page/Performance.idl: Use non-legacy exceptions.
* page/PerformanceUserTiming.cpp:
(WebCore::restrictedMarkFunction): Removed unneeded class name.
(WebCore::UserTiming::UserTiming): Take a reference instead of a pointer.
(WebCore::UserTiming::mark): Use ExceptionOr.
(WebCore::UserTiming::findExistingMarkStartTime): Ditto.
(WebCore::UserTiming::measure): Ditto.
(WebCore::getEntrySequenceByName): Simplified code using HashMap::get.
* page/PerformanceUserTiming.h: Updated for above changes. Removed reference
counting since this is a single-owner object.
* page/UserMessageHandler.cpp:
(WebCore::UserMessageHandler::postMessage): Use ExceptionOr.
* page/UserMessageHandler.h: Updated for above change.
* page/UserMessageHandler.idl: Use non-legacy exception.
* storage/Storage.cpp:
(WebCore::Storage::length): Use ExceptionOr.
(WebCore::Storage::key): Ditto.
(WebCore::Storage::getItem): Ditto.
(WebCore::Storage::setItem): Ditto.
(WebCore::Storage::removeItem): Ditto.
(WebCore::Storage::clear): Ditto.
(WebCore::Storage::contains): Ditto.
* storage/Storage.h: Updated for above change.
* storage/Storage.idl: Use non-legacy exceptions.
* storage/StorageEventDispatcher.cpp:
(WebCore::StorageEventDispatcher::dispatchSessionStorageEventsToFrames):
Updated for ExceptionOr.
(WebCore::StorageEventDispatcher::dispatchLocalStorageEventsToFrames): Ditto.
2016-10-18 Darin Adler <darin@apple.com>
Move internal testing classes from ExceptionCode to Exception
https://bugs.webkit.org/show_bug.cgi?id=163553
Reviewed by Ryosuke Niwa.
* bindings/js/JSDOMBinding.h: Added toJSArray. Also exported a function that
is now needed in the testing library.
* bindings/scripts/CodeGeneratorJS.pm:
(NativeToJSValue): Added code to handle the jsArray case with an exception.
* css/parser/CSSPropertyParser.cpp: Fix #if to make code compile when
CSS_SCROLL_SNAP is not enabled.
* dom/Element.cpp:
(WebCore::Element::createShadowRoot): Changed return type to a raw pointer.
There is no reason it needs to be a RefPtr.
* dom/Element.h: Updated for above change.
* svg/SVGPathStringBuilder.h: Exported class and made more public so it can
be used in test code.
* svg/SVGPathUtilities.cpp:
(WebCore::pathIteratorForBuildingString): Deleted. Needed only for test code,
so moved into there.
(WebCore::buildStringFromPath): Deleted. Ditto.
* svg/SVGPathUtilities.h: Removed buildStringFromPath.
* testing/InternalSettings.cpp: Simplified the guard macro and used the all
capitals style that our style guide prescribes for non-function-like macros.
(WebCore::InternalSettings::create): Moved here, no longer inline Use m_page.
(WebCore::InternalSettings::resetToConsistentState): Updated since settings
returns a reference.
(WebCore::InternalSettings::settings): Changed to return a reference and
assert that m_page is not null; functions all check m_page for null first.
(WebCore::InternalSettings::setTouchEventEmulationEnabled): Updated to use
ExceptionOr, do an m_page check, and use settings that returns a reference.
(WebCore::InternalSettings::setStandardFontFamily): Ditto.
(WebCore::InternalSettings::setSerifFontFamily): Ditto.
(WebCore::InternalSettings::setSansSerifFontFamily): Ditto.
(WebCore::InternalSettings::setFixedFontFamily): Ditto.
(WebCore::InternalSettings::setCursiveFontFamily): Ditto.
(WebCore::InternalSettings::setFantasyFontFamily): Ditto.
(WebCore::InternalSettings::setPictographFontFamily): Ditto.
(WebCore::InternalSettings::setTextAutosizingEnabled): Ditto.
(WebCore::InternalSettings::setTextAutosizingWindowSizeOverride): Ditto.
(WebCore::InternalSettings::setMediaTypeOverride): Ditto.
(WebCore::InternalSettings::setCanStartMedia): Ditto.
(WebCore::InternalSettings::setAllowsAirPlayForMediaPlayback): Ditto.
(WebCore::InternalSettings::setEditingBehavior): Ditto.
(WebCore::InternalSettings::setShouldDisplayTrackKind): Ditto.
(WebCore::InternalSettings::shouldDisplayTrackKind): Ditto.
(WebCore::InternalSettings::setStorageBlockingPolicy): Ditto.
(WebCore::InternalSettings::setPreferMIMETypeForImages): Ditto.
(WebCore::InternalSettings::setImagesEnabled): Ditto.
(WebCore::InternalSettings::setPDFImageCachingPolicy): Ditto.
(WebCore::InternalSettings::setMinimumTimerInterval): Ditto.
(WebCore::InternalSettings::setDefaultVideoPosterURL): Ditto.
(WebCore::InternalSettings::setForcePendingWebGLPolicy): Ditto.
(WebCore::InternalSettings::setTimeWithoutMouseMovementBeforeHidingControls): Ditto.
(WebCore::InternalSettings::setUseLegacyBackgroundSizeShorthandBehavior): Ditto.
(WebCore::InternalSettings::setAutoscrollForDragAndDropEnabled): Ditto.
(WebCore::InternalSettings::setFontFallbackPrefersPictographs): Ditto.
(WebCore::InternalSettings::setWebFontsAlwaysFallBack): Ditto.
(WebCore::InternalSettings::setQuickTimePluginReplacementEnabled): Ditto.
(WebCore::InternalSettings::setYouTubeFlashPluginReplacementEnabled): Ditto.
(WebCore::InternalSettings::setBackgroundShouldExtendBeyondPage): Ditto.
(WebCore::InternalSettings::setShouldConvertPositionStyleOnCopy): Ditto.
(WebCore::InternalSettings::setScrollingTreeIncludesFrames): Ditto.
(WebCore::InternalSettings::setAllowsInlineMediaPlayback): Ditto.
(WebCore::InternalSettings::setAllowsInlineMediaPlaybackAfterFullscreen): Ditto.
(WebCore::InternalSettings::setInlineMediaPlaybackRequiresPlaysInlineAttribute): Ditto.
(WebCore::InternalSettings::setIndexedDBWorkersEnabled): Ditto.
(WebCore::InternalSettings::userInterfaceDirectionPolicy): Ditto.
(WebCore::InternalSettings::setUserInterfaceDirectionPolicy): Ditto.
(WebCore::InternalSettings::systemLayoutDirection): Ditto.
(WebCore::InternalSettings::setSystemLayoutDirection): Ditto.
(WebCore::InternalSettings::variationFontsEnabled): Ditto.
(WebCore::InternalSettings::setVariationFontsEnabled): Ditto.
(WebCore::InternalSettings::forcedPrefersReducedMotionValue): Ditto.
(WebCore::InternalSettings::setForcedPrefersReducedMotionValue): Ditto.
* testing/InternalSettings.h: Updated for above changes. Also moved Backup to make
it private instead of public.
* testing/InternalSettings.idl: Use non-legacy execption. Also removed unneeded
exception for setIndexedDBWorkersEnabled.
* testing/Internals.cpp: Marked InspectorStubFrontend final and made everything private.
(WebCore::Internals::setCanShowModalDialogOverride): Use ExceptionOr.
(WebCore::Internals::lastSpatialNavigationCandidateCount): Ditto.
(WebCore::Internals::animationsAreSuspended): Ditto.
(WebCore::Internals::suspendAnimations): Ditto.
(WebCore::Internals::resumeAnimations): Ditto.
(WebCore::Internals::pauseAnimationAtTimeOnElement): Ditto.
(WebCore::Internals::pauseAnimationAtTimeOnPseudoElement): Ditto.
(WebCore::Internals::pauseTransitionAtTimeOnElement): Ditto.
(WebCore::Internals::pauseTransitionAtTimeOnPseudoElement): Ditto.
(WebCore::Internals::elementRenderTreeAsText): Ditto.
(WebCore::Internals::ensureShadowRoot): Ditto.
(WebCore::Internals::createShadowRoot): Ditto.
(WebCore::Internals::shadowRootType): Ditto.
(WebCore::Internals::isTimerThrottled): Ditto.
(WebCore::Internals::formControlStateOfPreviousHistoryItem): Ditto.
(WebCore::Internals::setFormControlStateOfPreviousHistoryItem): Ditto.
(WebCore::Internals::absoluteCaretBounds): Ditto.
(WebCore::Internals::inspectorHighlightRects): Ditto.
(WebCore::Internals::inspectorHighlightObject): Ditto.
(WebCore::Internals::markerCountForNode): Ditto.
(WebCore::Internals::markerAt): Ditto.
(WebCore::Internals::markerRangeForNode): Ditto.
(WebCore::Internals::markerDescriptionForNode): Ditto.
(WebCore::Internals::dumpMarkerRects): Ditto.
(WebCore::Internals::setMarkedTextMatchesAreHighlighted): Ditto.
(WebCore::Internals::setScrollViewPosition): Ditto.
(WebCore::Internals::setViewBaseBackgroundColor): Ditto.
(WebCore::Internals::setPagination): Ditto.
(WebCore::Internals::setPaginationLineGridEnabled): Ditto.
(WebCore::Internals::configurationForViewport): Ditto.
(WebCore::Internals::wasLastChangeUserEdit): Ditto.
(WebCore::Internals::scrollElementToRect): Ditto.
(WebCore::Internals::autofillFieldName): Ditto.
(WebCore::Internals::paintControlTints): Ditto.
(WebCore::Internals::rangeForDictionaryLookupAtLocation): Ditto.
(WebCore::Internals::setDelegatesScrolling): Ditto.
(WebCore::Internals::lastSpellCheckRequestSequence): Ditto.
(WebCore::Internals::lastSpellCheckProcessedSequence): Ditto.
(WebCore::Internals::wheelEventHandlerCount): Ditto.
(WebCore::Internals::touchEventHandlerCount): Ditto.
(WebCore::Internals::nodesFromRect): Ditto.
(WebCore::Internals::setBatteryStatus): Ditto.
(WebCore::Internals::setDeviceProximity): Ditto.
(WebCore::Internals::hasSpellingMarker): Ditto.
(WebCore::Internals::hasAutocorrectedMarker): Ditto.
(WebCore::Internals::handleAcceptedCandidate): Ditto.
(WebCore::Internals::isOverwriteModeEnabled): Ditto.
(WebCore::Internals::toggleOverwriteModeEnabled): Ditto.
(WebCore::Internals::countMatchesForText): Ditto.
(WebCore::Internals::countFindMatches): Ditto.
(WebCore::Internals::setInspectorIsUnderTest): Ditto.
(WebCore::Internals::hasGrammarMarker): Ditto.
(WebCore::Internals::numberOfScrollableAreas): Ditto.
(WebCore::Internals::isPageBoxVisible): Ditto.
(WebCore::Internals::layerTreeAsText): Ditto.
(WebCore::Internals::repaintRectsAsText): Ditto.
(WebCore::Internals::scrollingStateTreeAsText): Ditto.
(WebCore::Internals::mainThreadScrollingReasons): Ditto.
(WebCore::Internals::nonFastScrollableRects): Ditto.
(WebCore::Internals::setElementUsesDisplayListDrawing): Ditto.
(WebCore::Internals::setElementTracksDisplayListReplay): Ditto.
(WebCore::Internals::displayListForElement): Ditto.
(WebCore::Internals::replayDisplayListForElement): Ditto.
(WebCore::Internals::garbageCollectDocumentResources): Ditto.
(WebCore::Internals::insertAuthorCSS): Ditto.
(WebCore::Internals::insertUserCSS): Ditto.
(WebCore::Internals::pageProperty): Ditto.
(WebCore::Internals::pageSizeAndMarginsInPixels): Ditto.
(WebCore::Internals::setPageScaleFactor): Ditto.
(WebCore::Internals::setPageZoomFactor): Ditto.
(WebCore::Internals::setTextZoomFactor): Ditto.
(WebCore::Internals::setUseFixedLayout): Ditto.
(WebCore::Internals::setFixedLayoutSize): Ditto.
(WebCore::Internals::setViewExposedRect): Ditto.
(WebCore::Internals::setHeaderHeight): Ditto.
(WebCore::Internals::setFooterHeight): Ditto.
(WebCore::Internals::setTopContentInset): Ditto.
(WebCore::Internals::setApplicationCacheOriginQuota): Ditto.
(WebCore::Internals::startTrackingRepaints): Ditto.
(WebCore::Internals::stopTrackingRepaints): Ditto.
(WebCore::Internals::startTrackingLayerFlushes): Ditto.
(WebCore::Internals::layerFlushCount): Ditto.
(WebCore::Internals::startTrackingStyleRecalcs): Ditto.
(WebCore::Internals::styleRecalcCount): Ditto.
(WebCore::Internals::startTrackingCompositingUpdates): Ditto.
(WebCore::Internals::compositingUpdateCount): Ditto.
(WebCore::Internals::updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks): Ditto.
(WebCore::Internals::getCurrentCursorInfo): Ditto.
(WebCore::Internals::mediaElementHasCharacteristic): Ditto.
(WebCore::Internals::captionsStyleSheetOverride): Ditto.
(WebCore::Internals::setCaptionsStyleSheetOverride): Ditto.
(WebCore::Internals::setPrimaryAudioTrackLanguageOverride): Ditto.
(WebCore::Internals::setCaptionDisplayMode): Ditto.
(WebCore::Internals::selectionBounds): Ditto.
(WebCore::Internals::isVibrating): Ditto.
(WebCore::Internals::isPluginUnavailabilityIndicatorObscured): Ditto.
(WebCore::Internals::beginMediaSessionInterruption): Ditto.
(WebCore::Internals::setMediaSessionRestrictions): Ditto.
(WebCore::Internals::postRemoteControlCommand): Ditto.
(WebCore::Internals::setMockMediaPlaybackTargetPickerState): Ditto.
(WebCore::Internals::installMockPageOverlay): Ditto.
(WebCore::Internals::pageOverlayLayerTreeAsText): Ditto.
(WebCore::Internals::scrollSnapOffsets): Ditto.
(WebCore::Internals::pathStringWithShrinkWrappedRects): Moved the code that builds
the path string in here for now since it's only used for this testing.
(WebCore::Internals::resourceLoadStatisticsForOrigin): Take a const String&.
* testing/Internals.h: Updated for above changes.
* testing/Internals.idl: Use non-legacy exceptions.
2016-10-18 Chris Dumez <cdumez@apple.com>
[Web IDL] Drop webkit-specific extended attributes that are no longer useful
https://bugs.webkit.org/show_bug.cgi?id=163643
Reviewed by Ryosuke Niwa.
Drop webkit-specific IDL extended attributes that are no longer useful:
- [CustomReturn]: I believe this used to be for ObjC bindings. It has
no impact in JS bindings.
- [Deletable]: It only had an impact on static attributes and was only
used on HTMLAllCollection.all, which is not static. I updated the
bindings generator to so that static attributes are now configurable
by default (unless marked as [Unforgeable], as per Web IDL [1]. This
causes Notification.permission (This only static attribute we have)
to become deletable. This behavior is consistent with the specification
and with Chrome. I added test coverage for this.
- [ImplementationNamespace]: Implemented but unused.
- [PassContext]: Not implemented and unused.
- [TypedArray=*]: Not implemented and unused.
[1] https://heycam.github.io/webidl/#es-attributes
Test: fast/notifications/notification-permisssion-deletable.html
* bindings/scripts/CodeGeneratorJS.pm:
(GetNamespaceForInterface):
(GenerateImplementation):
* bindings/scripts/IDLAttributes.txt:
* bindings/scripts/test/JS/JSTestInterface.cpp:
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
* dom/Node.idl:
* html/HTMLDocument.idl:
2016-10-18 Sam Weinig <sam@webkit.org>
Replace std::experimental::variant with WTF::Variant (or similar)
https://bugs.webkit.org/show_bug.cgi?id=163626
Reviewed by Chris Dumez.
Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc.
into the WTF namespace.
* Modules/fetch/FetchBody.h:
(WebCore::FetchBody::isBlob):
(WebCore::FetchBody::isFormData):
(WebCore::FetchBody::isArrayBuffer):
(WebCore::FetchBody::isArrayBufferView):
(WebCore::FetchBody::isURLSearchParams):
(WebCore::FetchBody::isText):
(WebCore::FetchBody::blobBody):
(WebCore::FetchBody::formDataBody):
(WebCore::FetchBody::arrayBufferBody):
(WebCore::FetchBody::arrayBufferViewBody):
(WebCore::FetchBody::textBody):
(WebCore::FetchBody::urlSearchParamsBody):
* bindings/generic/IDLTypes.h:
* dom/ExceptionOr.h:
(WebCore::ExceptionOr<ReturnType>::hasException):
(WebCore::ExceptionOr<ReturnType>::releaseException):
(WebCore::ExceptionOr<ReturnType>::releaseReturnValue):
* dom/MessageEvent.cpp:
(WebCore::MessageEvent::source):
* dom/MessageEvent.h:
* dom/Node.cpp:
(WebCore::nodeSetPreTransformedFromNodeOrStringVector):
(WebCore::Node::convertNodesOrStringsIntoNode):
* dom/Node.h:
* html/HTMLOptionsCollection.h:
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::add):
* html/HTMLSelectElement.h:
* html/track/TrackEvent.cpp:
(WebCore::TrackEvent::TrackEvent):
* html/track/TrackEvent.h:
2016-10-18 Chris Dumez <cdumez@apple.com>
Unreviewed, rebaseline bindings tests after Sam's r207505.
* bindings/scripts/test/JS/JSTestCallback.cpp:
(WebCore::JSTestCallback::callbackWithSerializedScriptValueParam):
* bindings/scripts/test/JS/JSTestCallbackFunction.cpp:
(WebCore::JSTestCallbackFunction::callbackWithSerializedScriptValueParam):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjPrototypeFunctionSerializedValueCaller):
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
(WebCore::jsTestSerializedScriptValueInterfaceValueGetter):
(WebCore::jsTestSerializedScriptValueInterfaceReadonlyValueGetter):
(WebCore::jsTestSerializedScriptValueInterfaceCachedValueGetter):
(WebCore::jsTestSerializedScriptValueInterfaceCachedReadonlyValueGetter):
(WebCore::setJSTestSerializedScriptValueInterfaceValueFunction):
(WebCore::setJSTestSerializedScriptValueInterfaceCachedValueFunction):
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
(WebCore::jsTestTypedefsImmutableSerializedScriptValueGetter):
(WebCore::setJSTestTypedefsImmutableSerializedScriptValueFunction):
2016-10-18 Chris Dumez <cdumez@apple.com>
[Web IDL] Kill support for [LegacyConstructorTemplate=Event] / [LegacyInitializedByEventConstructor]
https://bugs.webkit.org/show_bug.cgi?id=163630
Reviewed by Darin Adler.
Kill support for [LegacyConstructorTemplate=Event] / [LegacyInitializedByEventConstructor] in our
IDL now that all our events use proper constructors instead.
* bindings/scripts/CodeGenerator.pm:
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
(GenerateConstructorDefinition):
(GenerateConstructorHelperMethods):
(IsConstructable):
* bindings/scripts/IDLAttributes.txt:
* dom/Event.h:
(WebCore::Event::create):
* dom/Event.idl:
* dom/UIEvent.h:
(WebCore::UIEvent::create):
* dom/UIEvent.idl:
2016-10-18 Chris Dumez <cdumez@apple.com>
Changing details.open should cause a toggle event to be fired asynchronously
https://bugs.webkit.org/show_bug.cgi?id=163568
Reviewed by Darin Adler.
Changing details.open should cause a toggle event to be fired asynchronously:
- https://html.spec.whatwg.org/#details-notification-task-steps
Firefox and Chrome implement this, we don't.
Test: imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-details-element/toggleEvent.html
* dom/EventNames.h:
* dom/GlobalEventHandlers.idl:
* html/HTMLAttributeNames.in:
* html/HTMLDetailsElement.cpp:
(WebCore::detailToggleEventSender):
(WebCore::HTMLDetailsElement::~HTMLDetailsElement):
(WebCore::HTMLDetailsElement::dispatchPendingEvent):
(WebCore::HTMLDetailsElement::parseAttribute):
* html/HTMLDetailsElement.h:
* html/HTMLElement.cpp:
(WebCore::HTMLElement::createEventHandlerNameMap):
2016-10-18 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Enable basic parser testing.
https://bugs.webkit.org/show_bug.cgi?id=163639
Reviewed by Dean Jackson.
* css/SelectorChecker.cpp:
(WebCore::SelectorChecker::matchRecursively):
Remove the ASSERT_NOT_REACHED on the new shadow selectors. We need to implement this
eventually, but it's better to not assert on that for now.
* css/parser/CSSParserValues.cpp:
(WebCore::CSSParserSelector::isHostPseudoSelector):
Make sure to check that we're a pseudoclass selector first, since otherwise we'll assert.
* css/parser/CSSParserValues.h:
(WebCore::CSSParserSelector::needsImplicitShadowCombinatorForMatching):
Make sure to check that we're a pseudoelement selector first, since otherwise we'll assert.
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::addExpandedPropertyForValue):
copyRef is needed here, since a singleton value is being propagated to all the expanded shorthand properties.
(WebCore::parseSingleShadow):
(WebCore::CSSPropertyParser::consumeFont):
Remove the font properties that aren't part of our shorthand. We will need to revisit this eventually as it seems
some of the font properties should be reset as part of this shorthand but aren't.
'
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::consumeInteger):
Just return a number for now instead of the parser_integer type.
* css/parser/CSSSelectorParser.cpp:
(WebCore::CSSSelectorParser::consumePseudo):
Clean this up so that it doesn't assert by making sure to add qualifying checks for the appropriate match type.
2016-10-18 Ryosuke Niwa <rniwa@webkit.org>
Update the comment for HTML Imports as there is now a proposal to use ES6 Modules for this.
Also replace the contact by me since I'm most familiar with this feature.
* features.json:
2016-10-18 Ryosuke Niwa <rniwa@webkit.org>
Update the status of shadow DOM API to "Done" with a comment saying we're still fixing bugs.
Also update my contact information since I'm no longer on Twitter.
* features.json:
2016-10-18 Chris Dumez <cdumez@apple.com>
Provide better form validation messages
https://bugs.webkit.org/show_bug.cgi?id=163584
Reviewed by Darin Adler.
Provide better form validation messages that match more closely the ones
from Chrome and Firefox.
No new tests, updated existing tests.
* English.lproj/Localizable.strings:
* platform/LocalizedStrings.cpp:
(WebCore::validationMessageValueMissingText):
(WebCore::validationMessageValueMissingForCheckboxText):
(WebCore::validationMessageValueMissingForFileText):
(WebCore::validationMessageValueMissingForMultipleFileText):
(WebCore::validationMessageValueMissingForRadioText):
(WebCore::validationMessageValueMissingForSelectText):
(WebCore::validationMessageTypeMismatchText):
(WebCore::validationMessageTypeMismatchForEmailText):
(WebCore::validationMessageTypeMismatchForMultipleEmailText):
(WebCore::validationMessageTypeMismatchForURLText):
(WebCore::validationMessagePatternMismatchText):
(WebCore::validationMessageTooShortText):
(WebCore::validationMessageTooLongText):
(WebCore::validationMessageRangeUnderflowText):
(WebCore::validationMessageRangeOverflowText):
(WebCore::validationMessageStepMismatchText):
(WebCore::validationMessageBadInputForNumberText):
2016-10-18 Dave Hyatt <hyatt@apple.com>
Fix GTK build.
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseSingleValue):
2016-10-18 Sam Weinig <sam@webkit.org>
Simplify SerializedScriptValue, MessagePortArray and ArrayBufferArray to ease generation
https://bugs.webkit.org/show_bug.cgi?id=163625
Reviewed by Chris Dumez.
- Replace uses of MessagePortArray (a.k.a. Vector<RefPtr<MessagePort>, 1>) with Vector<RefPtr<MessagePort>>.
- Replace uses of ArrayBufferArray (a.k.a. Vector<RefPtr<ArrayBuffer>, 1>) with Vector<RefPtr<ArrayBuffer>>.
- Add convenience functions to SerializedScriptValue to allow calling with fewer parameters.
- Move MessagePorts and ArrayBuffers more where possible.
* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::putOrAdd):
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd):
* bindings/js/IDBBindingUtilities.cpp:
(WebCore::deserializeIDBValueToJSValue):
* bindings/js/JSCustomEventCustom.cpp:
(WebCore::JSCustomEvent::detail):
* bindings/js/JSHistoryCustom.cpp:
(WebCore::JSHistory::state):
(WebCore::JSHistory::pushState):
(WebCore::JSHistory::replaceState):
* bindings/js/JSPopStateEventCustom.cpp:
(WebCore::JSPopStateEvent::state):
* dom/CustomEvent.cpp:
(WebCore::CustomEvent::trySerializeDetail):
* dom/ErrorEvent.cpp:
(WebCore::ErrorEvent::sanitizedErrorValue):
(WebCore::ErrorEvent::trySerializeError):
* dom/PopStateEvent.cpp:
(WebCore::PopStateEvent::trySerializeState):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::postMessage):
* page/DOMWindow.h:
* workers/DedicatedWorkerGlobalScope.cpp:
(WebCore::DedicatedWorkerGlobalScope::postMessage):
* workers/DedicatedWorkerGlobalScope.h:
* workers/Worker.cpp:
(WebCore::Worker::postMessage):
* workers/Worker.h:
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::handlePostMessage):
* bindings/js/JSDictionary.cpp:
(WebCore::JSDictionary::convertValue):
* bindings/js/JSDictionary.h:
Updated for new SerializedScriptValue interface/vector naming.
* bindings/js/JSMessageEventCustom.cpp:
(WebCore::handleInitMessageEvent):
Update handleInitMessageEvent to check for exceptions and use convert for the MessagePort sequence.
* bindings/js/JSMessagePortCustom.cpp:
(WebCore::extractTransferables):
(WebCore::fillMessagePortArray): Deleted.
* bindings/js/JSMessagePortCustom.h:
(WebCore::handlePostMessage):
Rename fillMessagePortArray to extractTransferables to better express what it does.
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneSerializer::serialize):
(WebCore::CloneSerializer::CloneSerializer):
(WebCore::CloneSerializer::fillTransferMap):
(WebCore::CloneSerializer::dumpIfTerminal):
(WebCore::CloneDeserializer::deserialize):
(WebCore::CloneDeserializer::CloneDeserializer):
(WebCore::CloneDeserializer::readTerminal):
(WebCore::SerializedScriptValue::transferArrayBuffers):
(WebCore::SerializedScriptValue::create):
(WebCore::SerializedScriptValue::deserialize):
* bindings/js/SerializedScriptValue.h:
Simplify interface to allow more callers to avoid passing default arguments. Use ExecState& more.
* bindings/scripts/CodeGeneratorJS.pm:
(GetNativeVectorType):
Remove special case for MessagePort.
(JSValueToNative):
(NativeToJSValue):
Updated for new SerializedScriptValue interface.
* dom/MessageEvent.cpp:
(WebCore::MessageEvent::MessageEvent):
(WebCore::MessageEvent::create):
(WebCore::MessageEvent::initMessageEvent):
(WebCore::MessageEvent::trySerializeData):
* dom/MessageEvent.h:
Store the MessagePort sequence as a Vector<RefPtr<MessagePort>> rather than in a unique_ptr.
* dom/MessageEvent.idl:
Update last type in init functions to be sequence<MessagePort> rather than Array. They are still
custom, as we don't quite generate these correctly yet.
* dom/MessagePort.cpp:
(WebCore::MessagePort::postMessage):
(WebCore::MessagePort::dispatchMessages):
(WebCore::MessagePort::disentanglePorts):
(WebCore::MessagePort::entanglePorts):
* dom/MessagePort.h:
Update interface to take MessagePort vectors by rvalue reference.
2016-10-18 Chris Dumez <cdumez@apple.com>
[iOS] Drop JSDictionary::convertValue() overload taking a TouchList
https://bugs.webkit.org/show_bug.cgi?id=163620
Reviewed by Sam Weinig.
Drop JSDictionary::convertValue() overload taking a TouchList now that
TouchEvent is using a proper constructor with a TouchEventInit
dictionary on iOS.
* bindings/js/JSDictionary.cpp:
2016-10-18 Dean Jackson <dino@apple.com>
Remove CSS_SHAPES feature definition. This should always be on.
https://bugs.webkit.org/show_bug.cgi?id=163628
<rdar://problem/28834613>
Reviewed by Tim Horton.
CSS Shapes is in Candidate Recommendation. It's a core part
of CSS. It should always be enabled.
* Configurations/FeatureDefines.xcconfig:
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::shapePropertyValue):
(WebCore::ComputedStyleExtractor::propertyValue):
* css/CSSPropertyNames.in:
* css/CSSValueKeywords.in:
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertShapeValue):
* css/parser/CSSParser.cpp:
(WebCore::isSimpleLengthPropertyID):
(WebCore::CSSParser::parseValue):
(WebCore::CSSParser::parseShapeProperty):
* css/parser/CSSParser.h:
* inspector/InspectorOverlay.cpp:
(WebCore::buildObjectForShapeOutside):
(WebCore::buildObjectForElementData):
* page/animation/CSSPropertyAnimation.cpp:
(WebCore::blendFunc):
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
* rendering/FloatingObjects.cpp:
(WebCore::FindNextFloatLogicalBottomAdapter::collectIfNeeded):
(WebCore::ComputeFloatOffsetForLineLayoutAdapter<FloatingObject::FloatLeft>::updateOffsetIfNeeded):
(WebCore::ComputeFloatOffsetForLineLayoutAdapter<FloatingObject::FloatRight>::updateOffsetIfNeeded):
* rendering/RenderBlock.cpp:
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::positionNewFloats):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::~RenderBox):
(WebCore::RenderBox::styleDidChange):
(WebCore::RenderBox::updateShapeOutsideInfoAfterStyleChange):
(WebCore::isCandidateForOpaquenessTest):
(WebCore::RenderBox::imageChanged):
* rendering/RenderBox.h:
(WebCore::RenderBox::markShapeOutsideDependentsForLayout):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::~RenderElement):
(WebCore::RenderElement::updateShapeImage):
(WebCore::RenderElement::initializeStyle):
(WebCore::RenderElement::setStyle):
* rendering/RenderElement.h:
(WebCore::RenderElement::hasShapeOutside):
* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::canUseForWithReason):
* rendering/line/LineWidth.cpp:
(WebCore::LineWidth::shrinkAvailableWidthForNewFloatIfNeeded):
(WebCore::LineWidth::wrapNextToShapeOutside):
(WebCore::LineWidth::fitBelowFloats):
* rendering/line/LineWidth.h:
* rendering/shapes/ShapeOutsideInfo.cpp:
* rendering/shapes/ShapeOutsideInfo.h:
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::changeRequiresLayout):
(WebCore::RenderStyle::changeRequiresRepaint):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::initialShapeImageThreshold):
* rendering/style/ShapeValue.cpp:
* rendering/style/ShapeValue.h:
* rendering/style/StyleRareNonInheritedData.cpp:
(WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
(WebCore::StyleRareNonInheritedData::operator==):
* rendering/style/StyleRareNonInheritedData.h:
* style/StylePendingResources.cpp:
(WebCore::Style::loadPendingResources):
2016-10-18 Chris Dumez <cdumez@apple.com>
convertDictionary<>() no longer needs to return an Optional<> type
https://bugs.webkit.org/show_bug.cgi?id=163624
Reviewed by Sam Weinig.
convertDictionary<>() no longer needs to return an Optional<> type now
that our dictionary structures are all default constructible after
<https://trac.webkit.org/changeset/206974>.
* bindings/js/JSDOMConvert.h:
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateDictionaryHeaderContent):
(GenerateDictionaryImplementationContent):
* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
(WebCore::convertDictionary<TestEventConstructor::Init>):
* bindings/scripts/test/JS/JSTestEventConstructor.h:
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::convertDictionary<TestObj::Dictionary>):
(WebCore::convertDictionary<TestObj::DictionaryThatShouldNotTolerateNull>):
(WebCore::convertDictionary<TestObj::DictionaryThatShouldTolerateNull>):
(WebCore::convertDictionary<AlternateDictionaryName>):
(WebCore::convertDictionary<TestObj::ParentDictionary>):
(WebCore::convertDictionary<TestObj::ChildDictionary>):
* bindings/scripts/test/JS/JSTestObj.h:
* bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
(WebCore::convertDictionary<DictionaryImplName>):
* bindings/scripts/test/JS/JSTestStandaloneDictionary.h:
2016-10-18 Chris Dumez <cdumez@apple.com>
Leverage new union type support for HTMLSelectElement.add() / HTMLOptionsCollection.add()
https://bugs.webkit.org/show_bug.cgi?id=163608
Reviewed by Ryosuke Niwa.
Leverage new union type support for HTMLSelectElement.add() / HTMLOptionsCollection.add():
- https://html.spec.whatwg.org/#htmlselectelement
- https://html.spec.whatwg.org/#htmloptionscollection
No new tests, rebaseline existing test.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateDefaultValue):
(GenerateParametersCheck):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalSequenceIsEmptyCaller):
* bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
(WebCore::constructJSTestOverloadedConstructorsWithSequence1):
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
(WebCore::jsTestTypedefsPrototypeFunctionFuncCaller):
* html/HTMLOptGroupElement.idl:
* html/HTMLOptionsCollection.cpp:
(WebCore::HTMLOptionsCollection::add):
* html/HTMLOptionsCollection.h:
* html/HTMLOptionsCollection.idl:
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::add):
(WebCore::HTMLSelectElement::setOption):
(WebCore::HTMLSelectElement::setLength):
* html/HTMLSelectElement.h:
* html/HTMLSelectElement.idl:
2016-10-18 Aaron Chu <aaron_chu@apple.com>
Web Inspector: AXI: focused/focusable state should be based on Accessibility Object instead of Element
https://bugs.webkit.org/show_bug.cgi?id=163088
<rdar://problem/16421985>
Reviewed by Darin Adler.
Changed code in InspectDOMAgent so that it determines the focusability of a Node based
on the AccessibilityNodeObject and not the Element class.
Covered by existing tests:
LayoutTests/inspector/dom/getAccessibilityPropertiesForNode.html
* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
2016-10-18 Anders Carlsson <andersca@apple.com>
Get rid of more WebHistoryItem cruft
https://bugs.webkit.org/show_bug.cgi?id=163623
Reviewed by Tim Horton.
* history/HistoryItem.cpp:
(WebCore::HistoryItem::HistoryItem):
* history/HistoryItem.h:
(WebCore::HistoryItem::setViewportArguments):
(WebCore::HistoryItem::bookmarkID): Deleted.
(WebCore::HistoryItem::setBookmarkID): Deleted.
(WebCore::HistoryItem::sharedLinkUniqueIdentifier): Deleted.
(WebCore::HistoryItem::setSharedLinkUniqueIdentifier): Deleted.
2016-10-18 Dave Hyatt <hyatt@apple.com>
Fix Windows build.
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseSingleValue):
2016-10-18 Antoine Quint <graouts@apple.com>
Modern media controls don't update their rendering correctly
https://bugs.webkit.org/show_bug.cgi?id=163603
<rdar://problem/28826022>
Reviewed by Dean Jackson.
There are rendering issues when we use an absolutely-positioned element
as the top-most element in a media element's shadow root (webkit.org/b/163592).
Since we only need for that element to be positioned, we can use "position: relative"
instead, which removes the rendering issues.
* Modules/modern-media-controls/controls/media-controls.css:
(.media-controls):
(.media-controls,): Deleted.
2016-10-18 Dean Jackson <dino@apple.com>
Add preliminary support for extended colors to WebCore::Color
https://bugs.webkit.org/show_bug.cgi?id=162878
<rdar://problem/28596413>
Follow-up review comments from Darin Adler.
* html/canvas/CanvasGradient.cpp:
(WebCore::CanvasGradient::addColorStop): Use nullptr.
* platform/graphics/Color.cpp:
(WebCore::Color::Color): Explicitly zero before assigning the pointer.
* platform/graphics/Color.h: Add some comments about the failings of operator== and hash.
(WebCore::Color::Color): Add some static_asserts to the constructors. Move the empty and deleted values
to static constants.
(WebCore::Color::isHashTableDeletedValue):
(WebCore::Color::hash): Replacement for asUint64, which was only being used for a hash.
(WebCore::Color::asUint64): Deleted.
* platform/graphics/ColorHash.h: Use new hash functions. Use "using" instead of typedef.
(WTF::ColorHash::hash):
2016-10-18 Ryosuke Niwa <rniwa@webkit.org>
REGRESSION (r201471): Keyboard remains visible when swiping back on twitter.com
https://bugs.webkit.org/show_bug.cgi?id=163581
<rdar://problem/27739558>
Reviewed by Simon Fraser.
The bug was caused by Chrome::elementDidBlur not getting called, which resulted in
StopAssistingNode not getting sent to the UI process.
Test: fast/forms/ios/hide-keyboard-on-node-removal.html
* dom/Document.cpp:
(WebCore::Document::setFocusedElement): Restore the behavior prior to r201471 by calling
Chrome::elementDidBlur explicitly.
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::dispatchBlurEvent): Added a comment about ordering.
2016-10-17 Anders Carlsson <andersca@apple.com>
Move some history specific HistoryItem code to WebHistoryItem
https://bugs.webkit.org/show_bug.cgi?id=163567
Reviewed by Tim Horton.
* history/HistoryItem.cpp:
(WebCore::HistoryItem::addRedirectURL): Deleted.
(WebCore::HistoryItem::redirectURLs): Deleted.
(WebCore::HistoryItem::setRedirectURLs): Deleted.
* history/HistoryItem.h:
2016-10-18 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Get all the properties turned on
https://bugs.webkit.org/show_bug.cgi?id=163605
Reviewed by Dean Jackson.
* WebCore.xcodeproj/project.pbxproj:
* css/CSSFunctionValue.h:
* css/CSSPendingSubstitutionValue.cpp: Added.
(WebCore::CSSPendingSubstitutionValue::customCSSText):
* css/CSSPendingSubstitutionValue.h: Added.
(WebCore::CSSPendingSubstitutionValue::create):
(WebCore::CSSPendingSubstitutionValue::shorthandValue):
(WebCore::CSSPendingSubstitutionValue::shorthandPropertyId):
(WebCore::CSSPendingSubstitutionValue::equals):
(WebCore::CSSPendingSubstitutionValue::CSSPendingSubstitutionValue):
* css/CSSValue.cpp:
(WebCore::CSSValue::cssText):
(WebCore::CSSValue::destroy):
* css/CSSValue.h:
(WebCore::CSSValue::isPendingSubstitutionValue):
* css/CSSValueKeywords.in:
* css/StylePropertyShorthand.cpp:
(WebCore::transitionShorthandForParsing):
* css/StylePropertyShorthand.h:
* css/parser/CSSParser.cpp:
(WebCore::CSSParser::completeURL):
* css/parser/CSSParserImpl.cpp:
(WebCore::CSSParserImpl::parseValue):
(WebCore::CSSParserImpl::consumeDeclaration):
(WebCore::CSSParserImpl::consumeDeclarationValue):
* css/parser/CSSParserMode.h:
(WebCore::CSSParserContext::completeURL):
* css/parser/CSSParserToken.cpp:
(WebCore::CSSParserToken::parseAsCSSPropertyID):
(WebCore::CSSParserToken::parseAsUnresolvedCSSPropertyID): Deleted.
* css/parser/CSSParserToken.h:
* css/parser/CSSPropertyParser.cpp:
(WebCore::cssPropertyID):
(WebCore::CSSPropertyParser::addProperty):
(WebCore::CSSPropertyParser::addExpandedPropertyForValue):
(WebCore::CSSPropertyParser::parseValue):
(WebCore::CSSPropertyParser::parseSingleValue):
(WebCore::CSSPropertyParser::parseValueStart):
(WebCore::CSSPropertyParser::consumeCSSWideKeyword):
(WebCore::consumeTransformOrigin):
(WebCore::consumeWillChange):
(WebCore::consumeFontFeatureTag):
(WebCore::consumeFontFeatureSettings):
(WebCore::consumePage):
(WebCore::consumeQuotes):
(WebCore::FontVariantLigaturesParser::consumeLigature):
(WebCore::FontVariantLigaturesParser::finalizeValue):
(WebCore::consumeFontVariantLigatures):
(WebCore::consumeFontVariantCaps):
(WebCore::FontVariantNumericParser::consumeNumeric):
(WebCore::FontVariantNumericParser::finalizeValue):
(WebCore::consumeFontVariantNumeric):
(WebCore::consumeFontVariantCSS21):
(WebCore::consumeFontVariantList):
(WebCore::consumeFontWeight):
(WebCore::consumeFamilyName):
(WebCore::consumeGenericFamily):
(WebCore::consumeFontFamily):
(WebCore::consumeSpacing):
(WebCore::consumeTabSize):
(WebCore::consumeTextSizeAdjust):
(WebCore::consumeFontSize):
(WebCore::consumeLineHeight):
(WebCore::createPrimitiveValuePair):
(WebCore::consumeCounter):
(WebCore::consumePageSize):
(WebCore::consumeSize):
(WebCore::consumeTextIndent):
(WebCore::validWidthOrHeightKeyword):
(WebCore::consumeMaxWidthOrHeight):
(WebCore::consumeWidthOrHeight):
(WebCore::consumeMarginOrOffset):
(WebCore::consumeClipComponent):
(WebCore::consumeClip):
(WebCore::consumeTouchAction):
(WebCore::consumeLineClamp):
(WebCore::consumeLocale):
(WebCore::consumeColumnWidth):
(WebCore::consumeColumnCount):
(WebCore::consumeColumnGap):
(WebCore::consumeColumnSpan):
(WebCore::consumeZoom):
(WebCore::consumeAnimationIterationCount):
(WebCore::consumeAnimationName):
(WebCore::consumeTransitionProperty):
(WebCore::consumeCubicBezier):
(WebCore::consumeAnimationTimingFunction):
(WebCore::consumeAnimationValue):
(WebCore::isValidAnimationPropertyList):
(WebCore::consumeAnimationPropertyList):
(WebCore::CSSPropertyParser::consumeAnimationShorthand):
(WebCore::consumeZIndex):
(WebCore::parseSingleShadow):
(WebCore::consumeShadow):
(WebCore::consumeFilterFunction):
(WebCore::consumeFilter):
(WebCore::consumeTextDecorationLine):
(WebCore::consumeTextEmphasisStyle):
(WebCore::consumeOutlineColor):
(WebCore::consumeLineWidth):
(WebCore::consumeBorderWidth):
(WebCore::consumeTextStrokeWidth):
(WebCore::consumeColumnRuleWidth):
(WebCore::consumeTranslate3d):
(WebCore::consumeNumbers):
(WebCore::consumePerspective):
(WebCore::consumeTransformValue):
(WebCore::consumeTransform):
(WebCore::consumePositionLonghand):
(WebCore::consumePositionX):
(WebCore::consumePositionY):
(WebCore::consumePaintStroke):
(WebCore::consumePaintOrder):
(WebCore::consumeNoneOrURI):
(WebCore::consumeFlexBasis):
(WebCore::consumeStrokeDasharray):
(WebCore::consumeBaselineShift):
(WebCore::consumeRxOrRy):
(WebCore::consumeCursor):
(WebCore::consumeAttr):
(WebCore::consumeCounterContent):
(WebCore::consumeContent):
(WebCore::consumePositionList):
(WebCore::consumeScrollSnapCoordinate):
(WebCore::consumeScrollSnapPoints):
(WebCore::consumeBorderRadiusCorner):
(WebCore::consumeVerticalAlign):
(WebCore::consumeShapeRadius):
(WebCore::consumeBasicShapeCircle):
(WebCore::consumeBasicShapeEllipse):
(WebCore::consumeBasicShapePolygon):
(WebCore::complete4Sides):
(WebCore::consumeRadii):
(WebCore::consumeBasicShapeInset):
(WebCore::consumeBasicShape):
(WebCore::consumeWebkitClipPath):
(WebCore::consumeShapeOutside):
(WebCore::consumeContentDistributionOverflowPosition):
(WebCore::consumeBorderImageRepeatKeyword):
(WebCore::consumeBorderImageRepeat):
(WebCore::consumeBorderImageSlice):
(WebCore::consumeBorderImageOutset):
(WebCore::consumeBorderImageWidth):
(WebCore::consumeBorderImageComponents):
(WebCore::consumeWebkitBorderImage):
(WebCore::consumeReflect):
(WebCore::consumeImageOrientation):
(WebCore::consumeBackgroundBlendMode):
(WebCore::consumeBackgroundAttachment):
(WebCore::consumeBackgroundBox):
(WebCore::consumeBackgroundComposite):
(WebCore::consumePrefixedBackgroundBox):
(WebCore::consumeBackgroundSize):
(WebCore::consumeGridAutoFlow):
(WebCore::consumeBackgroundComponent):
(WebCore::addBackgroundValue):
(WebCore::consumeCommaSeparatedBackgroundComponent):
(WebCore::consumeSelfPositionKeyword):
(WebCore::consumeSelfPositionOverflowPosition):
(WebCore::consumeAlignItems):
(WebCore::consumeJustifyItems):
(WebCore::consumeFitContent):
(WebCore::consumeCustomIdentForGridLine):
(WebCore::consumeGridLine):
(WebCore::isGridTrackFixedSized):
(WebCore::consumeGridBreadth):
(WebCore::consumeGridTrackSize):
(WebCore::consumeGridLineNames):
(WebCore::consumeGridTrackRepeatFunction):
(WebCore::consumeGridTrackList):
(WebCore::consumeGridTemplatesRowsOrColumns):
(WebCore::consumeGridTemplateAreas):
(WebCore::consumeFontFaceUnicodeRange):
(WebCore::consumeFontFaceSrcURI):
(WebCore::consumeFontFaceSrcLocal):
(WebCore::consumeFontFaceSrc):
(WebCore::CSSPropertyParser::parseFontFaceDescriptor):
(WebCore::CSSPropertyParser::consumeSystemFont):
(WebCore::CSSPropertyParser::consumeFont):
(WebCore::CSSPropertyParser::consumeFontVariantShorthand):
(WebCore::CSSPropertyParser::consumeBorderSpacing):
(WebCore::consumeSingleViewportDescriptor):
(WebCore::CSSPropertyParser::parseViewportDescriptor):
(WebCore::consumeColumnWidthOrCount):
(WebCore::CSSPropertyParser::consumeColumns):
(WebCore::CSSPropertyParser::consumeShorthandGreedily):
(WebCore::CSSPropertyParser::consumeFlex):
(WebCore::CSSPropertyParser::consumeBorder):
(WebCore::CSSPropertyParser::consume4Values):
(WebCore::CSSPropertyParser::consumeBorderImage):
(WebCore::CSSPropertyParser::consumeLegacyBreakProperty):
(WebCore::consumeBackgroundPosition):
(WebCore::consumeRepeatStyleComponent):
(WebCore::consumeRepeatStyle):
(WebCore::CSSPropertyParser::consumeBackgroundShorthand):
(WebCore::CSSPropertyParser::consumeGridItemPositionShorthand):
(WebCore::CSSPropertyParser::consumeGridAreaShorthand):
(WebCore::CSSPropertyParser::consumeGridTemplateRowsAndAreasAndColumns):
(WebCore::CSSPropertyParser::consumeGridTemplateShorthand):
(WebCore::CSSPropertyParser::consumeGridShorthand):
(WebCore::CSSPropertyParser::parseShorthand):
(WebCore::unresolvedCSSPropertyID): Deleted.
* css/parser/CSSPropertyParser.h:
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::consumeIdent):
(WebCore::CSSPropertyParserHelpers::consumeCustomIdent):
(WebCore::CSSPropertyParserHelpers::consumeString):
(WebCore::CSSPropertyParserHelpers::consumeImageSet):
* css/parser/CSSPropertyParserHelpers.h:
2016-10-18 Brent Fulgham <bfulgham@apple.com>
Correct Document::removeAllEventListeners
https://bugs.webkit.org/show_bug.cgi?id=163558
<rdar://problem/28716840>
Reviewed by Chris Dumez.
Tested by fast/dom/node-move-to-new-document-crash-main.html.
* dom/Document.cpp:
(WebCore::Document::removeAllEventListeners): Clear out the wheel and
touch event targets when clearing all data.
2016-10-18 Dean Jackson <dino@apple.com>
Remove dependency cycle with UIKit
https://bugs.webkit.org/show_bug.cgi?id=163577
<rdar://problem/28786160>
Reviewed by Tim Horton.
Soft link against UIKit. Followup patch because
I screwed up and forgot to edit the simulator
configuration.
* Configurations/WebCoreTestSupport.xcconfig:
2016-10-18 Said Abou-Hallawa <sabouhallawa@apple.com>
SVGCSSParser: m_implicitShorthand value is not reset after adding the shorthand property
https://bugs.webkit.org/show_bug.cgi?id=116470
Reviewed by Simon Fraser.
When we encounter a shorthand css property, we set m_implicitShorthand
to true to tell addProperty() later that the individual properties are
all set through a short hand one. We need to make sure that setting
m_implicitShorthand to true will not be leaked after finishing parsing
the short hand property.
Test: fast/css/implicit-property-restore.html
* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parseValue):
(WebCore::CSSParser::parseFillShorthand):
(WebCore::CSSParser::parseShorthand):
(WebCore::CSSParser::parse4Values):
(WebCore::CSSParser::parseBorderRadius):
(WTF::ImplicitScope::ImplicitScope): Deleted.
(WTF::ImplicitScope::~ImplicitScope): Deleted.
Get rid of ImplicitScope and replace its calls by TemporaryChange<bool>.
* css/parser/SVGCSSParser.cpp:
(WebCore::CSSParser::parseSVGValue):
Restore m_implicitShorthand value after setting it temporarily to true.
2016-10-18 Chris Dumez <cdumez@apple.com>
Update TrackEvent to stop using legacy [ConstructorTemplate=Event]
https://bugs.webkit.org/show_bug.cgi?id=163580
Reviewed by Sam Weinig.
Update TrackEvent to stop using legacy [ConstructorTemplate=Event]
and use a regular constructor as in the specification:
- https://html.spec.whatwg.org/#the-trackevent-interface
No new tests, updated existing tests.
* html/track/TrackEvent.cpp:
(WebCore::TrackEvent::TrackEvent):
* html/track/TrackEvent.h:
* html/track/TrackEvent.idl:
2016-10-18 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r207409.
https://bugs.webkit.org/show_bug.cgi?id=163602
Introduced many test failures and timeouts, causing release
bot to exit early (Requested by mcatanzaro on #webkit).
Reverted changeset:
"[GTK] Several tests crashing on debug bot in (anonymous
namespace)::MediaPlayerPrivateGStreamerBase::repaint"
https://bugs.webkit.org/show_bug.cgi?id=163511
http://trac.webkit.org/changeset/207409
2016-10-18 Eric Carlson <eric.carlson@apple.com>
[MediaStream] Resolve constraints and enumerate devices in the UI process
https://bugs.webkit.org/show_bug.cgi?id=162147
<rdar://problem/28803569>
Reviewed by Darin Adler.
Restructure gUM constraint validation and MediaDevices.enumerateDevices so all media device
access happens in the UI process.
No new tests, updated results of existing tests.
* CMakeLists.txt: Add MediaDevicesEnumerationRequest.cpp, delete UserMediaPermissionCheck.cpp.
* Modules/mediastream/MediaConstraintsImpl.cpp:
(WebCore::MediaConstraintsImpl::create): Only create from MediaConstraintsData.
(WebCore::MediaConstraintsImpl::initialize): Deleted.
* Modules/mediastream/MediaConstraintsImpl.h:
* Modules/mediastream/MediaDevicesEnumerationRequest.cpp: Added.
(WebCore::MediaDevicesEnumerationRequest::create):
(WebCore::MediaDevicesEnumerationRequest::MediaDevicesEnumerationRequest):
(WebCore::MediaDevicesEnumerationRequest::~MediaDevicesEnumerationRequest):
(WebCore::MediaDevicesEnumerationRequest::userMediaDocumentOrigin):
(WebCore::MediaDevicesEnumerationRequest::topLevelDocumentOrigin):
(WebCore::MediaDevicesEnumerationRequest::contextDestroyed):
(WebCore::MediaDevicesEnumerationRequest::start):
(WebCore::MediaDevicesEnumerationRequest::cancel):
(WebCore::MediaDevicesEnumerationRequest::setDeviceInfo):
(WebCore::MediaDevicesEnumerationRequest::finish):
* Modules/mediastream/MediaDevicesEnumerationRequest.h: Added.
* Modules/mediastream/MediaDevicesRequest.cpp:
(WebCore::MediaDevicesRequest::~MediaDevicesRequest): Clear the enumeration request.
(WebCore::MediaDevicesRequest::contextDestroyed): Ditto.
(WebCore::MediaDevicesRequest::start): Create and use a MediaDevicesEnumerationRequest.
(WebCore::MediaDevicesRequest::didCompletePermissionCheck): Deleted.
* Modules/mediastream/MediaDevicesRequest.h:
* Modules/mediastream/UserMediaClient.h:
* Modules/mediastream/UserMediaController.h:
(WebCore::UserMediaController::enumerateMediaDevices): New.
(WebCore::UserMediaController::cancelMediaDevicesEnumerationRequest): New.
(WebCore::UserMediaController::checkUserMediaPermission): Deleted.
(WebCore::UserMediaController::cancelUserMediaPermissionCheck): Deleted.
* Modules/mediastream/UserMediaPermissionCheck.h: Deleted.
* Modules/mediastream/UserMediaPermissionCheck.cpp: Deleted.
* Modules/mediastream/UserMediaRequest.cpp:
(WebCore::UserMediaRequest::UserMediaRequest):
(WebCore::UserMediaRequest::start):
(WebCore::UserMediaRequest::allow):
(WebCore::UserMediaRequest::deny):
(WebCore::UserMediaRequest::constraintsValidated): Deleted.
(WebCore::UserMediaRequest::userMediaAccessGranted): Deleted.
(WebCore::UserMediaRequest::userMediaAccessDenied): Deleted.
(WebCore::UserMediaRequest::constraintsInvalid): Deleted.
(WebCore::UserMediaRequest::didCreateStream): Deleted.
(WebCore::UserMediaRequest::failedToCreateStreamWithConstraintsError): Deleted.
(WebCore::UserMediaRequest::failedToCreateStreamWithPermissionError): Deleted.
* Modules/mediastream/UserMediaRequest.h:
* WebCore.xcodeproj/project.pbxproj: Add MediaDevicesEnumerationRequest.*.
* platform/mediastream/CaptureDevice.h:
(WebCore::CaptureDevice::CaptureDevice):
(WebCore::CaptureDevice::setPersistentId): Add setter for argument decoder.
(WebCore::CaptureDevice::setLabel): Ditto.
(WebCore::CaptureDevice::setGroupId): Ditto.
(WebCore::CaptureDevice::setKind): Ditto.
* platform/mediastream/CaptureDeviceManager.h: Remove unnecessary include.
* platform/mediastream/MediaConstraints.h:
(WebCore::MediaConstraint::encode): New.
(WebCore::MediaConstraint::decode): Ditto.
(WebCore::NumericConstraint::encode): Ditto.
(WebCore::NumericConstraint::decode): Ditto.
* platform/mediastream/MediaStreamCreationClient.h: Deleted.
* platform/mediastream/RealtimeMediaSourceCenter.h: Use completion handlers instead of client interface.
* platform/mediastream/mac/AVCaptureDeviceManager.mm:
(WebCore::AVCaptureDeviceManager::refreshCaptureDeviceList): Drive-by fix: don't initialize
group id, we don't support it.
* platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
(WebCore::RealtimeMediaSourceCenterMac::validateRequestConstraints): Update for interface change.
(WebCore::RealtimeMediaSourceCenterMac::createMediaStream): Ditto.
* platform/mediastream/mac/RealtimeMediaSourceCenterMac.h:
* platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp:
(WebCore::RealtimeMediaSourceCenterOwr::validateRequestConstraints): Ditto.
(WebCore::RealtimeMediaSourceCenterOwr::createMediaStream): Ditto.
(WebCore::RealtimeMediaSourceCenterOwr::mediaSourcesAvailable): Ditto.
* platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.h:
* platform/mock/MockRealtimeMediaSourceCenter.cpp:
(WebCore::MockRealtimeMediaSourceCenter::validateRequestConstraints): Ditto.
(WebCore::MockRealtimeMediaSourceCenter::createMediaStream): Ditto.
* platform/mock/MockRealtimeMediaSourceCenter.h:
2016-10-18 Zan Dobersek <zdobersek@igalia.com>
[WebIDL] Support BufferSource
https://bugs.webkit.org/show_bug.cgi?id=163541
Reviewed by Youenn Fablet.
Add support for the BufferSource typedef in WebIDL. The implementation
adds the necessary handling for this type in the generator scripts and
the specialization of the Converter<> template for the IDLBufferSource
struct that enables exposing ArrayBuffer or ArrayBufferView objects by
having WebCore::BufferSource objects pointing to their data.
The SourceBuffer interface in the MSE module has the appendBuffer()
operation modified to accept a BufferSource parameter, instead of
overloading it for ArrayBuffer and ArrayBufferView parameters.
The bindings generator tests cover BufferSource as both an operation
parameter and as a dictionary member.
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::appendBuffer):
(WebCore::SourceBuffer::appendBufferInternal):
* Modules/mediasource/SourceBuffer.h:
* Modules/mediasource/SourceBuffer.idl:
* WebCore.xcodeproj/project.pbxproj:
* bindings/generic/IDLTypes.h:
* bindings/js/BufferSource.h: Added.
* bindings/js/JSDOMConvert.h:
(WebCore::Converter<IDLBufferSource>::convert):
* bindings/scripts/CodeGenerator.pm:
(SkipIncludeHeader):
(IsWrapperType):
* bindings/scripts/CodeGeneratorJS.pm:
(AddClassForwardIfNeeded):
(GetBaseIDLType):
(IsHandledByDOMConvert):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::convertDictionary<TestObj::Dictionary>):
(WebCore::jsTestObjPrototypeFunctionBufferSourceParameter):
(WebCore::jsTestObjPrototypeFunctionBufferSourceParameterCaller):
* bindings/scripts/test/TestObj.idl:
2016-10-18 Javier Fernandez <jfernandez@igalia.com>
[css-grid] Different width of grid container between initial load and refresh
https://bugs.webkit.org/show_bug.cgi?id=163535
Reviewed by Manuel Rego Casasnovas.
Grid's layout logic manages two different override sizes; one it's
designed to implement the grid item's stretching behavior, identified
with the concept of 'overrideContentLogicalSize'; there is another
override size, known as overrideContainingBlockContentLogicalSize,
used to implement the Grid Area abstraction, which will behave as
the actual containing block of any grid item.
During grid's layout logic these override sizes are set according
to the CSS style rules. This affects how the grid container and its
children are going to be sized during layout. Grid Tracks sizing
algorithm depends on these override sizes.
In order to ensure that the tracks sizing algorithm produces the
same results when it's run consecutively several times, we need to
clear these override sizes and perform a layout of the affected grid
items. Otherwise, the affected items will return sizing values which
depend on the override values set in the previous layout, which in
some cases, like orthogonal flows, may change through different runs
of the sizing algorithm.
Test: fast/css-grid-layout/repeating-layout-must-produce-the-same-results.html
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::layoutBlock):
2016-10-18 Youenn Fablet <youenn@apple.com>
CachedResourceLoader should not need to remove fragment identifier
https://bugs.webkit.org/show_bug.cgi?id=163015
Reviewed by Darin Adler.
No expected change for non-window port.
For window port, CachedResourceLoader will strip the fragment identifier of the URL passed to subresourceForURL
before querying the memory cache.
Removing the fragment identifier from the request stored in CachedResourceRequest.
The fragment identifier is stored in a separate field.
This allows CachedResourceLoader to not care about fragment identifier.
CachedResource can then get access to it.
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::CachedResource):
(WebCore::CachedResource::finishRequestInitialization): Deleted.
* loader/cache/CachedResource.h:
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::cachedResource):
Updated the method taking a const String& to strip the fragment identifier if needed.
Updated the method taking a const URL& to assert if the fragment identifier is present.
(WebCore::CachedResourceLoader::requestUserCSSStyleSheet):
(WebCore::CachedResourceLoader::requestResource):
* loader/cache/CachedResourceRequest.cpp:
(WebCore::CachedResourceRequest::CachedResourceRequest):
(WebCore::CachedResourceRequest::splitFragmentIdentifierFromRequestURL):
* loader/cache/CachedResourceRequest.h:
(WebCore::CachedResourceRequest::releaseFragmentIdentifier):
(WebCore::CachedResourceRequest::clearFragmentIdentifier):
* loader/cache/MemoryCache.cpp:
(WebCore::MemoryCache::shouldRemoveFragmentIdentifier):
(WebCore::MemoryCache::removeFragmentIdentifierIfNeeded):
(WebCore::MemoryCache::revalidationSucceeded):
(WebCore::MemoryCache::resourceForRequest):
* loader/cache/MemoryCache.h:
2016-10-18 Antti Koivisto <antti@apple.com>
Rename setNeedsStyleRecalc to invalidateStyle
https://bugs.webkit.org/show_bug.cgi?id=163542
Reviewed by Darin Adler.
Also rename StyleChangeType enum and some related functions for clarity. For example
element.setNeedsStyleRecalc(SyntheticStyleChange);
becomes
element.invalidateStyleAndLayerComposition();
* WebCore.xcodeproj/project.pbxproj:
* css/StyleInvalidationAnalysis.cpp:
(WebCore::StyleInvalidationAnalysis::invalidateIfNeeded):
* dom/Document.cpp:
(WebCore::Document::recalcStyle):
(WebCore::Document::updateViewportUnitsOnResize):
(WebCore::Document::setCSSTarget):
(WebCore::unwrapFullScreenRenderer):
(WebCore::Document::setAnimatingFullScreen):
* dom/Element.cpp:
(WebCore::Element::setActive):
(WebCore::Element::setFocus):
(WebCore::Element::setHovered):
(WebCore::Element::attributeChanged):
(WebCore::Element::invalidateStyle):
(WebCore::Element::invalidateStyleAndLayerComposition):
(WebCore::Element::invalidateStyleForSubtree):
(WebCore::Element::invalidateStyleAndRenderersForSubtree):
Move public invalidation functions to Element tightening typing.
Use separate functions instead of enum values.
This way the call sites look nicer and only useful combinations are exposed.
(WebCore::Element::addShadowRoot):
(WebCore::checkForEmptyStyleChange):
(WebCore::checkForSiblingStyleChanges):
(WebCore::Element::needsStyleInvalidation):
(WebCore::Element::setContainsFullScreenElement):
* dom/Element.h:
(WebCore::Element::setHasFocusWithin):
* dom/Node.cpp:
(WebCore::computeEditabilityFromComputedStyle):
(WebCore::Node::adjustStyleValidity):
Update validity and mode separately. There was a potential bug here where
SyntheticStyleChange could overwrite FullStyleChange (no known repro).
(WebCore::Node::updateAncestorsForStyleRecalc):
(WebCore::Node::invalidateStyle):
(WebCore::Node::insertedInto):
(WebCore::Node::setNeedsStyleRecalc): Deleted.
* dom/Node.h:
(WebCore::Node::needsStyleRecalc):
(WebCore::Node::styleValidity):
(WebCore::Node::styleResolutionShouldRecompositeLayer):
(WebCore::Node::setHasValidStyle):
(WebCore::Node::styleChangeType): Deleted.
(WebCore::Node::clearNeedsStyleRecalc): Deleted.
(WebCore::Node::setStyleChange): Deleted.
* dom/RadioButtonGroups.cpp:
(WebCore::RadioButtonGroup::remove):
(WebCore::RadioButtonGroup::setNeedsStyleRecalcForAllButtons):
* dom/ShadowRoot.cpp:
(WebCore::ShadowRoot::setResetStyleInheritance):
* dom/SlotAssignment.cpp:
(WebCore::SlotAssignment::addSlotElementByName):
(WebCore::SlotAssignment::removeSlotElementByName):
(WebCore::SlotAssignment::didChangeSlot):
* dom/StyledElement.cpp:
(WebCore::StyledElement::attributeChanged):
(WebCore::StyledElement::styleAttributeChanged):
(WebCore::StyledElement::invalidateStyleAttribute):
* dom/Text.cpp:
(WebCore::Text::updateRendererAfterContentChange):
* dom/VisitedLinkState.cpp:
(WebCore::VisitedLinkState::invalidateStyleForAllLinks):
(WebCore::VisitedLinkState::invalidateStyleForLink):
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::focusedOrActiveStateChanged):
* html/BaseDateAndTimeInputType.cpp:
(WebCore::BaseDateAndTimeInputType::minOrMaxAttributeChanged):
* html/FileInputType.cpp:
(WebCore::FileInputType::setValue):
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::parseAttribute):
* html/HTMLBodyElement.cpp:
(WebCore::HTMLBodyElement::parseAttribute):
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::getContext):
(WebCore::HTMLCanvasElement::createImageBuffer):
* html/HTMLElement.cpp:
(WebCore::HTMLElement::adjustDirectionalityIfNeededAfterChildAttributeChanged):
(WebCore::HTMLElement::calculateAndAdjustDirectionality):
* html/HTMLFieldSetElement.cpp:
(WebCore::HTMLFieldSetElement::addInvalidDescendant):
(WebCore::HTMLFieldSetElement::removeInvalidDescendant):
* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::disabledStateChanged):
(WebCore::HTMLFormControlElement::readOnlyAttributeChanged):
(WebCore::HTMLFormControlElement::requiredAttributeChanged):
(WebCore::HTMLFormControlElement::setNeedsWillValidateCheck):
(WebCore::HTMLFormControlElement::updateValidity):
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::registerFormElement):
(WebCore::HTMLFormElement::registerInvalidAssociatedFormControl):
(WebCore::HTMLFormElement::removeInvalidAssociatedFormControlIfNeeded):
(WebCore::HTMLFormElement::resetDefaultButton):
* html/HTMLFrameElementBase.cpp:
(WebCore::HTMLFrameElementBase::finishedInsertingSubtree):
* html/HTMLFrameOwnerElement.cpp:
(WebCore::HTMLFrameOwnerElement::scheduleinvalidateStyleAndLayerComposition):
(WebCore::HTMLFrameOwnerElement::scheduleSetNeedsStyleRecalc): Deleted.
* html/HTMLFrameOwnerElement.h:
* html/HTMLFrameSetElement.cpp:
(WebCore::HTMLFrameSetElement::parseAttribute):
(WebCore::HTMLFrameSetElement::willRecalcStyle):
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::runPostTypeUpdateTasks):
(WebCore::HTMLInputElement::parseAttribute):
(WebCore::HTMLInputElement::setChecked):
(WebCore::HTMLInputElement::setIndeterminate):
(WebCore::HTMLInputElement::setAutoFilled):
(WebCore::HTMLInputElement::maxLengthAttributeChanged):
(WebCore::HTMLInputElement::minLengthAttributeChanged):
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::parseAttribute):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaPlayerRenderingModeChanged):
(WebCore::HTMLMediaElement::setVideoFullscreenLayer):
* html/HTMLObjectElement.cpp:
(WebCore::HTMLObjectElement::parseAttribute):
(WebCore::HTMLObjectElement::childrenChanged):
(WebCore::HTMLObjectElement::renderFallbackContent):
* html/HTMLOptGroupElement.cpp:
(WebCore::HTMLOptGroupElement::parseAttribute):
* html/HTMLOptionElement.cpp:
(WebCore::HTMLOptionElement::parseAttribute):
(WebCore::HTMLOptionElement::setSelectedState):
* html/HTMLPlugInElement.cpp:
(WebCore::HTMLPlugInElement::didAddUserAgentShadowRoot):
* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::setDisplayState):
(WebCore::HTMLPlugInImageElement::willRecalcStyle):
(WebCore::HTMLPlugInImageElement::finishParsingChildren):
(WebCore::HTMLPlugInImageElement::resumeFromDocumentSuspension):
(WebCore::HTMLPlugInImageElement::removeSnapshotTimerFired):
(WebCore::HTMLPlugInImageElement::restartSnapshottedPlugIn):
* html/HTMLProgressElement.cpp:
(WebCore::HTMLProgressElement::didElementStateChange):
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::parseAttribute):
(WebCore::HTMLSelectElement::setRecalcListItems):
(WebCore::HTMLSelectElement::parseMultipleAttribute):
(WebCore::HTMLSelectElement::reset):
* html/HTMLTableElement.cpp:
(WebCore::isTableCellAncestor):
(WebCore::setTableCellsChanged):
(WebCore::HTMLTableElement::parseAttribute):
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::setValueCommon):
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::updatePlaceholderVisibility):
* html/InputType.cpp:
(WebCore::InputType::setValue):
* html/NumberInputType.cpp:
(WebCore::NumberInputType::minOrMaxAttributeChanged):
* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::subtreeHasChanged):
* mathml/MathMLElement.cpp:
(WebCore::MathMLElement::parseAttribute):
* mathml/MathMLSelectElement.cpp:
(WebCore::MathMLSelectElement::updateSelectedChild):
* page/animation/AnimationBase.cpp:
(WebCore::AnimationBase::setNeedsStyleRecalc):
* page/animation/AnimationController.cpp:
(WebCore::AnimationControllerPrivate::clear):
(WebCore::AnimationControllerPrivate::updateAnimations):
(WebCore::AnimationControllerPrivate::fireEventsAndUpdateStyle):
(WebCore::AnimationControllerPrivate::pauseAnimationAtTime):
(WebCore::AnimationControllerPrivate::pauseTransitionAtTime):
(WebCore::AnimationController::cancelAnimations):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::imageChanged):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::calculateClipRects):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::attachRootLayer):
(WebCore::RenderLayerCompositor::detachRootLayer):
(WebCore::RenderLayerCompositor::notifyIFramesOfCompositingChange):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::updateDragState):
* rendering/svg/SVGResourcesCache.cpp:
(WebCore::SVGResourcesCache::clientStyleChanged):
* style/AttributeChangeInvalidation.cpp:
(WebCore::Style::AttributeChangeInvalidation::invalidateStyle):
* style/ClassChangeInvalidation.cpp:
(WebCore::Style::ClassChangeInvalidation::invalidateStyle):
* style/IdChangeInvalidation.cpp:
(WebCore::Style::IdChangeInvalidation::invalidateStyle):
* style/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::updateElementRenderer):
* style/StyleScope.cpp:
(WebCore::Style::Scope::updateActiveStyleSheets):
* style/StyleTreeResolver.cpp:
(WebCore::Style::resetStyleForNonRenderedDescendants):
(WebCore::Style::TreeResolver::resolveElement):
(WebCore::Style::TreeResolver::createAnimatedElementUpdate):
(WebCore::Style::TreeResolver::popParent):
(WebCore::Style::clearNeedsStyleResolution):
(WebCore::Style::TreeResolver::resolveComposedTree):
* style/StyleUpdate.h:
* style/StyleValidity.h: Added.
StyleChangeType enum splits into Style::Validity and Style::InvalidationMode.
Move to a file of its own.
* svg/SVGAElement.cpp:
(WebCore::SVGAElement::svgAttributeChanged):
* svg/SVGAnimateElementBase.cpp:
(WebCore::applyCSSPropertyToTarget):
(WebCore::removeCSSPropertyFromTarget):
* svg/SVGElement.cpp:
(WebCore::SVGElement::willRecalcStyle):
* svg/SVGElement.h:
(WebCore::SVGElement::invalidateSVGPresentationAttributeStyle):
* svg/SVGTests.cpp:
(WebCore::SVGTests::handleAttributeChange):
* svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::invalidateShadowTree):
* testing/Internals.cpp:
(WebCore::styleValidityToToString):
(WebCore::Internals::styleChangeType):
(WebCore::styleChangeTypeToString): Deleted.
2016-10-17 Sergio Villar Senin <svillar@igalia.com>
[css-grid] Constrain by min|max-height on auto repeat computation
https://bugs.webkit.org/show_bug.cgi?id=163540
Reviewed by Darin Adler.
The max-height (if definite) is used to compute the number of auto repeat rows whenever the
height is indefinite. We were using the min-height only in case both values were indefinite.
Although not explicitly mentioned by grid specs, it's reasonable to assume that
the min-height trumps the used value of height/max-height like it always does, per CSS
2.2. Note that the number of rows still needs to fit within that size even if using
min-height, because we're just using min-height to compute the used value of the height
property. If both height and max-height are indefinite we keep doing the same, i.e., compute
the minimum number of rows that fulfill min-height (if definite).
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::computeAutoRepeatTracksCount):
2016-10-17 Yusuke Suzuki <utatane.tea@gmail.com>
[DOMJIT] Use NativeCallFrameTracer for operations used for DOMJIT slow calls
https://bugs.webkit.org/show_bug.cgi?id=163586
Reviewed by Saam Barati.
* domjit/JSNodeDOMJIT.cpp:
(WebCore::toWrapperSlow):
2016-10-18 Ryuan Choi <ryuan.choi@navercorp.com>
[EFL] Build break since r207442
https://bugs.webkit.org/show_bug.cgi?id=163587
Unreviewed.
Since r207442, setRGB is moved to private.
* rendering/RenderThemeEfl.cpp:
(WebCore::fillColorsFromEdjeClass):
2016-10-17 Dean Jackson <dino@apple.com>
Remove dependency cycle with UIKit
https://bugs.webkit.org/show_bug.cgi?id=163577
<rdar://problem/28786160>
Reviewed by Tim Horton.
Soft link against UIKit.
* Configurations/WebCoreTestSupport.xcconfig:
* testing/Internals.mm:
2016-10-17 Dean Jackson <dino@apple.com>
Allow creation of ExtendedColors and make Color immutable
https://bugs.webkit.org/show_bug.cgi?id=163557
<rdar://problem/28805360>
Reviewed by Darin Adler and Dave Hyatt.
1. Support the creation of ExtendedColor objects via the
Color class.
2. Fix the remaining few places where a Color object is
modified after creation, instead creating a new Color.
Move all the mutation methods into the private section,
making Color now immutable.
Changes to Color are covered by existing tests. Changes
to ExtendedColor are covered by the ExtendedColor API test.
* css/parser/CSSParser.cpp:
(WebCore::CSSParser::fastParseColor): Return a new named Color.
* dom/Document.cpp:
(WebCore::Document::resetActiveLinkColor): Set to be the named "red" color.
* html/HTMLElement.cpp:
(WebCore::HTMLElement::addHTMLColorToStyle): Use the string-based constructor
where possible.
* page/CaptionUserPreferencesMediaAF.cpp:
(WebCore::CaptionUserPreferencesMediaAF::captionsTextEdgeCSS): No need to
use the string "black" here - we have a constant value.
* platform/graphics/cairo/GraphicsContextCairo.cpp: Don't use setRGB.
* platform/graphics/Color.cpp:
(WebCore::findNamedColor): Move this up in the file.
(WebCore::Color::Color): Copy in the code from setNamedColor. Also
add a constructor for ExtendedColor.
(WebCore::Color::serialized): Call ExtendedColor's serializer if necessary.
(WebCore::Color::cssText): Ditto.
(WebCore::Color::setNamedColor): Deleted.
(WebCore::Color::tagAsExtended): Deleted.
* platform/graphics/Color.h: Add a new constructor.
(WebCore::Color::setRGB): Move to private.
* platform/graphics/ExtendedColor.cpp:
(WebCore::ExtendedColor::cssText): Implement serializer.
* platform/graphics/ExtendedColor.h:
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::colorIncludingFallback): Construct a new Color rather than changing an existing object.
2016-10-17 Simon Fraser <simon.fraser@apple.com>
Implement DOMRect/DOMRectReadOnly
https://bugs.webkit.org/show_bug.cgi?id=163464
Reviewed by Darin Adler.
Implement the DOMRectInit/DOMRectReadOnly/DOMRect interfaces specified in
https://dev.w3.org/fxtf/geometry/
DOMRects allow negative height/width and require double storage, so we can't just
use FloatRect for storage. They also require handling of NaN and Infinity.
To have the left/right/top/bottom accessors follow IEEE NaN rules, we need to use
custom min/max functions that return NaN if either argument is NaN, so add
nanPropagatingMin/nanPropagatingMax helpers to MathExtras.h.
Test: fast/dom/domrect.html
* CMakeLists.txt:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* dom/DOMRect.h: Added.
(WebCore::DOMRect::create):
(WebCore::DOMRect::fromRect):
(WebCore::DOMRect::setX):
(WebCore::DOMRect::setY):
(WebCore::DOMRect::setWidth):
(WebCore::DOMRect::setHeight):
(WebCore::DOMRect::DOMRect):
* dom/DOMRect.idl: Added.
* dom/DOMRectInit.h: Added.
* dom/DOMRectInit.idl: Added.
* dom/DOMRectReadOnly.h: Added.
(WebCore::DOMRectReadOnly::create):
(WebCore::DOMRectReadOnly::fromRect):
(WebCore::DOMRectReadOnly::x):
(WebCore::DOMRectReadOnly::y):
(WebCore::DOMRectReadOnly::width):
(WebCore::DOMRectReadOnly::height):
(WebCore::DOMRectReadOnly::top):
(WebCore::DOMRectReadOnly::right):
(WebCore::DOMRectReadOnly::bottom):
(WebCore::DOMRectReadOnly::left):
(WebCore::DOMRectReadOnly::DOMRectReadOnly):
* dom/DOMRectReadOnly.idl: Added.
2016-10-17 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Basic MediaController
https://bugs.webkit.org/show_bug.cgi?id=163539
<rdar://problem/28797542>
Reviewed by Darin Adler.
We add a new main.js file which acts as the entry point by implementing the createControls()
function that HTMLMediaElement::ensureMediaControlsInjectedScript() once the shadow root has
been created. That functions creates an instance of the new MediaController class, which is
the controller object that will handle communication between the media controls and the media
element. At first, this MediaController class is very limited and assumes macOS inline
layout traits and forces a start button to be shown over the media, which can be played
to start the media and show the full controls. More functionality will be added by future patches.
Tests: media/modern-media-controls/media-controller/media-controller-click-to-start.html
media/modern-media-controls/media-controller/media-controller-constructor.html
media/modern-media-controls/media-controller/media-controller-resize.html
* Modules/modern-media-controls/main.js: Added.
(createControls):
* Modules/modern-media-controls/media/media-controller.js: Added.
(MediaController):
(MediaController.prototype.set pageScaleFactor):
(MediaController.prototype.set usesLTRUserInterfaceLayoutDirection):
(MediaController.prototype.handleEvent):
(MediaController.prototype.buttonWasClicked):
(MediaController.prototype._updateControlsSize):
* WebCore.xcodeproj/project.pbxproj:
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::mediaControlsStyleSheet):
(WebCore::RenderThemeMac::mediaControlsScript):
2016-10-17 Anders Carlsson <andersca@apple.com>
Remove an unused HistoryItem function
https://bugs.webkit.org/show_bug.cgi?id=163565
Reviewed by Tim Horton.
* history/HistoryItem.cpp:
(WebCore::HistoryItem::isAncestorOf): Deleted.
* history/HistoryItem.h:
2016-10-17 Nan Wang <n_wang@apple.com>
AX: [Mac] mapping for output elements
https://bugs.webkit.org/show_bug.cgi?id=163471
Reviewed by Chris Fleizach.
Mapped the output element to status role and exposed its text content
as AXTitle.
Test: accessibility/mac/output-element.html
* English.lproj/Localizable.strings:
* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::visibleText):
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::isOutput):
* accessibility/AccessibilityObject.h:
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::determineAccessibilityRole):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper roleDescription]):
* platform/LocalizedStrings.cpp:
(WebCore::AXOutputText):
* platform/LocalizedStrings.h:
* platform/efl/LocalizedStringsEfl.cpp:
(WebCore::AXOutputText):
* platform/gtk/LocalizedStringsGtk.cpp:
(WebCore::AXOutputText):
2016-10-17 Yusuke Suzuki <utatane.tea@gmail.com>
[DOMJIT] Use DOMJIT::Patchpoint in IC
https://bugs.webkit.org/show_bug.cgi?id=163223
Reviewed by Saam Barati.
Make DOMJITPatchpointParams non-const.
* domjit/DOMJITHelpers.h:
(WebCore::DOMJITHelpers::toWrapper):
* domjit/JSNodeDOMJIT.cpp:
(WebCore::createCallDOMForOffsetAccess):
(WebCore::checkNode):
(WebCore::NodeNodeTypeDOMJIT::callDOM):
2016-10-17 Chris Dumez <cdumez@apple.com>
Move form.reportValidity() behind InteractiveFormValidation setting
https://bugs.webkit.org/show_bug.cgi?id=163550
Reviewed by Darin Adler.
Move form.reportValidity() behind InteractiveFormValidation setting for consistency
given that the two features are strongly related.
Also enable the setting by default so we can get feedback on the implementation.
Demos:
- Interactive form validation: http://jsfiddle.net/tj_vantoll/HdSqt/
- Report validity: https://googlechrome.github.io/samples/report-validity/
* bindings/generic/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setInteractiveFormValidationEnabled):
(WebCore::RuntimeEnabledFeatures::interactiveFormValidationEnabled):
* html/HTMLButtonElement.idl:
* html/HTMLFieldSetElement.idl:
* html/HTMLFormElement.idl:
* html/HTMLInputElement.idl:
* html/HTMLKeygenElement.idl:
* html/HTMLObjectElement.idl:
* html/HTMLOutputElement.idl:
* html/HTMLSelectElement.idl:
* html/HTMLTextAreaElement.idl:
2016-10-17 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Add a MediaControlsHost API to retrieve images as base64
https://bugs.webkit.org/show_bug.cgi?id=163502
<rdar://problem/28792017>
Reviewed by Darin Adler.
Add a new `base64StringForIconAndPlatform()` method to MediaControlsHost such that we
may load images from the modern-media-controls directory in the WebCore.framework bundle.
We use this new method in the iconService singleton when a `mediaControlsHost` is set,
which will be set in a later patch.
* Modules/mediacontrols/MediaControlsHost.cpp:
(WebCore::MediaControlsHost::base64StringForIconAndPlatform):
* Modules/mediacontrols/MediaControlsHost.h:
* Modules/mediacontrols/MediaControlsHost.idl:
* Modules/modern-media-controls/controls/icon-service.js:
(const.iconService.new.IconService.prototype.urlForIconNameAndLayoutTraits):
(const.iconService.new.IconService):
* rendering/RenderTheme.h:
(WebCore::RenderTheme::mediaControlsBase64StringForIconAndPlatform):
(WebCore::RenderTheme::mediaControlsScript): Deleted.
* rendering/RenderThemeMac.h:
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::mediaControlsBase64StringForIconAndPlatform):
2016-10-17 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Add a MediaControlsHost API to retrieve the shadow root CSS
https://bugs.webkit.org/show_bug.cgi?id=163501
<rdar://problem/28792014>
Reviewed by Darin Adler.
Add a new `shadowRootCSSText` property to MediaControlsHost so that we may obtain the
concatenated CSS sources for the media controls shadow root via JS. Actually using this
API will be done in a later patch. We also no longer inject those styles as a user-agent
stylesheet when the runtime flag is on since it will no longer be necessary.
* Modules/mediacontrols/MediaControlsHost.cpp:
(WebCore::MediaControlsHost::shadowRootCSSText):
* Modules/mediacontrols/MediaControlsHost.h:
* Modules/mediacontrols/MediaControlsHost.idl:
* css/CSSDefaultStyleSheets.cpp:
(WebCore::CSSDefaultStyleSheets::ensureDefaultStyleSheetsForElement):
2016-10-17 Simon Fraser <simon.fraser@apple.com>
Implement DOMPoint/DOMPointReadOnly
https://bugs.webkit.org/show_bug.cgi?id=133916
Reviewed by Darin Adler.
Patch mostly by Dirk Schultz <krit@webkit.org>.
Implement DOMPoint/DOMPointReadOnly following https://drafts.fxtf.org/geometry/
(although we may need to match https://www.w3.org/TR/geometry-1/ to be compatible
with Chrome).
Test: geometry/DOMPoint-001.html
* CMakeLists.txt:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* dom/DOMPoint.h: Added.
* dom/DOMPoint.idl: Added.
* dom/DOMPointInit.h: Added.
* dom/DOMPointInit.idl: Added.
* dom/DOMPointReadOnly.h: Added.
(WebCore::DOMPointReadOnly::create):
(WebCore::DOMPointReadOnly::fromPoint):
(WebCore::DOMPointReadOnly::x):
(WebCore::DOMPointReadOnly::y):
(WebCore::DOMPointReadOnly::z):
(WebCore::DOMPointReadOnly::w):
(WebCore::DOMPointReadOnly::DOMPointReadOnly):
* dom/DOMPointReadOnly.idl: Added.
2016-10-17 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Use modern-media-controls module sources for media controls stylesheet and script injection
https://bugs.webkit.org/show_bug.cgi?id=163500
<rdar://problem/28792010>
Reviewed by Darin Adler.
Add files from the Modules/modern-media-controls directory to the Xcode project and add a copy phase
to copy those files with their directory stucture as a subdirectory of the WebCore.framework Resources
directory.
Additionally, use the modern-media-controls Module CSS and JS files when concatenating the media controls
scripts and styles in RenderTheme when the runtime flag is on.
* WebCore.xcodeproj/project.pbxproj:
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::mediaControlsStyleSheet):
(WebCore::RenderThemeMac::mediaControlsScript):
2016-10-17 Simon Fraser <simon.fraser@apple.com>
Fix typo in error message.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateSerializerFunction):
2016-10-17 Fujii Hironori <Hironori.Fujii@sony.com>
preprocessor.pm: cl.exe outputs processing filenames if Windows Perl is used
https://bugs.webkit.org/show_bug.cgi?id=163435
Reviewed by Alex Christensen.
cl.exe outputs processing filenames to stderr. Suppress this
annoying messages by using open3 instead of open2.
* bindings/scripts/preprocessor.pm:
(applyPreprocessor): Use open3 in case of Windows Perl.
2016-10-17 Mark Lam <mark.lam@apple.com>
Use the reject() helper function for conditionally throwing TypeErrors.
https://bugs.webkit.org/show_bug.cgi?id=163491
Reviewed by Filip Pizlo.
No new tests because this patch does not introduce new behavior.
* bindings/js/JSCryptoAlgorithmDictionary.cpp:
(WebCore::createRsaKeyGenParams):
* bindings/js/JSIDBDatabaseCustom.cpp:
(WebCore::JSIDBDatabase::createObjectStore):
* bridge/c/c_instance.cpp:
(JSC::Bindings::CInstance::invokeMethod):
2016-10-17 Miguel Gomez <magomez@igalia.com>
[GTK] Several tests crashing on debug bot in (anonymous namespace)::MediaPlayerPrivateGStreamerBase::repaint
https://bugs.webkit.org/show_bug.cgi?id=163511
Reviewed by Carlos Garcia Campos.
Perform the video repaint in the main thread when accelerated compositing is disabled.
Covered by existent tests.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase):
(WebCore::MediaPlayerPrivateGStreamerBase::repaint):
(WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
2016-10-17 Konstantin Tokarev <annulen@yandex.ru>
Eleminate code duplication between ResourceRequest encoding/decoding implementations
https://bugs.webkit.org/show_bug.cgi?id=163507
Reviewed by Carlos Garcia Campos.
ResourceRequestBase::encodeWithoutPlatformData() and Soup implementation of
ArgumentCoder<ResourceRequest>::encodePlatformData() share most of the code,
ditto for decoding implementations.
No new tests needed.
* platform/network/ResourceRequestBase.h:
(WebCore::ResourceRequestBase::encodeBase):
(WebCore::ResourceRequestBase::decodeBase):
(WebCore::ResourceRequestBase::encodeWithoutPlatformData):
(WebCore::ResourceRequestBase::decodeWithoutPlatformData):
* platform/network/soup/ResourceRequest.h:
(WebCore::ResourceRequest::encodeWithPlatformData):
(WebCore::ResourceRequest::decodeWithPlatformData):
2016-10-17 Michael Catanzaro <mcatanzaro@igalia.com>
Move user agent quirks to cross-platform location
https://bugs.webkit.org/show_bug.cgi?id=163508
Reviewed by Carlos Garcia Campos.
Tested by Tools/TestWebKitAPI/Tests/WebCore/UserAgentQuirks.cpp.
* PlatformGTK.cmake:
* platform/UserAgent.h: Renamed from Source/WebCore/platform/gtk/UserAgentGtk.h.
* platform/UserAgentQuirks.cpp: Added. Moved from UserAgentGtk.cpp.
(WebCore::urlRequiresChromeBrowser): Sneakily tighten up Google domain detection, it should
only apply to sites if the base domain matches google.*, not any base domain that starts
with google.
(WebCore::urlRequiresMacintoshPlatform):
(WebCore::UserAgentQuirks::quirksForURL):
(WebCore::UserAgentQuirks::stringForQuirk):
* platform/UserAgentQuirks.h: Moved from UserAgentGtk.cpp. prepare-ChangeLog thinks it was
renamed from Source/WebCore/platform/efl/UserAgentEfl.h, but prepare-ChangeLog is dumb.
(WebCore::UserAgentQuirks::UserAgentQuirks):
(WebCore::UserAgentQuirks::add):
(WebCore::UserAgentQuirks::contains):
(WebCore::UserAgentQuirks::isEmpty):
* platform/efl/UserAgentEfl.cpp:
(WebCore::standardUserAgentForURL):
* platform/gtk/UserAgentGtk.cpp:
(WebCore::buildUserAgentString):
(WebCore::standardUserAgentForURL):
(): Deleted.
(WebCore::UserAgentQuirks::UserAgentQuirks): Deleted.
(WebCore::UserAgentQuirks::add): Deleted.
(WebCore::UserAgentQuirks::contains): Deleted.
(WebCore::UserAgentQuirks::isEmpty): Deleted.
(WebCore::urlRequiresChromeBrowser): Deleted.
(WebCore::urlRequiresMacintoshPlatform): Deleted.
2016-10-17 Alberto Garcia <berto@igalia.com>
[GTK] gobject-introspection on package build with webkit2gtk fails without active X session
https://bugs.webkit.org/show_bug.cgi?id=163105
Reviewed by Carlos Garcia Campos.
Don't call XCompositeQueryExtension() or XDamageQueryExtension()
if m_display is NULL.
* platform/graphics/x11/PlatformDisplayX11.cpp:
(WebCore::PlatformDisplayX11::supportsXComposite):
(WebCore::PlatformDisplayX11::supportsXDamage):
2016-10-16 Nan Wang <n_wang@apple.com>
AX: [Mac] roleDescription for AXTextField input types
https://bugs.webkit.org/show_bug.cgi?id=163419
<rdar://problem/28766192>
Reviewed by Darin Adler.
Provided more detailed role description for input types that
exposed as standard text fields on the mac.
Changes are covered in modified test expectation.
* English.lproj/Localizable.strings:
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper roleDescription]):
* platform/LocalizedStrings.cpp:
(WebCore::AXEmailFieldText):
(WebCore::AXTelephoneFieldText):
(WebCore::AXURLFieldText):
(WebCore::AXDateFieldText):
(WebCore::AXTimeFieldText):
* platform/LocalizedStrings.h:
* platform/efl/LocalizedStringsEfl.cpp:
(WebCore::AXEmailFieldText):
(WebCore::AXTelephoneFieldText):
(WebCore::AXURLFieldText):
(WebCore::AXDateFieldText):
(WebCore::AXTimeFieldText):
* platform/gtk/LocalizedStringsGtk.cpp:
(WebCore::AXEmailFieldText):
(WebCore::AXTelephoneFieldText):
(WebCore::AXURLFieldText):
(WebCore::AXDateFieldText):
(WebCore::AXTimeFieldText):
2016-10-16 Chris Dumez <cdumez@apple.com>
Update WebKit localizable strings
https://bugs.webkit.org/show_bug.cgi?id=163513
Reviewed by Dan Bernstein.
Update WebKit localizable strings as it was missing the "too short" one needed
by form validation. This was causing a "Localized string not found" message to
be shown when testing the following sample on WebKit ToT:
- https://googlechrome.github.io/samples/report-validity/
* English.lproj/Localizable.strings:
2016-10-16 Chris Dumez <cdumez@apple.com>
REGRESSION (r206750): Crash when pressing Caps Lock if “Use the Caps Lock key to switch to and from U.S.” is selected in Input Sources preferences
https://bugs.webkit.org/show_bug.cgi?id=163506
<rdar://problem/28792483>
Reviewed by Darin Adler.
As per the NSEvent documentation [1], calling [NSEvent characters] is only
valid on key up / key down events and will raise an NSInternalInconsistencyException
if accessed on any other kind of event object. The crash happens when keyForKeyEvent()
is called with the third kind of key event (NSFlagsChanged) which is used for
detecting modifier keys. We normally detect the modifier key and return early before
calling [NSEvent characters]. However, in some rare cases, we fail to detect the
modifier key and we fall through.
To address the issue, we now return "Unidentified" for NSFlagsChanged events, if we
fail to detect the modifier key and before calling [NSEvent characters].
[1] https://developer.apple.com/reference/appkit/nsevent/1534183-characters
No new test, not easily testable.
* platform/mac/PlatformEventFactoryMac.mm:
(WebCore::keyForKeyEvent):
2016-10-16 Darin Adler <darin@apple.com>
Move CSS classes from ExceptionCode to Exception
https://bugs.webkit.org/show_bug.cgi?id=163494
Reviewed by Sam Weinig.
Removed the "get" prefix from the names of many CSSPrimitiveValue
functions to match WebKit coding style and to disambiguate them
from the public CSS DOM functions that raise exceptions.
* bindings/js/JSCSSStyleDeclarationCustom.cpp:
(WebCore::propertyNamePrefix): Use enum class.
(WebCore::parseJavaScriptCSSPropertyName): Tweak style a bit.
(WebCore::stylePropertyGetter): Refactor to simplify structure.
(WebCore::stylePropertyGetterPixelOrPosPrefix): Ditto. Also use floatValue.
(WebCore::JSCSSStyleDeclaration::putDelegate): Use findIgnoringASCIICase,
and use propagateException to handle ExcpetionOr.
(WebCore::JSCSSStyleDeclaration::getPropertyCSSValue): Tweak style a bit.
(WebCore::JSCSSStyleDeclaration::getOwnPropertyNames): Use a lambda to
initialize a global here.
* bindings/js/JSDOMBinding.h: Added toJSString to support bindings for
functions returning ExceptionOr<String>.
* bindings/scripts/gobject-generate-headers.pl: Deleted.
* css/BasicShapeFunctions.cpp:
(WebCore::convertToLengthSize): Use pairValue.
(WebCore::convertToCenterCoordinate): Use valueID and pairValue.
(WebCore::cssValueToBasicShapeRadius): Ditto.
* css/CSSBasicShapes.cpp:
(WebCore::serializePositionOffset): Ditto.
(WebCore::buildSerializablePositionOffset): Ditto.
(WebCore::CSSBasicShapeCircle::cssText): Ditto.
(WebCore::CSSBasicShapeEllipse::cssText): Ditto.
(WebCore::updateCornerRadiusWidthAndHeight): Ditto.
* css/CSSBorderImageSliceValue.h: Use quadValue.
* css/CSSCalculationValue.cpp:
(WebCore::determineCategory): Use floatValue and doubleValue.
* css/CSSCharsetRule.h: Use ExceptionOr. Also made more things private.
* css/CSSCharsetRule.idl: Use non-legacy exceptions.
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::CSSComputedStyleDeclaration::setCssText): Use ExceptionOr.
(WebCore::ComputedStyleExtractor::propertyMatches): Use valueID.
(WebCore::CSSComputedStyleDeclaration::setProperty): Use ExceptionOr.
(WebCore::CSSComputedStyleDeclaration::removeProperty): Ditto.
(WebCore::CSSComputedStyleDeclaration::setPropertyInternal): Ditto.
(WebCore::ComputedStyleExtractor::getBackgroundShorthandValue): Return
a Ref instead of a RefPtr.
* css/CSSComputedStyleDeclaration.h: Updated for above changes.
* css/CSSCrossfadeValue.cpp:
(WebCore::CSSCrossfadeValue::fixedSize): Use floatValue.
(WebCore::CSSCrossfadeValue::image): Ditto.
(WebCore::CSSCrossfadeValue::blend): Use doubleValue.
* css/CSSFontFace.cpp:
(WebCore::CSSFontFace::calculateStyleMask): Use valueID.
(WebCore::CSSFontFace::calculateWeightMask): Ditto.
* css/CSSFontFaceSet.cpp:
(WebCore::CSSFontFaceSet::familyNameFromPrimitive): Ditto.
(WebCore::CSSFontFaceSet::matchingFaces): Use ExceptoinOr.
(WebCore::CSSFontFaceSet::check): Ditto.
* css/CSSFontFaceSet.h: Updated for above changes.
* css/CSSGradientValue.cpp:
(WebCore::compareStops): Use doubleValue.
(WebCore::CSSGradientValue::addStops): Use floatValue.
(WebCore::positionFromValue): Use floatValue and valudID.
(WebCore::CSSLinearGradientValue::customCSSText): Use doubleValue and valueID.
(WebCore::CSSLinearGradientValue::createGradient): Use floatValue and valueID.
(WebCore::CSSRadialGradientValue::customCSSText): Use doubleValue and valueID.
(WebCore::CSSRadialGradientValue::resolveRadius): Use floatValue.
(WebCore::CSSRadialGradientValue::createGradient): Use valueID.
* css/CSSGroupingRule.cpp:
(WebCore::CSSGroupingRule::insertRule): Use ExceptionOr.
(WebCore::CSSGroupingRule::deleteRule): Ditto.
* css/CSSGroupingRule.h: Updated for above changes.
* css/CSSImageGeneratorValue.cpp:
(WebCore::CSSImageGeneratorValue::subimageIsPending): Use valueID.
(WebCore::CSSImageGeneratorValue::cachedImageForCSSValue): Ditto.
* css/CSSImageSetValue.cpp:
(WebCore::CSSImageSetValue::fillImageSet): Use floatValue.
* css/CSSMediaRule.idl: Use non-legacy exceptions.
* css/CSSPrimitiveValue.cpp:
(WebCore::CSSPrimitiveValue::computeDegrees): Use doubleValue.
(WebCore::CSSPrimitiveValue::setFloatValue): Use ExceptionOr.
(WebCore::CSSPrimitiveValue::getFloatValue): Replaced getDoubleValue with this,
since getDoubleValue is unused, moving the call to clampTo into this function.
Also changed this to use ExceptionOr.
(WebCore::CSSPrimitiveValue::doubleValue): Renamed from getDoubleValue.
(WebCore::CSSPrimitiveValue::doubleValueInternal): Use Optional instead of a bool
and an out argument to return the value and check for type failure.
(WebCore::CSSPrimitiveValue::setStringValue): Use ExceptionOr.
(WebCore::CSSPrimitiveValue::getStringValue): Ditto.
(WebCore::CSSPrimitiveValue::stringValue): Renamed from getStringValue.
(WebCore::CSSPrimitiveValue::getCounterValue): Use ExceptionOr.
(WebCore::CSSPrimitiveValue::getRectValue): Use ExceptionOr.
(WebCore::CSSPrimitiveValue::getQuadValue): Deleted.
(WebCore::CSSPrimitiveValue::getLengthRepeatValue): Deleted.
(WebCore::CSSPrimitiveValue::getRGBColorValue): Use ExceptionOr.
(WebCore::CSSPrimitiveValue::getPairValue): Deleted.
(WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText): Use new names for functions.
* css/CSSPrimitiveValue.h: Reorganized the class, moved large inline function bodies
out of the class definition. Updated for the above changes.
* css/CSSPrimitiveValue.idl: Use non-legacy exceptions.
* css/CSSPrimitiveValueMappings.h: Use value instead of getValue, etc.
* css/CSSRule.cpp:
(WebCore::CSSRule::setCssText): Use ExceptionOr.
* css/CSSRule.h: Updated for above change.
* css/CSSRule.idl: Use non-legacy exceptions.
* css/CSSStyleDeclaration.h: Use ExceptionOr.
* css/CSSStyleDeclaration.idl: Use non-legacy exceptions.
* css/CSSStyleSheet.cpp:
(WebCore::CSSStyleSheet::deprecatedInsertRule): Use ExceptionOr.
(WebCore::CSSStyleSheet::insertRule): Ditto.
(WebCore::CSSStyleSheet::deleteRule): Ditto.
(WebCore::CSSStyleSheet::addRule): Ditto.
* css/CSSStyleSheet.h: Updated for the above changes.
* css/CSSStyleSheet.idl: Use non-legacy exceptions.
* css/CSSSupportsRule.idl: Use non-legacy exceptions.
* css/CSSToStyleMap.cpp:
(WebCore::CSSToStyleMap::mapFillAttachment): Use valueID instead of getValueID, etc.
(WebCore::convertToLengthSize): Ditto.
(WebCore::CSSToStyleMap::mapFillSize): Ditto.
(WebCore::CSSToStyleMap::mapFillXPosition): Ditto.
(WebCore::CSSToStyleMap::mapFillYPosition): Ditto.
(WebCore::CSSToStyleMap::mapFillMaskSourceType): Ditto.
(WebCore::CSSToStyleMap::mapAnimationDirection): Ditto.
(WebCore::CSSToStyleMap::mapAnimationFillMode): Ditto.
(WebCore::CSSToStyleMap::mapAnimationIterationCount): Ditto.
(WebCore::CSSToStyleMap::mapAnimationName): Ditto.
(WebCore::CSSToStyleMap::mapAnimationPlayState): Ditto.
(WebCore::CSSToStyleMap::mapAnimationProperty): Ditto.
(WebCore::CSSToStyleMap::mapAnimationTimingFunction): Ditto.
(WebCore::CSSToStyleMap::mapAnimationTrigger): Ditto.
(WebCore::CSSToStyleMap::mapNinePieceImageSlice): Ditto.
(WebCore::CSSToStyleMap::mapNinePieceImageQuad): Ditto.
(WebCore::CSSToStyleMap::mapNinePieceImageRepeat): Ditto.
* css/CSSValue.h: Use ExceptionOr.
* css/CSSValue.idl: Use non-legacy exceptions.
* css/Counter.h: Use stringValue instead of getStringValue, etc.
* css/FontFace.cpp:
(WebCore::FontFace::create): Use ExceptionOr.
(WebCore::FontFace::setFamily): Ditto.
(WebCore::FontFace::setStyle): Ditto.
(WebCore::FontFace::setWeight): Ditto.
(WebCore::FontFace::setStretch): Ditto.
(WebCore::FontFace::setUnicodeRange): Ditto.
(WebCore::FontFace::setVariant): Ditto.
(WebCore::FontFace::setFeatureSettings): Ditto.
* css/FontFace.h: Updated for above changes.
* css/FontFace.idl: Use non-legacy exceptions.
* css/FontFaceSet.cpp:
(WebCore::FontFaceSet::load): Use ExceptionOr.
(WebCore::FontFaceSet::check): Ditto.
* css/FontFaceSet.h: Updated for above changes.
* css/FontFaceSet.idl: Use non-legacy exceptions.
* css/FontVariantBuilder.cpp:
(WebCore::extractFontVariantLigatures): Use valueID instead of getValueID, etc.
(WebCore::extractFontVariantNumeric): Ditto.
(WebCore::extractFontVariantEastAsian): Ditto.
* css/MediaList.cpp:
(WebCore::MediaList::setMediaText): Use ExceptionOr.
(WebCore::MediaList::deleteMedium): Ditto.
(WebCore::MediaList::appendMedium): Ditto.
* css/MediaList.h: Updated for above changes.
* css/MediaList.idl: Use non-legacy exceptions.
* css/MediaQueryEvaluator.cpp:
(WebCore::doubleValue): Use valueID instead of getValueID, etc.
(WebCore::colorGamutEvaluate): Ditto.
(WebCore::invertedColorsEvaluate): Ditto.
(WebCore::orientationEvaluate): Ditto.
(WebCore::evaluateResolution): Ditto.
(WebCore::computeLength): Ditto.
(WebCore::viewModeEvaluate): Ditto.
(WebCore::hoverEvaluate): Ditto.
(WebCore::pointerEvaluate): Ditto.
(WebCore::prefersReducedMotionEvaluate): Ditto.
* css/PropertySetCSSStyleDeclaration.cpp:
(WebCore::PropertySetCSSStyleDeclaration::setCssText): Use ExceptionOr.
(WebCore::PropertySetCSSStyleDeclaration::setProperty): Ditto.
(WebCore::PropertySetCSSStyleDeclaration::removeProperty): Ditto.
(WebCore::PropertySetCSSStyleDeclaration::getPropertyCSSValueInternal): Ditto.
(WebCore::PropertySetCSSStyleDeclaration::setPropertyInternal): Ditto.
* css/PropertySetCSSStyleDeclaration.h: Updated for above changes.
Also marked a couple additional functions private.
* css/StyleBuilderConverter.h: Use doubleValue instead of getDoubleValue, etc.
* css/StyleBuilderCustom.h: Ditto.
* css/StyleProperties.cpp:
(WebCore::StyleProperties::getLayeredShorthandValue): Ditto.
* css/StyleResolver.cpp:
(WebCore::StyleResolver::MatchResult::addMatchedProperties): Ditto.
(WebCore::StyleResolver::colorFromPrimitiveValueIsDerivedFromElement): Ditto.
(WebCore::StyleResolver::colorFromPrimitiveValue): Ditto.
(WebCore::StyleResolver::createFilterOperations): Ditto.
* css/TransformFunctions.cpp:
(WebCore::transformsForValue): Ditto.
* css/ViewportStyleResolver.cpp:
(WebCore::ViewportStyleResolver::getViewportArgumentValue): Ditto.
* css/WebKitCSSMatrix.cpp:
(WebCore::WebKitCSSMatrix::WebKitCSSMatrix): Tweaked constructors a bit,
getting rid of the one that uses an ExceptionCode.
(WebCore::WebKitCSSMatrix::create): Moved in here, and use ExceptionOr.
(WebCore::WebKitCSSMatrix::setMatrixValue): Use ExceptionOr.
(WebCore::WebKitCSSMatrix::multiply): Tweak coding style a bit.
(WebCore::WebKitCSSMatrix::inverse): Use ExceptionOr.
(WebCore::WebKitCSSMatrix::translate): Return a Ref instead of RefPtr.
(WebCore::WebKitCSSMatrix::scale): Ditto.
(WebCore::WebKitCSSMatrix::rotate): Ditto.
(WebCore::WebKitCSSMatrix::rotateAxisAngle): Ditto.
(WebCore::WebKitCSSMatrix::skewX): Ditto.
(WebCore::WebKitCSSMatrix::skewY): Ditto.
(WebCore::WebKitCSSMatrix::toString): Tweaked formatting a bit.
* css/WebKitCSSMatrix.h: Updated for above changes.
* css/WebKitCSSMatrix.idl: Use non-legacy extensions.
* css/makeprop.pl:
(handleCurrentColorValue): Use valueID instead of getValueID.
(generateValueSetter): Ditto.
* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parse4ValuesFillPosition): Use valueID instead of getValueID, etc.
(WebCore::CSSParser::parse3ValuesFillPosition): Ditto.
(WebCore::CSSParser::parseFillPosition): Ditto.
(WebCore::CSSParser::parseFillRepeat): Ditto.
(WebCore::CSSParser::parseGridPosition): Ditto.
(WebCore::CSSParser::parseGridTemplateRowsAndAreasAndColumns): Ditto.
(WebCore::isGridTrackFixedSized): Ditto.
(WebCore::CSSParser::parseRadialGradient): Ditto.
(WebCore::CSSParser::parseBuiltinFilterArguments): Ditto.
* css/parser/CSSParserValues.cpp:
(WebCore::CSSParserValue::createCSSValue): Removed the unneeded call to
setPrimitiveType here. The createParserOperator returns an object that
already has the correct primitive type.
* css/parser/CSSPropertyParser.cpp: Updated most cases of calling the old
getXXXValue functions, but not sure if it's right since it is commented out
code that I did not compile.
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::clampRGBComponent): Use intValue instead of getIntValue, etc.
(WebCore::CSSPropertyParserHelpers::parseHSLParameters): Ditto.
(WebCore::CSSPropertyParserHelpers::isHorizontalPositionKeywordOnly): Ditto.
(WebCore::CSSPropertyParserHelpers::isVerticalPositionKeywordOnly): Ditto.
(WebCore::CSSPropertyParserHelpers::positionFromThreeOrFourValues): Ditto.
(WebCore::CSSPropertyParserHelpers::consumeRadialGradient): Ditto.
* dom/Range.cpp: Added now-needed include of ExceptionCode.h.
* dom/SelectorQuery.cpp: Ditto.
* editing/ApplyStyleCommand.cpp:
(WebCore::toIdentifier): Use valueID instead of getValueID, etc.
(WebCore::ApplyStyleCommand::computedFontSize): Ditto.
* editing/EditingStyle.cpp:
(WebCore::identifierForStyleProperty): Ditto.
(WebCore::HTMLElementEquivalent::valueIsPresentInStyle): Ditto.
(WebCore::EditingStyle::extractFontSizeDelta): Ditto.
(WebCore::EditingStyle::textDirection): Ditto.
(WebCore::EditingStyle::prepareToApplyAt): Ditto.
(WebCore::EditingStyle::textDirectionForSelection): Ditto.
(WebCore::fontWeightIsBold): Ditto.
(WebCore::legacyFontSizeFromCSSValue): Ditto.
(WebCore::isTransparentColorValue): Ditto.
(WebCore::hasTransparentBackgroundColor): Ditto.
(WebCore::backgroundColorInEffect): Ditto.
* editing/Editor.cpp:
(WebCore::Editor::applyEditingStyleToElement): Removed IGNORE_EXCEPTION; that is
what we do by default for things returning ExceptionOr.
* editing/RemoveCSSPropertyCommand.cpp:
(WebCore::RemoveCSSPropertyCommand::doApply): Ditto.
(WebCore::RemoveCSSPropertyCommand::doUnapply): Ditto.
* editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline): Ditto.
* editing/cocoa/HTMLConverter.mm:
(floatValueFromPrimitiveValue): Use floatValue instead of getFloatValue, etc.
* editing/markup.cpp:
(WebCore::propertyMissingOrEqualToNone): Ditto.
* inspector/InspectorStyleSheet.cpp:
(WebCore::InspectorStyleSheet::addRule): Updated to call ExceptionOr-returning functions.
(WebCore::InspectorStyleSheet::deleteRule): Ditto.
(WebCore::InspectorStyleSheet::setStyleText): Ditto.
* svg/SVGLength.cpp:
(WebCore::SVGLength::fromCSSPrimitiveValue): Use floatValue instead of getFloatValue.
2016-10-16 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Styles for StartButton are missing
https://bugs.webkit.org/show_bug.cgi?id=163499
<rdar://problem/28792009>
Reviewed by Darin Adler.
Add styling for StartButton so that instances are always displayed in the center of their container.
Test: media/modern-media-controls/start-button/start-button-styles.html
* Modules/modern-media-controls/controls/start-button.css: Added.
(button.start):
(button.start > *):
(button.start > div):
(button.start > img):
(button.start:active > img):
2016-10-16 Simon Fraser <simon.fraser@apple.com>
Implement serializer = { attribute }
https://bugs.webkit.org/show_bug.cgi?id=163466
Follow-up fix to die if "serializer {...}" lists an attribute not present
on the interface. I don't think this is testable with the current bindings tests.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateSerializerFunction):
2016-10-16 Simon Fraser <simon.fraser@apple.com>
Add the "Geometry Interfaces" to features.json.
* features.json:
2016-10-16 Carlos Garcia Campos <cgarcia@igalia.com>
Document request not updated after willSendRequest is called for a redirect
https://bugs.webkit.org/show_bug.cgi?id=163436
Reviewed by Michael Catanzaro.
The first willSendRequest happens before DocumentLoader::startLoadingMainResource(), that calls setRequest, but
the second one happens after DocumentLoader::redirectReceived() and then the request is never updated again.
Covered by GTK+ unit tests.
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::willContinueMainResourceLoadAfterRedirect): Set the new request.
* loader/DocumentLoader.h:
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::willSendRequestInternal): Notify the document loader when loading the main resource
and called for a redirection.
2016-10-15 Said Abou-Hallawa <sabouhallawa@apple.com>
Delete the animated image catchup code
https://bugs.webkit.org/show_bug.cgi?id=163410
Reviewed by Simon Fraser.
This patch fixes two issues in the animated image workflow:
1) Setting the animation timer should follow the following rules:
-- Initial case: Which happens before drawing the first frame. We
should set the timer to fire after the current_frame_duration.
-- Late case (Slow animation): This happens if the current_time is
past the next_frame_desired_time. In this case we should fire the
timer immediately.
-- Early case (Fast animation): This happens when there is still time
before the next_frame_desired_time. In this case we should set the
timer to fire after the difference between the next_frame_desired_time
and the current_time.
2) Deleting the code for catching up the current_frame:
This code used to run in the slow animation case. It was never used
on iOS. It was trying to adjust the current_frame according to the
current_time as if there were no delay. It turned out that this might
cause a bigger delay because most likely the decoder decodes the image
frames incrementally; i.e. to decode frame k, it has to have frame
(k - 1) decoded.
Test: fast/images/ordered-animated-image-frames.html
* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::draw): Remove the iOS specific code.
(WebCore::BitmapImage::startAnimation): Move the animation finishing code from
BitmapImage::internalAdvanceAnimation() to this function. Simplify the timer
duration code as it is described above.
(WebCore::BitmapImage::advanceAnimation): Merge BitmapImage::internalAdvanceAnimation()
into this function.
(WebCore::BitmapImage::resetAnimation):
(WebCore::BitmapImage::internalAdvanceAnimation): Deleted.
* platform/graphics/BitmapImage.h:
* platform/graphics/Image.cpp:
(WebCore::Image::drawTiled):
* platform/graphics/Image.h:
(WebCore::Image::startAnimation):
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::startAnimation):
* svg/graphics/SVGImage.h:
Remove the catchup code form the Image and SVGImage classes.
2016-10-15 Darin Adler <darin@apple.com>
Move Web SQL database and WebSockets off legacy exceptions
https://bugs.webkit.org/show_bug.cgi?id=163284
Reviewed by Chris Dumez.
* Modules/webdatabase/DOMWindowWebDatabase.cpp:
(WebCore::DOMWindowWebDatabase::openDatabase): Use ExceptionOr.
* Modules/webdatabase/DOMWindowWebDatabase.h: Update for above.
* Modules/webdatabase/DOMWindowWebDatabase.idl: Ditto.
* Modules/webdatabase/SQLResultSet.cpp:
(WebCore::SQLResultSet::SQLResultSet): Move initialization of
many data members into the class definition.
(WebCore::SQLResultSet::insertId): Use ExceptionOr.
(WebCore::SQLResultSet::rowsAffected): Moved into class definition.
(WebCore::SQLResultSet::rows): Ditto.
(WebCore::SQLResultSet::setInsertId): Ditto.
(WebCore::SQLResultSet::setRowsAffected): Ditto.
* Modules/webdatabase/SQLResultSet.h: Updated for above.
* Modules/webdatabase/SQLResultSet.idl: Use non-legacy exceptions.
Added a FIXME about the mismatch between long and int64_t.
* Modules/webdatabase/SQLStatement.cpp:
(WebCore::SQLStatement::execute): Use reference instead of pointer.
* Modules/websockets/WebSocket.cpp:
(WebCore::isValidProtocolString): Use StringView.
(WebCore::WebSocket::subprotocolSeparator): Fixed capitalization and
spelling error in the name of this function.
(WebCore::WebSocket::WebSocket): Move initialization of many data
members into the class definition.
(WebCore::WebSocket::create): Use ExceptionOr.
(WebCore::WebSocket::connect): Ditto.
(WebCore::WebSocket::send): Ditto.
(WebCore::WebSocket::close): Ditto.
(WebCore::WebSocket::binaryType): Update to use enum class.
(WebCore::WebSocket::setBinaryType): Use ExecptionOr and update to
use enum class.
(WebCore::WebSocket::didReceiveBinaryData): Ditto.
* Modules/websockets/WebSocket.h: Updated for above. Changed the
BinaryType enum into an enum class.
* Modules/websockets/WebSocket.idl: Use non-legacy exceptions.
* Modules/websockets/WebSocketHandshake.cpp:
(WebCore::WebSocketHandshake::checkResponseHeaders):
Updated for name change to subprotocolSeparator.
* dom/ExceptionOr.h: Added a constructor for scalar types that does not
require an rvalue reference. We can refine this more later, but for now
this is sufficient to obviate the need for WTFMove where it otherwise would
have been needed in the code above.
* inspector/InspectorDatabaseAgent.cpp: Use reference instead of pointer.
* page/DOMWindow.idl: Touched this file to work around bugs in the dependency
analysis of the current CMake build system, since otherwise it doesn't process the
change to the partial interface WebSocket. Edited lots of comments, removed many
others, and tweaked formatting.
2016-10-14 Sam Weinig <sam@webkit.org>
MessageEvent's source property should be a (DOMWindow or MessagePort)? rather than a EventTarget?
https://bugs.webkit.org/show_bug.cgi?id=163475
Reviewed by Simon Fraser.
Start fleshing out union support, starting with MessageEvent.
- Simplify things a bit for now by requiring interface types to use RefPtr<T> as their type when
used in sequences and unions. We should revisit this later, and see if we can use Ref<T> where
possible, but it causes complications for dictionaries, since they want a Ref<T> uninitialized.
* bindings/generic/IDLTypes.h:
Switch IDLInterface to use RefPtr<T> as its implementation type.
* bindings/js/JSDOMConvert.h:
(WebCore::Detail::VariadicConverterBase::convert):
- Remove isJSDOMWrapperType() optimization. It was not correct, due to not being able to detect window
and window shell, and not always an optimization, e.g. in the case of a single interface.
- Switch from JSC::jsDynamicCast<WrapperType*>() to WrapperType::toWrapped() which can be faster and
handles window and window shell correctly.
- Also fix an issue where we would wrongly assert that one interface had to match.
* bindings/js/JSDOMWrapper.h:
(WebCore::isJSDOMWrapperType): Deleted.
Remove unused predicate.
* bindings/scripts/IDLParser.pm:
(parseType):
Add missing support for nullable unions.
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/TestObj.idl:
Add new tests for unions (both non-null and nullable) in dictionaries.
* dom/ContainerNode.cpp:
(WebCore::ContainerNode::append):
(WebCore::ContainerNode::prepend):
* dom/ContainerNode.h:
* dom/Node.cpp:
(WebCore::nodeSetPreTransformedFromNodeOrStringVector):
(WebCore::Node::convertNodesOrStringsIntoNode):
(WebCore::Node::before):
(WebCore::Node::after):
(WebCore::Node::replaceWith):
* dom/Node.h:
Add using declaration for NodeOrString and change it to use RefPtr<Node>.
* bindings/js/JSMessageEventCustom.cpp:
(WebCore::handleInitMessageEvent):
* dom/MessageEvent.cpp:
(WebCore::MessageEvent::MessageEvent):
(WebCore::MessageEvent::create):
(WebCore::MessageEvent::initMessageEvent):
(WebCore::MessageEvent::source):
(WebCore::isValidSource): Deleted.
* dom/MessageEvent.h:
* dom/MessageEvent.idl:
* page/DOMWindow.cpp:
(WebCore::PostMessageTimer::event):
Change MessageEvent's source to be a std::experimental::variant<RefPtr<DOMWindow>, RefPtr<MessagePort>>.
For now, we only enforce this on setting, and leave the getter a EventTarget?, but that should not be
observable, and will rectified in subsequent patches.
2016-10-15 Chris Dumez <cdumez@apple.com>
Add support for reportValidity() on form and form control elements
https://bugs.webkit.org/show_bug.cgi?id=163479
Reviewed by Darin Adler.
Add support for reportValidity() on form and form control elements:
- https://html.spec.whatwg.org/#dom-form-reportvalidity
- https://html.spec.whatwg.org/#dom-cva-reportvalidity
Firefox and Chrome already support this.
Demo: https://googlechrome.github.io/samples/report-validity/
No new tests, rebaselined existing tests.
* html/HTMLButtonElement.idl:
* html/HTMLFieldSetElement.idl:
* html/HTMLFormElement.idl:
* html/HTMLInputElement.idl:
* html/HTMLKeygenElement.idl:
* html/HTMLObjectElement.idl:
* html/HTMLOutputElement.idl:
* html/HTMLSelectElement.idl:
* html/HTMLTextAreaElement.idl:
Add reportValidity() operation.
* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::checkValidity):
(WebCore::HTMLFormControlElement::reportValidity):
Add implementation for reportValidity() for form control elements.
First, it calls checkValidity() and returns early if there is no
constraint violation. if the JS canceled the 'invalid' event
fired by checkValidity(), then return early as well, as per the
specification. If the element is focusable, we scroll to it,
focus it and show the validation message. Otherwise, we log a
error message to the console. The last part of the behavior
matches what we already did in HTMLFormElement::validateInteractively()
and complies with the behavior in the specification.
(WebCore::HTMLFormControlElement::focusAndShowValidationMessage):
Add utility function to scroll to the form control element, focus
it and show its validation message. This code was moved from
HTMLFormElement::validateInteractively() so that it could be reused
in HTMLFormControlElement::reportValidity().
* html/HTMLFormControlElement.h:
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::validateInteractively):
Move the early abort checks to the existing call site (prepareForSubmission)
so that we can reuse this method for reportValidity().
(WebCore::HTMLFormElement::prepareForSubmission):
Only call validateInteractively() if we really should validate. Those checks
used to be in validateInteractively() but I moved them here so we could more
easily reuse validateInteractively().
(WebCore::HTMLFormElement::checkValidity):
(WebCore::HTMLFormElement::checkInvalidControlsAndCollectUnhandled):
Update Vector type to be a Vector of HTMLFormControlElement given that we
only add HTMLFormControlElement objects to it and that it results it simpler
code.
(WebCore::HTMLFormElement::reportValidity):
Add implementation for reportValidity() for form elements. The
implementation calls our already existing validateInteractively()
method, as per the specification.
* html/HTMLFormElement.h:
* html/HTMLObjectElement.h:
reportValidity() returns true unconditionally for object elements,
similarly to checkValidity().
2016-10-15 Simon Fraser <simon.fraser@apple.com>
Sort the project file.
* WebCore.xcodeproj/project.pbxproj:
2016-10-15 Simon Fraser <simon.fraser@apple.com>
Implement serializer = { attribute }
https://bugs.webkit.org/show_bug.cgi?id=163466
Reviewed by Darin Adler.
Fix the code generator to generate code for serializer = { attribute }.
In IDLParser, extend domSerializable with flags for the 'inherit', 'getter' and
'attribute' values (the first two are still unsupported). Fix parseSerializationPattern()
to detect these; it needs to create the domSerializable() now. Basic support
for isSerializableAttribute() is added (primitive types only).
GenerateSerializerFunction is fixed to output code for the serializable attributes
in the order specified in "serializer = {}", as specified in WebIDL.
Removed custom serialization for ClientRect and PerformanceTiming.
Other minor cleanup to always get $interfaceName from $interface->name, and to fix
ObjectConstructor.h to be included as <runtime/ObjectConstructor.h>.
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSBindingsAllInOne.cpp:
* bindings/js/JSClientRectCustom.cpp: Removed.
* bindings/js/JSPerformanceTimingCustom.cpp: Removed.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
(GenerateSerializerFunction):
* bindings/scripts/IDLParser.pm:
(parseSerializerRest):
(parseSerializationPattern):
(parseSerializationAttributes):
(isSerializableAttribute):
(applyMemberList):
* bindings/scripts/test/JS/JSTestNode.cpp:
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjPrototypeFunctionToJSONCaller):
* bindings/scripts/test/JS/JSTestSerialization.cpp: Added.
* bindings/scripts/test/JS/JSTestSerialization.h: Added.
* bindings/scripts/test/TestObj.idl:
* bindings/scripts/test/TestSerialization.idl: Copied from Source/WebCore/dom/ClientRect.idl.
* dom/ClientRect.idl:
* page/PerformanceTiming.idl:
2016-10-15 Michael Catanzaro <mcatanzaro@igalia.com>
[GTK] Restore user agent quirk for Yahoo
https://bugs.webkit.org/show_bug.cgi?id=163481
Reviewed by Carlos Garcia Campos.
finance.yahoo.com is sending a mobile version in response to our standard user agent.
* platform/gtk/UserAgentGtk.cpp:
(WebCore::urlRequiresMacintoshPlatform):
2016-10-15 Chris Dumez <cdumez@apple.com>
Setting HTMLMediaElement.volume to NaN or Inf should throw a TypeError
https://bugs.webkit.org/show_bug.cgi?id=163472
Reviewed by Sam Weinig.
Setting HTMLMediaElement.volume to NaN or Inf should throw a TypeError:
- https://html.spec.whatwg.org/#dom-media-volume
This is because the attribute is of type double (not unrestricted double in the IDL).
Chrome and Firefox agree with the specification. WebKit throws an IndexSizeErr instead.
No new tests, rebaselined existing test.
* html/HTMLMediaElement.idl:
2016-10-15 Zalan Bujtas <zalan@apple.com>
CounterNode::resetRenderers is so inefficient.
https://bugs.webkit.org/show_bug.cgi?id=163480
Reviewed by Simon Fraser.
CounterNode::resetRenderers() removes all the associated renderers from this CounterNode
and sets the dirty bit on them.
This patch does all that in a loop, instead of traversing the linked tree on each removal.
No change in functionality.
* rendering/CounterNode.cpp:
(WebCore::CounterNode::CounterNode):
(WebCore::CounterNode::~CounterNode):
(WebCore::CounterNode::nextInPreOrderAfterChildren):
(WebCore::CounterNode::lastDescendant):
(WebCore::CounterNode::addRenderer): These assertions do not seem super useful.
(WebCore::CounterNode::removeRenderer):
(WebCore::CounterNode::resetRenderers):
(WebCore::CounterNode::insertAfter):
(WebCore::CounterNode::removeChild):
* rendering/CounterNode.h:
* rendering/RenderCounter.cpp:
(WebCore::makeCounterNode):
(WebCore::RenderCounter::RenderCounter):
(WebCore::RenderCounter::~RenderCounter):
(WebCore::RenderCounter::originalText):
(WebCore::updateCounters):
(WebCore::RenderCounter::invalidate): Deleted.
* rendering/RenderCounter.h:
2016-10-15 Antoine Quint <graouts@apple.com>
[Modern Media Controls] macOS inline controls
https://bugs.webkit.org/show_bug.cgi?id=163444
<rdar://problem/27989473>
Reviewed by Dean Jackson.
Introducing the new MacOSMediaControls and MacOSInlineMediaControls classes. MacOSMediaControls is a MediaControls subclass
that adds specific buttons to the macOS platform and sets the layout traits to be macOS. This class has a new subclass,
MacOSInlineMediaControls, which sets the layout traits to also include inline and implements custom layout to drop
controls as necessary as the width of the controls varies. It also shows the volume slider when the mute button is hovered.
Tests: media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-buttons-styles.html
media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-constructor.html
media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-controls-bar-styles.html
media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-layout.html
media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-time-control-styles.html
media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-volume-slider-visibility.html
media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-volume-styles.html
media/modern-media-controls/macos-inline-media-controls/macos-inline-media-dropping-controls.html
media/modern-media-controls/macos-media-controls/macos-media-controls.html
* Modules/modern-media-controls/controls/macos-inline-media-controls.css: Added.
(.media-controls.mac.inline > .controls-bar):
(.media-controls.mac.inline > .controls-bar > *):
(.media-controls.mac.inline button):
(.media-controls.mac.inline button:active):
(.media-controls.mac.inline > .controls-bar button):
(.media-controls.mac.inline > .controls-bar,):
(.media-controls.mac.inline button.play-pause):
(.media-controls.mac.inline button.skip-back):
(.media-controls.mac.inline .scrubber.slider):
(.media-controls.mac.inline button.mute):
(.media-controls.mac.inline button.airplay):
(.media-controls.mac.inline button.pip):
(.media-controls.mac.inline button.tracks):
(.media-controls.mac.inline button.fullscreen):
(.media-controls.mac.inline .time-label):
(.media-controls.mac.inline .volume-slider-container):
(.media-controls.mac.inline .volume-slider-container:before):
(.media-controls.mac.inline .volume.slider):
* Modules/modern-media-controls/controls/macos-inline-media-controls.js: Added.
(MacOSInlineMediaControls.prototype.layout):
(MacOSInlineMediaControls.prototype.handleEvent):
* Modules/modern-media-controls/controls/macos-media-controls.js: Added.
(MacOSMediaControls):
2016-10-14 Antti Koivisto <antti@apple.com>
100% CPU on homedepot.com page
https://bugs.webkit.org/show_bug.cgi?id=163452
<rdar://problem/28730708>
Reviewed by Simon Fraser.
The site has a keyframe animation on body. Currently this causes the animation to invalidate the
style of the entire document.
Animations use SyntheticStyleChange to invalidate elements when animation progresses and currently
that causes full subtree invalidation. However animation only ever affect individual elements and
the normal style resolution mechanism should be able to deal with things like inheritance as needed.
Test: fast/animation/animation-style-update-size.html
* dom/Document.cpp:
(WebCore::Document::recalcStyle):
* dom/Document.h:
(WebCore::Document::lastStyleUpdateSizeForTesting):
Testing support.
* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::resolveElement):
Don't force subtree style resolution for SyntheticStyleChange.
* style/StyleUpdate.h:
(WebCore::Style::Update::size):
* testing/Internals.cpp:
(WebCore::Internals::lastStyleUpdateSize):
* testing/Internals.h:
* testing/Internals.idl:
2016-10-14 Chris Dumez <cdumez@apple.com>
Setting HTMLMediaElement.muted to the same value should not fire a volume change event
https://bugs.webkit.org/show_bug.cgi?id=163474
Reviewed by Eric Carlson.
Setting HTMLMediaElement.muted to the same value should not fire a volume
change event:
- https://html.spec.whatwg.org/#dom-media-muted
Chrome and Firefox agree with the specification.
No new tests, rebaselined existing test.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::setMuted):
2016-10-14 Dean Jackson <dino@apple.com>
Add Display P3 ColorSpace
https://bugs.webkit.org/show_bug.cgi?id=162880
<rdar://problem/28598564>
Reviewed by Sam Weinig.
Re-landing with a version that hopefully compiles on El Capitan.
Add a new ColorSpace for Display P3.
This will be tested once the Color class can create
objects that reference other color spaces.
* platform/graphics/ColorSpace.h:
* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::displayP3ColorSpaceRef):
* platform/graphics/cg/GraphicsContextCG.h:
(WebCore::cachedCGColorSpace):
2016-10-14 Brent Fulgham <bfulgham@apple.com>
[Win][Direct2D] Minor cleanups
https://bugs.webkit.org/show_bug.cgi?id=162953
Reviewed by Dean Jackson.
Code cleanup. No change in behavior.
* platform/graphics/win/ImageDecoderDirect2D.cpp:
(WebCore::ImageDecoder::frameIsCompleteAtIndex):
(WebCore::ImageDecoder::frameBytesAtIndex):
2016-10-14 Alex Christensen <achristensen@webkit.org>
Fix CMake build.
* PlatformMac.cmake:
2016-10-14 Anders Carlsson <andersca@apple.com>
Pass on networking settings to the PKPaymentRequest
https://bugs.webkit.org/show_bug.cgi?id=163462
rdar://problem/28567629
Reviewed by Dan Bernstein.
Add new SPI.
* platform/spi/cocoa/PassKitSPI.h:
2016-10-14 Dean Jackson <dino@apple.com>
CSS parsing should use Color not RGBA32
https://bugs.webkit.org/show_bug.cgi?id=163423
<rdar://problem/28766903>
Reviewed by Simon Fraser.
Re-landing this after it was rolled out in https://trac.webkit.org/r207342.
In order to allow CSS to use the ExtendedColor variant of
Color, we need to stop using RGBA32. This is a fairly big
change that goes through all the places in the parser
related to colors, and moves them from RGBA32 to Color.
No change in functionality, so covered by existing tests.
* WebCore.xcodeproj/project.pbxproj: Add the new ColorHash.h file.
* css/CSSPrimitiveValue.cpp: CSSPrimitiveValue now can hold a Color*
rather than an unsigned int for colors.
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::cleanup):
(WebCore::CSSPrimitiveValue::getRGBColorValue):
(WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText):
(WebCore::CSSPrimitiveValue::cloneForCSSOM):
(WebCore::CSSPrimitiveValue::equals):
* css/CSSPrimitiveValue.h: Move to Color* and also use some
nullptrs.
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Add a new inline
constructor.
* css/CSSValuePool.cpp: Move to Color.
(WebCore::CSSValuePool::CSSValuePool):
(WebCore::CSSValuePool::createColorValue):
* css/CSSValuePool.h: Change the ColorValueCache to a new type.
* css/StyleResolver.cpp: Move to Color.
(WebCore::StyleResolver::colorFromPrimitiveValue):
* css/parser/CSSParser.cpp:
(WebCore::parseColorValue):
(WebCore::CSSParser::parseColor):
(WebCore::CSSParser::parseColorFromString):
(WebCore::CSSParser::parseSystemColor):
(WebCore::fastParseColorInternal):
(WebCore::CSSParser::fastParseColor):
(WebCore::CSSParser::parseColorFromValue):
* css/parser/CSSParser.h:
* css/parser/CSSParserFastPaths.cpp:
(WebCore::fastParseColorInternal):
(WebCore::CSSParserFastPaths::parseColor):
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::consumeColor):
* css/parser/SVGCSSParser.cpp:
(WebCore::CSSParser::parseSVGValue):
(WebCore::CSSParser::parseSVGPaint):
(WebCore::CSSParser::parseSVGColor):
* editing/EditingStyle.cpp:
(WebCore::cssValueToColor):
(WebCore::textColorFromStyle):
(WebCore::backgroundColorFromStyle):
(WebCore::rgbaBackgroundColorInEffect):
(WebCore::EditingStyle::prepareToApplyAt):
(WebCore::isTransparentColorValue):
(WebCore::cssValueToRGBA): Deleted.
* editing/cocoa/HTMLConverter.mm:
(HTMLConverterCaches::colorPropertyValueForNode):
* html/HTMLBodyElement.cpp:
(WebCore::HTMLBodyElement::parseAttribute):
* html/canvas/CanvasGradient.cpp:
(WebCore::CanvasGradient::addColorStop):
* html/canvas/CanvasRenderingContext2D.cpp: Ditto, but leave a FIXME to
remind myself to come back when colorWithOverrideAlpha has been updated.
(WebCore::CanvasRenderingContext2D::setStrokeStyle):
(WebCore::CanvasRenderingContext2D::setFillStyle):
(WebCore::CanvasRenderingContext2D::setShadowColor):
(WebCore::CanvasRenderingContext2D::setShadow):
* html/canvas/CanvasStyle.cpp:
(WebCore::isCurrentColorString):
(WebCore::parseColor):
(WebCore::currentColor):
(WebCore::parseColorOrCurrentColor):
(WebCore::CanvasStyle::createFromString):
(WebCore::CanvasStyle::createFromStringWithOverrideAlpha):
* html/canvas/CanvasStyle.h:
* svg/SVGColor.cpp:
(WebCore::SVGColor::colorFromRGBColorString):
* platform/graphics/Color.h: Add new constructors for the special
empty and deleted Color values used in HashTables.
(WebCore::Color::Color):
(WebCore::Color::isHashTableDeletedValue):
(WebCore::Color::asUint64): New accessor to get the raw uint64_t value.
* platform/graphics/ColorHash.h: Added. Implement the traits for a Color HashTable.
(WTF::ColorHash::hash):
(WTF::ColorHash::equal):
(WTF::HashTraits<WebCore::Color>::emptyValue):
(WTF::HashTraits<WebCore::Color>::constructDeletedValue):
(WTF::HashTraits<WebCore::Color>::isDeletedValue):
2016-10-14 Brent Fulgham <bfulgham@apple.com>
[Win][Direct2D] Implement basic SVG support
https://bugs.webkit.org/show_bug.cgi?id=163349
Reviewed by Brent Fulgham.
Direct2D needs access to the target graphics context when generating bitmap
images so that it can properly match pixel format and other settings.
Add implementations for a number of drawing primitives used in the SVG
test cases. Correct some differences between CG and Direct2D for drawing
different primitives.
No new tests. Tested by existing 'svg' tests.
* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::frameImageAtIndex): Take optional target graphics
context. Also pass the graphics context to the image decoder.
(WebCore::BitmapImage::nativeImage): Accept an optional target context.
(WebCore::BitmapImage::nativeImageForCurrentFrame): Ditto.
(WebCore::BitmapImage::draw): Pass target graphics context to the
'frameImageAtIndex' method.
* platform/graphics/BitmapImage.h:
* platform/graphics/Image.h:
* platform/graphics/ImageBuffer.cpp:
(WebCore::ImageBuffer::create): Moved from header. Add create function that
takes an optional GraphicsContext argument.
* platform/graphics/ImageBuffer.h:
* platform/graphics/ImageFrameCache.cpp: Add missing include needed to build
under Direct2D.
* platform/graphics/ImageSource.cpp:
(WebCore::ImageSource::setDecoderTargetContext): Added.
(WebCore::ImageSource::setRenderTarget): Deleted.
* platform/graphics/ImageSource.h:
* platform/graphics/Pattern.h:
* platform/graphics/win/GraphicsContextDirect2D.cpp:
(WebCore::GraphicsContextPlatformPrivate::endDraw): Log error state instead of crashing
each time.
(WebCore::GraphicsContext::drawEllipse): Ellipses are defined in D2D as a center, an
X-radius, and a Y-radius.
(WebCore::GraphicsContext::applyStrokePattern):
(WebCore::GraphicsContext::applyFillPattern):
(WebCore::GraphicsContext::clearRect): Use 'Clear' function if possible. Don't clear
anything if the clear rect is outside the drawing area.
(WebCore::GraphicsContext::strokeRect): Provide implementation (needed by SVG).
(WebCore::GraphicsContext::platformFillEllipse): Ellipses are defined in D2D as
a center, an X-radius, and a Y-radius.
(WebCore::GraphicsContext::platformStrokeEllipse): Ditto.
* platform/graphics/win/ImageBufferDirect2D.cpp:
(WebCore::ImageBuffer::createCompatibleBuffer): Accept optional GraphicsContext argument.
(WebCore::ImageBuffer::ImageBuffer): Ditto.
* platform/graphics/win/ImageDecoderDirect2D.cpp:
(WebCore::ImageDecoder::setTargetContext): Renamed from 'setRenderTarget'.
(WebCore::ImageDecoder::createFrameImageAtIndex): Take optional GraphicsContext argument.
(WebCore::ImageDecoder::setRenderTarget): Deleted.
* platform/graphics/win/ImageDecoderDirect2D.h:
* platform/graphics/win/ImageDirect2D.cpp:
(WebCore::BitmapImage::setRenderTarget): Deleted.
* platform/graphics/win/NativeImageDirect2D.cpp: Add missing include.
* platform/graphics/win/PatternDirect2D.cpp:
(WebCore::Pattern::createPlatformPattern): Revise for new signature.
* rendering/FilterEffectRenderer.cpp:
(WebCore::FilterEffectRenderer::allocateBackingStoreIfNeeded): Pass GraphicsContext
to ImageBuffer constructor.
(WebCore::FilterEffectRendererHelper::beginFilterEffect): Pass target context to
filter when allocating backing store.
* rendering/FilterEffectRenderer.h: Add GraphicsContext as argument to constructor.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::hasFilterThatIsPainting): Supply GraphicsContext argument when
building new FilterEffectRenderer and helper.
(WebCore::RenderLayer::setupFilters): Ditto.
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::nativeImageForCurrentFrame): Revise to take optional GraphicsContext
argument.
(WebCore::SVGImage::nativeImage): Ditto.
* svg/graphics/SVGImage.h:
* svg/graphics/SVGImageForContainer.cpp:
(WebCore::SVGImageForContainer::nativeImageForCurrentFrame): Ditto.
* svg/graphics/SVGImageForContainer.h:
2016-10-14 Chris Dumez <cdumez@apple.com>
Unreviewed, rolling out r207319.
Regressed Dromaeo and may have caused crashes under
GuardMalloc (rdar://problem/28780835)
Reverted changeset:
"[Web IDL] Add support for [SameObject] extended attribute"
https://bugs.webkit.org/show_bug.cgi?id=163414
http://trac.webkit.org/changeset/207319
2016-10-14 Anders Carlsson <andersca@apple.com>
Clean up BackForwardClient
https://bugs.webkit.org/show_bug.cgi?id=163454
Reviewed by Sam Weinig.
Remove iOS specific member functions that are only used from WebKit.
* history/BackForwardClient.h:
* loader/EmptyClients.cpp:
2016-10-13 Anders Carlsson <andersca@apple.com>
Move BackForwardList from WebCore to WebKitLegacy
https://bugs.webkit.org/show_bug.cgi?id=163418
Reviewed by Tim Horton.
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* history/BackForwardController.cpp:
(WebCore::BackForwardController::BackForwardController):
* history/BackForwardController.h:
* loader/EmptyClients.cpp:
(WebCore::fillWithEmptyClients):
* page/Page.cpp:
(WebCore::Page::Page):
2016-10-14 Manuel Rego Casasnovas <rego@igalia.com>
[css-grid] Changing the argument on fit-content() doesn't cause the grid to be relayout
https://bugs.webkit.org/show_bug.cgi?id=163434
Reviewed by Sergio Villar Senin.
When fit-content() was implemented a new attribute
m_fitContentTrackBreadth was added to GridTrackSize.
However we forgot to include it in the == operator implementation,
so we were missing the changes on that value.
Now if you change the argument of a fit-content() track,
the track size is properly recomputed.
Test: fast/css-grid-layout/grid-change-fit-content-argument.html
* rendering/style/GridTrackSize.h:
(WebCore::GridTrackSize::operator==): Check m_fitContentTrackBreadth.
2016-10-14 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r207317.
https://bugs.webkit.org/show_bug.cgi?id=163448
This change caused an existing LayoutTest to fail on all
platforms (Requested by ryanhaddad on #webkit).
Reverted changeset:
"CSS parsing should use Color not RGBA32"
https://bugs.webkit.org/show_bug.cgi?id=163423
http://trac.webkit.org/changeset/207317
2016-10-14 Antti Koivisto <antti@apple.com>
Share inline stylesheets between shadow trees
https://bugs.webkit.org/show_bug.cgi?id=163353
Reviewed by Ryosuke Niwa and Andreas Kling.
If shadow trees have identical inline stylesheets the data structures can be shared.
In future this will also allow sharing style resolvers.
* css/CSSStyleSheet.cpp:
(WebCore::CSSStyleSheet::createInline):
Move StyleSheetContents construction to the client.
* css/parser/CSSParserMode.h:
(WebCore::CSSParserContextHash::hash):
(WebCore::CSSParserContextHash::equal):
(WTF::HashTraits<WebCore::CSSParserContext>::constructDeletedValue):
(WTF::HashTraits<WebCore::CSSParserContext>::isDeletedValue):
(WTF::HashTraits<WebCore::CSSParserContext>::emptyValue):
Make CSSParserContext hashable.
* dom/ExtensionStyleSheets.cpp:
(WebCore::createExtensionsStyleSheet):
(WebCore::ExtensionStyleSheets::pageUserSheet):
(WebCore::ExtensionStyleSheets::updateInjectedStyleSheetCache):
Don't use CSSStyleSheet::createInline, these are not really inline stylesheets.
Code cleanups.
* dom/InlineStyleSheetOwner.cpp:
(WebCore::parserContextForForElement):
(WebCore::makeInlineStyleSheetCacheKey):
(WebCore::inlineStyleSheetCache):
Implement a simple cache for sharing stylesheets with identical text and context.
(WebCore::InlineStyleSheetOwner::createSheet):
(WebCore::InlineStyleSheetOwner::clearCache):
* dom/InlineStyleSheetOwner.h:
* platform/MemoryPressureHandler.cpp:
(WebCore::MemoryPressureHandler::releaseNoncriticalMemory):
2016-10-14 Chris Dumez <cdumez@apple.com>
[Mac] Allow throttling of background tabs that have media elements with no audible audio
https://bugs.webkit.org/show_bug.cgi?id=163402
<rdar://problem/28056151>
Reviewed by Gavin Barraclough.
Allow throttling of background tabs that have media elements with no audible audio.
We were taking an media assertion from the PageThrottler as soon as there was a
media element playing on the page. This prevented throttling of background tabs
even if those media elements had no audible audio, which was unfortunate.
We now have more fine-grained rules for when HTMLMediaElement should take an
assertion. I also added release logging to help debug such issues in the
future.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::setMuted):
(WebCore::HTMLMediaElement::updateVolume):
(WebCore::HTMLMediaElement::updatePlayState):
(WebCore::HTMLMediaElement::updateAudioAssertionState):
(WebCore::HTMLMediaElement::effectiveMuted): Deleted.
* html/HTMLMediaElement.h:
2016-10-14 Romain Bellessort <romain.bellessort@crf.canon.fr>
[Readable Streams API] Cleanup patch, fix small inconsistencies
https://bugs.webkit.org/show_bug.cgi?id=163329
Reviewed by Youenn Fablet.
Cleanup patch, fixed 3 small inconsistences between implementation and spec.
No change in behaviour.
* Modules/streams/ReadableStream.idl: Added optional parameter in getReader.
* Modules/streams/ReadableStreamDefaultController.js:
(error): Call readableStreamDefaultControllerError instead of readableStreamError.
* Modules/streams/ReadableStreamInternals.js: Added missing ASSERT in readableStreamDefaultControllerCallPullIfNeeded.
2016-10-14 Youenn Fablet <youenn@apple.com>
http://trac.webkit.org/changeset/207330 broke Mac Windows build
https://bugs.webkit.org/show_bug.cgi?id=163442
Unreviewed.
* platform/network/cf/ResourceRequestCFNet.cpp:
(WebCore::toPlatformRequestCachePolicy): Do not explicitly use CFURLRequestCachePolicy enumeration values.
2016-10-14 Zan Dobersek <zdobersek@igalia.com>
[Cairo] GraphicsContext3D::ImageExtractor fails to extract images
https://bugs.webkit.org/show_bug.cgi?id=163439
Reviewed by Carlos Garcia Campos.
In the Cairo implementation of GraphicsContext3D::ImageExtractor,
don't check for frame completeness at index 0. This information
is now cached only after the frame for that index is decoded and
marked as completed, which is done after this check.
Becuase of this the current check forces extractImage() to return
early and abort WebGL texture uploads from image sources.
This bug was most likely exposed after the refactoring in r206481.
https://trac.webkit.org/changeset/206481
* platform/graphics/cairo/GraphicsContext3DCairo.cpp:
(WebCore::GraphicsContext3D::ImageExtractor::extractImage):
2016-10-14 Youenn Fablet <youenn@apple.com>
MediaResourceLoader should use CachedResource::ressourceError to do CORS checks
https://bugs.webkit.org/show_bug.cgi?id=163279
Reviewed by Darin Adler.
Covered by existing tests.
* loader/MediaResourceLoader.cpp:
(WebCore::MediaResource::responseReceived): Making use of CachedResource::ressourceError to detect CORS failures.
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::shouldUpdateCachedResourceWithCurrentRequest): Activating loader options checks
before reusing the resource.
(WebCore::isResourceSuitableForDirectReuse): Disabling direct reuse of MediaResource since reuse of raw
resources does not work yet for media resources.
2016-10-14 Youenn Fablet <youenn@apple.com>
Make NetworkCache aware of fetch cache mode
https://bugs.webkit.org/show_bug.cgi?id=163332
Reviewed by Antti Koivisto.
Tests: imported/w3c/web-platform-tests/fetch/api/request/request-cache-default-conditional.html
imported/w3c/web-platform-tests/fetch/api/request/request-cache-default.html
imported/w3c/web-platform-tests/fetch/api/request/request-cache-force-cache.html
imported/w3c/web-platform-tests/fetch/api/request/request-cache-no-cache.html
imported/w3c/web-platform-tests/fetch/api/request/request-cache-no-store.html
imported/w3c/web-platform-tests/fetch/api/request/request-cache-only-if-cached.html
imported/w3c/web-platform-tests/fetch/api/request/request-cache-reload.html
* loader/cache/CachedResourceLoader.cpp:
(WebCore::updateRequestAccordingCacheMode): Setting request cache policy according cache mode.
Basically, these two are about the same.
(WebCore::CachedResourceLoader::determineRevalidationPolicy): Making use of cache policy instead of cache mode.
* platform/network/ResourceRequestBase.h: Adding new cache policies, aligned with fetch cache modes.
* platform/network/cf/ResourceRequestCFNet.cpp:
(WebCore::toPlatformRequestCachePolicy): If policy is not supported by CFNetwork, fallback to ReloadIgnoringCacheData.
This is the best approximate we might find.
(WebCore::ResourceRequest::doUpdatePlatformHTTPBody):
(WebCore::ResourceRequest::doUpdateResourceRequest): Only updating cache policy, if cache policy is the default.
* platform/network/cf/ResourceRequestCFNet.h:
* platform/network/cocoa/ResourceRequestCocoa.mm: Doing the same modifications as for ResourceRequestCFNet.
(WebCore::ResourceRequest::doUpdateResourceRequest):
(WebCore::toPlatformRequestCachePolicy):
(WebCore::ResourceRequest::doUpdatePlatformRequest):
2016-10-13 Youenn Fablet <youenn@apple.com>
Binding generated code for private operations should assert for casted-this checks
https://bugs.webkit.org/show_bug.cgi?id=163326
Reviewed by Darin Adler.
Covered by existing tests.
Private operations are not exposed to user scripts and are only called by built-in scripts or other WebKit-controlled code.
The call sites already ensure that the caller is of the right type so there is no need to do that work twice.
Introducing a casted-this-error Assert mode for casted-this checks, which may be reused for other binding generated code.
Updated binding generator to use that mode for private operations.
* bindings/js/JSDOMBinding.h:
(WebCore::BindingCaller::callPromiseOperation):
(WebCore::BindingCaller::callOperation):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
* bindings/scripts/test/JS/JSTestGlobalObject.cpp:
(WebCore::jsTestGlobalObjectInstanceFunctionTestPrivateFunction):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjPrototypeFunctionPrivateMethod):
2016-10-13 Carlos Garcia Campos <cgarcia@igalia.com>
WebView and WebPage URLs not updated after URL is modified by InjectedBundlePageResourceLoadClient::willSendRequestForFrame
https://bugs.webkit.org/show_bug.cgi?id=146306
Reviewed by Darin Adler.
Notify about the provisional URL change when new request set for main resource load in DocumentLoader has a
different URL than the previous one.
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::setRequest):
2016-10-13 Youenn Fablet <youenn@apple.com>
Update serializer and iterator binding generated code
https://bugs.webkit.org/show_bug.cgi?id=163325
Reviewed by Darin Adler.
No change of behavior.
Covered by existing tests and rebased binding generated code.
Making use of BindingCaller::callOperation within serializer and iterator operations.
Refactored serializer code to use direct attribute getters.
* bindings/js/JSDOMIterator.h:
(WebCore::iteratorCreate):
(WebCore::iteratorForEach):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateSerializerFunction):
(GenerateImplementationIterableFunctions):
* bindings/scripts/test/JS/JSTestIterable.cpp:
(WebCore::jsTestIterablePrototypeFunctionSymbolIteratorCaller):
(WebCore::jsTestIterablePrototypeFunctionSymbolIterator):
(WebCore::jsTestIterablePrototypeFunctionEntriesCaller):
(WebCore::jsTestIterablePrototypeFunctionEntries):
(WebCore::jsTestIterablePrototypeFunctionKeysCaller):
(WebCore::jsTestIterablePrototypeFunctionKeys):
(WebCore::jsTestIterablePrototypeFunctionValuesCaller):
(WebCore::jsTestIterablePrototypeFunctionValues):
(WebCore::jsTestIterablePrototypeFunctionForEachCaller):
(WebCore::jsTestIterablePrototypeFunctionForEach):
* bindings/scripts/test/JS/JSTestNode.cpp:
(WebCore::jsTestNodePrototypeFunctionSymbolIteratorCaller):
(WebCore::jsTestNodePrototypeFunctionSymbolIterator):
(WebCore::jsTestNodePrototypeFunctionEntriesCaller):
(WebCore::jsTestNodePrototypeFunctionEntries):
(WebCore::jsTestNodePrototypeFunctionKeysCaller):
(WebCore::jsTestNodePrototypeFunctionKeys):
(WebCore::jsTestNodePrototypeFunctionValuesCaller):
(WebCore::jsTestNodePrototypeFunctionValues):
(WebCore::jsTestNodePrototypeFunctionForEachCaller):
(WebCore::jsTestNodePrototypeFunctionForEach):
(WebCore::jsTestNodePrototypeFunctionToJSON):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjPrototypeFunctionToJSON):
2016-10-13 Alex Christensen <achristensen@webkit.org>
Fix API test after r207318.
https://bugs.webkit.org/show_bug.cgi?id=162951
This fixes the API test WebKit2.PendingAPIRequestURL which asserted when trying to hash a null String.
* loader/DocumentLoader.cpp:
(WebCore::isRemoteWebArchive):
If the mimeType is a null String, it is not in the set webArchiveMIMETypes, so return false instead of hashing it.
2016-10-13 Alex Christensen <achristensen@webkit.org>
Hosts of URLs with non-special schemes should be case-sensitive, and non-ASCII characters in such hosts should be punycode-encoded
https://bugs.webkit.org/show_bug.cgi?id=163413
Reviewed by Tim Horton.
This retains compatibility with the canonicalization Chrome, Firefox, and Safari with uppercase characters
in the hosts of URLs with unrecognized schemes. Safari treats such characters as the host, while Firefox
and Chrome treat such characters as part of the path, starting with the "//" after the ':'
Behavior of non-ASCII characters is inconsistent, and since we need to have a host, we should punycode-encode
the host to be consistent with special schemes because percent-encoding hosts sometimes is inconsistent.
This solution was proposed to the spec in https://github.com/whatwg/url/issues/148
Covered by updated API and layout tests.
* platform/URLParser.cpp:
(WebCore::URLParser::parse):
(WebCore::URLParser::percentDecode):
(WebCore::URLParser::domainToASCII):
(WebCore::URLParser::hasInvalidDomainCharacter):
(WebCore::URLParser::parseHostAndPort):
(WebCore::URLParser::formURLDecode):
(WebCore::percentDecode): Deleted.
(WebCore::domainToASCII): Deleted.
(WebCore::hasInvalidDomainCharacter): Deleted.
(WebCore::formURLDecode): Deleted.
* platform/URLParser.h:
2016-10-13 Chris Dumez <cdumez@apple.com>
[Web IDL] Add support for [SameObject] extended attribute
https://bugs.webkit.org/show_bug.cgi?id=163414
Reviewed by Darin Adler.
Add support for [SameObject] Web IDL extended attribute:
- https://heycam.github.io/webidl/#SameObject
Start using it on DOM / HTML attributes where the specification
mandates it.
Test: js/dom/SameObject-support.html
* bindings/scripts/CodeGeneratorJS.pm:
(ShouldCacheAttribute):
(GenerateHeader):
(GenerateImplementation):
* bindings/scripts/IDLAttributes.txt:
* dom/DataTransfer.idl:
* dom/Document.idl:
* dom/Element.idl:
* dom/MutationRecord.idl:
* dom/Node.idl:
* dom/NodeIterator.idl:
* dom/ParentNode.idl:
* dom/TreeWalker.idl:
* html/HTMLAnchorElement.idl:
* html/HTMLAreaElement.idl:
* html/HTMLButtonElement.idl:
* html/HTMLDataListElement.idl:
* html/HTMLDocument.idl:
* html/HTMLElement.idl:
* html/HTMLFieldSetElement.idl:
* html/HTMLFormElement.idl:
* html/HTMLIFrameElement.idl:
* html/HTMLInputElement.idl:
* html/HTMLKeygenElement.idl:
* html/HTMLLinkElement.idl:
* html/HTMLMapElement.idl:
* html/HTMLMediaElement.idl:
* html/HTMLMeterElement.idl:
* html/HTMLOutputElement.idl:
* html/HTMLProgressElement.idl:
* html/HTMLSelectElement.idl:
* html/HTMLTableElement.idl:
* html/HTMLTableRowElement.idl:
* html/HTMLTableSectionElement.idl:
* html/HTMLTextAreaElement.idl:
* page/Location.idl:
* page/Navigator.idl:
2016-10-13 Andy Estes <aestes@apple.com>
[iOS] Support Web Archive previews generated by QuickLook
https://bugs.webkit.org/show_bug.cgi?id=162951
<rdar://problem/28607920>
Reviewed by Brady Eidson.
QuickLook might generate a Web Archive preview for some resource types, but WebKit would
refuse to load it due to the prohibition on loading remote Web Archives. Even though the
original resource might be from a remote origin, the QuickLook-generated preview is a
trusted local resource, so allow it to be loaded.
No test possible.
* loader/DocumentLoader.cpp:
(WebCore::isRemoteWebArchive): Added. Moved the remote web archive check from
continueAfterContentPolicy() to here, and added a check for responses containing the
QuickLook preview protocol.
(WebCore::DocumentLoader::continueAfterContentPolicy): Called isRemoteWebArchive().
2016-10-13 Dean Jackson <dino@apple.com>
CSS parsing should use Color not RGBA32
https://bugs.webkit.org/show_bug.cgi?id=163423
<rdar://problem/28766903>
Reviewed by Simon Fraser.
In order to allow CSS to use the ExtendedColor variant of
Color, we need to stop using RGBA32. This is a fairly big
change that goes through all the places in the parser
related to colors, and moves them from RGBA32 to Color.
No change in functionality, so covered by existing tests.
* WebCore.xcodeproj/project.pbxproj: Add the new ColorHash.h file.
* css/CSSPrimitiveValue.cpp: CSSPrimitiveValue now can hold a Color*
rather than an unsigned int for colors.
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::cleanup):
(WebCore::CSSPrimitiveValue::getRGBColorValue):
(WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText):
(WebCore::CSSPrimitiveValue::cloneForCSSOM):
(WebCore::CSSPrimitiveValue::equals):
* css/CSSPrimitiveValue.h: Move to Color* and also use some
nullptrs.
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Add a new inline
constructor.
* css/CSSValuePool.cpp: Move to Color.
(WebCore::CSSValuePool::CSSValuePool):
(WebCore::CSSValuePool::createColorValue):
* css/CSSValuePool.h: Change the ColorValueCache to a new type.
* css/StyleResolver.cpp: Move to Color.
(WebCore::StyleResolver::colorFromPrimitiveValue):
* css/parser/CSSParser.cpp:
(WebCore::parseColorValue):
(WebCore::CSSParser::parseColor):
(WebCore::CSSParser::parseColorFromString):
(WebCore::CSSParser::parseSystemColor):
(WebCore::fastParseColorInternal):
(WebCore::CSSParser::fastParseColor):
(WebCore::CSSParser::parseColorFromValue):
* css/parser/CSSParser.h:
* css/parser/CSSParserFastPaths.cpp:
(WebCore::fastParseColorInternal):
(WebCore::CSSParserFastPaths::parseColor):
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::consumeColor):
* css/parser/SVGCSSParser.cpp:
(WebCore::CSSParser::parseSVGValue):
(WebCore::CSSParser::parseSVGPaint):
(WebCore::CSSParser::parseSVGColor):
* editing/EditingStyle.cpp:
(WebCore::cssValueToColor):
(WebCore::textColorFromStyle):
(WebCore::backgroundColorFromStyle):
(WebCore::rgbaBackgroundColorInEffect):
(WebCore::EditingStyle::prepareToApplyAt):
(WebCore::isTransparentColorValue):
(WebCore::cssValueToRGBA): Deleted.
* editing/cocoa/HTMLConverter.mm:
(HTMLConverterCaches::colorPropertyValueForNode):
* html/HTMLBodyElement.cpp:
(WebCore::HTMLBodyElement::parseAttribute):
* html/canvas/CanvasGradient.cpp:
(WebCore::CanvasGradient::addColorStop):
* html/canvas/CanvasRenderingContext2D.cpp: Ditto, but leave a FIXME to
remind myself to come back when colorWithOverrideAlpha has been updated.
(WebCore::CanvasRenderingContext2D::setStrokeStyle):
(WebCore::CanvasRenderingContext2D::setFillStyle):
(WebCore::CanvasRenderingContext2D::setShadowColor):
(WebCore::CanvasRenderingContext2D::setShadow):
* html/canvas/CanvasStyle.cpp:
(WebCore::isCurrentColorString):
(WebCore::parseColor):
(WebCore::currentColor):
(WebCore::parseColorOrCurrentColor):
(WebCore::CanvasStyle::createFromString):
(WebCore::CanvasStyle::createFromStringWithOverrideAlpha):
* html/canvas/CanvasStyle.h:
* svg/SVGColor.cpp:
(WebCore::SVGColor::colorFromRGBColorString):
* platform/graphics/Color.h: Add new constructors for the special
empty and deleted Color values used in HashTables.
(WebCore::Color::Color):
(WebCore::Color::isHashTableDeletedValue):
(WebCore::Color::asUint64): New accessor to get the raw uint64_t value.
* platform/graphics/ColorHash.h: Added. Implement the traits for a Color HashTable.
(WTF::ColorHash::hash):
(WTF::ColorHash::equal):
(WTF::HashTraits<WebCore::Color>::emptyValue):
(WTF::HashTraits<WebCore::Color>::constructDeletedValue):
(WTF::HashTraits<WebCore::Color>::isDeletedValue):
2016-10-13 Nan Wang <n_wang@apple.com>
AX: [Mac] better accessibility support for Summary elements
https://bugs.webkit.org/show_bug.cgi?id=163367
<rdar://problem/28745010>
Reviewed by Chris Fleizach.
Exposed summary elements as AXButton and used the text node's content
as AXTitle. Also exposed the details parent's expanded status on the summary
element, so that users would see it as a collapsed/expanded button.
Changes are covered in the modified tests.
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::parentObjectUnignored):
(WebCore::AccessibilityObject::scrollViewAncestor):
(WebCore::AccessibilityObject::headingElementForNode):
(WebCore::AccessibilityObject::matchedParent):
(WebCore::AccessibilityObject::isDescendantOfObject):
(WebCore::AccessibilityObject::isInsideARIALiveRegion):
(WebCore::AccessibilityObject::elementAccessibilityHitTest):
(WebCore::AccessibilityObject::isExpanded):
(WebCore::AccessibilityObject::isARIAHidden):
(WebCore::AccessibilityObject::focusableAncestor):
(WebCore::AccessibilityObject::editableAncestor):
* accessibility/AccessibilityObject.h:
(WebCore::AccessibilityObject::isSummary):
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper _accessibilityListAncestor]):
(-[WebAccessibilityObjectWrapper _accessibilityLandmarkAncestor]):
(-[WebAccessibilityObjectWrapper _accessibilityTableAncestor]):
(-[WebAccessibilityObjectWrapper _accessibilityFieldsetAncestor]):
(-[WebAccessibilityObjectWrapper tableCellParent]):
(-[WebAccessibilityObjectWrapper tableParent]):
(-[WebAccessibilityObjectWrapper convertPointToScreenSpace:]):
(-[WebAccessibilityObjectWrapper convertRectToScreenSpace:]):
(-[WebAccessibilityObjectWrapper detailParentForSummaryObject:]):
(-[WebAccessibilityObjectWrapper detailParentForObject:]):
(matchedParent): Deleted.
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper additionalAccessibilityAttributeNames]):
(createAccessibilityRoleMap):
(-[WebAccessibilityObjectWrapper roleDescription]):
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
2016-10-13 Zalan Bujtas <zalan@apple.com>
[Clean RenderTree] LayoutTests/imported/blink/fast/table/crash-bad-child-table-continuation.html fails.
https://bugs.webkit.org/show_bug.cgi?id=163399
Reviewed by David Hyatt.
When we try to insert a renderer before a child whose direct parent is a (anonymus) RenderTable, continuation logic
should dismiss the RenderTable as the parent and find a more appropriate ancestor.
RenderTables assumes a certain descendant tree structure which might not be available in the continuation.
Will be testable with webkit.org/b/162834
* rendering/RenderInline.cpp:
(WebCore::canUseAsParentForContinuation):
(WebCore::RenderInline::addChildToContinuation):
2016-10-13 Alex Christensen <achristensen@webkit.org>
Disable URLParser for non-Safari iOS and Mac apps for now
https://bugs.webkit.org/show_bug.cgi?id=163397
Reviewed by Tim Horton.
r207268 was an awful hack, and it was insufficient.
Disable the URLParser for other apps for now. Hopefully we can enable it everywhere soon.
No change in behavior for testing infrastructure.
Old URLs were well tested before making the switch, and nothing has changed for them.
* platform/URLParser.cpp:
(WebCore::URLParser::parse):
(WebCore::URLParser::parseHostAndPort):
(WebCore::URLParser::setEnabled):
(WebCore::URLParser::enabled):
* platform/URLParser.h:
2016-10-13 Chris Dumez <cdumez@apple.com>
Rename [ConstructorTemplate=*] to [LegacyConstructorTemplate=*]
https://bugs.webkit.org/show_bug.cgi?id=163390
Reviewed by Darin Adler.
Rename [ConstructorTemplate=*] to [LegacyConstructorTemplate=*] as the
modern way of doing this is to use a constructor that takes in a
dictionary. I am working on getting rid of this extended attribute
entirely but the remaining uses require better support for union types.
* Modules/applepay/ApplePayValidateMerchantEvent.idl:
* Modules/indexeddb/IDBVersionChangeEvent.idl:
* Modules/mediastream/RTCTrackEvent.idl:
* bindings/scripts/CodeGenerator.pm:
(IsConstructorTemplate):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateConstructorDefinition):
(IsConstructable):
* bindings/scripts/IDLAttributes.txt:
* dom/Event.idl:
* dom/ProgressEvent.idl:
* dom/UIEvent.idl:
* html/track/TrackEvent.idl:
2016-10-13 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r207297.
This change broke the iOS build.
Reverted changeset:
"Disable URLParser for non-Safari iOS and Mac apps for now"
https://bugs.webkit.org/show_bug.cgi?id=163397
http://trac.webkit.org/changeset/207297
2016-10-13 Anders Carlsson <andersca@apple.com>
Get rid of the HistoryItemVector typedef
https://bugs.webkit.org/show_bug.cgi?id=163398
Reviewed by Beth Dakin.
Expand the HistoryitemVector typedef instead to make it more clear what types we are dealing with.
* history/BackForwardList.cpp:
(WebCore::BackForwardList::backListWithLimit):
(WebCore::BackForwardList::forwardListWithLimit):
(WebCore::BackForwardList::entries):
* history/BackForwardList.h:
* history/HistoryItem.cpp:
(WebCore::HistoryItem::children):
* history/HistoryItem.h:
* loader/HistoryController.cpp:
(WebCore::HistoryController::currentFramesMatchItem):
2016-10-13 Antoine Quint <graouts@apple.com>
[Modern Media Controls] MediaControls base class
https://bugs.webkit.org/show_bug.cgi?id=163387
<rdar://problem/28753955>
Reviewed by Dean Jackson.
Introducing the new MediaControls class which will serve as a basis for all media controls.
We will introduce specific MediaControls subclasses for macOS inline, macOS fullscreen and
iOS inline in future patches.
Tests: media/modern-media-controls/media-controls/media-controls-constructor.html
media/modern-media-controls/media-controls/media-controls-placard.html
media/modern-media-controls/media-controls/media-controls-start-button.html
* Modules/modern-media-controls/controls/media-controls.css: Added.
(.media-controls,):
* Modules/modern-media-controls/controls/media-controls.js: Added.
(MediaControls.):
(MediaControls.prototype.get showsStartButton):
(MediaControls.prototype.set showsStartButton):
(MediaControls.prototype.get showsPlacard):
(MediaControls.prototype.showPlacard):
(MediaControls.prototype.hidePlacard):
2016-10-13 Alex Christensen <achristensen@webkit.org>
Disable URLParser for non-Safari iOS and Mac apps for now
https://bugs.webkit.org/show_bug.cgi?id=163397
Reviewed by Tim Horton.
r207268 was an awful hack, and it was insufficient.
Disable the URLParser for other apps for now. Hopefully we can enable it everywhere soon.
No change in behavior for testing infrastructure.
Old URLs were well tested before making the switch, and nothing has changed for them.
* platform/URLParser.cpp:
(WebCore::URLParser::parse):
(WebCore::URLParser::parseHostAndPort):
(WebCore::URLParser::setEnabled):
(WebCore::URLParser::enabled):
* platform/URLParser.h:
2016-10-13 Antoine Quint <graouts@apple.com>
[Modern Media Controls] TimeControl and TimeLabel
https://bugs.webkit.org/show_bug.cgi?id=163356
<rdar://problem/28741376>
Reviewed by Dean Jackson.
We introduce the TimeControl and TimeLabel classes. A TimeControl object
provides two TimeLabels, one for the elapsed time, one for the remaining
time, and a Scrubber in between them. Depending on a TimeControl's width,
it will adjust its layout such that the scrubber takes all the available
space between the labels, and can indicate whether it's large enough to
meet the minimal required width to show the scrubber, such that a container
node may decide not to show the TimeControl at all.
TimeLabel nodes simply show an integer time value in miliseconds in a
nicely formatted way.
Tests: media/modern-media-controls/time-control/time-control.html
media/modern-media-controls/time-label/time-label.html
* Modules/modern-media-controls/controls/time-control.js: Added.
(TimeControl.prototype.get width):
(TimeControl.prototype.set width):
(TimeControl.prototype.get isSufficientlyWide):
* Modules/modern-media-controls/controls/time-label.css: Added.
(.time-label):
* Modules/modern-media-controls/controls/time-label.js: Added.
(TimeLabel.prototype.get value):
(TimeLabel.prototype.set value):
(TimeLabel.prototype.commitProperty):
(TimeLabel.prototype._formattedTime):
2016-10-13 Jer Noble <jer.noble@apple.com>
CRASH at WebCore::SourceBuffer::removeCodedFrames + 37
https://bugs.webkit.org/show_bug.cgi?id=163336
Reviewed by Alex Christensen.
Test: media/media-source/media-source-remove-crash.html
A null-deref crash can occur if a SourceBuffer is removed from a MediaSource after
SourceBuffer.remove() is called, but before the removeTimer is fired.
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::removeTimerFired):
2016-10-13 Michael Catanzaro <mcatanzaro@igalia.com>
[SOUP] SHOULD NEVER BE REACHED ../../Source/WebCore/platform/URL.cpp(1291) : void WebCore::URL::parse(const WTF::String&)
https://bugs.webkit.org/show_bug.cgi?id=163392
Reviewed by Alex Christensen.
Fix the URL constructor to work with URLParser.
* platform/soup/URLSoup.cpp:
(WebCore::URL::URL):
2016-10-13 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r207286.
Caused LayoutTest http/tests/misc/acid3.html to fail.
Reverted changeset:
"Share inline stylesheets between shadow trees"
https://bugs.webkit.org/show_bug.cgi?id=163353
http://trac.webkit.org/changeset/207286
2016-10-13 Sergio Villar Senin <svillar@igalia.com>
[css-grid] Use min-size instead of min-content contribution for intrinsic maximums resolution
https://bugs.webkit.org/show_bug.cgi?id=163283
Reviewed by Manuel Rego Casasnovas.
This was recently modified in the specs
https://hg.csswg.org/drafts/diff/575fb847e29d/css-grid/Overview.bs. Specifically this is
addressing the last one. It used to be "min-content contribution" but now it says "min-size
contribution".
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::currentItemSizeForTrackSizeComputationPhase):
2016-10-11 Sergio Villar Senin <svillar@igalia.com>
[css-grid] Fix intrinsic maximums resolution with fit-content and auto
https://bugs.webkit.org/show_bug.cgi?id=163282
Reviewed by Manuel Rego Casasnovas.
The step 2.5 in section 12.5 https://drafts.csswg.org/css-grid/#algo-content of the specs,
details how to sizes tracks with intrinsic max track sizing functions.
Not so long ago there were only two max track sizing functions min-content and max-content
(auto was always resolved to max-content). However there were some recent changes that force
us to consider 2 new values: auto (which is not internally translated to max-content
although it still works the same) and specially the newly added fit-content.
Some of the new test cases are commented due to bug http://wkb.ug/163283.
Test: fast/css-grid-layout/grid-intrinsic-maximums.html
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::shouldProcessTrackForTrackSizeComputationPhase):
* rendering/style/GridTrackSize.h:
(WebCore::GridTrackSize::cacheMinMaxTrackBreadthTypes):
(WebCore::GridTrackSize::hasIntrinsicMinTrackBreadth):
(WebCore::GridTrackSize::hasIntrinsicMaxTrackBreadth):
(WebCore::GridTrackSize::hasAutoOrMinContentMinTrackBreadthAndIntrinsicMaxTrackBreadth):
2016-10-13 Miguel Gomez <magomez@igalia.com>
[GTK] Video playback doesn't work properly with accelerated compositing disabled
https://bugs.webkit.org/show_bug.cgi?id=163386
Reviewed by Carlos Garcia Campos.
Trigger a repaint of the player when a new frame arrives and accelerated compositing is disabled.
Covered by existent tests.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
2016-10-13 Antti Koivisto <antti@apple.com>
Share inline stylesheets between shadow trees
https://bugs.webkit.org/show_bug.cgi?id=163353
Reviewed by Ryosuke Niwa and Andreas Kling.
If shadow trees have identical inline stylesheets the data structures can be shared.
In future this will also allow sharing style resolvers.
* css/parser/CSSParserMode.h:
(WebCore::CSSParserContextHash::hash):
(WebCore::CSSParserContextHash::equal):
(WTF::HashTraits<WebCore::CSSParserContext>::constructDeletedValue):
(WTF::HashTraits<WebCore::CSSParserContext>::isDeletedValue):
(WTF::HashTraits<WebCore::CSSParserContext>::emptyValue):
Make CSSParserContext hashable.
* dom/InlineStyleSheetOwner.cpp:
(WebCore::makeInlineStyleSheetCacheKey):
(WebCore::inlineStyleSheetCache):
Implement a simple cache for sharing stylesheets with identical text and context.
(WebCore::InlineStyleSheetOwner::createSheet):
(WebCore::InlineStyleSheetOwner::clearCache):
* dom/InlineStyleSheetOwner.h:
* platform/MemoryPressureHandler.cpp:
(WebCore::MemoryPressureHandler::releaseNoncriticalMemory):
2016-10-13 Antti Koivisto <antti@apple.com>
Revert patch landed with wrong commit message.
2016-10-12 Per Arne Vollan <pvollan@apple.com>
[Win] Encode function pointers.
https://bugs.webkit.org/show_bug.cgi?id=163331
Reviewed by Brent Fulgham.
We should encode stored function pointers.
* platform/win/SoftLinking.h:
2016-10-13 Youenn Fablet <youenn@apple.com>
Remove CachedResourceRequest::mutableResourceRequest
https://bugs.webkit.org/show_bug.cgi?id=163277
Reviewed by Sam Weinig.
No change of behavior.
Removing CachedResourceRequest::mutableResourceRequest requires call sites to either update the ResourceRequest
before creating the CachedResourceRequest or to add methods at CachedResourceRequest.
Adding CachedResourceRequest::releaseResourceRequest for CachedResource constructor.
Most new CachedResourceRequest methods are used by CachedResourceLoader which is passed a CachedResourceRequest.
This allows code in CachedResourceLoader to be easier to read.
* css/CSSImageSetValue.cpp:
(WebCore::CSSImageSetValue::loadBestFitImage):
* css/CSSImageValue.cpp:
(WebCore::CSSImageValue::loadImage):
* dom/ScriptElement.cpp:
(WebCore::ScriptElement::requestScriptWithCache):
* loader/CrossOriginAccessControl.cpp:
(WebCore::createAccessControlPreflightRequest):
* loader/CrossOriginAccessControl.h:
* loader/CrossOriginPreflightChecker.cpp:
(WebCore::CrossOriginPreflightChecker::startPreflight):
(WebCore::CrossOriginPreflightChecker::doPreflight):
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::loadRequest):
* loader/MediaResourceLoader.cpp:
(WebCore::MediaResourceLoader::requestResource):
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::CachedResource):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::requestImage):
(WebCore::CachedResourceLoader::requestUserCSSStyleSheet):
(WebCore::CachedResourceLoader::prepareFetch):
(WebCore::CachedResourceLoader::updateHTTPRequestHeaders):
(WebCore::CachedResourceLoader::requestResource):
(WebCore::acceptHeaderValueFromType): Deleted.
(WebCore::updateRequestAccordingCacheMode): Deleted.
* loader/cache/CachedResourceRequest.cpp:
(WebCore::CachedResourceRequest::setAsPotentiallyCrossOrigin):
(WebCore::CachedResourceRequest::updateForAccessControl):
(WebCore::CachedResourceRequest::upgradeInsecureRequestIfNeeded):
(WebCore::CachedResourceRequest::setDomainForCachePartition):
(WebCore::acceptHeaderValueFromType):
(WebCore::CachedResourceRequest::setAcceptHeaderIfNone):
(WebCore::CachedResourceRequest::updateAccordingCacheMode):
(WebCore::CachedResourceRequest::removeFragmentIdentifierIfNeeded):
(WebCore::CachedResourceRequest::applyBlockedStatus):
* loader/cache/CachedResourceRequest.h:
(WebCore::CachedResourceRequest::releaseResourceRequest):
(WebCore::CachedResourceRequest::setCachingPolicy):
(WebCore::CachedResourceRequest::mutableResourceRequest): Deleted.
(WebCore::CachedResourceRequest::setCacheModeToNoStore): Deleted.
* loader/icon/IconLoader.cpp:
(WebCore::IconLoader::startLoading):
* platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp:
(WebCore::WebCoreAVCFResourceLoader::startLoading):
* platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
(WebCore::WebCoreAVFResourceLoader::startLoading):
2016-10-13 Antti Koivisto <antti@apple.com>
Support scoped style for user agent shadow trees
https://bugs.webkit.org/show_bug.cgi?id=163212
<rdar://problem/28715318>
Reviewed by Ryosuke Niwa and Andreas Kling.
This patch adds support for user agent shadow trees that have scoped style. This means
that the shadows can be styled via <style> elements contained in the tree instead of
using pseudo elements on the global UA sheet. Since the style is scoped it can use
normal id and class selectors.
Elements in the shadow tree can still be exposed for author styling if needed by giving
them pseudo ids
The patch also uses the new mechanism for the <meter> element.
The mechanism is not optimized yet, each shadow tree gets its own copy of style-related data
structures. This can be improved later.
* CMakeLists.txt:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* css/ElementRuleCollector.cpp:
(WebCore::MatchRequest::MatchRequest):
(WebCore::ElementRuleCollector::addMatchedRule):
(WebCore::ElementRuleCollector::matchAuthorShadowPseudoElementRules):
Make treeContextOrdinal an int so we can use negative ordinals. This is used to allow author pseudo
elements from earlier tree context to win over the shadow tree (matching CSS scoping spec language).
* css/ElementRuleCollector.h:
* css/StyleResolver.cpp:
(WebCore::StyleResolver::MatchResult::addMatchedProperties):
(WebCore::StyleResolver::CascadedProperties::addImportantMatches):
* css/StyleResolver.h:
* css/html.css:
(meter::-webkit-meter-inner-element): Deleted.
(meter::-webkit-meter-bar): Deleted.
(meter::-webkit-meter-optimum-value): Deleted.
(meter::-webkit-meter-suboptimum-value): Deleted.
(meter::-webkit-meter-even-less-good-value): Deleted.
Remove meter pseudo elements from the UA sheet.
* html/HTMLMeterElement.cpp:
(WebCore::HTMLMeterElement::childShouldCreateRenderer):
Don't create shadow renderers when we have appearance (are using RenderMeter).
(WebCore::setValueClass):
Move this logic here from MeterShadowElement.cpp.
Set both class and pseudo id. The latter is needed to keep author styling working.
(WebCore::HTMLMeterElement::didElementStateChange):
(WebCore::HTMLMeterElement::renderMeter):
RenderMeter is now only instantiated when appearance is enabled.
(WebCore::HTMLMeterElement::didAddUserAgentShadowRoot):
Build the shadow tree out of <div>s instead of special shadow elements.
* html/HTMLMeterElement.h:
* html/shadow/MeterShadowElement.cpp: Removed.
* html/shadow/MeterShadowElement.h: Removed.
Not needed anymore.
* html/shadow/meterElementShadow.css: Added.
(div#inner):
(div#bar):
(div#value):
(div#value.optimum):
(div#value.suboptimum):
(div#value.even-less-good):
Stylesheet for meter element shadow tree using normal id and class selectors.
* style/StyleScope.cpp:
(WebCore::Style::Scope::shouldUseSharedUserAgentShadowTreeStyleResolver):
Switch to per-scope style resolver for UA shadow trees if there is stylesheets in the tree.
(WebCore::Style::Scope::resolver):
(WebCore::Style::Scope::resolverIfExists):
* style/StyleScope.h:
2016-10-12 Chris Dumez <cdumez@apple.com>
[Web IDL] Drop support for legacy [ConstructorConditional=*]
https://bugs.webkit.org/show_bug.cgi?id=163368
Reviewed by Ryosuke Niwa.
Drop support for legacy [ConstructorConditional=*] webkit-specific IDL
extended attribute. This was introduced to disable DOM4 event
constructors at compile time. However, nowadays, those constructors are
enabled everywhere.
* Configurations/FeatureDefines.xcconfig:
* bindings/scripts/CodeGenerator.pm:
(GenerateConstructorConditionalString): Deleted.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateConstructorHelperMethods):
* bindings/scripts/IDLAttributes.txt:
* bindings/scripts/test/JS/JSTestInterface.cpp:
(WebCore::JSTestInterfaceConstructor::getConstructData): Deleted.
* bindings/scripts/test/TestInterface.idl:
* dom/UIEvent.idl:
2016-10-12 Chris Dumez <cdumez@apple.com>
The bindings generator should provide a better error message when it does not find a dictionary definition
https://bugs.webkit.org/show_bug.cgi?id=163377
Reviewed by Ryosuke Niwa.
The bindings generator should provide a better error message when it does
not find a dictionary definition.
* bindings/scripts/CodeGenerator.pm:
(GetDictionaryByName):
* bindings/scripts/CodeGeneratorJS.pm:
(assert):
(GenerateDictionaryImplementationContent):
(GenerateHeader):
(GenerateDictionaryHeader):
2016-10-12 Chris Dumez <cdumez@apple.com>
Update WebKitMediaKeyMessageEvent / WebKitMediaKeyNeededEvent to stop using legacy [ConstructorTemplate=Event]
https://bugs.webkit.org/show_bug.cgi?id=163369
Reviewed by Ryosuke Niwa.
Update WebKitMediaKeyMessageEvent / WebKitMediaKeyNeededEvent to stop
using legacy [ConstructorTemplate=Event] and use regular constructors
instead.
This also adds support for having dictionary members that are typed
arrays because this was needed.
Test: fast/events/webkit-media-key-events-constructor.html
* Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.cpp:
(WebCore::WebKitMediaKeyMessageEvent::WebKitMediaKeyMessageEvent):
* Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.h:
(WebCore::WebKitMediaKeyMessageEvent::create):
(WebCore::WebKitMediaKeyMessageEvent::createForBindings): Deleted.
* Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.idl:
* Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.cpp:
(WebCore::WebKitMediaKeyNeededEvent::WebKitMediaKeyNeededEvent):
* Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.h:
(WebCore::WebKitMediaKeyNeededEvent::create):
(WebCore::WebKitMediaKeyNeededEvent::createForBindings): Deleted.
* Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.idl:
* bindings/js/JSDOMConvert.h:
(WebCore::Converter<IDLInterface<JSC::GenericTypedArrayView<Adaptor>>>::convert):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateDefaultValue):
* dom/InputEvent.cpp:
(WebCore::InputEvent::InputEvent):
* dom/InputEvent.h:
* dom/InputEvent.idl:
2016-10-12 Chris Dumez <cdumez@apple.com>
Update HTMLSelectElement::recalcListItems() to ignore nested optgroup elements
https://bugs.webkit.org/show_bug.cgi?id=163358
Reviewed by Kent Tamura.
Update HTMLSelectElement::recalcListItems() to ignore nested optgroup elements.
As per the specification, we only want optgroup elements that are direct
children of the select element. This also matches the behavior of Chrome.
Test: fast/dom/HTMLSelectElement/nested-optgroup.html
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::recalcListItems):
2016-10-12 Zalan Bujtas <zalan@apple.com>
RenderRubyRun should not mark child renderers dirty at the end of layout.
https://bugs.webkit.org/show_bug.cgi?id=163359
<rdar://problem/28711840>
Reviewed by David Hyatt.
The current layout logic does not support marking renderers dirty for subsequent layouts.
Layout needs to exit with a clean tree.
Should relayoutChild be insufficient, we could also mark the base/text dirty for the justified content.
Test: fast/ruby/rubyrun-has-bad-child.html
* rendering/RenderBlockLineLayout.cpp:
(WebCore::RenderBlockFlow::updateRubyForJustifiedText):
* rendering/RenderRubyRun.cpp:
(WebCore::RenderRubyRun::layout):
(WebCore::RenderRubyRun::layoutBlock):
* rendering/RenderRubyRun.h:
2016-10-12 Simon Fraser <simon.fraser@apple.com>
Crash when using megaplan.ru
https://bugs.webkit.org/show_bug.cgi?id=163276
rdar://problem/28446672
Reviewed by Sam Weinig.
Make sure we allocate enough space in the vector of CGPoints that we use for path building.
Test: css3/masking/large-clip-path.html
* platform/graphics/cg/PathCG.cpp:
(WebCore::Path::polygonPathFromPoints):
2016-10-12 Alex Christensen <achristensen@webkit.org>
Fix out-of-bounds reading in URLParser when parsing improperly percent-encoded values
https://bugs.webkit.org/show_bug.cgi?id=163376
Reviewed by Saam Barati.
Covered by new API tests, which used to crash under asan.
* platform/URLParser.cpp:
(WebCore::percentDecode):
If you subtract 2 from size_t's smaller than 2, you're gonna have a bad time.
2016-10-12 Alex Christensen <achristensen@webkit.org>
Mail needs nonspecial URLs to keep case in host and not have slash after host
https://bugs.webkit.org/show_bug.cgi?id=163373
Reviewed by Saam Barati.
Mail uses urls like scheme://HoSt which were not changed when canonicalized
before enabling the URLParser but now are canonicalized to scheme://host/
I manually verified this fixes the issue.
This should be reverted once Mail will accept modern canonicalized URLs.
* platform/URLParser.cpp:
(WebCore::URLParser::parse):
(WebCore::URLParser::parseHostAndPort):
* platform/URLParser.h:
If the application is mail and the scheme is nonspecial, don't make the host lower case and don't add a slash after the host.
2016-10-11 Dean Jackson <dino@apple.com>
Add preliminary support for extended colors to WebCore::Color
https://bugs.webkit.org/show_bug.cgi?id=162878
<rdar://problem/28596413>
Reviewed by Darin Adler.
Add an ExtendedColor class that will hold the data necessary
for wider-than-sRGB (and more precise) colors. In order to
avoid increasing the size of Color, implement a tagged
pointer that is either referencing an ExtendedColor, or
is a 64-bit number with the top 32-bits being the RGBA, and
the bottom 2 bits indicating an invalid RGBA or a valid RGBA,
plus the tag.
Add copy constructors and operator= so that the new Color objects
are correctly copied.
There isn't yet a way to create an ExtendedColor. That's coming
in a followup patch (and will require changes to the CSS parser).
Covered by existing tests, and new API tests in Color.
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj: Add new files.
* platform/graphics/Color.cpp: Update everything to use m_rgbaAndFlags
instead of m_color + m_valid.
(WebCore::Color::Color):
(WebCore::Color::~Color):
(WebCore::Color::operator=):
(WebCore::Color::nameForRenderTreeAsText):
(WebCore::Color::setNamedColor):
(WebCore::Color::light):
(WebCore::Color::dark):
(WebCore::Color::setValid):
(WebCore::Color::setExtended):
(WebCore::Color::isExtended):
(WebCore::Color::asExtended):
* platform/graphics/Color.h: Implement the tagged union.
(WebCore::Color::Color):
(WebCore::Color::isValid):
(WebCore::Color::red):
(WebCore::Color::green):
(WebCore::Color::blue):
(WebCore::Color::alpha):
(WebCore::Color::rgb):
(WebCore::Color::setRGB):
(WebCore::operator==):
* platform/graphics/ExtendedColor.cpp: New file. Holds floating point
red, green, blue and alpha, plus a color space.
(WebCore::ExtendedColor::create):
(WebCore::ExtendedColor::~ExtendedColor):
(WebCore::ExtendedColor::ref):
(WebCore::ExtendedColor::deref):
* platform/graphics/ExtendedColor.h:
(WebCore::ExtendedColor::red):
(WebCore::ExtendedColor::green):
(WebCore::ExtendedColor::blue):
(WebCore::ExtendedColor::alpha):
(WebCore::ExtendedColor::colorSpace):
(WebCore::ExtendedColor::ExtendedColor):
* platform/graphics/cg/ColorCG.cpp: Update the constructors for
the platform specific color classes.
(WebCore::Color::Color):
* platform/graphics/gtk/ColorGtk.cpp:
(WebCore::Color::Color):
* platform/graphics/win/ColorDirect2D.cpp:
(WebCore::Color::Color):
* rendering/RenderEmbeddedObject.cpp: Use NeverDestroyed.
(WebCore::replacementTextRoundedRectPressedColor):
(WebCore::replacementTextRoundedRectColor):
(WebCore::replacementTextColor):
(WebCore::unavailablePluginBorderColor):
* rendering/RenderFrameSet.cpp: Ditto.
(WebCore::borderStartEdgeColor):
(WebCore::borderEndEdgeColor):
(WebCore::borderFillColor):
* rendering/RenderTableCell.cpp: This grows in size slightly
because it can no longer pack bits.
2016-10-12 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Sliders: scrubber and volume
https://bugs.webkit.org/show_bug.cgi?id=163328
<rdar://problem/28733838>
Reviewed by Dean Jackson.
We add a new Slider class that provides a custom slider backed by an
invisible <input type="range"> element and a fill underlay to provide
a custom color between the left edge of the slider and the slider thumb.
As the slider's value changes, a UI delegate receives messages to track
such changes.
Tests: media/modern-media-controls/scrubber/scrubber.html
media/modern-media-controls/slider/slider-constructor.html
media/modern-media-controls/slider/slider-fill.html
media/modern-media-controls/slider/slider-styles.html
media/modern-media-controls/volume-slider/volume-slider-value.html
media/modern-media-controls/volume-slider/volume-slider.html
* Modules/modern-media-controls/controls/scrubber.css: Added.
(.scrubber.slider > input::-webkit-slider-thumb):
* Modules/modern-media-controls/controls/scrubber.js: Added.
(Scrubber):
* Modules/modern-media-controls/controls/slider.css: Added.
(.slider):
(.slider > input,):
(.slider > .fill):
(.slider > input):
(.slider > input::-webkit-slider-thumb):
* Modules/modern-media-controls/controls/slider.js: Added.
(Slider.prototype.get value):
(Slider.prototype.set value):
(Slider.prototype.get width):
(Slider.prototype.set width):
(Slider.prototype.handleEvent):
(Slider.prototype.commitProperty):
(Slider.prototype._handleInputEvent):
(Slider.prototype._handleChangeEvent):
(Slider.prototype._updateFill):
* Modules/modern-media-controls/controls/volume-slider.css: Added.
(.volume.slider > input::-webkit-slider-thumb):
* Modules/modern-media-controls/controls/volume-slider.js: Added.
(VolumeSlider):
2016-10-12 Wenson Hsieh <wenson_hsieh@apple.com>
Add experimental support for the "formatForeColor" inputType
https://bugs.webkit.org/show_bug.cgi?id=163348
<rdar://problem/28739334>
Reviewed by Ryosuke Niwa.
Adds support for the "formatForeColor" attribute. This patch introduces a simple hook in Editor.cpp to extract
data for an input event from an EditingStyle when performing an editing action.
Test: fast/events/input-events-forecolor-data.html
* editing/EditCommand.cpp:
(WebCore::inputTypeNameForEditingAction):
* editing/Editor.cpp:
(WebCore::inputEventDataForEditingStyleAndAction):
Added a new static helper to compute the data attribute of an InputEvent when handling a style change.
(WebCore::Editor::computeAndSetTypingStyle):
2016-10-12 Chris Dumez <cdumez@apple.com>
[Web IDL] Generated bindings include the wrong header when ImplementedAs is used on a dictionary
https://bugs.webkit.org/show_bug.cgi?id=163352
Reviewed by Ryosuke Niwa.
Generated bindings include the wrong header when ImplementedAs is used
on a dictionary.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateDictionaryHeader):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjPrototypeFunctionOperationWithExternalDictionaryParameterCaller):
* bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
(WebCore::convertDictionary<DictionaryImplName>):
(WebCore::convertDictionary<TestStandaloneDictionary>): Deleted.
* bindings/scripts/test/JS/JSTestStandaloneDictionary.h:
* bindings/scripts/test/TestStandaloneDictionary.idl:
2016-10-12 Yusuke Suzuki <utatane.tea@gmail.com>
[DOMJIT][JSC] Explore the way to embed nodeType into JSC::JSType in WebCore
https://bugs.webkit.org/show_bug.cgi?id=163245
Reviewed by Filip Pizlo.
Node.nodeType accessor is so frequently called. For example, jQuery's $ function uses
this to distinguish DOM objects from the other JS objects. So every time you call `$(dom)`,
nodeType accessor is called. In addition to that, jQuery's prev, next, parent etc. also uses
this `nodeType`. And Ember.js also uses it. And ... So this function is super critical for DOM
performance.
The challenge is that there is no room for putting NodeType into C++ Node class. Node class
has a 32bit field to store some data. However, these bits are already exhausted. Extending
Node class is unacceptable since it significantly enlarges memory consumption of WebKit (Node
is everywhere!). Unfortunately, current Node::nodeType is implemented as a virtual function
even though this function is frequently called from JS world.
Interestingly, we already store some duplicate data in JSObject, JSC::JSType. WebCore already
extends it with JSElementType, JSNodeType, and JSDocumentWrapperType. And these types are
corresponding to specific NodeTypes. For example, JSElementType should have ELEMENT_NODE type.
This patch further extends this JSC::JSType in WebCore side safely. We embed NodeType bits into
JSC::JSType. This design offers significantly faster nodeType implementation. Furthermore, it
makes DOMJIT easy for nodeType accessor.
Even without the IC change[1], Dromaeo dom-query shows 8 - 10% improvement,
1452.96 runs/s vs 1578.56 runs/s. We can expect that this improvement will be applied to the
other benchmarks / real applications when the IC change is landed.
[1]: https://bugs.webkit.org/show_bug.cgi?id=163226
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSDOMWrapper.h:
* bindings/js/JSNodeCustom.h:
(WebCore::JSNode::nodeType):
* bindings/scripts/CodeGeneratorJS.pm:
(GetJSTypeForNode):
(GenerateHeader):
* dom/Node.idl:
* dom/NodeConstants.h: Copied from Source/JavaScriptCore/domjit/DOMJITGetterSetter.h.
* domjit/JSNodeDOMJIT.cpp:
(WebCore::createCallDOMForOffsetAccess):
(WebCore::NodeFirstChildDOMJIT::callDOM):
(WebCore::NodeLastChildDOMJIT::callDOM):
(WebCore::NodeNextSiblingDOMJIT::callDOM):
(WebCore::NodePreviousSiblingDOMJIT::callDOM):
(WebCore::NodeParentNodeDOMJIT::callDOM):
(WebCore::NodeNodeTypeDOMJIT::checkDOM):
(WebCore::NodeNodeTypeDOMJIT::callDOM):
2016-10-12 Chris Dumez <cdumez@apple.com>
Update more events to stop using legacy [ConstructorTemplate=Event]
https://bugs.webkit.org/show_bug.cgi?id=163339
Reviewed by Ryosuke Niwa.
Update more events to stop using legacy [ConstructorTemplate=Event]
and use regular constructors instead.
No new tests, updated existing tests.
* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
(WebCore::convertDictionary<TestEventConstructor::Init>):
(WebCore::JSTestEventConstructorConstructor::construct):
(WebCore::JSTestEventConstructorConstructor::prototypeForStructure):
(WebCore::JSTestEventConstructor::JSTestEventConstructor):
(WebCore::JSTestEventConstructor::createPrototype):
(WebCore::JSTestEventConstructorPrototype::create): Deleted.
(WebCore::JSTestEventConstructorPrototype::createStructure): Deleted.
(WebCore::JSTestEventConstructorPrototype::JSTestEventConstructorPrototype): Deleted.
(WebCore::setJSTestEventConstructorConstructor): Deleted.
(WebCore::JSTestEventConstructor::getConstructor): Deleted.
* bindings/scripts/test/JS/JSTestEventConstructor.h:
(WebCore::JSTestEventConstructor::wrapped):
(WebCore::JSTestEventConstructor::create): Deleted.
(WebCore::toJS): Deleted.
(WebCore::toJSNewlyCreated): Deleted.
* bindings/scripts/test/TestEventConstructor.idl:
* css/CSSFontFaceLoadEvent.cpp:
(WebCore::CSSFontFaceLoadEvent::CSSFontFaceLoadEvent):
* css/CSSFontFaceLoadEvent.h:
* css/CSSFontFaceLoadEvent.idl:
* html/canvas/WebGLContextEvent.cpp:
(WebCore::WebGLContextEvent::WebGLContextEvent):
* html/canvas/WebGLContextEvent.h:
* html/canvas/WebGLContextEvent.idl:
* storage/StorageEvent.cpp:
(WebCore::StorageEvent::create):
(WebCore::StorageEvent::StorageEvent):
* storage/StorageEvent.h:
* storage/StorageEvent.idl:
2016-10-12 Andreas Kling <akling@apple.com>
Make Document::existingAXObjectCache() fast with accessibility disabled.
<https://webkit.org/b/163347>
Reviewed by Antti Koivisto.
Instruments says we were spending 2.3% of Dromaeo/dom-modify.html in this function,
traversing ancestors. Track whether we've ever had a cache, and use that knowledge
to return early if possible.
* dom/Document.cpp:
(WebCore::Document::existingAXObjectCache):
(WebCore::Document::axObjectCache):
2016-10-12 Jeremy Huddleston Sequoia <jeremyhu@apple.com>
[SOUP] trunk r207192 fails to compile due to missing std::function being unavailable (missing #include <functional>)
https://bugs.webkit.org/show_bug.cgi?id=163340
Reviewed by Michael Catanzaro.
* platform/network/soup/SoupNetworkSession.h: Add missing #include <functional>
2016-10-12 Brent Fulgham <bfulgham@apple.com>
[WebGL] Revise vertex array attribute checks to account for lazy memory allocation.
https://bugs.webkit.org/show_bug.cgi?id=163149
<rdar://problem/28629774>
Reviewed by Dean Jackson.
Tested by fast/canvas/webgl/webgl-drawarrays-crash-2.html
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::validateVertexAttributes):
2016-10-12 Wenson Hsieh <wenson_hsieh@apple.com>
Now playing media sessions are always cleared for the active foreground tab
https://bugs.webkit.org/show_bug.cgi?id=163310
<rdar://problem/28573301>
Reviewed by Jer Noble.
Currently, we clear out Now Playing info whenever we set the visibility of Now Playing controls to Never. This
is incorrect, as the Now Playing session needs to still be active (just not visible) in this state. Instead, we
should not be taking the active/foregrounded-ness of a media session for Now Playing into account in
MediaElementSession::canShowControlsManager so that even if a media session is in the active/foreground tab, we
will update the Now Playing session with the latest info. However, when setting the visibility, we now check
and see if the session allows Now Playing visibility, and set the Now Playing visibility to Always or Never
depending on the answer.
Tweaked existing unit tests in NowPlayingControlsTests.
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::canShowControlsManager):
(WebCore::MediaElementSession::allowsNowPlayingControlsVisibility):
(WebCore::MediaElementSession::pageAllowsNowPlayingControls): Deleted.
* html/MediaElementSession.h:
* platform/audio/PlatformMediaSession.h:
(WebCore::PlatformMediaSession::allowsNowPlayingControlsVisibility):
* platform/audio/mac/MediaSessionManagerMac.mm:
(WebCore::MediaSessionManagerMac::updateNowPlayingInfo):
2016-10-12 Zalan Bujtas <zalan@apple.com>
Refactor LineLayoutState's float box handling.
https://bugs.webkit.org/show_bug.cgi?id=163286
Reviewed by David Hyatt.
We keep track of float boxes both per line (RootInlineBox::m_floats) and
per flow block (LineLayoutState::m_floats) during layout.
As we lay out the lines and iterate through RootInlineBox::m_floats, we
increment LineLayoutState::m_floatIndex. This LineLayoutState::m_floatIndex is
later used to find the matching float box in the per-block-flow float list.
This logic works fine as long as the lists and the index manipulation are tightly coded.
However due to the complexity of the line/float layout code, this is no longer the case.
This patch makes float box handling more secure by changing this index based setup
to a list iterator. It helps to eliminate potential vector overflow issues.
LineLayoutState::FloatList (new class) keeps track of all the floats for the block flow.
It groups the float box related functions/members and provides an iterator interface to ensure safer
syncing between this and the line based floats.
No change in functionality.
* rendering/RenderBlockFlow.h:
* rendering/RenderBlockLineLayout.cpp:
(WebCore::RenderBlockFlow::appendFloatingObjectToLastLine):
(WebCore::repaintDirtyFloats):
(WebCore::RenderBlockFlow::layoutRunsAndFloats):
(WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):
(WebCore::RenderBlockFlow::linkToEndLineIfNeeded):
(WebCore::RenderBlockFlow::layoutLineBoxes):
(WebCore::RenderBlockFlow::checkFloatInCleanLine):
(WebCore::RenderBlockFlow::determineStartPosition):
(WebCore::RenderBlockFlow::determineEndPosition):
(WebCore::RenderBlockFlow::repaintDirtyFloats): Deleted.
(WebCore::RenderBlockFlow::checkFloatsInCleanLine): Deleted.
* rendering/line/LineLayoutState.h:
(WebCore::FloatWithRect::create):
(WebCore::FloatWithRect::renderer):
(WebCore::FloatWithRect::rect):
(WebCore::FloatWithRect::everHadLayout):
(WebCore::FloatWithRect::adjustRect):
(WebCore::FloatWithRect::FloatWithRect):
(WebCore::LineLayoutState::FloatList::append):
(WebCore::LineLayoutState::FloatList::setLastFloat):
(WebCore::LineLayoutState::FloatList::lastFloat):
(WebCore::LineLayoutState::FloatList::setLastCleanFloat):
(WebCore::LineLayoutState::FloatList::lastCleanFloat):
(WebCore::LineLayoutState::FloatList::floatWithRect):
(WebCore::LineLayoutState::FloatList::begin):
(WebCore::LineLayoutState::FloatList::end):
(WebCore::LineLayoutState::FloatList::find):
(WebCore::LineLayoutState::FloatList::isEmpty):
(WebCore::LineLayoutState::LineLayoutState):
(WebCore::LineLayoutState::floatList):
(WebCore::LineLayoutState::lastFloat): Deleted.
(WebCore::LineLayoutState::setLastFloat): Deleted.
(WebCore::LineLayoutState::floats): Deleted.
(WebCore::LineLayoutState::floatIndex): Deleted.
(WebCore::LineLayoutState::setFloatIndex): Deleted.
2016-10-12 Said Abou-Hallawa <sabouhallawa@apple.com>
Unreviewed, fix Windows build break after r207182.
* platform/graphics/cg/ImageDecoderCG.cpp:
2016-10-12 Chris Dumez <cdumez@apple.com>
Update remaining DOM events to stop using legacy [ConstructorTemplate=Event]
https://bugs.webkit.org/show_bug.cgi?id=163319
Reviewed by Darin Adler.
Update remaining DOM events to stop using legacy [ConstructorTemplate=Event]
and use regular constructors instead.
No new tests, updated existing tests.
* dom/AutocompleteErrorEvent.h:
* dom/AutocompleteErrorEvent.idl:
* dom/BeforeLoadEvent.h:
* dom/BeforeLoadEvent.idl:
* dom/CompositionEvent.cpp:
(WebCore::CompositionEvent::CompositionEvent):
* dom/CompositionEvent.h:
* dom/CompositionEvent.idl:
* dom/ErrorEvent.cpp:
(WebCore::ErrorEvent::ErrorEvent):
* dom/ErrorEvent.h:
* dom/ErrorEvent.idl:
* dom/FocusEvent.cpp:
(WebCore::FocusEvent::FocusEvent):
* dom/FocusEvent.h:
* dom/FocusEvent.idl:
* dom/HashChangeEvent.h:
* dom/HashChangeEvent.idl:
* dom/OverflowEvent.cpp:
(WebCore::OverflowEvent::OverflowEvent):
* dom/OverflowEvent.h:
* dom/OverflowEvent.idl:
* dom/PageTransitionEvent.cpp:
(WebCore::PageTransitionEvent::PageTransitionEvent):
* dom/PageTransitionEvent.h:
* dom/PageTransitionEvent.idl:
* dom/PopStateEvent.cpp:
(WebCore::PopStateEvent::PopStateEvent):
(WebCore::PopStateEvent::create):
* dom/PopStateEvent.h:
* dom/PopStateEvent.idl:
* dom/SecurityPolicyViolationEvent.h:
* dom/SecurityPolicyViolationEvent.idl:
* dom/TouchEvent.cpp:
(WebCore::TouchEvent::TouchEvent):
* dom/TouchEvent.h:
* dom/TouchEvent.idl:
* dom/TransitionEvent.cpp:
(WebCore::TransitionEvent::TransitionEvent):
* dom/TransitionEvent.h:
* dom/TransitionEvent.idl:
* dom/WebKitAnimationEvent.cpp:
(WebCore::WebKitAnimationEvent::WebKitAnimationEvent):
* dom/WebKitAnimationEvent.h:
* dom/WebKitAnimationEvent.idl:
* dom/WebKitTransitionEvent.cpp:
(WebCore::WebKitTransitionEvent::WebKitTransitionEvent):
* dom/WebKitTransitionEvent.h:
* dom/WebKitTransitionEvent.idl:
2016-10-12 Chris Dumez <cdumez@apple.com>
Stop using PassRefPtr in platform/efl
https://bugs.webkit.org/show_bug.cgi?id=163321
Reviewed by Laszlo Gombos.
Stop using PassRefPtr in platform/efl.
* platform/efl/BatteryProviderEfl.cpp:
(WebCore::batteryProperties):
(WebCore::BatteryProviderEfl::setBatteryStatus):
(WebCore::BatteryProviderEfl::dispatchEvent):
* platform/efl/BatteryProviderEfl.h:
* platform/efl/BatteryProviderEflClient.h:
* platform/efl/PlatformSpeechSynthesisProviderEfl.cpp:
(WebCore::PlatformSpeechSynthesisProviderEfl::voiceName):
(WebCore::PlatformSpeechSynthesisProviderEfl::speak):
* platform/efl/PlatformSpeechSynthesisProviderEfl.h:
2016-10-12 Youenn Fablet <youenn@apple.com>
Attribute setter binding generated code should use more references
https://bugs.webkit.org/show_bug.cgi?id=163275
Reviewed by Alex Christensen.
No change of behavior.
* bindings/scripts/CodeGeneratorJS.pm:
(JSValueToNative):
* bindings/scripts/test/JS/JSTestGlobalObject.cpp:
* bindings/scripts/test/JS/JSTestInterface.cpp:
* bindings/scripts/test/JS/JSTestNode.cpp:
* bindings/scripts/test/JS/JSTestNondeterministic.cpp:
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
2016-10-11 Youenn Fablet <youenn@apple.com>
Refactor binding generated casted-this checks for methods
https://bugs.webkit.org/show_bug.cgi?id=163198
Reviewed by Darin Adler.
Covered by existing tests and binding rebased tests..
Introducing BindingCaller::callMethod and callPromiseMethod to encapsulate casted-this checks for methods.
This is supported for all methods except seralizer and iterators methods.
Introduced castForMethod similarly to castForAttribute.
Moved this from static methods of JSClass to static methods of BindingCaller<JSClass>
This allows removing the corresponding declarations from JSClass header file.
Note the difference of handling thisValue between the two in case of CustomProxyToJSObject.
This should be made more consistent.
In case of bad casted this check, CustomProxyToJSObject objects will throw a TypeError with an error message like other methods.
Before the patch, a TypeError without error message was thrown.
EventTarget being different, added a specialization of BindingCaller for it.
This allows also removing some binding generated code dedicated to EventTarget.
A similar approach might also be done for CustomProxyToJSObject objects to further simplify the binding generator.
* bindings/js/JSDOMBinding.cpp:
(WebCore::rejectPromiseWithThisTypeError):
* bindings/js/JSDOMBinding.h:
(WebCore::BindingCaller::callPromiseMethod):
(WebCore::BindingCaller::callMethod):
* bindings/js/JSEventTargetCustom.h:
(WebCore::BindingCaller<JSEventTarget>::callMethod):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
(GenerateImplementation):
(GenerateFunctionCastedThis): Deleted.
* bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
* bindings/scripts/test/JS/JSTestActiveDOMObject.h:
* bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
* bindings/scripts/test/JS/JSTestCustomNamedGetter.h:
* bindings/scripts/test/JS/JSTestEventTarget.cpp:
* bindings/scripts/test/JS/JSTestEventTarget.h:
* bindings/scripts/test/JS/JSTestGlobalObject.cpp:
* bindings/scripts/test/JS/JSTestGlobalObject.h:
* bindings/scripts/test/JS/JSTestInterface.cpp:
* bindings/scripts/test/JS/JSTestInterface.h:
* bindings/scripts/test/JS/JSTestIterable.cpp:
* bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
* bindings/scripts/test/JS/JSTestJSBuiltinConstructor.h:
* bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
* bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
* bindings/scripts/test/JS/JSTestNode.cpp:
* bindings/scripts/test/JS/JSTestNode.h:
* bindings/scripts/test/JS/JSTestNondeterministic.cpp:
* bindings/scripts/test/JS/JSTestNondeterministic.h:
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestObj.h:
* bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
* bindings/scripts/test/JS/JSTestOverrideBuiltins.h:
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
* bindings/scripts/test/JS/JSTestTypedefs.h:
2016-10-11 Youenn Fablet <youenn@apple.com>
MediaResourceLoader::requestResource should take a ResourceRequest&& as input
https://bugs.webkit.org/show_bug.cgi?id=160397
Reviewed by Alex Christensen.
No change in behavior.
* loader/MediaResourceLoader.cpp:
(WebCore::MediaResourceLoader::requestResource): Passing a ResourceRequest&& as input parameter.
* loader/MediaResourceLoader.h:
* platform/graphics/PlatformMediaResourceLoader.h: Ditto.
* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
(webKitWebSrcStart): Creating an extra copy since MediaResourceLoader::requestResource expects a Resourcerequest&&.
2016-10-11 Chris Dumez <cdumez@apple.com>
Update AnimationEvent to stop using legacy [ConstructorTemplate=Event]
https://bugs.webkit.org/show_bug.cgi?id=163312
Reviewed by Ryosuke Niwa.
Update AnimationEvent to stop using legacy [ConstructorTemplate=Event]
and use a regular constructor as in the specification:
- https://drafts.csswg.org/css-animations/#interface-animationevent
* dom/AnimationEvent.cpp:
(WebCore::AnimationEvent::AnimationEvent):
* dom/AnimationEvent.h:
* dom/AnimationEvent.idl:
2016-10-11 Chris Dumez <cdumez@apple.com>
Update DeviceProximityEvent to stop using legacy [ConstructorTemplate=Event]
https://bugs.webkit.org/show_bug.cgi?id=163311
Reviewed by Ryosuke Niwa.
Update DeviceProximityEvent to stop using legacy [ConstructorTemplate=Event]
and use a regular constructor instead, as in the specification:
- https://www.w3.org/TR/2015/WD-proximity-20150903/#deviceproximityevent-interface
* Modules/proximity/DeviceProximityEvent.cpp:
(WebCore::DeviceProximityEvent::DeviceProximityEvent):
* Modules/proximity/DeviceProximityEvent.h:
(WebCore::DeviceProximityEvent::create):
(WebCore::DeviceProximityEventInit::DeviceProximityEventInit): Deleted.
* Modules/proximity/DeviceProximityEvent.idl:
2016-10-11 Gyuyoung Kim <gyuyoung.kim@webkit.org>
Unreviewed, EFL build fix because of r207173.
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::forcedPrefersReducedMotionValue):
2016-10-11 Said Abou-Hallawa <sabouhallawa@apple.com>
[CG] Add the option to immediately decode an image frame and control its memory caching
https://bugs.webkit.org/show_bug.cgi?id=163298
Reviewed by Simon Fraser.
This patch fixes two things. (1) An option is added to immediately decode an
image frame. This can be done by adding kCGImageSourceShouldCacheImmediately
to the ImageSource options dictionary. (2) BitmapImage should also control
when the image frame is actually deleted from memory. This can be done by
calling CGImageSourceCreateThumbnailAtIndex(). CG does not keep a reference
to the returned CGImageRef.
* platform/graphics/ImageFrame.h: Adding the DecodingMode enum class.
Ideally this should be a member of ImageDecoder class. But since we
have three header files for ImageDecoder, this can be added here till
the three files combined in one header file.
* platform/graphics/ImageFrameCache.cpp:
(WebCore::ImageFrameCache::setRenderTarget): Deleted.
* platform/graphics/ImageFrameCache.h:
* platform/graphics/ImageSource.cpp:
(WebCore::ImageSource::setRenderTarget):
* platform/graphics/ImageSource.h:
(WebCore::ImageSource::setRenderTarget): Deleted.
Unrelated change. The native image decoder is available from the ImageSource.
ImageSource::setTarget() does not need not to get it through ImageFrameCache.
* platform/graphics/cg/ImageDecoderCG.cpp:
(WebCore::createImageSourceOptions): Clean this function by using CFMutableDictionary.
(WebCore::imageSourceOptions): Cache two default ImageSource options and create new
ones for the non default cases.
(WebCore::ImageDecoder::createFrameImageAtIndex): Use the appropriate ImageSource function
* platform/graphics/cg/ImageDecoderCG.h:
* platform/graphics/win/ImageDecoderDirect2D.cpp:
(WebCore::ImageDecoder::createFrameImageAtIndex):
* platform/graphics/win/ImageDecoderDirect2D.h:
* platform/image-decoders/ImageDecoder.cpp:
(WebCore::ImageDecoder::createFrameImageAtIndex):
* platform/image-decoders/ImageDecoder.h:
Change functions' signature to include a DecodingMode argument.
2016-10-11 Chris Dumez <cdumez@apple.com>
select.options may return too many option elements
https://bugs.webkit.org/show_bug.cgi?id=163296
Reviewed by Ryosuke Niwa.
select.options may return too many option elements. We're only supposed
to return the option element children of the select element, and the
option element children of all the optgroup element children of the
select element, in tree order:
- https://html.spec.whatwg.org/#dom-select-options
- https://html.spec.whatwg.org/#concept-select-option-list
Firefox and Chrome agrees with the specification. However, WebKit was
returning all the option elements that are descendants of the select
element.
Test: imported/w3c/web-platform-tests/html/infrastructure/common-dom-interfaces/collections/htmloptionscollection.html
* html/HTMLOptionsCollection.h:
2016-10-11 Alex Christensen <achristensen@webkit.org>
Fix assertion when creating first WebCore::URL from non-main thread after r207162
https://bugs.webkit.org/show_bug.cgi?id=163304
Reviewed by Filip Pizlo.
This fixes assertions when running UserContentWorld.NormalWorld API tests.
* platform/text/TextEncodingRegistry.cpp:
(WebCore::buildBaseTextCodecMaps):
(WebCore::atomicCanonicalTextEncodingName):
The new URLParser requires a TextEncoding& in its constructor, which defaults to UTF8Encoding.
When creating the first TextEncoding in a process, it calls buildBaseTextCodecMaps which asserts
it's on the main thread because it initializes static variables. Since we are getting a lock right
after this call anyway, just put this function call inside the lock.
2016-10-11 Dean Jackson <dino@apple.com>
color-gamut media query shouldn't ASSERT on invalid values
https://bugs.webkit.org/show_bug.cgi?id=163303
<rdar://problem/28724566>
Reviewed by Simon Fraser.
Remove the ASSERT_NOT_REACHED in the evaluation, since it
can be hit when there is a valid CSS keyword that is not
expected in the query.
Updated fast/media/mq-color-gamut.html
* css/MediaQueryEvaluator.cpp:
(WebCore::colorGamutEvaluate):
2016-10-11 Chris Dumez <cdumez@apple.com>
Update MediaStream events to stop using legacy [ConstructorTemplate=Event]
https://bugs.webkit.org/show_bug.cgi?id=163289
Reviewed by Sam Weinig.
Update MediaStream events to stop using legacy [ConstructorTemplate=Event]
and use regular constructors instead.
* Modules/mediastream/MediaStreamEvent.cpp:
(WebCore::MediaStreamEvent::create):
(WebCore::MediaStreamEvent::MediaStreamEvent):
* Modules/mediastream/MediaStreamEvent.h:
* Modules/mediastream/MediaStreamEvent.idl:
* Modules/mediastream/MediaStreamTrackEvent.cpp:
(WebCore::MediaStreamTrackEvent::create):
(WebCore::MediaStreamTrackEvent::MediaStreamTrackEvent):
* Modules/mediastream/MediaStreamTrackEvent.h:
* Modules/mediastream/MediaStreamTrackEvent.idl:
* Modules/mediastream/OverconstrainedErrorEvent.h:
(WebCore::OverconstrainedErrorEvent::create):
(WebCore::OverconstrainedErrorEvent::OverconstrainedErrorEvent):
(WebCore::OverconstrainedErrorEvent::~OverconstrainedErrorEvent): Deleted.
* Modules/mediastream/OverconstrainedErrorEvent.idl:
* Modules/mediastream/RTCDTMFToneChangeEvent.cpp:
(WebCore::RTCDTMFToneChangeEvent::create):
(WebCore::RTCDTMFToneChangeEvent::RTCDTMFToneChangeEvent):
* Modules/mediastream/RTCDTMFToneChangeEvent.h:
* Modules/mediastream/RTCDTMFToneChangeEvent.idl:
* Modules/mediastream/RTCTrackEvent.cpp:
(WebCore::RTCTrackEvent::create):
(WebCore::RTCTrackEvent::RTCTrackEvent):
* Modules/mediastream/RTCTrackEvent.h:
* Modules/mediastream/RTCTrackEvent.idl:
2016-10-11 Chris Dumez <cdumez@apple.com>
Update UIRequestEvent to stop using legacy [ConstructorTemplate=Event]
https://bugs.webkit.org/show_bug.cgi?id=163288
Reviewed by Darin Adler.
Update UIRequestEvent to stop using legacy [ConstructorTemplate=Event]
and use a constructor as in the specification:
- https://dvcs.w3.org/hg/IndieUI/raw-file/default/src/indie-ui-events.html#UIRequestEvent
* Modules/indieui/UIRequestEvent.cpp:
(WebCore::UIRequestEvent::create):
(WebCore::UIRequestEvent::UIRequestEvent):
(WebCore::UIRequestEvent::createForBindings): Deleted.
* Modules/indieui/UIRequestEvent.h:
* Modules/indieui/UIRequestEvent.idl:
2016-10-11 Dean Jackson <dino@apple.com>
Implement prefers-reduced-motion media query
https://bugs.webkit.org/show_bug.cgi?id=163250
<rdar://problem/28704129>
Reviewed by Simon Fraser.
Implement the prefers-reduced-motion media query, as
described in https://github.com/w3c/csswg-drafts/issues/442.
Tests: fast/media/mq-prefers-reduced-motion-forced-value.html
fast/media/mq-prefers-reduced-motion.html
* Configurations/WebCoreTestSupport.xcconfig: Link against AppKit and UIKit.
* css/CSSValueKeywords.in: New keyword for "reduce".
* css/MediaFeatureNames.h: Add prefers-reduced-motion.
* css/MediaQueryEvaluator.cpp:
(WebCore::prefersReducedMotionEvaluate):
* css/MediaQueryExp.cpp:
(WebCore::featureWithValidIdent):
(WebCore::isFeatureValidWithoutValue):
* platform/Theme.h: New API to detect the system accessibility settings.
(WebCore::Theme::userPrefersReducedMotion):
* platform/ios/ThemeIOS.h:
* platform/ios/ThemeIOS.mm:
(WebCore::ThemeIOS::userPrefersReducedMotion):
* platform/mac/ThemeMac.h:
* platform/mac/ThemeMac.mm:
(WebCore::ThemeMac::userPrefersReducedMotion):
* testing/Internals.cpp: Expose the same API to internals, so that
a test can examine the value too.
(WebCore::Internals::userPrefersReducedMotion):
* testing/Internals.h:
* testing/Internals.idl:
* testing/Internals.mm:
(WebCore::Internals::userPrefersReducedMotion):
* page/Settings.h: New setting to override the system value...
* page/Settings.in:
* testing/InternalSettings.cpp: ... plumbed through internals.
(WebCore::InternalSettings::Backup::Backup):
(WebCore::InternalSettings::Backup::restoreTo):
(WebCore::InternalSettings::forcedPrefersReducedMotionValue):
(WebCore::InternalSettings::setForcedPrefersReducedMotionValue):
* testing/InternalSettings.h:
* testing/InternalSettings.idl:
* testing/Internals.cpp:
(WebCore::Internals::userPrefersReducedMotion):
* testing/Internals.h:
* testing/Internals.idl:
* testing/Internals.mm:
(WebCore::Internals::userPrefersReducedMotion):
2016-10-10 Ryosuke Niwa <rniwa@webkit.org>
Annotate DOM API with CEReactions
https://bugs.webkit.org/show_bug.cgi?id=163268
Reviewed by Darin Adler.
Added CEReactions IDL attribute to APIs defined in https://dom.spec.whatwg.org.
No new tests since existing tests cover the code change.
Added a dedicated code generation test: JSTestCEReactions.idl and TestCEReactionsStringifier.idl.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation): Generate CustomElementReactionStack in attribute setters. In the case of PutForwards,
check the extended attributes of the target attribute's stringifier.
* bindings/scripts/test/JS/JSTestCEReactions.cpp: Added.
* bindings/scripts/test/JS/JSTestCEReactions.h: Added.
* bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp: Added.
* bindings/scripts/test/JS/JSTestCEReactionsStringifier.h: Added.
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjPrototypeFunctionMethodWithNeedsCustomElementReactionStack): Deleted.
* bindings/scripts/test/TestCEReactions.idl: Added.
* bindings/scripts/test/TestCEReactionsStringifier.idl: Added.
* bindings/scripts/test/TestObj.idl:
* dom/Attr.idl:
* dom/ChildNode.idl:
* dom/Document.idl:
* dom/Element.idl:
* dom/NamedNodeMap.idl:
* dom/Node.idl:
* dom/ParentNode.idl:
* dom/Range.idl:
* html/DOMTokenList.idl:
2016-10-11 Chris Dumez <cdumez@apple.com>
Update CloseEvent to stop using legacy [ConstructorTemplate=Event]
https://bugs.webkit.org/show_bug.cgi?id=163293
Reviewed by Darin Adler.
Update CloseEvent to stop using legacy [ConstructorTemplate=Event] and
use a regular constructor as in the specification:
- https://html.spec.whatwg.org/multipage/comms.html#the-closeevent-interfaces
No new tests, updated existing test.
* Modules/websockets/CloseEvent.h:
(WebCore::CloseEvent::create):
(WebCore::CloseEvent::CloseEvent):
* Modules/websockets/CloseEvent.idl:
2016-10-11 Yusuke Suzuki <utatane.tea@gmail.com>
[DOMJIT] DOMJIT::Patchpoint should have a way to receive constant folded arguments
https://bugs.webkit.org/show_bug.cgi?id=163224
Reviewed by Filip Pizlo.
* domjit/DOMJITHelpers.h:
(WebCore::DOMJITHelpers::toWrapper):
* domjit/JSNodeDOMJIT.cpp:
(WebCore::createCallDOMForOffsetAccess):
2016-10-11 Alex Christensen <achristensen@webkit.org>
Enable URLParser by default
https://bugs.webkit.org/show_bug.cgi?id=162660
<rdar://28601706>
Reviewed by Sam Weinig.
Covered by updates to many LayoutTests.
* platform/URLParser.cpp:
Make the default value true for URLParser::enabled.
This is the most impactful and well-documented one-line change I've ever written.
2016-10-11 Daniel Bates <dabates@apple.com>
[iOS] REGRESSION (r197953): User gesture required to load video in iOS 9-built apps
https://bugs.webkit.org/show_bug.cgi?id=163244
<rdar://problem/27250015>
Reviewed by Jer Noble.
Adds a new setting to toggle requiring a user gesture to load a video (enabled by default).
Disable this setting for apps built against iOS 9 or earlier.
Tests: media/loadedmetadata-fires-without-user-gesture-when-setRequiresUserGestureToLoadVideo-false.html
media/require-user-gesture-to-load-video.html
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::HTMLMediaElement): Only require a user gesture to load a video
when Settings::requiresUserGestureToLoadVideo() is true.
* page/Settings.cpp: Enable setting requiresUserGestureToLoadVideo by default.
* page/Settings.in: Add setting, requiresUserGestureToLoadVideo.
2016-10-11 Sam Weinig <sam@webkit.org>
Fix the iOS build.
* bindings/js/JSDOMConvert.h:
2016-10-11 Daniel Bates <dabates@apple.com>
[iOS] Sandbox QuickLook previews
https://bugs.webkit.org/show_bug.cgi?id=163240
<rdar://problem/25961633>
Fix bad merge following r207151.
* platform/network/cf/ResourceResponse.h: Define m_isQuickLook.
2016-10-11 Daniel Bates <dabates@apple.com>
[iOS] Sandbox QuickLook previews
https://bugs.webkit.org/show_bug.cgi?id=163240
<rdar://problem/25961633>
Reviewed by Brent Fulgham.
Use a unique origin for- and limit the capabilities of- QuickLook previews.
Tests: http/tests/quicklook/at-import-stylesheet-blocked.html
http/tests/quicklook/base-url-blocked.html
http/tests/quicklook/cross-origin-iframe-blocked.html
http/tests/quicklook/csp-header-ignored.html
http/tests/quicklook/document-domain-is-empty-string.html
http/tests/quicklook/external-stylesheet-blocked.html
http/tests/quicklook/hide-referer-on-navigation.html
http/tests/quicklook/submit-form-blocked.html
http/tests/quicklook/top-navigation-blocked.html
* dom/Document.cpp:
(WebCore::Document::processHttpEquiv): Call ContentSecurityPolicy::didReceiveHeader().
(WebCore::Document::processReferrerPolicy): Do not process referrer policy for QuickLook previews.
(WebCore::Document::initSecurityContext): Apply sandbox for QuickLook previews.
(WebCore::Document::shouldEnforceQuickLookSandbox): Added.
(WebCore::Document::applyQuickLookSandbox): Added.
* dom/Document.h:
* page/csp/ContentSecurityPolicy.h: Change accessibility of didReceiveHeader() from private to public.
(WebCore::ContentSecurityPolicy::processHTTPEquiv): Deleted.
* platform/network/cf/ResourceResponse.h:
(WebCore::ResourceResponse::isQuickLook): Added.
(WebCore::ResourceResponse::setIsQuickLook): Added.
* platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:
(WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveResponse): Modified to mark
resource response as a QuickLook preview, if appropriate. Also remove the name of the first argument
and the need to use UNUSED_PARAM(connection) as we no longer make use of the first argument
following r207151.
* platform/network/ios/QuickLook.mm:
(-[WebResourceLoaderQuickLookDelegate _sendDidReceiveResponseIfNecessary]): Ditto.
* platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
(-[WebCoreResourceHandleAsDelegate connection:didReceiveResponse:]): Ditto. Fix style nits,
including renaming the function argument "r" to "resource" to better describe its purpose.
2016-10-11 Alex Christensen <achristensen@webkit.org>
Fix bindings tests after r207150.
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::convertDictionary<TestObj::Dictionary>):
2016-10-11 Alex Christensen <achristensen@webkit.org>
URLParser should percent-encode non-ASCII and non-printable characters in fragment
https://bugs.webkit.org/show_bug.cgi?id=163287
Reviewed by Brady Eidson.
Based on discussion in https://github.com/whatwg/url/issues/150
If that discussion decides to keep the spec as-is (which keeps non-ASCII characters in the fragment
to match IE and Edge's behavior, which Chrome has followed for special schemes) then we can revert
this change later after enabling the URL parser. Making this change keeps behavior matching Safari
and Firefox, as well as Chrome's handling of non-special schemes, such as data URLs.
Covered by updated API tests.
* platform/URLParser.cpp:
(WebCore::URLParser::appendToASCIIBuffer):
(WebCore::URLParser::copyURLPartsUntil):
(WebCore::URLParser::syntaxViolation):
(WebCore::URLParser::currentPosition):
(WebCore::URLParser::parse):
(WebCore::URLParser::fragmentSyntaxViolation): Deleted.
* platform/URLParser.h:
No more non-ASCII characters in canonicalized URLs.
2016-10-11 Alex Christensen <achristensen@webkit.org>
Remove dead networking code
https://bugs.webkit.org/show_bug.cgi?id=163263
Reviewed by Daniel Bates.
There are no more Cocoa platforms using CFURLConnection.
USE(CFNETWORK) is being replaced by USE(CFURLCONNECTION) and it is only used on the AppleWin port.
No change in behavior.
* WebCore.xcodeproj/project.pbxproj:
* WebCorePrefix.h:
* loader/DocumentLoader.h:
* loader/EmptyClients.h:
* loader/FrameLoaderClient.h:
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::didReceiveAuthenticationChallenge):
* loader/ResourceLoader.h:
* loader/SubresourceLoader.h:
* loader/cf/ResourceLoaderCFNet.cpp:
* loader/cocoa/SubresourceLoaderCocoa.mm:
(WebCore::SubresourceLoader::willCacheResponse): Deleted.
* loader/mac/DocumentLoaderMac.cpp:
* loader/mac/ResourceLoaderMac.mm:
(WebCore::ResourceLoader::willCacheResponse): Deleted.
* page/mac/PageMac.mm:
(WebCore::Page::platformInitialize):
(WebCore::Page::addSchedulePair):
(WebCore::Page::removeSchedulePair):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForResponseToAuthenticationChallenge):
(WebCore::WebCoreNSURLAuthenticationChallengeClient::create): Deleted.
(WebCore::WebCoreNSURLAuthenticationChallengeClient::WebCoreNSURLAuthenticationChallengeClient): Deleted.
* platform/mac/WebCoreSystemInterface.h:
* platform/network/NetworkStorageSession.h:
* platform/network/ProtectionSpace.h:
* platform/network/ProtectionSpaceBase.cpp:
* platform/network/ResourceHandle.cpp:
* platform/network/ResourceHandle.h:
* platform/network/ResourceHandleClient.cpp:
* platform/network/ResourceHandleClient.h:
(WebCore::ResourceHandleClient::willCacheResponse):
(WebCore::ResourceHandleClient::shouldCacheResponse):
* platform/network/ResourceHandleInternal.h:
(WebCore::ResourceHandleInternal::ResourceHandleInternal):
* platform/network/ResourceRequestBase.cpp:
* platform/network/cf/AuthenticationCF.cpp:
(WebCore::AuthenticationChallenge::AuthenticationChallenge):
(WebCore::createCF):
(WebCore::core):
* platform/network/cf/AuthenticationCF.h:
* platform/network/cf/AuthenticationChallenge.h:
* platform/network/cf/CookieJarCFNet.cpp:
* platform/network/cf/CredentialStorageCFNet.cpp:
(WebCore::CredentialStorage::getFromPersistentStorage):
(WebCore::CredentialStorage::saveToPersistentStorage): Deleted.
* platform/network/cf/LoaderRunLoopCF.cpp:
* platform/network/cf/LoaderRunLoopCF.h:
* platform/network/cf/NetworkStorageSessionCFNet.cpp:
(WebCore::NetworkStorageSession::cookieStorage):
* platform/network/cf/ProtectionSpaceCFNet.cpp:
* platform/network/cf/ProtectionSpaceCFNet.h:
* platform/network/cf/ResourceError.h:
* platform/network/cf/ResourceErrorCF.cpp:
* platform/network/cf/ResourceHandleCFNet.cpp:
(WebCore::shouldSniffConnectionProperty):
(WebCore::ResourceHandle::createCFURLConnection):
(WebCore::ResourceHandle::start):
(WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
(WebCore::ResourceHandle::tryHandlePasswordBasedAuthentication):
(WebCore::ResourceHandle::receivedCredential):
(WebCore::ResourceHandle::schedule): Deleted.
(WebCore::ResourceHandle::unschedule): Deleted.
* platform/network/cf/ResourceHandleCFURLConnectionDelegate.cpp:
* platform/network/cf/ResourceHandleCFURLConnectionDelegate.h:
* platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::setupRequest):
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse):
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::canRespondToProtectionSpace):
* platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.h:
* platform/network/cf/ResourceRequest.h:
(WebCore::ResourceRequest::encodingRequiresPlatformData):
* platform/network/cf/ResourceRequestCFNet.cpp:
(WebCore::findCFURLRequestCopyContentDispositionEncodingFallbackArrayFunction):
(WebCore::ResourceRequest::doUpdatePlatformRequest):
(WebCore::ResourceRequest::doUpdatePlatformHTTPBody):
(WebCore::ResourceRequest::doUpdateResourceRequest):
(WebCore::ResourceRequest::setStorageSession):
(WebCore::findCFURLRequestSetContentDispositionEncodingFallbackArrayFunction): Deleted.
* platform/network/cf/ResourceRequestCFNet.h:
* platform/network/cf/ResourceResponse.h:
(WebCore::ResourceResponse::ResourceResponse):
* platform/network/cf/ResourceResponseCFNet.cpp:
(WebCore::ResourceResponse::cfURLResponse):
(WebCore::ResourceResponse::platformCertificateInfo):
* platform/network/cf/SynchronousLoaderClientCFNet.cpp:
* platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:
(WebCore::SynchronousResourceHandleCFURLConnectionDelegate::setupRequest):
(WebCore::SynchronousResourceHandleCFURLConnectionDelegate::setupConnectionScheduling):
(WebCore::adjustMIMETypeIfNecessary):
(WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveResponse):
(WebCore::SynchronousResourceHandleCFURLConnectionDelegate::willCacheResponse):
(WebCore::SynchronousResourceHandleCFURLConnectionDelegate::canRespondToProtectionSpace):
* platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.h:
* platform/network/cocoa/CredentialCocoa.h:
* platform/network/cocoa/CredentialCocoa.mm:
(WebCore::Credential::Credential): Deleted.
(WebCore::Credential::cfCredential): Deleted.
* platform/network/cocoa/ProtectionSpaceCocoa.h:
* platform/network/cocoa/ProtectionSpaceCocoa.mm:
(WebCore::ProtectionSpace::ProtectionSpace): Deleted.
(WebCore::ProtectionSpace::cfSpace): Deleted.
* platform/network/cocoa/ResourceRequestCocoa.mm:
(WebCore::ResourceRequest::nsURLRequest):
* platform/network/cocoa/ResourceResponseCocoa.mm:
(WebCore::ResourceResponse::platformCertificateInfo):
(WebCore::ResourceResponse::nsURLResponse): Deleted.
(WebCore::ResourceResponse::ResourceResponse): Deleted.
* platform/network/ios/QuickLook.h:
* platform/network/ios/QuickLook.mm:
(-[WebQuickLookHandleAsDelegate initWithConnectionDelegate:]): Deleted.
(-[WebQuickLookHandleAsDelegate connection:didReceiveDataArray:]): Deleted.
(-[WebQuickLookHandleAsDelegate connection:didReceiveData:lengthReceived:]): Deleted.
(-[WebQuickLookHandleAsDelegate connectionDidFinishLoading:]): Deleted.
(-[WebQuickLookHandleAsDelegate connection:didFailWithError:]): Deleted.
(-[WebQuickLookHandleAsDelegate detachHandle]): Deleted.
(WebCore::QuickLookHandle::create): Deleted.
(WebCore::QuickLookHandle::cfResponse): Deleted.
* platform/network/ios/ResourceHandleIOS.mm: Removed.
* platform/network/ios/ResourceRequestIOS.mm: Removed.
* platform/network/mac/AuthenticationMac.mm:
(-[WebCoreAuthenticationClientAsChallengeSender setCFChallenge:]): Deleted.
(-[WebCoreAuthenticationClientAsChallengeSender cfChallenge]): Deleted.
(WebCore::core): Deleted.
(WebCore::mac): Deleted.
* platform/network/mac/CookieJarMac.mm:
(WebCore::setCookiesFromDOM):
(WebCore::cookieStorage):
(WebCore::addCookie):
* platform/network/mac/CredentialStorageMac.mm:
* platform/network/mac/FormDataStreamMac.h:
* platform/network/mac/FormDataStreamMac.mm:
* platform/network/mac/ResourceErrorMac.mm:
(NSErrorFromCFError): Deleted.
(WebCore::ResourceError::ResourceError): Deleted.
(WebCore::ResourceError::nsError): Deleted.
(WebCore::ResourceError::operator NSError *): Deleted.
* platform/network/mac/ResourceHandleMac.mm:
(WebCore::ResourceHandle::continueWillCacheResponse):
(WebCore::ResourceHandle::getConnectionTimingData): Deleted.
* platform/network/mac/ResourceRequestMac.mm: Removed.
* platform/network/mac/SynchronousLoaderClient.mm:
(WebCore::SynchronousLoaderClient::platformBadResponseError):
* platform/network/mac/WebCoreResourceHandleAsDelegate.h:
* platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.h:
* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
* platform/network/mac/WebCoreURLResponse.mm:
(WebCore::synthesizeRedirectResponseIfNecessary):
* platform/win/TemporaryLinkStubs.cpp:
* testing/js/WebCoreTestSupportPrefix.h:
2016-10-10 Sam Weinig <sam@webkit.org>
Use IDLTypes in more places
https://bugs.webkit.org/show_bug.cgi?id=163247
Reviewed by Darin Adler.
Switch JS -> Native type conversions to use convert<IDLType>(...) rather
than convert<NativeType>(...). This allows us to differentiate things like
conversion from JSValue to DOMString vs. JSValue to USVString which have different
rules.
* bindings/generic/IDLTypes.h:
Add predicate for integer types.
* bindings/js/IDBBindingUtilities.cpp:
(WebCore::idbKeyPathFromValue):
* bindings/js/JSApplePaySessionCustom.cpp:
(WebCore::JSApplePaySession::completeShippingMethodSelection):
(WebCore::JSApplePaySession::completeShippingContactSelection):
* bindings/js/JSCryptoAlgorithmDictionary.cpp:
(WebCore::createAesKeyGenParams):
(WebCore::createRsaKeyGenParams):
* bindings/js/JSCustomElementRegistryCustom.cpp:
(WebCore::JSCustomElementRegistry::define):
* bindings/js/JSDocumentCustom.cpp:
(WebCore::JSDocument::getCSSCanvasContext):
* bindings/js/JSMockContentFilterSettingsCustom.cpp:
(WebCore::JSMockContentFilterSettings::setDecisionPoint):
(WebCore::toDecision):
* bindings/js/JSNodeFilterCustom.cpp:
(WebCore::JSNodeFilter::acceptNode):
Switch to new convert<IDLType> style.
* bindings/js/JSDOMBinding.h:
(WebCore::toRefPtrNativeArray): Deleted.
(WebCore::toNativeArray): Deleted.
These can now be called as convert<IDLSequence<IDLInterface<T>>> and convert<IDLType> respectively.
* bindings/js/JSDOMConvert.h:
(WebCore::Converter<IDLNullable<T>>::convert):
(WebCore::Converter<IDLBoolean>::convert):
(WebCore::Converter<IDLInterface<T>>::convert):
(WebCore::Converter<IDLByte>::convert):
(WebCore::Converter<IDLOctet>::convert):
(WebCore::Converter<IDLShort>::convert):
(WebCore::Converter<IDLUnsignedShort>::convert):
(WebCore::Converter<IDLLong>::convert):
(WebCore::Converter<IDLUnsignedLong>::convert):
(WebCore::Converter<IDLLongLong>::convert):
(WebCore::Converter<IDLUnsignedLongLong>::convert):
(WebCore::Converter<IDLFloat>::convert):
(WebCore::Converter<IDLUnrestrictedFloat>::convert):
(WebCore::Converter<IDLDouble>::convert):
(WebCore::Converter<IDLUnrestrictedDouble>::convert):
(WebCore::Converter<IDLDOMString>::convert):
(WebCore::Converter<IDLUSVString>::convert):
(WebCore::Detail::ArrayConverter::convert):
(WebCore::Converter<IDLSequence<T>>::convert):
(WebCore::Converter<IDLFrozenArray<T>>::convert):
(WebCore::Converter<IDLDictionary<T>>::convert):
(WebCore::Converter<IDLEnumeration<T>>::convert):
(WebCore::Detail::VariadicConverterBase::convert):
(WebCore::Detail::VariadicConverterBase<IDLInterface<T>>::convert):
(WebCore::convertVariadicArguments):
(WebCore::convertWrapperType): Deleted.
(WebCore::convertWrapperTypeSequence): Deleted.
(WebCore::Converter<bool>::convert): Deleted.
(WebCore::Converter<String>::convert): Deleted.
(WebCore::Converter<Vector<T>>::convert): Deleted.
(WebCore::Converter<int8_t>::convert): Deleted.
(WebCore::Converter<uint8_t>::convert): Deleted.
(WebCore::Converter<int16_t>::convert): Deleted.
(WebCore::Converter<uint16_t>::convert): Deleted.
(WebCore::Converter<int32_t>::convert): Deleted.
(WebCore::Converter<uint32_t>::convert): Deleted.
(WebCore::Converter<int64_t>::convert): Deleted.
(WebCore::Converter<uint64_t>::convert): Deleted.
Switch Converter to be specialized on IDLTypes. Add support for IDLNullable, IDLSequence, and IDLFrozenArray.
* bindings/scripts/CodeGenerator.pm:
(GetFlattenedMemberTypes): Deleted.
(GetNumberOfNullableMemberTypes): Deleted.
(GetIDLUnionMemberTypes): Deleted.
(GetBaseIDLType): Deleted.
(GetIDLType): Deleted.
Move IDLType conversion logic to CodeGeneratorJS so it can use GetEnumerationClassName and GetDictionaryClassName.
* bindings/scripts/CodeGeneratorJS.pm:
(AddToImplIncludesForIDLType):
Add support for sequences, FrozenArrays and external dictionaries.
(GenerateEnumerationsImplementationContent):
(GenerateEnumerationsHeaderContent):
Change the name of parse<enum> and convert<enum> to parseEnumeration<enum> and convertEnumeration<enum>
to make them more consistent with dictionary conversion specialization and not interfere with the convert
function specialization.
(GenerateDictionaryImplementationContent):
Simplify by using convert<IDLType>.
(GetFlattenedMemberTypes):
(GetNumberOfNullableMemberTypes):
(GetIDLUnionMemberTypes):
(GetBaseIDLType):
(GetIDLType):
Moved from CodeGenerator.pm
(IsHandledByDOMConvert):
(JSValueToNative):
Start switching JSValueToNative over to using convert<IDLType>. Use IsHandledByDOMConvert as a predicate
for what is supported.
* bindings/scripts/IDLParser.pm:
(applyTypedefs):
(cloneType):
(applyTypedefsForSignature):
(parseTypedef):
(parseOperationOrIterator):
(parseSpecialOperation):
Make typedefs work with aggregate types (unions, sequences and FrozenArrays).
* bindings/scripts/test/JS/JSTestEventTarget.cpp:
* bindings/scripts/test/JS/JSTestGlobalObject.cpp:
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestObj.h:
* bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
* bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
Update test results.
* bindings/scripts/test/TestTypedefs.idl:
Add additional tests for typedefs that use unions and sequences.
* testing/InternalSettings.idl:
Change the name of a parameter to avoid a name collision.
2016-10-11 Konstantin Tokarev <annulen@yandex.ru>
Fixed compilation with !ENABLE(SVG_FONTS)
https://bugs.webkit.org/show_bug.cgi?id=163281
Reviewed by Csaba Osztrogonác.
No new tests needed.
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::shouldUpdateCachedResourceWithCurrentRequest):
2016-10-11 Brent Fulgham <bfulgham@apple.com>
Unreviewed build fix after r207140.
* PlatformAppleWin.cmake: Add missing compile file.
2016-10-10 Brent Fulgham <bfulgham@apple.com>
[Win][Direct2D] Add initial Pattern handling implementation
https://bugs.webkit.org/show_bug.cgi?id=163270
Reviewed by Simon Fraser.
Provide an implemenation of Patterns for Direct2D.
No new tests. Covered by fast/borders/border-image-01.html and others.
* platform/graphics/GraphicsContext.h:
* platform/graphics/Pattern.h: Add D2D definitions.
* platform/graphics/win/GraphicsContextDirect2D.cpp:
(WebCore::GraphicsContext::solidStrokeBrush): Use a more generic return type.
(WebCore::GraphicsContext::solidFillBrush): Ditto.
(WebCore::GraphicsContext::patternStrokeBrush): Added.
(WebCore::GraphicsContext::patternFillBrush): Added.
(WebCore::GraphicsContext::drawPattern): Provide D2D implementation.
(WebCore::GraphicsContext::applyStrokePattern): Ditto.
(WebCore::GraphicsContext::applyFillPattern): Ditto.
(WebCore::GraphicsContext::drawPath): Use stroke pattern if available.
(WebCore::GraphicsContext::fillPath): Use fill pattern if available.
(WebCore::GraphicsContext::strokePath): Use stroke pattern if available.
(WebCore::GraphicsContext::fillRect): Use fill pattern if available.
* platform/graphics/win/GraphicsContextPlatformPrivateDirect2D.h:
* platform/graphics/win/PatternDirect2D.cpp: Added.
2016-10-11 Per Arne Vollan <pvollan@apple.com>
[Win] Compile fix.
https://bugs.webkit.org/show_bug.cgi?id=163272
Reviewed by Brent Fulgham.
When compiling with older SDKs, some CoreText symbols are redefined.
This patch checks if the relevant CoreText header file has been
included before defining the symbol.
* platform/spi/win/CoreTextSPIWin.h:
2016-10-11 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Buttons container
https://bugs.webkit.org/show_bug.cgi?id=163238
<rdar://problem/28701864>
Reviewed by Dean Jackson.
We add a new ButtonsContainer class which contains a group of Button objects
and positions them based on the provided padding and margin between buttons.
Buttons that aren't enabled or marked as dropped are not added to the tree of
LayoutNodes, and thus the DOM.
Additionally, we fix a few issues we found while working on tests for ButtonsContainer
where LayoutNodes would schedule layout callbacks even when they would not do any work
during the layout callback due to not resetting the `needsLayout` flag to false and
removing any scheduled tasks when a layout was completed.
Finally, we fix a few style issues that had not been caught so far and an unused
`size` property on IconButton.
Tests: media/modern-media-controls/buttons-container/buttons-container-buttons-property.html
media/modern-media-controls/buttons-container/buttons-container-constructor.html
media/modern-media-controls/buttons-container/buttons-container-layout.html
* Modules/modern-media-controls/controls/airplay-button.js:
(AirplayButton.prototype.set on):
(AirplayButton):
* Modules/modern-media-controls/controls/buttons-container.css:
(.buttons-container):
* Modules/modern-media-controls/controls/buttons-container.js:
(ButtonsContainer.prototype.get buttons):
(ButtonsContainer.prototype.set buttons):
(ButtonsContainer.prototype.layout):
* Modules/modern-media-controls/controls/icon-button.js:
* Modules/modern-media-controls/controls/layout-node.js:
(LayoutNode.prototype.set needsLayout):
(LayoutNode.prototype.markDirtyProperty):
(LayoutNode.prototype._markNodeManipulation):
(LayoutNode.prototype._updateDirtyState):
(performScheduledLayout):
(elementFromString):
* Modules/modern-media-controls/controls/scheduler.js:
(const.scheduler.new.prototype.unscheduleLayout):
2016-10-11 Youenn Fablet <youenn@apple.com>
[Fetch API] Support Request cache mode
https://bugs.webkit.org/show_bug.cgi?id=162281
Reviewed by Alex Christensen.
Covered by updated test.
Added support for only-if-cached mode at Request level.
Added support for cache mode at CachedResourceLoader, by setting HTTP headers and ResourceRequest cache policy
based on https://fetch.spec.whatwg.org/#concept-request-cache-mode and https://fetch.spec.whatwg.org/#http-network-or-cache-fetch.
Disabled default cache policy computation (done in FrameLoader) when cache mode is different from the default.
Activated no-store cache mode for EventSource as per https://html.spec.whatwg.org/#the-eventsource-interface.
* Modules/fetch/FetchRequest.cpp:
(WebCore::setCache): Adding support for only-if-cached.
(WebCore::buildOptions): Throw if only-if-cached and fetch mode is not same-origin.
* loader/FetchOptions.h: Adding support for only-if-cached.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::defaultRequestCachingPolicy): Introduced to ease readability.
(WebCore::FrameLoader::addExtraFieldsToRequest): Updating cache policy only if request has the default cache policy.
This allows bypassing the default behavior for fetch cache mode different from "default".
* loader/FrameLoader.h:
* loader/cache/CachedResourceLoader.cpp:
(WebCore::updateRequestAccordingCacheMode): Introduced to set headers and request cache policy according fetch cache mode.
(WebCore::CachedResourceLoader::requestResource):
(WebCore::CachedResourceLoader::loadResource):
(WebCore::CachedResourceLoader::determineRevalidationPolicy): Ensure bypassing the memory cache in no-store and reload cases.
We reload in case of cache mode=reload to refresh the meory cache entry.
* loader/cache/CachedResourceRequest.h:
(WebCore::CachedResourceRequest::setCacheModeToNoStore):
* page/EventSource.cpp:
(WebCore::EventSource::connect): Use no-store cache mode as per https://html.spec.whatwg.org/#the-eventsource-interface.
* platform/network/HTTPHeaderMap.cpp:
(WebCore::HTTPHeaderMap::addIfNotPresent): Helper routine.
* platform/network/HTTPHeaderMap.h:
* platform/network/HTTPHeaderValues.cpp:
* platform/network/HTTPHeaderValues.h:
* platform/network/ResourceRequestBase.cpp:
(WebCore::ResourceRequestBase::addHTTPHeaderFieldIfNotPresent):
(WebCore::ResourceRequestBase::addHTTPHeaderField):
(WebCore::ResourceRequestBase::hasHTTPHeaderField):
* platform/network/ResourceRequestBase.h:
2016-10-10 Antti Koivisto <antti@apple.com>
Stop copying author shadow pseudo rules into shadow tree style resolver
https://bugs.webkit.org/show_bug.cgi?id=163232
Reviewed by Darin Adler.
* css/ElementRuleCollector.cpp:
(WebCore::ElementRuleCollector::collectMatchingRules):
(WebCore::ElementRuleCollector::matchAuthorRules):
(WebCore::ElementRuleCollector::matchAuthorShadowPseudoElementRules):
If we are resolving a user agent shadow tree also look up pseudo element rules from the host scope author sheet.
This is needed to keep web exposed ::-webkit-foo pseudo elements working.
(WebCore::ElementRuleCollector::collectMatchingShadowPseudoElementRules):
Factor to a function.
* css/ElementRuleCollector.h:
* css/RuleSet.cpp:
(WebCore::RuleSet::copyShadowPseudoElementRulesFrom): Deleted.
* css/RuleSet.h:
* dom/Document.cpp:
(WebCore::Document::userAgentShadowTreeStyleResolver):
* style/StyleScope.cpp:
(WebCore::Style::Scope::updateStyleResolver):
No need to awkwardly copy these rules anymore.
2016-10-11 Chris Dumez <cdumez@apple.com>
Update IDBVersionChangeEvent to stop using legacy [ConstructorTemplate=Event]
https://bugs.webkit.org/show_bug.cgi?id=163266
Reviewed by Darin Adler.
Update IDBVersionChangeEvent to stop using legacy [ConstructorTemplate=Event]
and use a regular constructor instead, as in the specification:
- http://w3c.github.io/IndexedDB/#request-idbversionchangeevent
This patch also fixes a bug where the IDBVersionChangeEvent was ignoring the
EventInit dictionary members passed by the JavaScript (e.g. bubbles).
No new tests, updated existing test.
* Modules/indexeddb/IDBVersionChangeEvent.cpp:
(WebCore::IDBVersionChangeEvent::IDBVersionChangeEvent):
* Modules/indexeddb/IDBVersionChangeEvent.h:
* Modules/indexeddb/IDBVersionChangeEvent.idl:
* bindings/js/JSDOMConvert.h:
(WebCore::convertNullable):
(WebCore::convert): Deleted.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateDefaultValue):
(GenerateDictionaryImplementationContent):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::convertDictionary<TestObj::Dictionary>):
* bindings/scripts/test/TestObj.idl:
2016-10-11 Chris Dumez <cdumez@apple.com>
Update WebKitPlaybackTargetAvailabilityEvent to stop using legacy [ConstructorTemplate=Event]
https://bugs.webkit.org/show_bug.cgi?id=163265
Reviewed by Darin Adler.
Update WebKitPlaybackTargetAvailabilityEvent to stop using legacy
[ConstructorTemplate=Event] and use a regular constructor instead.
* Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.cpp:
(WebCore::WebKitPlaybackTargetAvailabilityEvent::WebKitPlaybackTargetAvailabilityEvent):
* Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.h:
(WebCore::WebKitPlaybackTargetAvailabilityEvent::createForBindings):
(WebCore::WebKitPlaybackTargetAvailabilityEvent::~WebKitPlaybackTargetAvailabilityEvent): Deleted.
* Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.idl:
2016-10-10 Zan Dobersek <zdobersek@igalia.com>
Add ENABLE_ENCRYPTED_MEDIA configuration option
https://bugs.webkit.org/show_bug.cgi?id=163219
Reviewed by Darin Adler.
* Configurations/FeatureDefines.xcconfig:
Add the ENABLE_ENCRYPTED_MEDIA configuration option. It will be used
to enable or disable the new EME implementation at build-time.
* DerivedSources.make: Group the legacy option and the new option together.
2016-10-10 Youenn Fablet <youenn@apple.com>
CachedResourceRequest constructor should be made more efficient
https://bugs.webkit.org/show_bug.cgi?id=163210
Reviewed by Alex Christensen.
No change of behavior.
Refactoring to use one CachedResourceRequest constructor that will move its request and charset to improve efficiency.
* css/StyleRuleImport.cpp:
(WebCore::StyleRuleImport::requestStyleSheet):
* dom/ProcessingInstruction.cpp:
(WebCore::ProcessingInstruction::checkStyleSheet):
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::process):
* html/parser/HTMLResourcePreloader.cpp:
(WebCore::PreloadRequest::resourceRequest):
* loader/cache/CachedResourceRequest.cpp:
(WebCore::CachedResourceRequest::CachedResourceRequest):
* loader/cache/CachedResourceRequest.h:
2016-10-10 Adam Bergkvist <adam.bergkvist@ericsson.com> and Alejandro G. Castro <alex@igalia.com>
WebRTC: Make MediaEndpointPeerConnection handle remotely assigned mids correctly
https://bugs.webkit.org/show_bug.cgi?id=163202
Reviewed by Eric Carlson.
An RTCRtpTransceiver has a null mid until it's been associated with a
media description (with a mid) [1]. During that time, it's identified by
a provisional mid that might become its real mid, but the transceiver
can also get its mid assigned by a remote media description. In the
second case, the mid value is initially unknown. A transceiver's
RTCRtpSender must directly (synchronously in the script) provide a muted
remote source that is playable by, for example, a media element. This
source is initially registered in the MediaEndpoint (WebRTC backend)
with the transceiver's provisional mid. So, if the real mid is set by a
remote description, the registered mid must be updated to preserve the
association between the registered source and the transceiver.
[1] https://w3c.github.io/webrtc-pc/archives/20160913/webrtc.html#dom-rtcrtptransceiver-mid
Test: fast/mediastream/RTCPeerConnection-remotely-assigned-transceiver-mid.html
* Modules/mediastream/MediaEndpointPeerConnection.cpp:
Don't break after finding the first transceiver in the loop that builds the send source map.
Update the mid used to register the muted remote source if the a transceiver's mid gets
assigned by a remote media description.
(WebCore::createSourceMap):
(WebCore::MediaEndpointPeerConnection::setRemoteDescriptionTask):
* platform/mediastream/MediaEndpoint.cpp:
* platform/mediastream/MediaEndpoint.h:
* platform/mock/MockMediaEndpoint.cpp:
(WebCore::MockMediaEndpoint::MockMediaEndpoint):
(WebCore::MockMediaEndpoint::updateReceiveConfiguration):
(WebCore::MockMediaEndpoint::updateSendConfiguration):
(WebCore::MockMediaEndpoint::createMutedRemoteSource):
(WebCore::MockMediaEndpoint::replaceMutedRemoteSourceMid):
(WebCore::MockMediaEndpoint::emulatePlatformEvent):
Add "unmute-remote-sources-by-mid" action that emulates data arriving on media descriptions
which unmutes the remote sources.
(WebCore::MockMediaEndpoint::updateConfigurationMids):
(WebCore::MockMediaEndpoint::unmuteRemoteSourcesByMid):
(WebCore::MockMediaEndpoint::unmuteTimerFired):
* platform/mock/MockMediaEndpoint.h:
2016-10-10 Darin Adler <darin@apple.com>
Move audio module off of legacy exceptions
https://bugs.webkit.org/show_bug.cgi?id=163269
Reviewed by Alex Christensen.
* Modules/webaudio/AnalyserNode.cpp:
(WebCore::AnalyserNode::setFftSize): Use ExceptionOr.
(WebCore::AnalyserNode::setMinDecibels): Ditto.
(WebCore::AnalyserNode::setMaxDecibels): Ditto.
(WebCore::AnalyserNode::setSmoothingTimeConstant): Ditto.
* Modules/webaudio/AnalyserNode.h: Update for above.
* Modules/webaudio/AnalyserNode.idl: Ditto.
* Modules/webaudio/AudioBasicInspectorNode.cpp:
(WebCore::AudioBasicInspectorNode::AudioBasicInspectorNode):
Initialize m_needAutomaticPull in class definition.
(WebCore::AudioBasicInspectorNode::connect): Use ExceptionOr.
(WebCore::AudioBasicInspectorNode::disconnect): Ditto.
* Modules/webaudio/AudioBasicInspectorNode.h: Updated for above.
* Modules/webaudio/AudioBuffer.cpp:
(WebCore::AudioBuffer::createFromAudioFileData): Use reference.
(WebCore::AudioBuffer::AudioBuffer): Initialize m_gain in class definition.
(WebCore::AudioBuffer::getChannelData): Use ExceptionOr.
(WebCore::AudioBuffer::channelData): Rename to disambiguate with getChannelData.
(WebCore::AudioBuffer::zero): Use modern for loop.
* Modules/webaudio/AudioBuffer.h: Update for above.
* Modules/webaudio/AudioBuffer.idl: Ditto.
* Modules/webaudio/AudioBufferSourceNode.cpp:
(WebCore::AudioBufferSourceNode::process): Use reference.
(WebCore::AudioBufferSourceNode::setBuffer): Use channelData.
(WebCore::AudioBufferSourceNode::start): Use ExceptionOr.
(WebCore::AudioBufferSourceNode::startPlaying): Ditto.
* Modules/webaudio/AudioBufferSourceNode.h: Update for above.
* Modules/webaudio/AudioBufferSourceNode.idl: Ditto.
* Modules/webaudio/AudioContext.cpp:
(WebCore::AudioContext::createBuffer): Use ExceptionOr.
(WebCore::AudioContext::createMediaElementSource): Ditto.
(WebCore::AudioContext::createMediaStreamSource): Ditto.
(WebCore::AudioContext::createScriptProcessor): Ditto.
(WebCore::AudioContext::createDelay): Ditto.
(WebCore::AudioContext::createChannelSplitter): Ditto.
(WebCore::AudioContext::createChannelMerger): Ditto.
(WebCore::AudioContext::createPeriodicWave): Ditto.
* Modules/webaudio/AudioContext.h: Update for above.
* Modules/webaudio/AudioContext.idl: Ditto.
* Modules/webaudio/AudioDestinationNode.h: Use unsigned instead
of unsigned long for maxChannelCount.
* Modules/webaudio/AudioNode.cpp:
(WebCore::AudioNode::connect): Use ExceptionOr.
(WebCore::AudioNode::disconnect): Ditto.
(WebCore::AudioNode::channelCount): Use unsigned.
(WebCore::AudioNode::setChannelCount): Use ExceptionOr and unsigned.
(WebCore::AudioNode::setChannelCountMode): Ditto.
(WebCore::AudioNode::setChannelInterpretation): Ditto.
* Modules/webaudio/AudioNode.h: Update for above.
* Modules/webaudio/AudioNode.idl: Ditto.
* Modules/webaudio/AudioScheduledSourceNode.cpp:
(WebCore::AudioScheduledSourceNode::AudioScheduledSourceNode):
Initialize data members in class definition.
(WebCore::AudioScheduledSourceNode::updateSchedulingInfo): Take
a reference instead of a pointer to the audio bus.
(WebCore::AudioScheduledSourceNode::start): Use ExceptionOr.
(WebCore::AudioScheduledSourceNode::stop): Ditto.
* Modules/webaudio/AudioScheduledSourceNode.h: Update for above.
* Modules/webaudio/ConvolverNode.cpp:
(WebCore::ConvolverNode::ConvolverNode): Initialize m_normalize
in class definition.
(WebCore::ConvolverNode::setBuffer): Use ExceptionOr.
* Modules/webaudio/ConvolverNode.h: Update for above.
* Modules/webaudio/ConvolverNode.idl: Ditto.
* Modules/webaudio/DefaultAudioDestinationNode.cpp:
(WebCore::DefaultAudioDestinationNode::DefaultAudioDestinationNode):
Initialize m_numberOfInputChannels in class definition.
(WebCore::DefaultAudioDestinationNode::maxChannelCount): Use unsigned.
(WebCore::DefaultAudioDestinationNode::setChannelCount): Use ExceptionOr.
* Modules/webaudio/DefaultAudioDestinationNode.h: Update for changes above.
* Modules/webaudio/DelayNode.cpp:
(WebCore::DelayNode::DelayNode): Moved exception logic out of constructor.
(WebCore::DelayNode::create): Added. Moved exception logic in here.
(WebCore::DelayNode::delayTime): Moved typecast here from header.
* Modules/webaudio/DelayNode.h: Update for above.
* Modules/webaudio/OfflineAudioContext.cpp:
(WebCore::OfflineAudioContext::OfflineAudioContext): Marked inline.
(WebCore::OfflineAudioContext::create): Use ExceptionOr.
(WebCore::OfflineAudioContext::~OfflineAudioContext): Deleted. Unneeded.
* Modules/webaudio/OfflineAudioContext.h: Update for above.
* Modules/webaudio/OfflineAudioContext.idl: Ditto.
* Modules/webaudio/OfflineAudioDestinationNode.cpp:
(WebCore::OfflineAudioDestinationNode::offlineRender): Use channelData.
* Modules/webaudio/OscillatorNode.cpp:
(WebCore::OscillatorNode::OscillatorNode): Updated for change to setType.
(WebCore::OscillatorNode::setType): Use ExceptionOr.
(WebCore::OscillatorNode::process): Use a reference.
* Modules/webaudio/OscillatorNode.h: Update for above.
* Modules/webaudio/OscillatorNode.idl: Ditto.
* Modules/webaudio/ScriptProcessorNode.cpp:
(WebCore::ScriptProcessorNode::process): Use channelData.
* bindings/js/JSDOMBinding.h: Added overloads of toJS to it can be used on
references to array buffers and array buffer views, not just pointers.
2016-10-10 Youenn Fablet <youenn@apple.com>
Change HTTPHeaderValues from a struct to a namespace
https://bugs.webkit.org/show_bug.cgi?id=163203
Reviewed by Alex Christensen.
No change of behavior.
* Modules/fetch/FetchBody.cpp:
(WebCore::FetchBody::extract):
* platform/network/HTTPHeaderValues.cpp:
(WebCore::HTTPHeaderValues::textPlainContentType):
(WebCore::HTTPHeaderValues::formURLEncodedContentType):
(WebCore::HTTPHeaderValues::TextPlainContentType): Deleted.
(WebCore::HTTPHeaderValues::FormURLEncodedContentType): Deleted.
* platform/network/HTTPHeaderValues.h:
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::send):
2016-10-10 Chris Dumez <cdumez@apple.com>
Update WheelEvent / MouseEvent to stop using legacy [ConstructorTemplate=Event]
https://bugs.webkit.org/show_bug.cgi?id=163254
Reviewed by Darin Adler.
Update WheelEvent / MouseEvent to stop using legacy [ConstructorTemplate=Event]
and use a regular constructor instead, as in the specification:
- https://www.w3.org/TR/uievents/#interface-mouseevent
- https://www.w3.org/TR/uievents/#interface-wheelevent
* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
(GenerateDictionaryHeader):
Fix our broken dependency tracking when it comes to dictionaries.
* dom/MouseEvent.cpp:
(WebCore::MouseEvent::create):
(WebCore::MouseEvent::MouseEvent):
* dom/MouseEvent.h:
* dom/MouseEvent.idl:
* dom/MouseEventInit.h: Added.
* dom/MouseEventInit.idl: Added.
* dom/MouseRelatedEvent.cpp:
(WebCore::MouseRelatedEvent::MouseRelatedEvent):
* dom/MouseRelatedEvent.h:
* dom/UIEventWithKeyState.h:
(WebCore::UIEventWithKeyState::UIEventWithKeyState):
* dom/WheelEvent.cpp:
(WebCore::WheelEvent::WheelEvent):
* dom/WheelEvent.h:
* dom/WheelEvent.idl:
2016-10-10 Chris Dumez <cdumez@apple.com>
Add support for languagechange event
https://bugs.webkit.org/show_bug.cgi?id=163222
Reviewed by Ryosuke Niwa.
Add support for languagechange event:
- https://html.spec.whatwg.org/#dom-navigator-languages
Firefox and Chrome already support this.
Test: fast/dom/window-languagechange-event.html
* dom/EventNames.h:
* html/HTMLAttributeNames.in:
* html/HTMLBodyElement.cpp:
(WebCore::HTMLBodyElement::createWindowEventHandlerNameMap):
* page/DOMWindow.cpp:
(WebCore::languagesChangedCallback):
(WebCore::DOMWindow::DOMWindow):
(WebCore::DOMWindow::~DOMWindow):
(WebCore::DOMWindow::languagesChanged):
(WebCore::DOMWindow::canShowModalDialog): Deleted.
(WebCore::DOMWindow::removeEventListener): Deleted.
* page/DOMWindow.h:
* page/WindowEventHandlers.idl:
2016-10-10 Chris Dumez <cdumez@apple.com>
Update GamepadEvent to stop using legacy [ConstructorTemplate=Event]
https://bugs.webkit.org/show_bug.cgi?id=163243
Reviewed by Darin Adler.
Update GamepadEvent to stop using legacy [ConstructorTemplate=Event]
and use a proper constructor as in the specification:
- https://w3c.github.io/gamepad/#gamepadevent-interface
* Modules/gamepad/GamepadEvent.cpp:
(WebCore::GamepadEvent::GamepadEvent):
* Modules/gamepad/GamepadEvent.h:
(WebCore::GamepadEvent::create):
(WebCore::GamepadEvent::~GamepadEvent): Deleted.
* Modules/gamepad/GamepadEvent.idl:
2016-10-10 Darin Adler <darin@apple.com>
Move Fetch from legacy to new DOM exceptions
https://bugs.webkit.org/show_bug.cgi?id=163195
Reviewed by Chris Dumez.
* Modules/fetch/FetchHeaders.cpp:
(WebCore::canWriteHeader): Use ExceptionOr.
(WebCore::FetchHeaders::append): Ditto.
(WebCore::FetchHeaders::remove): Ditto.
(WebCore::FetchHeaders::get): Ditto.
(WebCore::FetchHeaders::has): Ditto.
(WebCore::FetchHeaders::set): Ditto.
(WebCore::FetchHeaders::filterAndFill): Ditto.
(WebCore::FetchHeaders::Iterator::next): Got rid of unneeded code to
clear out m_keys after the last call to next, since it will be deleted
as soon as the iterator is deleted.
* Modules/fetch/FetchHeaders.h: Use pragma once. Use ExceptionOr.
* Modules/fetch/FetchHeaders.idl: Move to non-legacy exceptions.
* Modules/fetch/FetchRequest.cpp:
(WebCore::FetchRequest::setBody): Use ExceptionOr.
(WebCore::FetchRequest::clone): Ditto.
* Modules/fetch/FetchRequest.h: Use pragma once. Use ExceptionOr.
* Modules/fetch/FetchRequest.idl: Move to non-legacy exceptions.
* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::redirect): Use ExceptionOr.
(WebCore::FetchResponse::setStatus): Ditto.
* Modules/fetch/FetchResponse.h: Use ExceptionOr.
* Modules/fetch/FetchResponse.idl: Move to non-legacy exceptions.
* bindings/js/JSDOMBinding.h: Added implementation of toJSNullableString.
* bindings/scripts/CodeGeneratorJS.pm:
(NativeToJSValue): Call toJSNullableString and toJSString for
functions that return ExceptionOr<String>.
2016-10-10 Nan Wang <n_wang@apple.com>
AX: Expose invalid status for input types with that information
https://bugs.webkit.org/show_bug.cgi?id=163252
<rdar://problem/28704409>
Reviewed by Chris Fleizach.
For input types with invalid input value, we should expose the invalid
status to the assitive technology.
Test: accessibility/mac/invalid-status-for-input-types.html
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::invalidStatus):
2016-10-10 Konstantin Tokarev <annulen@yandex.ru>
Added override specifier to PluginViewBase::isPluginViewBase()
https://bugs.webkit.org/show_bug.cgi?id=163218
Reviewed by Alex Christensen.
No new tests needed.
* plugins/PluginViewBase.h:
2016-10-10 Alex Christensen <achristensen@webkit.org>
Don't run SecurityOrigin's port through URLParser
https://bugs.webkit.org/show_bug.cgi?id=163253
Reviewed by Brady Eidson.
No change in behavior.
* page/SecurityOrigin.cpp:
(WebCore::SecurityOrigin::maybeCreateFromDatabaseIdentifier):
(WebCore::SecurityOrigin::create):
We used to parse URLs like "file://:0/" which are valid when using URL::parse
but aren't valid when we start using the URLParser, which matches other browsers' failure
to parse URLs with a port but no host. There is no reason to write and parse the port.
Setting m_port directly accomplishes the same thing.
2016-10-10 Said Abou-Hallawa <sabouhallawa@apple.com>
<Error>: CGContextSetLineDash: invalid dash array: at least one element must be non-zero
https://bugs.webkit.org/show_bug.cgi?id=138555
Reviewed by Simon Fraser.
Ensure the dashArray has at least one non-zero element before calling
GraphicsContext::setLineDash(). Call GraphicsContext::setStrokeStyle()
instead, if the dashArray does not have one.
* rendering/svg/SVGRenderSupport.cpp:
(WebCore::SVGRenderSupport::applyStrokeStyleToContext):
2016-10-10 Brent Fulgham <bfulgham@apple.com>
[Win][Direct2D] Correct Radial Graident Bug
https://bugs.webkit.org/show_bug.cgi?id=163241
Reviewed by Darin Adler.
Radial gradients were not working correctly under Direct2D because the
points and radius values used were incorrect. D2D wants a center point and
an offset, not a start and end point. It wants an X and Y radius (for an
ellipse), not a radius at the start point, and a radius at the end point.
Covered by existing fast/gradients/css-radial-gradients.html (and others).
* platform/graphics/Image.cpp:
(WebCore::Image::drawTiled): Remove 'notImplemented' code path.
* platform/graphics/win/GradientDirect2D.cpp:
(WebCore::Gradient::generateGradient): Use correct input values to
the Radial Gradient constructor.
(WebCore::Gradient::fill): Generate a gradient if we have no active
one to use.
2016-10-10 Jiewen Tan <jiewen_tan@apple.com>
Rename CryptoAlgorithmParameters to CryptoAlgorithmParametersDeprecated
https://bugs.webkit.org/show_bug.cgi?id=163163
<rdar://problem/28681544>
Reviewed by Brent Fulgham.
Replace all uses of 'CryptoAlgorithmParameters' with 'CryptoAlgorithmParametersDeprecated' in preparation for a new CryptoAlgorithmParameters type.
No changes of behaviors. No new tests.
* Modules/encryptedmedia/CDMSessionClearKey.cpp:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSCryptoAlgorithmDictionary.cpp:
* bindings/js/JSCryptoAlgorithmDictionary.h:
* bindings/js/JSCryptoKeySerializationJWK.cpp:
* bindings/js/JSCryptoKeySerializationJWK.h:
* bindings/js/JSWebKitSubtleCryptoCustom.cpp:
* crypto/CryptoAlgorithm.cpp:
* crypto/CryptoAlgorithm.h:
* crypto/CryptoAlgorithmParametersDeprecated.h: Renamed from Source/WebCore/crypto/CryptoAlgorithmParameters.h.
* crypto/CryptoKeySerialization.h:
* crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
* crypto/algorithms/CryptoAlgorithmAES_CBC.h:
* crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
* crypto/algorithms/CryptoAlgorithmAES_KW.h:
* crypto/algorithms/CryptoAlgorithmHMAC.cpp:
* crypto/algorithms/CryptoAlgorithmHMAC.h:
* crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
* crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h:
* crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
* crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h:
* crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
* crypto/algorithms/CryptoAlgorithmRSA_OAEP.h:
* crypto/algorithms/CryptoAlgorithmSHA1.cpp:
* crypto/algorithms/CryptoAlgorithmSHA1.h:
* crypto/algorithms/CryptoAlgorithmSHA224.cpp:
* crypto/algorithms/CryptoAlgorithmSHA224.h:
* crypto/algorithms/CryptoAlgorithmSHA256.cpp:
* crypto/algorithms/CryptoAlgorithmSHA256.h:
* crypto/algorithms/CryptoAlgorithmSHA384.cpp:
* crypto/algorithms/CryptoAlgorithmSHA384.h:
* crypto/algorithms/CryptoAlgorithmSHA512.cpp:
* crypto/algorithms/CryptoAlgorithmSHA512.h:
* crypto/keys/CryptoKeySerializationRaw.cpp:
* crypto/gnutls/CryptoAlgorithmAES_CBCGnuTLS.cpp:
* crypto/gnutls/CryptoAlgorithmHMACGnuTLS.cpp:
* crypto/gnutls/CryptoAlgorithmRSA_OAEPGnuTLS.cpp:
* crypto/gnutls/CryptoAlgorithmRSASSA_PKCS1_v1_5GnuTLS.cpp:
* crypto/keys/CryptoKeySerializationRaw.h:
* crypto/mac/CryptoAlgorithmAES_CBCMac.cpp:
* crypto/mac/CryptoAlgorithmHMACMac.cpp:
* crypto/mac/CryptoAlgorithmRSASSA_PKCS1_v1_5Mac.cpp:
* crypto/mac/CryptoAlgorithmRSA_OAEPMac.cpp:
* crypto/parameters/CryptoAlgorithmAesCbcParamsDeprecated.h: Renamed from Source/WebCore/crypto/parameters/CryptoAlgorithmAesCbcParams.h.
* crypto/parameters/CryptoAlgorithmAesKeyGenParamsDeprecated.h: Renamed from Source/WebCore/crypto/parameters/CryptoAlgorithmAesKeyGenParams.h.
* crypto/parameters/CryptoAlgorithmHmacKeyParamsDeprecated.h: Renamed from Source/WebCore/crypto/parameters/CryptoAlgorithmHmacKeyParams.h.
* crypto/parameters/CryptoAlgorithmHmacParamsDeprecated.h: Renamed from Source/WebCore/crypto/parameters/CryptoAlgorithmHmacParams.h.
* crypto/parameters/CryptoAlgorithmRsaKeyGenParamsDeprecated.h: Renamed from Source/WebCore/crypto/parameters/CryptoAlgorithmRsaKeyGenParams.h.
* crypto/parameters/CryptoAlgorithmRsaKeyParamsWithHashDeprecated.h: Renamed from Source/WebCore/crypto/parameters/CryptoAlgorithmRsaKeyParamsWithHash.h.
* crypto/parameters/CryptoAlgorithmRsaOaepParamsDeprecated.h: Renamed from Source/WebCore/crypto/parameters/CryptoAlgorithmRsaOaepParams.h.
* crypto/parameters/CryptoAlgorithmRsaSsaParamsDeprecated.h: Renamed from Source/WebCore/crypto/parameters/CryptoAlgorithmRsaSsaParams.h.
2016-10-10 Darin Adler <darin@apple.com>
Move NotificationCenter from legacy to new DOM exceptions
https://bugs.webkit.org/show_bug.cgi?id=163217
Reviewed by Chris Dumez.
* Modules/notifications/DOMWindowNotifications.cpp:
(WebCore::DOMWindowNotifications::webkitNotifications): Pass reference to
document instead of pointer. Also use auto and early return.
* Modules/notifications/Notification.cpp:
(WebCore::Notification::Notification): Move checks that can lead to
throwing an exception out of the constructor into the create function.
(WebCore::Notification::create): Changed to use ExceptionOr. Also moved
checks that can lead to throwing an exception here.
(WebCore::Notification::show): Update since NotificationController::client
now returns a reference.
(WebCore::Notification::permission): Ditto.
(WebCore::Notification::requestPermission): Ditto.
* Modules/notifications/Notification.h: Updated for above changes.
* Modules/notifications/NotificationCenter.cpp:
(WebCore::NotificationCenter::create): Take a reference to the script execution
context instead of a pointer.
(WebCore::NotificationCenter::NotificationCenter): Ditto.
(WebCore::NotificationCenter::createNotification): Use ExceptionOr.
(WebCore::NotificationCenter::requestPermission): Take an rvalue reference.
* Modules/notifications/NotificationCenter.h: Use pragma once.
Marked the class final. Updated for changes above.
* Modules/notifications/NotificationCenter.idl: Use non-legacy exceptions.
* Modules/notifications/NotificationController.cpp:
(WebCore::NotificationController::NotificationController): Use a reference rather
than a pointer for m_client, since it is never null.
(WebCore::NotificationController::~NotificationController): Ditto.
(WebCore::NotificationController::clientFrom): Updated for the change above.
* Modules/notifications/NotificationController.h: Updated for the change above.
* Modules/notifications/WorkerGlobalScopeNotifications.cpp:
(WebCore::WorkerGlobalScopeNotifications::webkitNotifications): Updated to
pass a reference for the script execution context. Also added FIXME about the
fact that the client is always null.
2016-10-10 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Placards
https://bugs.webkit.org/show_bug.cgi?id=163110
<rdar://problem/28669342>
Reviewed by Dean Jackson.
Inline media controls need to display placards when the video is no longer playing inline,
such as when the video is playing fullscreen or via AirPlay. To that end, we introduce a
new Placard class and two subclasses for display during fullscreen or AirPlay playback.
Note that localization will be done in a later patch.
Tests: media/modern-media-controls/airplay-placard/airplay-placard.html
media/modern-media-controls/pip-placard/pip-placard.html
media/modern-media-controls/placard/placard.html
* Modules/modern-media-controls/controls/airplay-placard.js:
(AirplayPlacard):
* Modules/modern-media-controls/controls/icon-service.js:
* Modules/modern-media-controls/controls/pip-placard.js:
(PiPPlacard):
* Modules/modern-media-controls/controls/placard.css:
(.placard):
(.placard .container):
(.placard .icon):
(.placard .title,):
(.placard .title):
(.placard .description):
* Modules/modern-media-controls/controls/placard.js:
(Placard.):
* Modules/modern-media-controls/images/iOS/airplay-placard@1x.png: Added.
* Modules/modern-media-controls/images/iOS/airplay-placard@2x.png: Added.
* Modules/modern-media-controls/images/iOS/airplay-placard@3x.png: Added.
* Modules/modern-media-controls/images/iOS/pip-placard@1x.png: Added.
* Modules/modern-media-controls/images/iOS/pip-placard@2x.png: Added.
* Modules/modern-media-controls/images/iOS/pip-placard@3x.png: Added.
* Modules/modern-media-controls/images/macOS/airplay-placard@1x.png: Added.
* Modules/modern-media-controls/images/macOS/airplay-placard@2x.png: Added.
* Modules/modern-media-controls/images/macOS/pip-placard@1x.png: Added.
* Modules/modern-media-controls/images/macOS/pip-placard@2x.png: Added.
2016-10-10 Chris Dumez <cdumez@apple.com>
Add support for Navigator.languages attribute
https://bugs.webkit.org/show_bug.cgi?id=163220
Reviewed by Darin Adler.
Add support for Navigator.languages attribute:
- https://html.spec.whatwg.org/#navigatorlanguage
Firefox and Chrome already support this.
Currently, we always return a single language for privacy reasons so
this API does not actually bring anything new besides interoperability
with other browsers and compliance with the HTML specification.
No new tests, rebaselined existing tests.
* page/NavigatorBase.cpp:
(WebCore::NavigatorBase::languages):
* page/NavigatorBase.h:
* page/NavigatorLanguage.idl:
2016-10-10 Brent Fulgham <bfulgham@apple.com>
[Win][Direct2D] Implement dashed and dotted border line drawing
https://bugs.webkit.org/show_bug.cgi?id=163235
Reviewed by Alex Christensen.
Covered by existing fast/border tests.
* platform/graphics/GraphicsContext.cpp: Use custom 'setPlatformStrokeStyle' for D2D.
* platform/graphics/Path.cpp:
(WebCore::Path::length): Don't use default implementation for Direct2D.
* platform/graphics/win/GraphicsContextDirect2D.cpp:
(WebCore::GraphicsContextPlatformPrivate::brushWithColor): Initialize pointer to nullptr.
(WebCore::GraphicsContext::drawRect): Use proper stroke style.
(WebCore::GraphicsContextPlatformPrivate::setLineCap): Added.
(WebCore::GraphicsContextPlatformPrivate::setLineJoin): Added.
(WebCore::GraphicsContextPlatformPrivate::setStrokeStyle): Added.
(WebCore::GraphicsContextPlatformPrivate::setMiterLimit): Added.
(WebCore::GraphicsContextPlatformPrivate::setDashOffset): Added.
(WebCore::GraphicsContextPlatformPrivate::setPatternWidth): Added.
(WebCore::GraphicsContextPlatformPrivate::setPatternOffset): Added.
(WebCore::GraphicsContextPlatformPrivate::setStrokeThickness): Added.
(WebCore::GraphicsContextPlatformPrivate::setDashes): Added.
(WebCore::GraphicsContextPlatformPrivate::recomputeStrokeStyle): Added.
(WebCore::GraphicsContextPlatformPrivate::strokeStyle): Added.
(WebCore::GraphicsContext::drawLine): Use proper stroke style.
(WebCore::GraphicsContext::drawEllipse): Ditto.
(WebCore::GraphicsContext::drawPath): Ditto.
(WebCore::GraphicsContext::strokePath): Ditto.
(WebCore::GraphicsContext::setPlatformStrokeStyle): Added.
(WebCore::GraphicsContext::setMiterLimit): Tell D2D context about miter limit.
(WebCore::GraphicsContext::setLineCap): Ditto for line cap.
(WebCore::GraphicsContext::setLineDash): Ditto for dashes.
(WebCore::GraphicsContext::setLineJoin): Ditto for join style.
(WebCore::GraphicsContext::setPlatformStrokeThickness): Ditto for stroke thickness.
(WebCore::GraphicsContext::platformStrokeEllipse): Use proper stroke style.
* platform/graphics/win/GraphicsContextPlatformPrivateDirect2D.h:
* platform/graphics/win/PathDirect2D.cpp:
(WebCore::Path::currentPoint): Zero-initialize a value.
(WebCore::Path::length): Added.
2016-10-10 Chris Dumez <cdumez@apple.com>
Update ProgressEvent to stop using legacy [ConstructorTemplate=Event]
https://bugs.webkit.org/show_bug.cgi?id=163221
Reviewed by Darin Adler.
Update ProgressEvent to stop using legacy [ConstructorTemplate=Event]
and use a regular constructor as in the specification:
- https://xhr.spec.whatwg.org/#firing-events-using-the-progressevent-interface
* dom/ProgressEvent.cpp:
(WebCore::ProgressEvent::ProgressEvent):
* dom/ProgressEvent.h:
(WebCore::ProgressEvent::create):
* dom/ProgressEvent.idl:
2016-10-10 Wenson Hsieh <wenson_hsieh@apple.com>
Address some review feedback from r206979 and r207010
https://bugs.webkit.org/show_bug.cgi?id=163236
Reviewed by Tim Horton.
In TypingCommand.h, some methods on TypingCommand should be marked as final to reflect the fact that they
override methods in CompositeEditCommand. Also, HTMLFormControlElement::dispatchFormControlInputEvent does not
need to specify HTMLElement::dispatchInputEvent() when calling dispatchInputEvent().
No new tests, since there is no behavior change.
* editing/TypingCommand.h:
* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::dispatchFormControlInputEvent):
2016-10-10 Chris Dumez <cdumez@apple.com>
Update MessageEvent to stop using legacy [ConstructorTemplate=Event]
https://bugs.webkit.org/show_bug.cgi?id=163187
Reviewed by Darin Adler.
Update MessageEvent to stop using legacy [ConstructorTemplate=Event] and
use a regular constructor as in the specification:
- https://html.spec.whatwg.org/multipage/comms.html#the-messageevent-interfaces
No new tests, updated existing test.
* bindings/js/JSDOMBinding.h:
(WebCore::toRefPtrNativeArray):
* bindings/js/JSDOMConvert.h:
(WebCore::convertWrapperTypeSequence):
(WebCore::convertWrapperType): Deleted.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateDefaultValue):
(GenerateDictionaryImplementationContent):
(GetNativeType):
* dom/MessageEvent.cpp:
(WebCore::MessageEvent::MessageEvent):
(WebCore::MessageEvent::create):
(WebCore::MessageEvent::trySerializeData):
(WebCore::MessageEvent::createForBindings): Deleted.
(WebCore::MessageEvent::initMessageEvent): Deleted.
* dom/MessageEvent.h:
* dom/MessageEvent.idl:
2016-10-10 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Buttons
https://bugs.webkit.org/show_bug.cgi?id=163109
<rdar://problem/28668954>
Reviewed by Dean Jackson.
We introduce specific IconButton subclasses for the various buttons we will be using
in media controls on macOS (inline and fullscreen) and iOS. One class, StartButton, is
a subclass of Button and not IconButton because we're only interested in having it display
an <img> element rather than use a mask and requires additional DOM structure.
Tests: media/modern-media-controls/airplay-button/airplay-button-on.html
media/modern-media-controls/airplay-button/airplay-button.html
media/modern-media-controls/aspect-ratio-button/aspect-ratio-button.html
media/modern-media-controls/forward-button/forward-button.html
media/modern-media-controls/fullscreen-button/fullscreen-button.html
media/modern-media-controls/mute-button/mute-button.html
media/modern-media-controls/pip-button/pip-button.html
media/modern-media-controls/play-pause-button/play-pause-button.html
media/modern-media-controls/rewind-button/rewind-button.html
media/modern-media-controls/skip-back-button/skip-back-button.html
media/modern-media-controls/start-button/start-button.html
media/modern-media-controls/tracks-button/tracks-button.html
* Modules/modern-media-controls/controls/airplay-button.css:
(button.airplay.on):
* Modules/modern-media-controls/controls/airplay-button.js:
(AirplayButton):
(AirplayButton.prototype.set on):
* Modules/modern-media-controls/controls/aspect-ratio-button.js:
(AspectRatioButton):
(AspectRatioButton.prototype.get scalesToFill):
(AspectRatioButton.prototype.set scalesToFill):
* Modules/modern-media-controls/controls/forward-button.js:
(ForwardButton):
* Modules/modern-media-controls/controls/fullscreen-button.js:
(FullscreenButton):
* Modules/modern-media-controls/controls/icon-button.js:
* Modules/modern-media-controls/controls/icon-service.js:
* Modules/modern-media-controls/controls/mute-button.js:
(MuteButton):
(MuteButton.prototype.get muted):
(MuteButton.prototype.set muted):
* Modules/modern-media-controls/controls/pip-button.js:
(PiPButton):
* Modules/modern-media-controls/controls/play-pause-button.js:
(PlayPauseButton):
(PlayPauseButton.prototype.get playing):
(PlayPauseButton.prototype.set playing):
* Modules/modern-media-controls/controls/rewind-button.js:
(RewindButton):
* Modules/modern-media-controls/controls/skip-back-button.js:
(SkipBackButton):
* Modules/modern-media-controls/controls/start-button.js:
(StartButton):
* Modules/modern-media-controls/controls/tracks-button.js:
(TracksButton):
* Modules/modern-media-controls/images/iOS/airplay@1x.png: Added.
* Modules/modern-media-controls/images/iOS/airplay@2x.png: Added.
* Modules/modern-media-controls/images/iOS/enter-fullscreen@1x.png: Added.
* Modules/modern-media-controls/images/iOS/enter-fullscreen@2x.png: Added.
* Modules/modern-media-controls/images/iOS/enter-fullscreen@3x.png: Added.
* Modules/modern-media-controls/images/iOS/interval-skip-back@1x.png: Added.
* Modules/modern-media-controls/images/iOS/interval-skip-back@2x.png: Added.
* Modules/modern-media-controls/images/iOS/interval-skip-back@3x.png: Added.
* Modules/modern-media-controls/images/iOS/pause@1x.png: Added.
* Modules/modern-media-controls/images/iOS/pip-in@1x.png: Added.
* Modules/modern-media-controls/images/iOS/pip-in@2x.png: Added.
* Modules/modern-media-controls/images/iOS/pip-in@3x.png: Added.
* Modules/modern-media-controls/images/iOS/play@1x.png: Added.
* Modules/modern-media-controls/images/iOS/play@2x.png: Added.
* Modules/modern-media-controls/images/iOS/play@3x.png: Added.
* Modules/modern-media-controls/images/iOS/start@1x.png: Added.
* Modules/modern-media-controls/images/macOS/airplay-fullscreen@1x.png: Added.
* Modules/modern-media-controls/images/macOS/airplay-fullscreen@2x.png: Added.
* Modules/modern-media-controls/images/macOS/airplay@1x.png: Added.
* Modules/modern-media-controls/images/macOS/airplay@2x.png: Added.
* Modules/modern-media-controls/images/macOS/enter-fullscreen@1x.png: Added.
* Modules/modern-media-controls/images/macOS/enter-fullscreen@2x.png: Added.
* Modules/modern-media-controls/images/macOS/exit-fullscreen@1x.png: Added.
* Modules/modern-media-controls/images/macOS/exit-fullscreen@2x.png: Added.
* Modules/modern-media-controls/images/macOS/forward@1x.png: Added.
* Modules/modern-media-controls/images/macOS/forward@2x.png: Added.
* Modules/modern-media-controls/images/macOS/interval-skip-back@1x.png: Added.
* Modules/modern-media-controls/images/macOS/interval-skip-back@2x.png: Added.
* Modules/modern-media-controls/images/macOS/media-selection-fullscreen@1x.png: Added.
* Modules/modern-media-controls/images/macOS/media-selection-fullscreen@2x.png: Added.
* Modules/modern-media-controls/images/macOS/media-selection@1x.png: Added.
* Modules/modern-media-controls/images/macOS/media-selection@2x.png: Added.
* Modules/modern-media-controls/images/macOS/pip-in@1x.png: Added.
* Modules/modern-media-controls/images/macOS/pip-in@2x.png: Added.
* Modules/modern-media-controls/images/macOS/play-fullscreen@1x.png: Added.
* Modules/modern-media-controls/images/macOS/play-fullscreen@2x.png: Added.
* Modules/modern-media-controls/images/macOS/play@1x.png: Added.
* Modules/modern-media-controls/images/macOS/play@2x.png: Added.
* Modules/modern-media-controls/images/macOS/rewind@1x.png: Added.
* Modules/modern-media-controls/images/macOS/rewind@2x.png: Added.
* Modules/modern-media-controls/images/macOS/scale-to-fill@1x.png: Added.
* Modules/modern-media-controls/images/macOS/scale-to-fill@2x.png: Added.
* Modules/modern-media-controls/images/macOS/scale-to-fit@1x.png: Added.
* Modules/modern-media-controls/images/macOS/scale-to-fit@2x.png: Added.
* Modules/modern-media-controls/images/macOS/volume-mute@1x.png: Added.
* Modules/modern-media-controls/images/macOS/volume-mute@2x.png: Added.
* Modules/modern-media-controls/images/macOS/volume@1x.png: Added.
* Modules/modern-media-controls/images/macOS/volume@2x.png: Added.
2016-10-10 Nan Wang <n_wang@apple.com>
AX: Update AXPlaceHolder algorithm
https://bugs.webkit.org/show_bug.cgi?id=163229
Reviewed by Chris Fleizach.
From https://w3c.github.io/html-aam/
When the placeholder and aria-placeholder attributes are both present, we
should expose the value of the placeholder attribute. Updated the algorithm
for that.
Changes are covered in the modified test.
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::placeholderValue):
2016-10-10 Yusuke Suzuki <utatane.tea@gmail.com>
[DOMJIT] Implement Node accessors in DOMJIT
https://bugs.webkit.org/show_bug.cgi?id=163005
Reviewed by Filip Pizlo.
This patch implements DOMJIT accessors in WebCore. We plan to offer 2 things in DOMJIT.
1. Hand written DOM inlining.
We inject DOMJIT::Patchpoint compiler into JSC. And JSC uses this to inline DOM operation,
and drop type checks. Since the operation is fully inlined, potentially it has large
performance boost. Note that CSS Selector JIT compiler already does the similar things:
accessing parentNode etc. directly by using offsets.
2. Exposing signature information.
We will offer function type signature by some representation and pass it to JSC.
JSC will use to drop type checks. Since IDL code generator already knows this,
we can automatically generate such a information. Since we don't perform any inlining,
the performance boost may be limited. But it's worth doing.
This patch implements the first one, hand written DOM inlining facility. We add a new IDL attribute,
"DOMJIT". This means that "This readonly attribute have a DOMJIT patchpoint compiler".
We annotate several accessors at first. "firstChild", "lastChild", "nextSibling", "previousSibling",
and "parentNode". And we implement DOMJIT::Patchpoint for that in JSNodeDOMJIT.cpp.
This patchpoint will be integrated into JSC's DFG and FTL. And these tiers can drop type checks and
inline the entire code of these accessors. JSC compiler still does not know much about DOM. And WebCore
does not know much about each tier of JSC. WebCore just offers the generic patchpoints and they are
used in both DFG and FTL tiers. The layer separation is still kept.
While very small microbenchmark[1] shows performance benefit, still we cannot improve DOM
benchmarks due to the lack of following implementations. Once the following implementations
are implemented, we will get performance boost.
1. Super polymorphic sites.
This inlining is super effective if we run some microbenchmarks. However, Dromaeo does not
show so much performance benefit. This is because Dromaeo's dom-traverse.html is super
polymorphic call site where JSC gives up optimization. For example, in the following
dromaeo's benchmark, we can see so various DOM nodes at the `cur.firstChild` site, like,
HTMLDivElement, HTMLAnchorElement, Text, Comment etc. JSC gives up optimization since we
encounter so many Structures. This should be optimized since they share the large part of
prototype-chain and they hit the exactly same CustomGetter, Node.prototype.firstChild.
We will handle this and when we optimize it, this DOMJIT works well on Dromaeo.
test( "firstChild", function(){
var nodes = document.body.childNodes, nl = nodes.length;
for ( var i = 0; i < num; i++ ) {
for ( var j = 0; j < nl; j++ ) {
var cur = nodes[j];
while ( cur )
cur = cur.firstChild;
ret = cur;
}
}
});
2. Emit code in IC.
Currently, we only optimize DOMJIT accessors in DFG and FTL. However, we should leverage
this DOMJIT::Patchpoint to emit inlined code even in Inline Caching (IC). We will emit
CheckDOM's code for IC's guard phase, and emit CallDOM's code for IC's get phase. This
offers performance benefit even if we live in baseline JIT code. And this should be easy.
[1]: With the following one, we can see 3x improvement (26ms v.s. 80ms).
var element = document.getElementsByTagName('div')[3];
var before = Date.now();
for (var i = 0; i < 1e7; ++i)
element.firstChild;
console.log(Date.now() - before);
* CMakeLists.txt:
* ForwardingHeaders/domjit/DOMJITGetterSetter.h:
* ForwardingHeaders/domjit/DOMJITPatchpoint.h: Copied from Source/JavaScriptCore/domjit/DOMJITSlowPathCalls.h.
* ForwardingHeaders/domjit/DOMJITPatchpointParams.h: Copied from Source/JavaScriptCore/domjit/DOMJITSlowPathCalls.h.
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSDOMGlobalObject.h:
* bindings/js/JSDOMWrapper.h:
(WebCore::JSDOMWrapper::offsetOfWrapped):
(WebCore::JSDOMWrapper::wrapped): Deleted.
* bindings/js/ScriptWrappable.h:
(WebCore::ScriptWrappable::offsetOfWrapper):
* bindings/scripts/CodeGeneratorJS.pm:
(GetJSCAttributesForAttribute):
(GenerateHeader):
(GeneratePropertiesHashTable):
(GenerateImplementation):
(GenerateHashTableValueArray):
* bindings/scripts/IDLAttributes.txt:
* dom/ContainerNode.h:
(WebCore::ContainerNode::lastChildMemoryOffset):
(WebCore::ContainerNode::lastChild): Deleted.
* dom/Node.h:
(WebCore::Node::flagIsContainer):
(WebCore::Node::flagIsText): Deleted.
* dom/Node.idl:
* domjit/DOMJITHelpers.h: Added.
(WebCore::DOMJITHelpers::branchIfNotWorldIsNormal):
(WebCore::DOMJITHelpers::branchIfNotWeakIsLive):
(WebCore::DOMJITHelpers::tryLookUpWrapperCache):
(WebCore::DOMJITHelpers::toWrapper):
(WebCore::DOMJITHelpers::branchIfDOMWrapper):
(WebCore::DOMJITHelpers::branchIfNotDOMWrapper):
(WebCore::DOMJITHelpers::branchIfNode):
(WebCore::DOMJITHelpers::branchIfNotNode):
(WebCore::DOMJITHelpers::branchIfElement):
(WebCore::DOMJITHelpers::branchIfNotElement):
(WebCore::DOMJITHelpers::branchIfDocumentWrapper):
(WebCore::DOMJITHelpers::branchIfNotDocumentWrapper):
* domjit/JSNodeDOMJIT.cpp: Added.
(WebCore::toWrapperSlow):
(WebCore::createCallDOMForOffsetAccess):
(WebCore::checkNode):
(WebCore::NodeFirstChildDOMJIT::checkDOM):
(WebCore::NodeFirstChildDOMJIT::callDOM):
(WebCore::NodeLastChildDOMJIT::checkDOM):
(WebCore::NodeLastChildDOMJIT::callDOM):
(WebCore::NodeNextSiblingDOMJIT::checkDOM):
(WebCore::NodeNextSiblingDOMJIT::callDOM):
(WebCore::NodePreviousSiblingDOMJIT::checkDOM):
(WebCore::NodePreviousSiblingDOMJIT::callDOM):
(WebCore::NodeParentNodeDOMJIT::checkDOM):
(WebCore::NodeParentNodeDOMJIT::callDOM):
2016-10-10 Wenson Hsieh <wenson_hsieh@apple.com>
Support InputEvent.data for the new InputEvent spec
https://bugs.webkit.org/show_bug.cgi?id=163113
<rdar://problem/28681935>
Reviewed by Darin Adler.
Introduces InputEvent.data, a string attribute that, if non-null, indicates the text to be inserted by an input
event. For text areas and text inputs, the 'insertText', 'insertFromPaste', 'insertFromDrop', and
'insertReplacementText' input types should cause subsequent `input` and `beforeinput` events to have non-null
data. However, for contenteditable areas, only 'insertText' leads to having data in resulting InputEvents.
To implement this, we introduce a new virtual method, CompositeEditCommand::inputEventData, which gives
composite editing commands the chance to vend a data string for input events they might fire (by default, this
is null).
Tests: fast/events/input-events-paste-data.html
fast/events/input-events-typing-data.html
* dom/InputEvent.cpp:
(WebCore::InputEvent::InputEvent):
* dom/InputEvent.h:
* dom/InputEvent.idl:
Currently, our InputEventInit struct is wrong. According to the UI-Events spec at www.w3.org/TR/uievents/, the
init struct for an InputEvent should contain a data string (added in this patch) as well as an isComposing flag
(to be added in a future patch along with composition support). While adding support for the data attribute, we
tweak the InputEvent IDL and headers slightly to adjust for this.
* dom/Node.cpp:
(WebCore::Node::dispatchInputEvent):
* dom/Node.h:
* editing/CompositeEditCommand.h:
(WebCore::CompositeEditCommand::inputEventData):
* editing/EditCommand.cpp:
(WebCore::EditCommand::isEditingTextAreaOrTextInput):
* editing/EditCommand.h:
* editing/Editor.cpp:
(WebCore::dispatchBeforeInputEvent):
(WebCore::dispatchInputEvent):
(WebCore::dispatchBeforeInputEvents):
(WebCore::dispatchInputEvents):
(WebCore::Editor::willApplyEditing):
(WebCore::Editor::appliedEditing):
(WebCore::Editor::setBaseWritingDirection):
(WebCore::Editor::computeAndSetTypingStyle):
* editing/ReplaceRangeWithTextCommand.cpp:
(WebCore::ReplaceRangeWithTextCommand::inputEventData):
* editing/ReplaceRangeWithTextCommand.h:
* editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplaceSelectionCommand::inputEventData):
* editing/ReplaceSelectionCommand.h:
* editing/SpellingCorrectionCommand.cpp:
(WebCore::SpellingCorrectionCommand::inputEventData):
* editing/SpellingCorrectionCommand.h:
* editing/TypingCommand.cpp:
(WebCore::TypingCommand::TypingCommand):
(WebCore::TypingCommand::inputEventData):
(WebCore::TypingCommand::willAddTypingToOpenCommand):
(WebCore::TypingCommand::insertTextRunWithoutNewlines):
* editing/TypingCommand.h:
* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::dispatchFormControlInputEvent):
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::setEditingValue):
(WebCore::HTMLInputElement::setValueFromRenderer):
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::listBoxOnChange):
(WebCore::HTMLSelectElement::dispatchChangeEventForMenuList):
2016-10-10 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r206972.
https://bugs.webkit.org/show_bug.cgi?id=163227
Making EWS flaky (Requested by bfulgham_ on #webkit).
Reverted changeset:
"[CMake] CMake does not support the dep files for implicit
dependency"
https://bugs.webkit.org/show_bug.cgi?id=161433
http://trac.webkit.org/changeset/206972
2016-10-10 Darin Adler <darin@apple.com>
Move media source from legacy to new DOM exceptions
https://bugs.webkit.org/show_bug.cgi?id=163201
Reviewed by Chris Dumez.
* Modules/mediasource/MediaSource.cpp: Removed unneeded includes.
(WebCore::MediaSource::create): Use auto.
(WebCore::MediaSource::MediaSource): Initialize m_mediaElement in class definition.
(WebCore::MediaSource::setLiveSeekableRange): Use ExceptionOr.
(WebCore::MediaSource::clearLiveSeekableRange): Ditto.
(WebCore::MediaSource::setDuration): Ditto.
(WebCore::MediaSource::setDurationInternal): Ditto.
(WebCore::MediaSource::endOfStream): Ditto.
(WebCore::MediaSource::streamEndedWithError): Use bufferedInternal.
(WebCore::MediaSource::addSourceBuffer): Use ExceptionOr.
(WebCore::MediaSource::removeSourceBuffer): Ditto.
(WebCore::MediaSource::detachFromElement): Use removeSourceBuffer
without IGNORE_EXCEPTION since that is now the default behavior.
(WebCore::MediaSource::activeRanges): Use bufferedInternal.
(WebCore::MediaSource::createSourceBufferPrivate): Use ExceptionOr.
* Modules/mediasource/MediaSource.h: Removed unneeded includes.
Made more things private and also private rather than protected.
* Modules/mediasource/MediaSource.idl: Use non-legacy exceptions.
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::buffered): Use ExceptionOr.
(WebCore::SourceBuffer::setTimestampOffset): Ditto.
(WebCore::SourceBuffer::setAppendWindowStart): Ditto.
(WebCore::SourceBuffer::setAppendWindowEnd): Ditto.
(WebCore::SourceBuffer::appendBuffer): Ditto.
(WebCore::SourceBuffer::abort): Ditto.
(WebCore::SourceBuffer::remove): Ditto.
(WebCore::SourceBuffer::appendBufferInternal): Ditto.
(WebCore::SourceBuffer::setMode): Ditto.
* Modules/mediasource/SourceBuffer.h: Removed unneeded includes.
Updated for above changes. Made more things private.
* Modules/mediasource/SourceBuffer.idl: Use non-legacy exceptions.
* platform/graphics/gstreamer/WebKitMediaSourceGStreamer.h:
Added now-needed include of MediaSourcePrivate.h.
2016-10-10 Jer Noble <jer.noble@apple.com>
Address flaky airplay-* LayouTests
https://bugs.webkit.org/show_bug.cgi?id=163044
Reviewed by Brent Fulgham.
Two separate problems conspired to make airplay tests a bit flaky:
For one, when the HTMLMediaElement clears its MediaPlayer, it won't necessarily notify
clients that it has stopped playing to a wireless target. The WebMediaSessionManager may
eventually cause this value to reset, but it's asynchronous, and may fire after the next
test starts. Reset this state explicitly.
For two, the state of the mock playback target picker was not being reset between test
invocations.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::clearMediaPlayer):
* testing/Internals.cpp:
(WebCore::Internals::resetToConsistentState):
2016-10-10 Brent Fulgham <bfulgham@apple.com>
Correct typo in comment (patining -> painting).
* platform/graphics/GraphicsContext.cpp:
(WebCore::GraphicsContext::centerLineAndCutOffCorners):
2016-10-10 Brent Fulgham <bfulgham@apple.com>
Reduce code duplication between CG, Cairo, and Direct2D
https://bugs.webkit.org/show_bug.cgi?id=163157
Reviewed by Darin Adler.
Move a number of routines that have been copied-and-pasted to different
platform files into the main GraphicsContext.cpp file.
No new tests because there is no change in behavior.
* platform/graphics/GraphicsContext.cpp:
(WebCore::GraphicsContext::dashedLineCornerWidthForStrokeWidth): Added.
(WebCore::GraphicsContext::dashedLinePatternWidthForStrokeWidth): Added.
(WebCore::GraphicsContext::dashedLinePatternOffsetForPatternAndStrokeWidth): Added.
(WebCore::GraphicsContext::centerLineAndCutOffCorners): Added.
* platform/graphics/GraphicsContext.h:
* platform/graphics/cairo/GraphicsContextCairo.cpp:
(WebCore::GraphicsContext::drawLine): Call new helper function.
* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::GraphicsContext::drawLine): Ditto.
* platform/graphics/win/GraphicsContextDirect2D.cpp:
(WebCore::GraphicsContext::drawLine): Ditto.
2016-10-10 Carlos Garcia Campos <cgarcia@igalia.com>
REGRESSION(r206731): [SOUP] Network process crash in gotHeadersCallback
https://bugs.webkit.org/show_bug.cgi?id=163170
Reviewed by Michael Catanzaro.
Do not assume NetworkingContext is non-null and valid before using it.
* platform/network/soup/ResourceHandleSoup.cpp:
(WebCore::gotHeadersCallback):
(WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
2016-10-10 Youenn Fablet <youenn@apple.com>
Images and scripts should be said as clean based on CachedResource::isCORSSameOrigin
https://bugs.webkit.org/show_bug.cgi?id=162390
Reviewed by Darin Adler.
No observable change of behavior.
Renaming CachedResource::isClean to isCORSSameOrigin to match html spec terminology.
Making use of it to check whether images taint canvas and whether script errors should be sanitized.
Some asserts are added to ensure that a resource fetched using one origin is not reused for another origin.
* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::sanitizeScriptError):
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::initializeStyleSheet):
* html/canvas/CanvasRenderingContext.cpp:
(WebCore::CanvasRenderingContext::wouldTaintOrigin):
* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::isOriginClean):
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::isCORSSameOrigin):
* loader/cache/CachedResource.h:
2016-10-10 Youenn Fablet <youenn@apple.com>
[Fetch API] Memory cache should not bypass redirect mode
https://bugs.webkit.org/show_bug.cgi?id=162959
Reviewed by Darin Adler.
Test: http/tests/fetch/redirectmode-and-preload.html
Ensure reloading of resources if the redirect modes are different between request and cached resource, and
cached resource has redirections.
As a temporary workaround, we activate resource update for raw resources in
shouldUpdateCachedResourceWithCurrentRequest but disable it in canUpdateFromResource.
This allows handling reloading of resources with different redirection mode in canUpdateFromResource.
A future patch should allow loading cached raw resources from other cached raw resources.
* loader/cache/CachedResource.h:
(WebCore::CachedResource::hasRedirections):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::shouldUpdateCachedResourceWithCurrentRequest):
(WebCore::canUpdateFromResource):
(WebCore::CachedResourceLoader::updateCachedResourceWithCurrentRequest):
2016-10-10 Youenn Fablet <youenn@apple.com>
Attribute getter binding generated code should use more references
https://bugs.webkit.org/show_bug.cgi?id=163179
Reviewed by Darin Adler.
No change of behavior.
Using more references in attribute getter generated code since BindingCaller::attribute can do the
pointer-to-references checks once for all.
Needed to update GenerateCallWith and NativeToJSValue to handle the case where references (attribute getters) or
pointers (methods and attribute setters) are to be used.
Future refactoring should allign methods/attribute setters to attribute getters.
* bindings/js/JSDOMBinding.h:
(WebCore::BindingCaller::attribute):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
(GenerateCallWith):
(NativeToJSValue):
(JSValueToNative):
* bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
* bindings/scripts/test/JS/JSTestException.cpp:
* bindings/scripts/test/JS/JSTestGlobalObject.cpp:
* bindings/scripts/test/JS/JSTestInterface.cpp:
* bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
* bindings/scripts/test/JS/JSTestNode.cpp:
* bindings/scripts/test/JS/JSTestNondeterministic.cpp:
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSattribute.cpp:
2016-10-10 Youenn Fablet <youenn@apple.com>
Fix Mac Win build after https://trac.webkit.org/changeset/206966
https://bugs.webkit.org/show_bug.cgi?id=163199
Unreviewed.
* bindings/js/JSDOMBinding.h: Marking rejectPromiseWithGetterTypeError as WEBCORE_EXPORT.
2016-10-09 Antti Koivisto <antti@apple.com>
Enable optimized stylesheet updates in shadow trees
https://bugs.webkit.org/show_bug.cgi?id=163180
Reviewed by Darin Adler.
When we get a new stylesheet (for example when load completes) we invalidate only
those elements in DOM that are affected by the new sheet. This patch makes the
optimization also work in shadow trees.
Test: fast/shadow-dom/scoped-style-invalidation.html
* css/StyleInvalidationAnalysis.cpp:
(WebCore::StyleInvalidationAnalysis::invalidateStyle):
* css/StyleInvalidationAnalysis.h:
* dom/Document.cpp:
(WebCore::Document::didRemoveAllPendingStylesheet):
* style/StyleScope.cpp:
(WebCore::Style::Scope::removePendingSheet):
(WebCore::Style::Scope::analyzeStyleSheetChange):
(WebCore::Style::Scope::updateActiveStyleSheets):
2016-10-10 Youenn Fablet <youenn@apple.com>
Refactor binding generated casted-this checks for attribute setters
https://bugs.webkit.org/show_bug.cgi?id=163181
Reviewed by Darin Adler.
No change of behavior.
Covered by existing tests and binding expectations.
Adding support for attribute setter in BindingCaller.
Updating binding generator to make use of it.
Future refactoring should use more reference and rename castedThis to thisObject, like for getters.
* bindings/js/JSDOMBinding.h:
(WebCore::BindingCaller::setAttribute):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
* bindings/scripts/test/JS/JSTestInterface.cpp:
* bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
* bindings/scripts/test/JS/JSTestNode.cpp:
* bindings/scripts/test/JS/JSTestNondeterministic.cpp:
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
2016-10-09 Darin Adler <darin@apple.com>
Move encrypted media from legacy to new DOM exceptions
https://bugs.webkit.org/show_bug.cgi?id=163194
Reviewed by Youenn Fablet.
* Modules/encryptedmedia/CDM.cpp:
(WebCore::CDM::createSession): Take a reference instead of a pointer.
* Modules/encryptedmedia/CDM.h: Updated for above change.
* Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
(WebCore::WebKitMediaKeySession::create): Take a reference instead of a pointer.
(WebCore::WebKitMediaKeySession::MediaKeySession): Ditto.
(WebCore::WebKitMediaKeySession::~MediaKeySession): Removed unneeded code that
sets m_session to null.
(WebCore::WebKitMediaKeySession::keyRequestTimerFired): Use auto.
(WebCore::WebKitMediaKeySession::update): Use ExceptionOr.
(WebCore::WebKitMediaKeySession::addKeyTimerFired): Use m_keys directly instead
of calling the keys function.
(WebCore::WebKitMediaKeySession::sendError): Set m_error directly instead of
calling the setError function.
(WebCore::WebKitMediaKeySession::mediaKeysStorageDirectory): Use auto.
(WebCore::WebKitMediaKeySession::hasPendingActivity): Check m_session directly
instead of writing !isClosed.
(WebCore::WebKitMediaKeySession::setError): Deleted.
* Modules/encryptedmedia/legacy/WebKitMediaKeySession.h: Use pragma once. Removed
unneeded includes. Changed create to take a reference instead of a pointer.
Made most members and base classes private instead of public. Also removed
a few now-unneeded functions. Made everything that was formerly protected
private instead, since the two are the same in a final class.
* Modules/encryptedmedia/legacy/WebKitMediaKeySession.idl: Removed unneeded comments.
Moved from MayThrowLegacyException to MayThrowException.
* Modules/encryptedmedia/legacy/WebKitMediaKeys.cpp:
(WebCore::WebKitMediaKeys::create): Use ExceptionOr.
(WebCore::WebKitMediaKeys::MediaKeys): Made argument be an rvalue reference.
Also initialize m_mediaElement in the class definition.
(WebCore::WebKitMediaKeys::~MediaKeys): Call detachKeys instead of setKeys(nullptr).
(WebCore::WebKitMediaKeys::createSession): Use ExceptionOr. Also pass reference
insteead of pointer to create. Also removed unneeded separate checks for null
strings in code that already calls isEmpty.
(WebCore::WebKitMediaKeys::isTypeSupported): Removed unneeded checks for null strings
in code that already calls isEmpty.
(WebCore::WebKitMediaKeys::cdmMediaPlayer): Tweaked a bit.
(WebCore::WebKitMediaKeys::cachedKeyForKeyId): Use auto.
* Modules/encryptedmedia/legacy/WebKitMediaKeys.h: Use pragma once. Removed unneeded includes.
Changed cdm() function to return a reference. Initialize m_mediaElement.
Use private instead of protected.
* Modules/encryptedmedia/legacy/WebKitMediaKeys.idl: Use ConstructorMayThrowException
and MayThrowException instead of the legacy versions.
2016-10-09 Zan Dobersek <zdobersek@igalia.com>
ENABLE_LEGACY_ENCRYPTED_MEDIA interfaces should have a hard-coded WebKit prefix
https://bugs.webkit.org/show_bug.cgi?id=162982
Reviewed by Jer Noble.
Have the Web-exposed interfaces guarded by ENABLE_LEGACY_ENCRYPTED_MEDIA also use
the WebKit prefix in the implementations. This will prevent conflicts between
interfaces with same names in both the legacy API and the future EME API.
Most of the interfaces in this legacy API already used the WebKit prefix when
exposed via JS bindings. The only exception is MediaKeyNeededEvent, which gets
prefixed in this patch.
The interface implementations for this legacy API are also moved under the
Modules/encryptedmedia/legacy/ directory.
No new tests -- covered by existing tests (with the relevant changes reflected
in the updated baselines).
* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.make:
* Modules/encryptedmedia/CDM.cpp:
* Modules/encryptedmedia/CDMSessionClearKey.cpp:
(WebCore::CDMSessionClearKey::generateKeyRequest):
(WebCore::CDMSessionClearKey::update):
* Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.cpp: Renamed from Source/WebCore/Modules/encryptedmedia/MediaKeyMessageEvent.cpp.
(WebCore::WebKitMediaKeyMessageEvent::WebKitMediaKeyMessageEvent):
(WebCore::WebKitMediaKeyMessageEvent::~WebKitMediaKeyMessageEvent):
(WebCore::WebKitMediaKeyMessageEvent::eventInterface):
* Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.h: Renamed from Source/WebCore/Modules/encryptedmedia/MediaKeyMessageEvent.h.
(WebCore::WebKitMediaKeyMessageEvent::create):
(WebCore::WebKitMediaKeyMessageEvent::createForBindings):
* Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.idl: Renamed from Source/WebCore/Modules/encryptedmedia/MediaKeyMessageEvent.idl.
* Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.cpp: Renamed from Source/WebCore/Modules/encryptedmedia/MediaKeyNeededEvent.cpp.
(WebCore::WebKitMediaKeyNeededEvent::WebKitMediaKeyNeededEvent):
(WebCore::WebKitMediaKeyNeededEvent::~WebKitMediaKeyNeededEvent):
(WebCore::WebKitMediaKeyNeededEvent::eventInterface):
* Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.h: Renamed from Source/WebCore/Modules/encryptedmedia/MediaKeyNeededEvent.h.
(WebCore::WebKitMediaKeyNeededEvent::create):
(WebCore::WebKitMediaKeyNeededEvent::createForBindings):
* Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.idl: Renamed from Source/WebCore/Modules/encryptedmedia/MediaKeyNeededEvent.idl.
* Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp: Renamed from Source/WebCore/Modules/encryptedmedia/MediaKeySession.cpp.
(WebCore::WebKitMediaKeySession::create):
(WebCore::WebKitMediaKeySession::WebKitMediaKeySession):
(WebCore::WebKitMediaKeySession::~WebKitMediaKeySession):
(WebCore::WebKitMediaKeySession::setError):
(WebCore::WebKitMediaKeySession::close):
(WebCore::WebKitMediaKeySession::cachedKeyForKeyId):
(WebCore::WebKitMediaKeySession::sessionId):
(WebCore::WebKitMediaKeySession::generateKeyRequest):
(WebCore::WebKitMediaKeySession::keyRequestTimerFired):
(WebCore::WebKitMediaKeySession::update):
(WebCore::WebKitMediaKeySession::addKeyTimerFired):
(WebCore::WebKitMediaKeySession::sendMessage):
(WebCore::WebKitMediaKeySession::sendError):
(WebCore::WebKitMediaKeySession::mediaKeysStorageDirectory):
(WebCore::WebKitMediaKeySession::hasPendingActivity):
(WebCore::WebKitMediaKeySession::stop):
(WebCore::WebKitMediaKeySession::activeDOMObjectName):
(WebCore::WebKitMediaKeySession::canSuspendForDocumentSuspension):
* Modules/encryptedmedia/legacy/WebKitMediaKeySession.h: Renamed from Source/WebCore/Modules/encryptedmedia/MediaKeySession.h.
* Modules/encryptedmedia/legacy/WebKitMediaKeySession.idl: Renamed from Source/WebCore/Modules/encryptedmedia/MediaKeySession.idl.
* Modules/encryptedmedia/legacy/WebKitMediaKeys.cpp: Renamed from Source/WebCore/Modules/encryptedmedia/MediaKeys.cpp.
(WebCore::WebKitMediaKeys::create):
(WebCore::WebKitMediaKeys::WebKitMediaKeys):
(WebCore::WebKitMediaKeys::~WebKitMediaKeys):
(WebCore::WebKitMediaKeys::createSession):
(WebCore::WebKitMediaKeys::isTypeSupported):
(WebCore::WebKitMediaKeys::setMediaElement):
(WebCore::WebKitMediaKeys::cdmMediaPlayer):
(WebCore::WebKitMediaKeys::keyAdded):
(WebCore::WebKitMediaKeys::cachedKeyForKeyId):
* Modules/encryptedmedia/legacy/WebKitMediaKeys.h: Renamed from Source/WebCore/Modules/encryptedmedia/MediaKeys.h.
* Modules/encryptedmedia/legacy/WebKitMediaKeys.idl: Renamed from Source/WebCore/Modules/encryptedmedia/MediaKeys.idl.
* bindings/js/JSDictionary.cpp:
(WebCore::JSDictionary::convertValue):
* bindings/js/JSDictionary.h:
* dom/EventNames.in:
* dom/EventTargetFactory.in:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaPlayerKeyNeeded):
(WebCore::HTMLMediaElement::setMediaKeys):
* html/HTMLMediaElement.h:
(WebCore::HTMLMediaElement::keys):
* html/HTMLMediaElement.idl:
* html/WebKitMediaKeyError.h: Renamed from Source/WebCore/html/MediaKeyError.h.
(WebCore::WebKitMediaKeyError::create):
(WebCore::WebKitMediaKeyError::WebKitMediaKeyError):
* html/WebKitMediaKeyError.idl: Renamed from Source/WebCore/html/MediaKeyError.idl.
* testing/MockCDM.cpp:
(WebCore::MockCDMSession::generateKeyRequest):
(WebCore::MockCDMSession::update):
2016-10-09 Zan Dobersek <zdobersek@igalia.com>
Remove stale ENABLE(ENCRYPTED_MEDIA) code in HTMLMediaElement
https://bugs.webkit.org/show_bug.cgi?id=163111
Reviewed by Alex Christensen.
Remove three method implementations in HTMLMediaElement which had their
declarations and the related WebIDL entries removed in the first ENCRYPTED_MEDIA
purge in r206440.
No new tests -- no changes in behavior.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::webkitGenerateKeyRequest): Deleted.
(WebCore::HTMLMediaElement::webkitAddKey): Deleted.
(WebCore::HTMLMediaElement::webkitCancelKeyRequest): Deleted.
2016-10-09 Wenson Hsieh <wenson_hsieh@apple.com>
Support InputEvent.inputType for the new InputEvent spec
https://bugs.webkit.org/show_bug.cgi?id=163025
<rdar://problem/28658092>
Reviewed by Darin Adler.
Adds support for the inputType attribute of InputEvent. To do this, we introduce a helper to
map EditActions to inputType names, and also split out ambiguous EditActions (such as
EditActionTyping) into more specific subtypes (such as EditActionTypingDeleteBackward,
EditActionTypingInsertParagraph, etc.), each of which corresponds to an inputType.
In places where we create CompositeEditCommands, we now pass in these specific EditActions
where appropriate, and when dispatching `beforeinput` and `input` events, we ask the
CompositeEditCommand for its input type name, which it derives from its editingAction.
Tests: fast/events/before-input-prevent-biu.html
fast/events/before-input-prevent-cut.html
fast/events/before-input-prevent-paste.html
fast/events/before-input-prevent-typing.html
fast/events/before-input-prevent-undo.html
* dom/InputEvent.h:
* dom/Node.cpp:
(WebCore::Node::dispatchInputEvent):
* dom/Node.h:
* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::apply):
(WebCore::CompositeEditCommand::inputEventTypeName):
Allows a CompositeEditCommand to specify the inputType its corresponding `beforeinput` and `input` events
should have.
* editing/CompositeEditCommand.h:
(WebCore::CompositeEditCommand::shouldStopCaretBlinking): Deleted.
* editing/EditAction.h:
* editing/EditCommand.cpp:
(WebCore::inputTypeNameForEditingAction):
* editing/EditCommand.h:
* editing/Editor.cpp:
(WebCore::Editor::willApplyEditing):
(WebCore::Editor::appliedEditing):
(WebCore::Editor::willUnapplyEditing):
(WebCore::Editor::unappliedEditing):
(WebCore::Editor::willReapplyEditing):
(WebCore::Editor::reappliedEditing):
(WebCore::Editor::computeAndSetTypingStyle):
* editing/InsertListCommand.cpp:
(WebCore::InsertListCommand::editingAction):
* editing/InsertListCommand.h:
(WebCore::InsertListCommand::preservesTypingStyle): Deleted.
(WebCore::InsertListCommand::editingAction): Deleted.
* editing/ReplaceRangeWithTextCommand.cpp:
(WebCore::ReplaceRangeWithTextCommand::ReplaceRangeWithTextCommand):
* editing/SpellingCorrectionCommand.cpp:
(WebCore::SpellingCorrectionCommand::SpellingCorrectionCommand):
* editing/TypingCommand.cpp:
(WebCore::editActionForTypingCommand):
(WebCore::TypingCommand::TypingCommand):
(WebCore::TypingCommand::inputEventTypeName):
The editingAction() of a TypingCommand is the first editing action the TypingCommand was initialized using.
Since subsequent typing commands update the last open typing command, we override inputEventTypeName here to
use the last updated editing action rather than the default (initial) editing action.
(WebCore::TypingCommand::willAddTypingToOpenCommand):
(WebCore::TypingCommand::insertTextRunWithoutNewlines):
(WebCore::TypingCommand::insertParagraphSeparator):
* editing/TypingCommand.h:
2016-10-09 Darin Adler <darin@apple.com>
Move ApplePaySession from legacy to new DOM exceptions
https://bugs.webkit.org/show_bug.cgi?id=163191
Reviewed by Sam Weinig.
* Modules/applepay/ApplePaySession.cpp:
(WebCore::ApplePaySession::create): Use ExceptionOr.
(WebCore::ApplePaySession::ApplePaySession): Moved initialization
of two of the data members to class definition.
(WebCore::ApplePaySession::supportsVersion): Use ExceptionOr.
(WebCore::ApplePaySession::canMakePayments): Ditto.
(WebCore::ApplePaySession::canMakePaymentsWithActiveCard): Ditto.
(WebCore::ApplePaySession::openPaymentSetup): Ditto.
(WebCore::ApplePaySession::begin): Ditto.
(WebCore::ApplePaySession::abort): Ditto.
(WebCore::ApplePaySession::completeMerchantValidation): Ditto.
(WebCore::ApplePaySession::completeShippingMethodSelection): Ditto.
(WebCore::ApplePaySession::completeShippingContactSelection): Ditto.
(WebCore::ApplePaySession::completePaymentMethodSelection): Ditto.
(WebCore::ApplePaySession::completePayment): Ditto.
(WebCore::ApplePaySession::validateMerchant): Use auto and get instead of
using a RefPtr type and * for event dispatching.
(WebCore::ApplePaySession::didAuthorizePayment): Ditto.
(WebCore::ApplePaySession::didSelectShippingMethod): Ditto.
(WebCore::ApplePaySession::didSelectShippingContact): Ditto.
(WebCore::ApplePaySession::didSelectPaymentMethod): Ditto.
(WebCore::ApplePaySession::didCancelPayment): Ditto.
(WebCore::ApplePaySession::paymentCoordinator): Moved dereferencing
inside the downcast.
* Modules/applepay/ApplePaySession.h: Updated for changes above.
* Modules/applepay/ApplePaySession.idl: Use MayThrowException.
* bindings/js/JSApplePaySessionCustom.cpp:
(WebCore::JSApplePaySession::completeShippingMethodSelection):
Use propagateException.
(WebCore::JSApplePaySession::completeShippingContactSelection): Ditto.
(WebCore::JSApplePaySession::completePaymentMethodSelection): Ditto.
* bindings/js/JSDOMBinding.h: Added implementation of toJSBoolean.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateConstructorDefinition): Generate the different arguments for
toJSNewlyCreated when ConstructorMayThrowException is specified that
activate the version of that function that handles exceptions.
* bindings/scripts/IDLAttributes.txt: Added ConstructorMayThrowException.
2016-10-09 Darin Adler <darin@apple.com>
Replace all uses of ExceptionCodeWithMessage with WebCore::Exception
https://bugs.webkit.org/show_bug.cgi?id=163178
Reviewed by Sam Weinig.
* Modules/indexeddb/IDBCursor.cpp:
(WebCore::IDBCursor::stringToDirection): Return an Optional instead of
using an ExceptionCode out argument, since this function just needs to
indicate failure, not actually throw an exception.
(WebCore::IDBCursor::update): Return ExceptionOr instead of using an
ExceptionCodeWithMessage out argument.
(WebCore::IDBCursor::advance): Ditto.
(WebCore::IDBCursor::continueFunction): Ditto.
(WebCore::IDBCursor::deleteFunction): Ditto.
* Modules/indexeddb/IDBCursor.h: Updated for above changes.
* Modules/indexeddb/IDBCursor.idl: Sorted extended attributes alphabetically.
Use MayThrowException instead of MayThrowLegacyExceptionWithMessage.
* Modules/indexeddb/IDBDatabase.cpp:
(WebCore::IDBDatabase::createObjectStore): Return ExceptionOr instead of
using an ExceptionCodeWithMessage out argument.
(WebCore::IDBDatabase::transaction): Ditto.
(WebCore::IDBDatabase::deleteObjectStore): Ditto.
* Modules/indexeddb/IDBDatabase.h: Updated for above changes.
* Modules/indexeddb/IDBDatabase.idl: Use MayThrowException instead of
MayThrowLegacyExceptionWithMessage.
* Modules/indexeddb/IDBFactory.cpp:
(WebCore::IDBFactory::open): Return ExceptionOr instead of
using an ExceptionCodeWithMessage out argument.
(WebCore::IDBFactory::openInternal): Ditto.
(WebCore::IDBFactory::deleteDatabase): Ditto.
(WebCore::IDBFactory::cmp): Ditto.
* Modules/indexeddb/IDBFactory.h: Updated for above changes.
* Modules/indexeddb/IDBFactory.idl: Use MayThrowException instead of
MayThrowLegacyExceptionWithMessage.
* Modules/indexeddb/IDBIndex.cpp:
(WebCore::IDBIndex::openCursor): Return ExceptionOr instead of
using an ExceptionCodeWithMessage out argument.
(WebCore::IDBIndex::count): Ditto.
(WebCore::IDBIndex::doCount): Ditto.
(WebCore::IDBIndex::openKeyCursor): Ditto.
(WebCore::IDBIndex::get): Ditto.
(WebCore::IDBIndex::doGet): Ditto.
(WebCore::IDBIndex::getKey): Ditto.
(WebCore::IDBIndex::doGetKey): Ditto.
* Modules/indexeddb/IDBIndex.h: Updated for above changes.
* Modules/indexeddb/IDBIndex.idl: Use MayThrowException instead of
MayThrowLegacyExceptionWithMessage.
* Modules/indexeddb/IDBKeyRange.cpp:
(WebCore::IDBKeyRange::only): Return ExceptionOr instead of
using an ExceptionCode out argument.
(WebCore::IDBKeyRange::lowerBound): Ditto.
(WebCore::IDBKeyRange::upperBound): Ditto.
(WebCore::IDBKeyRange::bound): Ditto.
* Modules/indexeddb/IDBKeyRange.h: Updated for above changes.
* Modules/indexeddb/IDBKeyRange.idl: Use MayThrowException instead of
MayThrowLegacyException.
* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::openCursor): Return ExceptionOr instead of
using an ExceptionCodeWithMessage out argument.
(WebCore::IDBObjectStore::get): Ditto.
(WebCore::IDBObjectStore::add): Ditto.
(WebCore::IDBObjectStore::put): Ditto.
(WebCore::IDBObjectStore::putForCursorUpdate): Ditto.
(WebCore::IDBObjectStore::putOrAdd): Ditto.
(WebCore::IDBObjectStore::deleteFunction): Ditto.
(WebCore::IDBObjectStore::doDelete): Ditto.
(WebCore::IDBObjectStore::clear): Ditto.
(WebCore::IDBObjectStore::createIndex): Ditto.
(WebCore::IDBObjectStore::index): Ditto.
(WebCore::IDBObjectStore::deleteIndex): Ditto.
(WebCore::IDBObjectStore::count): Ditto.
(WebCore::IDBObjectStore::doCount): Ditto.
* Modules/indexeddb/IDBObjectStore.h: Updated for above changes.
* Modules/indexeddb/IDBObjectStore.idl: Use MayThrowException instead of
MayThrowLegacyExceptionWithMessage.
* Modules/indexeddb/IDBRequest.cpp:
(WebCore::IDBRequest::errorCode): Deleted. Was dead code.
(WebCore::IDBRequest::error): Return ExceptionOr instead of
using an ExceptionCodeWithMessage out argument.
* Modules/indexeddb/IDBRequest.h: Updated for above changes.
* Modules/indexeddb/IDBRequest.idl: Use GetterMayThrowException instead of
GetterMayThrowLegacyExceptionWithMessage.
* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::stringToMode): Return an Optional instead of
using an ExceptionCode out argument, since this function just needs to
indicate failure, not actually throw an exception.
(WebCore::IDBTransaction::db): Tweaked code a bit.
(WebCore::IDBTransaction::error): Return a pointer instead of a RefPtr.
(WebCore::IDBTransaction::objectStore): Return ExceptionOr instead of
using an ExceptionCodeWithMessage out argument.
(WebCore::IDBTransaction::abortDueToFailedRequest): Call internalAbort.
(WebCore::IDBTransaction::abort): Return ExceptionOr instead of
using an ExceptionCodeWithMessage out argument.
(WebCore::IDBTransaction::internalAbort): Added a version that asserts
instead of throwing an exception for internal use.
(WebCore::IDBTransaction::stop): Call internalAbort.
* Modules/indexeddb/IDBTransaction.h: Updated for above changes.
* Modules/indexeddb/IDBTransaction.idl: Use MayThrowException instead of
MayThrowLegacyExceptionWithMessage.
* Modules/indexeddb/client/IDBConnectionProxy.cpp:
(WebCore::IDBClient::IDBConnectionProxy::openDatabase): Updated to return
a Ref instead of a RefPtr, since the function can never return null.
(WebCore::IDBClient::IDBConnectionProxy::deleteDatabase): Ditto.
* Modules/indexeddb/client/IDBConnectionProxy.h: Updated for above changes.
* Modules/mediastream/MediaEndpointPeerConnection.cpp:
(WebCore::MediaEndpointPeerConnection::setLocalDescriptionTask): Updated
exception handling to use ExceptionOr instead of ExceptionCodeWithMessage.
(WebCore::MediaEndpointPeerConnection::setRemoteDescriptionTask): Ditto.
* Modules/mediastream/MediaEndpointSessionDescription.cpp:
(WebCore::MediaEndpointSessionDescription::create): Ditto.
* Modules/mediastream/MediaEndpointSessionDescription.h: Updated for above change.
* bindings/js/JSDOMBinding.cpp:
(WebCore::createDOMException): Added overload for Exception.
(WebCore::throwDOMException): Deleted overload for ExceptionCodeWithMessage.
Updated code to call the new createDOMException function.
(WebCore::setDOMExceptionSlow): Ditto.
(WebCore::setDOMException): Ditto.
* bindings/js/JSDOMBinding.h: Added overload of createDOMException that takes
an Exception. Deleted functions dealing with ExceptionCodeWithMessage. Fixed
interface of toJSNumber and toJSNullableNumber and implemented toJSNumber.
* bindings/js/JSDOMPromise.cpp:
(WebCore::DeferredPromise::reject): Added overload that takes an Exception.
* bindings/js/JSDOMPromise.h: Updated for above change.
* bindings/js/JSHistoryCustom.cpp:
(WebCore::JSHistory::pushState): Use propagateException to deal with
ExceptionOr instead of ExceptionCodeWithMessage.
(WebCore::JSHistory::replaceState): Ditto.
* bindings/js/JSIDBDatabaseCustom.cpp:
(WebCore::JSIDBDatabase::createObjectStore): Use toJS and
to deal with ExceptionOr rather than setDOMException to deal
with ExceptionCodeWithMessage.
* bindings/js/JSIDBRequestCustom.cpp:
(WebCore::JSIDBRequest::result): Use propagateException and
Exception rather than setDOMException and ExceptionCodeWithMessage.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation): Removed support for GetterMayThrowLegacyExceptionWithMessage,
SetterMayThrowLegacyExceptionWithMessage, and MayThrowLegacyExceptionWithMessage.
(GenerateReturnParameters): Ditto.
(GenerateImplementationFunctionCall): Ditto.
(GenerateConstructorDefinition): Ditto.
* bindings/scripts/IDLAttributes.txt: Removed GetterMayThrowLegacyExceptionWithMessage,
SetterMayThrowLegacyExceptionWithMessage, and MayThrowLegacyExceptionWithMessage.
* bindings/scripts/test/JS/JSTestObj.cpp: Regenerated.
* bindings/scripts/test/TestObj.idl: Removed tests cases for now-removed attributes.
* dom/CustomElementRegistry.idl: Use MayThrowException instead of
MayThrowLegacyExceptionWithMessage.
* dom/ExceptionCode.h: Removed ExceptionCodeWithMessage. Also updated to use pragma
once, removed include of WTFString.h and switched to using instead of typedef.
* history/HistoryItem.h: Return a pointer instead of a RefPtr from stateObject
to cut down a little on unnecessary reference count churn.
* inspector/InspectorIndexedDBAgent.cpp: Updated all the code that uses IDB
classes to use the new versions rather than the old ExceptionCodeWithMessage versions.
* page/DOMWindow.cpp:
(WebCore::DOMWindow::history): Pass a reference instead of a pointer.
* page/History.cpp:
(WebCore::History::History): Take a reference instead of a pointer.
(WebCore::History::length): Tweaked to use a local variable.
(WebCore::History::state): Return a pointer instead of a PassRefPtr.
(WebCore::History::stateInternal): Ditto. Also use early return consistently.
(WebCore::History::isSameAsCurrentState): Updated for above change.
(WebCore::History::stateObjectAdded): Return ExceptionOr rather than taking an
ExceptionCodeWithMessage out argument.
* page/History.h: Use pragma once. Removed some unneeded includes. Marked class final.
Updated for changes above.
* page/History.idl: Use MayThrowException instead of MayThrowLegacyException.
2016-10-07 Ryosuke Niwa <rniwa@webkit.org>
REGRESSION(r165103): labels list doesn't get invalidated when other lists are invalidated at document level
https://bugs.webkit.org/show_bug.cgi?id=163145
Reviewed by Darin Adler.
The bug was caused by Document::invalidateNodeListAndCollectionCaches removing all node lists regardless
of whether they have been invalidated or not.
Fixed the bug by removing only those node lists that got invalidated via LiveNodeList::invalidateCache.
Test: fast/dom/NodeList/form-labels-length.html
* dom/Document.cpp:
(WebCore::Document::Document):
(WebCore::Document::unregisterNodeListForInvalidation): Removed the conditional which allowed removal to
happen while m_listsInvalidatedAtDocument is empty inside invalidateNodeListAndCollectionCaches.
* dom/Document.h:
* dom/Node.cpp:
(WebCore::Document::invalidateNodeListAndCollectionCaches): Just remove the node lists being invalidated via
LiveNodeList's invalidateCache, which calls unregisterNodeListForInvalidation, instead of removing them all.
We make a copy of the list of node lists into a local vector because mutating HashMap while iterating over it
is not a safe operation.
2016-10-09 Chris Dumez <cdumez@apple.com>
Update generated bindings code so that dictionary structures no longer need explicit constructors
https://bugs.webkit.org/show_bug.cgi?id=163188
Reviewed by Darin Adler.
Update generated bindings code so that dictionary structures no longer
need explicit constructors. We now call the default constructor and
then initialize the members one by one.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateDictionaryImplementationContent):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::convertDictionary<TestObj::Dictionary>):
(WebCore::convertDictionary<TestObj::DictionaryThatShouldNotTolerateNull>):
(WebCore::convertDictionary<TestObj::DictionaryThatShouldTolerateNull>):
(WebCore::convertDictionary<AlternateDictionaryName>):
(WebCore::convertDictionary<TestObj::ParentDictionary>):
(WebCore::convertDictionary<TestObj::ChildDictionary>):
* bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
(WebCore::convertDictionary<TestStandaloneDictionary>):
* dom/ClipboardEvent.h:
* dom/CustomEvent.h:
* dom/EventInit.h:
(WebCore::EventInit::EventInit): Deleted.
* dom/EventModifierInit.h:
(WebCore::EventModifierInit::EventModifierInit): Deleted.
* dom/KeyboardEvent.cpp:
(WebCore::KeyboardEvent::KeyboardEvent):
* dom/KeyboardEvent.h:
* dom/KeyboardEvent.idl:
* dom/UIEventInit.h:
(WebCore::UIEventInit::UIEventInit): Deleted.
* editing/Editor.cpp:
(WebCore::Editor::dispatchCPPEvent):
2016-10-09 Fujii Hironori <Hironori.Fujii@sony.com>
[CMake] CMake does not support the dep files for implicit dependency
https://bugs.webkit.org/show_bug.cgi?id=161433
Reviewed by Brent Fulgham.
Created a Perl script to generate all IDL bindings for CMake.
This script can regenerate outdated bindings by based on the
supplemental dependency and dep files created by
'--write-dependencies' switch of generate-bindings.pl.
add_custom_target is used to invoke the script instead of
add_custom_command because Ninja deletes all output files before
executing the command in case of add_custom_command.
USES_TERMINAL option of add_custom_target has two effects:
1) Not buffering output of the command
2) Invoking the command in the special Ninja pool which inhibits parallel build
One needs to use CMake 3.2 or later to enable this feature.
* CMakeLists.txt: Specified target names for
GENERATE_BINDINGS. Added dependency for the targets.
* bindings/scripts/generate-bindings-all.pl: Added.
2016-10-09 Chris Dumez <cdumez@apple.com>
Update KeyboardEvent to stop using legacy [ConstructorTemplate=Event]
https://bugs.webkit.org/show_bug.cgi?id=163176
Reviewed by Darin Adler.
Update KeyboardEvent to stop using legacy [ConstructorTemplate=Event]
and use a proper constructor instead, like in the specification:
- https://www.w3.org/TR/uievents/#interface-keyboardevent
Also add support for passing modifierAltGraph / modifierCapsLock
in the inialization dictionary as we support those modifiers via
getModifierState().
No new tests, extended existing test.
* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* dom/EventModifierInit.h: Added.
(WebCore::EventModifierInit::EventModifierInit):
* dom/EventModifierInit.idl: Added.
* dom/KeyboardEvent.cpp:
(WebCore::KeyboardEvent::KeyboardEvent):
(WebCore::KeyboardEvent::getModifierState):
* dom/KeyboardEvent.h:
* dom/KeyboardEvent.idl:
* dom/MouseRelatedEvent.cpp:
(WebCore::MouseRelatedEvent::MouseRelatedEvent):
* dom/MouseRelatedEvent.h:
* dom/UIEvent.cpp:
(WebCore::UIEvent::UIEvent):
* dom/UIEvent.h:
(WebCore::UIEvent::create): Deleted.
* dom/UIEventInit.h: Added.
(WebCore::UIEventInit::UIEventInit):
* dom/UIEventInit.idl: Added.
* dom/UIEventWithKeyState.h:
(WebCore::UIEventWithKeyState::altGraphKey):
(WebCore::UIEventWithKeyState::capsLockKey):
(WebCore::UIEventWithKeyState::UIEventWithKeyState):
(WebCore::UIEventWithKeyState::ctrlKey): Deleted.
(WebCore::UIEventWithKeyState::shiftKey): Deleted.
(WebCore::UIEventWithKeyState::altKey): Deleted.
(WebCore::UIEventWithKeyState::metaKey): Deleted.
2016-10-09 Youenn Fablet <youenn@apple.com>
Promise attribute getters should reject promises in case of casted-this errors
https://bugs.webkit.org/show_bug.cgi?id=163167
Reviewed by Darin Adler.
Covered by updated test and binding test.
* bindings/js/JSDOMBinding.cpp:
(WebCore::throwGetterTypeError):
(WebCore::rejectPromiseWithGetterTypeError): Added to reject promises for attribute getters
* bindings/js/JSDOMBinding.h:
(WebCore::BindingCaller::attribute): Introducing promise rejection for type cast errors.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
* bindings/scripts/test/JS/JSTestObj.cpp: Rebased test. As can be seen, only custom promise attributes are supported.
(WebCore::jsTestObjTestReadOnlyPromiseAttribute):
(WebCore::jsTestObjTestReadOnlyPromiseAttributeGetter):
* bindings/scripts/test/TestObj.idl:
2016-10-08 Chris Dumez <cdumez@apple.com>
[Mac] Write WebArchive to the pasteboard when copying image in WebKit
https://bugs.webkit.org/show_bug.cgi?id=163100
Reviewed by Darin Adler.
Write WebArchive to the pasteboard when copying image in WebKit. This
fixes pasting such images to a content editable field in WebKit because
Web archives take priority over RTFD when reading from the pasteboard
in WebKit.
Using RTFD when pasting the image in WebKit was causing issues because:
1. The pasted image would not be displayed because our RTFD import code
is buggy.
2. The pasted image URL was a webkit-fake-url://
3. Formatting associated to the image (e.g. inline style) would be lost
No new tests, unskipped existing test on WebKit2.
* editing/Editor.h:
* editing/mac/EditorMac.mm:
(WebCore::Editor::imageInWebArchiveFormat):
(WebCore::Editor::writeImageToPasteboard):
* platform/Pasteboard.h:
* platform/mac/PasteboardMac.mm:
(WebCore::writableTypesForImage):
(WebCore::Pasteboard::write):
(WebCore::Pasteboard::Pasteboard): Deleted.
(WebCore::Pasteboard::createForCopyAndPaste): Deleted.
2016-10-08 Chris Dumez <cdumez@apple.com>
Update CustomEvent to stop using legacy [ConstructorTemplate=Event]
https://bugs.webkit.org/show_bug.cgi?id=163174
Reviewed by Darin Adler.
Update CustomEvent to stop using legacy [ConstructorTemplate=Event] and
use an actual constructor instead, like in the specification:
- https://dom.spec.whatwg.org/#interface-customevent
There is a very minor behavior change when explictly passing undefined
as detail value in CustomEventInit. We used to initialize detail to
undefined but we now initialize it to null instead, which is its default
value. The new behavior matches the one of Chrome and Firefox.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateDefaultValue):
(GenerateDictionaryImplementationContent):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::convertDictionary<TestObj::Dictionary>):
* bindings/scripts/test/TestObj.idl:
* dom/CustomEvent.cpp:
(WebCore::CustomEvent::CustomEvent):
* dom/CustomEvent.h:
* dom/CustomEvent.idl:
* dom/Document.cpp:
(WebCore::Document::createEvent):
* dom/Event.cpp:
(WebCore::Event::Event):
* dom/Event.h:
2016-10-08 Chris Dumez <cdumez@apple.com>
Add support for ClipboardEvent
https://bugs.webkit.org/show_bug.cgi?id=163164
Reviewed by Darin Adler.
Add support for ClipboardEvent:
- https://www.w3.org/TR/clipboard-apis/#clipboard-event-interfaces
Firefox and Chrome both already support this.
This gives us 5 more points on html5test.com.
Tests: editing/pasteboard/clipboard-event.html
fast/events/clipboard-event-constructor.html
* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSEventCustom.cpp:
(WebCore::toJSNewlyCreated): Deleted.
* bindings/scripts/CodeGeneratorJS.pm:
(WillConvertUndefinedToDefaultParameterValue):
We use [] as implicit default value for dictionary parameters. This change
is so we call convertDictionary<>() even if the parameter is undefined
because we want to pass a struct to the implementation initialized with
the default member values defined in the IDL.
* dom/ClipboardEvent.cpp:
(WebCore::ClipboardEvent::ClipboardEvent):
(WebCore::ClipboardEvent::eventInterface):
* dom/ClipboardEvent.h:
* dom/ClipboardEvent.idl: Added.
* dom/Event.cpp:
(WebCore::Event::Event):
* dom/Event.h:
* dom/Event.idl:
* dom/EventInit.h: Added.
* dom/EventInit.idl: Added.
* dom/EventNames.in:
* dom/MouseEvent.h:
(WebCore::MouseEvent::dataTransfer):
* editing/Editor.cpp:
(WebCore::Editor::dispatchCPPEvent):
2016-10-06 Darin Adler <darin@apple.com>
Next step on moving to modern way to return DOM exceptions
https://bugs.webkit.org/show_bug.cgi?id=163016
Reviewed by Ryosuke Niwa.
* Modules/fetch/FetchRequest.idl:
Added MayThrowException to initializeWith since it throws an exception.
* bindings/js/JSCallbackData.cpp:
(WebCore::JSCallbackData::invokeCallback):
* bindings/js/JSCustomElementInterface.cpp:
(WebCore::JSCustomElementInterface::invokeCallback):
* bindings/js/JSCustomSQLStatementErrorCallback.cpp:
(WebCore::JSSQLStatementErrorCallback::handleEvent):
* bindings/js/JSCustomXPathNSResolver.cpp:
(WebCore::JSCustomXPathNSResolver::lookupNamespaceURI):
* bindings/js/JSDOMBinding.cpp:
(WebCore::reportException):
(WebCore::reportCurrentException):
* bindings/js/JSErrorHandler.cpp:
(WebCore::JSErrorHandler::handleEvent):
* bindings/js/JSEventListener.cpp:
(WebCore::JSEventListener::handleEvent):
* bindings/js/JSMutationCallback.cpp:
(WebCore::JSMutationCallback::call):
* bindings/js/JSNodeFilterCustom.cpp:
(WebCore::JSNodeFilter::acceptNode):
* bindings/js/ScheduledAction.cpp:
(WebCore::ScheduledAction::executeFunctionInContext):
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::evaluateInWorld):
* bindings/js/WorkerScriptController.cpp:
(WebCore::WorkerScriptController::evaluate):
* inspector/PageScriptDebugServer.cpp:
(WebCore::PageScriptDebugServer::reportException):
Use JSC::Exception explicitly to avoid ambiguity with WebCore::Exception,
or in some cases use auto instead.
* bindings/js/JSDOMBinding.cpp:
(WebCore::hasUnpairedSurrogate): Factored this inline function out of valueToUSVString
for clarity.
(WebCore::createDOMException): Removed unused TRY_TO_CREATE_EXCEPTION macro.
(WebCore::propagateExceptionSlowPath): Added.
(WebCore::propagateException): Added.
(WebCore::setDOMException): Removed overload that takes an exception code and message
string separately; no longer needed.
* bindings/js/JSDOMBinding.h: Include the ExceptionOr header
rather than forward declaring. Added more of the ExceptionOr handling
functions; some just declared and not yet defined. Updated for changes
to ExceptionOr interface. Removed the createDOMException function that takes
only an exception code; not needed outside JSDOMBinding.cpp.
* bindings/js/JSXMLHttpRequestCustom.cpp:
(WebCore::JSXMLHttpRequest::send): Rewrote this to use ExceptionOr instead
of ExceptionCode. Added some FIXMEs as well.
(WebCore::JSXMLHttpRequest::responseText): Ditto.
(WebCore::JSXMLHttpRequest::retrieveResponse): Ditto.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation): Fixed if statements to follow WebKit coding style
rather than using extra braces. Added call to propagateException for SetterMayThrowException.
(GenerateSerializerFunction): Fixed if statements as above.
(GenerateParametersCheck): Ditto. Also added call to propagateException for functions with
void return type and MayThrowException.
(GenerateReturnParameters): Tweaked coding style a bit.
(addIterableProperties): Fixed if statements as above.
(NativeToJSValue): Added code to handle various cases of GetterMayThrowException
and MayThrowException.
(GenerateConstructorDefinition): Used encodedJSValue() instead of
JSValue::encode(JSValue()), a longer way to say the same thing.
* bindings/scripts/IDLAttributes.txt: Added GetterMayThrowException,
MayThrowException, and SetterMayThrowException.
* bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
* bindings/scripts/test/JS/JSTestException.cpp:
* bindings/scripts/test/JS/JSTestGlobalObject.cpp:
* bindings/scripts/test/JS/JSTestInterface.cpp:
* bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
* bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
* bindings/scripts/test/JS/JSTestNode.cpp:
* bindings/scripts/test/JS/JSTestNondeterministic.cpp:
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
* bindings/scripts/test/JS/JSattribute.cpp:
Regenerated results.
* bindings/scripts/test/TestObj.idl: Added some test cases.
* dom/DOMImplementation.cpp:
(WebCore::DOMImplementation::createDocumentType): Tweaked formatting.
(WebCore::DOMImplementation::createDocument): Ditto.
* dom/DOMImplementation.idl: Added MayThrowException to two functions since
I am abandoning, for now, the ability to throw exceptions without any extended
attribute in the IDL file. This feature may return at some point if we figure
out a way to do it for functions without return values as well as functions with.
* dom/Document.cpp:
(WebCore::Document::exitPointerLock): Rewrote to streamline logic.
(WebCore::Document::pointerLockElement): Ditto.
(WebCore::Document::inputCursor): Added. No need for this to be inlined.
(WebCore::Document::setInputCursor): Changed to take Ref&&.
(WebCore::Document::getSelection): Added. Moved here from TreeScope.
* dom/Document.h: Updated for above changes.
* dom/Document.idl: Tweaked formatting.
* dom/Exception.h: Merged the two constructors into one with a default
argument value, which should be equally efficient. Added releaseMessage function.
Added assertion that this is only created for actual exceptions with non-zero
ExceptionCode. Unlike ExceptionCode, which has a value of 0 which means no
exception, we do not create an Exception if there is no exception.
* dom/ExceptionOr.h: Renamed takeReturnValue to releaseReturnValue. Replaced
exceptionCode and exceptionMessage with releaseException. Added ExceptionOr<void>
specialization.
* dom/TreeScope.cpp:
(WebCore::TreeScope::~TreeScope): Removed code dealing with
m_selection, which is now in Document.
(WebCore::TreeScope::getSelection): Deleted.
* dom/TreeScope.h: Removed DOMSelection.
* page/DOMSelection.cpp:
(WebCore::selectionShadowAncestor): Changed to take a reference rather than
a guaranteed-non-null pointer.
(WebCore::DOMSelection::DOMSelection): Changed to take a Frame& instead of
of a TreeScope*.
(WebCore::DOMSelection::clearTreeScope): Deleted.
(WebCore::DOMSelection::isCollapsed): Updated call to selectionShadowAncestor.
(WebCore::DOMSelection::type): Took out obsolete uneeeded comment. Got rid
of case where this returns a null string. Use ASCIILiteral.
(WebCore::DOMSelection::rangeCount): Streamlined code.
(WebCore::DOMSelection::collapse): Removed redundant check of m_frame for
null which is already handled by the isValidForPosition function.
Removed non-helpful FIXME.
(WebCore::DOMSelection::collapseToEnd): Changed to use ExceptionOr instead of
ExceptionCode.
(WebCore::DOMSelection::collapseToStart): Ditto.
(WebCore::DOMSelection::setBaseAndExtent): Removed redundant check of m_frame
for null which is already handled by the isValidForPosition function. Removed
non-helpful FIXME.
(WebCore::DOMSelection::setPosition): Ditto.
(WebCore::DOMSelection::extend): Changed to use ExceptionOr instead of
ExceptionCode.
(WebCore::DOMSelection::getRangeAt): Ditto.
(WebCore::DOMSelection::isValidForPosition): Changed to return false when
m_frame is null rather than asserting is is non-null and having every caller
check m_frame before calling this.
* page/DOMSelection.h: Use #pragma once. Fix indentation. Removed unneeded
comments. Use ExceptionOr rather than ExceptionCode.
* page/DOMSelection.idl: Move from MayThrowLegacyException to MayThrowException.
* page/DOMWindow.cpp:
(WebCore::DOMWindow::resetDOMWindowProperties): Sorted properties alphabetically
to make it more obvious if any are accidentally omitted or listed twice.
(WebCore::DOMWindow::getSelection): Changed ownership so that the window owns
the selection like all the other objects, rather than having it be owned by the
document instead.
* page/DOMWindow.h: Added m_selection, sorted all the other related properties
alphabetically so it's easy to compare the list here with elsewhere.
* replay/ReplayController.cpp:
(WebCore::ReplayController::frameNavigated): Updated to call setInputCursor
with a reference rather than a pointer.
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::responseText): Use ExceptionOr rather than ExceptionCode.
(WebCore::XMLHttpRequest::responseXML): Ditto.
(WebCore::XMLHttpRequest::setTimeout): Ditto.
(WebCore::XMLHttpRequest::setResponseType): Ditto.
(WebCore::XMLHttpRequest::setWithCredentials): Ditto.
(WebCore::XMLHttpRequest::open): Ditto.
(WebCore::XMLHttpRequest::prepareToSend): Changed to return an
Optional<ExceptionOr> to reflect the three different states: an exception,
a value to return without sending, or "continue with the send algorithm".
The old code did this with a boolean plus an exception code. This sounds
confusing but is easy to read at the call sites, so probably OK to keep.
(WebCore::XMLHttpRequest::send): Use ExceptionOr rather than ExceptionCode.
(WebCore::XMLHttpRequest::sendBytesData): Ditto.
(WebCore::XMLHttpRequest::createRequest): Ditto.
(WebCore::XMLHttpRequest::overrideMimeType): Ditto.
(WebCore::XMLHttpRequest::setRequestHeader): Ditto.
* xml/XMLHttpRequest.h: Updated for changes above.
* xml/XMLHttpRequest.idl: Sorted interface extended attributes alphabetically.
Changed from MayThrowLegacyException to MayThrowException.
2016-10-06 Sam Weinig <sam@webkit.org>
Autogenerate passing union types as part of a functions variadic arguments
https://bugs.webkit.org/show_bug.cgi?id=162919
Reviewed by Darin Adler.
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSBindingsAllInOne.cpp:
Remove deleted files.
* bindings/generic/IDLTypes.h:
Switch to use std::reference_wrapper as it's implementation type. We may need more
granularity here in the future, but this will work for now.
* bindings/js/JSCharacterDataCustom.cpp: Removed.
* bindings/js/JSDocumentTypeCustom.cpp: Removed.
* bindings/js/JSNodeOrString.cpp: Removed.
* bindings/js/JSNodeOrString.h: Removed.
* bindings/js/JSDOMBinding.h:
(WebCore::VariadicHelperBase::convert): Deleted.
(WebCore::toArguments): Deleted.
Moved to JSDOMConvert.h and renamed to convertVariadicArguments and make
it work in terms of IDLTypes.
* bindings/js/JSDOMConvert.h:
(WebCore::Converter<IDLInterface<T>>::convert):
(WebCore::VariadicConverterBase::convert):
(WebCore::VariadicConverterBase<IDLInterface<T>>::convert):
(WebCore::convertVariadicArguments):
* bindings/js/JSDocumentCustom.cpp:
(WebCore::JSDocument::prepend): Deleted.
(WebCore::JSDocument::append): Deleted.
* bindings/js/JSDocumentFragmentCustom.cpp:
(WebCore::JSDocumentFragment::prepend): Deleted.
(WebCore::JSDocumentFragment::append): Deleted.
* bindings/js/JSElementCustom.cpp:
(WebCore::JSElement::before): Deleted.
(WebCore::JSElement::after): Deleted.
(WebCore::JSElement::replaceWith): Deleted.
(WebCore::JSElement::prepend): Deleted.
(WebCore::JSElement::append): Deleted.
Remove now generated functions.
* bindings/scripts/CodeGenerator.pm:
(assert):
Add assert to help debugging.
(ParseInterface):
Don't treat union types as interfaces.
(GetFlattenedMemberTypes):
(GetNumberOfNullableMemberTypes):
(GetIDLUnionMemberTypes):
Implement WebIDL algorithms for getting the flattened member list of union, and use it
to construct the c++ IDLType.
(GetBaseIDLType):
(GetIDLType):
Add helper to convert an parsed idlType to a c++ IDLType.
(IsWrapperType):
Don't treat union types as wrappers.
* bindings/scripts/CodeGeneratorJS.pm:
(AddToImplIncludesForIDLType):
Add helper for adding #includes based on a parsed idlType. It recursively handles union types.
(GenerateParametersCheck):
Use the new convertVariadicArguments function to handle all variadic arguments, including
union types.
* bindings/scripts/IDLParser.pm:
(parseDictionaryMember):
(parseAttributeRest):
(parseOptionalOrRequiredArgument):
(parseExceptionField):
Add an idlType to domSignature and populate it.
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod13):
(WebCore::jsTestObjPrototypeFunctionVariadicStringMethod):
(WebCore::jsTestObjPrototypeFunctionVariadicDoubleMethod):
(WebCore::jsTestObjPrototypeFunctionVariadicNodeMethod):
(WebCore::jsTestObjPrototypeFunctionVariadicUnionMethod):
* bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
(WebCore::constructJSTestOverloadedConstructors5):
* bindings/scripts/test/TestObj.idl:
Add and update tests.
* dom/ChildNode.idl:
* dom/ParentNode.idl:
Remove Custom extended attribute.
* dom/ContainerNode.cpp:
* dom/ContainerNode.h:
* dom/Node.cpp:
* dom/Node.h:
Switch to using std::reference_wrapper instead of Ref<> for passed in parameters.
2016-10-08 Youenn Fablet <youenn@apple.com>
[Fetch API] Request constructor should provide exception messages
https://bugs.webkit.org/show_bug.cgi?id=162382
Reviewed by Darin Adler.
No change of behavior, except that exceptions now have error messages.
Added support of exception messages to ExceptionOr.
Making use of ExceptionOr for Request constructor parameter checking.
* Modules/fetch/FetchRequest.cpp:
(WebCore::setReferrerPolicy):
(WebCore::setMode):
(WebCore::setCredentials):
(WebCore::setCache):
(WebCore::setRedirect):
(WebCore::setMethod):
(WebCore::setReferrer):
(WebCore::buildOptions):
(WebCore::FetchRequest::initializeOptions):
(WebCore::FetchRequest::initializeWith):
* Modules/fetch/FetchRequest.h:
* Modules/fetch/FetchRequest.idl:
* bindings/js/JSDOMBinding.cpp:
(WebCore::setDOMException):
* bindings/js/JSDOMBinding.h:
(WebCore::toJS):
(WebCore::toJSNewlyCreated):
* dom/Exception.h:
(WebCore::Exception::code):
(WebCore::Exception::message):
(WebCore::Exception::Exception):
* dom/ExceptionOr.h:
(WebCore::ExceptionOr<ReturnType>::exceptionMessage):
2016-10-08 Youenn Fablet <youenn@apple.com>
Refactor binding generated casted-this checks
https://bugs.webkit.org/show_bug.cgi?id=162677
Reviewed by Darin Adler.
No change of behavior.
Split the attribute getter function in two, one with the signature expected by JSCore and one used after casted-this checks.
The second function takes directly a JSXX object and returns a JSValue instead of an EncodedJSValue.
In the future, the second function should only take references.
Introducing BindingCaller as a way to templatize binding code used to cast thisValue with the desired JSXX value.
This allows implementing the first function using the second function as template parameter.
Introducing JSClass::castForAttribute as a way to encapsulate differences in the way to handle thisValue access.
* bindings/js/JSDOMBinding.h:
(WebCore::BindingCaller::attribute):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
(GenerateImplementation):
* bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
* bindings/scripts/test/JS/JSTestActiveDOMObject.h:
* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
* bindings/scripts/test/JS/JSTestEventConstructor.h:
* bindings/scripts/test/JS/JSTestException.cpp:
* bindings/scripts/test/JS/JSTestException.h:
* bindings/scripts/test/JS/JSTestGlobalObject.cpp:
* bindings/scripts/test/JS/JSTestInterface.cpp:
* bindings/scripts/test/JS/JSTestInterface.h:
* bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
* bindings/scripts/test/JS/JSTestJSBuiltinConstructor.h:
* bindings/scripts/test/JS/JSTestNode.cpp:
* bindings/scripts/test/JS/JSTestNode.h:
* bindings/scripts/test/JS/JSTestNondeterministic.cpp:
* bindings/scripts/test/JS/JSTestNondeterministic.h:
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestObj.h:
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
* bindings/scripts/test/JS/JSTestTypedefs.h:
* bindings/scripts/test/JS/JSattribute.cpp:
* bindings/scripts/test/JS/JSattribute.h:
2016-10-08 Enrique Ocaña González <eocanha@igalia.com>
Missing include in MediaDescription
https://bugs.webkit.org/show_bug.cgi?id=162873
Reviewed by Xabier Rodriguez-Calvar.
Added missing header.
* platform/MediaDescription.h:
2016-10-08 Antti Koivisto <antti@apple.com>
Move StyleResolver ownership from Document/ShadowRoot to Style::Scope
https://bugs.webkit.org/show_bug.cgi?id=163148
Reviewed by Andreas Kling.
Reduce duplication between Document and ShadowRoot.
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::propertyValue):
* css/CSSStyleSheet.cpp:
(WebCore::CSSStyleSheet::didMutateRules):
* css/ElementRuleCollector.cpp:
(WebCore::ElementRuleCollector::matchHostPseudoClassRules):
(WebCore::ElementRuleCollector::matchSlottedPseudoElementRules):
* css/MediaQueryMatcher.cpp:
(WebCore::MediaQueryMatcher::documentElementUserAgentStyle):
* css/StyleMedia.cpp:
(WebCore::StyleMedia::matchMedium):
* css/parser/SizesAttributeParser.cpp:
(WebCore::SizesAttributeParser::mediaConditionMatches):
* dom/Document.cpp:
(WebCore::Document::~Document):
(WebCore::Document::childrenChanged):
(WebCore::Document::isPageBoxVisible):
(WebCore::Document::pageSizeAndMarginsInPixels):
(WebCore::Document::userAgentShadowTreeStyleResolver):
(WebCore::Document::fontsNeedUpdate):
(WebCore::Document::didClearStyleResolver):
(WebCore::Document::updateViewportUnitsOnResize):
(WebCore::Document::createStyleResolver): Deleted.
(WebCore::Document::clearStyleResolver): Deleted.
* dom/Document.h:
(WebCore::Document::styleResolverIfExists): Deleted.
(WebCore::Document::ensureStyleResolver): Deleted.
* dom/Element.cpp:
(WebCore::Element::styleResolver):
* dom/ShadowRoot.cpp:
(WebCore::ShadowRoot::styleResolver): Deleted.
(WebCore::ShadowRoot::styleResolverIfExists): Deleted.
(WebCore::ShadowRoot::resetStyleResolver): Deleted.
* dom/ShadowRoot.h:
* page/DOMWindow.cpp:
(WebCore::DOMWindow::getMatchedCSSRules):
* page/FrameView.cpp:
(WebCore::FrameView::layout):
* page/Page.cpp:
(WebCore::Page::updateStyleForAllPagesAfterGlobalChangeInEnvironment):
* page/PrintContext.cpp:
(WebCore::PrintContext::pageProperty):
* platform/MemoryPressureHandler.cpp:
(WebCore::MemoryPressureHandler::releaseCriticalMemory):
* style/AttributeChangeInvalidation.cpp:
(WebCore::Style::mayBeAffectedByHostStyle):
* style/ClassChangeInvalidation.cpp:
(WebCore::Style::mayBeAffectedByHostStyle):
* style/IdChangeInvalidation.cpp:
(WebCore::Style::mayBeAffectedByHostStyle):
* style/StyleScope.cpp:
(WebCore::Style::Scope::resolver):
(WebCore::Style::Scope::resolverIfExists):
(WebCore::Style::Scope::clearResolver):
(WebCore::Style::Scope::analyzeStyleSheetChange):
(WebCore::Style::Scope::updateActiveStyleSheets):
(WebCore::Style::Scope::updateStyleResolver):
(WebCore::Style::Scope::styleResolver): Deleted.
(WebCore::Style::Scope::styleResolverIfExists): Deleted.
* style/StyleScope.h:
* style/StyleSharingResolver.cpp:
(WebCore::Style::SharingResolver::resolve):
(WebCore::Style::SharingResolver::canShareStyleWithElement):
* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::Scope::Scope):
(WebCore::Style::TreeResolver::resolve):
2016-10-07 Chris Dumez <cdumez@apple.com>
window.navigator.language incorrectly returns all lowercase string
https://bugs.webkit.org/show_bug.cgi?id=163096
Reviewed by Darin Adler.
Update navigator.language so that it no longer returns an all lowercase
string (e.g. 'en-us' -> 'en-US'). This matches the behavior of other
browsers and the specification which indicate we should return a
BCP 47 language tag:
- https://html.spec.whatwg.org/#dom-navigator-language
- https://tools.ietf.org/html/bcp47
The other call sites relying on userPreferredLanguages() use case
insensitive comparison so they will not break.
No new tests, updated existing test.
* platform/Language.h:
2016-10-07 Wenson Hsieh <wenson_hsieh@apple.com>
Support onbeforeinput event handling for the new InputEvent spec
https://bugs.webkit.org/show_bug.cgi?id=163021
<rdar://problem/28658073>
Reviewed by Darin Adler.
Adds support for parsing the onbeforeinput attribute, and for sending default-preventable
`beforeinput` InputEvents to the page. To do this, we introduce two new virtual methods:
willApplyCommand and didApplyCommand on the CompositeEditCommand that are called before and
after CompositeEditCommand::doApply, respectively. willApplyCommand indicates whether or not
the composite editor command should proceed with applying the command.
Tweaks existing layout tests and adds new tests.
Tests: fast/events/before-input-events-different-start-end-elements.html
fast/events/before-input-events-prevent-default-in-textfield.html
fast/events/before-input-events-prevent-default.html
* dom/Document.idl:
* dom/Element.idl:
* dom/EventNames.h:
* dom/Node.cpp:
(WebCore::Node::dispatchInputEvent):
(WebCore::Node::defaultEventHandler):
Currently, we fire input events in Node in response to dispatching a webkitEditableContentChangedEvent. After
some discussion, Ryosuke and I believe that it will be ok to instead directly dispatch the input event where we
would normally dispatch a webkitEditableContentChangedEvent.
* editing/CompositeEditCommand.cpp:
(WebCore::EditCommandComposition::unapply):
(WebCore::EditCommandComposition::reapply):
Added calls to Editor::willUnapplyEditing and Editor::willReapplyEditing.
(WebCore::CompositeEditCommand::willApplyCommand):
(WebCore::CompositeEditCommand::apply):
(WebCore::CompositeEditCommand::didApplyCommand):
Added new virtual functions, willApplyCommand and didApplyCommand, that surround a call to
CompositeEditCommand::doApply. By default, they call willApplyEditing and appliedEditing on the editor, but may
be overridden in special cases, such as in TypingCommand, where we invoke appliedEditing after adding a new
typing command to the last open command.
If willApplyCommand returns false, CompositeEditCommand::apply will bail and not proceed with the command.
* editing/CompositeEditCommand.h:
* editing/Editor.cpp:
(WebCore::dispatchBeforeInputEvent):
(WebCore::dispatchBeforeInputEvents):
(WebCore::dispatchInputEvents):
(WebCore::Editor::willApplyEditing):
(WebCore::Editor::appliedEditing):
(WebCore::Editor::willUnapplyEditing):
(WebCore::Editor::unappliedEditing):
(WebCore::Editor::willReapplyEditing):
(WebCore::Editor::reappliedEditing):
(WebCore::Editor::computeAndSetTypingStyle):
(WebCore::dispatchEditableContentChangedEvents): Deleted.
* editing/Editor.h:
* editing/TypingCommand.cpp:
(WebCore::TypingCommand::willApplyCommand):
(WebCore::TypingCommand::didApplyCommand):
(WebCore::TypingCommand::willAddTypingToOpenCommand):
(WebCore::TypingCommand::insertTextRunWithoutNewlines):
(WebCore::TypingCommand::insertLineBreak):
(WebCore::TypingCommand::insertParagraphSeparator):
(WebCore::TypingCommand::insertParagraphSeparatorInQuotedContent):
(WebCore::TypingCommand::deleteKeyPressed):
(WebCore::TypingCommand::forwardDeleteKeyPressed):
(WebCore::TypingCommand::deleteSelection):
These now invoke willAddTypingToOpenCommand before proceeding with creating the command and applying it. The
flow is now:
- willAddTypingToOpenCommand
- create and apply a new command
- typingAddedToOpenCommand
* editing/TypingCommand.h:
(WebCore::TypingCommand::preservesTypingStyle): Deleted.
(WebCore::TypingCommand::shouldRetainAutocorrectionIndicator): Deleted.
(WebCore::TypingCommand::setShouldRetainAutocorrectionIndicator): Deleted.
(WebCore::TypingCommand::shouldStopCaretBlinking): Deleted.
* html/HTMLAttributeNames.in:
* html/HTMLElement.cpp:
(WebCore::HTMLElement::createEventHandlerNameMap):
2016-10-07 Nan Wang <n_wang@apple.com>
AX: <figcaption> should be AXTitleUIElement for other content inside the <figure>
https://bugs.webkit.org/show_bug.cgi?id=108996
Reviewed by Chris Fleizach.
Exposed the figcaption element to be the AXTitleUIElement for the figure element. And used
the figcaption's content as the accessible name of the figure. Also, updated the figure element's
role description on Mac.
Accessible name and description calculation for figure elements:
https://w3c.github.io/html-aam/#figure-and-figcaption-elements
Test: accessibility/mac/figure-element.html
* English.lproj/Localizable.strings:
* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::captionForFigure):
(WebCore::AccessibilityNodeObject::alternativeText):
* accessibility/AccessibilityNodeObject.h:
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::isFigure):
(WebCore::AccessibilityObject::isSuperscriptStyleGroup): Deleted.
* accessibility/AccessibilityObject.h:
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::exposesTitleUIElement):
(WebCore::AccessibilityRenderObject::titleUIElement):
(WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper roleDescription]):
* platform/LocalizedStrings.cpp:
(WebCore::AXFigureText):
* platform/LocalizedStrings.h:
* platform/efl/LocalizedStringsEfl.cpp:
(WebCore::AXFigureText):
* platform/gtk/LocalizedStringsGtk.cpp:
(WebCore::AXFigureText):
2016-10-07 Alex Christensen <achristensen@webkit.org>
Non-special URL fragments should percent-encode non-ASCII characters
https://bugs.webkit.org/show_bug.cgi?id=163153
Reviewed by Tim Horton.
This is needed to keep compatibility with data URLs with non-ASCII characters after a '#'
which works in Chrome, Firefox, and Safari, while maintaining compatibility with Chrome, IE, and Edge
which keep non-ASCII characters in the fragments of special URLs.
This was proposed to the spec in https://github.com/whatwg/url/issues/150
Covered by new API tests.
* platform/URLParser.cpp:
(WebCore::URLParser::syntaxViolation):
Removed assertion because we now have fragments that need percent encoding but are all ASCII.
(WebCore::URLParser::fragmentSyntaxViolation):
(WebCore::URLParser::parse):
2016-10-07 Brent Fulgham <bfulgham@apple.com>
EventHandler functions that need to guarantee event handler lifetime need to use Ref<Frame>
https://bugs.webkit.org/show_bug.cgi?id=98617
<rdar://problem/12778649>
Reviewed by Daniel Bates.
Improve stability by ensuring that the Frame holding an active EventHandler is kept
alive while in the process of handling events and executing JavaScript.
No new tests since there is no change in behavior.
* page/EventHandler.cpp:
(WebCore::EventHandler::handleMousePressEventSingleClick): Protect the Frame with a Ref<>.
(WebCore::EventHandler::handleMousePressEvent): Ditto.
(WebCore::EventHandler::handleMouseDraggedEvent): Ditto.
(WebCore::EventHandler::eventMayStartDrag): Ditto.
(WebCore::EventHandler::handleMouseReleaseEvent): Ditto.
(WebCore::EventHandler::hitTestResultAtPoint): Ditto.
(WebCore::EventHandler::scrollRecursively): Ditto.
(WebCore::EventHandler::logicalScrollRecursively): Ditto.
(WebCore::EventHandler::selectCursor): Ditto.
(WebCore::EventHandler::handleMouseDoubleClickEvent): Ditto.
(WebCore::EventHandler::mouseMoved): Ditto.
(WebCore::EventHandler::handleMouseMoveEvent): Ditto.
(WebCore::EventHandler::handleMouseForceEvent): Ditto.
(WebCore::EventHandler::dispatchDragEvent): Ditto.
(WebCore::EventHandler::updateDragAndDrop): Ditto.
(WebCore::EventHandler::cancelDragAndDrop): Ditto.
(WebCore::EventHandler::performDragAndDrop): Ditto.
(WebCore::EventHandler::prepareMouseEvent): Ditto.
(WebCore::EventHandler::updateMouseEventTargetNode): Ditto.
(WebCore::EventHandler::dispatchMouseEvent): Ditto.
(WebCore::EventHandler::platformCompleteWheelEvent): Ditto.
(WebCore::EventHandler::handleWheelEvent): Ditto.
(WebCore::EventHandler::defaultWheelEventHandler): Ditto.
(WebCore::EventHandler::sendContextMenuEvent): Ditto.
(WebCore::EventHandler::sendContextMenuEventForKey): Ditto.
(WebCore::EventHandler::hoverTimerFired): Ditto.
(WebCore::EventHandler::keyEvent): Ditto.
(WebCore::EventHandler::defaultKeyboardEventHandler): Ditto.
(WebCore::EventHandler::handleDrag): Ditto.
(WebCore::EventHandler::handleTextInputEvent): Ditto.
(WebCore::EventHandler::defaultSpaceEventHandler): Ditto.
(WebCore::EventHandler::defaultTabEventHandler): Ditto.
(WebCore::EventHandler::sendScrollEvent): Ditto.
(WebCore::EventHandler::handleTouchEvent): Ditto.
* page/ios/EventHandlerIOS.mm:
(WebCore::EventHandler::focusDocumentView): Ditto.
* page/mac/EventHandlerMac.mm:
(WebCore::EventHandler::platformCompleteWheelEvent): Ditto.
2016-10-07 Chris Dumez <cdumez@apple.com>
Regression(r201970): productSub / vendor / vendorSub should not be exposed on WorkerNavigator
https://bugs.webkit.org/show_bug.cgi?id=163124
Reviewed by Ryosuke Niwa.
productSub / vendor / vendorSub should not be exposed on WorkerNavigator:
- https://html.spec.whatwg.org/#navigatorid
Test case:
- http://w3c-test.org/submissions/3881/html/webappapis/system-state-and-capabilities/the-navigator-object/NavigatorID.worker
Note that the specification also restricts NavigatorID's appCodeName and
product attributes to Window. However, it seems the HTML specification is
about to get updated so that these get exposed to workers:
- https://github.com/whatwg/html/pull/1870
No new tests, updated existing test.
* bindings/scripts/generate-bindings.pl:
(shouldPropertyBeExposed):
* page/NavigatorID.idl:
2016-10-07 Alex Christensen <achristensen@webkit.org>
Disable URLParser logs by default in all builds
https://bugs.webkit.org/show_bug.cgi?id=163135
Reviewed by Brady Eidson.
In debug builds with the URLParser enabled, some tests time out because
parameters to generate log strings are being evaluated for each character of each URL
and then not being used if URLParser logs are disabled. Generating these unused parameters
is too slow even for debug builds. Let's only generate them if they are to be used.
No change in behaviour.
* platform/URLParser.cpp:
(WebCore::URLParser::parse):
(WebCore::URLParser::allValuesEqual):
2016-10-07 Andreas Kling <akling@apple.com>
[WK2] didRemoveFrameFromHierarchy callback doesn't fire for subframes when evicting from PageCache.
<https://webkit.org/b/163098>
<rdar://problem/28663488>
Reviewed by Antti Koivisto.
Fix a bug where WK2 didRemoveFrameFromHierarchy callbacks wouldn't fire for subframes that were getting
kicked out of PageCache. The problem was happening because CachedFrame would disconnect the Frame from
its Page just before calling FrameLoader::detachViewsAndDocumentLoader() where the callbacks are fired.
Without a Page, the WebFrame on WK2 side can't find its WebPage, and so it can't fire its callbacks.
The fix is just to switch the order of those two lines.
This bug was causing frequent DOM and window object leaks in some clients *cough* Safari *cough* that
were relying on didRemoveFrameFromHierarchy to release their isolated worlds.
Test: WebKit2.DidRemoveFrameFromHiearchyInPageCache
* history/CachedFrame.cpp:
(WebCore::CachedFrame::destroy):
2016-10-07 Nan Wang <n_wang@apple.com>
AX: AXRoleDescription for details and summary elements
https://bugs.webkit.org/show_bug.cgi?id=163094
Reviewed by Chris Fleizach.
details and summary elements should have AXRoleDescription that is consistent with other
elements that have custom AXSubRole.
Test: accessibility/mac/details-summary-role-description.html
* English.lproj/Localizable.strings:
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper roleDescription]):
* platform/LocalizedStrings.cpp:
(WebCore::AXDetailsText):
(WebCore::AXSummaryText):
* platform/LocalizedStrings.h:
* platform/efl/LocalizedStringsEfl.cpp:
(WebCore::AXDetailsText):
(WebCore::AXSummaryText):
* platform/gtk/LocalizedStringsGtk.cpp:
(WebCore::AXDetailsText):
(WebCore::AXSummaryText):
2016-10-07 Ryan Haddad <ryanhaddad@apple.com>
Fix the Windows build after r206917.
Unreviewed build fix.
* dom/DOMAllInOne.cpp:
2016-10-07 Antti Koivisto <antti@apple.com>
Rename AuthorStyleSheets to Style::Scope
https://bugs.webkit.org/show_bug.cgi?id=163108
Reviewed by Andreas Kling.
It represents the style scope in DOM.
Also move the file under style/.
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* css/CSSStyleSheet.cpp:
(WebCore::CSSStyleSheet::styleSheetScope):
* css/CSSStyleSheet.h:
* css/InspectorCSSOMWrappers.cpp:
(WebCore::InspectorCSSOMWrappers::getWrapperForRuleInSheets):
* css/InspectorCSSOMWrappers.h:
* css/StyleSheetList.cpp:
(WebCore::StyleSheetList::styleSheets):
(WebCore::StyleSheetList::detachFromDocument):
* dom/AuthorStyleSheets.cpp: Removed.
* dom/AuthorStyleSheets.h: Removed.
* dom/Document.cpp:
(WebCore::Document::Document):
(WebCore::Document::setContentLanguage):
(WebCore::Document::recalcStyle):
(WebCore::Document::needsStyleRecalc):
(WebCore::Document::updateStyleIfNeeded):
(WebCore::Document::updateLayoutIgnorePendingStylesheets):
(WebCore::Document::createStyleResolver):
(WebCore::Document::didRemoveAllPendingStylesheet):
(WebCore::Document::usesStyleBasedEditability):
(WebCore::Document::processHttpEquiv):
(WebCore::Document::preferredStylesheetSet):
(WebCore::Document::selectedStylesheetSet):
(WebCore::Document::setSelectedStylesheetSet):
(WebCore::Document::haveStylesheetsLoaded):
* dom/Document.h:
(WebCore::Document::styleScope):
(WebCore::Document::authorStyleSheets): Deleted.
* dom/ExtensionStyleSheets.cpp:
(WebCore::ExtensionStyleSheets::clearPageUserSheet):
(WebCore::ExtensionStyleSheets::updatePageUserSheet):
(WebCore::ExtensionStyleSheets::invalidateInjectedStyleSheetCache):
(WebCore::ExtensionStyleSheets::addUserStyleSheet):
(WebCore::ExtensionStyleSheets::addAuthorStyleSheetForTesting):
(WebCore::ExtensionStyleSheets::styleResolverChangedTimerFired):
* dom/InlineStyleSheetOwner.cpp:
(WebCore::InlineStyleSheetOwner::insertedIntoDocument):
(WebCore::InlineStyleSheetOwner::removedFromDocument):
(WebCore::InlineStyleSheetOwner::clearDocumentData):
(WebCore::InlineStyleSheetOwner::createSheet):
(WebCore::InlineStyleSheetOwner::sheetLoaded):
(WebCore::InlineStyleSheetOwner::startLoadingDynamicSheet):
* dom/InlineStyleSheetOwner.h:
(WebCore::InlineStyleSheetOwner::styleScope):
(WebCore::InlineStyleSheetOwner::styleSheetScope): Deleted.
* dom/ProcessingInstruction.cpp:
(WebCore::ProcessingInstruction::~ProcessingInstruction):
(WebCore::ProcessingInstruction::checkStyleSheet):
(WebCore::ProcessingInstruction::sheetLoaded):
(WebCore::ProcessingInstruction::insertedInto):
(WebCore::ProcessingInstruction::removedFrom):
* dom/ShadowRoot.cpp:
(WebCore::ShadowRoot::styleResolver):
(WebCore::ShadowRoot::styleScope):
(WebCore::ShadowRoot::updateStyle):
(WebCore::ShadowRoot::authorStyleSheets): Deleted.
* dom/ShadowRoot.h:
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::~HTMLLinkElement):
(WebCore::HTMLLinkElement::setDisabledState):
(WebCore::HTMLLinkElement::parseAttribute):
(WebCore::HTMLLinkElement::process):
(WebCore::HTMLLinkElement::insertedInto):
(WebCore::HTMLLinkElement::removedFrom):
(WebCore::HTMLLinkElement::addPendingSheet):
(WebCore::HTMLLinkElement::removePendingSheet):
* html/HTMLStyleElement.cpp:
* inspector/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::collectAllDocumentStyleSheets):
(WebCore::InspectorCSSAgent::forcePseudoState):
(WebCore::InspectorCSSAgent::buildObjectForRule):
(WebCore::InspectorCSSAgent::resetPseudoStates):
* inspector/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::setEmulatedMedia):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::getMatchedCSSRules):
* page/Frame.cpp:
(WebCore::Frame::setPrinting):
* page/FrameView.cpp:
(WebCore::FrameView::layout):
(WebCore::FrameView::setPagination):
(WebCore::FrameView::setViewportSizeForCSSViewportUnits):
* page/Page.cpp:
(WebCore::Page::setViewMode):
(WebCore::Page::setNeedsRecalcStyleInAllFrames):
(WebCore::Page::invalidateInjectedStyleSheetCacheInAllFrames):
* style/StyleScope.cpp: Copied from dom/AuthorStyleSheets.cpp.
(WebCore::Style::Scope::Scope):
(WebCore::Style::Scope::styleResolver):
(WebCore::Style::Scope::styleResolverIfExists):
(WebCore::Style::Scope::forNode):
(WebCore::Style::Scope::removePendingSheet):
(WebCore::Style::Scope::addStyleSheetCandidateNode):
(WebCore::Style::Scope::removeStyleSheetCandidateNode):
(WebCore::Style::Scope::collectActiveStyleSheets):
(WebCore::Style::Scope::analyzeStyleSheetChange):
(WebCore::Style::Scope::updateActiveStyleSheets):
(WebCore::Style::Scope::updateStyleResolver):
(WebCore::Style::Scope::activeStyleSheetsForInspector):
(WebCore::Style::Scope::activeStyleSheetsContains):
(WebCore::Style::Scope::flushPendingUpdate):
(WebCore::Style::Scope::clearPendingUpdate):
(WebCore::Style::Scope::scheduleActiveSetUpdate):
(WebCore::Style::Scope::didChangeCandidatesForActiveSet):
(WebCore::Style::Scope::didChangeContentsOrInterpretation):
(WebCore::Style::Scope::pendingUpdateTimerFired):
(WebCore::AuthorStyleSheets::AuthorStyleSheets): Deleted.
(WebCore::AuthorStyleSheets::styleResolver): Deleted.
(WebCore::AuthorStyleSheets::styleResolverIfExists): Deleted.
(WebCore::AuthorStyleSheets::forNode): Deleted.
(WebCore::AuthorStyleSheets::removePendingSheet): Deleted.
(WebCore::AuthorStyleSheets::addStyleSheetCandidateNode): Deleted.
(WebCore::AuthorStyleSheets::removeStyleSheetCandidateNode): Deleted.
(WebCore::AuthorStyleSheets::collectActiveStyleSheets): Deleted.
(WebCore::AuthorStyleSheets::analyzeStyleSheetChange): Deleted.
(WebCore::AuthorStyleSheets::updateActiveStyleSheets): Deleted.
(WebCore::AuthorStyleSheets::updateStyleResolver): Deleted.
(WebCore::AuthorStyleSheets::activeStyleSheetsForInspector): Deleted.
(WebCore::AuthorStyleSheets::activeStyleSheetsContains): Deleted.
(WebCore::AuthorStyleSheets::flushPendingUpdate): Deleted.
(WebCore::AuthorStyleSheets::clearPendingUpdate): Deleted.
(WebCore::AuthorStyleSheets::scheduleActiveSetUpdate): Deleted.
(WebCore::AuthorStyleSheets::didChangeCandidatesForActiveSet): Deleted.
(WebCore::AuthorStyleSheets::didChangeContentsOrInterpretation): Deleted.
(WebCore::AuthorStyleSheets::pendingUpdateTimerFired): Deleted.
* style/StyleScope.h: Copied from dom/AuthorStyleSheets.h.
* style/StyleTreeResolver.cpp:
* svg/SVGFontFaceElement.cpp:
(WebCore::SVGFontFaceElement::rebuildFontFace):
(WebCore::SVGFontFaceElement::removedFrom):
* xml/XMLTreeViewer.cpp:
(WebCore::XMLTreeViewer::transformDocumentToTreeView):
* xml/parser/XMLDocumentParser.cpp:
(WebCore::XMLDocumentParser::end):
* xml/parser/XMLDocumentParserLibxml2.cpp:
(WebCore::XMLDocumentParser::doEnd):
2016-10-07 Zalan Bujtas <zalan@apple.com>
https://vuldb.com/?cvssv3.2012 takes long time to load.
https://bugs.webkit.org/show_bug.cgi?id=162994
<rdar://problem/28593746>
Reviewed by Darin Adler.
Stop visiting cousins when we hit the style sharing search threshold.
In addition to mistakenly ignoring the threshold at SharingResolver::findSibling(), we
continued on searching for cousin elements.
Test: fast/selectors/slow-style-sharing-with-long-cousin-list.html
* style/StyleSharingResolver.cpp:
(WebCore::Style::SharingResolver::resolve):
(WebCore::Style::SharingResolver::findSibling):
(WebCore::Style::SharingResolver::locateCousinList):
2016-10-07 Romain Bellessort <romain.bellessort@crf.canon.fr>
[Readable Streams API] Implement generic reader functions
https://bugs.webkit.org/show_bug.cgi?id=163003
Reviewed by Darin Adler.
Implements reader generic functions defined by spec in order to prepare BYOBReader integration.
Generic functions factorize some code that is used by both DefaultReader and BYOBReader.
No change in behaviour.
* Modules/streams/ReadableStreamDefaultReader.js:
(cancel): Rely on readableStreamReaderGenericCancel.
(releaseLock): Rely on readableStreamReaderGenericRelease.
* Modules/streams/ReadableStreamInternals.js:
(privateInitializeReadableStreamDefaultReader): Rely on readableStreamReaderGenericInitialize.
(readableStreamReaderGenericInitialize): Added.
(readableStreamReaderGenericCancel): Added.
(readableStreamReaderGenericRelease): Added.
2016-10-07 Adam Bergkvist <adam.bergkvist@ericsson.com>
WebRTC: Misc gardening: Use typedefs consistently and remove unused code
https://bugs.webkit.org/show_bug.cgi?id=163104
Reviewed by Philippe Normand.
Miscellaneous WebRTC gardening. See file list below for details.
Testing: No change in behavior.
* Modules/mediastream/MediaEndpointPeerConnection.cpp:
* Modules/mediastream/MediaEndpointPeerConnection.h:
Move NotImplemented include to cpp-file.
* platform/mediastream/MediaEndpoint.h:
Use MediaPayloadVector typedef (instead of Vector<RefPtr<MediaPayload>>).
* platform/mediastream/PeerMediaDescription.h:
(WebCore::PeerMediaDescription::source): Deleted.
(WebCore::PeerMediaDescription::setSource): Deleted.
Sources are passed to updateSendConfiguration() via a source map and not added to each
PeerMediaDescription anymore. Remove unused code.
* platform/mock/MockMediaEndpoint.cpp:
(WebCore::MockMediaEndpoint::getDefaultAudioPayloads):
(WebCore::MockMediaEndpoint::getDefaultVideoPayloads):
Use MediaPayloadVector typedef.
* platform/mock/MockMediaEndpoint.h:
Use MediaPayloadVector typedef.
2016-10-07 Gwang Yoon Hwang <yoon@igalia.com>
[GTK] Remove unneeded creation of TextureMapperPlatformLayerProxy
https://bugs.webkit.org/show_bug.cgi?id=163101
Reviewed by Žan Doberšek.
Covered by existing tests.
* platform/graphics/cairo/ImageBufferCairo.cpp:
(WebCore::ImageBufferData::ImageBufferData): Modified not to create
TextureMapperPlatformLayerProxy if it is not created for the
accelerated 2d canvas.
2016-10-07 Fujii Hironori <Hironori.Fujii@sony.com>
Use 'use lib $FindBin::Bin' to append Perl module include path
https://bugs.webkit.org/show_bug.cgi?id=162256
Reviewed by Carlos Garcia Campos.
Some Perl scripts are needed to be executed with '-I' switch to
explicitly append Perl module include path. Use 'use lib' as well
as other Perl scripts do.
* CMakeLists.txt: Removed '-I' options from invocation of Perl.
* DerivedSources.make: Ditto.
* bindings/scripts/generate-bindings.pl: Use 'use lib'.
* bindings/scripts/preprocess-idls.pl: Ditto.
* css/make-css-file-arrays.pl: Ditto.
* css/makegrammar.pl: Ditto.
* css/makeprop.pl: Ditto.
* css/makevalues.pl: Ditto.
* dom/make_dom_exceptions.pl: Ditto.
* dom/make_event_factory.pl: Ditto.
* dom/make_names.pl: Ditto.
* page/make_settings.pl: Ditto.
2016-10-07 Youenn Fablet <youenn@apple.com>
Refactor CachedResourceClient::notifyFinished
https://bugs.webkit.org/show_bug.cgi?id=162060
Reviewed by Darin Adler.
No change of behavior.
Making CachedResourceClient and CachedRawResourceClient callbacks take CachedResource references and not pointers.
In most cases, the CachedResource parameter is only used for assertions.
Removing that parameter might be contemplated in the future.
The only real case is in RenderImage.
Removed the CachedResource parameter from ContentFilter methods as code was calling these methods with null values.
* dom/LoadableClassicScript.cpp:
(WebCore::LoadableClassicScript::notifyFinished):
* dom/LoadableClassicScript.h:
* html/HTMLImageLoader.cpp:
(WebCore::HTMLImageLoader::notifyFinished):
* html/HTMLImageLoader.h:
* loader/ContentFilter.cpp:
(WebCore::ContentFilter::continueAfterResponseReceived):
(WebCore::ContentFilter::continueAfterDataReceived):
(WebCore::ContentFilter::continueAfterNotifyFinished):
(WebCore::ContentFilter::deliverResourceData):
* loader/ContentFilter.h:
* loader/CrossOriginPreflightChecker.cpp:
(WebCore::CrossOriginPreflightChecker::notifyFinished):
* loader/CrossOriginPreflightChecker.h:
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::notifyFinished):
(WebCore::DocumentLoader::handleSubstituteDataLoadNow):
(WebCore::DocumentLoader::redirectReceived):
(WebCore::DocumentLoader::responseReceived):
(WebCore::DocumentLoader::continueAfterContentPolicy):
(WebCore::DocumentLoader::dataReceived):
* loader/DocumentLoader.h:
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::redirectReceived):
(WebCore::DocumentThreadableLoader::dataSent):
(WebCore::DocumentThreadableLoader::responseReceived):
(WebCore::DocumentThreadableLoader::dataReceived):
(WebCore::DocumentThreadableLoader::notifyFinished):
* loader/DocumentThreadableLoader.h:
* loader/ImageLoader.cpp:
(WebCore::ImageLoader::notifyFinished):
* loader/ImageLoader.h:
* loader/LinkLoader.cpp:
(WebCore::LinkLoader::triggerEvents):
(WebCore::LinkLoader::notifyFinished):
* loader/LinkLoader.h:
* loader/LinkPreloadResourceClients.cpp:
(WebCore::LinkPreloadResourceClient::triggerEvents):
* loader/LinkPreloadResourceClients.h:
* loader/MediaResourceLoader.cpp:
(WebCore::MediaResource::responseReceived):
(WebCore::MediaResource::shouldCacheResponse):
(WebCore::MediaResource::redirectReceived):
(WebCore::MediaResource::dataSent):
(WebCore::MediaResource::dataReceived):
(WebCore::MediaResource::notifyFinished):
(WebCore::MediaResource::getOrCreateReadBuffer):
* loader/MediaResourceLoader.h:
* loader/TextTrackLoader.cpp:
(WebCore::TextTrackLoader::processNewCueData):
(WebCore::TextTrackLoader::deprecatedDidReceiveCachedResource):
(WebCore::TextTrackLoader::notifyFinished):
* loader/TextTrackLoader.h:
* loader/cache/CachedRawResource.cpp:
(WebCore::CachedRawResource::notifyClientsDataWasReceived):
(WebCore::CachedRawResource::didAddClient):
(WebCore::CachedRawResource::redirectReceived):
(WebCore::CachedRawResource::responseReceived):
(WebCore::CachedRawResource::shouldCacheResponse):
(WebCore::CachedRawResource::didSendData):
* loader/cache/CachedRawResourceClient.h:
(WebCore::CachedRawResourceClient::dataSent):
(WebCore::CachedRawResourceClient::responseReceived):
(WebCore::CachedRawResourceClient::shouldCacheResponse):
(WebCore::CachedRawResourceClient::dataReceived):
(WebCore::CachedRawResourceClient::redirectReceived):
(WebCore::CachedRawResourceClient::getOrCreateReadBuffer):
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::checkNotify):
(WebCore::CachedResource::didAddClient):
* loader/cache/CachedResourceClient.h:
(WebCore::CachedResourceClient::notifyFinished):
(WebCore::CachedResourceClient::deprecatedDidReceiveCachedResource):
* loader/cache/CachedTextTrack.cpp:
(WebCore::CachedTextTrack::updateData):
* loader/icon/IconLoader.cpp:
(WebCore::IconLoader::notifyFinished):
* loader/icon/IconLoader.h:
* loader/soup/CachedRawResourceSoup.cpp:
* platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp:
(WebCore::WebCoreAVCFResourceLoader::responseReceived):
(WebCore::WebCoreAVCFResourceLoader::dataReceived):
(WebCore::WebCoreAVCFResourceLoader::notifyFinished):
(WebCore::WebCoreAVCFResourceLoader::fulfillRequestWithResource):
* platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.h:
* platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.h:
* platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
(WebCore::WebCoreAVFResourceLoader::responseReceived):
(WebCore::WebCoreAVFResourceLoader::dataReceived):
(WebCore::WebCoreAVFResourceLoader::notifyFinished):
(WebCore::WebCoreAVFResourceLoader::fulfillRequestWithResource):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::notifyFinished):
* rendering/RenderImage.h:
* rendering/RenderLayerFilterInfo.cpp:
(WebCore::RenderLayer::FilterInfo::setRenderer):
(WebCore::RenderLayer::FilterInfo::notifyFinished):
* rendering/RenderLayerFilterInfo.h:
* svg/SVGFEImageElement.cpp:
(WebCore::SVGFEImageElement::notifyFinished):
* svg/SVGFEImageElement.h:
* svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::notifyFinished):
* svg/SVGUseElement.h:
* xml/parser/XMLDocumentParser.cpp:
(WebCore::XMLDocumentParser::notifyFinished):
* xml/parser/XMLDocumentParser.h:
2016-10-06 Youenn Fablet <youenn@apple.com>
CachedXSLStylesheet does not need to be updated according Origin/Fetch mode
https://bugs.webkit.org/show_bug.cgi?id=162389
Reviewed by Darin Adler.
No change of behavior.
Making clear that there is no reason to update cached XSLT resources according the origin, given that CORS is never checked and loading is always same-origin.
Renaming CachedResource::isClean to CachedResource::isCORSSameOrigin to better match spec terminology.
Updating HTMLLinkElement accordingly.
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::initializeStyleSheet):
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::isCORSSameOrigin): Ensuring that this method is not called for resource types for which CORS is not to be used.
(WebCore::CachedResource::isClean): Deleted.
* loader/cache/CachedResource.h:
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::shouldUpdateCachedResourceWithCurrentRequest):
2016-10-06 Youenn Fablet <youenn@apple.com>
Add a place for common HTTP Header values
https://bugs.webkit.org/show_bug.cgi?id=163002
Reviewed by Alex Christensen.
No change of behavior.
Introducing HTTPHeaderValues with two Content-Type values.
* CMakeLists.txt:
* Modules/fetch/FetchBody.cpp:
(WebCore::FetchBody::extract):
* WebCore.xcodeproj/project.pbxproj:
* platform/network/HTTPHeaderValues.cpp: Added.
(WebCore::HTTPHeaderValues::TextPlainContentType):
(WebCore::HTTPHeaderValues::FormURLEncodedContentType):
* platform/network/HTTPHeaderValues.h: Added.
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::send):
2016-10-06 Youenn Fablet <youenn@apple.com>
CachedResourceRequest should not need to store defer and preload options
https://bugs.webkit.org/show_bug.cgi?id=163004
Reviewed by Alex Christensen.
No change of behavior.
Removing CachedResourceRequest defer and preload fields.
These fields are computed inside CachedResourceLoader instead.
Updated setting of priority from CachedResourceRequest to CachedResource.
Priority is set for any new resource (this covers all cases where no cached resource can be reused from the memory cache).
Priority is set for a cached resource if the request is not a preload request.
* loader/LinkLoader.cpp:
(WebCore::LinkLoader::preloadIfNeeded):
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::CachedResource):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::requestImage):
(WebCore::CachedResourceLoader::canRequest):
(WebCore::CachedResourceLoader::requestResource):
(WebCore::CachedResourceLoader::determineRevalidationPolicy):
(WebCore::CachedResourceLoader::requestPreload):
* loader/cache/CachedResourceLoader.h:
* loader/cache/CachedResourceRequest.cpp:
(WebCore::CachedResourceRequest::CachedResourceRequest):
* loader/cache/CachedResourceRequest.h:
(WebCore::CachedResourceRequest::priority):
(WebCore::CachedResourceRequest::forPreload): Deleted.
(WebCore::CachedResourceRequest::setForPreload): Deleted.
(WebCore::CachedResourceRequest::defer): Deleted.
(WebCore::CachedResourceRequest::setDefer): Deleted.
2016-10-06 Myles C. Maxfield <mmaxfield@apple.com>
Variation fonts don't affect glyph advances
https://bugs.webkit.org/show_bug.cgi?id=163093
Reviewed by Darin Adler.
Work around known bug <rdar://problem/28662086>. For variation fonts,
CTFontGetAdvancesForGlyphs() gives correct answers but
CTFontGetUnsummedAdvancesForGlyphsAndStyle() doesn't.
Test: fast/text/variations/advances.html
* platform/graphics/FontPlatformData.h:
(WebCore::FontPlatformData::hasVariations):
* platform/graphics/cocoa/FontCocoa.mm:
(WebCore::Font::platformWidthForGlyph):
* platform/graphics/cocoa/FontPlatformDataCocoa.mm:
(WebCore::FontPlatformData::FontPlatformData):
2016-10-06 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r206713.
https://bugs.webkit.org/show_bug.cgi?id=163097
triggers apparent codegen bug on ARM 32-bit (Requested by smfr
on #webkit).
Reverted changeset:
"Support transitions/animations of background-position with
right/bottom-relative values"
https://bugs.webkit.org/show_bug.cgi?id=162048
http://trac.webkit.org/changeset/206713
2016-10-06 Daniel Bates <dabates@apple.com>
Remove unused WebCore::contentDispositionType()
https://bugs.webkit.org/show_bug.cgi?id=163095
Reviewed by Alex Christensen.
The function WebCore::contentDispositionType() was only used by the Chromium and Qt ports
to parse the Content-Disposition HTTP header. Both of these ports have long since been
removed from the repository. We should remove WebCore::contentDispositionType().
* platform/network/HTTPParsers.cpp:
(WebCore::contentDispositionType): Deleted.
* platform/network/HTTPParsers.h:
2016-10-06 Ryosuke Niwa <rniwa@webkit.org>
Upgrading and constructing element should always report exception instead of rethrowing
https://bugs.webkit.org/show_bug.cgi?id=162996
Reviewed by Darin Adler.
The latest HTML specification specifies that we must report exceptions thrown during element upgrades:
https://html.spec.whatwg.org/#upgrades
In addition, F2F during 2016 TPAC had a consensus that we should do the same for document.createElement:
https://github.com/w3c/webcomponents/issues/569
Since the HTML parser already reports the exception thrown during custom element construction as it does
not have any JS stack, these changes make exceptions thrown during upgrades and constructions.
In our implementation, this only reduces the code complexity as now we can push the logic to fallback
to HTMLUnknownElement into JSCustomElementInterface's constructElement, which has been renamed
to constructElementWithFallback, and eliminate ShouldClearException enum class entirely. Moreover,
constructElementWithFallback can now return Ref instead of RefPtr.
No new tests. Existing tests have been updated.
* bindings/js/JSCustomElementInterface.cpp:
(WebCore::JSCustomElementInterface::constructElementWithFallback): Create a HTMLUnknownElement if
an attempt to construct a custom element had failed in lieu of returning nullptr.
(WebCore::JSCustomElementInterface::tryToConstructCustomElement): Renamed from constructElement.
Always report exceptions (the same behavior as ShouldClearException::Clear).
(WebCore::JSCustomElementInterface::upgradeElement): Report exceptions instead of rethrowing.
* bindings/js/JSCustomElementInterface.h:
* dom/Document.cpp:
(WebCore::createHTMLElementWithNameValidation):
* html/parser/HTMLDocumentParser.cpp:
(WebCore::HTMLDocumentParser::runScriptsForPausedTreeBuilder):
2016-10-06 Chris Dumez <cdumez@apple.com>
Overwriting an attribute event listener can lead to wrong event listener firing order
https://bugs.webkit.org/show_bug.cgi?id=163083
Reviewed by Darin Adler.
Overwriting an attribute event listener could lead to wrong event listener
firing order in WebKit. This is because we were removing the old event
listener and then appending the new one instead of actually *replacing*
the old one.
No new tests, rebaselined existing tests.
* dom/EventListenerMap.cpp:
(WebCore::EventListenerMap::replace):
* dom/EventListenerMap.h:
* dom/EventTarget.cpp:
(WebCore::EventTarget::setAttributeEventListener):
(WebCore::EventTarget::hasActiveEventListeners): Deleted.
(WebCore::EventTarget::dispatchEventForBindings): Deleted.
* dom/EventTarget.h:
2016-10-06 Alex Christensen <achristensen@webkit.org>
URLParser: Non-ASCII characters in Non-UTF-8 encoded queries of relative URLs with ws, wss, or nonspecial schemes should be UTF-8 encoded
https://bugs.webkit.org/show_bug.cgi?id=163089
Reviewed by Tim Horton.
This is a change similar to r206818 but with relative URLs.
This matches the spec, URL::parse, and other browsers' behavior.
Covered by new API tests for URLParser.
This also fixes tests like http/tests/misc/url-in-utf32le.html when URLParser is enabled.
* platform/URL.cpp:
(WebCore::URL::URL):
Use the same encoding for the URL constructor whether or not the URLParser is enabled.
* platform/URLParser.cpp:
(WebCore::URLParser::copyURLPartsUntil):
(WebCore::URLParser::parse):
(WebCore::isSpecial): Deleted.
* platform/URLParser.h:
Use UTF-8 for non-special, ws, or wss schemes.
2016-10-06 Zalan Bujtas <zalan@apple.com>
Add back ASSERT(!needsLayout) to RenderTableSection which is now valid
https://bugs.webkit.org/show_bug.cgi?id=92954
<rdar://problem/12147973>
Reviewed by Dan Bernstein.
LayoutTests pass fine now with this assert on.
Covered by existing tests.
* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::paint):
2016-10-06 Jiewen Tan <jiewen_tan@apple.com>
Add a dummy SubtleCrypto interface
https://bugs.webkit.org/show_bug.cgi?id=162992
<rdar://problem/28643573>
Reviewed by Brent Fulgham.
Add a dummy SubtleCrypto interface and rename KeyPair to CryptoKeyPair.
Tests: crypto/subtle/gc-2.html
crypto/subtle/gc-3.html
crypto/subtle/gc.html
crypto/webkitSubtle/aes-cbc-192-encrypt-decrypt.html
crypto/webkitSubtle/aes-cbc-256-encrypt-decrypt.html
crypto/webkitSubtle/aes-cbc-encrypt-decrypt-with-padding.html
crypto/webkitSubtle/aes-cbc-encrypt-decrypt.html
crypto/webkitSubtle/aes-cbc-generate-key.html
crypto/webkitSubtle/aes-cbc-import-jwk.html
crypto/webkitSubtle/aes-cbc-invalid-length.html
crypto/webkitSubtle/aes-cbc-unwrap-failure.html
crypto/webkitSubtle/aes-cbc-unwrap-rsa.html
crypto/webkitSubtle/aes-cbc-wrap-rsa-non-extractable.html
crypto/webkitSubtle/aes-cbc-wrap-rsa.html
crypto/webkitSubtle/aes-cbc-wrong-key-class.html
crypto/webkitSubtle/aes-export-key.html
crypto/webkitSubtle/aes-kw-key-manipulation.html
crypto/webkitSubtle/aes-kw-wrap-unwrap-aes.html
crypto/webkitSubtle/aes-postMessage.html
crypto/webkitSubtle/argument-conversion.html
crypto/webkitSubtle/array-buffer-view-offset.html
crypto/webkitSubtle/crypto-key-algorithm-gc.html
crypto/webkitSubtle/crypto-key-usages-gc.html
crypto/webkitSubtle/hmac-check-algorithm.html
crypto/webkitSubtle/hmac-export-key.html
crypto/webkitSubtle/hmac-generate-key.html
crypto/webkitSubtle/hmac-import-jwk.html
crypto/webkitSubtle/hmac-postMessage.html
crypto/webkitSubtle/hmac-sign-verify-empty-key.html
crypto/webkitSubtle/hmac-sign-verify.html
crypto/webkitSubtle/import-jwk.html
crypto/webkitSubtle/jwk-export-use-values.html
crypto/webkitSubtle/jwk-import-use-values.html
crypto/webkitSubtle/rsa-export-generated-keys.html
crypto/webkitSubtle/rsa-export-key.html
crypto/webkitSubtle/rsa-export-private-key.html
crypto/webkitSubtle/rsa-indexeddb-non-exportable-private.html
crypto/webkitSubtle/rsa-indexeddb-non-exportable.html
crypto/webkitSubtle/rsa-indexeddb-private.html
crypto/webkitSubtle/rsa-indexeddb.html
crypto/webkitSubtle/rsa-oaep-generate-non-extractable-key.html
crypto/webkitSubtle/rsa-oaep-key-manipulation.html
crypto/webkitSubtle/rsa-oaep-plaintext-length.html
crypto/webkitSubtle/rsa-oaep-wrap-unwrap-aes.html
crypto/webkitSubtle/rsa-postMessage.html
crypto/webkitSubtle/rsaes-pkcs1-v1_5-decrypt.html
crypto/webkitSubtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes.html
crypto/webkitSubtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent.html
crypto/webkitSubtle/rsassa-pkcs1-v1_5-generate-key.html
crypto/webkitSubtle/rsassa-pkcs1-v1_5-import-jwk-small-key.html
crypto/webkitSubtle/rsassa-pkcs1-v1_5-import-jwk.html
crypto/webkitSubtle/rsassa-pkcs1-v1_5-sign-verify.html
crypto/webkitSubtle/sha-1.html
crypto/webkitSubtle/sha-224.html
crypto/webkitSubtle/sha-256.html
crypto/webkitSubtle/sha-384.html
crypto/webkitSubtle/sha-512.html
crypto/webkitSubtle/unimplemented-unwrap-crash.html
crypto/webkitSubtle/unwrapKey-check-usage.html
crypto/webkitSubtle/wrapKey-check-usage.html
crypto/workers/subtle/aes-postMessage-worker.html
crypto/workers/subtle/gc-worker.html
crypto/workers/subtle/hmac-postMessage-worker.html
crypto/workers/subtle/hrsa-postMessage-worker.html
crypto/workers/subtle/multiple-postMessage-worker.html
crypto/workers/subtle/rsa-postMessage-worker.html
* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.make:
* PlatformEfl.cmake:
* PlatformGTK.cmake:
* PlatformMac.cmake:
* WebCore.xcodeproj/project.pbxproj:
* crypto/CryptoKeyPair.idl:
* crypto/SubtleCrypto.cpp:
(WebCore::SubtleCrypto::SubtleCrypto):
* crypto/SubtleCrypto.h:
(WebCore::SubtleCrypto::create):
* crypto/SubtleCrypto.idl: Added.
* page/Crypto.cpp:
(WebCore::Crypto::Crypto):
(WebCore::Crypto::subtle):
* page/Crypto.h:
* page/Crypto.idl:
2016-10-06 Anders Carlsson <andersca@apple.com>
Crash when ApplePaySession.completeMerchantValidation is not passed a dictionary
https://bugs.webkit.org/show_bug.cgi?id=163074
rdar://problem/27824842
Reviewed by Tim Horton.
Raise a type error on a null initializer object.
* Modules/applepay/ApplePaySession.cpp:
(WebCore::ApplePaySession::completeMerchantValidation):
2016-10-06 Antti Koivisto <antti@apple.com>
Mutating styleSheet in shadow tree doesn't update the style
https://bugs.webkit.org/show_bug.cgi?id=162744
<rdar://problem/28550588>
Reviewed by Ryosuke Niwa.
We weren't always invalidating the right AuthorStyleSheets (to be renamed) instance
for the scope after mutations.
Test: fast/shadow-dom/mutating-stylesheet-in-shadow-tree.html
* css/CSSStyleSheet.cpp:
(WebCore::CSSStyleSheet::didMutateRules):
(WebCore::CSSStyleSheet::didMutate):
(WebCore::CSSStyleSheet::clearOwnerNode):
(WebCore::CSSStyleSheet::rootStyleSheet):
(WebCore::CSSStyleSheet::ownerDocument):
(WebCore::CSSStyleSheet::styleSheetScope):
Invalidate the right scope after stylesheet mutations.
* css/CSSStyleSheet.h:
* dom/AuthorStyleSheets.cpp:
(WebCore::AuthorStyleSheets::styleResolver):
(WebCore::AuthorStyleSheets::styleResolverIfExists):
Take care to update the right style resolver.
(WebCore::AuthorStyleSheets::forNode):
(WebCore::AuthorStyleSheets::removeStyleSheetCandidateNode):
Start the update timer so clients don't need to request update separately.
(WebCore::AuthorStyleSheets::analyzeStyleSheetChange):
(WebCore::AuthorStyleSheets::updateActiveStyleSheets):
(WebCore::AuthorStyleSheets::updateStyleResolver):
* dom/AuthorStyleSheets.h:
* dom/InlineStyleSheetOwner.cpp:
(WebCore::InlineStyleSheetOwner::insertedIntoDocument):
Save the scope we were inserted into so removals can be done reliably.
(WebCore::InlineStyleSheetOwner::removedFromDocument):
Use and clear the saved scope.
Remove didChangeCandidatesForActiveSet() as it is now done by removeStyleSheetCandidateNode() call.
(WebCore::InlineStyleSheetOwner::clearDocumentData):
(WebCore::InlineStyleSheetOwner::createSheet):
(WebCore::InlineStyleSheetOwner::sheetLoaded):
(WebCore::InlineStyleSheetOwner::startLoadingDynamicSheet):
(WebCore::authorStyleSheetsForElement): Deleted.
* dom/InlineStyleSheetOwner.h:
(WebCore::InlineStyleSheetOwner::styleSheetScope):
* dom/ShadowRoot.cpp:
(WebCore::ShadowRoot::styleResolverIfExists):
* dom/ShadowRoot.h:
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::removedFrom):
Remove didChangeCandidatesForActiveSet() as it is now done by removeStyleSheetCandidateNode() call.
* html/HTMLStyleElement.cpp:
(WebCore::HTMLStyleElement::~HTMLStyleElement):
(WebCore::HTMLStyleElement::parseAttribute):
Fix a bug where we wouldn't create stylesheet if a style element was activated by removing a media attribute.
(WebCore::HTMLStyleElement::insertedInto):
(WebCore::HTMLStyleElement::removedFrom):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::getMatchedCSSRules):
* svg/SVGStyleElement.cpp:
(WebCore::SVGStyleElement::~SVGStyleElement):
(WebCore::SVGStyleElement::insertedInto):
(WebCore::SVGStyleElement::removedFrom):
2016-10-06 Alex Christensen <achristensen@webkit.org>
Skip tabs and newlines between end of query and beginning of fragment in non-UTF-8-encoded URLs
https://bugs.webkit.org/show_bug.cgi?id=163071
Reviewed by Tim Horton.
Covered by a new API test that would have asserted before this change.
* platform/URLParser.cpp:
(WebCore::URLParser::encodeQuery):
Skip tabs and newlines before asserting that we are at the end.
2016-10-06 Alex Christensen <achristensen@webkit.org>
URLParser should parse file URLs with ports consistently
https://bugs.webkit.org/show_bug.cgi?id=163075
Reviewed by Brady Eidson.
Covered by API tests. We used to assert when parsing the newly tested URLs.
* platform/URLParser.cpp:
(WebCore::URLParser::parse):
2016-10-06 Chris Dumez <cdumez@apple.com>
[WebIDL] Add support for having dictionaries in their own IDL file
https://bugs.webkit.org/show_bug.cgi?id=162912
Reviewed by Darin Adler.
Add support for having dictionaries in their own IDL file so that they
can be shared by multiple interfaces.
Leverage this new support to merge Element::ScrollToOptions and
DOMWindow::ScrollToOptions.
No new tests, extended bindings tests.
* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* bindings/scripts/CodeGenerator.pm:
(ProcessDocument):
(IDLFileForInterface):
(GetDictionaryByName):
(IsDictionaryType):
(HasEnumImplementationNameOverride): Deleted.
(GetEnumImplementationNameOverride): Deleted.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateDictionary):
(GetEnumerationClassName):
(GenerateEnumerationImplementationContent):
(GenerateEnumerationHeaderContent):
(GetDictionaryClassName):
(GenerateDefaultValue):
(GenerateDictionaryHeaderContent):
(GenerateDictionariesHeaderContent):
(GenerateDictionaryImplementationContent):
(GenerateDictionariesImplementationContent):
(GenerateHeader):
(GenerateImplementation):
(GenerateParametersCheck):
(GenerateDictionaryHeader):
(GenerateDictionaryImplementation):
(GenerateCallbackHeader):
(GenerateCallbackImplementation):
(GetNativeType):
(JSValueToNative):
(GetNestedClassName): Deleted.
(GenerateConversionRuleWithLeadingComma): Deleted.
(addIterableProperties): Deleted.
* bindings/scripts/preprocess-idls.pl:
(containsInterfaceOrExceptionFromIDL):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjPrototypeFunctionOperationWithExternalDictionaryParameter):
(WebCore::jsTestObjPrototypeFunctionAttachShadowRoot): Deleted.
* bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp: Added.
(WebCore::convertDictionary<TestStandaloneDictionary>):
* bindings/scripts/test/JS/JSTestStandaloneDictionary.h: Added.
* bindings/scripts/test/TestObj.idl:
* bindings/scripts/test/TestStandaloneDictionary.idl: Added.
* dom/Element.h:
* dom/Element.idl:
* html/HTMLBodyElement.cpp:
(WebCore::HTMLBodyElement::scrollTo):
* page/DOMWindow.h:
* page/DOMWindow.idl:
* page/ScrollToOptions.h: Added.
* page/ScrollToOptions.idl: Added.
2016-10-06 Brent Fulgham <bfulgham@apple.com>
Unreviewed build fix.
* platform/graphics/Image.cpp: Add missing include
for 'NotImplemented' when building under Direct2D.
2016-10-06 Brent Fulgham <bfulgham@apple.com>
[Win][Direct2D] Add Direct2D CMake rules
https://bugs.webkit.org/show_bug.cgi?id=162925
Reviewed by Brent Fulgham.
Modify PlatformAppleWin.cmake to conditionally build the CoreGraphics
and CoreAnimation implementation, or the Direct2D files, depending
on whether the USE_DIRECT2D macro is set in the CMake build options.
By default it builds the normal CA/CG way.
Add a stub GraphicsLayer implementation for Direct2D.
No new tests because there is no change in our active ports.
* PlatformAppleWin.cmake: Conditionalize the build for CA/CG or
Direct2D.
* config.h: Make sure CA is turned of for Direct2D builds.
* page/win/FrameWinDirect2D.cpp: Add missing include file.
* platform/graphics/win/GraphicsLayerDirect2D.cpp: Added.
* platform/graphics/win/GraphicsLayerDirect2D.h: Added.
2016-10-06 Yusuke Suzuki <utatane.tea@gmail.com>
[WebCore][JSC] Use new @throwTypeError and @throwRangeError intrinsics
https://bugs.webkit.org/show_bug.cgi?id=163001
Reviewed by Keith Miller.
Replace `throw new @XXXError(...)` to @throwXXXError intrinsic.
It reduces the size of bytecode sequence and facilitate inlining.
No behavior change.
* Modules/fetch/FetchHeaders.js:
(initializeFetchHeaders):
* Modules/fetch/FetchInternals.js:
(fillFetchHeaders):
* Modules/fetch/FetchRequest.js:
(initializeFetchRequest):
* Modules/fetch/FetchResponse.js:
(initializeFetchResponse):
(clone):
* Modules/mediastream/NavigatorUserMedia.js:
(webkitGetUserMedia):
* Modules/mediastream/RTCPeerConnection.js:
(initializeRTCPeerConnection):
(getLocalStreams):
(getStreamById):
(addStream):
* Modules/streams/ReadableStream.js:
(initializeReadableStream):
(getReader):
* Modules/streams/ReadableStreamDefaultController.js:
(enqueue):
(error):
(close):
* Modules/streams/ReadableStreamDefaultReader.js:
(releaseLock):
* Modules/streams/ReadableStreamInternals.js:
(privateInitializeReadableStreamDefaultReader):
(privateInitializeReadableStreamDefaultController):
(doStructuredClone):
(readableStreamError):
* Modules/streams/StreamInternals.js:
(validateAndNormalizeQueuingStrategy):
(enqueueValueWithSize):
* Modules/streams/WritableStream.js:
(initializeWritableStream):
(state):
* xml/XMLHttpRequest.js:
(response):
2016-10-06 John Wilander <wilander@apple.com>
Update Resource Load Statistics
https://bugs.webkit.org/show_bug.cgi?id=162811
Reviewed by Alex Christensen.
No new tests. The counting is based on top privately owned domains
which currently is not supported by layout tests nor API tests.
* Modules/websockets/WebSocket.cpp:
(WebCore::WebSocket::connect):
Now captures statistics for web sockets too.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadResourceSynchronously):
* loader/ResourceLoadObserver.cpp:
Now captures statistics for synchronous XHR too.
(WebCore::is3xxRedirect):
Convenience function.
(WebCore::ResourceLoadObserver::shouldLog):
Convenience function.
(WebCore::ResourceLoadObserver::logFrameNavigation):
Updated to make use of new convenience functions.
(WebCore::ResourceLoadObserver::logSubresourceLoading):
Updated to make use of new convenience functions.
(WebCore::ResourceLoadObserver::logWebSocketLoading):
Added.
(WebCore::ResourceLoadObserver::logUserInteraction):
Updated to make use of new convenience functions.
(WebCore::ResourceLoadObserver::primaryDomain):
Now makes use of the Public Suffix list.
Removed old custom parsing of primary domain.
* loader/ResourceLoadObserver.h:
* loader/ResourceLoadStatisticsStore.cpp:
(WebCore::ResourceLoadStatisticsStore::prevalentResourceDomainsWithoutUserInteraction):
Convenience function.
(WebCore::ResourceLoadStatisticsStore::processStatistics): Deleted.
* loader/ResourceLoadStatisticsStore.h:
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::willSendRequestInternal):
Moved logging call higher up and added a check for whether we
are loading the main resource. The reason for moving it up is
to capture the request before some data may be cleared out in
redirect handling. We also want to capture failed CORS requests
since they are sent and then cancelled on the way back.
2016-10-06 Adam Bergkvist <adam.bergkvist@ericsson.com>
WebRTC: Add support for the iceconnectionstatechange event in MediaEndpointPeerConnection
https://bugs.webkit.org/show_bug.cgi?id=162961
Reviewed by Eric Carlson.
Implement MediaEndpointPeerConnection's iceTransportStateChanged callback. When called, it
updates the ICE transport state of the corresponding transceiver and determines if the
RTCPeerConnection's aggregated iceConnectionState needs to be updated.
Update MediaEndpointMock's emulatePlatformEvent feature to support a new action:
"step-ice-transport-states". When initiated, this action replays a predefined set of ICE
transport state changes on a set of transceivers which can be observed via the
iceTransportStateChanged (mentioned above).
Test: fast/mediastream/RTCPeerConnection-iceconnectionstatechange-event.html
* Modules/mediastream/MediaEndpointPeerConnection.cpp:
(WebCore::deriveAggregatedIceConnectionState):
(WebCore::MediaEndpointPeerConnection::iceTransportStateChanged):
* Modules/mediastream/MediaEndpointPeerConnection.h:
* platform/mediastream/MediaEndpoint.h:
(WebCore::MediaEndpointClient::~MediaEndpointClient):
* platform/mock/MockMediaEndpoint.cpp:
(WebCore::MockMediaEndpoint::MockMediaEndpoint):
(WebCore::MockMediaEndpoint::emulatePlatformEvent):
(WebCore::MockMediaEndpoint::stepIceTransportStates):
(WebCore::MockMediaEndpoint::iceTransportTimerFired):
* platform/mock/MockMediaEndpoint.h:
2016-10-06 Youenn Fablet <youenn@apple.com>
CachedResource client handling methods should take reference
https://bugs.webkit.org/show_bug.cgi?id=163014
Reviewed by Alex Christensen.
No change of behavior.
* bindings/js/CachedScriptSourceProvider.h:
(WebCore::CachedScriptSourceProvider::~CachedScriptSourceProvider):
(WebCore::CachedScriptSourceProvider::CachedScriptSourceProvider):
* css/CSSCrossfadeValue.cpp:
(WebCore::CSSCrossfadeValue::~CSSCrossfadeValue):
(WebCore::CSSCrossfadeValue::loadSubimages):
* css/CSSFilterImageValue.cpp:
(WebCore::CSSFilterImageValue::~CSSFilterImageValue):
(WebCore::CSSFilterImageValue::loadSubimages):
* css/CSSFontFaceSource.cpp:
(WebCore::CSSFontFaceSource::CSSFontFaceSource):
(WebCore::CSSFontFaceSource::~CSSFontFaceSource):
* css/StyleRuleImport.cpp:
(WebCore::StyleRuleImport::~StyleRuleImport):
(WebCore::StyleRuleImport::requestStyleSheet):
* dom/DataTransfer.cpp:
(WebCore::DragImageLoader::startLoading):
(WebCore::DragImageLoader::stopLoading):
* dom/LoadableClassicScript.cpp:
(WebCore::LoadableClassicScript::create):
(WebCore::LoadableClassicScript::~LoadableClassicScript):
* dom/ProcessingInstruction.cpp:
(WebCore::ProcessingInstruction::~ProcessingInstruction):
(WebCore::ProcessingInstruction::checkStyleSheet):
(WebCore::ProcessingInstruction::parseStyleSheet):
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::~HTMLLinkElement):
(WebCore::HTMLLinkElement::process):
* loader/CrossOriginPreflightChecker.cpp:
(WebCore::CrossOriginPreflightChecker::~CrossOriginPreflightChecker):
(WebCore::CrossOriginPreflightChecker::startPreflight):
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::detachFromFrame):
(WebCore::DocumentLoader::clearMainResource):
(WebCore::DocumentLoader::becomeMainResourceClient):
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::~DocumentThreadableLoader):
(WebCore::DocumentThreadableLoader::clearResource):
(WebCore::DocumentThreadableLoader::loadRequest):
* loader/ImageLoader.cpp:
(WebCore::ImageLoader::~ImageLoader):
(WebCore::ImageLoader::clearImageWithoutConsideringPendingLoadEvent):
(WebCore::ImageLoader::updateFromElement):
(WebCore::ImageLoader::dispatchPendingBeforeLoadEvent):
* loader/LinkLoader.cpp:
(WebCore::LinkLoader::~LinkLoader):
(WebCore::LinkLoader::notifyFinished):
(WebCore::LinkLoader::loadLink):
* loader/LinkPreloadResourceClients.h:
(WebCore::LinkPreloadResourceClient::addResource):
(WebCore::LinkPreloadResourceClient::clearResource):
* loader/MediaResourceLoader.cpp:
(WebCore::MediaResource::MediaResource):
(WebCore::MediaResource::stop):
* loader/TextTrackLoader.cpp:
(WebCore::TextTrackLoader::~TextTrackLoader):
(WebCore::TextTrackLoader::cancelLoad):
(WebCore::TextTrackLoader::load):
* loader/cache/CachedCSSStyleSheet.cpp:
(WebCore::CachedCSSStyleSheet::didAddClient):
* loader/cache/CachedCSSStyleSheet.h:
* loader/cache/CachedFont.cpp:
(WebCore::CachedFont::didAddClient):
* loader/cache/CachedFont.h:
* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::didAddClient):
(WebCore::CachedImage::didRemoveClient):
* loader/cache/CachedImage.h:
* loader/cache/CachedRawResource.cpp:
(WebCore::CachedRawResource::didAddClient):
* loader/cache/CachedRawResource.h:
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::addClient):
(WebCore::CachedResource::didAddClient):
(WebCore::CachedResource::addClientToSet):
(WebCore::CachedResource::removeClient):
(WebCore::CachedResource::switchClientsToRevalidatedResource):
(WebCore::CachedResource::Callback::timerFired):
* loader/cache/CachedResource.h:
(WebCore::CachedResource::hasClient):
(WebCore::CachedResource::didRemoveClient):
* loader/cache/CachedSVGDocumentReference.cpp:
(WebCore::CachedSVGDocumentReference::~CachedSVGDocumentReference):
(WebCore::CachedSVGDocumentReference::load):
* loader/cache/CachedXSLStyleSheet.cpp:
(WebCore::CachedXSLStyleSheet::didAddClient):
* loader/cache/CachedXSLStyleSheet.h:
* loader/cache/MemoryCache.cpp:
(WebCore::MemoryCache::addImageToCache):
(WebCore::MemoryCache::removeImageFromCache):
* loader/icon/IconLoader.cpp:
(WebCore::IconLoader::startLoading):
(WebCore::IconLoader::stopLoading):
* platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp:
(WebCore::WebCoreAVCFResourceLoader::startLoading):
(WebCore::WebCoreAVCFResourceLoader::stopLoading):
* platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
(WebCore::WebCoreAVFResourceLoader::startLoading):
(WebCore::WebCoreAVFResourceLoader::stopLoading):
* rendering/RenderImageResource.cpp:
(WebCore::RenderImageResource::shutdown):
(WebCore::RenderImageResource::setCachedImage):
* rendering/RenderLayerFilterInfo.cpp:
(WebCore::RenderLayer::FilterInfo::updateReferenceFilterClients):
(WebCore::RenderLayer::FilterInfo::removeReferenceFilterClients):
* rendering/style/StyleCachedImage.cpp:
(WebCore::StyleCachedImage::addClient):
(WebCore::StyleCachedImage::removeClient):
* svg/SVGFEImageElement.cpp:
(WebCore::SVGFEImageElement::clearResourceReferences):
(WebCore::SVGFEImageElement::requestImageResource):
* svg/SVGFontFaceUriElement.cpp:
(WebCore::SVGFontFaceUriElement::~SVGFontFaceUriElement):
(WebCore::SVGFontFaceUriElement::loadFont):
* svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::~SVGUseElement):
(WebCore::SVGUseElement::updateExternalDocument):
* xml/XSLImportRule.cpp:
(WebCore::XSLImportRule::~XSLImportRule):
(WebCore::XSLImportRule::setXSLStyleSheet):
(WebCore::XSLImportRule::loadSheet):
* xml/parser/XMLDocumentParser.cpp:
(WebCore::XMLDocumentParser::notifyFinished):
* xml/parser/XMLDocumentParserLibxml2.cpp:
(WebCore::XMLDocumentParser::~XMLDocumentParser):
(WebCore::XMLDocumentParser::endElementNs):
2016-10-05 Philippe Normand <pnormand@igalia.com>
[GStreamer][OWR] GL rendering support
https://bugs.webkit.org/show_bug.cgi?id=162972
Reviewed by Žan Doberšek.
When GStreamer-GL is enabled the GL context needs to be properly passed
to the GStreamer pipeline running within the OpenWebRTC video renderer.
This is now supported using a new OpenWebRTC API that allows the
renderer to request the context from the application using a callback
registered within the renderer.
The player's GL context/display set-up was refactored to a new
method, requestGLContext, which is used as callback for the
OpenWebRTC request_context handler.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage):
(WebCore::MediaPlayerPrivateGStreamerBase::requestGLContext):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
(WebCore::MediaPlayerPrivateGStreamerBase::gstGLContext):
(WebCore::MediaPlayerPrivateGStreamerBase::gstGLDisplay):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.cpp:
(WebCore::MediaPlayerPrivateGStreamerOwr::createVideoSink):
2016-10-06 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Icon service and the IconButton class
https://bugs.webkit.org/show_bug.cgi?id=162970
<rdar://problem/28631803>
Reviewed by Dean Jackson.
We introduce the new IconButton class to display buttons that show an icon
in modern media controls. An IconButton uses a CSS mask-image to display the icon
such that we may set the actual button color to any value by setting the element's
background-color property.
Icons are obtained through the `iconService` singleton which knows how to load the
right icon for the current layout traits and resolution. Icons loaded through the
icon service are cached. In a later patch, we will be introducing functionality,
through the MediaControlsHost, to load the icon from the WebCore bundle.
Tests: media/modern-media-controls/icon-button/icon-button-active-state.html
media/modern-media-controls/icon-button/icon-button.html
media/modern-media-controls/icon-service/icon-service.html
* Modules/modern-media-controls/controls/button.css:
(button):
* Modules/modern-media-controls/controls/icon-button.css: Copied from Source/WebCore/Modules/modern-media-controls/controls/button.css.
(button.icon):
(button.icon:active):
* Modules/modern-media-controls/controls/icon-button.js: Added.
(IconButton):
(IconButton.prototype.get iconName):
(IconButton.prototype.set iconName):
(IconButton.prototype.handleEvent):
(IconButton.prototype.layout):
(IconButton.prototype._imageDidLoad):
(IconButton.prototype._updateImage):
* Modules/modern-media-controls/controls/icon-service.js: Copied from Source/WebCore/Modules/modern-media-controls/controls/layout-item.js.
(const.iconService.new.IconService):
(const.iconService.new.IconService.prototype.imageForIconNameAndLayoutTraits):
(const.iconService.new.IconService.prototype.urlForIconNameAndLayoutTraits):
* Modules/modern-media-controls/controls/layout-item.js:
* Modules/modern-media-controls/images/iOS/pause@2x.png: Added.
* Modules/modern-media-controls/images/iOS/pause@3x.png: Added.
* Modules/modern-media-controls/images/iOS/start@2x.png: Added.
* Modules/modern-media-controls/images/iOS/start@3x.png: Added.
* Modules/modern-media-controls/images/macOS/pause-fullscreen@1x.png: Added.
* Modules/modern-media-controls/images/macOS/pause-fullscreen@2x.png: Added.
* Modules/modern-media-controls/images/macOS/pause@1x.png: Added.
* Modules/modern-media-controls/images/macOS/pause@2x.png: Added.
* Modules/modern-media-controls/images/macOS/start@1x.png: Added.
* Modules/modern-media-controls/images/macOS/start@2x.png: Added.
2016-10-06 Miguel Gomez <magomez@igalia.com>
[GTK] Fix build with GSTREAMER_GL enabled and ACCELERATED_2D_CANVAS disabled
https://bugs.webkit.org/show_bug.cgi?id=163008
Reviewed by Carlos Garcia Campos.
Put functions using cairo-gl behind appropriate guards.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::paintToCairoSurface): Deleted.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
2016-10-06 Miguel Gomez <magomez@igalia.com>
[GTK] Copying video textures to webgl should not depend on cairo-gl
https://bugs.webkit.org/show_bug.cgi?id=162904
Reviewed by Žan Doberšek.
Perform the texture copy without using cairo-gl.
Covered by existent tests.
* platform/GStreamer.cmake:
Add the new VideoTextureCopierGStreamer class to the build.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::copyVideoTextureToPlatformTexture):
Use VideoTextureCopierGStreamer to perform the copy.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
Add a VideoTextureCopierGStreamer as a class attribute.
* platform/graphics/gstreamer/VideoTextureCopierGStreamer.cpp: Added.
(WebCore::VideoTextureCopierGStreamer::VideoTextureCopierGStreamer):
(WebCore::VideoTextureCopierGStreamer::~VideoTextureCopierGStreamer):
(WebCore::VideoTextureCopierGStreamer::updateTextureSpaceMatrix):
Recalculates the matrix used as the texture coordinates transformation.
(WebCore::VideoTextureCopierGStreamer::updateTransformationMatrix):
Recalculates the matrices used as the vertices coordinates transformation.
(WebCore::VideoTextureCopierGStreamer::copyVideoTextureToPlatformTexture):
Performs the texture copy by using a shader that applies the rotation needed to follow
the video orientation.
* platform/graphics/gstreamer/VideoTextureCopierGStreamer.h: Added.
2016-10-06 Gwang Yoon Hwang <yoon@igalia.com>
[GTK] Build fix for X11 and GStreamerGL after r183731
https://bugs.webkit.org/show_bug.cgi?id=163000
Reviewed by Philippe Normand.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
Include gstgldisplay_egl.h if platform uses EGL.
2016-10-06 Mario Sanchez Prada <mario@endlessm.com>
[GStreamer] Can't play any video with GSTREAMER_GL enabled
https://bugs.webkit.org/show_bug.cgi?id=162669
Reviewed by Philippe Normand.
Make sure an EGLDisplay type is passed when creating the GstGlDisplay
for the EGL code path, instead of a native X11 display type, so
that we get a valid GstGlDisplay as a result, not a dummy one.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext):
2016-10-06 Youenn Fablet <youenn@apple.com>
[Fetch API] Forbid redirection to non-HTTP(s) URL in non-navigation mode.
https://bugs.webkit.org/show_bug.cgi?id=162785
Reviewed by Alex Christensen.
Covered by rebased and existing tests.
Ensuring non-HTTP redirection URLs are not followed at DocumentThreadableLoader level for fetch API only.
This should be applied to all clients at some point, but there is still some uncertainty for data URLs.
Did some refactoring to better separate the case of security checks in case of regular request or redirected request.
This allows in particular to handle more clearly the case of data URLs which are allowed in all modes for regular requests.
But they are not allowed for same-origin redirected requests.
* WebCore.xcodeproj/project.pbxproj:
* loader/DocumentThreadableLoader.cpp:
(WebCore::reportRedirectionWithBadScheme): Reporting bad scheme redirection error.
(WebCore::DocumentThreadableLoader::redirectReceived): Checking that redirection URLs are HTTP(s) in case of Fetch API.
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::willSendRequestInternal):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::requestImage):
(WebCore::CachedResourceLoader::checkInsecureContent):
(WebCore::CachedResourceLoader::allowedByContentSecurityPolicy):
(WebCore::isSameOriginDataURL):
(WebCore::CachedResourceLoader::canRequest):
(WebCore::CachedResourceLoader::canRequestAfterRedirection):
(WebCore::CachedResourceLoader::canRequestInContentDispositionAttachmentSandbox):
(WebCore::CachedResourceLoader::requestResource):
* loader/cache/CachedResourceLoader.h:
2016-10-06 Youenn Fablet <youenn@apple.com>
[Fetch API] Use ReadableStream pull to transfer binary data to stream when application needs it
https://bugs.webkit.org/show_bug.cgi?id=162892
Reviewed by Alex Christensen.
Covered by existing tests.
Before this patch, FetchResponse was never resolving the start promise.
This way, it could enqueue data, error or close the stream whenever desired.
With this patch, FetchResponse will feed the stream when being asked to.
This allows keeping the data in WebCore until the application needs it.
This is only implemented for network data.
For other data owned by response (blob, text...), data will be enqueued like previously as fast as possible.
Note that FetchResponse can enqueue/error/close the stream at any time since JSFetchResponse has a reference to the stream.
And the stream has a reference to the controller.
In addition to transfer binary chunks to ReadableStream only when needed, WebCore is now aware of the data
stored in the response, which may allow applying backpressure to the network source in the future.
* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::BodyLoader::didSucceed):
(WebCore::FetchResponse::BodyLoader::didReceiveData): Enqueuing only if stream is pulling.
Otherwise, storing in FetchBodyConsumer. If stream is pulling, we enqueue both buffered data and received chunk.
(WebCore::FetchResponse::consumeBodyAsStream): Resolving pull promise if we enqueued some buffered data.
(WebCore::FetchResponse::closeStream):
(WebCore::FetchResponse::feedStream): If we have some buffered data, we enqueue it. If there is no loader, the stream can be closed.
* Modules/fetch/FetchResponse.h:
* Modules/fetch/FetchResponseSource.cpp:
(WebCore::FetchResponseSource::doPull):
(WebCore::FetchResponseSource::close):
(WebCore::FetchResponseSource::error):
* Modules/fetch/FetchResponseSource.h:
* Modules/streams/ReadableStreamSource.h:
(WebCore::ReadableStreamSource::isPulling): Renamed from isStarting.
(WebCore::ReadableStreamSource::isStarting): Deleted.
2016-10-06 Adam Bergkvist <adam.bergkvist@ericsson.com>
WebRTC: Add support for the icecandidate event in MediaEndpointPeerConnection
https://bugs.webkit.org/show_bug.cgi?id=162957
Reviewed by Eric Carlson.
Implement MediaEndpointPeerConnection's gotIceCandidate and doneGatheringCandidates
callbacks. These are used by the MediaEndpoint (WebRTC backend implementation) to
notify about ICE events.
Add API to Internals to emulate WebRTC platform events, such as dispatching a set of ICE
candidates followed by a gathering done indication. Initially, only a single action,
"dispatch-fake-ice-candidates", is supported, but the intention is to extend the set of
actions to support more test cases.
Test: fast/mediastream/RTCPeerConnection-icecandidate-event.html
* Modules/mediastream/MediaEndpointPeerConnection.cpp:
(WebCore::MediaEndpointPeerConnection::emulatePlatformEvent):
(WebCore::MediaEndpointPeerConnection::gotIceCandidate):
(WebCore::MediaEndpointPeerConnection::doneGatheringCandidates):
* Modules/mediastream/MediaEndpointPeerConnection.h:
* Modules/mediastream/PeerConnectionBackend.h:
* Modules/mediastream/RTCIceTransport.h: Added.
RTCIceCandidate will eventually be part of the JS API, but right now it's
only used to keep track of the ICE states related to a RTCRtpTranscevier.
(WebCore::RTCIceTransport::create):
(WebCore::RTCIceTransport::~RTCIceTransport):
(WebCore::RTCIceTransport::transportState):
(WebCore::RTCIceTransport::setTransportState):
(WebCore::RTCIceTransport::gatheringState):
(WebCore::RTCIceTransport::setGatheringState):
(WebCore::RTCIceTransport::RTCIceTransport):
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::emulatePlatformEvent):
* Modules/mediastream/RTCPeerConnection.h:
* Modules/mediastream/RTCRtpTransceiver.cpp:
(WebCore::RTCRtpTransceiver::RTCRtpTransceiver):
* Modules/mediastream/RTCRtpTransceiver.h:
(WebCore::RTCRtpTransceiver::iceTransport):
* WebCore.xcodeproj/project.pbxproj:
* platform/mediastream/MediaEndpoint.h:
(WebCore::MediaEndpoint::emulatePlatformEvent):
* platform/mediastream/PeerConnectionStates.h:
* platform/mock/MockMediaEndpoint.cpp:
(WebCore::MockMediaEndpoint::MockMediaEndpoint):
(WebCore::MockMediaEndpoint::updateReceiveConfiguration):
(WebCore::MockMediaEndpoint::emulatePlatformEvent):
(WebCore::MockMediaEndpoint::dispatchFakeIceCandidates):
(WebCore::MockMediaEndpoint::iceCandidateTimerFired):
* platform/mock/MockMediaEndpoint.h:
* testing/Internals.cpp:
(WebCore::Internals::emulateRTCPeerConnectionPlatformEvent):
Generic API to signal down to the WebRTC platform mock.
* testing/Internals.h:
* testing/Internals.idl:
2016-10-06 Nan Wang <n_wang@apple.com>
AX:[Mac] Unable to edit text input, textarea fields in iframe using VO naivgation
https://bugs.webkit.org/show_bug.cgi?id=162999
Reviewed by Chris Fleizach.
In WebKit1, the top web area setting the selection to an input element inside an iframe
will make the input field not editable. The issue is that when the web area and the input element
have different documents, the setSelection function in FrameSelection will set the selection on
the input's frame and cause the caret to disappear. I fixed it by not setting the selection in such case.
Test: accessibility/mac/wk1-set-selected-text-marker-range-input-element.html
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::setSelectedVisiblePositionRange):
2016-10-05 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r206845.
https://bugs.webkit.org/show_bug.cgi?id=162998
broke el capitan build (Requested by alexchristensen on
#webkit).
Reverted changeset:
"Add Display P3 ColorSpace"
https://bugs.webkit.org/show_bug.cgi?id=162880
http://trac.webkit.org/changeset/206845
2016-10-05 Youenn Fablet <youenn@apple.com>
Reuse CodeGenerator::UpdateFile in Tools CodeGenerator
https://bugs.webkit.org/show_bug.cgi?id=162960
Reviewed by Alex Christensen.
No change of behavior.
* bindings/scripts/CodeGenerator.pm:
(UpdateFile): Adding FIXME to enable lazy writing when feasible.
2016-10-05 Michael Catanzaro <mcatanzaro@igalia.com>
[SOUP] HostTLSCertificateSet should not use SHA-1 hashes to compare certificates
https://bugs.webkit.org/show_bug.cgi?id=162965
Reviewed by Carlos Garcia Campos.
Use SHA-256 instead.
No new tests, covered by TestSSL.
* platform/network/soup/SoupNetworkSession.cpp:
(WebCore::HostTLSCertificateSet::computeCertificateHash):
2016-10-05 Michael Catanzaro <mcatanzaro@igalia.com>
[GTK] Bump Chrome version in Chrome user agent quirk
https://bugs.webkit.org/show_bug.cgi?id=162984
Reviewed by Carlos Garcia Campos.
* platform/gtk/UserAgentGtk.cpp:
(WebCore::buildUserAgentString):
2016-10-05 Dean Jackson <dino@apple.com>
Add Display P3 ColorSpace
https://bugs.webkit.org/show_bug.cgi?id=162880
<rdar://problem/28598564>
Reviewed by Sam Weinig.
Add a new ColorSpace for Display P3.
This will be tested once the Color class can create
objects that reference other color spaces.
* platform/graphics/ColorSpace.h:
* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::displayP3ColorSpaceRef):
* platform/graphics/cg/GraphicsContextCG.h:
(WebCore::cachedCGColorSpace):
2016-10-05 Wenson Hsieh <wenson_hsieh@apple.com>
Introduce InputEvent bindings in preparation for the input events spec
https://bugs.webkit.org/show_bug.cgi?id=162954
Reviewed by Ryosuke Niwa.
Creates new bindings for InputEvent. Also introduces a runtime switch that allows Node to dispatch InputEvents
rather than generic events of type 'input'. Adds a new test verifying that when the switch is enabled, inputs
and contenteditable divs fire these new InputEvents on input. So far, only inputType is a part of the object
prototype, since we will be implementing this first. getTargetRanges() will follow once the finer details of
StaticRange are hashed out. See https://bugs.webkit.org/show_bug.cgi?id=162947 for more details.
Tests: fast/events/input-events-fired-when-typing.html
fast/events/ios/input-events-fired-when-typing-in-contenteditable.html
* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* dom/DOMAllInOne.cpp:
* dom/Event.cpp:
(WebCore::Event::composed):
(WebCore::Event::isInputEvent):
* dom/Event.h:
* dom/EventNames.in:
* dom/InputEvent.cpp: Added.
(WebCore::InputEvent::InputEvent):
* dom/InputEvent.h: Added.
* dom/InputEvent.idl: Added.
* dom/Node.cpp:
(WebCore::Node::dispatchInputEvent):
(WebCore::Node::defaultEventHandler):
* dom/Node.h:
* editing/Editor.cpp:
(WebCore::Editor::setBaseWritingDirection):
* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::dispatchFormControlInputEvent):
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::setEditingValue):
(WebCore::HTMLInputElement::setValueFromRenderer):
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::listBoxOnChange):
(WebCore::HTMLSelectElement::dispatchChangeEventForMenuList):
* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlTimelineElement::defaultEventHandler):
* page/Settings.in:
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::Backup::Backup):
(WebCore::InternalSettings::Backup::restoreTo):
* testing/InternalSettings.h:
* testing/InternalSettings.idl:
2016-10-05 Alex Christensen <achristensen@webkit.org>
URLParser should parse IPv4 addresses as the last two pieces of an IPv6 address
https://bugs.webkit.org/show_bug.cgi?id=162991
Reviewed by Saam Barati.
The last 32 bits of an IPv6 address can be written in the form of an IPv4 address,
but the syntax is stricter than if it were just an IPv4 address. There must be 4 pieces,
and each piece must be decimal (no octal or hex allowed). These should serialize to
regular hex IPv6 addresses.
Covered by new API tests.
* platform/URLParser.cpp:
(WebCore::URLParser::parseIPv4Piece):
(WebCore::URLParser::parseIPv4Host):
(WebCore::URLParser::parseIPv4PieceInsideIPv6):
(WebCore::URLParser::parseIPv4AddressInsideIPv6):
(WebCore::URLParser::parseIPv6Host):
(WebCore::URLParser::parseIPv4Number): Deleted.
* platform/URLParser.h:
2016-10-05 Myles C. Maxfield <mmaxfield@apple.com>
Put variation fonts work behind a compile-time flag
https://bugs.webkit.org/show_bug.cgi?id=162949
Reviewed by Simon Fraser.
No new tests because there is no behavior change.
* Configurations/FeatureDefines.xcconfig:
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::propertyValue):
* css/CSSFontVariationValue.cpp:
* css/CSSFontVariationValue.h:
* css/CSSPropertyNames.in:
* css/CSSValue.cpp:
(WebCore::CSSValue::equals):
(WebCore::CSSValue::cssText):
(WebCore::CSSValue::destroy):
* css/CSSValue.h:
(WebCore::CSSValue::isFontFeatureValue): Deleted.
(WebCore::CSSValue::isFontVariationValue): Deleted.
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertFontVariationSettings): Deleted.
* css/StyleBuilderCustom.h:
(WebCore::StyleBuilderCustom::applyInheritFontFeatureSettings): Deleted.
(WebCore::StyleBuilderCustom::applyInheritFontVariationSettings): Deleted.
* css/parser/CSSParser.cpp:
(WebCore::CSSParserContext::CSSParserContext):
(WebCore::operator==):
(WebCore::CSSParser::parseValue):
(WebCore::CSSParser::parseFontVariationSettings): Deleted.
* css/parser/CSSParserMode.h:
* page/Settings.in:
* page/animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
(WebCore::blendFunc): Deleted.
* platform/graphics/FontCache.h:
(WebCore::FontDescriptionKey::FontDescriptionKey):
(WebCore::FontDescriptionKey::operator==):
(WebCore::FontDescriptionKey::computeHash):
* platform/graphics/FontDescription.cpp:
* platform/graphics/FontDescription.h:
(WebCore::FontDescription::operator==):
(WebCore::FontDescription::setFeatureSettings): Deleted.
(WebCore::FontDescription::setVariationSettings): Deleted.
* platform/graphics/FontTaggedSettings.cpp:
(WebCore::operator<<): Deleted.
* platform/graphics/FontTaggedSettings.h:
(WebCore::FontVariationSettings::isEmpty):
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::preparePlatformFont):
* platform/graphics/cocoa/FontPlatformDataCocoa.mm:
(WebCore::cascadeToLastResortAndVariationsFontDescriptor):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::setFontVariationSettings): Deleted.
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::fontVariationSettings): Deleted.
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::Backup::Backup):
(WebCore::InternalSettings::Backup::restoreTo):
(WebCore::InternalSettings::variationFontsEnabled):
(WebCore::InternalSettings::setVariationFontsEnabled):
* testing/InternalSettings.h:
2016-10-05 Brent Fulgham <bfulgham@apple.com>
Unreviewed build fix after r206830
* platform/graphics/win/FontPlatformDataWin.cpp: Add missing include
when building with Direct2D.
2016-10-05 Brent Fulgham <bfulgham@apple.com>
[Win][Direct2D] Disable some CoreGraphics and CoreAnimation-based logic when building for D2D
https://bugs.webkit.org/show_bug.cgi?id=162977
Reviewed by Alex Christensen.
Currently the Direct2D implementation does not support some of the accelerated compositing
features that require CoreAnimation. During this bring-up, we want to disable these routines
so that we can build and run in (mostly) unaccelerated drawing.
This patch mostly consists of adding "#if USE(CG)" and "#if USE(CA)" to files that are
specific to those implementations.
This change should have no impact on non-Direct2D ports.
No change in behavior for active ports.
* config.h: Turn of CG when building in Direct2D.
* css/CSSFontFaceSource.cpp:
* loader/cache/CachedFont.cpp:
* loader/cache/CachedSVGFont.cpp:
* page/CaptionUserPreferencesMediaAF.cpp:
* page/win/FrameCGWin.cpp:
* page/win/FrameDirect2D.cpp: Added.
* platform/graphics/Font.cpp:
* platform/graphics/FontCache.cpp:
* platform/graphics/FontPlatformData.cpp:
* platform/graphics/GraphicsContext.h:
* platform/graphics/Image.cpp:
* platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.cpp:
* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
* platform/graphics/ca/GraphicsLayerCA.cpp:
* platform/graphics/ca/PlatformCALayer.cpp:
* platform/graphics/ca/TileController.cpp:
* platform/graphics/ca/TileGrid.cpp:
* platform/graphics/ca/TileGrid.h:
* platform/graphics/ca/win/CACFLayerTreeHost.cpp:
* platform/graphics/ca/win/LayerChangesFlusher.cpp:
* platform/graphics/ca/win/PlatformCAAnimationWin.cpp:
* platform/graphics/ca/win/PlatformCAAnimationWin.h:
* platform/graphics/ca/win/PlatformCAFiltersWin.cpp:
* platform/graphics/ca/win/PlatformCALayerWin.cpp:
* platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
* platform/graphics/ca/win/WKCACFViewLayerTreeHost.cpp:
* platform/graphics/ca/win/WebTiledBackingLayerWin.cpp:
* platform/graphics/cg/GradientCG.cpp:
* platform/graphics/cg/GraphicsContextCG.cpp:
* platform/graphics/cg/ImageBufferCG.cpp:
* platform/graphics/cg/ImageBufferDataCG.cpp:
* platform/graphics/cg/PDFDocumentImage.cpp:
* platform/graphics/cg/PatternCG.cpp:
* platform/graphics/cg/SubimageCacheWithTimer.cpp:
* platform/graphics/win/FontCGWin.cpp:
* platform/graphics/win/FontPlatformDataCGWin.cpp:
* platform/graphics/win/GlyphPageTreeNodeCGWin.cpp:
* platform/graphics/win/GlyphPageTreeNodeDirect2D.cpp:
* platform/graphics/win/GradientDirect2D.cpp:
* platform/graphics/win/PathDirect2D.cpp: Fix a few build problems I didn't notice
while building without Direct2D active.
* platform/graphics/win/SimpleFontDataCGWin.cpp:
* platform/graphics/win/SimpleFontDataWin.cpp:
* platform/win/DragImageCGWin.cpp:
* platform/win/DragImageDirect2D.cpp: Added.
* rendering/RenderMediaControls.cpp:
2016-10-05 Chris Dumez <cdumez@apple.com>
KeyboardEvent.getModifierState() should support "CapsLock" modifier
https://bugs.webkit.org/show_bug.cgi?id=162861
Reviewed by Darin Adler.
Add support for "CapsLock" modifier on Mac / iOS for KeyboardEvent's
getModifierState() API, as per:
- https://w3c.github.io/uievents/#dom-keyboardevent-getmodifierstate
No new tests, updated existing test.
* dom/KeyboardEvent.cpp:
(WebCore::KeyboardEvent::KeyboardEvent):
(WebCore::KeyboardEvent::getModifierState):
* dom/KeyboardEvent.h:
* platform/PlatformEvent.h:
* platform/ios/PlatformEventFactoryIOS.mm:
(WebCore::modifiersForEvent):
* platform/mac/PlatformEventFactoryMac.mm:
(WebCore::keyIdentifierForKeyEvent):
2016-10-05 Michael Catanzaro <mcatanzaro@igalia.com>
[GTK] Improve OS X UA quirk
https://bugs.webkit.org/show_bug.cgi?id=162613
Reviewed by Carlos Garcia Campos.
Include OS X version number in user agent, like Safari does.
* platform/gtk/UserAgentGtk.cpp:
(WebCore::buildUserAgentString):
2016-10-05 Michael Catanzaro <mcatanzaro@igalia.com>
[GTK] Improve comment in platformVersionForUAString
https://bugs.webkit.org/show_bug.cgi?id=162612
Reviewed by Carlos Garcia Campos.
* platform/gtk/UserAgentGtk.cpp:
(WebCore::platformVersionForUAString):
2016-10-05 Zalan Bujtas <zalan@apple.com>
Missing quotation mark when <q> gets reparented.
https://bugs.webkit.org/show_bug.cgi?id=162940
Reviewed by Darin Adler.
When an opening RenderQuote gets removed due to some change in the render tree,
we notify the closing RenderQuote so that it can update its content (") accordingly (and vice versa).
However when the same RenderQuote is added back to the render tree (aka reparenting), we fail to
let the other RenderQuote know about it and its content becomes stale.
This patch ensures that when either the opening or closing part of the quotation mark gets reparented,
we inform the other, corresponding opening/closing renderer about it.
Test: fast/css-generated-content/missing-quotes-with-dynamic-content.html
* dom/PseudoElement.cpp:
(WebCore::PseudoElement::didAttachRenderers):
* rendering/RenderQuote.cpp:
(WebCore::RenderQuote::insertedIntoTree):
* rendering/RenderQuote.h:
2016-10-05 Alex Christensen <achristensen@webkit.org>
URLParser should correctly strip unnecessary 0's in IPv6 addresses
https://bugs.webkit.org/show_bug.cgi?id=162979
Reviewed by Brady Eidson.
Covered by new API tests.
* platform/URLParser.cpp:
(WebCore::URLParser::parseIPv6Host):
Strip leading 0's and any 0's before the last 0 if the value is 0.
2016-10-05 Alex Christensen <achristensen@webkit.org>
UTF-8 encode queries of nonspecial and websocket schemes
https://bugs.webkit.org/show_bug.cgi?id=162956
Reviewed by Geoffrey Garen and Brady Eidson.
The URL spec says in the query state:
'If url is not special or url's scheme is either "ws" or "wss", set encoding to UTF-8.'
This should be determined as soon as we are done parsing the scheme.
Covered by new API tests.
This also fixes tests like fast/loader/javascript-url-encoding-2.html when URLParser is enabled.
* platform/URLParser.cpp:
(WebCore::isValidSchemeCharacter):
Renamed Scheme to ValidScheme so I can use Scheme as the name of an enum class in the same namespace.
(WebCore::isSpecial):
(WebCore::scheme):
Separate functionality so we can have different behavior for different sets of
ws and wss schemes, special, and non-special schemes.
(WebCore::URLParser::copyURLPartsUntil):
(WebCore::URLParser::parse):
Set isUTF8Encoding to true when we finish parsing the scheme if the scheme is ws, wss, or non-special,
according to spec. This also matches existing behavior. This way we will already know whether to go
into UTF8Query or NonUTF8Query state when we see a '?'.
(WebCore::isSpecialScheme): Deleted.
2016-10-05 Alex Christensen <achristensen@webkit.org>
Prepare to enable URLParser
https://bugs.webkit.org/show_bug.cgi?id=162974
Reviewed by Brady Eidson.
* platform/URL.cpp:
(WebCore::URL::serialize):
When we enable the URLParser, this attempt to make serialized URLs more spec compliant
won't be needed any more.
2016-10-05 Brent Fulgham <bfulgham@apple.com>
[Win][Direct2D] Add initial D2D Path and Gradient implementation
https://bugs.webkit.org/show_bug.cgi?id=162923
Reviewed by Alex Christensen.
This patch lands a set of new files that implements initial Path
and Gradient features on Windows using Direct2D.
No new tests until complete backend lands.
* platform/graphics/Gradient.h:
* platform/graphics/Path.cpp:
* platform/graphics/Path.h:
* platform/graphics/win/GradientDirect2D.cpp: Added.
* platform/graphics/win/PathDirect2D.cpp: Added.
2016-10-05 Romain Bellessort <romain.bellessort@crf.canon.fr>
[Readable Streams API] Align function names with spec
https://bugs.webkit.org/show_bug.cgi?id=162967
Reviewed by Darin Adler.
Align function names with spec. Behaviour was already in line with spec, but previous function names had
sometimes been preserved to track the changes more easily. This led to some inconsistencies (for instance,
enqueueInReadableStream was still used even though it works on a controller instead of a stream) and it
also made it more difficult to compare spec and implementation.
No change in behaviour.
* Modules/fetch/FetchInternals.js:
(consumeStream): Updated with new function names.
* Modules/fetch/FetchResponse.js:
(clone): Updated with new function names.
* Modules/streams/ReadableStream.js:
(tee): Updated with new function names.
* Modules/streams/ReadableStreamDefaultController.js:
(enqueue): Updated with new function names.
(error): Updated with new function names.
* Modules/streams/ReadableStreamDefaultReader.js:
(read): Updated with new function names.
* Modules/streams/ReadableStreamInternals.js:
(privateInitializeReadableStreamDefaultController): Updated with new function names.
(readableStreamDefaultControllerError): Updated with new function names.
(readableStreamTee): Updated with new function names.
(readableStreamTeePullFunction): Updated with new function names.
(readableStreamTeeBranch2CancelFunction): Updated with new function names.
(readableStreamError): Updated with new function names.
(readableStreamCancel): Updated with new function names.
(readableStreamDefaultControllerPull): Updated with new function names.
(readableStreamDefaultControllerClose): Updated with new function names.
(readableStreamClose): Updated with new function names.
(readableStreamDefaultControllerEnqueue): Updated with new function names.
(readableStreamDefaultReaderRead): Updated with new function names.
2016-10-05 Chris Dumez <cdumez@apple.com>
[Bindings] Declare dictionary / enumeration template specializations in the header
https://bugs.webkit.org/show_bug.cgi?id=162929
Reviewed by Darin Adler.
Declare dictionary / enumeration template specializations in the header
so that:
- They can be used from custom bindings code.
- Dictionaries / enumerations can be used to their own IDL files to
share them (Bug 162912).
No new tests, rebaselined bindings tests.
* WebCore.xcodeproj/project.pbxproj:
* bindings/generic/IDLTypes.h:
* bindings/js/JSDOMConvert.h:
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateInterface):
(GenerateEnumerationImplementationContent):
(GenerateEnumerationHeaderContent):
(GenerateDictionaryHeaderContent):
(GenerateHeader):
(GenerateCallbackHeader):
(GenerateCallbackImplementation):
(GenerateDefaultValue): Deleted.
(GenerateDictionaryImplementationContent): Deleted.
(GenerateParametersCheck): Deleted.
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestObj.h:
2016-10-05 Zan Dobersek <zdobersek@igalia.com>
Rename ENABLE_ENCRYPTED_MEDIA_V2 to ENABLE_LEGACY_ENCRYPTED_MEDIA
https://bugs.webkit.org/show_bug.cgi?id=162903
Reviewed by Alex Christensen.
Rename build guards for the remaining implementation of the legacy EME API
to ENABLE_LEGACY_ENCRYPTED_MEDIA. This will allow for the future implementation
of the near-finished API to be guarded with the simple ENABLE_ENCRYPTED_MEDIA guards.
No new tests -- no change in behavior.
* CMakeLists.txt:
* Configurations/FeatureDefines.xcconfig:
* DerivedSources.cpp:
* DerivedSources.make:
* Modules/encryptedmedia/CDM.cpp:
* Modules/encryptedmedia/CDM.h:
* Modules/encryptedmedia/CDMPrivate.h:
* Modules/encryptedmedia/CDMPrivateClearKey.cpp:
* Modules/encryptedmedia/CDMPrivateClearKey.h:
* Modules/encryptedmedia/CDMPrivateMediaPlayer.cpp:
* Modules/encryptedmedia/CDMPrivateMediaPlayer.h:
* Modules/encryptedmedia/CDMSessionClearKey.cpp:
* Modules/encryptedmedia/CDMSessionClearKey.h:
* Modules/encryptedmedia/MediaKeyMessageEvent.cpp:
* Modules/encryptedmedia/MediaKeyMessageEvent.h:
* Modules/encryptedmedia/MediaKeyMessageEvent.idl:
* Modules/encryptedmedia/MediaKeyNeededEvent.cpp:
* Modules/encryptedmedia/MediaKeyNeededEvent.h:
* Modules/encryptedmedia/MediaKeyNeededEvent.idl:
* Modules/encryptedmedia/MediaKeySession.cpp:
* Modules/encryptedmedia/MediaKeySession.h:
* Modules/encryptedmedia/MediaKeySession.idl:
* Modules/encryptedmedia/MediaKeys.cpp:
* Modules/encryptedmedia/MediaKeys.h:
* Modules/encryptedmedia/MediaKeys.idl:
* bindings/js/JSDictionary.cpp:
* bindings/js/JSDictionary.h:
* dom/Element.idl:
* dom/EventNames.in:
* dom/EventTargetFactory.in:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::~HTMLMediaElement):
(WebCore::HTMLMediaElement::webkitGenerateKeyRequest):
(WebCore::HTMLMediaElement::webkitAddKey):
* html/HTMLMediaElement.h:
* html/HTMLMediaElement.idl:
* html/MediaError.h:
* html/MediaError.idl:
* html/MediaKeyError.h:
* html/MediaKeyError.idl:
* page/Settings.h:
* platform/graphics/CDMSession.h:
* platform/graphics/MediaPlayer.cpp:
* platform/graphics/MediaPlayer.h:
* platform/graphics/MediaPlayerPrivate.h:
* platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.h:
* platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm:
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
* platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.cpp:
* platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.h:
* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
(WebCore::MediaPlayerPrivateAVFoundationCF::supportsKeySystem):
(WebCore::AVFWrapper::shouldWaitForLoadingOfResource):
* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h:
* platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.h:
* platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
* platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
* platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.h:
* platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
* platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h:
* platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::supportsKeySystem):
(WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource):
(WebCore::playerKVOProperties):
(-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
* platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::willProvideContentKeyRequestInitializationDataForTrackID):
(WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID):
* testing/Internals.cpp:
* testing/Internals.h:
* testing/Internals.idl:
* testing/MockCDM.cpp:
* testing/MockCDM.h:
2016-10-05 Daniel Bates <dabates@apple.com>
Do not follow redirects when sending violation report
https://bugs.webkit.org/show_bug.cgi?id=162520
<rdar://problem/27957639>
Reviewed by Alex Christensen.
Do not follow redirects when sending a Content Security Policy or XSS Auditor violation report
as redirects can be used to forward report details to a third-party.
This changes makes WebKit more closely conform to the reporting requirements in section Reporting
of the Content Security Level 2 standard: <https://w3c.github.io/webappsec-csp/2/#violation-reports>
(Editor's Draft, 25 April 2016).
Tests: http/tests/security/contentSecurityPolicy/report-blocked-uri-and-do-not-follow-redirect-when-sending-report.php
http/tests/security/xssAuditor/report-script-tag-and-do-not-follow-redirect-when-sending-report.html
http/tests/security/xssAuditor/report-script-tag-full-block-and-do-not-follow-redirect-when-sending-report.html
* loader/LoaderStrategy.h: Modified createPingHandle() to take a boolean, shouldFollowRedirects,
whether to follow redirect responses for a ping request.
* loader/PingLoader.cpp:
(WebCore::PingLoader::loadImage): Pass ShouldFollowRedirects::Yes to PingLoader::startPingLoad to
keep our current behavior.
(WebCore::PingLoader::sendPing): Ditto. Note our current behavior of following redirects matches
the behavior described in the section "Hyperlink auditing" of the HTML standard:
<https://html.spec.whatwg.org/multipage/semantics.html#hyperlink-auditing> (23 September 2016).
(WebCore::PingLoader::sendViolationReport): Pass ShouldFollowRedirects::No to PingLoader::startPingLoad
so that we do not follow redirects when sending a violation report.
(WebCore::PingLoader::startPingLoad): Modified to take argument shouldFollowRedirects whether to
follow redirect responses for a ping request.
* loader/PingLoader.h:
* platform/network/PingHandle.h: Add boolean m_shouldFollowRedirects. I grouped this boolean with
the existing boolean, m_shouldUseCredentialStorage, as opposed to appending to the end of the class
definition to avoid increasing object size as clang will coalesces the two bools into a single
machine word. Override ResourceHandleClient::willSendRequest() and ResourceHandleClient::willSendRequestAsync()
to follow a redirect, if applicable.
2016-10-05 Carlos Garcia Campos <cgarcia@igalia.com>
[SOUP] Move global TLS errors handling from ResourceHandle to SoupNetworkSession
https://bugs.webkit.org/show_bug.cgi?id=162910
Reviewed by Alex Christensen.
So that it will be shared with network session code. Also remove setHostAllowsAnyHTTPSCertificate() that we have
never actually used.
* platform/network/ResourceHandle.h:
* platform/network/soup/ResourceHandleSoup.cpp:
(WebCore::tlsErrorsChangedCallback): Use SoupNetworkSession::checkTLSErrors().
* platform/network/soup/SoupNetworkSession.cpp:
(WebCore::HostTLSCertificateSet::add):
(WebCore::HostTLSCertificateSet::contains):
(WebCore::HostTLSCertificateSet::computeCertificateHash):
(WebCore::clientCertificates):
(WebCore::SoupNetworkSession::setShouldIgnoreTLSErrors):
(WebCore::SoupNetworkSession::checkTLSErrors):
(WebCore::SoupNetworkSession::allowSpecificHTTPSCertificateForHost):
* platform/network/soup/SoupNetworkSession.h:
2016-10-05 Carlos Garcia Campos <cgarcia@igalia.com>
[SOUP] Move request HTTP body handling to ResourceRequestSoup and simplify it
https://bugs.webkit.org/show_bug.cgi?id=162891
Reviewed by Michael Catanzaro.
We are currently adding the HTTP body to the message in ResourceHandleSoup, but we could do it as part of the
ResourceRequest::updateSoupMessage() method, since the HTTP body is indeed part of the request. The code can be
also simplified, especially the handling of files, by using SharedBuffer that already mmaps the file when
possible, instead of using GMappedFile API.
* platform/SharedBuffer.h: Add createSoupBuffer() method.
* platform/network/soup/ResourceHandleSoup.cpp:
(WebCore::createSoupMessageForHandleAndRequest):
(WebCore::milisecondsSinceRequest): Deleted.
(WebCore::ResourceHandle::didStartRequest): Deleted.
(WebCore::startingCallback): Deleted.
(WebCore::networkEventCallback): Deleted.
(WebCore::ResourceHandle::start): Deleted.
(WebCore::ResourceHandle::releaseForDownload): Deleted.
(WebCore::ResourceHandle::timeoutFired): Deleted.
* platform/network/soup/ResourceRequest.h:
* platform/network/soup/ResourceRequestSoup.cpp:
(WebCore::appendEncodedBlobItemToSoupMessageBody): Helper method to append the blob to the request message body.
(WebCore::ResourceRequest::updateSoupMessageBody): Add HTTPBody to the request message body.
(WebCore::ResourceRequest::updateSoupMessage): Call updateSoupMessageBody() to also update the body.
* platform/soup/SharedBufferSoup.cpp:
(WebCore::SharedBuffer::createSoupBuffer): Returns a new SoupBuffer for the SharedBuffer.
2016-10-04 Chris Dumez <cdumez@apple.com>
Implement KeyboardEvent.code from the UI Event spec
https://bugs.webkit.org/show_bug.cgi?id=149584
Reviewed by Darin Adler.
Add support for Keyboard.code attribute:
- https://w3c.github.io/uievents/#dom-keyboardevent-code
- https://w3c.github.io/uievents-code/
The feature is only enabled on Mac for now as the implementation is
platform-specific and Mac only.
Test: fast/events/keyboardevent-code.html
* dom/KeyboardEvent.cpp:
(WebCore::KeyboardEvent::KeyboardEvent):
* dom/KeyboardEvent.h:
* dom/KeyboardEvent.idl:
* platform/PlatformKeyboardEvent.h:
(WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
(WebCore::PlatformKeyboardEvent::code):
(WebCore::PlatformKeyboardEvent::unmodifiedText): Deleted.
* platform/mac/PlatformEventFactoryMac.h:
* platform/mac/PlatformEventFactoryMac.mm:
(WebCore::codeForKeyEvent):
(WebCore::keyIdentifierForKeyEvent):
* replay/SerializationMethods.cpp:
(JSC::EncodingTraits<PlatformKeyboardEvent>::encodeValue):
(JSC::EncodingTraits<PlatformKeyboardEvent>::decodeValue):
2016-10-04 Said Abou-Hallawa <sabouhallawa@apple.com>
The dragged image should be the current frame only of the animated image
https://bugs.webkit.org/show_bug.cgi?id=162109
Reviewed by Tim Horton.
Instead of creating an NSImage with all the frames for the dragImage,
create an NSImage with the current frame only.
* dom/DataTransferMac.mm:
(WebCore::DataTransfer::createDragImage): Call snapshotNSImage() to create the dragImage.
* editing/cocoa/HTMLConverter.mm:
(fileWrapperForElement): Call the Image function with its new name.
* platform/graphics/BitmapImage.h:
* platform/graphics/Image.h:
(WebCore::Image::nsImage): Rename getNSImage() to nsImage().
(WebCore::Image::snapshotNSImage): Returns the NSImage of the current frame.
(WebCore::Image::tiffRepresentation): Rename getTIFFRepresentation() to tiffRepresentation().
(WebCore::Image::getNSImage): Deleted.
(WebCore::Image::getTIFFRepresentation): Deleted.
* platform/graphics/mac/ImageMac.mm:
(WebCore::BitmapImage::tiffRepresentation): Rename getTIFFRepresentation() to tiffRepresentation().
(WebCore::BitmapImage::nsImage): Rename getNSImage() to nsImage().
(WebCore::BitmapImage::snapshotNSImage): Returns the NSImage of the current frame.
(WebCore::BitmapImage::getTIFFRepresentation): Deleted.
(WebCore::BitmapImage::getNSImage): Deleted.
* platform/mac/CursorMac.mm:
(WebCore::createCustomCursor): Call snapshotNSImage() since the cursor does not animate anyway.
* platform/mac/DragImageMac.mm:
(WebCore::createDragImageFromImage): Use snapshotNSImage() for the dragImage.
* platform/mac/PasteboardMac.mm:
(WebCore::Pasteboard::write): Call the Image function with its new name.
2016-10-04 Andy Estes <aestes@apple.com>
[iOS] Crash in WebResourceLoaderQuickLookDelegate when the client cancels the navigation to a QuickLook resource
https://bugs.webkit.org/show_bug.cgi?id=162950
<rdar://problem/23759114>
Reviewed by Brady Eidson.
When we receive data from QLPreviewConverter for the first time, we call
ResourceLoader::didReceiveResponse() with the preview NSURLResponse from QuickLook. If the
client decides to cancel this navigation in decidePolicyForResponse(),
WebResourceLoaderQuickLookDelegate will end up with a null _resourceLoader after
didReceiveResponse() returns. This change adds null checks in the methods that use
_resourceLoader after calling -_sendDidReceiveResponseIfNecessary.
New API test: QuickLook.CancelNavigationAfterResponse
* platform/network/ios/QuickLook.mm:
(-[WebResourceLoaderQuickLookDelegate connection:didReceiveDataArray:]): Changed to only
call ResourceLoader::didReceiveDataArray() if _resourceLoader is non-null.
(-[WebResourceLoaderQuickLookDelegate connection:didReceiveData:lengthReceived:]): Ditto for
ResourceLoader::didReceiveData().
(-[WebResourceLoaderQuickLookDelegate connection:didFailWithError:]): Ditto for
ResourceLoader::didFail().
2016-10-04 Chris Dumez <cdumez@apple.com>
Add support for KeyboardEvent.isComposing attribute
https://bugs.webkit.org/show_bug.cgi?id=162921
Reviewed by Darin Adler.
Add support for KeyboardEvent.isComposing attribute:
- https://www.w3.org/TR/uievents/#dom-keyboardevent-iscomposing
- https://www.w3.org/TR/uievents/#ref-for-dom-keyboardevent-iscomposing-3
Manual test: https://jsfiddle.net/ay92sr08/9/
No new tests, extended existing tests.
* dom/KeyboardEvent.cpp:
(WebCore::KeyboardEvent::KeyboardEvent):
* dom/KeyboardEvent.h:
* dom/KeyboardEvent.idl:
2016-10-03 Ryosuke Niwa <rniwa@webkit.org>
ShadowRoot interface should have elementFromPoint
https://bugs.webkit.org/show_bug.cgi?id=162882
Reviewed by Chris Dumez.
Add elementFromPoint to ShadowRoot's prototype as specified at:
https://www.w3.org/TR/shadow-dom/#extensions-to-the-documentorshadowroot-mixin
with changes proposed at https://github.com/w3c/csswg-drafts/issues/556
Added TreeScope::retargetToScope which implements
This patch also factors DocumentOrShadowRoot.idl out of Document and ShadowRoot interfaces to better match
the latest DOM specification: https://dom.spec.whatwg.org/#mixin-documentorshadowroot
Test: fast/shadow-dom/Document-prototype-elementFromPoint.html
* CMakeLists.txt:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* dom/Document.cpp:
(WebCore::Document::nodeFromPoint): Moved to TreeScope.
(WebCore::Document::elementFromPoint): Moved to TreeScope.
* dom/Document.h:
* dom/Document.idl: Moved elementFromPoint and activeElement to DocumentOrShadowRoot.idl.
* dom/DocumentOrShadowRoot.idl: Added.
* dom/EventPath.cpp:
(WebCore::RelatedNodeRetargeter::checkConsistency): Use newly added TreeScope::retargetToScope.
* dom/ShadowRoot.idl: Moved activeElement to DocumentOrShadowRoot.idl.
* dom/TreeScope.cpp:
(WebCore::TreeScope::retargetToScope): Added. Implements https://dom.spec.whatwg.org/#retarget efficiently.
Instead of checking whether A (node) is a shadow-including inclusive ancestor of B (this scope) at each
parent, find the lowest ancestor which contains both A and B, and return the self-inclusive ancestor of B
in that tree. To find the lowest common ancestor in O(n), traverse all ancestors of A and B separately and
do a top-down traversal. The last tree scope in which A's ancestor and B's ancestor match is the lowest
common ancestor.
(WebCore::TreeScope::nodeFromPoint): Moved from Document.
(WebCore::TreeScope::elementFromPoint): Moved from Document. Use retargetToScope and parentInComposedTree
instead of parentNode and ancestorInThisScope to match the semantics proposed in
https://github.com/w3c/csswg-drafts/issues/556
* dom/TreeScope.h:
2016-10-04 Myles C. Maxfield <mmaxfield@apple.com>
font-family: cursive should map to KaiTi in Chinese
https://bugs.webkit.org/show_bug.cgi?id=162889
<rdar://problem/28363547>
Reviewed by Tim Horton.
According to Bobby Tung, this is a better mapping. Previously, we were
relying on the system fallback mechanism. However, an explicit mapping
is more robust.
Test: fast/text/cursive-zh.html
* page/cocoa/SettingsCocoa.mm:
(WebCore::Settings::initializeDefaultFontFamilies):
2016-10-04 Alex Christensen <achristensen@webkit.org>
URLParser: query-only URLs relative to file URLs should just add a query
https://bugs.webkit.org/show_bug.cgi?id=162888
Reviewed by Tim Horton.
Covered by new API tests.
* platform/URLParser.cpp:
(WebCore::URLParser::parse):
Like bug 206749 but with queries instead of fragments.
2016-10-04 Alex Christensen <achristensen@webkit.org>
URLParser should match URL::parse and other browsers when parsing a URL containing only scheme://
https://bugs.webkit.org/show_bug.cgi?id=162909
Reviewed by Tim Horton.
If there's no host in this case we shouldn't fail, but rather make a valid URL with the // in the path.
This matches Chrome, Firefox, and Safari's behavior.
Covered by API tests.
* platform/URLParser.cpp:
(WebCore::URLParser::parse):
2016-10-04 Brent Fulgham <bfulgham@apple.com>
Unreviewed build fix after r206773.
Exclude Direct2D definitions when building for normal CG Windows.
* platform/graphics/GraphicsContext.h:
2016-10-04 Yusuke Suzuki <utatane.tea@gmail.com>
[DOMJIT] Introduce DOMJIT::GetterSetter to tell JIT information
https://bugs.webkit.org/show_bug.cgi?id=162916
Reviewed by Filip Pizlo.
* ForwardingHeaders/domjit/DOMJITGetterSetter.h: Added.
* PlatformEfl.cmake:
* PlatformGTK.cmake:
* PlatformMac.cmake:
* PlatformWin.cmake:
2016-10-04 Chris Dumez <cdumez@apple.com>
Return null when window.open() is popup blocked
https://bugs.webkit.org/show_bug.cgi?id=162897
Reviewed by Michael Catanzaro.
The return value of window.open() when the popup is blocked should be null:
- https://github.com/whatwg/html/pull/1854
- https://github.com/whatwg/html/issues/1851
Firefox / Edge return null.
No new tests, rebaselined existing tests.
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::open):
2016-10-04 Chris Dumez <cdumez@apple.com>
[Web IDL] Add support for dictionary inheritance
https://bugs.webkit.org/show_bug.cgi?id=162907
Reviewed by Sam Weinig.
Add support for dictionary inheritance to our Web IDL parser and
bindings generator. Leverage this new support for EventTarget's
EventListenerOptions / AddEventListenerOptions dictionaries, in
order to match the DOM specification:
- https://dom.spec.whatwg.org/#interface-eventtarget
Also update the bindings generator to convert the dictionary
members in lexicographical order, as per:
- https://heycam.github.io/webidl/#es-dictionary (Step 5.1)
No new tests, rebaselined bindings tests.
* bindings/scripts/CodeGenerator.pm:
(GetDictionaryByName):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateDictionaryImplementationContent):
* bindings/scripts/IDLParser.pm:
(parseDictionary):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::convertDictionary<TestObj::Dictionary>):
(WebCore::convertDictionary<TestObj::DictionaryThatShouldNotTolerateNull>):
(WebCore::convertDictionary<TestObj::DictionaryThatShouldTolerateNull>):
(WebCore::convertDictionary<AlternateDictionaryName>):
(WebCore::convertDictionary<TestObj::ParentDictionary>):
(WebCore::convertDictionary<TestObj::ChildDictionary>):
* bindings/scripts/test/TestObj.idl:
* dom/EventTarget.idl:
2016-10-04 Brent Fulgham <bfulgham@apple.com>
[Win][Direct2D] Add initial D2D GraphicsContext implementation
https://bugs.webkit.org/show_bug.cgi?id=162917
Reviewed by Dean Jackson.
This patch lands a set of new files that implement the GraphicsContext
features on Windows using Direct2D.
No new tests until complete backend lands.
* platform/graphics/Color.h: Add new casting operator.
* platform/graphics/FloatSize.h: Ditto.
* platform/graphics/GraphicsContext.cpp: Update for Direct2D
implementation.
* platform/graphics/GraphicsContext.h:
* platform/graphics/win/ColorDirect2D.cpp:
(WebCore::Color::operator D2D1_VECTOR_4F): Added.
* platform/graphics/win/GraphicsContextCGWin.cpp: Add compiler
guard to avoid building when using Direct2D.
* platform/graphics/win/GraphicsContextDirect2D.cpp: Added.
* platform/graphics/win/GraphicsContextPlatformPrivateDirect2D.h: Added.
* platform/graphics/win/GraphicsContextWin.cpp: Update for Direct2D
includes.
* platform/graphics/win/TransformationMatrixDirect2D.cpp: Fix comment.
2016-10-04 Carlos Garcia Campos <cgarcia@igalia.com>
[SOUP] Remove SSLPolicyFlags from SoupNetworkSession
https://bugs.webkit.org/show_bug.cgi?id=162906
Reviewed by Michael Catanzaro.
All soup based ports are setting SSLUseSystemCAFile flag unconditionally, so we can just use that when creating
the session like we do for all other construct parameters.
* platform/network/soup/SoupNetworkSession.cpp:
(WebCore::SoupNetworkSession::createTestingSession):
(WebCore::SoupNetworkSession::setupLogger):
(WebCore::SoupNetworkSession::SoupNetworkSession): Deleted.
(WebCore::SoupNetworkSession::clearOldSoupCache): Deleted.
(WebCore::SoupNetworkSession::setHTTPProxy): Deleted.
* platform/network/soup/SoupNetworkSession.h:
(WebCore::SoupNetworkSession::soupSession): Deleted.
2016-10-04 Wenson Hsieh <wenson_hsieh@apple.com>
Media controls are displayed in the incorrect state momentarily after switching between tabs playing media
https://bugs.webkit.org/show_bug.cgi?id=162766
<rdar://problem/28533523>
Reviewed by Jer Noble.
When showing Now Playing controls for a media session, we should first set up the Now Playing info and
playback state before telling MediaRemote to make the session visible. This is WebKit work in ensuring that
when switching Now Playing sessions by switching tabs, we do not first display an invalid Now Playing state
before updating to the expected state.
Adds 2 new WebKit API tests in NowPlayingControlsTests: NowPlayingControlsHideAfterShowingClearsInfo and
NowPlayingControlsClearInfoAfterSessionIsNoLongerValid.
* platform/audio/PlatformMediaSessionManager.h:
(WebCore::PlatformMediaSessionManager::lastUpdatedNowPlayingTitle):
(WebCore::PlatformMediaSessionManager::lastUpdatedNowPlayingDuration):
(WebCore::PlatformMediaSessionManager::lastUpdatedNowPlayingElapsedTime):
(WebCore::PlatformMediaSessionManager::hasActiveNowPlayingSession): Deleted.
* platform/audio/mac/MediaSessionManagerMac.h:
* platform/audio/mac/MediaSessionManagerMac.mm:
(WebCore::MediaSessionManagerMac::updateNowPlayingInfo):
2016-10-04 Youenn Fablet <youenn@apple.com>
[Fetch API] ReadableStream should be errored with TypeError values
https://bugs.webkit.org/show_bug.cgi?id=162895
Reviewed by Alex Christensen.
Test: imported/w3c/web-platform-tests/fetch/api/basic/error-after-response.html
* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::BodyLoader::didFail): Removing FIXME.
* bindings/js/ReadableStreamDefaultController.h:
(WebCore::ReadableStreamDefaultController::error<String>): Erroring with TypeError values.
2016-10-03 Chris Dumez <cdumez@apple.com>
Bindings do not throw a TypeError if a required dictionary member is missing
https://bugs.webkit.org/show_bug.cgi?id=162734
Reviewed by Geoffrey Garen.
Bindings should throw a TypeError if a required dictionary member is missing.
For example, if there is a "required long id" member in a dictionary that is
missing, our bindings would prevously pass 0 to the implementation instead
of throwing a TypeError.
Relevant specification:
- https://heycam.github.io/webidl/#es-dictionary
I aligned our bindings generator implementation with the specification,
except for the support for dictionary inheritance that is still missing
and will be addressed in a follow-up patch.
No new tests, I rebaselined the bindings tests and this is already covered
by fast/events/touch/touch-constructor.html on iOS.
* bindings/js/JSCustomElementRegistryCustom.cpp:
(WebCore::JSCustomElementRegistry::define):
* bindings/js/JSDOMConvert.h:
(WebCore::convert): Deleted.
(WebCore::Converter<bool>::convert): Deleted.
(WebCore::Converter<String>::convert): Deleted.
(WebCore::Converter<IDLDOMString>::convert): Deleted.
(WebCore::Converter<IDLUSVString>::convert): Deleted.
(WebCore::Converter<JSC::JSValue>::convert): Deleted.
(WebCore::Converter<int8_t>::convert): Deleted.
(WebCore::Converter<uint8_t>::convert): Deleted.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateDictionaryImplementationContent):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::convertDictionary<TestObj::Dictionary>):
(WebCore::convertDictionary<TestObj::DictionaryThatShouldNotTolerateNull>):
(WebCore::convertDictionary<TestObj::DictionaryThatShouldTolerateNull>):
(WebCore::convertDictionary<AlternateDictionaryName>):
2016-10-03 Zalan Bujtas <zalan@apple.com>
[ListItems] Render tree should be all clean by the end of FrameView::layout().
https://bugs.webkit.org/show_bug.cgi?id=162832
Reviewed by Simon Fraser.
List item markers are inserted into the tree during layout, right before laying out
the list item (that's a big FIXME). At this point we already know what part of the tree
needs to be laid out. Inserting a list item marker does not expand this dirty area.
However whenever we insert a new renderer into the tree, we call setNeedsLayout on the contining block chain.
In certain cases (floating renderers), it could potentially trigger some unintentional markings
and we return from FrameView::layout() with a dirty subtree.
This patch preemptively marks the list item and its marker dirty so that
when the marker is getting inserted into the tree, we stop the marking at the parent.
Not testable.
* rendering/RenderListItem.cpp:
(WebCore::RenderListItem::insertOrMoveMarkerRendererIfNeeded):
2016-10-03 Myles C. Maxfield <mmaxfield@apple.com>
Implement rendering of font-variation-settings
https://bugs.webkit.org/show_bug.cgi?id=162782
Reviewed by Zalan Bujtas.
(Re-landing after fixing tests.)
Because the heavy lifting for font-variation-settings is done by CoreText,
this patch is fairly minimal. It simply hooks up the CSS property to CoreText.
There is an existing bug in CoreText where variations inside fonts do not
survive the addition of a cascade list. Therefore, FontPlatformData::ctFont()
needs to work around this (conditionally) by resupplying the variation at
the same time as the cascade list. The CoreText bug is <rdar://problem/28449441>.
Tests: fast/text/variations/duplicate.html
fast/text/variations/exist.html
fast/text/variations/inheritance.html
fast/text/variations/order.html
fast/text/variations/outofbounds.html
* platform/graphics/FontCache.h:
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::preparePlatformFont):
(WebCore::fontWithFamily):
(WebCore::FontCache::createFontPlatformData):
(WebCore::FontCache::systemFallbackForCharacters):
* platform/graphics/cocoa/FontPlatformDataCocoa.mm:
(WebCore::cascadeToLastResortAttributesDictionary):
(WebCore::cascadeToLastResortAndVariationsFontDescriptor):
(WebCore::FontPlatformData::ctFont):
(WebCore::cascadeToLastResortFontDescriptor): Deleted.
* platform/graphics/mac/FontCustomPlatformData.cpp:
(WebCore::FontCustomPlatformData::fontPlatformData):
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::updateCachedSystemFontDescription):
2016-10-03 Alex Christensen <achristensen@webkit.org>
URLParser should strip tabs at all locations
https://bugs.webkit.org/show_bug.cgi?id=162836
Reviewed by Geoffrey Garen.
Covered by adding tabs to each location of each API test
except tests that test the encoding of surrogate pairs,
because inserting a tab between the pairs changes the encoding.
* platform/URLParser.cpp:
(WebCore::URLParser::takesTwoAdvancesUntilEnd):
(WebCore::URLParser::parse):
(WebCore::URLParser::parseIPv4Number):
(WebCore::URLParser::parseIPv4Host):
* platform/URLParser.h:
2016-10-03 Antti Koivisto <antti@apple.com>
Remove Document::elementSheet()
https://bugs.webkit.org/show_bug.cgi?id=162876
Reviewed by Andreas Kling.
This is a Document owned stylesheet that exists as a context for parsing element inline style.
It never contains any rules and is generally confusing.
This patch removes the requirement for a stylesheet to be present for CSSParser to operate in
the correct context. Inline style is now parsed without stylesheet and a context object is
passed instead.
* bindings/js/JSCSSStyleDeclarationCustom.cpp:
(WebCore::root):
* bindings/js/JSCSSStyleDeclarationCustom.h:
(WebCore::root): Deleted.
* css/PropertySetCSSStyleDeclaration.cpp:
(WebCore::PropertySetCSSStyleDeclaration::setCssText):
(WebCore::PropertySetCSSStyleDeclaration::setProperty):
(WebCore::PropertySetCSSStyleDeclaration::setPropertyInternal):
(WebCore::PropertySetCSSStyleDeclaration::cssParserContext):
(WebCore::StyleRuleCSSStyleDeclaration::parentStyleSheet):
(WebCore::StyleRuleCSSStyleDeclaration::cssParserContext):
(WebCore::InlineCSSStyleDeclaration::parentStyleSheet):
(WebCore::InlineCSSStyleDeclaration::cssParserContext):
* css/PropertySetCSSStyleDeclaration.h:
(WebCore::PropertySetCSSStyleDeclaration::didMutate): Deleted.
* css/StyleProperties.cpp:
(WebCore::MutableStyleProperties::setProperty):
(WebCore::MutableStyleProperties::setCustomProperty):
(WebCore::MutableStyleProperties::parseDeclaration):
* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parseValue):
(WebCore::CSSParser::parseCustomPropertyValue):
(WebCore::CSSParser::parseInlineStyleDeclaration):
* css/parser/CSSParser.h:
* css/parser/CSSParserImpl.cpp:
(WebCore::CSSParserImpl::parseInlineStyleDeclaration):
* dom/Document.cpp:
(WebCore::Document::~Document):
(WebCore::Document::updateBaseURL):
(WebCore::Document::usesStyleBasedEditability):
(WebCore::Document::setHasElementUsingStyleBasedEditability):
(WebCore::Document::elementSheet): Deleted.
* dom/Document.h:
* dom/StyledElement.cpp:
(WebCore::StyledElement::setInlineStyleFromString):
(WebCore::StyledElement::invalidateStyleAttribute):
The usesStyleBasedEditability bit used to be set via the elementSheet. Instead check for it after inline style mutations.
(WebCore::StyledElement::setInlineStyleProperty):
(WebCore::StyledElement::addPropertyToPresentationAttributeStyle):
* dom/StyledElement.h:
(WebCore::StyledElement::invalidateStyleAttribute): Deleted.
* inspector/InspectorStyleSheet.cpp:
(WebCore::InspectorStyleSheetForInlineStyle::getStyleAttributeRanges):
* svg/SVGAnimateElementBase.cpp:
(WebCore::applyCSSPropertyToTarget):
2016-10-03 Brent Fulgham <bfulgham@apple.com>
Avoid null dereference when changing focus in design mode.
https://bugs.webkit.org/show_bug.cgi?id=162877
<rdar://problem/28061261>
Reviewed by Chris Dumez.
The bare m_frame pointer in DOMWindow can be cleared when setting focus to a new element. Check
that the m_frame pointer is non-null before using it after calling a routine that could
clear the pointer value.
Test: fast/frames/iframe-focus-crash.html
* page/DOMWindow.cpp:
(WebCore::DOMWindow::focus): Check that the pointer is still non-null after setting the
current focused element to nullptr.
2016-10-03 Chris Dumez <cdumez@apple.com>
Add support for KeyboardEvent.key attribute
https://bugs.webkit.org/show_bug.cgi?id=36267
Reviewed by Darin Adler.
Add support for KeyboardEvent.key attribute:
- https://w3c.github.io/uievents/#dom-keyboardevent-key
This is behind a compile time flag that is only enabled on Mac and
iOS and the implementation is still missing for other platforms.
Test: fast/events/keyboardevent-key.html
* dom/KeyboardEvent.cpp:
(WebCore::KeyboardEvent::KeyboardEvent):
* dom/KeyboardEvent.h:
* dom/KeyboardEvent.idl:
* platform/PlatformKeyboardEvent.h:
(WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
(WebCore::PlatformKeyboardEvent::key):
* platform/cocoa/KeyEventCocoa.h:
* platform/cocoa/KeyEventCocoa.mm:
(WebCore::keyForCharCode):
* platform/ios/PlatformEventFactoryIOS.h:
* platform/ios/PlatformEventFactoryIOS.mm:
(WebCore::keyForKeyEvent):
(WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder):
* platform/mac/PlatformEventFactoryMac.h:
* platform/mac/PlatformEventFactoryMac.mm:
(WebCore::keyForKeyEvent):
(WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder):
(WebCore::PlatformWheelEventBuilder::PlatformWheelEventBuilder): Deleted.
* replay/SerializationMethods.cpp:
(JSC::EncodingTraits<PlatformKeyboardEvent>::encodeValue):
(JSC::EncodingTraits<PlatformKeyboardEvent>::decodeValue):
2016-10-03 Chris Dumez <cdumez@apple.com>
Add support for KeyboardEvent.key attribute
https://bugs.webkit.org/show_bug.cgi?id=36267
Reviewed by Darin Adler.
Add support for KeyboardEvent.key attribute:
- https://w3c.github.io/uievents/#dom-keyboardevent-key
This is behind a compile time flag that is only enabled on Mac and
iOS and the implementation is still missing for other platforms.
Test: fast/events/keyboardevent-key.html
* dom/KeyboardEvent.cpp:
(WebCore::KeyboardEvent::KeyboardEvent):
* dom/KeyboardEvent.h:
* dom/KeyboardEvent.idl:
* platform/PlatformKeyboardEvent.h:
(WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
(WebCore::PlatformKeyboardEvent::key):
* platform/cocoa/KeyEventCocoa.h:
* platform/cocoa/KeyEventCocoa.mm:
(WebCore::keyForCharCode):
* platform/ios/PlatformEventFactoryIOS.h:
* platform/ios/PlatformEventFactoryIOS.mm:
(WebCore::keyForKeyEvent):
(WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder):
* platform/mac/PlatformEventFactoryMac.h:
* platform/mac/PlatformEventFactoryMac.mm:
(WebCore::keyForKeyEvent):
(WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder):
(WebCore::PlatformWheelEventBuilder::PlatformWheelEventBuilder): Deleted.
* replay/SerializationMethods.cpp:
(JSC::EncodingTraits<PlatformKeyboardEvent>::encodeValue):
(JSC::EncodingTraits<PlatformKeyboardEvent>::decodeValue):
2016-10-03 Alex Christensen <achristensen@webkit.org>
URLParser: fragment-only URLs relative to file URLs should just add a fragment
https://bugs.webkit.org/show_bug.cgi?id=162871
Reviewed by Geoffrey Garen.
Covered by new API tests.
* platform/URLParser.cpp:
(WebCore::URLParser::parse):
Instead of adding ///# after copying the base URL to the query, just add an #.
2016-10-03 Antoine Quint <graouts@apple.com>
[Modern Media Controls] LayoutItem and Button classes
https://bugs.webkit.org/show_bug.cgi?id=162868
<rdar://problem/28590166>
Reviewed by Dean Jackson.
We introduce the new Button class and its parent class LayoutItem. We will subclass Button
a lot in coming patches, as it provides a way to create a button and provide a delegate to
respond to UI events via the `uiDelegate` property. A Button extends a LayoutItem, another
class that we'll subclass heavily in coming patches, which is simply a LayoutNode with a
`layoutDelegate` which allows to set the node's `layoutTraits`, a bit-mask allowing to
specify layout attributes such as the platform and playback styles.
Tests: media/modern-media-controls/button/button.html
media/modern-media-controls/layout-item/layout-item.html
* Modules/modern-media-controls/controls/button.css: Added.
(button):
* Modules/modern-media-controls/controls/button.js: Added.
(Button):
(Button.prototype.get enabled):
(Button.prototype.set enabled):
(Button.prototype.handleEvent):
(Button.prototype._handleUIEvent):
* Modules/modern-media-controls/controls/layout-item.js: Added.
(LayoutItem.prototype.get layoutTraits):
(LayoutItem):
2016-10-03 Andy Estes <aestes@apple.com>
ASSERTION FAILED: url.containsOnlyASCII() in WebCore::checkEncodedString() when parsing an invalid CSS cursor URL
https://bugs.webkit.org/show_bug.cgi?id=162763
<rdar://problem/28572758>
Reviewed by Youenn Fablet.
CSSCursorImageValue copies the URL of its underlying CSSImageValue by using the
ParsedURLString URL constructor on the String returned by CSSImageValue::url(). While
CSSImageValues were always being constructed from a URL implicitly converted to a String,
nothing ensured that the URL was valid. For invalid URLs, URL::string() returns the string
it was constructed with, which might still represent a relative URL or contain non-ASCII
characters, violating the preconditions of the ParsedURLString URL constructor and causing
an assertion to fail in Debug builds.
Fix this by having CSSImageValue store its image URL using a WebCore::URL rather than a
String. CSSCursorImageValue can then copy this URL instead of attempting to re-parse a
possibly-invalid URL string.
Test: fast/css/cursor-with-invalid-url.html
* css/CSSCursorImageValue.cpp:
(WebCore::CSSCursorImageValue::CSSCursorImageValue): Copied m_imageValue.url() into
m_originalURL instead of using the ParsedURLString URL constructor, since
CSSImageValue::url() now returns a WebCore::URL.
(WebCore::CSSCursorImageValue::loadImage): Created a URL from cursorElement->href() by
calling Document::completeURL().
* css/CSSImageValue.cpp:
(WebCore::CSSImageValue::CSSImageValue): Changed to take a URL&& instead of a const String&.
(WebCore::CSSImageValue::loadImage): Stopped calling Document::completeURL(), since m_url is
now a WebCore::URL.
* css/CSSImageValue.h: Changed url() to return a const URL&, and changed m_url to be a URL.
* html/HTMLBodyElement.cpp:
(WebCore::HTMLBodyElement::collectStyleForPresentationAttribute): Removed a call to
URL::string().
* html/HTMLTableElement.cpp:
(WebCore::HTMLTableElement::collectStyleForPresentationAttribute): Ditto.
* html/HTMLTablePartElement.cpp:
(WebCore::HTMLTablePartElement::collectStyleForPresentationAttribute): Ditto.
2016-10-03 Zalan Bujtas <zalan@apple.com>
Log an error to stderr when FrameView::layout() fails to clean all the renderers.
https://bugs.webkit.org/show_bug.cgi?id=162835
Reviewed by Simon Fraser.
We've come across multiple layout/painting bugs caused by renderers left dirty
after FrameView::layout(). This patch helps catching such issues early.
Once all the blocking bugs are fixed (webkit.org/b/162835), logging should be replaced with ASSERT().
Not testable.
* page/FrameView.cpp:
(WebCore::RenderTreeNeedsLayoutChecker::~RenderTreeNeedsLayoutChecker):
(WebCore::FrameView::layout):
2016-10-03 Brent Fulgham <bfulgham@apple.com>
[Win][Direct2D] Add D2D Bitmap Image handling code
https://bugs.webkit.org/show_bug.cgi?id=162761
Reviewed by Dean Jackson.
This patch lands a set of new files that implement
Image and BitmapImage features on Windows using
Direct2D.
The desired ID2D1RenderTarget handle is needed by the
image decoder so that it can load the resulting bitmap
into the GPU.
No new tests until complete backend lands.
* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::draw): Tell the Direct2D image decoder
which render target to use.
* platform/graphics/BitmapImage.h:
* platform/graphics/ImageBuffer.cpp:
* platform/graphics/ImageBuffer.h:
* platform/graphics/ImageBufferData.h:
* platform/graphics/ImageFrameCache.cpp:
(WebCore::ImageFrameCache::setRenderTarget): Added.
* platform/graphics/ImageFrameCache.h:
(WebCore::ImageFrameCache::decoder): Added.
* platform/graphics/ImageSource.cpp:
* platform/graphics/ImageSource.h:
(WebCore::ImageSource::setRenderTarget):
* platform/graphics/win/ImageBufferDataDirect2D.cpp: Added.
* platform/graphics/win/ImageBufferDataDirect2D.h: Added.
* platform/graphics/win/ImageBufferDirect2D.cpp: Added.
* platform/graphics/win/ImageCGWin.cpp:
* platform/graphics/win/ImageDecoderDirect2D.cpp: Added.
* platform/graphics/win/ImageDecoderDirect2D.h: Added.
* platform/graphics/win/ImageDirect2D.cpp: Added.
* platform/graphics/win/NativeImageDirect2D.cpp: Added.
2016-10-03 Carlos Garcia Campos <cgarcia@igalia.com>
[SOUP] Remove unused methods toSoupMessage from ResourceRequest/Response
https://bugs.webkit.org/show_bug.cgi?id=162867
Reviewed by Sergio Villar Senin.
* platform/network/soup/ResourceRequest.h:
* platform/network/soup/ResourceRequestSoup.cpp:
(WebCore::ResourceRequest::updateSoupMessage):
(WebCore::ResourceRequest::updateFromSoupMessage): Deleted.
* platform/network/soup/ResourceResponse.h:
* platform/network/soup/ResourceResponseSoup.cpp:
(WebCore::ResourceResponse::updateFromSoupMessage): Deleted.
2016-10-03 Youenn Fablet <youenn@apple.com>
Remove FetchBody::m_isEmpty
https://bugs.webkit.org/show_bug.cgi?id=162857
Reviewed by Alex Christensen.
No change of behavior.
Moving handling of null bodies in FetchBodyOwner, by having an Optional<FetchBody> in FetchBodyOwner.
Moving storage of m_contentType in FetchBodyOwner.
Moving header storage from FetchResponse/FetchRequest to FetchBodyOwner, as it helps updating m_contentType.
* Modules/fetch/FetchBody.cpp: removing m_isEmpty and m_contentType.
(WebCore::FetchBody::extract): Computes the default content-type which is stored in FetchBodyOwner.
(WebCore::FetchBody::blob):
(WebCore::FetchBody::consume):
(WebCore::FetchBody::consumeAsStream):
(WebCore::FetchBody::loadingSucceeded):
(WebCore::FetchBody::bodyForInternalRequest):
(WebCore::FetchBody::clone):
* Modules/fetch/FetchBody.h:
(WebCore::FetchBody::loadingBody):
(WebCore::FetchBody::FetchBody):
* Modules/fetch/FetchBodyOwner.cpp:
(WebCore::FetchBodyOwner::FetchBodyOwner):
(WebCore::FetchBodyOwner::stop):
(WebCore::FetchBodyOwner::arrayBuffer):
(WebCore::FetchBodyOwner::blob):
(WebCore::FetchBodyOwner::cloneBody): Needs to clone m_contentType as well.
(WebCore::FetchBodyOwner::extractBody):
(WebCore::FetchBodyOwner::updateContentType):
(WebCore::FetchBodyOwner::consumeOnceLoadingFinished):
(WebCore::FetchBodyOwner::formData):
(WebCore::FetchBodyOwner::json):
(WebCore::FetchBodyOwner::text):
(WebCore::FetchBodyOwner::loadBlob):
(WebCore::FetchBodyOwner::blobLoadingSucceeded):
(WebCore::FetchBodyOwner::blobLoadingFailed):
(WebCore::FetchBodyOwner::finishBlobLoading):
* Modules/fetch/FetchBodyOwner.h:
(WebCore::FetchBodyOwner::body):
(WebCore::FetchBodyOwner::isBodyNull):
* Modules/fetch/FetchRequest.cpp:
(WebCore::FetchRequest::setBody):
(WebCore::FetchRequest::internalRequest):
(WebCore::FetchRequest::clone):
* Modules/fetch/FetchRequest.h:
(WebCore::FetchRequest::FetchRequest):
* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::initializeWith):
(WebCore::FetchResponse::FetchResponse):
(WebCore::FetchResponse::cloneForJS):
(WebCore::FetchResponse::fetch):
(WebCore::FetchResponse::BodyLoader::didSucceed):
(WebCore::FetchResponse::BodyLoader::didReceiveResponse):
(WebCore::FetchResponse::BodyLoader::start):
(WebCore::FetchResponse::createReadableStreamSource):
* Modules/fetch/FetchResponse.h:
2016-10-03 Andy Estes <aestes@apple.com>
ASSERTION FAILED: result in WebCore::CSSParser::parseURI
https://bugs.webkit.org/show_bug.cgi?id=141638
<rdar://problem/27709952>
Reviewed by Andreas Kling.
CSSParser::parseURIInternal() failed to parse unquoted URLs with Unicode escape sequences
greater than 0xFF, even when the destination character type was multi-byte. Fixed by
checking the size of DestCharacterType instead of SrcCharacterType.
Updated fast/css/url-with-multi-byte-unicode-escape.html to test for an unquoted URL.
* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parseURIInternal): For code points greater than 0xFF, only returned
false if sizeof(DestCharacterType) == 1.
2016-10-03 Alex Christensen <achristensen@webkit.org>
URLParser: empty relative URLs should not copy fragment from the base URL
https://bugs.webkit.org/show_bug.cgi?id=162864
Reviewed by Chris Dumez.
Covered by new API tests.
* platform/URL.cpp:
(WebCore::URL::removeFragmentIdentifier):
Optimize removing fragments, now that it happens more often. We don't need to reparse,
because the result will always be equal to just a substring when removing the fragment at the end.
* platform/URLParser.cpp:
(WebCore::URLParser::copyASCIIStringUntil):
(WebCore::URLParser::copyURLPartsUntil):
(WebCore::containsOnlyC0ControlOrSpace):
(WebCore::URLParser::URLParser):
(WebCore::URLParser::parse):
* platform/URLParser.h:
Because we are not copying the fragment, we can simplify and remove some unreachable code.
2016-10-03 Chris Dumez <cdumez@apple.com>
td.scope should only return known values
https://bugs.webkit.org/show_bug.cgi?id=162755
Reviewed by Sam Weinig.
td.scope should only return known values:
- https://html.spec.whatwg.org/#dom-th-scope
Firefox conforms to the specification.
No new tests, rebaselined existing test.
* html/HTMLTableCellElement.cpp:
(WebCore::HTMLTableCellElement::scope):
2016-10-03 Carlos Garcia Campos <cgarcia@igalia.com>
[SOUP] Simplify AuthenticationChallenge
https://bugs.webkit.org/show_bug.cgi?id=162784
Reviewed by Alex Christensen.
We don't really need to keep references to the SoupSession and SoupMessage in AuthenticationChallenge, the
SoupNetworkSession callback already forwards the challenge to the right ResourceHandle.
* platform/network/soup/AuthenticationChallenge.h:
(WebCore::AuthenticationChallenge::authenticationClient):
(WebCore::AuthenticationChallenge::soupSession): Deleted.
(WebCore::AuthenticationChallenge::soupMessage): Deleted.
* platform/network/soup/AuthenticationChallengeSoup.cpp:
(WebCore::AuthenticationChallenge::AuthenticationChallenge):
(WebCore::AuthenticationChallenge::platformCompare):
* platform/network/soup/ResourceHandleSoup.cpp:
(WebCore::ResourceHandle::continueDidReceiveAuthenticationChallenge):
(WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
(WebCore::ResourceHandle::receivedRequestToContinueWithoutCredential):
(WebCore::ResourceHandle::receivedCredential):
(WebCore::ResourceHandle::receivedCancellation):
* platform/network/soup/SoupNetworkSession.cpp:
(WebCore::authenticateCallback):
2016-10-03 Carlos Garcia Campos <cgarcia@igalia.com>
[SOUP] Cleanup persistent credential storage code
https://bugs.webkit.org/show_bug.cgi?id=162777
Reviewed by Alex Christensen.
We have this feature behind ENABLE_CREDENTIAL_STORAGE flag, which is confusing, because we use credential
storage unconditionally and this is only about persistent storage. Also the flag assumes libsecret is available,
and since it's only used by GTK sometimes we use GTK ifdefs instead of CREDENTIAL_STORAGE. So, I think we should
use USE(LIBSECRET) instead, and reduce a bit the ifdefs in common soup code. Another problem is that current
implementation is always used, while it should depend on the current network storage session and never used in
ephemeral sessions. This patch moves the code from CredentialBackingStore to NetworkStorageSessionSoup and
modernizes a bit.
* PlatformGTK.cmake: Remove CredentialBackingStore.cpp.
* platform/gtk/GRefPtrGtk.cpp: Use USE(LIBSECRET)
* platform/gtk/GRefPtrGtk.h:
* platform/network/NetworkStorageSession.h:
* platform/network/ResourceHandleInternal.h:
* platform/network/gtk/CredentialBackingStore.cpp: Removed.
* platform/network/gtk/CredentialBackingStore.h: Removed.
* platform/network/soup/NetworkStorageSessionSoup.cpp:
(WebCore::NetworkStorageSession::~NetworkStorageSession):
(WebCore::schemeFromProtectionSpaceServerType):
(WebCore::authTypeFromProtectionSpaceAuthenticationScheme):
(WebCore::NetworkStorageSession::getCredentialFromPersistentStorage):
(WebCore::NetworkStorageSession::saveCredentialToPersistentStorage):
(WebCore::NetworkStorageSession::ensurePrivateBrowsingSession): Deleted.
(WebCore::NetworkStorageSession::switchToNewTestingSession): Deleted.
* platform/network/soup/ResourceHandleSoup.cpp:
(WebCore::gotHeadersCallback):
(WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
(WebCore::ResourceHandle::receivedCredential):
(WebCore::ResourceHandle::continueDidReceiveAuthenticationChallenge): Deleted.
(WebCore::ResourceHandle::receivedRequestToContinueWithoutCredential): Deleted.
(WebCore::ResourceHandle::receivedCancellation): Deleted.
2016-10-03 Carlos Garcia Campos <cgarcia@igalia.com>
Unreviewed. Fix the build with coordinated graphics enabled after r206712.
* page/scrolling/ScrollingStateTree.cpp:
(WebCore::ScrollingStateTree::attachNode):
2016-10-02 Chris Dumez <cdumez@apple.com>
Add support for KeyboardEvent.getModifierState() operation
https://bugs.webkit.org/show_bug.cgi?id=162855
Reviewed by Darin Adler.
Add support for KeyboardEvent.getModifierState() operation:
- https://w3c.github.io/uievents/#dom-keyboardevent-getmodifierstate
Test: fast/events/constructors/keyboard-event-getModifierState.html
* dom/KeyboardEvent.cpp:
(WebCore::KeyboardEvent::getModifierState):
* dom/KeyboardEvent.idl:
2016-10-02 Chris Dumez <cdumez@apple.com>
Add support for KeyboardEvent.repeat attribute
https://bugs.webkit.org/show_bug.cgi?id=162854
Reviewed by Darin Adler.
Add support for KeyboardEvent.repeat attribute:
- https://w3c.github.io/uievents/#dom-keyboardevent-repeat
No new tests, extended existing test.
* dom/KeyboardEvent.cpp:
(WebCore::KeyboardEvent::KeyboardEvent):
* dom/KeyboardEvent.h:
* dom/KeyboardEvent.idl:
2016-10-02 Darin Adler <darin@apple.com>
Rename ExceptionCode-based exception handling to "legacy"
https://bugs.webkit.org/show_bug.cgi?id=162859
Reviewed by Chris Dumez.
RaisesException is now MayThrowLegacyException.
A follow-up patch soon will add MayThrowException for the new style,
where we use ExceptionOr<> as the return type instead of an ExceptionCode
out argument.
* bindings/scripts/CodeGeneratorJS.pm:
Removed the quotation marks from the syntax object->{PropertyName} so the
renaming script could handle it. Tweaked various comments and logic for clarity.
Changed to use the perl "x if y" syntax for brevity in many places.
Renamed with the script and by hand. Added code to skip including the same header
in both the implementation file and the header, just to make generated bindings
slightly smaller and faster to compile. Used "using" instead of "typedef".
* bindings/scripts/IDLAttributes.txt: Updated from old names to new ones.
* Modules/applepay/ApplePaySession.idl:
* Modules/encryptedmedia/MediaKeySession.idl:
* Modules/encryptedmedia/MediaKeys.idl:
* Modules/fetch/FetchHeaders.idl:
* Modules/fetch/FetchRequest.idl:
* Modules/fetch/FetchResponse.idl:
* Modules/indexeddb/IDBCursor.idl:
* Modules/indexeddb/IDBDatabase.idl:
* Modules/indexeddb/IDBFactory.idl:
* Modules/indexeddb/IDBIndex.idl:
* Modules/indexeddb/IDBKeyRange.idl:
* Modules/indexeddb/IDBObjectStore.idl:
* Modules/indexeddb/IDBRequest.idl:
* Modules/indexeddb/IDBTransaction.idl:
* Modules/mediasource/MediaSource.idl:
* Modules/mediasource/SourceBuffer.idl:
* Modules/mediastream/MediaDevices.idl:
* Modules/mediastream/RTCDTMFSender.idl:
* Modules/mediastream/RTCDataChannel.idl:
* Modules/mediastream/RTCIceCandidate.idl:
* Modules/mediastream/RTCPeerConnection.idl:
* Modules/mediastream/RTCRtpSender.idl:
* Modules/mediastream/RTCSessionDescription.idl:
* Modules/navigatorcontentutils/NavigatorContentUtils.idl:
* Modules/notifications/NotificationCenter.idl:
* Modules/webaudio/AnalyserNode.idl:
* Modules/webaudio/AudioBuffer.idl:
* Modules/webaudio/AudioBufferSourceNode.idl:
* Modules/webaudio/AudioContext.idl:
* Modules/webaudio/AudioNode.idl:
* Modules/webaudio/ConvolverNode.idl:
* Modules/webaudio/OfflineAudioContext.idl:
* Modules/webaudio/OscillatorNode.idl:
* Modules/webdatabase/DOMWindowWebDatabase.idl:
* Modules/webdatabase/SQLResultSet.idl:
* Modules/websockets/WebSocket.idl:
* bindings/scripts/test/TestImplements.idl:
* bindings/scripts/test/TestInterface.idl:
* bindings/scripts/test/TestNamedConstructor.idl:
* bindings/scripts/test/TestNondeterministic.idl:
* bindings/scripts/test/TestObj.idl:
* bindings/scripts/test/TestSupplemental.idl:
* bindings/scripts/test/TestTypedefs.idl:
* css/CSSCharsetRule.idl:
* css/CSSMediaRule.idl:
* css/CSSPrimitiveValue.idl:
* css/CSSRule.idl:
* css/CSSStyleDeclaration.idl:
* css/CSSStyleSheet.idl:
* css/CSSSupportsRule.idl:
* css/CSSValue.idl:
* css/FontFace.idl:
* css/FontFaceSet.idl:
* css/MediaList.idl:
* css/WebKitCSSMatrix.idl:
* dom/CharacterData.idl:
* dom/ChildNode.idl:
* dom/CustomElementRegistry.idl:
* dom/DataTransferItemList.idl:
* dom/Document.idl:
* dom/Element.idl:
* dom/EventTarget.idl:
* dom/MessagePort.idl:
* dom/MutationObserver.idl:
* dom/NamedNodeMap.idl:
* dom/Node.idl:
* dom/ParentNode.idl:
* dom/Range.idl:
* dom/ShadowRoot.idl:
* dom/Text.idl:
* fileapi/FileReader.idl:
* fileapi/FileReaderSync.idl:
* html/DOMTokenList.idl:
* html/DOMURL.idl:
* html/HTMLCanvasElement.idl:
* html/HTMLElement.idl:
* html/HTMLEmbedElement.idl:
* html/HTMLFrameElement.idl:
* html/HTMLIFrameElement.idl:
* html/HTMLInputElement.idl:
* html/HTMLMarqueeElement.idl:
* html/HTMLMediaElement.idl:
* html/HTMLObjectElement.idl:
* html/HTMLOptionElement.idl:
* html/HTMLOptionsCollection.idl:
* html/HTMLProgressElement.idl:
* html/HTMLSelectElement.idl:
* html/HTMLTableElement.idl:
* html/HTMLTableRowElement.idl:
* html/HTMLTableSectionElement.idl:
* html/HTMLTextAreaElement.idl:
* html/HTMLVideoElement.idl:
* html/ImageData.idl:
* html/MediaController.idl:
* html/TimeRanges.idl:
* html/URLUtils.idl:
* html/canvas/CanvasGradient.idl:
* html/canvas/CanvasPath.idl:
* html/canvas/CanvasRenderingContext2D.idl:
* html/canvas/OESVertexArrayObject.idl:
* html/canvas/WebGLRenderingContextBase.idl:
* html/track/DataCue.idl:
* html/track/TextTrack.idl:
* html/track/TextTrackCue.idl:
* html/track/VTTCue.idl:
* html/track/VTTRegion.idl:
* loader/appcache/DOMApplicationCache.idl:
* page/Crypto.idl:
* page/DOMSelection.idl:
* page/DOMWindow.idl:
* page/EventSource.idl:
* page/History.idl:
* page/Location.idl:
* page/Performance.idl:
* page/UserMessageHandler.idl:
* page/WindowOrWorkerGlobalScope.idl:
* storage/Storage.idl:
* svg/SVGAltGlyphElement.idl:
* svg/SVGAngle.idl:
* svg/SVGAnimatedBoolean.idl:
* svg/SVGAnimatedEnumeration.idl:
* svg/SVGAnimatedInteger.idl:
* svg/SVGAnimatedNumber.idl:
* svg/SVGAnimatedString.idl:
* svg/SVGAnimationElement.idl:
* svg/SVGColor.idl:
* svg/SVGGlyphRefElement.idl:
* svg/SVGGraphicsElement.idl:
* svg/SVGLength.idl:
* svg/SVGLengthList.idl:
* svg/SVGMatrix.idl:
* svg/SVGNumberList.idl:
* svg/SVGPaint.idl:
* svg/SVGPathSegList.idl:
* svg/SVGPointList.idl:
* svg/SVGPreserveAspectRatio.idl:
* svg/SVGStringList.idl:
* svg/SVGStyleElement.idl:
* svg/SVGTextContentElement.idl:
* svg/SVGTransformList.idl:
* svg/SVGViewSpec.idl:
* testing/InternalSettings.idl:
* testing/Internals.idl:
* workers/DedicatedWorkerGlobalScope.idl:
* workers/Worker.idl:
* xml/DOMParser.idl:
* xml/XMLHttpRequest.idl:
* xml/XPathEvaluator.idl:
* xml/XPathExpression.idl:
* xml/XPathResult.idl:
Allowed the rename script to rename the exception-related extended attributes.
* bindings/scripts/test/JS/JSInterfaceName.cpp:
* bindings/scripts/test/JS/JSInterfaceName.h:
* bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
* bindings/scripts/test/JS/JSTestActiveDOMObject.h:
* bindings/scripts/test/JS/JSTestCallback.cpp:
* bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
* bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.h:
* bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
* bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h:
* bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
* bindings/scripts/test/JS/JSTestCustomNamedGetter.h:
* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
* bindings/scripts/test/JS/JSTestEventConstructor.h:
* bindings/scripts/test/JS/JSTestEventTarget.cpp:
* bindings/scripts/test/JS/JSTestEventTarget.h:
* bindings/scripts/test/JS/JSTestException.cpp:
* bindings/scripts/test/JS/JSTestException.h:
* bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
* bindings/scripts/test/JS/JSTestGenerateIsReachable.h:
* bindings/scripts/test/JS/JSTestGlobalObject.cpp:
* bindings/scripts/test/JS/JSTestGlobalObject.h:
* bindings/scripts/test/JS/JSTestInterface.cpp:
* bindings/scripts/test/JS/JSTestInterface.h:
* bindings/scripts/test/JS/JSTestIterable.cpp:
* bindings/scripts/test/JS/JSTestIterable.h:
* bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
* bindings/scripts/test/JS/JSTestJSBuiltinConstructor.h:
* bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
* bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
* bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
* bindings/scripts/test/JS/JSTestNamedConstructor.h:
* bindings/scripts/test/JS/JSTestNode.cpp:
* bindings/scripts/test/JS/JSTestNode.h:
* bindings/scripts/test/JS/JSTestNondeterministic.cpp:
* bindings/scripts/test/JS/JSTestNondeterministic.h:
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestObj.h:
* bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
* bindings/scripts/test/JS/JSTestOverloadedConstructors.h:
* bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
* bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.h:
* bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
* bindings/scripts/test/JS/JSTestOverrideBuiltins.h:
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
* bindings/scripts/test/JS/JSTestTypedefs.h:
* bindings/scripts/test/JS/JSattribute.cpp:
* bindings/scripts/test/JS/JSattribute.h:
* bindings/scripts/test/JS/JSreadonly.cpp:
* bindings/scripts/test/JS/JSreadonly.h:
Regenerated.
2016-10-02 Wenson Hsieh <wenson_hsieh@apple.com>
Media controls for Soundcloud easily falls out of sync with what's actually playing
https://bugs.webkit.org/show_bug.cgi?id=162843
<rdar://problem/28176874>
Reviewed by Beth Dakin.
Currently, audio elements are subject to the same main content restrictions as video elements. This is
problematic on sites where audio elements are really the main content, such as soundcloud. We need a different
heuristic for determining whether audio elements such as these should be allowed to show playback controls.
Furthermore, we currently forbid autoplaying audio from showing controls if it has user gesture restrictions
(i.e. it started playing via script). This is, again, problematic on sites where audio elements are played one
after another (such as on soundcloud). Even though a subsequent audio element may have been triggered via
script, we might want still want to show controls for it if the user has explicitly triggered other elements on
the page to begin playing. However, if the user has not gestured on any media in the page, we still should not
show controls for audio elements that begin playing via script.
Adds two new unit tests to TestWebKitAPI simulating audio playback behavior on soundcloud.
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::removeBehaviorRestriction):
(WebCore::MediaElementSession::canShowControlsManager):
(WebCore::MediaElementSession::allowsPlaybackControlsForAutoplayingAudio):
* html/MediaElementSession.h:
* page/Page.h:
(WebCore::Page::allowsPlaybackControlsForAutoplayingAudio):
(WebCore::Page::setAllowsPlaybackControlsForAutoplayingAudio):
2016-10-02 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r206683.
This change caused API test WebKit2.FindMatches to fail on
Mac.
Reverted changeset:
"The dragged image should be the current frame only of the
animated image"
https://bugs.webkit.org/show_bug.cgi?id=162109
http://trac.webkit.org/changeset/206683
2016-10-02 Chris Dumez <cdumez@apple.com>
Unreviewed, rolling out r206692 and r206718.
Seems to have caused >200 failures on Sierra
Reverted changesets:
"Implement rendering of font-variation-settings"
https://bugs.webkit.org/show_bug.cgi?id=162782
http://trac.webkit.org/changeset/206692
"Tried to fix the build after r206692."
http://trac.webkit.org/changeset/206718
2016-10-02 Dan Bernstein <mitz@apple.com>
Tried to fix the build after r206692.
* platform/graphics/cocoa/FontPlatformDataCocoa.mm:
(WebCore::cascadeToLastResortAndVariationsFontDescriptor):
2016-10-02 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r206716.
https://bugs.webkit.org/show_bug.cgi?id=162858
It is breaking Mac CMake Debug build (Requested by youenn on
#webkit).
Reverted changeset:
"[Fetch API] Forbid redirection to non-HTTP(s) URL in non-
navigation mode."
https://bugs.webkit.org/show_bug.cgi?id=162785
http://trac.webkit.org/changeset/206716
2016-10-02 Youenn Fablet <youenn@apple.com>
[Fetch API] Forbid redirection to non-HTTP(s) URL in non-navigation mode.
https://bugs.webkit.org/show_bug.cgi?id=162785
Reviewed by Alex Christensen.
Covered by rebased and existing tests.
Ensuring non-HTTP redirection URLs are not followed at DocumentThreadableLoader level for fetch API only.
This should be applied to all clients at some point, but there is still some uncertainty for data URLs.
Did some refactoring to better separate the case of security checks in case of regular request or redirected request.
This allows in particular to handle more clearly the case of data URLs which are allowed in all modes for regular requests.
But they are not allowed for same-origin redirected requests.
* WebCore.xcodeproj/project.pbxproj:
* loader/DocumentThreadableLoader.cpp:
(WebCore::reportRedirectionWithBadScheme): Reporting bad scheme redirection error.
(WebCore::DocumentThreadableLoader::redirectReceived): Checking that redirection URLs are HTTP(s) in case of Fetch API.
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::willSendRequestInternal):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::requestImage):
(WebCore::CachedResourceLoader::checkInsecureContent):
(WebCore::CachedResourceLoader::allowedByContentSecurityPolicy):
(WebCore::isSameOriginDataURL):
(WebCore::CachedResourceLoader::canRequest):
(WebCore::CachedResourceLoader::canRequestAfterRedirection):
(WebCore::CachedResourceLoader::canRequestInContentDispositionAttachmentSandbox):
(WebCore::CachedResourceLoader::requestResource):
* loader/cache/CachedResourceLoader.h:
2016-10-01 Simon Fraser <simon.fraser@apple.com>
Support transitions/animations of background-position with right/bottom-relative values
https://bugs.webkit.org/show_bug.cgi?id=162048
Reviewed by Dean Jackson.
Make transitions between "background-position: 10px 20px" and "background-position: right 10px bottom 20px"
work. We do this by by converting "right 10px" to "calc(100% - 10px)" when blending.
Also improve logging of calculated lengths, and better animation logging for FillLayer properties.
Test: transitions/background-position-transitions.html
* page/animation/CSSPropertyAnimation.cpp:
(WebCore::FillLayerAnimationPropertyWrapperBase::FillLayerAnimationPropertyWrapperBase): Keep the propertyID
around so logging can use it.
(WebCore::FillLayerAnimationPropertyWrapperBase::property):
(WebCore::FillLayerPropertyWrapperGetter::FillLayerPropertyWrapperGetter):
(WebCore::FillLayerPropertyWrapperGetter::value):
(WebCore::FillLayerPropertyWrapper::FillLayerPropertyWrapper):
(WebCore::createCalculatedLength):
(WebCore::FillLayerPositionPropertyWrapper::FillLayerPositionPropertyWrapper):
(WebCore::FillLayerRefCountedPropertyWrapper::FillLayerRefCountedPropertyWrapper):
(WebCore::FillLayerStyleImagePropertyWrapper::FillLayerStyleImagePropertyWrapper):
(WebCore::FillLayersPropertyWrapper::FillLayersPropertyWrapper):
(WebCore::CSSPropertyAnimation::blendProperties): Blend then log, so that the logging
can show the result.
* platform/CalculationValue.cpp:
(WebCore::CalcExpressionNumber::dump):
(WebCore::CalcExpressionBinaryOperation::dump):
(WebCore::CalcExpressionLength::dump):
(WebCore::CalcExpressionBlendLength::dump):
(WebCore::operator<<):
* platform/CalculationValue.h:
* platform/Length.cpp:
(WebCore::operator<<):
2016-10-01 Simon Fraser <simon.fraser@apple.com>
Bad cast when CSS position programmatically changed from -webkit-sticky to fixed
https://bugs.webkit.org/show_bug.cgi?id=160826
Reviewed by Zalan Bujtas.
If a scrolling state tree node changed type (e.g. from sticky to fixed), we'd fail
to recreate the node so keep a node with the wrong type.
Fix by destroying the node and making a new one with a new ID in this case. The
new ID is necessary to ensure that the scrolling tree is updated.
Test: fast/scrolling/sticky-to-fixed.html
* page/scrolling/ScrollingStateTree.cpp:
(WebCore::ScrollingStateTree::nodeTypeAndParentMatch):
(WebCore::ScrollingStateTree::attachNode):
(WebCore::ScrollingStateTree::stateNodeForID):
* page/scrolling/ScrollingStateTree.h:
2016-10-01 Youenn Fablet <youenn@apple.com>
removing FetchBoyd::m_type
Remove FetchBody::m_type
https://bugs.webkit.org/show_bug.cgi?id=162841
Reviewed by Sam Weinig.
No change of behavior.
Removing FetchBody::m_type and using m_data in lieu.
Introducing temporarily FetchBody::m_isEmpty to handle the case of null bodies.
Null body handling should be moved to FetchBodyOwner in a follow-up patch.
* Modules/fetch/FetchBody.cpp:
(WebCore::FetchBody::FetchBody):
(WebCore::FetchBody::extract):
(WebCore::FetchBody::arrayBuffer):
(WebCore::FetchBody::blob):
(WebCore::FetchBody::json):
(WebCore::FetchBody::text):
(WebCore::FetchBody::consumeOnceLoadingFinished):
(WebCore::FetchBody::consume):
(WebCore::FetchBody::consumeAsStream):
(WebCore::FetchBody::loadingSucceeded):
(WebCore::FetchBody::bodyForInternalRequest):
(WebCore::FetchBody::clone):
(WebCore::FetchBody::consumeText): Deleted.
(WebCore::FetchBody::consumeBlob): Deleted.
* Modules/fetch/FetchBody.h:
(WebCore::FetchBody::isEmpty):
(WebCore::FetchBody::isBlob):
(WebCore::FetchBody::isFormData):
(WebCore::FetchBody::isArrayBuffer):
(WebCore::FetchBody::isArrayBufferView):
(WebCore::FetchBody::isURLSearchParams):
(WebCore::FetchBody::isText):
(WebCore::FetchBody::FetchBody):
(WebCore::FetchBody::setContentType): Deleted.
(WebCore::FetchBody::urlSearchParamsBody): Deleted.
* Modules/fetch/FetchBodyOwner.cpp:
(WebCore::FetchBodyOwner::consumeOnceLoadingFinished):
(WebCore::FetchBodyOwner::blobLoadingSucceeded):
(WebCore::FetchBodyOwner::finishBlobLoading): Deleted.
* Modules/fetch/FetchBodyOwner.h:
(WebCore::FetchBodyOwner::body): Deleted.
* Modules/fetch/FetchRequest.cpp:
(WebCore::FetchRequest::setBody):
* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::fetch):
(WebCore::FetchResponse::BodyLoader::didSucceed):
(WebCore::FetchResponse::consume):
(WebCore::FetchResponse::consumeBodyAsStream):
(WebCore::FetchResponse::createReadableStreamSource):
(WebCore::FetchResponse::finishConsumingStream): Deleted.
* Modules/fetch/FetchResponse.h:
2016-09-30 David Kilzer <ddkilzer@apple.com>
REGRESSION (r203424): WebCore::ImageBuffer::createCompatibleBuffer() in ImageBufferCG.cpp over-releases CGColorSpaceRef objects
<https://webkit.org/b/162823>
<rdar://problem/27723268>
Reviewed by Joseph Pecoraro.
Code is covered by existing tests, but no crashes have been
observed in practice. May require running one test multiple
times to reproduce.
* platform/graphics/cg/ImageBufferCG.cpp:
(WebCore::ImageBuffer::createCompatibleBuffer): Don't use
adoptCF() when the function doesn't return a +1 retained
CGColorSpaceRef.
2016-09-30 Joonghun Park <jh718.park@samsung.com>
[EFL] Fix build break since r206661. Unreviewed
https://bugs.webkit.org/show_bug.cgi?id=162825
No new tests, no new behaviours.
* rendering/RenderLayer.cpp:
(WebCore::ClipRects::ClipRects):
2016-09-30 Myles C. Maxfield <mmaxfield@apple.com>
Declare that our variation fonts work is in progress
https://bugs.webkit.org/show_bug.cgi?id=162816
Reviewed by Simon Fraser.
* features.json:
2016-09-30 Myles C. Maxfield <mmaxfield@apple.com>
Turn variation fonts on by default
https://bugs.webkit.org/show_bug.cgi?id=162818
Reviewed by Simon Fraser.
No new tests because there is no behavior change.
* page/Settings.in:
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::variationFontsEnabled):
2016-09-30 Myles C. Maxfield <mmaxfield@apple.com>
Implement rendering of font-variation-settings
https://bugs.webkit.org/show_bug.cgi?id=162782
Reviewed by Zalan Bujtas.
Because the heavy lifting for font-variation-settings is done by CoreText,
this patch is fairly minimal. It simply hooks up the CSS property to CoreText.
There is an existing bug in CoreText where variations inside fonts do not
survive the addition of a cascade list. Therefore, FontPlatformData::ctFont()
needs to work around this (conditionally) by resupplying the variation at
the same time as the cascade list. The CoreText bug is <rdar://problem/28449441>.
Tests: fast/text/variations/duplicate.html
fast/text/variations/exist.html
fast/text/variations/inheritance.html
fast/text/variations/order.html
fast/text/variations/outofbounds.html
* platform/graphics/FontCache.h:
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::preparePlatformFont):
(WebCore::fontWithFamily):
(WebCore::FontCache::createFontPlatformData):
(WebCore::FontCache::systemFallbackForCharacters):
* platform/graphics/cocoa/FontPlatformDataCocoa.mm:
(WebCore::cascadeToLastResortAttributesDictionary):
(WebCore::cascadeToLastResortAndVariationsFontDescriptor):
(WebCore::FontPlatformData::ctFont):
(WebCore::cascadeToLastResortFontDescriptor): Deleted.
* platform/graphics/mac/FontCustomPlatformData.cpp:
(WebCore::FontCustomPlatformData::fontPlatformData):
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::updateCachedSystemFontDescription):
2016-09-29 Sam Weinig <sam@webkit.org>
Add initial support for IDL union conversion
https://bugs.webkit.org/show_bug.cgi?id=161576
Reviewed by Chris Dumez.
* WebCore.xcodeproj/project.pbxproj:
Add IDLTypes.h
* bindings/generic/IDLTypes.h: Added.
Add a basic type hierarchy for types defined by WebIDL and their corresponding
WebCore implementation types.
* bindings/js/JSDOMConvert.h:
(WebCore::Converter<IDLDOMString>::convert):
(WebCore::Converter<IDLUSVString>::convert):
Add Converters for IDLDOMString and IDLUSVString.
(WebCore::ConditionalConverter<typename ReturnType, typename T, bool enabled>)
Add a struct to allow conditional conversion of types based on a compile boolean
value. This allows the union code to work, by ensuring that code for types that don't
exist doesn't get compiled.
(WebCore::Converter<IDLUnion>::convert):
Add template meta programming based version of the WebIDL conversion algorithm. It uses
introspection of the typelist to conditionally execute the parts of the algorithm that
apply and relies on the compiler eliminate the dead code it produces. This initial cut
doesn't implement the full algorithm, just a subset needed to see if this method will work
out.
* bindings/js/JSDOMWrapper.h:
(WebCore::isJSDOMWrapperType):
Add JSDOMWrapperType to the list of well known types to allow quick checking of wrappers
by the union code.
* bindings/js/JSNodeOrString.cpp:
(WebCore::toNodeOrStringVector):
Switch to new IDLUnion based converter.
2016-09-30 Myles C. Maxfield <mmaxfield@apple.com>
Implement animation of font-variation-settings
https://bugs.webkit.org/show_bug.cgi?id=162783
Reviewed by Simon Fraser.
Modify CSSPropertyAnimation to understand FontVariationSettings objects and how
to interpolate them.
If two FontVariationSettings objects are unlike (meaning they specify different
variation axes), for now the interpolation simply returns an empty object. This
might change in the future, but for now, this is a reasonable place to start.
Because CSSPropertyAnimation interacts with RenderStyles instead of
FontDescriptions, this patch adds a transparent accessor from the RenderStyle
to the inner FontDescription.
Tests: animations/font-variation-settings-order.html
animations/font-variation-settings-unlike.html
animations/font-variation-settings.html
* page/animation/CSSPropertyAnimation.cpp:
(WebCore::blendFunc):
(WebCore::PropertyWrapperFontVariationSettings::PropertyWrapperFontVariationSettings):
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::setFontVariationSettings):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::fontVariationSettings):
2016-09-30 Antoine Quint <graouts@apple.com>
[Modern Media Controls] layout nodes
https://bugs.webkit.org/show_bug.cgi?id=162799
<rdar://problem/28569301>
Reviewed by Dean Jackson.
Modern media controls will be using a tree of LayoutNode objects that commit to the DOM
in coordinated `requestAnimationFrame()` calls to ensure all layouts are done in an efficient
and coordinated manner. As a preamble, we introduced the `scheduler` singleton in
https://webkit.org/b/162726 which is in charge of scheduling callbacks.
A LayoutNode is created by providing an Element to its constructor, or an HTML string. Not
providing a parameter creates a simple <div>.
When we set a property on a LayoutNode, we call `markDirtyProperty(propertyName)` which keeps
track of dirty properties in the `_dirtyProperties` set. When this set is non-empty, the node
is marked as dirty and registered in the global `dirtyNodes` map, asking the shared scheduler
that a layout is needed. When the layout is performed, all nodes in the `dirtyNodes` map are
processed such that `commitProperty(propertyName)` is called to commit dirty properties for
a given node to the DOM, and `layout()` is called to allow subclasses of LayoutNode to conduct
custom layout logic that goes beyond committing a given property.
Another reason why a node may be marked as dirty is when a DOM hierarchy change is needed. A
host of DOM-like methods are exposed to allow flexible manipulations of nodes, with an extra
`children` property which allows wholesale change of a node's subtree with a single array
property assignment. Changes to the DOM hierarchy are performed in the same scheduler callback
as style properties.
Nodes can be marked for layout explicitly with by setting the `needsLayout` property.
Tests: media/modern-media-controls/layout-node/addChild.html
media/modern-media-controls/layout-node/children.html
media/modern-media-controls/layout-node/constructor.html
media/modern-media-controls/layout-node/height.html
media/modern-media-controls/layout-node/insertAfter.html
media/modern-media-controls/layout-node/insertBefore.html
media/modern-media-controls/layout-node/parent.html
media/modern-media-controls/layout-node/remove.html
media/modern-media-controls/layout-node/removeChild.html
media/modern-media-controls/layout-node/subclassing.html
media/modern-media-controls/layout-node/visible.html
media/modern-media-controls/layout-node/width.html
media/modern-media-controls/layout-node/x.html
media/modern-media-controls/layout-node/y.html
* Modules/modern-media-controls/controls/layout-node.js: Added.
(LayoutNode):
(LayoutNode.prototype.get x):
(LayoutNode.prototype.set x):
(LayoutNode.prototype.get y):
(LayoutNode.prototype.set y):
(LayoutNode.prototype.get width):
(LayoutNode.prototype.set width):
(LayoutNode.prototype.get height):
(LayoutNode.prototype.set height):
(LayoutNode.prototype.get visible):
(LayoutNode.prototype.set visible):
(LayoutNode.prototype.get needsLayout):
(LayoutNode.prototype.set needsLayout):
(LayoutNode.prototype.get parent):
(LayoutNode.prototype.get children):
(LayoutNode.prototype.set children):
(LayoutNode.prototype.addChild):
(LayoutNode.prototype.insertBefore):
(LayoutNode.prototype.insertAfter):
(LayoutNode.prototype.removeChild):
(LayoutNode.prototype.remove):
(LayoutNode.prototype.markDirtyProperty):
(LayoutNode.prototype.commitProperty):
(LayoutNode.prototype.layout):
(LayoutNode.prototype._markNodeManipulation):
(LayoutNode.prototype._updateDirtyState):
(LayoutNode.prototype._updateChildren):
(performScheduledLayout):
(elementFromString):
2016-09-30 Said Abou-Hallawa <sabouhallawa@apple.com>
The dragged image should be the current frame only of the animated image
https://bugs.webkit.org/show_bug.cgi?id=162109
Reviewed by Tim Horton.
Instead of creating an NSImage with all the frames for the dragImage,
create an NSImage with the current frame only.
* dom/DataTransferMac.mm:
(WebCore::DataTransfer::createDragImage): Call currentFrameNSImage() to create the dragImage.
* editing/cocoa/HTMLConverter.mm:
(fileWrapperForElement): Call the Image function with its new name.
* platform/graphics/BitmapImage.h:
* platform/graphics/Image.h:
(WebCore::Image::nsImage): Rename getNSImage() to nsImage().
(WebCore::Image::currentFrameNSImage): Returns the NSImage of the current frame.
(WebCore::Image::tiffRepresentation): Rename getTIFFRepresentation() to tiffRepresentation().
(WebCore::Image::getNSImage): Deleted.
(WebCore::Image::getTIFFRepresentation): Deleted.
* platform/graphics/mac/ImageMac.mm:
(WebCore::BitmapImage::tiffRepresentation): Rename getTIFFRepresentation() to tiffRepresentation().
(WebCore::BitmapImage::nsImage): Rename getNSImage() to nsImage().
(WebCore::BitmapImage::currentFrameNSImage): Returns the NSImage of the current frame.
(WebCore::BitmapImage::getTIFFRepresentation): Deleted.
(WebCore::BitmapImage::getNSImage): Deleted.
* platform/mac/CursorMac.mm:
(WebCore::createCustomCursor): Call currentFrameNSImage() since the cursor does not animate anyway.
* platform/mac/DragImageMac.mm:
(WebCore::createDragImageFromImage): Use currentFrameNSImage() for the dragImage.
* platform/mac/PasteboardMac.mm:
(WebCore::Pasteboard::write): Call the Image function with its new name.
2016-09-30 Chris Dumez <cdumez@apple.com>
[iOS] Allow sequence<Touch> input in TouchEvent constructor
https://bugs.webkit.org/show_bug.cgi?id=162806
<rdar://problem/28566429>
Reviewed by Ryosuke Niwa.
Allow sequence<Touch> input in TouchEvent constructor in addition to
TouchList objects. It is convenient for developers to pass arrays of
Touch objects.
No new tests, already covered by:
imported/w3c/web-platform-tests/touch-events/touch-touchevent-constructor.html
* bindings/js/JSDOMBinding.h:
(WebCore::toRefNativeArray):
(WebCore::toRefPtrNativeArray):
* bindings/js/JSDictionary.cpp:
(WebCore::JSDictionary::convertValue):
2016-09-30 Myles C. Maxfield <mmaxfield@apple.com>
Parse font-variation-settings
https://bugs.webkit.org/show_bug.cgi?id=162781
Reviewed by Simon Fraser.
CSS Fonts level 4 [1] details the font-variation-settings property which allows variations
to be applied to fonts which accept it. The property accepts a list of key/value
pairs where the keys are four-character Ascii codes and the values are floating
point values. The implementation uses font-feature-settings as a model, but with one
big difference: font-variation-settings can be animated. The set of variation points
are animated individually.
This font variations work is being done behind a run-time switch, which is settable from
the Safari Develop menu.
Now that FontDescription is growing, I'd like to do an investigation into the possibility of
moving some of the rare pieces of it into their own class to reduce memory. However, upon
advice, this investigation will be fairly involved and should be done in its own bug.
Test: fast/text/variations/getComputedStyle.html
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* css/CSSAllInOne.cpp:
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::propertyValue):
* css/CSSFontVariationValue.cpp: Copied from Source/WebCore/platform/graphics/FontTaggedSettings.cpp.
(WebCore::CSSFontVariationValue::CSSFontVariationValue):
(WebCore::CSSFontVariationValue::customCSSText):
(WebCore::CSSFontVariationValue::equals):
* css/CSSFontVariationValue.h: Copied from Source/WebCore/platform/graphics/FontTaggedSettings.cpp.
* css/CSSPropertyNames.in:
* css/CSSValue.cpp:
(WebCore::CSSValue::equals):
(WebCore::CSSValue::cssText):
(WebCore::CSSValue::destroy):
* css/CSSValue.h:
(WebCore::CSSValue::isFontVariationValue):
(WebCore::CSSValue::isFontFeatureValue): Deleted.
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertFontVariationSettings):
* css/StyleBuilderCustom.h:
(WebCore::StyleBuilderCustom::applyInitialFontVariationSettings):
(WebCore::StyleBuilderCustom::applyInheritFontVariationSettings):
(WebCore::StyleBuilderCustom::applyInheritFontFeatureSettings): Deleted.
* css/parser/CSSParser.cpp:
(WebCore::CSSParserContext::CSSParserContext):
(WebCore::operator==):
(WebCore::CSSParser::parseValue):
(WebCore::CSSParser::parseFontFeatureSettings):
(WebCore::CSSParser::parseFontVariationTag):
(WebCore::CSSParser::parseFontVariationSettings):
* css/parser/CSSParser.h:
* css/parser/CSSParserMode.h:
* platform/graphics/FontCache.h:
(WebCore::FontDescriptionKey::FontDescriptionKey):
(WebCore::FontDescriptionKey::operator==):
(WebCore::FontDescriptionKey::computeHash):
* platform/graphics/FontDescription.cpp:
* platform/graphics/FontDescription.h:
(WebCore::FontDescription::variationSettings):
(WebCore::FontDescription::setVariationSettings):
(WebCore::FontDescription::operator==):
(WebCore::FontDescription::featureSettings): Deleted.
(WebCore::FontDescription::setFeatureSettings): Deleted.
* platform/graphics/FontTaggedSettings.cpp:
(WebCore::FontVariationSettings::hash):
(WebCore::operator<<):
* platform/graphics/FontTaggedSettings.h:
2016-09-30 Myles C. Maxfield <mmaxfield@apple.com>
Followup patch to r206664
https://bugs.webkit.org/show_bug.cgi?id=162774
Unreviewed.
No new tests because there is no behavior change.
* platform/graphics/FontTaggedSettings.h:
(WebCore::FourCharacterTagHashTraits::isDeletedValue): Deleted.
2016-09-30 Myles C. Maxfield <mmaxfield@apple.com>
Fix fast/text/trak-optimizeLegibility.html
https://bugs.webkit.org/show_bug.cgi?id=162779
Reviewed by Simon Fraser.
I accidentally created this test to allow an unnecessary delta
in the width comparison. This covered the fact that the fonts
were not being selected correctly in our testing code. Update the
font selection code to work with system fonts correctly and
update the test to not use a delta when performing width
comparisons.
Test: fast/text/trak-optimizeLegibility.html
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::isSystemFont):
(WebCore::platformFontLookupWithFamily):
2016-09-30 Myles C. Maxfield <mmaxfield@apple.com>
Create runtime flag for variation font work
https://bugs.webkit.org/show_bug.cgi?id=162780
Reviewed by Alex Christensen.
No new tests because there is no behavior change.
Variation font work should be behind a runtime flag.
* page/Settings.in:
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::Backup::Backup):
(WebCore::InternalSettings::Backup::restoreTo):
(WebCore::InternalSettings::variationFontsEnabled):
(WebCore::InternalSettings::setVariationFontsEnabled):
* testing/InternalSettings.h:
* testing/InternalSettings.idl:
2016-09-30 Myles C. Maxfield <mmaxfield@apple.com>
Templatize internal FontFeatureSettings class for variation font support
https://bugs.webkit.org/show_bug.cgi?id=162774
Reviewed by Alex Christensen.
Font features and font variations are similar in that they are identified
by four-character tags and an associated value. However, the value is an
int for font features and is a float for font variations. In order to
simplify code, we can use the same class for both, and use a template
argument to distinguish between the two. Then, typedefs can be used to
name them.
No new tests because there is no behavior change.
* WebCore.xcodeproj/project.pbxproj: Rename FontFeatureSettings.{cpp,h}
to FontTaggedSettings.{cpp,h}
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::propertyValue):
* css/CSSFontFace.h:
* css/CSSFontFaceSource.h:
* css/CSSFontFeatureValue.cpp:
(WebCore::CSSFontFeatureValue::CSSFontFeatureValue):
* css/CSSFontFeatureValue.h:
* css/FontFace.cpp:
(WebCore::FontFace::featureSettings):
* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parseFontFeatureTag):
* loader/cache/CachedFont.h:
* platform/graphics/FontDescription.h:
* platform/graphics/FontFeatureSettings.cpp:
(WebCore::FontFeature::FontFeature): Deleted.
(WebCore::FontFeature::operator==): Deleted.
(WebCore::FontFeature::operator<): Deleted.
(WebCore::FontFeatureSettings::insert): Deleted.
(WebCore::FontFeatureSettings::hash): Deleted.
* platform/graphics/FontFeatureSettings.h: Removed.
(WebCore::fontFeatureTag): Deleted.
(WebCore::FontFeatureTagHash::hash): Deleted.
(WebCore::FontFeatureTagHash::equal): Deleted.
(WebCore::FontFeatureTagHashTraits::constructDeletedValue): Deleted.
(WebCore::FontFeatureTagHashTraits::isDeletedValue): Deleted.
(WebCore::FontFeature::operator!=): Deleted.
(WebCore::FontFeature::tag): Deleted.
(WebCore::FontFeature::value): Deleted.
(WebCore::FontFeature::enabled): Deleted.
(WebCore::FontFeatureSettings::operator==): Deleted.
(WebCore::FontFeatureSettings::operator!=): Deleted.
(WebCore::FontFeatureSettings::size): Deleted.
(WebCore::FontFeatureSettings::operator[]): Deleted.
(WebCore::FontFeatureSettings::at): Deleted.
(WebCore::FontFeatureSettings::begin): Deleted.
(WebCore::FontFeatureSettings::end): Deleted.
* platform/graphics/FontTaggedSettings.cpp: Renamed from Source/WebCore/platform/graphics/FontFeatureSettings.cpp.
(WebCore::FontFeatureSettings::hash):
* platform/graphics/FontTaggedSettings.h: Added.
(WebCore::fontFeatureTag):
(WebCore::FourCharacterTagHash::hash):
(WebCore::FourCharacterTagHash::equal):
(WebCore::FourCharacterTagHashTraits::constructDeletedValue):
(WebCore::FourCharacterTagHashTraits::isDeletedValue):
(WebCore::FontTaggedSetting::operator!=):
(WebCore::FontTaggedSetting::tag):
(WebCore::FontTaggedSetting::value):
(WebCore::FontTaggedSetting::enabled):
(WebCore::FontTaggedSetting<T>::FontTaggedSetting):
(WebCore::=):
(WebCore::FontTaggedSetting<T>::operator<):
(WebCore::FontTaggedSettings::operator==):
(WebCore::FontTaggedSettings::operator!=):
(WebCore::FontTaggedSettings::isEmpty):
(WebCore::FontTaggedSettings::size):
(WebCore::FontTaggedSettings::operator[]):
(WebCore::FontTaggedSettings::at):
(WebCore::FontTaggedSettings::begin):
(WebCore::FontTaggedSettings::end):
(WebCore::FontTaggedSettings<T>::insert):
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::tagEquals):
(WebCore::appendOpenTypeFeature):
* platform/graphics/mac/FontCustomPlatformData.h:
2016-09-30 Chris Dumez <cdumez@apple.com>
Fragment serialization should always use 'xml:' prefix for attributes in XML namespace
https://bugs.webkit.org/show_bug.cgi?id=162803
Reviewed by Sam Weinig.
Fragment serialization should always use 'xml:' prefix for attributes in XML namespace:
- https://html.spec.whatwg.org/#serialising-html-fragments
"""
If the attribute is in the XML namespace
-> The attribute's serialized name is the string "xml:" followed by the attribute's local name.
"""
- https://www.w3.org/TR/DOM-Parsing/#dfn-concept-xml-serialization-algorithm
"""
If ns is the XML namespace, then let qualified name be the concatenation of the string "xml:"
and the value of node's localName.
"""
Firefox complies with the specification.
No new tests, rebaselined existing test.
* editing/MarkupAccumulator.cpp:
(WebCore::MarkupAccumulator::appendAttribute):
2016-09-30 Zalan Bujtas <zalan@apple.com>
Unreviewed, rolling out r206611.
Scroll perf did not recover.
Reverted changeset:
"Unreviewed, rolling out r206483."
https://bugs.webkit.org/show_bug.cgi?id=162750
http://trac.webkit.org/changeset/206611
2016-09-30 Zalan Bujtas <zalan@apple.com>
Remove ClipRects's custom refcounting.
https://bugs.webkit.org/show_bug.cgi?id=162798
Reviewed by Simon Fraser.
It's safer to use RefCounted<>.
No change in functionality.
* rendering/RenderLayer.cpp:
(WebCore::ClipRects::ClipRects):
(WebCore::ClipRectsCache::getClipRects):
(WebCore::ClipRectsCache::setClipRects):
(WebCore::ClipRectsCache::getIndex):
(WebCore::RenderLayer::updateClipRects):
(WebCore::ClipRects::ref): Deleted.
(WebCore::ClipRects::deref): Deleted.
2016-09-30 Chris Dumez <cdumez@apple.com>
FileSaver.js does not work in WebKit
https://bugs.webkit.org/show_bug.cgi?id=162788
Reviewed by Sam Weinig.
FileSaver.js does not work in WebKit:
- https://eligrey.com/demos/FileSaver.js/
It works in Firefox and Chrome, but in WebKit, we were getting a
"Synthetic clicks on anchors that have a download attribute are
ignored." warning. We were too strict in restricting synthetic clicks.
We now allow synthetic clicks as long as they are triggered by a user
gesture.
Test: fast/dom/HTMLAnchorElement/anchor-download-user-triggered-synthetic-click.html
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::handleClick):
2016-09-30 Joseph Pecoraro <pecoraro@apple.com>
Breakpoints on blank lines or comments don't break
https://bugs.webkit.org/show_bug.cgi?id=9885
<rdar://problem/6134406>
Reviewed by Mark Lam.
Tests: inspector/debugger/breakpoints/resolved-dump-all-pause-locations.html
inspector/debugger/breakpoints/resolved-dump-each-line.html
* bindings/js/CachedScriptSourceProvider.h:
(WebCore::CachedScriptSourceProvider::CachedScriptSourceProvider):
2016-09-30 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Stepping out of a function finishes the line that called it.
https://bugs.webkit.org/show_bug.cgi?id=155325
<rdar://problem/25094578>
Reviewed by Mark Lam.
Tests: inspector/debugger/stepping/stepInto.html
inspector/debugger/stepping/stepOut.html
inspector/debugger/stepping/stepOver.html
inspector/debugger/stepping/stepping-arrow-functions.html
inspector/debugger/stepping/stepping-classes.html
inspector/debugger/stepping/stepping-control-flow.html
inspector/debugger/stepping/stepping-function-calls.html
inspector/debugger/stepping/stepping-function-default-parameters.html
inspector/debugger/stepping/stepping-literal-construction.html
inspector/debugger/stepping/stepping-loops.html
inspector/debugger/stepping/stepping-misc.html
inspector/debugger/stepping/stepping-switch.html
inspector/debugger/stepping/stepping-template-string.html
inspector/debugger/stepping/stepping-try-catch-finally.html
* inspector/InspectorDOMDebuggerAgent.h:
* inspector/InspectorDOMDebuggerAgent.cpp:
(WebCore::InspectorDOMDebuggerAgent::stepInto): Deleted.
Setting this state in step-into does not make sense since we do not
know when the debugger resumes and won't know when to clear it.
2016-09-30 Alex Christensen <achristensen@webkit.org>
Fix off-by-one error in URLParser::parseIPv4Host
https://bugs.webkit.org/show_bug.cgi?id=162789
Reviewed by Tim Horton.
The spec says "If any but the last item in numbers is greater than 255, return failure."
This means check up to size - 1, not size - 2.
Covered by a new API test.
* platform/URLParser.cpp:
(WebCore::URLParser::parseIPv4Host):
2016-09-30 Alex Christensen <achristensen@webkit.org>
URLParser: parsing a URL with an empty host and a colon should fail
https://bugs.webkit.org/show_bug.cgi?id=162795
Reviewed by Tim Horton.
Covered by new API tests.
* platform/URLParser.cpp:
(WebCore::URLParser::parseHostAndPort):
2016-09-30 Alex Christensen <achristensen@webkit.org>
URLParser: handle syntax violations in non-UTF-8 encoded queries
https://bugs.webkit.org/show_bug.cgi?id=162770
Reviewed by Tim Horton.
There is a fast path for queries of URLs that use UTF-8 encoding, which are quite common.
For non-UTF-8 encoded queries, which are less common, we put the code points in a Vector<UChar>
and encode them all at once. If there is a syntax violation in the query, we need to copy the
syntax-violation-free string up to the beginning of the query, then encode the query.
Covered by new API tests.
* platform/URLParser.cpp:
(WebCore::URLParser::percentEncodeByte):
(WebCore::URLParser::encodeQuery):
(WebCore::URLParser::parse):
* platform/URLParser.h:
2016-09-27 Anders Carlsson <andersca@apple.com>
Remove a couple of unused members from PlatformKeyboardEvent
https://bugs.webkit.org/show_bug.cgi?id=162641
Reviewed by Tim Horton.
* platform/PlatformKeyboardEvent.h:
(WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
(WebCore::PlatformKeyboardEvent::nativeVirtualKeyCode): Deleted.
(WebCore::PlatformKeyboardEvent::macCharCode): Deleted.
* platform/mac/PlatformEventFactoryMac.mm:
(WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder):
* replay/SerializationMethods.cpp:
(JSC::EncodingTraits<PlatformKeyboardEvent>::encodeValue):
(JSC::EncodingTraits<PlatformKeyboardEvent>::decodeValue):
2016-09-30 Antti Koivisto <antti@apple.com>
Remove "rem" unit optimization for document element font size changes
https://bugs.webkit.org/show_bug.cgi?id=162778
Reviewed by Alex Christensen.
We awkwardly track from the parser level if any stylesheet in a document uses any rem units. This is only used to minimally
optimize a case where document element's (<html>) font size changes dynamically.
In practice such changes are rare. Browsing around I couldn't find a single case where this optimization got used.
Even if it was used it would be of low value as a full style resolution is likely to happen anyway (as font inherits)
and the only thing really saved is that we don't need to invalidate the matched properties cache.
* css/CSSGrammar.y.in:
* css/StyleSheetContents.cpp:
(WebCore::StyleSheetContents::StyleSheetContents):
* css/StyleSheetContents.h:
* dom/AuthorStyleSheets.cpp:
(WebCore::AuthorStyleSheets::updateActiveStyleSheets):
* dom/AuthorStyleSheets.h:
(WebCore::AuthorStyleSheets::usesRemUnits): Deleted.
(WebCore::AuthorStyleSheets::setUsesRemUnit): Deleted.
* dom/Document.cpp:
(WebCore::Document::recalcStyle):
(WebCore::Document::updateBaseURL):
* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::resolveElement):
2016-09-30 Zalan Bujtas <zalan@apple.com>
RenderLayer::clipRects may return nullptr.
https://bugs.webkit.org/show_bug.cgi?id=162729
Reviewed by Chris Dumez.
This patch refactors RenderLayer::updateClipRects(), parentClipRects() and backgroundClipRect()
so that we don't have to rely on this seemingly unsafe line: clipRects = *parent()->clipRects(clipRectsContext);
Now updateClipRects() returns the computed/cached clip rects as opposed to update and refetch them.
While this patch makes the code look more readable/safer, it also eliminates cached item tripple retrievals.
No change in functionality.
* rendering/RenderLayer.cpp:
(WebCore::ClipRectsCache::getClipRects):
(WebCore::ClipRectsCache::setClipRects):
(WebCore::RenderLayer::updateClipRects):
(WebCore::RenderLayer::clipRects):
(WebCore::RenderLayer::calculateClipRects):
* rendering/RenderLayer.h:
2016-09-30 Youenn Fablet <youenn@apple.com>
Add a way to go from a RefPtr<T> to Ref<const T>
https://bugs.webkit.org/show_bug.cgi?id=162683
Reviewed by Alex Christensen.
No change of behavior.
* Modules/fetch/FetchBody.cpp:
(WebCore::FetchBody::extract):
2016-09-30 Said Abou-Hallawa <sabouhallawa@apple.com>
Unreviewed, fix 32-bit build.
* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::decodedSizeChanged):
2016-09-30 Youenn Fablet <youenn@apple.com>
FetchBody should use UTF8Encoding to encode text data
https://bugs.webkit.org/show_bug.cgi?id=162775
Reviewed by Sam Weinig.
Covered by added tests.
Removing unnecesary vector allocation when extracting UTF8 bytes from a Request/Response text/URLSearchParams body.
Making use of UTF8Encoding for consistency with the upload code path.
* Modules/fetch/FetchBody.cpp:
(WebCore::FetchBody::consumeAsStream):
(WebCore::FetchBody::consumeText):
(WebCore::extractBytesFromText): Deleted.
2016-09-30 Said Abou-Hallawa <sabouhallawa@apple.com>
Change the MemoryCache and CachedResource adjustSize functions to take a long argument
https://bugs.webkit.org/show_bug.cgi?id=162708
<rdar://problem/28555702>
Reviewed by Brent Fulgham.
Because the MemoryCache stores the size of the cached memory in unsigned,
two problems my happen when reporting a change in the size of the memory:
1. Signed integer overflow -- which can happen because MemoryCache::adjustSize()
takes a signed integer argument. If the allocated or the freed memory size is
larger than the maximum of a signed integer, an overflow will happen.
For the image caching code, this can be seen where the unsigned decodedSize
is casted to an integer before passing it to ImageObserver::decodedSizeChanged().
2. Unsigned integer overflow -- which can happen if the new allocated memory
size plus the currentSize exceeds the maximum of unsigned.
This can be seen in MemoryCache::adjustSize() where we add delta to m_liveSize
or m_deadSize without checking whether this addition will overflow or not. We
do not assert for overflow although we assert for underflow.
The fix for these two problems can be the following:
1. Make all the adjustSize functions all the way till MemoryCache::adjustSize()
take a signed long integer argument.
2. Do not create a NativeImagePtr for an ImageFrame if its frameBytes plus the
ImageFrameCache::decodedSize() will exceed the maximum of an unsigned integer.
* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::decodedSizeChanged): Change the argument to be long. No overflow will happen when casting the argument from unsigned to long.
* loader/cache/CachedImage.h:
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::setDecodedSize): Use long integer casting when calling MemoryCache::adjustSize().
(WebCore::CachedResource::setEncodedSize): Ditto.
* loader/cache/MemoryCache.cpp:
(WebCore::MemoryCache::MemoryCache): Add as static assert to ensure sizeof(long long) can hold any unsigned or its negation.
(WebCore::MemoryCache::revalidationSucceeded): Use long integer casting when calling MemoryCache::adjustSize().
(WebCore::MemoryCache::remove): Ditto.
(WebCore::MemoryCache::adjustSize): Change the function argument to long integer. No overflow will happen when casting the argument from unsigned to long.
* loader/cache/MemoryCache.h:
* platform/graphics/ImageFrameCache.cpp:
(WebCore::ImageFrameCache::destroyIncompleteDecodedData): Call a function with its new name.
(WebCore::ImageFrameCache::decodedSizeChanged): Change the function argument to long integer. No overflow will happen when casting the argument from unsigned to long.
(WebCore::ImageFrameCache::decodedSizeIncreased): Use long integer casting when calling decodedSizeChanged().
(WebCore::ImageFrameCache::decodedSizeDecreased): Ditto.
(WebCore::ImageFrameCache::decodedSizeReset): Ditto.
(WebCore::ImageFrameCache::didDecodeProperties): Ditto.
(WebCore::ImageFrameCache::frameAtIndex): Do not create the NativeImage if adding its frameByes to the MemoryCache will cause numerical overflow.
(WebCore::ImageFrameCache::decodedSizeIncremented): Deleted. This function is renamed decodedSizeIncreased().
(WebCore::ImageFrameCache::decodedSizeDecremented): Deleted. This function is renamed decodedSizeDecreased().
* platform/graphics/ImageFrameCache.h:
* platform/graphics/ImageObserver.h:
* platform/graphics/IntSize.h:
(WebCore::IntSize::unclampedArea): Returns the area of an IntSize in size_t.
* platform/graphics/cg/PDFDocumentImage.cpp:
(WebCore::PDFDocumentImage::decodedSizeChanged): Use long integer casting when calling ImageObserver::decodedSizeChanged().
2016-09-30 Chris Dumez <cdumez@apple.com>
Add support for ImageData.data attribute
https://bugs.webkit.org/show_bug.cgi?id=162767
Reviewed by Sam Weinig.
Add support for ImageData.data attribute:
- https://html.spec.whatwg.org/#imagedata
Firefox already supports it.
No new tests, updated existing tests.
* html/ImageData.idl:
2016-09-30 Youenn Fablet <youenn@apple.com>
DumpRenderTree crashed in com.apple.WebCore: WTF::Optional<WebCore::FetchBodyOwner::BlobLoader>::operator bool const + 12
https://bugs.webkit.org/show_bug.cgi?id=162483
Reviewed by Alex Christensen.
Test: fetch/closing-while-fetching-blob.html
No change of behavior.
* Modules/fetch/FetchBodyOwner.cpp:
(WebCore::FetchBodyOwner::stop): Asserting m_blobLoader is null (meaning that unsetPendingActivity was done)
only in case FetchBodyOwner has no risk being destroyed.
2016-09-30 Youenn Fablet <youennf@gmail.com>
[Fetch API] Add support for URLSearchParams body
https://bugs.webkit.org/show_bug.cgi?id=162667
Reviewed by Alex Christensen.
Tests: imported/w3c/web-platform-tests/fetch/api/basic/request-upload-worker.html
imported/w3c/web-platform-tests/fetch/api/basic/request-upload.html
* Modules/fetch/FetchBody.cpp:
(WebCore::extractBytesFromText): Moving to a static function that should be moved to a String method.
(WebCore::FetchBody::FetchBody): Adding constructor for URLSearchParams.
(WebCore::FetchBody::extract): Adding URLSearchParams body initialization.
(WebCore::FetchBody::consume): Consuming URLSearchParams bodies.
(WebCore::FetchBody::consumeAsStream): Ditto.
(WebCore::FetchBody::consumeText): Updated to take a parameter to handle both text and URLSearchParams bodies.
(WebCore::FetchBody::bodyForInternalRequest): Add URLSearchParams body upload.
(WebCore::FetchBody::clone): Add URLSearchParams body cloning
* Modules/fetch/FetchBody.h:
(WebCore::FetchBody::urlSearchParamsBody):
* html/URLSearchParams.cpp:
(WebCore::URLSearchParams::toString):
* html/URLSearchParams.h:
2016-09-29 Simon Fraser <simon.fraser@apple.com>
Re-order the arguments to drawPattern() functions
https://bugs.webkit.org/show_bug.cgi?id=162772
Reviewed by Zalan Bujtas.
Re-order the arguments to have the destination rect come near the front,
leaving CompositeOperator and BlendMode hanging out at the back like
other drawing functions.
No behavior change.
* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::drawPattern):
* platform/graphics/BitmapImage.h:
* platform/graphics/CrossfadeGeneratedImage.cpp:
(WebCore::CrossfadeGeneratedImage::drawPattern):
* platform/graphics/CrossfadeGeneratedImage.h:
* platform/graphics/GeneratedImage.h:
* platform/graphics/GradientImage.cpp:
(WebCore::GradientImage::drawPattern):
* platform/graphics/GradientImage.h:
* platform/graphics/GraphicsContext.h:
* platform/graphics/Image.cpp:
(WebCore::Image::drawTiled):
* platform/graphics/Image.h:
* platform/graphics/ImageBuffer.h:
* platform/graphics/NamedImageGeneratedImage.cpp:
(WebCore::NamedImageGeneratedImage::drawPattern):
* platform/graphics/NamedImageGeneratedImage.h:
* platform/graphics/cairo/GraphicsContextCairo.cpp:
(WebCore::GraphicsContext::drawPattern):
* platform/graphics/cairo/ImageBufferCairo.cpp:
(WebCore::ImageBuffer::drawPattern):
* platform/graphics/cairo/ImageCairo.cpp:
(WebCore::Image::drawPattern):
* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::GraphicsContext::drawPattern):
* platform/graphics/cg/ImageBufferCG.cpp:
(WebCore::ImageBuffer::drawPattern):
* platform/graphics/cg/ImageCG.cpp: This file can probably be removed and the code moved, since the
code is almost the same as the cairo code, and not platform-specific.
(WebCore::Image::drawPattern):
* platform/graphics/displaylists/DisplayListItems.cpp:
(WebCore::DisplayList::DrawPattern::DrawPattern):
(WebCore::DisplayList::DrawPattern::apply):
* platform/graphics/displaylists/DisplayListItems.h:
(WebCore::DisplayList::DrawPattern::create):
* platform/graphics/displaylists/DisplayListRecorder.cpp:
(WebCore::DisplayList::Recorder::drawPattern):
* platform/graphics/displaylists/DisplayListRecorder.h:
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::drawPatternForContainer):
* svg/graphics/SVGImageForContainer.cpp:
(WebCore::SVGImageForContainer::drawPattern):
* svg/graphics/SVGImageForContainer.h:
2016-09-29 Chris Dumez <cdumez@apple.com>
Add support for download attribute on area elements
https://bugs.webkit.org/show_bug.cgi?id=162765
Reviewed by Brent Fulgham.
Add support for download attribute on area elements:
- https://html.spec.whatwg.org/#htmlanchorelement
Because HTMLAreaElement inherits from HTMLAnchorElement on native side,
and because HTMLAnchorElement already supports the download attribute,
all that was needed was to add the download attribute to
HTMLAreaElement.idl file.
Test: http/tests/download/area-download.html
* html/HTMLAreaElement.idl:
2016-09-29 Ryosuke Niwa <rniwa@webkit.org>
Editor::findStringAndScrollToVisible is unused
https://bugs.webkit.org/show_bug.cgi?id=162762
Reviewed by Simon Fraser.
Deleted the unused function.
* editing/Editor.cpp:
(WebCore::Editor::findStringAndScrollToVisible): Deleted.
* editing/Editor.h:
2016-09-29 Jiewen Tan <jiewen_tan@apple.com>
Expose CryptoKey to web workers
https://bugs.webkit.org/show_bug.cgi?id=162640
<rdar://problem/28182204>
Reviewed by Brent Fulgham.
Tests: crypto/workers/aes-postMessage-worker.html
crypto/workers/hmac-postMessage-worker.html
crypto/workers/hrsa-postMessage-worker.html
crypto/workers/multiple-postMessage-worker.html
crypto/workers/rsa-postMessage-worker.html
* crypto/CryptoKey.idl:
* crypto/SerializedCryptoKeyWrap.h:
* crypto/mac/SerializedCryptoKeyWrapMac.mm:
(WebCore::deleteDefaultWebCryptoMasterKey):
Add a way to delete the default web crypto master key such that we can test
these APIs and cleanup.
* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::wrapCryptoKey):
(WebCore::WorkerGlobalScope::unwrapCryptoKey):
* workers/WorkerGlobalScope.h:
2016-09-29 Nan Wang <n_wang@apple.com>
AX: iOS: Tapping <input> in Safari zooms in a bit when page has max scale = 1
https://bugs.webkit.org/show_bug.cgi?id=162471
Reviewed by Simon Fraser.
If the author has defined a maximum scale, we should honor that when keyboard focus moves
to a text field, instead of using the forceAlwaysUserScalableMaximumScale.
Tests: fast/forms/ios/user-scalable-does-not-scale-for-keyboard-focus-with-author-defined-scale.html
fast/forms/ios/user-scalable-does-not-scale-for-keyboard-focus-with-user-scalable-no.html
fast/forms/ios/user-scalable-scales-for-keyboard-focus-with-no-author-defined-scale.html
* page/ViewportConfiguration.cpp:
(WebCore::ViewportConfiguration::allowsUserScaling):
(WebCore::ViewportConfiguration::allowsUserScalingIgnoringAlwaysScalable):
(WebCore::ViewportConfiguration::allowsUserScalingIgnoringForceAlwaysScaling): Deleted.
* page/ViewportConfiguration.h:
(WebCore::ViewportConfiguration::maximumScaleIgnoringAlwaysScalable):
(WebCore::ViewportConfiguration::maximumScale): Deleted.
2016-09-29 Alex Christensen <achristensen@webkit.org>
Fix syntax violation handling in IPv4 address parsing
https://bugs.webkit.org/show_bug.cgi?id=162756
Reviewed by Tim Horton.
When we are parsing the up to 4 numbers in an IPv4 address, if we find a syntax violation
(the canonicalized address would be different than the input string) then wait to report
it until we have determined that this is a valid IPv4 address that will be canonicalized.
If it is not a valid IPv4 address, then we will just treat the characters as the host, and
that could be no syntax violation.
Covered by a new API test and existing API tests.
* platform/URLParser.cpp:
(WebCore::URLParser::URLParser):
(WebCore::URLParser::parseIPv4Number):
(WebCore::URLParser::parseIPv4Host):
* platform/URLParser.h:
2016-09-29 Chris Dumez <cdumez@apple.com>
Fix post-landing nits after r206561.
https://bugs.webkit.org/show_bug.cgi?id=162659
Reviewed by Alex Christensen.
Uses more StringViews and constness.
* dom/SecurityContext.cpp:
(WebCore::SecurityContext::isSupportedSandboxPolicy):
* dom/SecurityContext.h:
* html/DOMTokenList.cpp:
(WebCore::DOMTokenList::DOMTokenList):
(WebCore::DOMTokenList::supports):
* html/DOMTokenList.h:
(WebCore::DOMTokenList::DOMTokenList):
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::relList):
* html/HTMLIFrameElement.cpp:
(WebCore::HTMLIFrameElement::sandbox):
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::relList):
* html/LinkRelAttribute.cpp:
(WebCore::LinkRelAttribute::isSupported):
* html/LinkRelAttribute.h:
2016-09-29 Alex Christensen <achristensen@webkit.org>
URLParser should correctly parse ports with leading 0's
https://bugs.webkit.org/show_bug.cgi?id=162752
* platform/URLParser.cpp:
(WebCore::URLParser::parsePort):
Followup. Remove branches based on Geoffrey's feedback.
2016-09-29 Alex Christensen <achristensen@webkit.org>
URLParser should correctly parse ports with leading 0's
https://bugs.webkit.org/show_bug.cgi?id=162752
Reviewed by Tim Horton.
Covered by new API tests.
* platform/URLParser.cpp:
(WebCore::URLParser::parsePort):
2016-09-29 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r206483.
https://bugs.webkit.org/show_bug.cgi?id=162750
May have caused iOS perf regression (Requested by smfr on
#webkit).
Reverted changeset:
"REGRESSION (r204552): Yelp carousel animation is not smooth."
https://bugs.webkit.org/show_bug.cgi?id=162632
http://trac.webkit.org/changeset/206483
2016-09-29 Alex Christensen <achristensen@webkit.org>
URLParser: make parsing invalid IPv4 addresses more robust and correct
https://bugs.webkit.org/show_bug.cgi?id=162746
Reviewed by Tim Horton.
If parsing an IPv4 address fails, the characters are just treated as a regular domain.
Covered by new API tests.
* platform/URLParser.cpp:
(WebCore::URLParser::parseIPv4Number):
(WebCore::URLParser::parseIPv4Host):
2016-09-29 Alex Christensen <achristensen@webkit.org>
URLParser: IPv6 addresses followed by a colon are invalid
https://bugs.webkit.org/show_bug.cgi?id=162747
Reviewed by Tim Horton.
Covered by new API tests.
* platform/URLParser.cpp:
(WebCore::URLParser::parseIPv6Host):
2016-09-29 Antoine Quint <graouts@apple.com>
[Modern Media Controls] scheduler for layout nodes
https://bugs.webkit.org/show_bug.cgi?id=162726
<rdar://problem/28543043>
Reviewed by Dean Jackson.
For the work on the modern media controls we will be using a tree of LayoutNode objects that will
commit to the DOM in coordinated `requestAnimationFrame()` calls to ensure all layouts are done
in an efficient and coordinated manner. As a preamble, we introduce a `scheduler` singleton which
provides a single public method `scheduleLayout(callback)` to queue callbacks to be fired in the
next `requestAnimationFrame()` callback.
Tests: media/modern-media-controls/scheduler/not-reentrant.html
media/modern-media-controls/scheduler/single-callback-when-registered-multiple-times.html
* Modules/modern-media-controls/controls/scheduler.js: Added.
(const.scheduler.new.prototype.scheduleLayout):
(const.scheduler.new.prototype._requestFrameIfNeeded):
(const.scheduler.new.prototype._frameDidFire):
(const.scheduler.new.prototype._layout):
2016-09-28 Ryosuke Niwa <rniwa@webkit.org>
Text nodes assigned to a linked slot are not clickable
https://bugs.webkit.org/show_bug.cgi?id=162091
<rdar://problem/28383300>
Reviewed by Antti Koivisto.
The bug was caused by updateMouseEventTargetNode adjusting the target to its parent element when
the original target was a text node. Fixed the bug by using the parent element in the composed tree.
Also fixed the bug that the hit testing was not finding the anchor element and keeping the cursor
in I-beam by traversing the composed tree instead.
Test: fast/shadow-dom/click-text-inside-linked-slot.html
* dom/Node.cpp:
(WebCore::Node::enclosingLinkEventParentOrSelf): Fixed the cursor problem.
* page/EventHandler.cpp:
(WebCore::EventHandler::updateMouseEventTargetNode): Fixed the activation problem.
2016-09-29 Sam Weinig <sam@webkit.org>
Allow overriding some NSURLSessionConfiguration properties on a per-NetworkProcess basis
<rdar://problem/27648683>
https://bugs.webkit.org/show_bug.cgi?id=162735
Reviewed by Dan Bernstein.
* platform/spi/cf/CFNetworkSPI.h:
Forward declare _sourceApplicationSecondaryIdentifier and _CTDataConnectionServiceType
2016-09-29 Antti Koivisto <antti@apple.com>
Remove addSubresourceStyleURLs functions
https://bugs.webkit.org/show_bug.cgi?id=162731
Reviewed by Ryosuke Niwa.
Use the generic std::function taking traverseSubresources instead. This prevents bugs caused by the code paths
not being in sync.
These functions are only used by the legacy webarchive code to gather URLs to locate CachedResources from the memory cache.
This can be improved further by returning the cached resources themselves instead of the URLs.
* css/CSSFontFaceSrcValue.cpp:
(WebCore::CSSFontFaceSrcValue::addSubresourceStyleURLs): Deleted.
* css/CSSFontFaceSrcValue.h:
* css/CSSPrimitiveValue.cpp:
(WebCore::CSSPrimitiveValue::addSubresourceStyleURLs): Deleted.
* css/CSSPrimitiveValue.h:
* css/CSSReflectValue.cpp:
(WebCore::CSSReflectValue::addSubresourceStyleURLs): Deleted.
* css/CSSReflectValue.h:
* css/CSSValue.cpp:
(WebCore::CSSValue::addSubresourceStyleURLs): Deleted.
* css/CSSValue.h:
* css/CSSValueList.cpp:
(WebCore::CSSValueList::addSubresourceStyleURLs): Deleted.
* css/CSSValueList.h:
* css/StyleProperties.cpp:
(WebCore::StyleProperties::addSubresourceStyleURLs): Deleted.
* css/StyleProperties.h:
* css/StyleRuleImport.h:
* css/StyleSheetContents.cpp:
(WebCore::StyleSheetContents::traverseSubresources):
Fix a bug where this would miss @import rules in @imported stylesheets.
Include the CachedResource for the imported stylesheet itself.
Tested by the test cases under LayoutTests/webarchive
(WebCore::StyleSheetContents::addSubresourceStyleURLs): Deleted.
* css/StyleSheetContents.h:
* dom/StyledElement.cpp:
(WebCore::StyledElement::addSubresourceAttributeURLs):
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::addSubresourceAttributeURLs):
* html/HTMLStyleElement.cpp:
(WebCore::HTMLStyleElement::addSubresourceAttributeURLs):
2016-09-29 Brent Fulgham <bfulgham@apple.com>
[Win][Direct2D] Add D2D Font handling code
https://bugs.webkit.org/show_bug.cgi?id=162712
Reviewed by Brent Fulgham.
This patch lands a set of new files that implement
No new tests until complete backend lands.
* platform/graphics/Font.h:
* platform/graphics/FontCascade.h:
(WebCore::FontCascade::syntheticObliqueAngle): Added helper function.
* platform/graphics/FontPlatformData.h:
(WebCore::FontPlatformData::dwFont): Added.
(WebCore::FontPlatformData::dwFontFace): Ditto.
* platform/graphics/GlyphBuffer.h:
* platform/graphics/cocoa/FontCascadeCocoa.mm:
(WebCore::FontCascade::drawGlyphs): Use helper function.
* platform/graphics/win/FontCGWin.cpp:
(WebCore::FontCascade::drawGlyphs): Ditto.
* platform/graphics/win/FontCacheWin.cpp:
(WebCore::FontCache::createFontPlatformData): Add case for Direct2D.
* platform/graphics/win/FontCascadeDirect2D.cpp: Added.
* platform/graphics/win/FontCustomPlatformData.cpp:
(WebCore::FontCustomPlatformData::~FontCustomPlatformData): Fix whitespace.
(WebCore::FontCustomPlatformData::fontPlatformData): Add Direct2D case.
* platform/graphics/win/FontPlatformDataCGWin.cpp:
(WebCore::FontPlatformData::FontPlatformData): Clean up C++ initializers.
* platform/graphics/win/FontPlatformDataCairoWin.cpp:
(WebCore::FontPlatformData::FontPlatformData): Ditto.
* platform/graphics/win/FontPlatformDataDirect2D.cpp: Added.
* platform/graphics/win/FontPlatformDataWin.cpp:
(WebCore::FontPlatformData::FontPlatformData): Clean up C++ initializers.
* platform/graphics/win/GlyphPageTreeNodeDirect2D.cpp: Added.
* platform/graphics/win/SimpleFontDataDirect2D.cpp: Added.
* platform/graphics/win/TextAnalyzerHelper.cpp: Added.
* platform/graphics/win/TextAnalyzerHelper.h: Added.
2016-09-29 Alex Christensen <achristensen@webkit.org>
URLParser should fail to parse unclosed IPv6 addresses
https://bugs.webkit.org/show_bug.cgi?id=162715
Reviewed by Tim Horton.
Covered by new API tests.
* platform/URLParser.cpp:
(WebCore::URLParser::parseHostAndPort):
2016-09-29 Alex Christensen <achristensen@webkit.org>
URLParser should ignore tabs at all possible locations
https://bugs.webkit.org/show_bug.cgi?id=162711
Reviewed by Tim Horton.
The URL spec says to remove all tabs and newlines before parsing a URL.
To reduce passes on the URL and copies of data, I chose to just ignore them every time I increment the iterator.
This is fragile, but faster. It can be completely tested, though. That is what this patch does.
Covered by an addition to the API tests that tries inserting one tab at each location of each test.
* platform/URLParser.cpp:
(WebCore::URLParser::advance):
(WebCore::URLParser::isWindowsDriveLetter):
(WebCore::URLParser::appendWindowsDriveLetter):
(WebCore::URLParser::isPercentEncodedDot):
(WebCore::URLParser::isSingleDotPathSegment):
(WebCore::URLParser::isDoubleDotPathSegment):
(WebCore::URLParser::consumeSingleDotPathSegment):
(WebCore::URLParser::consumeDoubleDotPathSegment):
(WebCore::URLParser::checkLocalhostCodePoint):
(WebCore::URLParser::isAtLocalhost):
(WebCore::URLParser::isLocalhost):
(WebCore::URLParser::URLParser):
(WebCore::URLParser::parse):
(WebCore::isPercentEncodedDot): Deleted.
(WebCore::isSingleDotPathSegment): Deleted.
(WebCore::isDoubleDotPathSegment): Deleted.
(WebCore::consumeSingleDotPathSegment): Deleted.
(WebCore::consumeDoubleDotPathSegment): Deleted.
* platform/URLParser.h:
(WebCore::URLParser::advance):
2016-09-29 Simon Fraser <simon.fraser@apple.com>
Fix hit testing on display:block <svg> elements
https://bugs.webkit.org/show_bug.cgi?id=162717
rdar://problem/23261130
Reviewed by Zalan Bujtas.
RenderSVGRoot::nodeAtPoint() needs to test for both the HitTestBlockBackground and
HitTestChildBlockBackground phases, since we only get the HitTestChildBlockBackground
phase when the <svg> is a block. This is similar to code in RenderTable::nodeAtPoint(),
and matches Blink code.
This fixes the point dragging on http://anthonydugois.com/svg-path-builder/.
Test: svg/hittest/block-svg.html
* rendering/svg/RenderSVGRoot.cpp:
(WebCore::RenderSVGRoot::nodeAtPoint):
2016-09-29 Chris Dumez <cdumez@apple.com>
Assigning non-numeric to input.minlength should set minlength to 0
https://bugs.webkit.org/show_bug.cgi?id=162727
Reviewed by Ryosuke Niwa.
There was a typo when we were updating the m_minLength member from the 'min'
content attribute instead of the 'minlength' one.
Test: imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/minlength.html.
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::parseAttribute):
2016-09-29 Chris Dumez <cdumez@apple.com>
[Web IDL] Fix overload resolution when the distinguishing argument is a Window
https://bugs.webkit.org/show_bug.cgi?id=162728
Reviewed by Ryosuke Niwa.
Fix overload resolution when the distinguishing argument is a Window.
Window is special because we could have a window or a proxy to the
Window (JSDOMWindowShell).
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateOverloadedFunctionOrConstructor):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod9):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod10):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod11):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod12):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod13):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod):
* bindings/scripts/test/TestObj.idl:
2016-09-29 Per Arne Vollan <pvollan@apple.com>
[Win] Compile fix.
https://bugs.webkit.org/show_bug.cgi?id=162262
Reviewed by Anders Carlsson.
If CoreText.h is included, we will get redefinition compile errors on some older SDK
versions.
* platform/spi/win/CoreTextSPIWin.h:
2016-09-29 Carlos Garcia Campos <cgarcia@igalia.com>
[SOUP] Remove WebCoreSynchronousLoader from ResourceHandleSoup
https://bugs.webkit.org/show_bug.cgi?id=162723
Reviewed by Sergio Villar Senin.
Since all soup based ports switched to NetworkProcess this is dead code.
* platform/network/soup/ResourceHandleSoup.cpp:
(WebCore::ResourceHandle::platformLoadResourceSynchronously):
2016-09-29 Nan Wang <n_wang@apple.com>
AX: Meter: [Mac] Content in label element should be used as AXTitle or AXDescription
https://bugs.webkit.org/show_bug.cgi?id=162586
Reviewed by Chris Fleizach.
Exposed the label element's text as AXDescription for meter elements.
Also refactored the code for fetching the label element's text and taken care of
the case where aria-label and aria-labelledby attributes are used on label elements.
Test: accessibility/mac/meter-with-label-element.html
* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::isLabelable):
(WebCore::AccessibilityNodeObject::textForLabelElement):
(WebCore::AccessibilityNodeObject::titleElementText):
(WebCore::AccessibilityNodeObject::title):
(WebCore::AccessibilityNodeObject::usesAltTagForTextComputation): Deleted.
* accessibility/AccessibilityNodeObject.h:
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::exposesTitleUIElement):
2016-09-29 Romain Bellessort <romain.bellessort@crf.canon.fr>
[Streams API] Improve ReadableStreamDefaultController.h/cpp
https://bugs.webkit.org/show_bug.cgi?id=160293
Reviewed by Youenn Fablet.
Various small improvements in ReadableStreamDefaultController code (helper methods and asserts).
No change in behaviour.
* bindings/js/ReadableStreamDefaultController.cpp:
(WebCore::ReadableStreamDefaultController::isControlledReadableStreamLocked): Added an assert and updated based
on new helper methods.
* bindings/js/ReadableStreamDefaultController.h:
(WebCore::ReadableStreamDefaultController::close): Updated based on new helper methods.
(WebCore::ReadableStreamDefaultController::error): Updated based on new helper methods.
(WebCore::ReadableStreamDefaultController::enqueue): Added an assert and updated based on new helper methods.
(WebCore::ReadableStreamDefaultController::jsController): New helper method.
(WebCore::ReadableStreamDefaultController::globalObject): Return reference instead of pointer.
(WebCore::ReadableStreamDefaultController::globalExec): New helper; return reference after performing an assert.
(WebCore::ReadableStreamDefaultController::error<String>): Added an assert and updated based on new helper methods.
2016-09-29 Jon Davis <jond@apple.com>
Added Beacon API to the Feature Status page.
https://bugs.webkit.org/show_bug.cgi?id=162630
Reviewed by Alex Christensen.
* features.json:
2016-09-28 Chris Dumez <cdumez@apple.com>
Drop first 'state' parameter to JSDOMWindow::toWrapped() / JSEventTarget::toWrapped()
https://bugs.webkit.org/show_bug.cgi?id=162709
Reviewed by Alex Christensen.
Drop first 'state' parameter to JSDOMWindow::toWrapped() / JSEventTarget::toWrapped()
as it is unused. This is the quickest way to allow DOMWindow / EventTarget members
in IDL dictionaries. This is because the generated bindings code relies on
convertWrapperType() in JSDOMConvert.h which calls toWrapped() with a single
parameter. Right now, the only type that requires an ExecState for its toWrapped()
is XPathNSResolver (which should likely be a callback interface rather than a
regular interface).
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::toWrapped):
* bindings/js/JSDictionary.cpp:
(WebCore::JSDictionary::convertValue):
* bindings/js/JSEventTargetCustom.cpp:
(WebCore::JSEventTarget::toWrapped):
* bindings/js/JSMessageEventCustom.cpp:
(WebCore::handleInitMessageEvent):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
(JSValueToNative):
2016-09-28 Chris Dumez <cdumez@apple.com>
Log console messages when the anchor download attribute is ignored
https://bugs.webkit.org/show_bug.cgi?id=162703
Reviewed by Alex Christensen.
Log console messages when the anchor download attribute is ignored so
that the developer can better understand what's happening.
No new tests, rebaselined existing tests.
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::handleClick):
2016-09-28 Chris Dumez <cdumez@apple.com>
Add support for DOMTokenList.supports()
https://bugs.webkit.org/show_bug.cgi?id=162659
Reviewed by Ryosuke Niwa.
Add support for DOMTokenList.supports():
- https://dom.spec.whatwg.org/#dom-domtokenlist-supports
Firefox and Chrome already recently implemented it (Chrome since
version 50 and Firefox since version 49).
Test: fast/dom/DOMTokenList-supports.html
* dom/SecurityContext.cpp:
(WebCore::SecurityContext::isSupportedSandboxPolicy):
(WebCore::SecurityContext::enforceSandboxFlags): Deleted.
* dom/SecurityContext.h:
* html/DOMTokenList.cpp:
(WebCore::DOMTokenList::DOMTokenList):
(WebCore::DOMTokenList::supports):
(WebCore::DOMTokenList::replace): Deleted.
* html/DOMTokenList.h:
(WebCore::DOMTokenList::DOMTokenList):
* html/DOMTokenList.idl:
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::parseAttribute):
(WebCore::HTMLAnchorElement::relList):
* html/HTMLAnchorElement.idl:
* html/HTMLAreaElement.idl:
* html/HTMLIFrameElement.cpp:
(WebCore::HTMLIFrameElement::sandbox):
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::relList):
* html/HTMLTableCellElement.idl:
* html/LinkRelAttribute.cpp:
(WebCore::LinkRelAttribute::isSupported):
(WebCore::LinkRelAttribute::LinkRelAttribute): Deleted.
* html/LinkRelAttribute.h:
2016-09-28 Ryosuke Niwa <rniwa@webkit.org>
DOMTokenList’s value and stringifier should not return parsed tokens
https://bugs.webkit.org/show_bug.cgi?id=161076
Reviewed by Chris Dumez.
Updated our implementation of DOMTokenList.prototype.value and its toString function
to match the latest DOM specification: https://dom.spec.whatwg.org/#interface-domtokenlist
"value" attribute, on getting, runs its serialize steps, which simply gets the attribute value.
On setting, it sets the attribute value with the given value.
The stringification behavior returns the same serialize steps as "value" attribute on getting.
This change simplifies our implementation of DOMTokenList and removes the need for m_cachedValue,
which has been removed in this patch.
No new tests since existing tests cover this.
* html/DOMTokenList.cpp:
(WebCore::DOMTokenList::value): Just call getAttribute.
(WebCore::DOMTokenList::setValue): Just call setAttribute.
(WebCore::DOMTokenList::updateTokensFromAttributeValue):
(WebCore::DOMTokenList::associatedAttributeValueChanged):
(WebCore::DOMTokenList::updateAssociatedAttributeFromTokens): Moved the code to update the tokens
from from the attribute value. This is the "update steps".
* html/DOMTokenList.h:
2016-09-28 Jer Noble <jer.noble@apple.com>
CRASH at WebCore::CDMSessionAVStreamSession::update + 950
https://bugs.webkit.org/show_bug.cgi?id=162701
Reviewed by Beth Dakin.
If the SourceBuffer backing a <video> element is removed before CDMSessionAVStreamSession::update() gets
a chance to run, the protectedSourceBuffer will be null. Just bail early and indicate an error.
* platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
(WebCore::CDMSessionAVStreamSession::update):
2016-09-28 Alex Christensen <achristensen@webkit.org>
URLParser should properly handle unexpected periods and overflows in IPv4 addresses
https://bugs.webkit.org/show_bug.cgi?id=162655
Reviewed by Geoffrey Garen.
Covered by new API tests.
* platform/URLParser.cpp:
(WebCore::URLParser::parseIPv4Number):
(WebCore::URLParser::parseIPv4Host):
* platform/URLParser.h:
2016-09-28 Wenson Hsieh <wenson_hsieh@apple.com>
Some media tests are crashing due to soft-linking failures
https://bugs.webkit.org/show_bug.cgi?id=162698
Reviewed by Jer Noble.
We should be handling soft-linking failures for MRMediaRemoteSetNowPlayingVisibility gracefully. Guards these
calls with canLoad_MediaRemote_MRMediaRemoteSetParentApplication and also use the
SOFT_LINK_FUNCTION_MAY_FAIL_FOR_HEADER macro when soft linking.
* platform/audio/mac/MediaSessionManagerMac.mm:
(WebCore::MediaSessionManagerMac::updateNowPlayingInfo):
* platform/mac/MediaRemoteSoftLink.cpp:
* platform/mac/MediaRemoteSoftLink.h:
2016-09-28 Alex Christensen <achristensen@webkit.org>
URLParser should ignore tabs in authority
https://bugs.webkit.org/show_bug.cgi?id=162694
Reviewed by Geoffrey Garen.
Covered by new API tests.
* platform/URLParser.cpp:
(WebCore::URLParser::parseAuthority):
2016-09-28 Alex Christensen <achristensen@webkit.org>
URLParser should ignore extra slashes after scheme:// and handle a missing slash after the port
https://bugs.webkit.org/show_bug.cgi?id=162690
Reviewed by Geoffrey Garen.
Covered by new API tests.
* platform/URLParser.cpp:
(WebCore::URLParser::parse):
2016-09-28 Alex Christensen <achristensen@webkit.org>
URLParser should correctly canonicalize uppercase IPv6 addresses
https://bugs.webkit.org/show_bug.cgi?id=162680
Reviewed by Tim Horton.
Covered by a new API test.
* platform/URLParser.cpp:
(WebCore::URLParser::parseIPv6Host):
If there is an uppercase character in the IPv6 address part, then it is a syntax violation
because the canonicalized IPv6 address differs from the input String.
2016-09-28 Chris Dumez <cdumez@apple.com>
Unreviewed, fix iOS build.
* bindings/js/ios/TouchConstructors.cpp:
2016-09-28 Chris Dumez <cdumez@apple.com>
It should be possible to dispatch events on template documents
https://bugs.webkit.org/show_bug.cgi?id=162687
Reviewed by Ryosuke Niwa.
It should be possible to dispatch events on template documents. Firefox
supports this. Chrome does not but this is likely not intentional as
Chrome generally supports dispatching events on frameless documents.
Test: fast/dom/template-document-dispatchEvent.html
* dom/Document.cpp:
(WebCore::Document::ensureTemplateDocument):
2016-09-27 Dean Jackson <dino@apple.com>
Use Color references where possible
https://bugs.webkit.org/show_bug.cgi?id=162643
<rdar://problem/28506550>
Reviewed by Simon Fraser.
There were a bunch of places where we pass or use
Colors by value. As the Color class gets a bit more
complicated, it would be nice to avoid copying, so
use references where possible.
* css/CSSGradientValue.cpp:
(WebCore::interpolate):
* css/StyleColor.h:
(WebCore::StyleColor::getColor):
(WebCore::StyleColor::resolve):
* css/StyleResolver.h:
(WebCore::StyleResolver::State::backgroundColor):
* dom/Document.h:
(WebCore::Document::textColor):
* editing/FrameSelection.cpp:
(WebCore::disappearsIntoBackground):
* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::setShadow):
* html/canvas/CanvasRenderingContext2D.h:
* html/track/TextTrackCueGeneric.h:
* page/PageOverlay.cpp:
(WebCore::PageOverlay::setBackgroundColor):
* page/PageOverlay.h:
* page/animation/CSSPropertyAnimation.cpp:
(WebCore::PropertyWrapperColor::PropertyWrapperColor):
(WebCore::PropertyWrapperMaybeInvalidColor::PropertyWrapperMaybeInvalidColor):
(WebCore::PropertyWrapperVisitedAffectedColor::PropertyWrapperVisitedAffectedColor):
* platform/graphics/GraphicsContext.cpp:
(WebCore::GraphicsContext::fillRectWithRoundedHole):
* platform/graphics/GraphicsContext.h:
(WebCore::GraphicsContext::strokeColor):
(WebCore::GraphicsContext::fillColor):
* platform/graphics/InbandTextTrackPrivateClient.h:
(WebCore::GenericCueData::foregroundColor):
(WebCore::GenericCueData::setForegroundColor):
(WebCore::GenericCueData::backgroundColor):
(WebCore::GenericCueData::setBackgroundColor):
(WebCore::GenericCueData::highlightColor):
(WebCore::GenericCueData::setHighlightColor):
* platform/graphics/ca/TileController.h:
* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::GraphicsContext::drawRect):
(WebCore::GraphicsContext::fillRect):
(WebCore::GraphicsContext::platformFillRoundedRect):
(WebCore::GraphicsContext::fillRectWithRoundedHole):
* platform/graphics/displaylists/DisplayListItems.h:
(WebCore::DisplayList::DrawFocusRingPath::color):
(WebCore::DisplayList::DrawFocusRingRects::color):
(WebCore::DisplayList::FillRectWithColor::color):
(WebCore::DisplayList::FillCompositedRect::color):
(WebCore::DisplayList::FillRoundedRect::color):
(WebCore::DisplayList::FillRectWithRoundedHole::color):
* platform/graphics/filters/FEDiffuseLighting.cpp:
(WebCore::FEDiffuseLighting::lightingColor):
* platform/graphics/filters/FEDiffuseLighting.h:
* platform/graphics/filters/FEDropShadow.h:
(WebCore::FEDropShadow::shadowColor):
* platform/graphics/filters/FEFlood.cpp:
(WebCore::FEFlood::floodColor):
(WebCore::FEFlood::platformApplySoftware):
* platform/graphics/filters/FEFlood.h:
* platform/graphics/filters/FESpecularLighting.cpp:
(WebCore::FESpecularLighting::lightingColor):
* platform/graphics/filters/FESpecularLighting.h:
* platform/graphics/filters/FilterOperation.h:
* rendering/BorderEdge.h:
(WebCore::BorderEdge::color):
* rendering/InlineFlowBox.cpp:
(WebCore::InlineFlowBox::paintBoxDecorations):
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paintSelection):
* rendering/InlineTextBox.h:
* rendering/RenderFrameSet.cpp:
(WebCore::borderStartEdgeColor):
(WebCore::borderEndEdgeColor):
(WebCore::borderFillColor):
* rendering/RenderInline.cpp:
(WebCore::RenderInline::paintOutlineForLine):
* rendering/RenderInline.h:
* rendering/RenderLayerCompositor.h:
* rendering/RenderView.cpp:
(WebCore::RenderView::paintBoxDecorations):
* rendering/TextDecorationPainter.cpp:
(WebCore::TextDecorationPainter::paintTextDecoration):
* rendering/TextPainter.cpp:
(WebCore::TextPainter::paintTextWithShadows):
* rendering/style/BorderValue.h:
(WebCore::BorderValue::color):
* rendering/style/CollapsedBorderValue.h:
(WebCore::CollapsedBorderValue::color):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::color):
(WebCore::RenderStyle::visitedLinkColor):
(WebCore::RenderStyle::setColor):
(WebCore::RenderStyle::setVisitedLinkColor):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::borderLeftColor):
(WebCore::RenderStyle::borderRightColor):
(WebCore::RenderStyle::borderTopColor):
(WebCore::RenderStyle::borderBottomColor):
(WebCore::RenderStyle::backgroundColor):
(WebCore::RenderStyle::columnRuleColor):
(WebCore::RenderStyle::outlineColor):
(WebCore::RenderStyle::textEmphasisColor):
(WebCore::RenderStyle::textFillColor):
(WebCore::RenderStyle::textStrokeColor):
(WebCore::RenderStyle::visitedLinkBackgroundColor):
(WebCore::RenderStyle::visitedLinkBorderLeftColor):
(WebCore::RenderStyle::visitedLinkBorderRightColor):
(WebCore::RenderStyle::visitedLinkBorderBottomColor):
(WebCore::RenderStyle::visitedLinkBorderTopColor):
(WebCore::RenderStyle::visitedLinkOutlineColor):
(WebCore::RenderStyle::visitedLinkColumnRuleColor):
(WebCore::RenderStyle::textDecorationColor):
(WebCore::RenderStyle::visitedLinkTextDecorationColor):
(WebCore::RenderStyle::visitedLinkTextEmphasisColor):
(WebCore::RenderStyle::visitedLinkTextFillColor):
(WebCore::RenderStyle::visitedLinkTextStrokeColor):
(WebCore::RenderStyle::stopColor):
(WebCore::RenderStyle::floodColor):
(WebCore::RenderStyle::lightingColor):
* svg/SVGFEDiffuseLightingElement.cpp:
(WebCore::SVGFEDiffuseLightingElement::build):
* svg/SVGFEDropShadowElement.cpp:
(WebCore::SVGFEDropShadowElement::build):
* svg/SVGFEFloodElement.cpp:
(WebCore::SVGFEFloodElement::build):
* svg/SVGFESpecularLightingElement.cpp:
(WebCore::SVGFESpecularLightingElement::build):
* svg/SVGGradientElement.cpp:
(WebCore::SVGGradientElement::buildStops):
2016-09-28 Ryosuke Niwa <rniwa@webkit.org>
assignedNodes should include fallback contents when flattened option is set
https://bugs.webkit.org/show_bug.cgi?id=162656
Reviewed by Antti Koivisto.
Fixed the bug by traversing through fallback contents when there are no assigned nodes.
Tests: imported/w3c/web-platform-tests/shadow-dom/slots.html
imported/w3c/web-platform-tests/shadow-dom/slots-fallback.html
* html/HTMLSlotElement.cpp:
(WebCore::flattenAssignedNodes):
(WebCore::HTMLSlotElement::assignedNodes):
2016-09-27 Wenson Hsieh <wenson_hsieh@apple.com>
Adopt MediaRemote SPI to achieve desired Now Playing behavior
https://bugs.webkit.org/show_bug.cgi?id=162658
<rdar://problem/28499358>
Reviewed by Jer Noble.
Restores the changes previously rolled out in r206444, and adopts new MediaRemote SPI to achieve the desired
behavior for media in background tabs without breaking other features.
Introduces 2 new unit tests in NowPlayingControlsTests.
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::pageAllowsNowPlayingControls):
* page/Page.cpp:
(WebCore::Page::setViewState):
* platform/audio/PlatformMediaSessionManager.h:
(WebCore::PlatformMediaSessionManager::hasActiveNowPlayingSession):
* platform/audio/mac/MediaSessionManagerMac.h:
* platform/audio/mac/MediaSessionManagerMac.mm:
(WebCore::MediaSessionManagerMac::updateNowPlayingInfo):
* platform/mac/MediaRemoteSoftLink.cpp:
* platform/mac/MediaRemoteSoftLink.h:
* platform/spi/mac/MediaRemoteSPI.h:
2016-09-28 Said Abou-Hallawa <sabouhallawa@apple.com>
REGRESSION(r206481): ASSERTION FAILED: isDecoderAvailable()
https://bugs.webkit.org/show_bug.cgi?id=162665
Reviewed by Simon Fraser.
Remove a wrong assertion from ImageSource::destroyDecodedData(). Before
r206481, the original function BitmapImage::destroyDecodedData() did not
have this assertion. Destroying the decoded ImageFrames can happen after
releasing the ImageDecoder. And it can happen also if decoding the image
fails and BitmapImage::isNull() is true. See CachedImage::finishLoading().
* platform/graphics/ImageSource.cpp:
(WebCore::ImageSource::destroyDecodedData):
2016-09-28 Youenn Fablet <youenn@apple.com>
WebCore::ResourceErrorBase::setType is crashing
https://bugs.webkit.org/show_bug.cgi?id=162484
<rdar://problem/28390828>
Reviewed by Alex Christensen.
Test: http/tests/xmlhttprequest/on-network-timeout-error-during-preflight.html
Behavior is slightly changed as we are no longer casting Timeout preflight errors as AccessControl errors.
This is more inline with fetch spec which prescribes to send back any error received by preflight as response error for fetch.
Ideally, we should not need to change errors received during preflight loads but the error type is important for some clients:
- EventSource may try to reconnect if error is not AccessControl
- XMLHttpRequest will send abort events in case of Cancellation errors and timeout events in case of Timeout errors
* loader/CrossOriginPreflightChecker.cpp:
(WebCore::CrossOriginPreflightChecker::notifyFinished): Setting error type to AccessControl except in case of Timeout.
(WebCore::CrossOriginPreflightChecker::doPreflight): Ditto.
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::preflightFailure): Removing ASSERT since Timeout errors may be returned.
* platform/network/ResourceErrorBase.h:
(WebCore::ResourceErrorBase::isGeneral): New getter.
2016-09-28 Jer Noble <jer.noble@apple.com>
PiP shows incorrect state of play button.
https://bugs.webkit.org/show_bug.cgi?id=162652
Reviewed by Eric Carlson.
After getting a new WebPlaybackSessionModel, the first thing WebVideoFullscreenInterfaceMac
should do is query for it's playbackRate() and isPlaying() properties.
* platform/mac/WebVideoFullscreenInterfaceMac.mm:
(WebCore::WebVideoFullscreenInterfaceMac::WebVideoFullscreenInterfaceMac):
2016-09-28 Michael Catanzaro <mcatanzaro@igalia.com>
[GTK] Add Chrome UA quirk
https://bugs.webkit.org/show_bug.cgi?id=162617
Reviewed by Carlos Garcia Campos.
Add Chrome UA quirk and use it on typekit.net, typekit.com, youtube.com, slack.com, and
any domain that begins with "google".
* platform/gtk/UserAgentGtk.cpp:
(WebCore::buildUserAgentString):
(WebCore::urlRequiresChromeBrowser):
(WebCore::standardUserAgentForURL):
2016-09-28 Jer Noble <jer.noble@apple.com>
[MSE][Mac] In SourceBufferPrivateAVFObjC::abort(), support reseting parser to the last appended initialization segment.
https://bugs.webkit.org/show_bug.cgi?id=135164
Reviewed by Eric Carlson.
Test: media/media-source/media-source-abort-resets-parser.html
Use the -[AVStreamDataParser appendStreamData:withFlags:] to implement "resetting" the parser. In this case,
the parser isn't explicitly reset during resetParserState(), but rather a flag is set so that the next append
signals a data discontinuity, and the parser is reset at that point.
Because a previous append operation may be in-flight during this abort(), care must be taken to invalidate any
operations which may have already started on a background thread. So SourceBufferPrivateAVFObjC will use a
separate WeakPtrFactory for its append operations, will invalidate any outstanding WeakPtrs during an abort(),
and will block until the previous append() operation completes.
This will require the WebAVStreamDataParserListener object to occasionally have it's WeakPtr pointing back to the
SourceBufferPrivateAVFObjC to be reset after an abort(), so make that ivar an @property. Rather than passing a
RetainPtr to itself in all the callbacks it handles, the WebAVStreamDataParserListener can just pass in a copy
of its own WeakPtr (which may be invalidated during an abort()).
Break the distinct operations of "abort()" and "resetParserState()" into their own methods in SourceBufferPrivate
and all its subclasses.
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::resetParserState):
(WebCore::SourceBuffer::abortIfUpdating):
* platform/graphics/SourceBufferPrivate.h:
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(-[WebAVStreamDataParserListener streamDataParser:didParseStreamDataAsAsset:]):
(-[WebAVStreamDataParserListener streamDataParser:didParseStreamDataAsAsset:withDiscontinuity:]):
(-[WebAVStreamDataParserListener streamDataParser:didFailToParseStreamDataWithError:]):
(-[WebAVStreamDataParserListener streamDataParser:didProvideMediaData:forTrackID:mediaType:flags:]):
(-[WebAVStreamDataParserListener streamDataParser:didReachEndOfTrackWithTrackID:mediaType:]):
(-[WebAVStreamDataParserListener streamDataParserWillProvideContentKeyRequestInitializationData:forTrackID:]):
(-[WebAVStreamDataParserListener streamDataParser:didProvideContentKeyRequestInitializationData:forTrackID:]):
(WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC):
(WebCore::SourceBufferPrivateAVFObjC::append):
(WebCore::SourceBufferPrivateAVFObjC::abort):
(WebCore::SourceBufferPrivateAVFObjC::resetParserState):
(-[WebAVStreamDataParserListener initWithParser:parent:]): Deleted.
* platform/graphics/gstreamer/SourceBufferPrivateGStreamer.cpp:
(WebCore::SourceBufferPrivateGStreamer::resetParserState):
* platform/graphics/gstreamer/SourceBufferPrivateGStreamer.h:
* platform/mock/mediasource/MockSourceBufferPrivate.cpp:
(WebCore::MockSourceBufferPrivate::resetParserState):
* platform/mock/mediasource/MockSourceBufferPrivate.h:
* platform/spi/mac/AVFoundationSPI.h:
2016-09-28 Michael Catanzaro <mcatanzaro@igalia.com>
[GTK] User agent should always claim to be Intel
https://bugs.webkit.org/show_bug.cgi?id=162610
Reviewed by Carlos Garcia Campos.
We should always claim to be running on Intel regardless of actual CPU type. See discussion
in bug #162548 for details. In particular, we can never advertise ARM because it causes dumb
websites to send mobile pages.
* platform/gtk/UserAgentGtk.cpp:
(WebCore::platformVersionForUAString):
(WebCore::buildUserAgentString):
(WebCore::cpuDescriptionForUAString): Deleted.
2016-09-28 Michael Catanzaro <mcatanzaro@igalia.com>
[GTK] Adjust OS X UA quirks list
https://bugs.webkit.org/show_bug.cgi?id=162616
Reviewed by Carlos Garcia Campos.
Remove the OS X quirk for yahoo.com as it's no longer needed. Add quirks for taobao.com and
whatsapp.com.
* platform/gtk/UserAgentGtk.cpp:
(WebCore::urlRequiresMacintoshPlatform):
(WebCore::standardUserAgentForURL):
2016-09-28 Alejandro G. Castro <alex@igalia.com>
Add WebIDL special operation support: serializer
https://bugs.webkit.org/show_bug.cgi?id=156293
Reviewed by Youenn Fablet.
Added support for the serializer special operation for WebIDLs,
current implementation adds support for:
- just the keyword: serializer; It will return all the
attributes of in an object.
- map of entries with the attributes: serializer = {attribute1,
attribute2, ...}
It creates a toJSON method that returns the serialized value
converted into an ECMAScript value. For more information check the
definition of the operation:
http://heycam.github.io/webidl/#idl-serializers
We have created a new function in the API of the objects
that are marked as serializer.
Used the support to add new API for RTCIceCandidate and
RTCSessionDescription.
Updated the tests expectations of the bindings.
Tests: bindings/scripts/test/TestNode.idl
bindings/scripts/test/TestObj.idl
fast/mediastream/RTCIceCandidate.html
fast/mediastream/RTCSessionDescription.html
* Modules/mediastream/RTCIceCandidate.idl: Added the serializer
operation.
* Modules/mediastream/RTCSessionDescription.idl: Added the
serializer operation.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation): Added the calls to the serializer
code generator.
(GenerateSerializerFunction): Added, generates the toJSON function
adding all the serializable->attributes value to an object as
defined in the spec.
* bindings/scripts/IDLParser.pm: Modified the serializer parser
that was unused to support the WebIDL spec parts. Added a new
domSerializable type to store the list of attributes in the
possible map.
(parseSerializer): Modified the function to follow the
semicolon rule in the spec, now the serializer line must have a
semicolon like any other line.
(parseSerializerRest): The function now has to get the attributes
list from the pattern parsing function and add them to the
domSerializable item.
(parseSerializationPattern): Now this function returns the list of
attributes in the serializable map or list if we have one.
(parseSerializationAttributes): Added, this function replaces the
Map and List functions, the currently supported parts are similar
for both situations.
(applyMemberList): Added the serializable item to the interface
variable and populate the serializable in case there is not a
defined map.
(parseSerializationPatternMap): Replaced with
parseSerializationAttributes.
(parseSerializationPatternList): Ditto.
* bindings/scripts/test/JS/JSTestNode.cpp: Modified the expected result.
(WebCore::jsTestNodePrototypeFunctionToJSON):
* bindings/scripts/test/JS/JSTestObj.cpp: Modified the expected result.
(WebCore::jsTestObjPrototypeFunctionToJSON):
* bindings/scripts/test/TestNode.idl: Added the serializer test.
* bindings/scripts/test/TestObj.idl: Added serializer map test.
2016-09-28 Michael Catanzaro <mcatanzaro@igalia.com>
[GTK] Simplify platformForUAString
https://bugs.webkit.org/show_bug.cgi?id=162614
Reviewed by Carlos Garcia Campos.
Note in particular that the previous PLATFORM(MAC) check was wrong here, as that is never
true for GTK; this patch risks changing it to OS(MAC_OS_X), on the hope that advertising Mac
when running on Mac might not break anything. If it does, then we should remove it and just
always pretend to be on X11.
* platform/gtk/UserAgentGtk.cpp:
(WebCore::platformForUAString):
2016-09-28 Michael Catanzaro <mcatanzaro@igalia.com>
[GTK] Bump fake Safari version in UA
https://bugs.webkit.org/show_bug.cgi?id=162615
Reviewed by Carlos Garcia Campos.
Pretend to be Safari 10.0 to fix sites that don't work when we pretend to be Safari 8.0.
* platform/gtk/UserAgentGtk.cpp:
(WebCore::buildUserAgentString):
2016-09-28 Khaled Hosny <khaledhosny@eglug.org>
Use new woff2 API
https://bugs.webkit.org/show_bug.cgi?id=162608
Reviewed by Michael Catanzaro.
Test: fast/text/woff2-totalsfntsize.html
* platform/graphics/WOFFFileFormat.cpp:
(WebCore::WOFF2VectorOut::WOFF2VectorOut):
(WebCore::WOFF2VectorOut::Write):
(WebCore::WOFF2VectorOut::Size):
(WebCore::convertWOFFToSfnt):
2016-09-28 Michael Catanzaro <mcatanzaro@igalia.com>
[GTK] Add warning comment in UserAgentGtk.cpp
https://bugs.webkit.org/show_bug.cgi?id=162618
Reviewed by Carlos Garcia Campos.
* platform/gtk/UserAgentGtk.cpp:
2016-09-28 Romain Bellessort <romain.bellessort@crf.canon.fr>
[Streams API] Align cancelReadableStream() with spec
https://bugs.webkit.org/show_bug.cgi?id=162556
Reviewed by Xabier Rodriguez-Calvar.
Aligned cancelReadableStream() with Streams API. In particular, private cancel() method
was added to ReadableStreamDefaultController and function name was replaced by readableStreamCancel().
Implementation of cancel() (as well as pull()) is actually made in ReadableStreamInternals.js to
avoid creating new function for each controller.
No change in behaviour.
* Modules/streams/ReadableStream.js:
(cancel): Updated with reference to readableStreamCancel().
* Modules/streams/ReadableStreamDefaultReader.js:
(cancel): Updated with reference to readableStreamCancel().
* Modules/streams/ReadableStreamInternals.js:
(privateInitializeReadableStreamDefaultController): Refer to external functions (cancel/pull) to avoid
creating new functions.
(teeReadableStreamBranch2CancelFunction): Updated with reference to readableStreamCancel().
(readableStreamCancel): New name for cancelReadableStream(), behaviour aligned with spec.
(readableStreamDefaultControllerCancel): Added to avoid creating new function for each controller.
(readableStreamDefaultControllerPull): Added to avoid creating new function for each controller.
(readFromReadableStreamDefaultReader): Updated call to pull method to pass controller.
* bindings/js/WebCoreBuiltinNames.h: Added "cancel".
2016-09-27 Joonghun Park <jh718.park@samsung.com>
[EFL] Fix debug build break since r206481. Unreviewed
https://bugs.webkit.org/show_bug.cgi?id=162662
No new tests, no new behaviours.
* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::draw):
2016-09-27 Nan Wang <n_wang@apple.com>
AX: CrashTracer: com.apple.WebKit.WebContent at WebCore::AXObjectCache::localCaretRectForCharacterOffset(WebCore::RenderObject*&, WebCore::CharacterOffset const&) + 116
https://bugs.webkit.org/show_bug.cgi?id=162654
Reviewed by Chris Fleizach.
rangeForUnorderedCharacterOffsets() can return a null Range but we failed to
do a null check in localCaretRectForCharacterOffset() before dereferencing it.
Test: accessibility/mac/bounds-for-range-crash.html
* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::localCaretRectForCharacterOffset):
2016-09-27 Alex Christensen <achristensen@webkit.org>
Inline critical functions in URLParser
https://bugs.webkit.org/show_bug.cgi?id=162653
Reviewed by Myles C. Maxfield.
This gives me about a 15% speed improvement.
* platform/URLParser.cpp:
(WebCore::CodePointIterator::CodePointIterator):
(WebCore::CodePointIterator::operator==):
(WebCore::CodePointIterator::operator!=):
(WebCore::CodePointIterator::operator=):
(WebCore::CodePointIterator::atEnd):
(WebCore::CodePointIterator::codeUnitsSince):
(WebCore::CodePointIterator<LChar>::operator):
(WebCore::CodePointIterator<UChar>::operator):
(WebCore::appendCodePoint):
(WebCore::isC0Control):
(WebCore::isC0ControlOrSpace):
(WebCore::isTabOrNewline):
(WebCore::isInSimpleEncodeSet):
(WebCore::isInDefaultEncodeSet):
(WebCore::isInUserInfoEncodeSet):
(WebCore::isInvalidDomainCharacter):
(WebCore::isPercentOrNonASCII):
(WebCore::isSlashQuestionOrHash):
(WebCore::isValidSchemeCharacter):
(WebCore::URLParser::advance):
(WebCore::URLParser::isWindowsDriveLetter):
(WebCore::URLParser::appendToASCIIBuffer):
(WebCore::percentEncodeByte):
(WebCore::URLParser::utf8PercentEncode):
(WebCore::URLParser::utf8QueryEncode):
(WebCore::isDefaultPort):
(WebCore::isSpecialScheme):
(WebCore::isPercentEncodedDot):
(WebCore::isSingleDotPathSegment):
(WebCore::isDoubleDotPathSegment):
(WebCore::consumeSingleDotPathSegment):
(WebCore::consumeDoubleDotPathSegment):
(WebCore::URLParser::popPath):
(WebCore::URLParser::parsedDataView):
(WebCore::URLParser::currentPosition):
(WebCore::zeroSequenceLength):
(WebCore::findLongestZeroSequence):
(WebCore::pow256):
(WebCore::percentDecode):
(WebCore::containsOnlyASCII):
(WebCore::domainToASCII):
(WebCore::hasInvalidDomainCharacter):
(WebCore::formURLDecode):
(WebCore::serializeURLEncodedForm):
2016-09-27 Zalan Bujtas <zalan@apple.com>
REGRESSION (r204552): Yelp carousel animation is not smooth.
https://bugs.webkit.org/show_bug.cgi?id=162632
Reviewed by Simon Fraser.
For composited state changes when the layers don't need rebuilding, the updateGeometry() traversal
is post-order (see webkit.org/162634), so we can't rely on the offsetfromRenderer() value when
computing the graphics layer position on the descendants. We need this workaround until after webkit.org/162634
gets fixed.
Tests: compositing/hidpi-composited-container-and-graphics-layer-gap-changes.html
compositing/hidpi-negative-composited-bounds-on-device-pixel.html
* rendering/RenderLayerBacking.cpp:
(WebCore::computeOffsetFromAncestorGraphicsLayer):
(WebCore::ComputedOffsets::ComputedOffsets):
(WebCore::ComputedOffsets::fromAncestorGraphicsLayer):
(WebCore::RenderLayerBacking::computeParentGraphicsLayerRect):
2016-09-27 Said Abou-Hallawa <sabouhallawa@apple.com>
Move caching the ImageFrame from BitmapImage to ImageSource
https://bugs.webkit.org/show_bug.cgi?id=155498
Reviewed by Simon Fraser.
BitmapImage has two modes of operation regarding its image decoding state.
The first mode happens when a remote image is loaded as encoded data and
which requires an ImageDecoder to generate the image metadata and the
the ImageFrames. The second mode happens when a BitmapImage is created
with a NativeImagePtr. In this case, no ImageDecoder is needed.
To remove this burden from the BitmapImage the member 'm_frames' is removed
from BitmapImage. A new member named 'm_frameCache' of type ImageFrameCache
is added to ImageSource. This class handles caching and recaching the image
metadata and the ImageFrames if the image needs decoding. When the BitmapImage
is initialized with a memory image, the ImageFrameCache initializes its
metadata and ImageFrames directly from the NativeImagePtr.
The plan for ImageFrameCache is to be extended for the asynchronous image
decoding and also to be used by the non CG image decoders which cache
other copies of the ImageFrames. This double caching should be removed.
When the BitmapImage is replying to the ImageFrame queries, it will ask the
ImageSource which will pass the query the ImageFrameCache. ImageFrameCache
will ensure the requested ImageFrame is cached and is valid for the requested
SubSamplingLevel before accessing the data members of this ImageFrame.
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
Add and ImageFrameCache.cpp to the WebCore project.
* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::BitmapImage): Move initializing the image metadata to
ImageSource. Add initializers for the remaining members in the class declaration.
(WebCore::BitmapImage::destroyDecodedData): Move most of the logic of this
function to ImageFrameCache::destroyDecodedData(). The only part which can't
be moved is the call invalidatePlatformData().
(WebCore::BitmapImage::destroyDecodedDataIfNecessary): Move the logic of this
function to ImageFrameCache::destroyDecodedDataIfNecessary().
(WebCore::BitmapImage::dataChanged): Move the logic of this function to
ImageSource::dataChanged().
(WebCore::BitmapImage::frameImageAtIndex): Move most of the logic of this
function to ImageFrameCache::frameImageAtIndex(). The only part which can't
be moved is the call invalidatePlatformData() if the required subsampling
level is different from the subsampling level for the cached frame image.
(WebCore::BitmapImage::draw): Replace the BitmapImage cached metadata with
the corresponding ImageSource cached metadata.
(WebCore::BitmapImage::drawPattern): Ditto.
(WebCore::BitmapImage::shouldAnimate): Ditto.
(WebCore::BitmapImage::startAnimation): Ditto.
(WebCore::BitmapImage::internalAdvanceAnimation): Ditto.
(WebCore::BitmapImage::dump): Call ImageSource::dump() to dump the image
cached metadata.
(WebCore::BitmapImage::haveFrameImageAtIndex): Deleted.
(WebCore::BitmapImage::destroyMetadataAndNotify): Deleted.
(WebCore::BitmapImage::cacheFrame): Deleted.
(WebCore::BitmapImage::didDecodeProperties): Deleted.
(WebCore::BitmapImage::updateSize): Deleted.
(WebCore::BitmapImage::size): Deleted.
(WebCore::BitmapImage::sizeRespectingOrientation): Deleted.
(WebCore::BitmapImage::hotSpot): Deleted.
(WebCore::BitmapImage::frameCount): Deleted.
(WebCore::BitmapImage::isSizeAvailable): Deleted.
(WebCore::BitmapImage::ensureFrameAtIndexIsCached): Deleted.
(WebCore::BitmapImage::frameIsCompleteAtIndex): Deleted.
(WebCore::BitmapImage::frameDurationAtIndex): Deleted.
(WebCore::BitmapImage::frameHasAlphaAtIndex): Deleted.
(WebCore::BitmapImage::currentFrameKnownToBeOpaque): Deleted.
(WebCore::BitmapImage::frameOrientationAtIndex): Deleted.
(WebCore::BitmapImage::singlePixelSolidColor): Deleted.
(WebCore::BitmapImage::repetitionCount): Deleted.
* platform/graphics/BitmapImage.h:
Managing the ImageFrames caching is moved to ImageFrameCache. Caching the
image metadata is now moved to the ImageSource.
* platform/graphics/GeneratedImage.h:
* platform/graphics/Image.h:
(WebCore::Image::orientationForCurrentFrame):
(WebCore::Image::singlePixelSolidColor):
Change currentFrameKnownToBeOpaque(), orientationForCurrentFrame() and
singlePixelSolidColor() to be const.
* platform/graphics/ImageFrame.cpp:
(WebCore::ImageFrame::defaultFrame): Returns an empty ImageFrame to get the default ImageFrame metadata.
(WebCore::ImageFrame::fillMetadata): Deleted. Moved to ImageFrameCache.
(WebCore::ImageFrame::initialize): Deleted. Ditto.
* platform/graphics/ImageFrame.h:
(WebCore::ImageFrame::setDuration): Change the type of the argument to float instead of unsigned.
(WebCore::ImageFrame::hasAlpha): Protect the unset m_hasAlpha by checking hasMetadata() first.
* platform/graphics/ImageFrameCache.cpp: Added.
(WebCore::ImageFrameCache::ImageFrameCache): Two constructors similar to what we do for ImageSource and BitmapImage.
(WebCore::ImageFrameCache::destroyDecodedData): Moved from BitmapImage.cpp.
(WebCore::ImageFrameCache::destroyDecodedDataIfNecessary): Ditto.
(WebCore::ImageFrameCache::destroyIncompleteDecodedData): Ditto.
(WebCore::ImageFrameCache::decodedSizeChanged): Ditto.
(WebCore::ImageFrameCache::decodedSizeIncremented): Ditto.
(WebCore::ImageFrameCache::decodedSizeDecremented): Ditto.
(WebCore::ImageFrameCache::decodedSizeReset): Ditto.
(WebCore::ImageFrameCache::didDecodeProperties): Ditto.
(WebCore::ImageFrameCache::growFrames): Grows the size of m_frames if necessary.
(WebCore::ImageFrameCache::setNativeImage): Initializes the ImageFrame metadata directly from the NativeImagePtr.
(WebCore::ImageFrameCache::setFrameNativeImage): Initializes the ImageFrame image and the metadata.
(WebCore::ImageFrameCache::setFrameMetadata): Initializes the ImageFrame metadata from the ImageDecoder.
(WebCore::ImageFrameCache::frameAtIndex): Returns an ImageFrame given its index. Cache or recache the requested ImageFrame if necessary.
(WebCore::ImageFrameCache::clearMetadata): Invalidates the cached image metadata.
(WebCore::ImageFrameCache::metadata): A template function which returns an image metadata property.
(WebCore::ImageFrameCache::frameMetadataAtIndex): A template function which returns an ImageFrame metadata property.
(WebCore::ImageFrameCache::isSizeAvailable): An image metadata property.
(WebCore::ImageFrameCache::frameCount): Ditto.
(WebCore::ImageFrameCache::repetitionCount): Ditto.
(WebCore::ImageFrameCache::filenameExtension): Ditto.
(WebCore::ImageFrameCache::hotSpot): Ditto.
(WebCore::ImageFrameCache::size): An image metadata property but we get it from the first ImageFrame.
(WebCore::ImageFrameCache::sizeRespectingOrientation): Ditto.
(WebCore::ImageFrameCache::singlePixelSolidColor): Ditto.
(WebCore::ImageFrameCache::frameIsCompleteAtIndex): An ImageFrame metadata property.
(WebCore::ImageFrameCache::frameHasAlphaAtIndex): Ditto.
(WebCore::ImageFrameCache::frameHasImageAtIndex): Ditto.
(WebCore::ImageFrameCache::frameHasInvalidNativeImageAtIndex): Ditto.
(WebCore::ImageFrameCache::frameSubsamplingLevelAtIndex): Ditto.
(WebCore::ImageFrameCache::frameSizeAtIndex): Ditto.
(WebCore::ImageFrameCache::frameBytesAtIndex): Ditto.
(WebCore::ImageFrameCache::frameDurationAtIndex): Ditto.
(WebCore::ImageFrameCache::frameOrientationAtIndex): Ditto.
(WebCore::ImageFrameCache::frameImageAtIndex): Ditto.
* platform/graphics/ImageFrameCache.h: Added.
(WebCore::ImageFrameCache::setDecoder): Sets the current ImageDecoder which is owned by the ImageSource.
(WebCore::ImageFrameCache::decodedSize): Returns the size of the cached NativeImages.
(WebCore::ImageFrameCache::isDecoderAvailable): Returns whether an ImageDecoder is available.
* platform/graphics/ImageSource.cpp:
(WebCore::ImageSource::ImageSource): Initializes the ImageFrameCache based on the image decoding state.
(WebCore::ImageSource::clearFrameBufferCache): Replace initialized() with isDecoderAvailable().
(WebCore::ImageSource::clear): Clears the ImageDecoder of the ImageFrameCache.
(WebCore::ImageSource::destroyDecodedData): Moved from BitmapImage.cpp.
(WebCore::ImageSource::destroyDecodedDataIfNecessary): Ditto.
(WebCore::ImageSource::ensureDecoderAvailable): Creates an ImageDecoder if necessary and sets it in ImageFrameCache.
(WebCore::ImageSource::setData):
(WebCore::ImageSource::dataChanged): Moved from BitmapImage.cpp.
(WebCore::ImageSource::isAllDataReceived):
(WebCore::ImageSource::maximumSubsamplingLevel): Rename calculateMaximumSubsamplingLevel() to maximumSubsamplingLevel().
(WebCore::ImageSource::subsamplingLevelForScale):
(WebCore::ImageSource::createFrameImageAtIndex):
(WebCore::ImageSource::dump):
(WebCore::ImageSource::calculateMaximumSubsamplingLevel): Deleted. Renamed to maximumSubsamplingLevel().
(WebCore::ImageSource::updateMetadata): Deleted. Not needed. Caching the image metadata is the responsibility of ImageFrameCache.
(WebCore::ImageSource::bytesDecodedToDetermineProperties): Deleted. Not needed.
(WebCore::ImageSource::isSizeAvailable): Deleted. Moved to ImageSource.h.
(WebCore::ImageSource::size): Deleted. Ditto.
(WebCore::ImageSource::sizeRespectingOrientation): Deleted. Ditto.
(WebCore::ImageSource::frameCount): Deleted. Ditto.
(WebCore::ImageSource::repetitionCount): Deleted. Ditto.
(WebCore::ImageSource::filenameExtension): Deleted. Ditto.
(WebCore::ImageSource::hotSpot): Deleted. Ditto.
(WebCore::ImageSource::frameIsCompleteAtIndex): Deleted. Ditto.
(WebCore::ImageSource::frameHasAlphaAtIndex): Deleted. Ditto.
(WebCore::ImageSource::frameAllowSubsamplingAtIndex): Deleted. Ditto.
(WebCore::ImageSource::frameSizeAtIndex): Deleted. Ditto.
(WebCore::ImageSource::frameBytesAtIndex): Deleted. Ditto.
(WebCore::ImageSource::frameDurationAtIndex): Deleted. Ditto.
(WebCore::ImageSource::frameOrientationAtIndex): Deleted. Ditto.
* platform/graphics/ImageSource.h:
(WebCore::ImageSource::isDecoderAvailable): initialized() was renamed to isDecoderAvailable().
(WebCore::ImageSource::decodedSize): Send the query to ImageFrameCache.
(WebCore::ImageSource::isSizeAvailable): Ditto.
(WebCore::ImageSource::frameCount): Ditto.
(WebCore::ImageSource::repetitionCount): Ditto.
(WebCore::ImageSource::filenameExtension): Ditto.
(WebCore::ImageSource::hotSpot): Ditto.
(WebCore::ImageSource::size): Ditto.
(WebCore::ImageSource::sizeRespectingOrientation): Ditto.
(WebCore::ImageSource::singlePixelSolidColor): Ditto.
(WebCore::ImageSource::frameIsCompleteAtIndex): Ditto.
(WebCore::ImageSource::frameHasAlphaAtIndex): Ditto.
(WebCore::ImageSource::frameHasImageAtIndex): Ditto.
(WebCore::ImageSource::frameHasInvalidNativeImageAtIndex): Ditto.
(WebCore::ImageSource::frameSubsamplingLevelAtIndex): Ditto.
(WebCore::ImageSource::frameSizeAtIndex): Ditto.
(WebCore::ImageSource::frameBytesAtIndex): Ditto.
(WebCore::ImageSource::frameDurationAtIndex): Ditto.
(WebCore::ImageSource::frameOrientationAtIndex): Ditto.
(WebCore::ImageSource::frameImageAtIndex): Ditto.
(WebCore::ImageSource::decoder): Deleted. Not needed.
(WebCore::ImageSource::initialized): Deleted. Was renamed to isDecoderAvailable().
(WebCore::ImageSource::setNeedsUpdateMetadata): Deleted. Not needed.
* platform/graphics/cairo/GraphicsContext3DCairo.cpp:
(WebCore::GraphicsContext3D::ImageExtractor::extractImage): AlphaOption and GammaAndColorProfileOption are moved out of ImageSource.
* platform/graphics/cg/GraphicsContext3DCG.cpp:
(WebCore::GraphicsContext3D::ImageExtractor::extractImage): Ditto.
* platform/graphics/cg/ImageDecoderCG.cpp:
(WebCore::ImageDecoder::ImageDecoder): Make the constructor of ImageDecoder be the same for all ports.
(WebCore::ImageDecoder::setData): Removed unused overloaded function.
(WebCore::ImageDecoder::size): Deleted. Removed unused function.
* platform/graphics/cg/ImageDecoderCG.h:
(WebCore::ImageDecoder::create): Make the constructor of CG ImageDecoder be like the other ports.
(WebCore::ImageDecoder::isAllDataReceived): Make this property owned by ImageDecoder.
* platform/graphics/cg/PDFDocumentImage.h: Change currentFrameKnownToBeOpaque() to be const.
* platform/graphics/efl/GraphicsContext3DEfl.cpp:
(WebCore::GraphicsContext3D::ImageExtractor::extractImage): AlphaOption and GammaAndColorProfileOption are moved out of ImageSource.
* platform/graphics/mac/ImageMac.mm:
(WebCore::BitmapImage::invalidatePlatformData): m_frames is owned by ImageFrameCache. ImageFrameCache::frameCount() has to
be equal to ImageFrame::m_frames.size().
* platform/image-decoders/ImageDecoder.cpp:
(WebCore::ImageDecoder::create): AlphaOption and GammaAndColorProfileOption are moved out of ImageSource.
* platform/image-decoders/ImageDecoder.h:
(WebCore::ImageDecoder::ImageDecoder): Ditto.
(WebCore::ImageDecoder::frameCount): Make frameCount const so it can be passed to the template function ImageFrameCache::metadata().
* platform/image-decoders/bmp/BMPImageDecoder.cpp:
(WebCore::BMPImageDecoder::BMPImageDecoder): AlphaOption and GammaAndColorProfileOption are moved out of ImageSource.
* platform/image-decoders/bmp/BMPImageDecoder.h:
* platform/image-decoders/gif/GIFImageDecoder.cpp:
(WebCore::GIFImageDecoder::GIFImageDecoder): AlphaOption and GammaAndColorProfileOption are moved out of ImageSource.
(WebCore::GIFImageDecoder::frameCount): Make frameCount const so it can be passed to the template function ImageFrameCache::metadata().
* platform/image-decoders/gif/GIFImageDecoder.h:
* platform/image-decoders/gif/GIFImageReader.cpp:
* platform/image-decoders/gif/GIFImageReader.h:
* platform/image-decoders/ico/ICOImageDecoder.cpp:
(WebCore::ICOImageDecoder::ICOImageDecoder):
(WebCore::ICOImageDecoder::frameCount): Make frameCount const so it can be passed to the template function ImageFrameCache::metadata().
(WebCore::ICOImageDecoder::decode): Move resizing the m_frameBufferCache from ICOImageDecoder::frameCount() to ICOImageDecoder::decode().
(WebCore::ICOImageDecoder::decodeAtIndex): AlphaOption and GammaAndColorProfileOption are moved out of ImageSource.
* platform/image-decoders/ico/ICOImageDecoder.h:
* platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
(WebCore::JPEGImageDecoder::JPEGImageDecoder): AlphaOption and GammaAndColorProfileOption are moved out of ImageSource.
* platform/image-decoders/jpeg/JPEGImageDecoder.h:
* platform/image-decoders/png/PNGImageDecoder.cpp:
(WebCore::PNGImageDecoder::PNGImageDecoder): AlphaOption and GammaAndColorProfileOption are moved out of ImageSource.
* platform/image-decoders/png/PNGImageDecoder.h:
(WebCore::PNGImageDecoder::frameCount): Make frameCount const so it can be passed to the template function ImageFrameCache::metadata().
* platform/image-decoders/webp/WEBPImageDecoder.cpp:
(WebCore::WEBPImageDecoder::WEBPImageDecoder):
* platform/image-decoders/webp/WEBPImageDecoder.h:
* svg/graphics/SVGImage.h: Make currentFrameKnownToBeOpaque() be const.
* svg/graphics/SVGImageForContainer.h: Ditto.
2016-09-27 Alex Christensen <achristensen@webkit.org>
Correctly parse URLs with the first tab in the fragment
https://bugs.webkit.org/show_bug.cgi?id=162650
Reviewed by Saam Barati.
Covered by a new API test.
* platform/URLParser.cpp:
(WebCore::URLParser::fragmentSyntaxViolation):
2016-09-27 Chris Dumez <cdumez@apple.com>
<a download> does not honor the same-origin requirement
https://bugs.webkit.org/show_bug.cgi?id=156100
Reviewed by Alex Christensen.
We now completely ignore the "download" attribute on anchors if the
href URL is cross-origin. We therefore navigate to the URL instead
of forcefully downloading it in this case and leave it up to the server
to give us the right headers if it should be downloaded. This is
conservative and matches Firefox.
Chrome and the HTML specification ignore only the suggested filename
if the URL is cross-origin but still download the file.
No new tests, updated existing test.
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::handleClick):
2016-09-27 Alex Christensen <achristensen@webkit.org>
URLParser: Handle windows drive letters after two slashes in relative URLs according to spec
https://bugs.webkit.org/show_bug.cgi?id=162646
Reviewed by Saam Barati.
Covered by new API tests.
* platform/URLParser.cpp:
(WebCore::CodePointIterator::codeUnitsSince):
(WebCore::URLParser::appendWindowsDriveLetter):
(WebCore::URLParser::parse):
(WebCore::isWindowsDriveLetter): Deleted.
(WebCore::URLParser::checkWindowsDriveLetter): Deleted.
* platform/URLParser.h:
2016-09-27 Alex Christensen <achristensen@webkit.org>
URLs with @ in the user should only search for the last @ until the end of the authority and host
https://bugs.webkit.org/show_bug.cgi?id=162635
Reviewed by Geoffrey Garen.
Covered by new API tests.
* platform/URLParser.cpp:
(WebCore::URLParser::parse):
2016-09-27 Chris Dumez <cdumez@apple.com>
It should be possible to dispatch events on documents created using DOMParser
https://bugs.webkit.org/show_bug.cgi?id=26147
Reviewed by Ryosuke Niwa.
It should be possible to dispatch events on documents created using
DOMParser. It did not work because we were not setting the context
document on the newly created document in DOMParser::parseFromString().
Firefox and Chrome both already support this.
Test: fast/dom/parsed-document-dispatchEvent.html
* xml/DOMParser.cpp:
(WebCore::DOMParser::DOMParser):
(WebCore::DOMParser::parseFromString):
* xml/DOMParser.h:
(WebCore::DOMParser::create):
* xml/DOMParser.idl:
2016-09-26 Myles C. Maxfield <mmaxfield@apple.com>
[Cocoa] Improve performance of complex text codepath
https://bugs.webkit.org/show_bug.cgi?id=161936
Reviewed by Simon Fraser.
CoreText exposes a bit on the CTRunStatus which represents whether
the run actually uses the glyph origins concept introduced in
r205396. If this bit is not set, we can use the (slightly faster)
call to CTRunGetAdvances() instead of
CTRunGetBaseAdvancesAndOrigins(). In addition, if none of the runs
have this bit set, we don't need to allocate storage for the vector
of origins at all, thereby using less memory.
No new tests because there is no behavior change.
* platform/graphics/mac/ComplexTextController.cpp:
(WebCore::ComplexTextController::advance):
(WebCore::ComplexTextController::adjustGlyphsAndAdvances):
* platform/graphics/mac/ComplexTextController.h:
(WebCore::ComplexTextController::ComplexTextRun::glyphOrigins):
(WebCore::ComplexTextController::glyphOrigin):
* platform/graphics/mac/ComplexTextControllerCoreText.mm:
(WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun):
* platform/spi/cocoa/CoreTextSPI.h:
2016-09-27 Ryosuke Niwa <rniwa@webkit.org>
Import w3c shadow DOM tests and fix one assertion
https://bugs.webkit.org/show_bug.cgi?id=162629
Reviewed by Chris Dumez.
The assertion failure was caused by RelatedNodeRetargeter's constructor mixing up the ancestor tree scopes
for the target and the related target. Fixed the bug by reversing the two.
Tests: imported/w3c/web-platform-tests/shadow-dom/event-composed-path-with-related-target.html
* dom/EventPath.cpp:
(WebCore::RelatedNodeRetargeter::RelatedNodeRetargeter): i and m_ancestorTreeScopes are for the related target
and j and targetTreeScopeAncestors are for the target.
2016-09-27 Chris Dumez <cdumez@apple.com>
It should be possible to dispatch events on documents that do not have a browsing context
https://bugs.webkit.org/show_bug.cgi?id=162620
Reviewed by Ryosuke Niwa.
It should be possible to dispatch events on documents that do not have a browsing
context (e.g. Documents created using DOMImplementation.createHTMLDocument()).
Gecko and Blink both allow this but WebKit did not.
The approach chosen to support this is similar to the one in Blink. When constructing
a new document (e.g. using DOMImplementation.createHTMLDocument()) we now keep track
of the context document. When requesting the scriptExecutionContext(), we now return
the context document if the document has one instead of the document itself.
Test: imported/w3c/web-platform-tests/dom/events/Event-dispatch-other-document.html
* bindings/js/JSDocumentCustom.cpp:
(WebCore::JSDocument::visitAdditionalChildren):
* dom/DOMImplementation.cpp:
(WebCore::DOMImplementation::createDocument):
(WebCore::DOMImplementation::createHTMLDocument):
* dom/Document.cpp:
(WebCore::Document::create):
(WebCore::Document::cloneDataFromDocument):
(WebCore::Document::contextDocument):
(WebCore::Document::takeDOMWindowFrom): Deleted.
* dom/Document.h:
(WebCore::Document::setContextDocument):
(WebCore::Node::scriptExecutionContext):
(WebCore::Node::isDocumentNode): Deleted.
* dom/Document.idl:
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::responseXML):
2016-09-27 Alex Christensen <achristensen@webkit.org>
Implement URLParser::syntaxViolation
https://bugs.webkit.org/show_bug.cgi?id=162593
Reviewed by Geoffrey Garen.
Most of the time when parsing URLs, we just look at the URL, find offsets of the host, path, query, etc.,
and the String can be used untouched. When this happens, we do not want to allocate and copy the String.
We want to just add a reference to an existing String.
Sometimes we need to canonicalize the String because there has been a syntaxViolation,
defined as any String that is different than its canonicalized URL String. In such cases we need to
allocate a new String and fill it with the canonicalized URL String. When a syntaxViolation happens for the
first time, we know that everything in the input String up to that point is equal to what it would have been
if we had canonicalized the beginning of the URL, copy it into a buffer, and continue parsing in a mode where
instead of just looking at the input URL String, we canonicalize each code point into the buffer.
Changes to behavior involve additional spec compliance with tabs and newlines in different places in URLs,
as well as additional spec compliance when parsing empty and null URLs relative to other URLs.
Both are covered by new API tests. Existing behavior covered by existing API tests.
This is about a 15% speed improvement on my URL parsing benchmark.
* platform/URL.cpp:
(WebCore::assertProtocolIsGood):
(WebCore::URL::protocolIs):
(WebCore::protocolIs):
* platform/URL.h:
* platform/URLParser.cpp:
(WebCore::isTabOrNewline):
(WebCore::URLParser::incrementIteratorSkippingTabsAndNewlines):
(WebCore::URLParser::isWindowsDriveLetter):
(WebCore::URLParser::appendToASCIIBuffer):
(WebCore::URLParser::checkWindowsDriveLetter):
(WebCore::URLParser::shouldCopyFileURL):
(WebCore::URLParser::utf8PercentEncode):
(WebCore::URLParser::utf8QueryEncode):
(WebCore::URLParser::copyURLPartsUntil):
(WebCore::URLParser::syntaxViolation):
(WebCore::URLParser::fragmentSyntaxViolation):
(WebCore::URLParser::parsedDataView):
(WebCore::URLParser::currentPosition):
(WebCore::URLParser::URLParser):
(WebCore::URLParser::parse):
(WebCore::URLParser::parseAuthority):
(WebCore::URLParser::parseIPv4Number):
(WebCore::URLParser::parseIPv4Host):
(WebCore::URLParser::parseIPv6Host):
(WebCore::URLParser::parsePort):
(WebCore::URLParser::parseHostAndPort):
(WebCore::serializeURLEncodedForm):
(WebCore::URLParser::allValuesEqual):
(WebCore::URLParser::internalValuesConsistent):
(WebCore::URLParser::incrementIteratorSkippingTabAndNewLine): Deleted.
(WebCore::URLParser::syntaxError): Deleted.
(WebCore::parseIPv4Number): Deleted.
* platform/URLParser.h:
(WebCore::URLParser::incrementIteratorSkippingTabsAndNewlines):
2016-09-27 Wenson Hsieh <wenson_hsieh@apple.com>
Related videos on YouTube (and YouTube playlists) cause media controls to disappear
https://bugs.webkit.org/show_bug.cgi?id=162621
<rdar://problem/28484193>
Reviewed by Jer Noble.
Tweaks the main content media heuristic for better Now Playing behavior on YouTube by making the following
changes:
- Remove the strict requirement for audio to be actively playing for the session to be able to show
controls for the purpose of Now Playing, making it the same as our policy for the controls manager.
- Make playback requirement restrictions apply only for the controls manager. Videos that do not
autoplay will still have the correct behavior with respect to Now Playing, since we will bail in the
hasEverNotifiedAboutPlaying() check.
- Only consider the main content heuristic as preventing media controls from showing up for the purposes
of the controls manager. Now Playing should instead account for this by preferring elements large
enough for main content after collecting all of the candidate sessions.
* html/HTMLMediaElement.cpp:
(WebCore::mediaElementSessionInfoForSession):
(WebCore::preferMediaControlsForCandidateSessionOverOtherCandidateSession):
(WebCore::HTMLMediaElement::updatePlayState):
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::canShowControlsManager):
* platform/audio/mac/MediaSessionManagerMac.mm:
(WebCore::MediaSessionManagerMac::sessionWillBeginPlayback):
2016-09-27 Chris Dumez <cdumez@apple.com>
Second parameter to MutationObserver.observe() should be optional
https://bugs.webkit.org/show_bug.cgi?id=162627
Reviewed by Ryosuke Niwa.
Second parameter to MutationObserver.observe() should be optional:
- https://dom.spec.whatwg.org/#interface-mutationobserver
Firefox agrees with the specification. There is no real behavior change
except that MutationObserver.prototype.observe.length is now 1 instead
of 2. Passing only one parameter will still throw a TypeError because
the Dictionary is empty. However, this parameter needs to be marked as
optional because Web IDL requires the last parameter to be optional if
it is a Dictionary.
No new tests, rebaselined existing test.
* dom/MutationObserver.idl:
2016-09-20 Anders Carlsson <andersca@apple.com>
PlatformEvent::m_modifiers should be an OptionSet
https://bugs.webkit.org/show_bug.cgi?id=162326
Reviewed by Daniel Bates.
* page/EventHandler.cpp:
(WebCore::EventHandler::handleAccessKey):
* page/EventHandler.h:
* page/mac/EventHandlerMac.mm:
(WebCore::EventHandler::accessKeyModifiers):
* platform/PlatformEvent.h:
(WebCore::PlatformEvent::shiftKey):
(WebCore::PlatformEvent::ctrlKey):
(WebCore::PlatformEvent::altKey):
(WebCore::PlatformEvent::metaKey):
(WebCore::PlatformEvent::modifiers):
(WebCore::PlatformEvent::PlatformEvent):
* platform/PlatformKeyboardEvent.h:
(WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
* platform/mac/PlatformEventFactoryMac.mm:
(WebCore::modifiersForEvent):
(WebCore::typeForEvent):
* replay/SerializationMethods.cpp:
(JSC::EncodingTraits<PlatformKeyboardEvent>::encodeValue):
(JSC::EncodingTraits<PlatformKeyboardEvent>::decodeValue):
* replay/WebInputs.json:
2016-09-27 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
[GTK] Handle Wayland & X11 correctly for GST_GL
https://bugs.webkit.org/show_bug.cgi?id=162619
Reviewed by Carlos Garcia Campos.
The checks for GST_GL consider X11 and Wayland are exclusive alternatives, but it
turns out we can enable both! We need to check them independently and also include
a runtime check.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext): fix checks for X11 and
Wayland to handle the case where both are enabled. Includes a runtime check.
2016-09-27 Eric Carlson <eric.carlson@apple.com>
[MediaStream] Restructure MediaConstraints classes
https://bugs.webkit.org/show_bug.cgi?id=162571
Reviewed by Jer Noble.
No new tests, no functional changes.
* Modules/mediastream/MediaConstraintsImpl.cpp:
(WebCore::MediaConstraintsImpl::initialize): Deleted, no longer used.
* Modules/mediastream/MediaConstraintsImpl.h:
* bindings/js/JSMediaDevicesCustom.cpp:
(WebCore::createStringConstraint): Return Optional<> instead of RefPtr<>.
(WebCore::createBooleanConstraint): Ditto.
(WebCore::createDoubleConstraint): Ditto.
(WebCore::createIntConstraint): Ditto.
(WebCore::parseMediaTrackConstraintSetForKey): Deal with above change.
* platform/mediastream/CaptureDeviceManager.cpp:
(CaptureDeviceManager::verifyConstraintsForMediaType): Use constraints.mandatoryConstraints.filter
instead of direct enumeration.
(CaptureDeviceManager::sessionSupportsConstraint): Use downcast<>.
(CaptureDeviceManager::isSupportedFrameRate): Ditto.
* platform/mediastream/MediaConstraints.cpp:
(WebCore::StringConstraint::find): Lose the ConstraintType parameter.
(WebCore::StringConstraint::merge): Use downcast<>.
(WebCore::FlattenedConstraint::set): Use ConstraintHolder.
(WebCore::FlattenedConstraint::merge): Ditto.
(WebCore::MediaTrackConstraintSetMap::forEach): New.
(WebCore::MediaTrackConstraintSetMap::filter): Ditto.
(WebCore::MediaTrackConstraintSetMap::isEmpty): Ditto.
(WebCore::MediaTrackConstraintSetMap::set): Ditto.
(WebCore::MediaConstraint::copy): Deleted.
(WebCore::IntConstraint::copy): Deleted.
(WebCore::DoubleConstraint::copy): Deleted.
(WebCore::BooleanConstraint::copy): Deleted.
(WebCore::StringConstraint::copy): Deleted.
* platform/mediastream/MediaConstraints.h:
(WebCore::MediaConstraint::MediaConstraint):
(WebCore::MediaConstraint::isEmpty):
(WebCore::MediaConstraint::isMandatory):
(WebCore::MediaConstraint::merge):
(WebCore::MediaConstraint::isInt):
(WebCore::MediaConstraint::isDouble):
(WebCore::MediaConstraint::isBoolean):
(WebCore::MediaConstraint::isString):
(WebCore::MediaConstraint::dataType):
(WebCore::MediaConstraint::constraintType):
(WebCore::NumericConstraint::getMin):
(WebCore::NumericConstraint::getMax):
(WebCore::NumericConstraint::getExact):
(WebCore::NumericConstraint::getIdeal):
(WebCore::NumericConstraint::fitnessDistance):
(WebCore::NumericConstraint::validForRange):
(WebCore::NumericConstraint::find):
(WebCore::NumericConstraint::NumericConstraint):
(WebCore::NumericConstraint::innerMerge):
(WebCore::FlattenedConstraint::isEmpty):
(WebCore::FlattenedConstraint::iterator::iterator):
(WebCore::FlattenedConstraint::iterator::operator*):
(WebCore::FlattenedConstraint::iterator::operator++):
(WebCore::FlattenedConstraint::iterator::operator==):
(WebCore::FlattenedConstraint::iterator::operator!=):
(WebCore::FlattenedConstraint::begin):
(WebCore::FlattenedConstraint::end):
(WebCore::FlattenedConstraint::ConstraintHolder::create):
(WebCore::FlattenedConstraint::ConstraintHolder::~ConstraintHolder):
(WebCore::FlattenedConstraint::ConstraintHolder::constraint):
(WebCore::FlattenedConstraint::ConstraintHolder::dataType):
(WebCore::FlattenedConstraint::ConstraintHolder::constraintType):
(WebCore::FlattenedConstraint::ConstraintHolder::ConstraintHolder):
(WebCore::MediaConstraint::getMin): Deleted.
(WebCore::MediaConstraint::getMax): Deleted.
(WebCore::MediaConstraint::getExact): Deleted.
(WebCore::MediaConstraint::getIdeal): Deleted.
(WebCore::MediaConstraint::validForRange): Deleted.
(WebCore::MediaConstraint::find): Deleted.
(WebCore::MediaConstraint::fitnessDistance): Deleted.
(WebCore::MediaConstraint::type): Deleted.
* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::fitnessDistance): Use downcast<>.
(WebCore::applyNumericConstraint):
(WebCore::RealtimeMediaSource::applyConstraint): Ditto.
(WebCore::RealtimeMediaSource::selectSettings): Ditto. Use constraints.mandatoryConstraints.filter
instead of direct enumeration.
(WebCore::RealtimeMediaSource::applyConstraints):
(WebCore::RealtimeMediaSource::setSampleRate): Sample rate is an int, not a double.
(WebCore::RealtimeMediaSource::setSampleSize): Sample size is also an int.
* platform/mediastream/RealtimeMediaSource.h:
* platform/mediastream/mac/AVCaptureDeviceManager.mm:
(WebCore::AVCaptureDeviceManager::sessionSupportsConstraint): Use downcast<>.
* platform/mock/MediaConstraintsMock.cpp:
(WebCore::isIntMediaConstraintSatisfiable): Use downcast<>.
(WebCore::isDoubleMediaConstraintSatisfiable): Ditto.
(WebCore::isBooleanMediaConstraintSatisfiable): Ditto.
(WebCore::isStringMediaConstraintSatisfiable):
(WebCore::isSatisfiable):
(WebCore::MediaConstraintsMock::verifyConstraints): Use constraints.mandatoryConstraints.filter
instead of direct enumeration.
* platform/mock/MediaConstraintsMock.h:
* platform/mock/MockRealtimeAudioSource.h:
* platform/mock/MockRealtimeMediaSourceCenter.cpp:
(WebCore::MockRealtimeMediaSourceCenter::createMediaStream):
2016-09-27 Wenson Hsieh <wenson_hsieh@apple.com>
Some Now Playing behavior is broken after r206315
https://bugs.webkit.org/show_bug.cgi?id=162625
<rdar://problem/28496755>
Reviewed by Jer Noble.
Reverts the part of our heuristic that disables Now Playing in active tabs in the main window.
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::pageAllowsNowPlayingControls):
* page/Page.cpp:
(WebCore::Page::setViewState):
2016-09-27 Ryan Haddad <ryanhaddad@apple.com>
Remove an unneeded assert in InspectorOverlay.cpp
https://bugs.webkit.org/show_bug.cgi?id=162581
Reviewed by Alexey Proskuryakov.
This assertion was added to catch unknown issues, but it is firing frequently enough on certain Inspector
tests that it is causing more harm than good.
* inspector/InspectorOverlay.cpp:
(WebCore::buildQuadObjectForCSSRegionContentClip):
(WebCore::evaluateCommandInOverlay):
2016-09-27 Jer Noble <jer.noble@apple.com>
Remove deprecated ENCRYPTED_MEDIA implementation.
https://bugs.webkit.org/show_bug.cgi?id=161010
Reviewed by Eric Carlson.
Remove all references to the deprecated ENABLE_ENCRYPTED_MEDIA (leaving in place
the soon-to-be deprecated ENABLE_ENCRYPTED_MEDIA_V2).
* CMakeLists.txt:
* Configurations/FeatureDefines.xcconfig:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* bindings/objc/DOMHTMLMediaElement.h:
* bindings/objc/DOMHTMLMediaElement.mm:
(-[DOMHTMLMediaElement canPlayType:]):
(-[DOMHTMLMediaElement canPlayType:keySystem:]): Deleted.
* bindings/js/JSDictionary.cpp:
* bindings/js/JSDictionary.h:
* dom/Element.idl:
* dom/EventNames.in:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::selectNextSourceChild):
(WebCore::exceptionCodeForMediaKeyException): Deleted.
(WebCore::HTMLMediaElement::canPlayType): Deleted.
(WebCore::HTMLMediaElement::mediaPlayerKeyAdded): Deleted.
(WebCore::HTMLMediaElement::mediaPlayerKeyError): Deleted.
(WebCore::HTMLMediaElement::mediaPlayerKeyMessage): Deleted.
(WebCore::HTMLMediaElement::mediaPlayerKeyNeeded): Deleted.
* html/HTMLMediaElement.h:
* html/HTMLMediaElement.idl:
* html/MediaError.h:
* html/MediaError.idl:
* html/MediaKeyError.h:
* html/MediaKeyError.idl:
* html/MediaKeyEvent.cpp: Removed.
(WebCore::MediaKeyEvent::MediaKeyEvent): Deleted.
(WebCore::MediaKeyEvent::~MediaKeyEvent): Deleted.
(WebCore::MediaKeyEvent::eventInterface): Deleted.
* html/MediaKeyEvent.h: Removed.
* html/MediaKeyEvent.idl: Removed.
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::nextBestMediaEngine):
(WebCore::MediaPlayer::generateKeyRequest): Deleted.
(WebCore::MediaPlayer::addKey): Deleted.
(WebCore::MediaPlayer::cancelKeyRequest): Deleted.
(WebCore::MediaPlayer::keyAdded): Deleted.
(WebCore::MediaPlayer::keyError): Deleted.
(WebCore::MediaPlayer::keyMessage): Deleted.
(WebCore::MediaPlayer::keyNeeded): Deleted.
* platform/graphics/MediaPlayer.h:
(WebCore::MediaPlayerClient::mediaPlayerKeyAdded): Deleted.
(WebCore::MediaPlayerClient::mediaPlayerKeyError): Deleted.
(WebCore::MediaPlayerClient::mediaPlayerKeyMessage): Deleted.
(WebCore::MediaPlayerClient::mediaPlayerKeyNeeded): Deleted.
* platform/graphics/MediaPlayerPrivate.h:
(WebCore::MediaPlayerPrivateInterface::addKey): Deleted.
(WebCore::MediaPlayerPrivateInterface::generateKeyRequest): Deleted.
(WebCore::MediaPlayerPrivateInterface::cancelKeyRequest): Deleted.
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
* platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
(WebCore::CDMSessionAVContentKeySession::update):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::supportsKeySystem):
(WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource):
(WebCore::MediaPlayerPrivateAVFoundationObjC::supportsType): Deleted.
(WebCore::MediaPlayerPrivateAVFoundationObjC::generateKeyRequest): Deleted.
(WebCore::MediaPlayerPrivateAVFoundationObjC::addKey): Deleted.
(WebCore::MediaPlayerPrivateAVFoundationObjC::cancelKeyRequest): Deleted.
* platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
(WebCore::MediaPlayerPrivateQTKit::supportsType): Deleted.
* testing/MockCDM.h:
2016-09-27 Youenn Fablet <youenn@apple.com>
[Fetch API] Use Ref<const T> in FetchBody::m_data variant
https://bugs.webkit.org/show_bug.cgi?id=162599
Reviewed by Alex Christensen.
Covered by existing tests.
Using Ref<const T> for all variants of m_data except for FormData since FetchBody is actually creating it and may modifiy it.
Updating blob loading code path to use a const Blob& instead of a Blob&.
* Modules/fetch/FetchBody.cpp:
(WebCore::FetchBody::FetchBody):
(WebCore::FetchBody::extract):
(WebCore::FetchBody::clone):
* Modules/fetch/FetchBody.h:
(WebCore::FetchBody::blobBody):
(WebCore::FetchBody::arrayBufferBody):
(WebCore::FetchBody::arrayBufferViewBody):
* Modules/fetch/FetchBodyOwner.cpp:
(WebCore::FetchBodyOwner::loadBlob):
* Modules/fetch/FetchBodyOwner.h:
* Modules/fetch/FetchLoader.cpp:
(WebCore::FetchLoader::start):
* Modules/fetch/FetchLoader.h:
2016-09-27 Michael Catanzaro <mcatanzaro@igalia.com>
Unreviewed typo fix
* platform/gtk/UserAgentGtk.cpp:
(WebCore::standardUserAgent):
2016-09-27 Youenn Fablet <youenn@apple.com>
Clean-up CachedImage constructor
https://bugs.webkit.org/show_bug.cgi?id=162601
Reviewed by Sam Weinig.
No change of behavior.
Removing an unused constructor.
Specializing one constructor for manually cached images.
Cleaning initialization of some CachedImage fields.
* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::CachedImage):
* loader/cache/CachedImage.h:
* loader/cache/MemoryCache.cpp:
(WebCore::MemoryCache::addImageToCache):
2016-09-27 Michael Catanzaro <mcatanzaro@igalia.com>
[FreeType] Add comment further justifying use of FT_LOAD_FORCE_AUTOHINT
https://bugs.webkit.org/show_bug.cgi?id=162607
Reviewed by Martin Robinson.
* platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp:
(WebCore::FontCustomPlatformData::FontCustomPlatformData):
2016-09-27 Mario Sanchez Prada <mario@endlessm.com>
Build fails for X11+EGL due to missing gst_gl_display_x11_new_with_display()
https://bugs.webkit.org/show_bug.cgi?id=162606
Reviewed by Gustavo Noronha Silva.
Use the right check to retrieve the right instance of GstGLDisplay
depending on whether we're using GLX or EGL, not X11 or Wayland.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext):
2016-09-27 Youenn Fablet <youenn@apple.com>
[GTK][EFL] imported/w3c/web-platform-tests/fetch/api/basic/accept-header.html is failing
https://bugs.webkit.org/show_bug.cgi?id=162547
Reviewed by Michael Catanzaro.
Covered by existing tests.
* platform/network/soup/SoupNetworkSession.cpp:
(WebCore::SoupNetworkSession::createTestingSession): Setting the underlying soupSession.
2016-09-27 Youenn Fablet <youenn@apple.com>
[Fetch API] Remove ReadableStreamSource firstReadCallback
https://bugs.webkit.org/show_bug.cgi?id=162339
Reviewed by Sam Weinig.
No observable change of behavior.
Removing ReadableStreamSource firstReadCallback.
This makes the enqueuing of data to happen when the stream is created.
In the future, we may want to implement doPull() to enqueue data when stream actually needs it.
* Modules/fetch/FetchResponseSource.cpp:
(WebCore::FetchResponseSource::doPull): Introduced as we introduce pull() in ReadableStreamSource.
* Modules/fetch/FetchResponseSource.h:
* Modules/streams/ReadableStreamInternals.js:
(readFromReadableStreamDefaultReader): Removing firstReadCallback use.
* Modules/streams/ReadableStreamSource.h: Renaming m_startPromise in m_promise since m_promise may store start and pull promises.
(WebCore::ReadableStreamSource::isStarting):
(WebCore::ReadableStreamSource::start):
(WebCore::ReadableStreamSource::pull): Introduced to support ReadableStreamSource pulling.
(WebCore::ReadableStreamSource::startFinished):
(WebCore::ReadableStreamSource::pullFinished): Ditto.
(WebCore::ReadableStreamSource::clean):
* Modules/streams/ReadableStreamSource.idl: Ditto.
* bindings/js/JSReadableStreamSourceCustom.cpp: Refactoring to use callPromiseFunction
(WebCore::startReadableStream):
(WebCore::JSReadableStreamSource::start):
(WebCore::pullReadableStream): Introduced to support ReadableStreamSource pulling.
(WebCore::JSReadableStreamSource::pull): Ditto.
* bindings/js/WebCoreBuiltinNames.h: Removing firstReadCallback
2016-09-27 Myles C. Maxfield <mmaxfield@apple.com>
REGRESSION(r205883): Letterpressed text is invisible
https://bugs.webkit.org/show_bug.cgi?id=162590
<rdar://problem/28141512>
Reviewed by Simon Fraser.
r205883 removed the last place where we use CGFonts directly in WebKit. However,
our letterpress code is sensitive to the current state of the CGContext.
Tests: fast/text/letterpress-different.html
fast/text/letterpress-paint.html
* platform/graphics/cocoa/FontCascadeCocoa.mm:
(WebCore::showLetterpressedGlyphsWithAdvances):
2016-09-27 Youenn Fablet <youenn@apple.com>
[Fetch API] Refactor FetchBody to use std::experimental::variant
https://bugs.webkit.org/show_bug.cgi?id=162559
Reviewed by Alex Christensen.
Covered by exiting tests.
Using variant to represent the variant data types.
Adding nullptr as a specific type for default empty values and to allow clean-up.
Adding FetchBody::clone as the default copy constructor is deleted with this change.
* Modules/fetch/FetchBody.cpp:
(WebCore::FetchBody::FetchBody):
(WebCore::FetchBody::json):
(WebCore::FetchBody::text):
(WebCore::FetchBody::consumeAsStream):
(WebCore::FetchBody::consumeArrayBuffer):
(WebCore::FetchBody::consumeArrayBufferView):
(WebCore::FetchBody::consumeText):
(WebCore::FetchBody::consumeBlob):
(WebCore::FetchBody::extractFromText):
(WebCore::FetchBody::bodyForInternalRequest):
(WebCore::FetchBody::clone):
* Modules/fetch/FetchBody.h:
(WebCore::FetchBody::blobBody):
(WebCore::FetchBody::formDataBody):
(WebCore::FetchBody::arrayBufferBody):
(WebCore::FetchBody::arrayBufferViewBody):
(WebCore::FetchBody::textBody):
* Modules/fetch/FetchRequest.cpp:
(WebCore::FetchRequest::clone):
* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::cloneForJS):
2016-09-26 Joonghun Park <jh718.park@samsung.com>
[EFL] Fix debug build break since r204205. Unreviewed
https://bugs.webkit.org/show_bug.cgi?id=162596
No new tests, no new behaviours.
* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::frameImageAtIndex):
2016-09-26 Wenson Hsieh <wenson_hsieh@apple.com>
If you play a youtube video from now playing after it finished in Safari, controls disappear
https://bugs.webkit.org/show_bug.cgi?id=162589
<rdar://problem/28484047>
Reviewed by Jer Noble.
Tweaks the main content heuristic slightly to remove the "mostly in mainframe" requirement in the case of Now
Playing. This was added in the case of the controls manager as an additional way to identify video elements that
should not show controls, since we relax audio and video constraints for showing videos in the controls manager,
so that a video element is prevented from showing controls on grounds of lacking audio only if it has never had
audio before. In the case of Now Playing, we have stricter requirements for videos, which must have audio, which
makes the mainframe heuristic not necessary.
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::canShowControlsManager):
2016-09-26 Antti Koivisto <antti@apple.com>
Setter on style element's textContent or cssText doesn't trigger style recalc
https://bugs.webkit.org/show_bug.cgi?id=160331
<rdar://problem/27609715>
Reviewed by Ryosuke Niwa and Daniel Bates.
We would not notify the parent when text node content changed in a shadow tree.
Test: fast/shadow-dom/shadow-style-text-mutation.html
* dom/AuthorStyleSheets.cpp:
(WebCore::AuthorStyleSheets::updateActiveStyleSheets):
Invalidate shadow root children instead of the root itself when doing full invalidation.
The invalidity bits have no meaning for non-element, non-texts.
* dom/CharacterData.cpp:
(WebCore::CharacterData::parserAppendData):
(WebCore::CharacterData::setDataAndUpdate):
(WebCore::CharacterData::notifyParentAfterChange):
Add a helper and call it also in shadow trees.
(WebCore::CharacterData::dispatchModifiedEvent):
* dom/CharacterData.h:
2016-09-26 Antti Koivisto <antti@apple.com>
Input elements don't work inside shadow tree
https://bugs.webkit.org/show_bug.cgi?id=160427
Reviewed by Darin Adler.
There is a bug in ComposedTreeIterator. If the iterator is initialized with an initial state where the root
is inside a shadow tree it won't iterate into slots.
If an input element is in a shadow tree it generates narrowly scoped style updates. When RenderTreeUpdater
applies such an update the update root will be inside the shadow tree and the bug will prevent the render tree
for slotted content from updating.
Added tests for both the iterator behavior and the specific symptom with input elements.
Tests: fast/shadow-dom/composed-tree-shadow-child-subtree.html
fast/shadow-dom/input-element-in-shadow.html
* dom/ComposedTreeIterator.cpp:
(WebCore::ComposedTreeIterator::ComposedTreeIterator):
Check and cache if the root is inside shadow tree.
(WebCore::ComposedTreeIterator::traverseNextInShadowTree):
* dom/ComposedTreeIterator.h:
(WebCore::ComposedTreeIterator::traverseNext):
If it is, always use the shadow traversal code path.
2016-09-26 Wenson Hsieh <wenson_hsieh@apple.com>
Seeking video doesn't update seek position
https://bugs.webkit.org/show_bug.cgi?id=162575
<rdar://problem/28457219>
Reviewed by Jer Noble.
On ToT, seeking in a video causes the playhead to stutter, and does not actually update media remote's seek
position. This is partly due to how we do not update media remote with new information when beginning to respond
to remote seek commands, so media remote continues to think that a playing video is still playing despite the
user attempting to seek through it.
To fix this, we introduce timer-based guards around remote seek commands, such that a seek "gesture" begins when
we receive the first seek command and ends when no seek command has been received in a set amount of time (this
is 0.5 seconds, which is approximately what other clients around the platform use).
Also, when responding to a remote seek, perform the seek with no tolerance. This prevents the playhead from
stuttering at the end of a seek from the final requested destination of the seek to the last actually seeked
time in the video.
When beginning to seek, we must pause the media. Through existing mechanisms, this causes the media session
manager to update its Now Playing information, which informs media remote that we are no longer playing and
prevents us from stuttering. However, when ending a seek, we must also trigger an additional update to again
refresh media remote's view of the current time. This prevents a flicker when playing media after seeking.
Unit tests to be added in a follow-up due to time constraints.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::HTMLMediaElement):
(WebCore::HTMLMediaElement::handleSeekToPlaybackPosition):
(WebCore::HTMLMediaElement::seekToPlaybackPositionEndedTimerFired):
(WebCore::HTMLMediaElement::didReceiveRemoteControlCommand):
* html/HTMLMediaElement.h:
* platform/audio/PlatformMediaSessionManager.h:
(WebCore::PlatformMediaSessionManager::scheduleUpdateNowPlayingInfo):
(WebCore::PlatformMediaSessionManager::sessionDidEndRemoteScrubbing):
(WebCore::PlatformMediaSessionManager::sessions): Deleted.
* platform/audio/mac/MediaSessionManagerMac.h:
* platform/audio/mac/MediaSessionManagerMac.mm:
(WebCore::PlatformMediaSessionManager::updateNowPlayingInfoIfNecessary):
(WebCore::MediaSessionManagerMac::scheduleUpdateNowPlayingInfo):
(WebCore::MediaSessionManagerMac::sessionDidEndRemoteScrubbing):
(WebCore::MediaSessionManagerMac::updateNowPlayingInfo):
2016-09-26 Chris Dumez <cdumez@apple.com>
[WK2] BlobDownloadClient should use asynchronous IPC to decide destination path
https://bugs.webkit.org/show_bug.cgi?id=162568
Reviewed by Alex Christensen.
Update BlobResourceHandle to wait for continueDidReceiveResponse() to be
called after it calls the client's didReceiveResponseAsync(), before
actually reading the Blob Data.
No new tests, covered by existing tests.
* platform/network/BlobResourceHandle.cpp:
(WebCore::BlobResourceHandle::continueDidReceiveResponse):
(WebCore::BlobResourceHandle::getSizeForNext):
(WebCore::BlobResourceHandle::notifyResponseOnSuccess):
(WebCore::BlobResourceHandle::notifyResponseOnError):
2016-09-26 Daniel Bates <dabates@apple.com>
Mark Ping{Handle, Load} as final
https://bugs.webkit.org/show_bug.cgi?id=162576
Reviewed by Alex Christensen.
We should not support subclassing of a ping handle or overriding its ResourceHandleClient
callbacks because there are security/privacy implications with a ping request. We should
not encourage subclassing without careful consideration.
* platform/network/PingHandle.h:
2016-09-26 Daniel Bates <dabates@apple.com>
Rename IOS_TEXT_AUTOSIZING to TEXT_AUTOSIZING
https://bugs.webkit.org/show_bug.cgi?id=162365
Reviewed by Simon Fraser.
Repurpose the feature name TEXT_AUTOSIZING for the ENABLE(IOS_TEXT_AUTOSIZING)-guarded code
as this code represents WebKit's automatic text size adjustment machinery and is compiled
on both macOS and iOS.
* Configurations/FeatureDefines.xcconfig:
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::propertyValue):
* css/CSSPropertyNames.in:
* css/StyleBuilderCustom.h:
* css/StyleResolver.cpp:
(WebCore::StyleResolver::updateFont):
* css/StyleResolver.h:
* css/parser/CSSParser.cpp:
(WebCore::CSSParserContext::CSSParserContext):
(WebCore::CSSParser::parseValue):
* css/parser/CSSParser.h:
* css/parser/CSSParserMode.h:
* dom/Document.cpp:
(WebCore::Document::destroyRenderTree):
* dom/Document.h:
* editing/EditingStyle.cpp:
* page/FrameView.cpp:
(WebCore::FrameView::layout):
* page/Page.cpp:
(WebCore::Page::Page):
* page/Page.h:
* page/Settings.in:
* platform/graphics/FontCascade.h:
* platform/graphics/FontDescription.cpp:
* platform/graphics/FontDescription.h:
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::RenderBlockFlow):
* rendering/RenderBlockFlow.h:
* rendering/RenderElement.cpp:
* rendering/RenderElement.h:
* rendering/RenderObject.cpp:
* rendering/RenderObject.h:
* rendering/RenderText.cpp:
(WebCore::RenderText::RenderText):
* rendering/RenderText.h:
* rendering/TextAutoSizing.cpp:
* rendering/TextAutoSizing.h:
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::changeRequiresLayout):
* rendering/style/RenderStyle.h:
* rendering/style/StyleInheritedData.cpp:
(WebCore::StyleInheritedData::StyleInheritedData):
(WebCore::StyleInheritedData::operator==):
* rendering/style/StyleInheritedData.h:
* rendering/style/StyleRareInheritedData.cpp:
(WebCore::StyleRareInheritedData::StyleRareInheritedData):
(WebCore::StyleRareInheritedData::operator==):
* rendering/style/StyleRareInheritedData.h:
* rendering/style/TextSizeAdjustment.h:
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::Backup::Backup):
(WebCore::InternalSettings::Backup::restoreTo):
(WebCore::InternalSettings::setTextAutosizingEnabled):
(WebCore::InternalSettings::setTextAutosizingWindowSizeOverride):
* testing/InternalSettings.h:
2016-09-26 Nan Wang <n_wang@apple.com>
AX: Progress: [Mac] Content in label element should be used as AXTitle or AXDescription
https://bugs.webkit.org/show_bug.cgi?id=162573
Reviewed by Chris Fleizach.
Exposed the label element's text as the AXTitle of the progress indicator.
Test: accessibility/mac/progress-with-label-element.html
* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::titleElementText):
(WebCore::AccessibilityNodeObject::title):
2016-09-26 Ryan Haddad <ryanhaddad@apple.com>
Rebaseline bindings tests after r206386.
Unreviewed test gardening.
* bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
* bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
* bindings/scripts/test/JS/JSTestGlobalObject.cpp:
* bindings/scripts/test/JS/JSTestInterface.cpp:
* bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
* bindings/scripts/test/JS/JSTestNode.cpp:
* bindings/scripts/test/JS/JSTestNondeterministic.cpp:
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
* bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
* bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
2016-09-26 Youenn Fablet <youenn@apple.com>
ASSERTION FAILED: m_origin || m_type == CachedResource::MainResource
https://bugs.webkit.org/show_bug.cgi?id=162472
<rdar://problem/28431522>
Reviewed by Chris Dumez.
Covered by existing tests.
* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::CachedImage): Fixing the last CachedImage constructor.
Using CachedResource protected constructor.
* loader/cache/CachedResource.h: Small clean-up.
2016-09-26 Youenn Fablet <youenn@apple.com>
[GTK][EFL] imported/w3c/web-platform-tests/fetch/api/basic/accept-header.html is failing
https://bugs.webkit.org/show_bug.cgi?id=162547
Reviewed by Carlos Garcia Campos.
Covered by LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/accept-header.html now passing.
* platform/network/soup/SoupNetworkSession.cpp:
(WebCore::SoupNetworkSession::createTestingSession): Setting a default Accept-Language value.
2016-09-26 Mark Lam <mark.lam@apple.com>
Added RETURN_IF_EXCEPTION() macro and use it for exception checks.
https://bugs.webkit.org/show_bug.cgi?id=162521
Reviewed by Saam Barati.
No new tests because this patch is mostly refactoring. The only change in
behavior is that functions that have a JSValue return type will now return the
empty JSValue when an exception is thrown. I tested this behavior by running
the existing JSC and layout tests.
* bindings/js/ArrayValue.cpp:
(WebCore::ArrayValue::get):
* bindings/js/IDBBindingUtilities.cpp:
(WebCore::toJS):
* bindings/js/JSApplePaySessionCustom.cpp:
(WebCore::JSApplePaySession::completeShippingMethodSelection):
(WebCore::JSApplePaySession::completeShippingContactSelection):
(WebCore::JSApplePaySession::completePaymentMethodSelection):
* bindings/js/JSAudioTrackCustom.cpp:
(WebCore::JSAudioTrack::setKind):
(WebCore::JSAudioTrack::setLanguage):
* bindings/js/JSBlobCustom.cpp:
(WebCore::constructJSBlob):
* bindings/js/JSCSSStyleDeclarationCustom.cpp:
(WebCore::JSCSSStyleDeclaration::getPropertyCSSValue):
* bindings/js/JSCommandLineAPIHostCustom.cpp:
(WebCore::getJSListenerFunctions):
* bindings/js/JSCryptoAlgorithmDictionary.cpp:
(WebCore::JSCryptoAlgorithmDictionary::getAlgorithmIdentifier):
(WebCore::getHashAlgorithm):
(WebCore::createAesCbcParams):
(WebCore::createAesKeyGenParams):
(WebCore::createHmacKeyParams):
(WebCore::createRsaKeyGenParams):
(WebCore::createRsaOaepParams):
* bindings/js/JSCryptoKeySerializationJWK.cpp:
(WebCore::getStringFromJSON):
(WebCore::JSCryptoKeySerializationJWK::reconcileUsages):
(WebCore::JSCryptoKeySerializationJWK::keyDataRSAComponents):
(WebCore::buildJSONForRSAComponents):
(WebCore::addUsagesToJSON):
(WebCore::JSCryptoKeySerializationJWK::serialize):
* bindings/js/JSCustomElementInterface.cpp:
(WebCore::constructCustomElementSynchronously):
(WebCore::JSCustomElementInterface::upgradeElement):
* bindings/js/JSCustomElementRegistryCustom.cpp:
(WebCore::getCustomElementCallback):
(WebCore::JSCustomElementRegistry::define):
(WebCore::whenDefinedPromise):
* bindings/js/JSDOMBinding.cpp:
(WebCore::valueToUSVString):
(WebCore::hasIteratorMethod):
(WebCore::toSmallerInt):
(WebCore::toSmallerUInt):
(WebCore::toInt32EnforceRange):
(WebCore::toUInt32EnforceRange):
(WebCore::toInt64EnforceRange):
(WebCore::toUInt64EnforceRange):
* bindings/js/JSDOMBinding.h:
(WebCore::toJSSequence):
(WebCore::toJS):
(WebCore::jsFrozenArray):
* bindings/js/JSDOMPromise.cpp:
(WebCore::rejectPromiseWithExceptionIfAny):
* bindings/js/JSDOMStringMapCustom.cpp:
(WebCore::JSDOMStringMap::putDelegate):
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::setLocation):
(WebCore::JSDOMWindow::open):
(WebCore::JSDOMWindow::showModalDialog):
(WebCore::handlePostMessage):
(WebCore::JSDOMWindow::setTimeout):
(WebCore::JSDOMWindow::setInterval):
* bindings/js/JSDataCueCustom.cpp:
(WebCore::constructJSDataCue):
* bindings/js/JSDeviceMotionEventCustom.cpp:
(WebCore::readAccelerationArgument):
(WebCore::readRotationRateArgument):
(WebCore::JSDeviceMotionEvent::initDeviceMotionEvent):
* bindings/js/JSDictionary.cpp:
(WebCore::JSDictionary::tryGetProperty):
(WebCore::JSDictionary::convertValue):
* bindings/js/JSDictionary.h:
(WebCore::JSDictionary::tryGetPropertyAndResult):
* bindings/js/JSDocumentCustom.cpp:
(WebCore::JSDocument::getCSSCanvasContext):
* bindings/js/JSFileCustom.cpp:
(WebCore::constructJSFile):
* bindings/js/JSGeolocationCustom.cpp:
(WebCore::JSGeolocation::getCurrentPosition):
(WebCore::JSGeolocation::watchPosition):
* bindings/js/JSHTMLAllCollectionCustom.cpp:
(WebCore::callHTMLAllCollection):
* bindings/js/JSHTMLCanvasElementCustom.cpp:
(WebCore::JSHTMLCanvasElement::getContext):
* bindings/js/JSHTMLElementCustom.cpp:
(WebCore::constructJSHTMLElement):
* bindings/js/JSHistoryCustom.cpp:
(WebCore::JSHistory::pushState):
(WebCore::JSHistory::replaceState):
* bindings/js/JSIDBDatabaseCustom.cpp:
(WebCore::JSIDBDatabase::createObjectStore):
* bindings/js/JSMessageEventCustom.cpp:
(WebCore::handleInitMessageEvent):
* bindings/js/JSMessagePortCustom.cpp:
(WebCore::fillMessagePortArray):
* bindings/js/JSMessagePortCustom.h:
(WebCore::handlePostMessage):
* bindings/js/JSMockContentFilterSettingsCustom.cpp:
(WebCore::JSMockContentFilterSettings::setDecisionPoint):
(WebCore::toDecision):
(WebCore::JSMockContentFilterSettings::setDecision):
(WebCore::JSMockContentFilterSettings::setUnblockRequestDecision):
* bindings/js/JSNodeFilterCustom.cpp:
(WebCore::JSNodeFilter::acceptNode):
* bindings/js/JSNodeOrString.cpp:
(WebCore::toNodeOrStringVector):
* bindings/js/JSSQLTransactionCustom.cpp:
(WebCore::JSSQLTransaction::executeSql):
* bindings/js/JSSVGLengthCustom.cpp:
(WebCore::JSSVGLength::convertToSpecifiedUnits):
* bindings/js/JSStorageCustom.cpp:
(WebCore::JSStorage::getOwnPropertyNames):
* bindings/js/JSTextTrackCustom.cpp:
(WebCore::JSTextTrack::setLanguage):
* bindings/js/JSVideoTrackCustom.cpp:
(WebCore::JSVideoTrack::setKind):
(WebCore::JSVideoTrack::setLanguage):
* bindings/js/JSWebGL2RenderingContextCustom.cpp:
(WebCore::JSWebGL2RenderingContext::getIndexedParameter):
* bindings/js/JSWebGLRenderingContextBaseCustom.cpp:
(WebCore::getObjectParameter):
(WebCore::JSWebGLRenderingContextBase::getExtension):
(WebCore::JSWebGLRenderingContextBase::getFramebufferAttachmentParameter):
(WebCore::JSWebGLRenderingContextBase::getParameter):
(WebCore::JSWebGLRenderingContextBase::getProgramParameter):
(WebCore::JSWebGLRenderingContextBase::getShaderParameter):
(WebCore::toVector):
(WebCore::dataFunctionf):
(WebCore::dataFunctionMatrix):
* bindings/js/JSWebKitSubtleCryptoCustom.cpp:
(WebCore::cryptoKeyFormatFromJSValue):
(WebCore::cryptoKeyUsagesFromJSValue):
(WebCore::JSWebKitSubtleCrypto::generateKey):
(WebCore::importKey):
(WebCore::JSWebKitSubtleCrypto::importKey):
(WebCore::exportKey):
(WebCore::JSWebKitSubtleCrypto::exportKey):
(WebCore::JSWebKitSubtleCrypto::unwrapKey):
* bindings/js/JSWorkerCustom.cpp:
(WebCore::constructJSWorker):
* bindings/js/JSWorkerGlobalScopeCustom.cpp:
(WebCore::JSWorkerGlobalScope::importScripts):
(WebCore::JSWorkerGlobalScope::setTimeout):
(WebCore::JSWorkerGlobalScope::setInterval):
* bindings/js/ReadableStreamDefaultController.cpp:
(WebCore::ReadableStreamDefaultController::invoke):
* bindings/js/ScheduledAction.cpp:
(WebCore::ScheduledAction::create):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateDictionaryImplementationContent):
(GenerateImplementation):
(GenerateParametersCheck):
(GenerateImplementationFunctionCall):
(GenerateConstructorDefinition):
* html/HTMLMediaElement.cpp:
(WebCore::controllerJSValue):
(WebCore::HTMLMediaElement::updateMediaControlsAfterPresentationModeChange):
(WebCore::HTMLMediaElement::getCurrentMediaControlsStatus):
2016-09-26 Michael Catanzaro <mcatanzaro@igalia.com>
-Wtautological-compare triggered in URLParser::internalValuesConsistent
https://bugs.webkit.org/show_bug.cgi?id=162551
Reviewed by Alex Christensen.
Fix logic error.
* platform/URLParser.cpp:
(WebCore::URLParser::internalValuesConsistent):
2016-09-26 Michael Catanzaro <mcatanzaro@igalia.com>
Add CairoUniquePtr and use it in FontPlatformDataFreetype.cpp
https://bugs.webkit.org/show_bug.cgi?id=162557
Reviewed by Alex Christensen.
* platform/graphics/cairo/CairoUniquePtr.h: Added.
(WebCore::CairoPtrDeleter<cairo_font_options_t>::operator()):
* platform/graphics/freetype/FontPlatformDataFreeType.cpp:
(WebCore::getDefaultCairoFontOptions): Return a smart pointer.
(WebCore::FontPlatformData::buildScaledFont): Use smart pointer.
2016-09-26 Michael Catanzaro <mcatanzaro@igalia.com>
Silence unused parameter warnings from Geoclue2Interface.c
https://bugs.webkit.org/show_bug.cgi?id=162545
Reviewed by Carlos Garcia Campos.
* PlatformGTK.cmake:
2016-09-26 Michael Catanzaro <mcatanzaro@igalia.com>
std::unique_ptr deleter functions should not check if pointer is null
https://bugs.webkit.org/show_bug.cgi?id=162558
Reviewed by Alex Christensen.
std::unique_ptr already does this before calling the deleter.
* platform/graphics/x11/XUniquePtr.h:
(WebCore::XPtrDeleter::operator()):
(WebCore::XPtrDeleter<XImage>::operator()):
(WebCore::XPtrDeleter<_XGC>::operator()):
(WebCore::XPtrDeleter<__GLXcontextRec>::operator()):
2016-09-26 Per Arne Vollan <pvollan@apple.com>
[Win][Debug] Compile fix.
https://bugs.webkit.org/show_bug.cgi?id=162550
Reviewed by Alex Christensen.
Windows headers need the FragmentForwardIterator '==' operator in debug mode.
* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::FragmentForwardIterator::operator==):
2016-09-26 Michael Catanzaro <mcatanzaro@igalia.com>
[GTK] Unnecessary extern functions in FontPlatformDataFreeType.cpp
https://bugs.webkit.org/show_bug.cgi?id=162555
Reviewed by Carlos Garcia Campos.
These functions should be file-static.
* platform/graphics/freetype/FontPlatformDataFreeType.cpp:
(WebCore::convertFontConfigSubpixelOrder):
(WebCore::convertFontConfigHintStyle):
(WebCore::setCairoFontOptionsFromFontConfigPattern):
== Rolled over to ChangeLog-2016-09-26 ==