Implement InputEvent.getTargetRanges() for the input events spec
[WebKit.git] / Source / WebCore / ChangeLog
1 2016-10-21  Wenson Hsieh  <wenson_hsieh@apple.com>
2
3         Implement InputEvent.getTargetRanges() for the input events spec
4         https://bugs.webkit.org/show_bug.cgi?id=162947
5         <rdar://problem/28853079>
6
7         Reviewed by Darin Adler.
8
9         Implements InputEvent.getTargetRanges(). See individual method changes below for more details. Adds a new hook
10         for subclasses of CompositeEditCommand to vend a list of target StaticRanges when retrieving target ranges for
11         an editing command on a contenteditable area.
12
13         Tests: fast/events/before-input-delete-empty-list-target-ranges.html
14                fast/events/before-input-delete-text-target-ranges.html
15                fast/events/before-input-replace-text-target-ranges.html
16
17         * CMakeLists.txt:
18         * DerivedSources.make:
19         * WebCore.xcodeproj/project.pbxproj:
20
21         Add StaticRange.idl, StaticRange.cpp and StaticRange.h.
22
23         * bindings/generic/RuntimeEnabledFeatures.h:
24         (WebCore::RuntimeEnabledFeatures::setInputEventsEnabled):
25         (WebCore::RuntimeEnabledFeatures::inputEventsEnabled):
26
27         Add a new runtime bindings flag for InputEvents and guard both InputEvent and StaticRange behind it.
28
29         * dom/DOMAllInOne.cpp:
30         * dom/InputEvent.cpp:
31         (WebCore::InputEvent::InputEvent):
32         * dom/InputEvent.h:
33         * dom/InputEvent.idl:
34         * dom/StaticRange.cpp: Copied from Source/WebCore/dom/InputEvent.cpp.
35         (WebCore::StaticRange::StaticRange):
36         (WebCore::StaticRange::create):
37         (WebCore::StaticRange::createFromRange):
38
39         Convenience method for creating a StaticRange from a Range's start/end container and offset.
40
41         (WebCore::StaticRange::startContainer):
42         (WebCore::StaticRange::endContainer):
43         (WebCore::StaticRange::collapsed):
44         * dom/StaticRange.h: Copied from Source/WebCore/dom/InputEvent.cpp.
45         (WebCore::StaticRange::startOffset):
46         (WebCore::StaticRange::endOffset):
47         * dom/StaticRange.idl: Copied from Source/WebCore/editing/ReplaceRangeWithTextCommand.h.
48         * editing/CompositeEditCommand.cpp:
49         (WebCore::CompositeEditCommand::willApplyCommand):
50         (WebCore::CompositeEditCommand::targetRanges):
51
52         Virtual method that returns a list of target ranges which are associated with this command.
53
54         (WebCore::CompositeEditCommand::targetRangesForBindings):
55
56         Non-virtual method that calls the above targetRanges(). Takes whether or not the CompositeEditCommand is editing
57         a textarea or plain text input into account.
58
59         (WebCore::CompositeEditCommand::moveParagraphs):
60         * editing/CompositeEditCommand.h:
61         * editing/EditCommand.cpp:
62         (WebCore::EditCommand::frame):
63         * editing/EditCommand.h:
64         (WebCore::EditCommand::document):
65         * editing/Editor.cpp:
66         (WebCore::dispatchBeforeInputEvent):
67         (WebCore::dispatchInputEvent):
68         (WebCore::dispatchBeforeInputEvents):
69
70         Changed the `beforeinput` event dispatch to use the regular Node::dispatchEvent instead of dispatchScopedEvent.
71         This is because if the page prevents the `beforeinput` event, we need to know immediately in order to bail from
72         the default action.
73
74         (WebCore::dispatchInputEvents):
75         (WebCore::Editor::willApplyEditing):
76
77         Added a list of static ranges as a parameter when calling on the Editor to dispatch `beforeinput` events.
78         By default, this uses the composite edit command's targetRangesForBindings(), though it may be special cased
79         by subclasses of CompositeEditCommand (see ReplaceRangeWithTextCommand, SpellingCorrectionCommand, and
80         TypingCommand).
81
82         * editing/Editor.h:
83         * editing/ReplaceRangeWithTextCommand.cpp:
84         (WebCore::ReplaceRangeWithTextCommand::targetRanges):
85         * editing/ReplaceRangeWithTextCommand.h:
86         * editing/SpellingCorrectionCommand.cpp:
87         (WebCore::SpellingCorrectionCommand::targetRanges):
88         * editing/SpellingCorrectionCommand.h:
89         * editing/TypingCommand.cpp:
90         (WebCore::editActionIsDeleteByTyping):
91         (WebCore::TypingCommand::shouldDeferWillApplyCommandUntilAddingTypingCommand):
92         (WebCore::TypingCommand::willApplyCommand):
93         (WebCore::TypingCommand::willAddTypingToOpenCommand):
94         (WebCore::TypingCommand::deleteKeyPressed):
95         (WebCore::TypingCommand::forwardDeleteKeyPressed):
96
97         Moves the firing of the `beforeinput` until after the selection range to delete has been computed.
98
99         * editing/TypingCommand.h:
100
101 2016-10-21  Antti Koivisto  <antti@apple.com>
102
103         Style resolver should be updated lazily
104         https://bugs.webkit.org/show_bug.cgi?id=163721
105
106         Reviewed by Andreas Kling.
107
108         Currently when stylesheets change in some way we generally update style resolvers and
109         invalidate style immediately. We should do this lazily to avoid unnecessary work.
110
111         Also improve naming of the stylesheet invalidation functions and use more optimal functions in some places.
112
113         * css/CSSComputedStyleDeclaration.cpp:
114         (WebCore::updateStyleIfNeededForNode):
115         * css/CSSStyleSheet.cpp:
116         (WebCore::CSSStyleSheet::didMutateRules):
117         (WebCore::CSSStyleSheet::didMutate):
118         (WebCore::CSSStyleSheet::setDisabled):
119         * css/StyleResolver.cpp:
120         (WebCore::StyleResolver::StyleResolver):
121
122             Initialize root style font with null font selector.
123             This avoids hitting a CSSFontSelector assert in fast/media/mq-relative-constraints-08.html where
124             media query evaluation requires font information before it is ready.
125             Exposed by increased laziness in this patch.
126
127         * dom/Document.cpp:
128         (WebCore::Document::setContentLanguage):
129         (WebCore::Document::updateLayoutIgnorePendingStylesheets):
130         (WebCore::Document::isPageBoxVisible):
131         (WebCore::Document::pageSizeAndMarginsInPixels):
132         (WebCore::Document::processHttpEquiv):
133         (WebCore::Document::setSelectedStylesheetSet):
134         (WebCore::Document::didInsertInDocumentShadowRoot):
135         (WebCore::Document::didRemoveInDocumentShadowRoot):
136         * dom/Document.h:
137         (WebCore::Document::inDocumentShadowRoots):
138
139             Track all shadow roots in the document. This allows us to find and flush style scopes cheaply.
140
141         * dom/Element.cpp:
142         (WebCore::Element::computedStyle):
143         * dom/ExtensionStyleSheets.cpp:
144         (WebCore::ExtensionStyleSheets::ExtensionStyleSheets):
145         (WebCore::ExtensionStyleSheets::clearPageUserSheet):
146         (WebCore::ExtensionStyleSheets::updatePageUserSheet):
147         (WebCore::ExtensionStyleSheets::invalidateInjectedStyleSheetCache):
148         (WebCore::ExtensionStyleSheets::addUserStyleSheet):
149         (WebCore::ExtensionStyleSheets::addAuthorStyleSheetForTesting):
150         (WebCore::ExtensionStyleSheets::addDisplayNoneSelector):
151         (WebCore::ExtensionStyleSheets::maybeAddContentExtensionSheet):
152         (WebCore::ExtensionStyleSheets::styleResolverChangedTimerFired): Deleted.
153
154             Since updates are now done lazily we don't need a special timer for extension stylesheets.
155
156         * dom/ExtensionStyleSheets.h:
157         * dom/ProcessingInstruction.cpp:
158         (WebCore::ProcessingInstruction::checkStyleSheet):
159         (WebCore::ProcessingInstruction::sheetLoaded):
160         (WebCore::ProcessingInstruction::removedFrom):
161         * dom/ShadowRoot.cpp:
162         (WebCore::ShadowRoot::ShadowRoot):
163         (WebCore::ShadowRoot::insertedInto):
164         (WebCore::ShadowRoot::removedFrom):
165         (WebCore::ShadowRoot::styleScope):
166         * dom/ShadowRoot.h:
167         * html/HTMLLinkElement.cpp:
168         (WebCore::HTMLLinkElement::setDisabledState):
169         (WebCore::HTMLLinkElement::parseAttribute):
170         (WebCore::HTMLLinkElement::process):
171         (WebCore::HTMLLinkElement::removePendingSheet):
172         * html/HTMLStyleElement.cpp:
173         (WebCore::HTMLStyleElement::parseAttribute):
174         * inspector/InspectorCSSAgent.cpp:
175         (WebCore::InspectorCSSAgent::createInspectorStyleSheetForDocument):
176         (WebCore::InspectorCSSAgent::forcePseudoState):
177         (WebCore::InspectorCSSAgent::resetPseudoStates):
178         * inspector/InspectorPageAgent.cpp:
179         (WebCore::InspectorPageAgent::setEmulatedMedia):
180         * page/Frame.cpp:
181         (WebCore::Frame::setPrinting):
182         * page/FrameView.cpp:
183         (WebCore::FrameView::layout):
184         (WebCore::FrameView::setPagination):
185         (WebCore::FrameView::setViewportSizeForCSSViewportUnits):
186         * page/Page.cpp:
187         (WebCore::Page::setViewMode):
188         (WebCore::Page::setNeedsRecalcStyleInAllFrames):
189         (WebCore::Page::invalidateInjectedStyleSheetCacheInAllFrames):
190         * style/StyleScope.cpp:
191         (WebCore::Style::Scope::setPreferredStylesheetSetName):
192         (WebCore::Style::Scope::setSelectedStylesheetSetName):
193         (WebCore::Style::Scope::removePendingSheet):
194         (WebCore::Style::Scope::removeStyleSheetCandidateNode):
195         (WebCore::Style::Scope::activeStyleSheetsForInspector):
196         (WebCore::Style::Scope::flushPendingUpdate):
197
198             Also flush descendant shadow roots.
199
200         (WebCore::Style::Scope::scheduleUpdate):
201         (WebCore::Style::Scope::didChangeActiveStyleSheetCandidates):
202
203             Make lazy.
204
205         (WebCore::Style::Scope::didChangeStyleSheetContents):
206
207             Make lazy.
208
209         (WebCore::Style::Scope::didChangeStyleSheetEnvironment):
210
211             Environment changes also affect author shadow roots.
212
213         (WebCore::Style::Scope::styleSheetsForStyleSheetList):
214         (WebCore::Style::Scope::scheduleActiveSetUpdate): Deleted.
215         (WebCore::Style::Scope::didChangeCandidatesForActiveSet): Deleted.
216         (WebCore::Style::Scope::didChangeContentsOrInterpretation): Deleted.
217
218             Improved naming of these and split didChangeContentsOrInterpretation into two separate functions.
219
220         * style/StyleScope.h:
221         (WebCore::Style::Scope::styleSheetsForStyleSheetList): Deleted.
222         (WebCore::Style::Scope::setPreferredStylesheetSetName): Deleted.
223         (WebCore::Style::Scope::setSelectedStylesheetSetName): Deleted.
224         * svg/SVGFontFaceElement.cpp:
225         (WebCore::SVGFontFaceElement::rebuildFontFace):
226         (WebCore::SVGFontFaceElement::removedFrom):
227         * testing/Internals.cpp:
228         (WebCore::Internals::resetToConsistentState):
229
230             Ensure that cationsStyleSheetOverride really becomes empty. Some tests rely on not having suprise
231             inserted stylesheets. Previously this was racy and the patch affected order of things.
232
233         (WebCore::Internals::styleChangeType):
234         * xml/XMLTreeViewer.cpp:
235         (WebCore::XMLTreeViewer::transformDocumentToTreeView):
236         * xml/parser/XMLDocumentParser.cpp:
237         (WebCore::XMLDocumentParser::end):
238         * xml/parser/XMLDocumentParserLibxml2.cpp:
239         (WebCore::XMLDocumentParser::doEnd):
240
241 2016-10-21  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Adam Bergkvist  <adam.bergkvist@ericsson.com>
242
243         WebRTC: [OpenWebRTC] Move SDPProcessorScriptResource(Gtk) to openwebrtc directory
244         https://bugs.webkit.org/show_bug.cgi?id=163778
245
246         Reviewed by Philippe Normand.
247
248         Move SDPProcessorScriptResourceGtk from the platform gtk directory to the port generic
249         openwebrtc directory to make it usable by other ports. Also drop the Gtk-suffix.
250
251         No change of behavior.
252
253         * PlatformGTK.cmake:
254         * platform/mediastream/gtk/SDPProcessorScriptResourceGtk.cpp:
255         (WebCore::SDPProcessorScriptResource::scriptString): Deleted.
256         * platform/mediastream/openwebrtc/SDPProcessorScriptResource.cpp: Renamed from Source/WebCore/platform/mediastream/gtk/SDPProcessorScriptResourceGtk.cpp.
257         (WebCore::SDPProcessorScriptResource::scriptString):
258
259 2016-10-21  Miguel Gomez  <magomez@igalia.com>
260
261         [GTK] Several tests crashing on debug bot in (anonymous namespace)::MediaPlayerPrivateGStreamerBase::repaint
262         https://bugs.webkit.org/show_bug.cgi?id=163511
263
264         Reviewed by Carlos Garcia Campos.
265
266         Perform the video repaint in the main thread when accelerated compositing is disabled. Added a new method to
267         MediaPlayerClient to get whether accelerated compositing is enabled from the MediaPlayer. This is needed
268         because mediaPlayerAcceleratedCompositingEnabled() will return false while HTMLMediaElement doesn't have a
269         RenderVideo, even when accelerated compositing is enabled.
270
271         Covered by existent tests.
272
273         * html/HTMLMediaElement.cpp:
274         (WebCore::HTMLMediaElement::mediaPlayerAcceleratedCompositingEnabled):
275         * html/HTMLMediaElement.h:
276         * platform/graphics/MediaPlayer.h:
277         (WebCore::MediaPlayerClient::mediaPlayerAcceleratedCompositingEnabled):
278         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
279         (WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase):
280         (WebCore::MediaPlayerPrivateGStreamerBase::repaint):
281         (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
282         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
283
284 2016-10-21  Adam Bergkvist  <adam.bergkvist@ericsson.com>
285
286         WebRTC: [GTK] Add MediaEndpointOwr - an OpenWebRTC WebRTC backend
287         https://bugs.webkit.org/show_bug.cgi?id=163327
288
289         Reviewed by Philippe Normand.
290
291         Add MediaEndpointOwr which is a MediaEndpoint implementation (WebRTC backend) based on
292         OpenWebRTC [1]. The WebRTC backend can be tested with a manual test. Automatic testing
293         is still done with MockMediaEndpoint.
294
295         [1] http://www.openwebrtc.org/
296
297         Testing: Added manual test (webrtc-one-tab-p2p.html)
298
299         * CMakeLists.txt:
300         * platform/GStreamer.cmake:
301         * platform/mediastream/openwebrtc/MediaEndpointOwr.cpp: Added.
302         (WebCore::createMediaEndpointOwr):
303         (WebCore::MediaEndpointOwr::MediaEndpointOwr):
304         (WebCore::MediaEndpointOwr::~MediaEndpointOwr):
305         (WebCore::MediaEndpointOwr::setConfiguration):
306         (WebCore::cryptoDataCallback):
307         (WebCore::MediaEndpointOwr::generateDtlsInfo):
308         (WebCore::MediaEndpointOwr::getDefaultAudioPayloads):
309         (WebCore::MediaEndpointOwr::getDefaultVideoPayloads):
310         (WebCore::payloadsContainType):
311         (WebCore::MediaEndpointOwr::filterPayloads):
312         (WebCore::MediaEndpointOwr::updateReceiveConfiguration):
313         (WebCore::findRtxPayload):
314         (WebCore::MediaEndpointOwr::updateSendConfiguration):
315         (WebCore::MediaEndpointOwr::addRemoteCandidate):
316         (WebCore::MediaEndpointOwr::replaceMutedRemoteSourceMid):
317         (WebCore::MediaEndpointOwr::createMutedRemoteSource):
318         (WebCore::MediaEndpointOwr::replaceSendSource):
319         (WebCore::MediaEndpointOwr::stop):
320         (WebCore::MediaEndpointOwr::transceiverIndexForSession):
321         (WebCore::MediaEndpointOwr::sessionMid):
322         (WebCore::MediaEndpointOwr::matchTransceiverByMid):
323         (WebCore::MediaEndpointOwr::dispatchNewIceCandidate):
324         (WebCore::MediaEndpointOwr::dispatchGatheringDone):
325         (WebCore::MediaEndpointOwr::processIceTransportStateChange):
326         (WebCore::MediaEndpointOwr::dispatchDtlsFingerprint):
327         (WebCore::MediaEndpointOwr::unmuteRemoteSource):
328         (WebCore::MediaEndpointOwr::prepareSession):
329         (WebCore::MediaEndpointOwr::prepareMediaSession):
330         (WebCore::parseHelperServerUrl):
331         (WebCore::MediaEndpointOwr::ensureTransportAgentAndTransceivers):
332         (WebCore::MediaEndpointOwr::internalAddRemoteCandidate):
333         (WebCore::gotCandidate):
334         (WebCore::candidateGatheringDone):
335         (WebCore::iceConnectionStateChange):
336         (WebCore::gotIncomingSource):
337         * platform/mediastream/openwebrtc/MediaEndpointOwr.h: Added.
338         (WebCore::OwrTransceiver::create):
339         (WebCore::OwrTransceiver::~OwrTransceiver):
340         (WebCore::OwrTransceiver::mid):
341         (WebCore::OwrTransceiver::session):
342         (WebCore::OwrTransceiver::owrIceState):
343         (WebCore::OwrTransceiver::setOwrIceState):
344         (WebCore::OwrTransceiver::gotEndOfRemoteCandidates):
345         (WebCore::OwrTransceiver::markGotEndOfRemoteCandidates):
346         (WebCore::OwrTransceiver::OwrTransceiver):
347         * platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.h:
348         (WebCore::RealtimeMediaSourceOwr::RealtimeMediaSourceOwr):
349         (WebCore::RealtimeMediaSourceOwr::swapOutShallowSource):
350         Add support for an initially muted source. This is used for early
351         creation of remote sources.
352
353 2016-10-21  Javier Fernandez  <jfernandez@igalia.com>
354
355         [css-grid] Content Alignment broken with indefinite sized grid container
356         https://bugs.webkit.org/show_bug.cgi?id=163724
357
358         Reviewed by Manuel Rego Casasnovas.
359
360         The Grid Tracks sizing algorithm receives as parameter the
361         available space to be used as space for tracks. We hold a variable
362         to store the remaining free space for each dimension.
363
364         When the grid container size is indefinite we can't compute the
365         available free space after computing track sizes until such
366         indefinite size is resolved.
367
368         No new tests, just added some additional test cases.
369
370         * rendering/RenderGrid.cpp:
371         (WebCore::RenderGrid::layoutBlock): Compute freeSpace for Rows
372         after doing layout and resolving the indefinite height.
373
374 2016-10-21  Jer Noble  <jer.noble@apple.com>
375
376         CRASH in SourceBuffer::sourceBufferPrivateDidReceiveSample + 2169
377         https://bugs.webkit.org/show_bug.cgi?id=163735
378
379         Reviewed by Eric Carlson.
380
381         Test: media/media-source/media-source-sample-wrong-track-id.html
382
383         When SourceBuffer receives a sample in sourceBufferPrivateDidReceiveSample() containing
384         a trackID not previously seen in an initialization segment, it creates a default TrackBuffer
385         object to contain that track's samples. One of the fields in TrackBuffer, description, is
386         normally filled out when an initialization segment is received, but with this default
387         TrackBuffer, it's still null when it's checked later in sourceBufferPrivateDidReceiveSample().
388
389         Rather than adding a null-check on trackBuffer.description, drop any sample that has a 
390         trackID which was not present during a previous initialization segment.
391
392         * Modules/mediasource/SourceBuffer.cpp:
393         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
394
395 2016-10-20  Carlos Garcia Campos  <cgarcia@igalia.com>
396
397         [GTK] Configures but fails to link with ENABLE_OPENGL=OFF
398         https://bugs.webkit.org/show_bug.cgi?id=163449
399
400         Reviewed by Michael Catanzaro.
401
402         Only define sharingGLContext in PlatformDisplay if EGL or GLX are enabled.
403
404         * platform/graphics/PlatformDisplay.cpp:
405         * platform/graphics/PlatformDisplay.h:
406         * platform/graphics/wayland/PlatformDisplayWayland.cpp:
407         (WebCore::PlatformDisplayWayland::initialize):
408         * platform/graphics/x11/PlatformDisplayX11.cpp:
409         (WebCore::PlatformDisplayX11::~PlatformDisplayX11):
410
411 2016-10-20  Filip Pizlo  <fpizlo@apple.com>
412
413         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
414         https://bugs.webkit.org/show_bug.cgi?id=163738
415
416         Reviewed by Geoffrey Garen.
417
418         No new tests because no change in behavior.
419
420         * bindings/js/GCController.cpp:
421         (WebCore::GCController::garbageCollectNow):
422
423 2016-10-20  Chris Dumez  <cdumez@apple.com>
424
425         [Bindings] Start using signature->idlType instead of signature->type in the overload resolution code
426         https://bugs.webkit.org/show_bug.cgi?id=163767
427
428         Reviewed by Darin Adler.
429
430         Start using signature->idlType instead of signature->type in the overload resolution code
431         to prepare for union type support.
432
433         * bindings/scripts/CodeGeneratorJS.pm:
434         (ComputeEffectiveOverloadSet):
435         (AreTypesDistinguishableForOverloadResolution):
436         (GetDistinguishingArgumentIndex):
437         (GetOverloadThatMatches):
438         (GenerateOverloadedFunctionOrConstructor):
439
440 2016-10-20  Myles C. Maxfield  <mmaxfield@apple.com>
441
442         Implement WebGL2 bufferData() and bufferSubData() methods
443         https://bugs.webkit.org/show_bug.cgi?id=163759
444
445         Reviewed by Dean Jackson.
446
447         These new overloads simply clip the input array buffer.
448
449         Test: fast/canvas/webgl/bufferData-offset-length.html
450
451         * html/canvas/WebGL2RenderingContext.cpp:
452         (WebCore::WebGL2RenderingContext::bufferData):
453         (WebCore::WebGL2RenderingContext::bufferSubData):
454         * html/canvas/WebGL2RenderingContext.h:
455         * html/canvas/WebGL2RenderingContext.idl:
456
457 2016-10-20  Chris Dumez  <cdumez@apple.com>
458
459         "Download Linked File" context menu action should use 'download' attribute as suggested filename
460         https://bugs.webkit.org/show_bug.cgi?id=163742
461         <rdar://problem/28840734>
462
463         Reviewed by Darin Adler.
464
465         Add convenience method to HitTestResult to return the URL element's
466         download attribute.
467
468         * rendering/HitTestResult.cpp:
469         (WebCore::HitTestResult::URLElementDownloadAttribute):
470         * rendering/HitTestResult.h:
471
472 2016-10-20  Nan Wang  <n_wang@apple.com>
473
474         AX: VoiceOver is not detecting ARIA treeview if it contains role="presentation"
475         https://bugs.webkit.org/show_bug.cgi?id=163763
476
477         Reviewed by Chris Fleizach.
478
479         Test: accessibility/mac/aria-tree-with-presentation-role.html
480
481         Web authors sometimes use presentation role in the aria tree to hide elements. We should
482         consider this a valid case if they specify tree items and groups correctly.
483
484         * accessibility/AccessibilityNodeObject.cpp:
485         (WebCore::AccessibilityNodeObject::hierarchicalLevel):
486         * accessibility/AccessibilityTree.cpp:
487         (WebCore::AccessibilityTree::nodeHasTreeItemChild):
488         (WebCore::AccessibilityTree::isTreeValid):
489         * accessibility/AccessibilityTree.h:
490
491 2016-10-20  Myles C. Maxfield  <mmaxfield@apple.com>
492
493         Many WebGL functions which don't throw are marked as possibly throwing
494         https://bugs.webkit.org/show_bug.cgi?id=163747
495
496         Reviewed by Dean Jackson.
497
498         Mechanically remove the exception code.
499
500         No new tests because there is no behavior change.
501
502         * bindings/js/JSWebGLRenderingContextBaseCustom.cpp:
503         (WebCore::getObjectParameter):
504         (WebCore::JSWebGLRenderingContextBase::getAttachedShaders):
505         (WebCore::JSWebGLRenderingContextBase::getProgramParameter):
506         (WebCore::JSWebGLRenderingContextBase::getShaderParameter):
507         (WebCore::JSWebGLRenderingContextBase::getUniform):
508         (WebCore::dataFunctionf):
509         (WebCore::dataFunctioni):
510         (WebCore::dataFunctionMatrix):
511         * html/canvas/WebGL2RenderingContext.cpp:
512         (WebCore::WebGL2RenderingContext::texSubImage2D):
513         * html/canvas/WebGLRenderingContext.cpp:
514         (WebCore::WebGLRenderingContext::texSubImage2D):
515         * html/canvas/WebGLRenderingContextBase.cpp:
516         (WebCore::WebGLRenderingContextBase::activeTexture):
517         (WebCore::WebGLRenderingContextBase::attachShader):
518         (WebCore::WebGLRenderingContextBase::bindAttribLocation):
519         (WebCore::WebGLRenderingContextBase::bindBuffer):
520         (WebCore::WebGLRenderingContextBase::bindFramebuffer):
521         (WebCore::WebGLRenderingContextBase::bindRenderbuffer):
522         (WebCore::WebGLRenderingContextBase::bindTexture):
523         (WebCore::WebGLRenderingContextBase::bufferData):
524         (WebCore::WebGLRenderingContextBase::bufferSubData):
525         (WebCore::WebGLRenderingContextBase::compileShader):
526         (WebCore::WebGLRenderingContextBase::createShader):
527         (WebCore::WebGLRenderingContextBase::detachShader):
528         (WebCore::WebGLRenderingContextBase::disableVertexAttribArray):
529         (WebCore::WebGLRenderingContextBase::drawArrays):
530         (WebCore::WebGLRenderingContextBase::drawElements):
531         (WebCore::WebGLRenderingContextBase::enableVertexAttribArray):
532         (WebCore::WebGLRenderingContextBase::framebufferRenderbuffer):
533         (WebCore::WebGLRenderingContextBase::framebufferTexture2D):
534         (WebCore::WebGLRenderingContextBase::getActiveAttrib):
535         (WebCore::WebGLRenderingContextBase::getActiveUniform):
536         (WebCore::WebGLRenderingContextBase::getAttachedShaders):
537         (WebCore::WebGLRenderingContextBase::getBufferParameter):
538         (WebCore::WebGLRenderingContextBase::getProgramParameter):
539         (WebCore::WebGLRenderingContextBase::getProgramInfoLog):
540         (WebCore::WebGLRenderingContextBase::getRenderbufferParameter):
541         (WebCore::WebGLRenderingContextBase::getShaderParameter):
542         (WebCore::WebGLRenderingContextBase::getShaderInfoLog):
543         (WebCore::WebGLRenderingContextBase::getShaderPrecisionFormat):
544         (WebCore::WebGLRenderingContextBase::getShaderSource):
545         (WebCore::WebGLRenderingContextBase::getTexParameter):
546         (WebCore::WebGLRenderingContextBase::getUniform):
547         (WebCore::WebGLRenderingContextBase::getUniformLocation):
548         (WebCore::WebGLRenderingContextBase::getVertexAttrib):
549         (WebCore::WebGLRenderingContextBase::linkProgram):
550         (WebCore::WebGLRenderingContextBase::readPixels):
551         (WebCore::WebGLRenderingContextBase::shaderSource):
552         (WebCore::WebGLRenderingContextBase::videoFrameToImage):
553         (WebCore::WebGLRenderingContextBase::texImage2D):
554         (WebCore::WebGLRenderingContextBase::uniform1f):
555         (WebCore::WebGLRenderingContextBase::uniform1fv):
556         (WebCore::WebGLRenderingContextBase::uniform1i):
557         (WebCore::WebGLRenderingContextBase::uniform1iv):
558         (WebCore::WebGLRenderingContextBase::uniform2f):
559         (WebCore::WebGLRenderingContextBase::uniform2fv):
560         (WebCore::WebGLRenderingContextBase::uniform2i):
561         (WebCore::WebGLRenderingContextBase::uniform2iv):
562         (WebCore::WebGLRenderingContextBase::uniform3f):
563         (WebCore::WebGLRenderingContextBase::uniform3fv):
564         (WebCore::WebGLRenderingContextBase::uniform3i):
565         (WebCore::WebGLRenderingContextBase::uniform3iv):
566         (WebCore::WebGLRenderingContextBase::uniform4f):
567         (WebCore::WebGLRenderingContextBase::uniform4fv):
568         (WebCore::WebGLRenderingContextBase::uniform4i):
569         (WebCore::WebGLRenderingContextBase::uniform4iv):
570         (WebCore::WebGLRenderingContextBase::uniformMatrix2fv):
571         (WebCore::WebGLRenderingContextBase::uniformMatrix3fv):
572         (WebCore::WebGLRenderingContextBase::uniformMatrix4fv):
573         (WebCore::WebGLRenderingContextBase::useProgram):
574         (WebCore::WebGLRenderingContextBase::validateProgram):
575         (WebCore::WebGLRenderingContextBase::vertexAttribPointer):
576         (WebCore::WebGLRenderingContextBase::restoreCurrentFramebuffer):
577         (WebCore::WebGLRenderingContextBase::restoreCurrentTexture2D):
578         * html/canvas/WebGLRenderingContextBase.h:
579         * html/canvas/WebGLRenderingContextBase.idl:
580
581 2016-10-19  Myles C. Maxfield  <mmaxfield@apple.com>
582
583         [macOS] [iOS] Disable variation fonts on macOS El Capitan and iOS 9
584         https://bugs.webkit.org/show_bug.cgi?id=163374
585
586         Reviewed by Darin Adler.
587
588         Because of platform lack of support for variations in in-memory fonts,
589         this feature should be disabled on the affected OSes.
590
591         No tests because there is no behavior change (on the relevant platforms).
592
593         * Configurations/FeatureDefines.xcconfig:
594
595 2016-10-20  Brady Eidson  <beidson@apple.com>
596
597         IndexedDB 2.0: Support IDBObjectStore name assignment.
598         <rdar://problem/28806931> and https://bugs.webkit.org/show_bug.cgi?id=163749
599
600         Reviewed by Alex Christensen.
601
602         Tests: storage/indexeddb/modern/objectstore-rename-1-private.html
603                storage/indexeddb/modern/objectstore-rename-1.html
604
605         Touches a *lot* of code sites, but none of them are particularly interesting.
606         They are all just getting the new name spread out to all of the various objects that need it.
607
608         * Modules/indexeddb/IDBDatabase.cpp:
609         (WebCore::IDBDatabase::renameObjectStore):
610         * Modules/indexeddb/IDBDatabase.h:
611
612         * Modules/indexeddb/IDBObjectStore.cpp:
613         (WebCore::IDBObjectStore::setName):
614         * Modules/indexeddb/IDBObjectStore.h:
615         * Modules/indexeddb/IDBObjectStore.idl:
616
617         * Modules/indexeddb/IDBTransaction.cpp:
618         (WebCore::IDBTransaction::renameObjectStore):
619         (WebCore::IDBTransaction::renameObjectStoreOnServer):
620         (WebCore::IDBTransaction::didRenameObjectStoreOnServer):
621         * Modules/indexeddb/IDBTransaction.h:
622
623         * Modules/indexeddb/client/IDBConnectionProxy.cpp:
624         (WebCore::IDBClient::IDBConnectionProxy::renameObjectStore):
625         * Modules/indexeddb/client/IDBConnectionProxy.h:
626
627         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
628         (WebCore::IDBClient::IDBConnectionToServer::renameObjectStore):
629         (WebCore::IDBClient::IDBConnectionToServer::didRenameObjectStore):
630         * Modules/indexeddb/client/IDBConnectionToServer.h:
631         * Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
632
633         * Modules/indexeddb/server/IDBBackingStore.h:
634
635         * Modules/indexeddb/server/IDBConnectionToClient.cpp:
636         (WebCore::IDBServer::IDBConnectionToClient::didDeleteObjectStore):
637         (WebCore::IDBServer::IDBConnectionToClient::didRenameObjectStore):
638         * Modules/indexeddb/server/IDBConnectionToClient.h:
639         * Modules/indexeddb/server/IDBConnectionToClientDelegate.h:
640
641         * Modules/indexeddb/server/IDBServer.cpp:
642         (WebCore::IDBServer::IDBServer::renameObjectStore):
643         * Modules/indexeddb/server/IDBServer.h:
644
645         * Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
646         (WebCore::IDBServer::MemoryBackingStoreTransaction::objectStoreRenamed):
647         (WebCore::IDBServer::MemoryBackingStoreTransaction::abort):
648         * Modules/indexeddb/server/MemoryBackingStoreTransaction.h:
649
650         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
651         (WebCore::IDBServer::MemoryIDBBackingStore::renameObjectStore):
652         * Modules/indexeddb/server/MemoryIDBBackingStore.h:
653
654         * Modules/indexeddb/server/MemoryObjectStore.h:
655         (WebCore::IDBServer::MemoryObjectStore::rename):
656
657         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
658         (WebCore::IDBServer::SQLiteIDBBackingStore::renameObjectStore):
659         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
660
661         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
662         (WebCore::IDBServer::UniqueIDBDatabase::renameObjectStore):
663         (WebCore::IDBServer::UniqueIDBDatabase::performRenameObjectStore):
664         (WebCore::IDBServer::UniqueIDBDatabase::didPerformRenameObjectStore):
665         * Modules/indexeddb/server/UniqueIDBDatabase.h:
666
667         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
668         (WebCore::IDBServer::UniqueIDBDatabaseConnection::didRenameObjectStore):
669         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.h:
670
671         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
672         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::renameObjectStore):
673         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:
674
675         * Modules/indexeddb/shared/IDBDatabaseInfo.cpp:
676         (WebCore::IDBDatabaseInfo::renameObjectStore):
677         * Modules/indexeddb/shared/IDBDatabaseInfo.h:
678
679         * Modules/indexeddb/shared/IDBObjectStoreInfo.h:
680         (WebCore::IDBObjectStoreInfo::rename):
681
682         * Modules/indexeddb/shared/IDBResultData.cpp:
683         (WebCore::IDBResultData::renameObjectStoreSuccess):
684         * Modules/indexeddb/shared/IDBResultData.h:
685
686         * Modules/indexeddb/shared/InProcessIDBServer.cpp:
687         (WebCore::InProcessIDBServer::didRenameObjectStore):
688         (WebCore::InProcessIDBServer::renameObjectStore):
689         * Modules/indexeddb/shared/InProcessIDBServer.h:
690
691 2016-10-20  Chris Dumez  <cdumez@apple.com>
692
693         Make table.deleteRow(-1) a no-op when there are no rows
694         https://bugs.webkit.org/show_bug.cgi?id=163746
695
696         Reviewed by Alex Christensen.
697
698         Make table.deleteRow(-1) a no-op when there are no rows, instead of throwing:
699         - https://github.com/whatwg/html/pull/1924
700
701         This is more consistent with the behavior of tbody.deleteRow(-1) and
702         tr.deleteCell(-1). This is also consistent with Gecko. Blink is doing the
703         same change via:
704         - https://codereview.chromium.org/2427963004/
705
706         No new tests, updated existing tests.
707
708         * html/HTMLTableElement.cpp:
709         (WebCore::HTMLTableElement::deleteRow):
710
711 2016-10-20  Dave Hyatt  <hyatt@apple.com>
712
713         [CSS Parser] Make sure to handle prefixed transform-style
714         https://bugs.webkit.org/show_bug.cgi?id=163756
715
716         Reviewed by Dean Jackson.
717
718         * css/parser/CSSParserFastPaths.cpp:
719         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
720
721 2016-10-20  Dave Hyatt  <hyatt@apple.com>
722
723         [CSS Parser] Fix crash when parsing -webkit-margin-collapse
724         https://bugs.webkit.org/show_bug.cgi?id=163753
725
726         Reviewed by Dean Jackson.
727
728         * css/parser/CSSPropertyParser.cpp:
729         (WebCore::CSSPropertyParser::parseShorthand):
730
731 2016-10-20  Chris Dumez  <cdumez@apple.com>
732
733         Passing a number as the pixel parameter to texImage2D() doesn't thrown an exception
734         https://bugs.webkit.org/show_bug.cgi?id=163715
735
736         Reviewed by Darin Adler.
737
738         Enable strict type checking for typed arrays in the bindings, similarly
739         do what we do for other wrapper types, as per Web IDL.
740
741         No new tests, updated existing tests.
742
743         * bindings/scripts/CodeGeneratorJS.pm:
744         (GenerateImplementation):
745         (GenerateParametersCheck):
746
747 2016-10-20  Myles C. Maxfield  <mmaxfield@apple.com>
748
749         Improve error message when passing a null ArrayBuffer to bufferData()
750         https://bugs.webkit.org/show_bug.cgi?id=163745
751
752         Reviewed by Dean Jackson.
753
754         Test: fast/canvas/webgl/bufferData-nullable-array-buffer-view.html
755
756         Update the idl file to accept a nullable ArrayBuffer, and throw
757         the relevant error with a more helpful error string.
758
759         * html/canvas/WebGLRenderingContextBase.cpp:
760         (WebCore::WebGLRenderingContextBase::bufferData):
761         * html/canvas/WebGLRenderingContextBase.h:
762         * html/canvas/WebGLRenderingContextBase.idl:
763
764 2016-10-20  Zalan Bujtas  <zalan@apple.com>
765
766         Stop searching for first-letter containers at multi-column boundary.
767         https://bugs.webkit.org/show_bug.cgi?id=163739
768         <rdar://problem/28810750>
769
770         We should not cross the multi-column boundary while searching for the first-letter container.
771         While moving first-letter renderers to a multi-column parent, it could result in finding the wrong
772         container and end up adding a new wrapper under the original container (from where we are moving the renderers).    
773
774         Reviewed by David Hyatt.
775
776         Test: fast/css-generated-content/first-letter-move-to-multicolumn-crash.html
777
778         * rendering/RenderBoxModelObject.cpp:
779         (WebCore::RenderBoxModelObject::moveChildrenTo):
780         * rendering/RenderTextFragment.cpp:
781         (WebCore::RenderTextFragment::blockForAccompanyingFirstLetter):
782
783 2016-10-19  Dean Jackson  <dino@apple.com>
784
785         Support CSS Shapes Level 1 without a prefix
786         https://bugs.webkit.org/show_bug.cgi?id=163709
787         <rdar://problem/28859369>
788
789         Reviewed by Myles Maxfield.
790
791         Support the unprefixed form of CSS Shapes, now that
792         it is in CR.
793
794         We have a few failing tests:
795
796         - Some image-based shaping failures, now skipped.
797           https://bugs.webkit.org/show_bug.cgi?id=163706
798
799         - Some false negatives, where my understanding
800           of the CSS OM seems to suggest that the W3C tests
801           are incorrect.
802           https://bugs.webkit.org/show_bug.cgi?id=163708
803
804         Tests: imported/w3c/csswg-test/css-shapes-1
805
806         * css/CSSComputedStyleDeclaration.cpp:
807         (WebCore::ComputedStyleExtractor::propertyValue):
808         * css/CSSPropertyNames.in:
809         * css/CSSValueKeywords.in:
810         * css/parser/CSSParser.cpp:
811         (WebCore::isSimpleLengthPropertyID):
812         (WebCore::CSSParser::parseValue):
813         * css/parser/CSSPropertyParser.cpp:
814         (WebCore::CSSPropertyParser::parseSingleValue):
815         * page/animation/CSSPropertyAnimation.cpp:
816         (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
817
818 2016-10-20  Dave Hyatt  <hyatt@apple.com>
819
820         [CSS Parser] Fix region, column and page break parsing
821         https://bugs.webkit.org/show_bug.cgi?id=163743
822
823         Reviewed by Simon Fraser.
824
825         * css/parser/CSSParserFastPaths.cpp:
826         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
827         Add the missing values for break support.
828
829         * css/parser/CSSPropertyParser.cpp:
830         (WebCore::isLegacyBreakProperty):
831         (WebCore::CSSPropertyParser::parseValueStart):
832         Add a special case for handling legacy break properties. Blink treats them like
833         shorthands, but we can't do that without breaking the old parser, so for now
834         we add a special case.
835
836         (WebCore::mapFromPageBreakBetween):
837         (WebCore::mapFromColumnBreakBetween):
838         (WebCore::mapFromRegionBreakBetween):
839         Updated to have the AvoidXXX values (where XXX is Column/Page/Region).
840
841         (WebCore::CSSPropertyParser::parseShorthand):
842         Remove the consumeLegacyBreak from the shorthand function, since we can't treat
843         the legacy break properties as shorthands yet.
844
845 2016-10-20  Sam Weinig  <sam@webkit.org>
846
847         Add convenience function that combines WTF::visit(...) with WTF::makeVisitor(...)
848         https://bugs.webkit.org/show_bug.cgi?id=163713
849
850         Reviewed by Dan Bernstein.
851
852         Switch uses of WTF::visit to use WTF::switchOn.
853
854         * dom/MessageEvent.cpp:
855         (WebCore::MessageEvent::source):
856         * dom/Node.cpp:
857         (WebCore::nodeSetPreTransformedFromNodeOrStringVector):
858         (WebCore::Node::convertNodesOrStringsIntoNode):
859         * html/HTMLSelectElement.cpp:
860         (WebCore::HTMLSelectElement::add):
861         * html/track/TrackEvent.cpp:
862         (WebCore::TrackEvent::TrackEvent):
863         * testing/TypeConversions.h:
864         (WebCore::TypeConversions::typeConversionsDictionaryUnionType):
865
866 2016-10-20  Dave Hyatt  <hyatt@apple.com>
867
868         [CSS Parser] Fix font family parsing and add CSS region property parsing
869         https://bugs.webkit.org/show_bug.cgi?id=163741
870
871         Reviewed by Zalan Bujtas.
872
873         * css/parser/CSSParser.cpp:
874         (WebCore::isKeywordPropertyID):
875         (WebCore::parseKeywordValue):
876         (WebCore::CSSParser::parseValue):
877         Modify the old CSSParser to have its own keyword check, since keywords were
878         incorrectly added to the new parser when this check was consolidated. Column
879         and region breaks are considered keyword properties by the old parser, but
880         not by the new parser, since the new parser special cases them and maps them
881         into the generic break property.
882
883         * css/parser/CSSParserFastPaths.cpp:
884         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
885         (WebCore::CSSParserFastPaths::isKeywordPropertyID):
886         Update for regions to make sure all the region properties are there. Remove the
887         column and region break properties, since they're not supposed to be here in the
888         new parser.
889
890         * css/parser/CSSPropertyParser.cpp:
891         (WebCore::consumeFamilyName):
892         Fix font parsing to make font family values so that fonts work.
893
894         (WebCore::consumeFlowProperty):
895         Add a function for handling -webkit-flow-from and -webkit-flow-into.
896
897         (WebCore::CSSPropertyParser::parseSingleValue):
898         Add support for the region properties.
899
900         (WebCore::mapFromRegionBreakBetween):
901         (WebCore::mapFromColumnRegionOrPageBreakInside):
902         (WebCore::mapFromLegacyBreakProperty):
903         (WebCore::CSSPropertyParser::consumeLegacyBreakProperty):
904         (WebCore::mapFromColumnOrPageBreakInside): Deleted.
905         Update to handle the region break properties in the same way that column break
906         properties are handled.
907
908 2016-10-20  Jer Noble  <jer.noble@apple.com>
909
910         CRASH in WebCore::MediaSource::seekToTime + 185
911         https://bugs.webkit.org/show_bug.cgi?id=163652
912
913         Reviewed by Eric Carlson.
914
915         Test: media/media-source/media-source-seek-detach-crash.html
916
917         Add isClosed() checks (which are effectively m_private null-checks) everywhere m_private is
918         dereferenced. The one place where m_private is cleared without setting the state to closed
919         is stop(), so make stop() set the state to closed as well (without firing any events).
920
921         * Modules/mediasource/MediaSource.cpp:
922         (WebCore::MediaSource::seekToTime):
923         (WebCore::MediaSource::completeSeek):
924         (WebCore::MediaSource::monitorSourceBuffers):
925         (WebCore::MediaSource::streamEndedWithError):
926         (WebCore::MediaSource::stop):
927
928 2016-10-20  Andreas Kling  <akling@apple.com>
929
930         Drop StyleResolver and SelectorQueryCache when entering PageCache.
931         <https://webkit.org/b/154238>
932
933         Reviewed by Antti Koivisto.
934
935         Stop keeping these around for cached pages to save lots of memory.
936         We can easily rebuild them if a cached navigation occurs, and this
937         way we also don't need to worry about invalidating style for cached
938         pages in all the right places.
939
940         Restoring a cached page will now lead to a forced style recalc.
941         We don't try to defer this (beyond a zero-timer) since it's going
942         to happen anyway, and it's nicer to front-load the cost rather than
943         stuttering on the first user content interaction.
944
945         * dom/Document.cpp:
946         (WebCore::Document::setPageCacheState):
947         * history/CachedPage.cpp:
948         (WebCore::CachedPage::restore):
949         (WebCore::CachedPage::clear):
950         * history/CachedPage.h:
951         (WebCore::CachedPage::markForVisitedLinkStyleRecalc): Deleted.
952         (WebCore::CachedPage::markForFullStyleRecalc): Deleted.
953         * history/PageCache.cpp:
954         (WebCore::PageCache::markPagesForVisitedLinkStyleRecalc): Deleted.
955         (WebCore::PageCache::markPagesForFullStyleRecalc): Deleted.
956         * history/PageCache.h:
957         * page/Frame.cpp:
958         (WebCore::Frame::setPageAndTextZoomFactors):
959         * page/Page.cpp:
960         (WebCore::Page::setViewScaleFactor):
961         (WebCore::Page::setDeviceScaleFactor):
962         (WebCore::Page::setPagination):
963         (WebCore::Page::setPaginationLineGridEnabled):
964         (WebCore::Page::setVisitedLinkStore):
965
966 2016-10-20  Carlos Alberto Lopez Perez  <clopez@igalia.com>
967
968         [GTK] Build fix after r207616
969         https://bugs.webkit.org/show_bug.cgi?id=163333
970
971         Reviewed by Carlos Garcia Campos.
972
973         EGL_PLATFORM_X11_KHR and EGL_PLATFORM_WAYLAND_KHR are not defined
974         on the EGL headers shipped by Mesa 10.3 (shipped by Debian 8)
975
976         * platform/graphics/wayland/PlatformDisplayWayland.cpp:
977         (WebCore::PlatformDisplayWayland::initialize):
978         * platform/graphics/x11/PlatformDisplayX11.cpp:
979         (WebCore::PlatformDisplayX11::initializeEGLDisplay):
980
981 2016-10-20  Fujii Hironori  <Hironori.Fujii@sony.com>
982
983         [CMake] CMake does not support the dep files for implicit dependency
984         https://bugs.webkit.org/show_bug.cgi?id=161433
985
986         Reviewed by Brent Fulgham.
987
988         Created a Perl script to generate all IDL bindings for CMake.
989         This script can regenerate outdated bindings by based on the
990         supplemental dependency and dep files created by
991         '--write-dependencies' switch of generate-bindings.pl.
992
993         add_custom_target is used to invoke the script instead of
994         add_custom_command because Ninja deletes all output files before
995         executing the command in case of add_custom_command.
996
997         USES_TERMINAL option of add_custom_target has two effects:
998         1) Not buffering output of the command
999         2) Invoking the command in the special Ninja pool which inhibits parallel build
1000         One needs to use CMake 3.2 or later to enable this feature.
1001
1002         * CMakeLists.txt: Specified target names for
1003         GENERATE_BINDINGS. Added dependency for the targets.
1004         * bindings/scripts/generate-bindings-all.pl: Added.
1005
1006 2016-10-20  Adam Jackson  <ajax@redhat.com>
1007
1008         Prefer eglGetPlatformDisplay to eglGetDisplay
1009         https://bugs.webkit.org/show_bug.cgi?id=163333
1010
1011         Reviewed by Carlos Garcia Campos.
1012
1013         eglGetDisplay forces the implementation to guess what kind of void* it's been handed. Different implementations
1014         do different things, in particular glvnd and Mesa behave differently. Fortunately there exists API to tell EGL
1015         what kind of display it is, so let's use it.
1016
1017         * platform/graphics/wayland/PlatformDisplayWayland.cpp:
1018         (WebCore::PlatformDisplayWayland::initialize):
1019         * platform/graphics/x11/PlatformDisplayX11.cpp:
1020         (WebCore::PlatformDisplayX11::initializeEGLDisplay):
1021
1022 2016-10-20  Carlos Garcia Campos  <cgarcia@igalia.com>
1023
1024         [GTK] Avoid including egl.h headers in internal headers
1025         https://bugs.webkit.org/show_bug.cgi?id=163722
1026
1027         Reviewed by Žan Doberšek.
1028
1029         egl.h includes eglplatform.h that decides the native types for the platform at compile time. However, we support
1030         to build with X11 and Wayland at the same time and decide what to use at runtime. Currently GLContext.h includes
1031         eglplatform.h after wayland-egl.h if Wayland is enabled. That means that the wayland native types are used by
1032         default from all cpp files including GLContext.h. It currently works in X11 because we cast the value anyway and
1033         for example EGLNativeWindowType is a pointer in Wayland that can be casted to unsigned long in X11 to represent
1034         the X Window. This is very fragile in any case, we should avoid adding egl headers in our headers and only
1035         include it in cpp files. But we also need to ensure we don't use X11 and Wayland in the same cpp file.
1036
1037         * PlatformGTK.cmake:
1038         * platform/graphics/GLContext.cpp:
1039         (WebCore::GLContext::createContextForWindow):
1040         * platform/graphics/GLContext.h:
1041         * platform/graphics/egl/GLContextEGL.cpp:
1042         (WebCore::GLContextEGL::createWindowContext):
1043         (WebCore::GLContextEGL::createContext):
1044         (WebCore::GLContextEGL::~GLContextEGL):
1045         * platform/graphics/egl/GLContextEGL.h:
1046         * platform/graphics/egl/GLContextEGLWayland.cpp: Added.
1047         (WebCore::GLContextEGL::GLContextEGL):
1048         (WebCore::GLContextEGL::createWindowSurfaceWayland):
1049         (WebCore::GLContextEGL::createWaylandContext):
1050         (WebCore::GLContextEGL::destroyWaylandWindow):
1051         * platform/graphics/egl/GLContextEGLX11.cpp: Added.
1052         (WebCore::GLContextEGL::GLContextEGL):
1053         (WebCore::GLContextEGL::createWindowSurfaceX11):
1054         (WebCore::GLContextEGL::createPixmapContext):
1055         * platform/graphics/glx/GLContextGLX.cpp:
1056         (WebCore::GLContextGLX::createWindowContext):
1057         (WebCore::GLContextGLX::createContext):
1058         (WebCore::GLContextGLX::GLContextGLX):
1059         * platform/graphics/glx/GLContextGLX.h:
1060         * platform/graphics/wayland/PlatformDisplayWayland.cpp:
1061         * platform/graphics/x11/PlatformDisplayX11.cpp:
1062
1063 2016-10-20  Carlos Garcia Campos  <cgarcia@igalia.com>
1064
1065         [GTK] Avoid strstr() when checking (E)GL extensions
1066         https://bugs.webkit.org/show_bug.cgi?id=161958
1067
1068         Reviewed by Žan Doberšek.
1069
1070         Add static method GLContext::isExtensionSupported() to properly search extenstions in the given extension
1071         list, and use it instead of strstr().
1072
1073         * platform/graphics/GLContext.cpp:
1074         (WebCore::GLContext::isExtensionSupported):
1075         * platform/graphics/GLContext.h:
1076         * platform/graphics/egl/GLContextEGL.cpp:
1077         (WebCore::GLContextEGL::createSurfacelessContext):
1078         * platform/graphics/glx/GLContextGLX.cpp:
1079         (WebCore::hasSGISwapControlExtension):
1080
1081 2016-10-20  Per Arne Vollan  <pvollan@apple.com>
1082
1083         [Win][Direct2D] Implement ImageBufferData::getData.
1084         https://bugs.webkit.org/show_bug.cgi?id=163668
1085
1086         Reviewed by Brent Fulgham.
1087
1088         Render data to a bitmap in system memory, which data can be read from.
1089
1090         * platform/graphics/win/ImageBufferDataDirect2D.cpp:
1091         (WebCore::ImageBufferData::getData):
1092         * platform/graphics/win/ImageBufferDirect2D.cpp:
1093         (WebCore::ImageBuffer::ImageBuffer):
1094
1095 2016-10-20  Carlos Garcia Campos  <cgarcia@igalia.com>
1096
1097         Wrong use of EGL_DEPTH_SIZE
1098         https://bugs.webkit.org/show_bug.cgi?id=155536
1099
1100         Reviewed by Michael Catanzaro.
1101
1102         What happens here is that the driver doesn't implement EGL_DEPTH_SIZE and the default value, which is 0, is
1103         returned. Then XCreatePixmap fails because 0 is not a valid depth. The thing is that even if EGL_DEPTH_SIZE or
1104         EGL_BUFFER_SIZE returned a valid depth, it still might not be supported by the default screen and XCreatePixmap
1105         can fail. What we need to ensure is that the depth we pass is compatible with the X display, not only with the
1106         EGL config, to avoid failures when creating the pixmap. So, we can use EGL_NATIVE_VISUAL_ID instead, and
1107         then ask X for the visual info for that id. If it isn't found then we just return before creating the pixmap,
1108         but if the visual is found then we can be sure that the depth of the visual will not make the pixmap creation
1109         fail. However, with the driver I'm using it doesn't matter how we create the pixmap that eglCreatePixmapSurface
1110         always fails, again with X errors that are fatal by default. Since the driver is not free, I assume it doesn't
1111         support eglCreatePixmapSurface or it's just buggy, so the only option we have here is trap the x errors and
1112         ignore them. It turns out that the X errors are not fatal in this case, because eglCreatePixmapSurface ends up
1113         returning a surface, and since these are offscreen contexts, it doesn't really matter if they contain an
1114         invalid pixmap, because we never do swap buffer on them, so just ignoring the X errors fixes the crashes and
1115         makes everythig work. This patch adds a helper class XErrorTrapper that allows to trap XErrors and decide what
1116         to do with them (ignore, warn or crash) or even not consider a particular set of errors as errors.
1117
1118         * PlatformEfl.cmake: Add new file to compilation.
1119         * PlatformGTK.cmake: Ditto.
1120         * platform/graphics/egl/GLContextEGL.cpp:
1121         (WebCore::GLContextEGL::createPixmapContext): Use EGL_NATIVE_VISUAL_ID instead of EGL_DEPTH_SIZE to figure out
1122         the depth to be passed to XCreatePixmap. Also use the XErrorTrapper class to ignore all BadDrawable errors
1123         produced by eglCreatePixmapSurface() and only show a warning about all other X errors.
1124         * platform/graphics/x11/XErrorTrapper.cpp: Added.
1125         (WebCore::xErrorTrappersMap):
1126         (WebCore::XErrorTrapper::XErrorTrapper):
1127         (WebCore::XErrorTrapper::~XErrorTrapper):
1128         (WebCore::XErrorTrapper::errorCode):
1129         (WebCore::XErrorTrapper::errorEvent):
1130         * platform/graphics/x11/XErrorTrapper.h: Added.
1131         (WebCore::XErrorTrapper::XErrorTrapper):
1132
1133 2016-10-20  Nael Ouedraogo  <nael.ouedraogo@crf.canon.fr>
1134
1135         WebRTC: The MediaStreamTrackEvent init dictionary needs a required track member
1136         https://bugs.webkit.org/show_bug.cgi?id=146232
1137
1138         Update MediaStreamTrackEvent IDL as per specification.
1139
1140         Reviewed by Darin Adler.
1141
1142         No additional test required, rebase existings tests.
1143
1144         * Modules/mediastream/MediaStreamTrackEvent.idl:
1145
1146 2016-10-19  Antoine Quint  <graouts@apple.com>
1147
1148         [Modern Media Controls] Media Controller: mute support
1149         https://bugs.webkit.org/show_bug.cgi?id=163677
1150         <rdar://problem/28851582>
1151
1152         Reviewed by Dean Jackson.
1153
1154         We introduce the MuteSupport class which brings support for muting the media
1155         by clicking on the mute button in the media controls and correctly reflecting
1156         the media's muted state should the media be muted via the media API.
1157
1158         Tests: media/modern-media-controls/mute-support/mute-support-button-click.html
1159                media/modern-media-controls/mute-support/mute-support-media-api.html
1160                media/modern-media-controls/mute-support/mute-support-muted.html
1161
1162         * Modules/modern-media-controls/media/media-controller.js:
1163         (MediaController):
1164         * Modules/modern-media-controls/media/mute-support.js: Copied from Source/WebCore/Modules/modern-media-controls/media/media-controller.js.
1165         (MuteSupport.prototype.get control):
1166         (MuteSupport.prototype.get mediaEvents):
1167         (MuteSupport.prototype.buttonWasClicked):
1168         (MuteSupport.prototype.syncControl):
1169         (MuteSupport):
1170         * WebCore.xcodeproj/project.pbxproj:
1171         * rendering/RenderThemeMac.mm:
1172         (WebCore::RenderThemeMac::mediaControlsScript):
1173
1174 2016-10-19  Alex Christensen  <achristensen@webkit.org>
1175
1176         Revert r207151
1177         https://bugs.webkit.org/show_bug.cgi?id=163675
1178
1179         Reviewed by Brent Fulgham.
1180
1181         This code is still useful for comparison with Windows.  I'll remove it again soon.
1182
1183         No new tests.  No change in behavior.
1184
1185         * WebCore.xcodeproj/project.pbxproj:
1186         * WebCorePrefix.h:
1187         * loader/DocumentLoader.h:
1188         * loader/EmptyClients.h:
1189         * loader/FrameLoaderClient.h:
1190         * loader/ResourceLoader.cpp:
1191         (WebCore::ResourceLoader::didReceiveAuthenticationChallenge):
1192         * loader/ResourceLoader.h:
1193         * loader/SubresourceLoader.h:
1194         * loader/cf/ResourceLoaderCFNet.cpp:
1195         * loader/cocoa/SubresourceLoaderCocoa.mm:
1196         (WebCore::SubresourceLoader::willCacheResponse):
1197         * loader/mac/DocumentLoaderMac.cpp:
1198         * loader/mac/ResourceLoaderMac.mm:
1199         (WebCore::ResourceLoader::willCacheResponse):
1200         * page/mac/PageMac.mm:
1201         (WebCore::Page::platformInitialize):
1202         (WebCore::Page::addSchedulePair):
1203         (WebCore::Page::removeSchedulePair):
1204         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1205         (WebCore::WebCoreNSURLAuthenticationChallengeClient::create):
1206         (WebCore::WebCoreNSURLAuthenticationChallengeClient::WebCoreNSURLAuthenticationChallengeClient):
1207         (WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForResponseToAuthenticationChallenge):
1208         * platform/mac/WebCoreSystemInterface.h:
1209         * platform/network/NetworkStorageSession.h:
1210         * platform/network/ProtectionSpace.h:
1211         * platform/network/ProtectionSpaceBase.cpp:
1212         * platform/network/ResourceHandle.cpp:
1213         * platform/network/ResourceHandle.h:
1214         * platform/network/ResourceHandleClient.cpp:
1215         * platform/network/ResourceHandleClient.h:
1216         * platform/network/ResourceHandleInternal.h:
1217         (WebCore::ResourceHandleInternal::ResourceHandleInternal):
1218         * platform/network/ResourceRequestBase.cpp:
1219         * platform/network/cf/AuthenticationCF.cpp:
1220         (WebCore::AuthenticationChallenge::AuthenticationChallenge):
1221         (WebCore::AuthenticationChallenge::setAuthenticationClient): Deleted.
1222         (WebCore::AuthenticationChallenge::authenticationClient): Deleted.
1223         (WebCore::AuthenticationChallenge::platformCompare): Deleted.
1224         (WebCore::createCF): Deleted.
1225         (WebCore::core): Deleted.
1226         * platform/network/cf/AuthenticationCF.h:
1227         * platform/network/cf/AuthenticationChallenge.h:
1228         * platform/network/cf/CookieJarCFNet.cpp:
1229         * platform/network/cf/CredentialStorageCFNet.cpp:
1230         (WebCore::CredentialStorage::getFromPersistentStorage):
1231         (WebCore::CredentialStorage::saveToPersistentStorage):
1232         * platform/network/cf/LoaderRunLoopCF.cpp:
1233         * platform/network/cf/LoaderRunLoopCF.h:
1234         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
1235         (WebCore::NetworkStorageSession::cookieStorage):
1236         * platform/network/cf/ProtectionSpaceCFNet.cpp:
1237         * platform/network/cf/ProtectionSpaceCFNet.h:
1238         * platform/network/cf/ResourceError.h:
1239         * platform/network/cf/ResourceErrorCF.cpp:
1240         * platform/network/cf/ResourceHandleCFNet.cpp:
1241         (WebCore::shouldSniffConnectionProperty):
1242         (WebCore::ResourceHandle::createCFURLConnection):
1243         (WebCore::ResourceHandle::start):
1244         (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
1245         (WebCore::ResourceHandle::tryHandlePasswordBasedAuthentication):
1246         (WebCore::ResourceHandle::receivedCredential):
1247         (WebCore::ResourceHandle::schedule):
1248         (WebCore::ResourceHandle::unschedule):
1249         * platform/network/cf/ResourceHandleCFURLConnectionDelegate.cpp:
1250         * platform/network/cf/ResourceHandleCFURLConnectionDelegate.h:
1251         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
1252         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::setupRequest):
1253         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse):
1254         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::canRespondToProtectionSpace):
1255         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.h:
1256         * platform/network/cf/ResourceRequest.h:
1257         (WebCore::ResourceRequest::encodingRequiresPlatformData):
1258         * platform/network/cf/ResourceRequestCFNet.cpp:
1259         (WebCore::findCFURLRequestSetContentDispositionEncodingFallbackArrayFunction):
1260         (WebCore::findCFURLRequestCopyContentDispositionEncodingFallbackArrayFunction):
1261         (WebCore::ResourceRequest::doUpdatePlatformRequest):
1262         (WebCore::ResourceRequest::doUpdatePlatformHTTPBody):
1263         (WebCore::ResourceRequest::doUpdateResourceRequest):
1264         (WebCore::ResourceRequest::setStorageSession):
1265         * platform/network/cf/ResourceRequestCFNet.h:
1266         * platform/network/cf/ResourceResponse.h:
1267         * platform/network/cf/ResourceResponseCFNet.cpp:
1268         (WebCore::ResourceResponse::cfURLResponse):
1269         * platform/network/cf/SynchronousLoaderClientCFNet.cpp:
1270         * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:
1271         (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::setupRequest):
1272         (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::setupConnectionScheduling):
1273         (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveResponse):
1274         (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::willCacheResponse):
1275         (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::canRespondToProtectionSpace):
1276         * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.h:
1277         * platform/network/cocoa/CredentialCocoa.h:
1278         * platform/network/cocoa/CredentialCocoa.mm:
1279         (WebCore::Credential::Credential):
1280         (WebCore::Credential::cfCredential):
1281         * platform/network/cocoa/ProtectionSpaceCocoa.h:
1282         * platform/network/cocoa/ProtectionSpaceCocoa.mm:
1283         (WebCore::ProtectionSpace::ProtectionSpace):
1284         (WebCore::ProtectionSpace::cfSpace):
1285         * platform/network/cocoa/ResourceRequestCocoa.mm:
1286         (WebCore::ResourceRequest::nsURLRequest):
1287         * platform/network/cocoa/ResourceResponseCocoa.mm:
1288         (WebCore::ResourceResponse::platformCertificateInfo):
1289         (WebCore::ResourceResponse::nsURLResponse):
1290         (WebCore::ResourceResponse::ResourceResponse):
1291         * platform/network/ios/QuickLook.h:
1292         * platform/network/ios/QuickLook.mm:
1293         (-[WebQuickLookHandleAsDelegate initWithConnectionDelegate:]):
1294         (-[WebQuickLookHandleAsDelegate connection:didReceiveDataArray:]):
1295         (-[WebQuickLookHandleAsDelegate connection:didReceiveData:lengthReceived:]):
1296         (-[WebQuickLookHandleAsDelegate connectionDidFinishLoading:]):
1297         (-[WebQuickLookHandleAsDelegate connection:didFailWithError:]):
1298         (-[WebQuickLookHandleAsDelegate detachHandle]):
1299         (WebCore::QuickLookHandle::create):
1300         (WebCore::QuickLookHandle::cfResponse):
1301         * platform/network/mac/AuthenticationMac.mm:
1302         (-[WebCoreAuthenticationClientAsChallengeSender setCFChallenge:]):
1303         (-[WebCoreAuthenticationClientAsChallengeSender cfChallenge]):
1304         (WebCore::core):
1305         (WebCore::mac):
1306         * platform/network/mac/CookieJarMac.mm:
1307         (WebCore::setCookiesFromDOM):
1308         (WebCore::addCookie):
1309         (WebCore::cookieStorage):
1310         * platform/network/mac/CredentialStorageMac.mm:
1311         * platform/network/mac/FormDataStreamMac.h:
1312         * platform/network/mac/FormDataStreamMac.mm:
1313         * platform/network/mac/ResourceErrorMac.mm:
1314         (NSErrorFromCFError):
1315         (WebCore::ResourceError::ResourceError):
1316         (WebCore::ResourceError::nsError):
1317         (WebCore::ResourceError::operator NSError *):
1318         * platform/network/mac/ResourceHandleMac.mm:
1319         (WebCore::ResourceHandle::getConnectionTimingData):
1320         * platform/network/mac/ResourceRequestMac.mm: Added.
1321         (WebCore::ResourceRequest::ResourceRequest):
1322         (WebCore::ResourceRequest::updateNSURLRequest):
1323         * platform/network/mac/SynchronousLoaderClient.mm:
1324         * platform/network/mac/WebCoreResourceHandleAsDelegate.h:
1325         * platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
1326         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.h:
1327         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
1328         * platform/network/mac/WebCoreURLResponse.mm:
1329         * platform/win/TemporaryLinkStubs.cpp:
1330         * testing/js/WebCoreTestSupportPrefix.h:
1331
1332 2016-10-19  Jer Noble  <jer.noble@apple.com>
1333
1334         REGRESSION (r206025): All YouTube videos play with black bars on all four sides
1335         https://bugs.webkit.org/show_bug.cgi?id=163308
1336
1337         Reviewed by Darin Adler.
1338
1339         Test: media/media-source/media-source-resize.html
1340
1341         After r206025, we do not fire resize events when the size change notification happens equal-
1342         to-or-before the current time, which can happen at the very beginning of a stream. Take care
1343         of this case by checking that the target time isn't actually in the past inside of
1344         sizeWillChangeAtTime(), and also always skip the boundary time observer when there was no
1345         previous size (such as after a flush due to a seek).
1346
1347         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
1348         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1349         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::sizeWillChangeAtTime):
1350         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setNaturalSize):
1351         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1352         (WebCore::SourceBufferPrivateAVFObjC::flushAndEnqueueNonDisplayingSamples):
1353         (WebCore::SourceBufferPrivateAVFObjC::enqueueSample):
1354
1355 2016-10-19  Nan Wang  <n_wang@apple.com>
1356
1357         AX: [Mac] Mark element AXAPI should comform to specs
1358         https://bugs.webkit.org/show_bug.cgi?id=163707
1359
1360         Reviewed by Chris Fleizach.
1361
1362         Created a new role for mark elements on Mac and exposed the role
1363         description.
1364
1365         Changes are covered in modified test expectaions.
1366
1367         * English.lproj/Localizable.strings:
1368         * accessibility/AccessibilityObject.h:
1369         * accessibility/AccessibilityRenderObject.cpp:
1370         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
1371         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1372         (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
1373         * accessibility/mac/AccessibilityObjectMac.mm:
1374         (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject):
1375         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1376         (createAccessibilityRoleMap):
1377         (-[WebAccessibilityObjectWrapper roleDescription]):
1378         * platform/LocalizedStrings.cpp:
1379         (WebCore::AXMarkText):
1380         * platform/LocalizedStrings.h:
1381
1382 2016-10-19  Alex Christensen  <achristensen@webkit.org>
1383
1384         Re-enable URLParser for non-Safari Cocoa apps after r207321
1385         https://bugs.webkit.org/show_bug.cgi?id=163690
1386
1387         Reviewed by Darin Adler.
1388
1389         I disabled the URLParser for non-Safari applications in r207305
1390         to give me time to make URLParser more compatible, which I did in r207321
1391
1392         Updated some API tests which will be investigated in 
1393         https://bugs.webkit.org/show_bug.cgi?id=163127
1394
1395         * platform/URLParser.cpp:
1396         (WebCore::URLParser::setEnabled):
1397         (WebCore::URLParser::enabled):
1398         * testing/js/WebCoreTestSupport.cpp:
1399         (WebCoreTestSupport::setURLParserEnabled): Deleted.
1400         * testing/js/WebCoreTestSupport.h:
1401
1402 2016-10-19  Myles C. Maxfield  <mmaxfield@apple.com>
1403
1404         CSS font-variation-settings does not handle uppercase axis names in variable fonts
1405         https://bugs.webkit.org/show_bug.cgi?id=163546
1406
1407         Reviewed by Dean Jackson.
1408
1409         Remove the extra toASCIILower() call.
1410
1411         Test: fast/text/variations/case-axis-names.html
1412
1413         * css/parser/CSSParser.cpp:
1414         (WebCore::CSSParser::parseFontVariationTag):
1415
1416 2016-10-19  Anders Carlsson  <andersca@apple.com>
1417
1418         Remove m_redirectURLs from HistoryItem
1419         https://bugs.webkit.org/show_bug.cgi?id=163704
1420
1421         Reviewed by Dan Bernstein.
1422
1423         * history/HistoryItem.cpp:
1424         (WebCore::HistoryItem::HistoryItem):
1425         (WebCore::HistoryItem::reset):
1426         * history/HistoryItem.h:
1427
1428 2016-10-19  Joone Hur  <joone.hur@intel.com>
1429
1430         Add a plain space instead of &nbsp; between text nodes
1431         https://bugs.webkit.org/show_bug.cgi?id=123163
1432
1433         Reviewed by Ryosuke Niwa.
1434
1435         When we rebalance white spaces, &nbsp; can be added as space
1436         under some conditions. This patch adds a condition that the next
1437         sibling text node should not exist.
1438
1439         No new tests, updated existing test.
1440
1441         * editing/CompositeEditCommand.cpp:
1442         (WebCore::CompositeEditCommand::rebalanceWhitespaceOnTextSubstring):
1443         * editing/htmlediting.cpp:
1444         (WebCore::stringWithRebalancedWhitespace):
1445         * editing/htmlediting.h:
1446
1447 2016-10-19  Sam Weinig  <sam@webkit.org>
1448
1449         Add support for sequences and dictionaries in unions
1450         https://bugs.webkit.org/show_bug.cgi?id=163695
1451
1452         Reviewed by Chris Dumez.
1453
1454         Tests:
1455          - Updated js/dom/webidl-type-mapping.html
1456
1457         * bindings/generic/IDLTypes.h:
1458         Add additional helper predicates and fix formatting.
1459
1460         * bindings/js/JSDOMBinding.h:
1461         Export hasIteratorMethod for use in testing.
1462
1463         * bindings/js/JSDOMConvert.h:
1464         - Change return type of Converter<IDLDictionary<T>> to T, from Optional<T>.
1465         - Add support for unions conversion step 12 (parts 1-3).
1466
1467         * bindings/scripts/CodeGeneratorJS.pm:
1468         (GenerateDefaultValue):
1469         Support complex default value computations for unions using the convert infrastructure.
1470
1471         (GenerateParametersCheck):
1472         (GenerateConstructorDefinition):
1473         Remove incorrect .value() calls now that Converter<IDLDictionary<T>> returns T.
1474
1475         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
1476         * bindings/scripts/test/JS/JSTestObj.cpp:
1477         Update bindings test results.
1478
1479         * testing/TypeConversions.h:
1480         (WebCore::TypeConversions::setTypeConversionsDictionary):
1481         (WebCore::TypeConversions::typeConversionsDictionaryLongValue):
1482         (WebCore::TypeConversions::typeConversionsDictionaryStringValue):
1483         (WebCore::TypeConversions::typeConversionsDictionarySequenceValue):
1484         (WebCore::TypeConversions::typeConversionsDictionaryUnionType):
1485         * testing/TypeConversions.idl:
1486         Add some complex types to allow testing IDL conversions from tests.
1487
1488 2016-10-19  Ryosuke Niwa  <rniwa@webkit.org>
1489
1490         Annotate more DOM and HTML IDLs with CEReactions
1491         https://bugs.webkit.org/show_bug.cgi?id=163653
1492
1493         Reviewed by Darin Adler.
1494
1495         Added CEReactions to more IDL files.
1496
1497         Test: fast/custom-elements/reactions-for-webkit-extensions.html
1498
1499         * bindings/js/JSDOMStringMapCustom.cpp:
1500         (WebCore::JSDOMStringMap::deleteProperty): Instantiate CustomElementReactionStack, which is equivalent to
1501         adding CEReactions in IDL.
1502         (WebCore::JSDOMStringMap::putDelegate): Ditto.
1503         * dom/Document.idl:
1504         * dom/Element.idl:
1505         * html/HTMLElement.idl:
1506         * page/DOMSelection.idl:
1507
1508 2016-10-19  Ryan Haddad  <ryanhaddad@apple.com>
1509
1510         Unreviewed, rolling out r207557.
1511
1512         This change caused animations/font-variations tests to time
1513         out on pre-Sierra Macs.
1514
1515         Reverted changeset:
1516
1517         "[macOS] [iOS] Disable variation fonts on macOS El Capitan and
1518         iOS 9"
1519         https://bugs.webkit.org/show_bug.cgi?id=163374
1520         http://trac.webkit.org/changeset/207557
1521
1522 2016-10-19  Dave Hyatt  <hyatt@apple.com>
1523
1524         [CSS Parser] Support -webkit-border-fit
1525         https://bugs.webkit.org/show_bug.cgi?id=163687
1526
1527         Reviewed by Zalan Bujtas.
1528
1529         Add support for -webkit-border-fit to isValidKeywordPropertyAndValue.
1530
1531         * css/parser/CSSParserFastPaths.cpp:
1532         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
1533
1534 2016-10-19  Dave Hyatt  <hyatt@apple.com>
1535
1536         [CSS Parser] class and id parsing need to be case-insensitive in HTML quirks mode
1537         https://bugs.webkit.org/show_bug.cgi?id=163685
1538
1539         Reviewed by Zalan Bujtas.
1540
1541         Class and ID parsing should be case-insensitive in quirks mode. Apply the same hack
1542         that the old parser did and lowercase the class and ids in place.
1543
1544         * css/parser/CSSSelectorParser.cpp:
1545         (WebCore::CSSSelectorParser::consumeId):
1546         (WebCore::CSSSelectorParser::consumeClass):
1547
1548 2016-10-19  Nan Wang  <n_wang@apple.com>
1549
1550         AX: crash: com.apple.WebCore: WebCore::AccessibilityObject::findMatchingObjects + 600
1551         https://bugs.webkit.org/show_bug.cgi?id=163682
1552
1553         Reviewed by Chris Fleizach.
1554
1555         There's a null pointer crash when we ask for startObject->parentObjectUnignored() in
1556         AccessibilityObject::findMatchingObject. Added a null check for the startObject to fix that.
1557
1558         Test: accessibility/mac/search-predicate-crash.html
1559
1560         * accessibility/AccessibilityObject.cpp:
1561         (WebCore::AccessibilityObject::findMatchingObjects):
1562
1563 2016-10-19  David Kilzer  <ddkilzer@apple.com>
1564
1565         Bug 163670: Refine assertions in WebCore::ImageData constructors
1566         <https://webkit.org/b/163670>
1567         <rdar://problem/27497338>
1568
1569         Reviewed by Brent Fulgham.
1570
1571         No new tests because there is no change in nominal behavior.
1572
1573         * html/ImageData.cpp:
1574         (WebCore::ImageData::ImageData(const IntSize&)): Change to use
1575         ASSERT() since the worst-case scenario here is a nullptr deref.
1576         Switch to IntSize::area() to compute the area.
1577         (WebCore::ImageData::ImageData(const IntSize&, Ref<Uint8ClampedArray>&&)):
1578         Add ASSERT() identical to the previous constructor, and change
1579         ASSERT_WITH_SECURITY_IMPLICATION() to only fire when m_data is
1580         not nullptr and the length check fails.  Switch to
1581         IntSize::area() to compute the area.
1582
1583 2016-10-19  Myles C. Maxfield  <mmaxfield@apple.com>
1584
1585         [macOS] [iOS] Disable variation fonts on macOS El Capitan and iOS 9
1586         https://bugs.webkit.org/show_bug.cgi?id=163374
1587
1588         Reviewed by Darin Adler.
1589
1590         Because of platform lack of support for variations in in-memory fonts,
1591         this feature should be disabled on the affected OSes.
1592
1593         No tests because there is no behavior change (on the relevant platforms).
1594
1595         * Configurations/FeatureDefines.xcconfig:
1596
1597 2016-10-19  Dave Hyatt  <hyatt@apple.com>
1598
1599         [CSS Parser] Fix background-position parsing
1600         https://bugs.webkit.org/show_bug.cgi?id=163681
1601
1602         Reviewed by Dean Jackson.
1603
1604         The new parser has a more efficient parsed representation of background positions. When
1605         background-position is "center" or when no length unit is specified for a dimension,
1606         then rather than creating a pair, the new parser makes a singleton primitive value.
1607
1608         Patch the StyleBuilder code to handle this case, resolving center to (left,50%) or
1609         (top,50%) as appropriate and also handling top/left without any associated length.
1610
1611         * css/CSSToStyleMap.cpp:
1612         (WebCore::CSSToStyleMap::mapFillXPosition):
1613         (WebCore::CSSToStyleMap::mapFillYPosition):
1614
1615 2016-10-19  Antoine Quint  <graouts@apple.com>
1616
1617         [Modern Media Controls] Media Controller: click-to-start support
1618         https://bugs.webkit.org/show_bug.cgi?id=163659
1619         <rdar://problem/28845656>
1620
1621         Reviewed by Dean Jackson.
1622
1623         We introduce the MediaControllerSupport class which will allow a number of media controller
1624         features to be implemented by subclasses each devoted to implementing a specific subset of
1625         media controller features. With this bug, we add the correct behavior for click-to-start,
1626         only showing the start button under the right circumstances.
1627
1628         A MediaController object indicates which media control to attach click event listeners to
1629         through the `control` property, and a list of media events it should register on the media
1630         element through the `mediaEvents` property. Then, as the user interacts with the specified
1631         control and the media, the Button delegation method `buttonWasClicked()` and the `syncControl()`
1632         methods are called to allow for the media state to be correctly set and represented in the
1633         media controls. Custom event handling for the specified events can also be achieved by
1634         subclassing the `handleEvent()` method.
1635
1636         Tests: media/modern-media-controls/start-support/start-support-audio.html
1637                media/modern-media-controls/start-support/start-support-autoplay.html
1638                media/modern-media-controls/start-support/start-support-click-to-start.html
1639                media/modern-media-controls/start-support/start-support-error.html
1640                media/modern-media-controls/start-support/start-support-fullscreen.html
1641                media/modern-media-controls/start-support/start-support-manual-play.html
1642                media/modern-media-controls/start-support/start-support-no-source.html
1643
1644         * Modules/modern-media-controls/media/media-controller-support.js: Added.
1645         (MediaControllerSupport):
1646         (MediaControllerSupport.prototype.get control):
1647         (MediaControllerSupport.prototype.get mediaEvents):
1648         (MediaControllerSupport.prototype.buttonWasClicked):
1649         (MediaControllerSupport.prototype.handleEvent):
1650         (MediaControllerSupport.prototype.syncControl):
1651         * Modules/modern-media-controls/media/media-controller.js:
1652         (MediaController):
1653         (MediaController.prototype.buttonWasClicked): Deleted.
1654         * Modules/modern-media-controls/media/start-support.js: Added.
1655         (StartSupport.prototype.get control):
1656         (StartSupport.prototype.get mediaEvents):
1657         (StartSupport.prototype.buttonWasClicked):
1658         (StartSupport.prototype.handleEvent):
1659         (StartSupport.prototype.syncControl):
1660         (StartSupport.prototype._shouldShowStartButton):
1661         (StartSupport):
1662
1663 2016-10-19  Aaron Chu  <aaron_chu@apple.com>
1664
1665         Web Inspector: AXI: expose computed tree node and heading level
1666         https://bugs.webkit.org/show_bug.cgi?id=130825
1667         <rdar://problem/16442349>
1668
1669         Reviewed by Joseph Pecoraro.
1670
1671         Exposing two new accessibility properties: Heading Level and Hierarchical Level.
1672
1673         Updated Test: LayoutTest/inspector/dom/getAccessibilityPropertiesForNode.html
1674
1675         * inspector/InspectorDOMAgent.cpp:
1676         (WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
1677
1678 2016-10-19  Adam Bergkvist  <adam.bergkvist@ericsson.com>
1679
1680         WebRTC: Implement MediaEndpointPeerConnection::stop()
1681         https://bugs.webkit.org/show_bug.cgi?id=163660
1682
1683         Reviewed by Philippe Normand.
1684
1685         Make MediaEndpointPeerConnection::stop() stop its MediaEndpoint.
1686
1687         Testing: This fix deals with cleanup and tearing down resources down in the platform layer
1688         and is not covered by automated tests. It is however observable in the manual test added
1689         in [1] where the remote videos should stop when the connections are closed.
1690
1691         [1] http://webkit.org/b/163327
1692
1693         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
1694         (WebCore::MediaEndpointPeerConnection::stop):
1695
1696 2016-10-19  Dave Hyatt  <hyatt@apple.com>
1697
1698         [CSS Parser] Fix -webkit-mask-box-image parsing
1699         https://bugs.webkit.org/show_bug.cgi?id=163676
1700
1701         Reviewed by Dean Jackson.
1702
1703         -webkit-mask-box-image is not a shorthand in our current code, so treat it the same as the legacy
1704         -webkit-border-image.
1705
1706         * css/parser/CSSPropertyParser.cpp:
1707         (WebCore::CSSPropertyParser::parseSingleValue):
1708         (WebCore::CSSPropertyParser::parseShorthand):
1709
1710 2016-10-19  Carlos Alberto Lopez Perez  <clopez@igalia.com>
1711
1712         [GTK][EFL] Build fix after r207543.
1713         https://bugs.webkit.org/show_bug.cgi?id=163671
1714
1715         Unreviewed.
1716
1717         Fix typo on the filename of the included header:
1718         Mac filesystem is case insensitive, but Linux filesystems are case sensitive.
1719
1720         * css/parser/CSSPropertyParser.cpp:
1721
1722 2016-10-19  Zalan Bujtas  <zalan@apple.com>
1723
1724         Use anonymous table row for new child at RenderTableRow::addChild() if available.
1725         https://bugs.webkit.org/show_bug.cgi?id=163651
1726         <rdar://problem/28705022>
1727
1728         Reviewed by David Hyatt.
1729
1730         We should try to prevent the continuation siblings from getting separated and inserted into
1731         wrapper renderers. It makes finding these continuation siblings difficult.
1732         This patch adds a checks for anonymous table rows so that we could find a closer common ancestor of
1733         beforeChild/new child. 
1734
1735         Test: fast/table/crash-when-table-has-continuation-and-content-inserted.html
1736
1737         * rendering/RenderObject.cpp:
1738         (WebCore::RenderObject::showRenderObject): Add continuation information.
1739         * rendering/RenderTableRow.cpp:
1740         (WebCore::RenderTableRow::addChild):
1741
1742 2016-10-19  Joseph Pecoraro  <pecoraro@apple.com>
1743
1744         Cleanup WebCore/workers
1745         https://bugs.webkit.org/show_bug.cgi?id=163635
1746
1747         Reviewed by Chris Dumez.
1748
1749         * workers/*:
1750         Cleanup like pragma once, nullptr, remove stale includes, declarations.
1751
1752 2016-10-19  Chris Dumez  <cdumez@apple.com>
1753
1754         MouseEvent's coordinates should be 0 for simulated clicks
1755         https://bugs.webkit.org/show_bug.cgi?id=163648
1756
1757         Reviewed by Darin Adler.
1758
1759         MouseEvent's coordinates should be 0 / 0 for simulated clicks triggered
1760         by JavaScript (i.e. via element.click()). This behavior matches Chrome
1761         and Firefox.
1762
1763         WebKit was computing actual coordinates for the element which was
1764         expensive, especially because computing  screenX / screenY required
1765         a synchronous IPC with the UI process.
1766
1767         Test: fast/events/element-click-no-coords.html
1768
1769         * dom/Element.cpp:
1770         (WebCore::Element::dispatchSimulatedClick):
1771         * dom/SimulatedClick.cpp:
1772         (WebCore::simulateMouseEvent):
1773         (WebCore::simulateClick):
1774         * dom/SimulatedClick.h:
1775         * html/HTMLElement.cpp:
1776         (WebCore::HTMLElement::click):
1777
1778 2016-10-19  Dave Hyatt  <hyatt@apple.com>
1779
1780         [CSS Parser] Fix transform parsing
1781         https://bugs.webkit.org/show_bug.cgi?id=163671
1782
1783         Reviewed by Dean Jackson.
1784
1785         The new parser turned function names into CSSValueIDs and made CSSFunctionValue store them. This
1786         meant it could be used to handle transform values, with the function name representing the
1787         transform operation efficiently as a CSSValueID.
1788
1789         The old parser, however, creates WebKitCSSTransformValues. This value does not exist in the new
1790         parser. Rather than forcing the old and new parser over to CSSFunctionValues, I opted to
1791         just make the new parser build WebkitCSSTransformValues too.
1792
1793         The main reason I did this is that WebkitCSSTransformValue is actually exposed to the Web via
1794         IDL. To be safe, I am not eliminating it (even though Blink has).
1795
1796         * css/parser/CSSPropertyParser.cpp:
1797         (WebCore::consumeTranslate3d):
1798         (WebCore::consumeNumbers):
1799         (WebCore::consumePerspective):
1800         (WebCore::transformOperationForCSSValueID):
1801         (WebCore::consumeTransformValue):
1802
1803 2016-10-19  Darin Adler  <darin@apple.com>
1804
1805         Move XPath from ExceptionCode to Exception
1806         https://bugs.webkit.org/show_bug.cgi?id=163656
1807
1808         Reviewed by Chris Dumez.
1809
1810         * dom/Document.cpp:
1811         (WebCore::Document::createExpression): Use ExceptionOr.
1812         (WebCore::Document::createNSResolver): Return Ref.
1813         (WebCore::Document::evaluate): Use ExceptionOr.
1814         * dom/Document.h: Updated for above changes.
1815         * dom/Document.idl: Use non-legacy exceptions for the functions above.
1816
1817         * inspector/InspectorNodeFinder.cpp:
1818         (WebCore::InspectorNodeFinder::searchUsingXPath): Call XPath functions
1819         with new interface.
1820
1821         * xml/DOMParser.cpp:
1822         (WebCore::DOMParser::DOMParser): Marked inline.
1823         (WebCore::DOMParser::create): Moved here from header.
1824         (WebCore::DOMParser::parseFromString): Use ExceptionOr.
1825         * xml/DOMParser.h: Updated for above changes.
1826         * xml/DOMParser.idl: Use non-legacy exception.
1827
1828         * xml/XPathEvaluator.cpp:
1829         (WebCore::XPathEvaluator::createExpression): Use ExceptionOr.
1830         (WebCore::XPathEvaluator::evaluate): Ditto.
1831         * xml/XPathEvaluator.h: Updated for above changes.
1832         * xml/XPathEvaluator.idl: Use non-legacy exceptions.
1833
1834         * xml/XPathExpression.cpp:
1835         (WebCore::XPathExpression::createExpression): Use ExceptionOr.
1836         (WebCore::XPathExpression::evaluate): Ditto.
1837         * xml/XPathExpression.h: Updated for above changes.
1838         * xml/XPathExpression.idl: Use non-legacy exceptions.
1839
1840         * xml/XPathGrammar.y: Added include of XPathStep.h.
1841
1842         * xml/XPathParser.cpp:
1843         (WebCore::XPath::Parser::Parser): Initialize three scalar data members
1844         in the class definition rather than here.
1845         (WebCore::XPath::Parser::parseStatement): Use ExceptionOr.
1846         * xml/XPathParser.h: Updated for above changes.
1847
1848         * xml/XPathResult.cpp:
1849         (WebCore::XPathResult::XPathResult): Use a reference rather than a
1850         pointer for the document. Alao initialize two scalar data members
1851         in the class definition rather than here.
1852         (WebCore::XPathResult::convertTo): Use ExceptionOr.
1853         (WebCore::XPathResult::numberValue): Ditto.
1854         (WebCore::XPathResult::stringValue): Ditto.
1855         (WebCore::XPathResult::booleanValue): Ditto.
1856         (WebCore::XPathResult::singleNodeValue): Ditto.
1857         (WebCore::XPathResult::snapshotLength): Ditto.
1858         (WebCore::XPathResult::iterateNext): Ditto.
1859         (WebCore::XPathResult::snapshotItem): Ditto.
1860         * xml/XPathResult.h: Updated for the changes above.
1861         * xml/XPathResult.idl: Use non-legacy exceptions.
1862
1863 2016-10-19  Nan Wang  <n_wang@apple.com>
1864
1865         AX: [Mac] Meter element should use AXValueDescription to descrbe the status of the value
1866         https://bugs.webkit.org/show_bug.cgi?id=163610
1867
1868         Reviewed by Chris Fleizach.
1869
1870         Exposed the goodness of the meter value in AXValueDescription.
1871
1872         Test: accessibility/mac/meter-gauge-value-description.html
1873
1874         * English.lproj/Localizable.strings:
1875         * accessibility/AccessibilityProgressIndicator.cpp:
1876         (WebCore::AccessibilityProgressIndicator::gaugeRegionValueDescription):
1877         * accessibility/AccessibilityProgressIndicator.h:
1878         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1879         (-[WebAccessibilityObjectWrapper valueDescriptionForMeter]):
1880         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
1881         * platform/LocalizedStrings.cpp:
1882         (WebCore::AXMeterGaugeRegionOptimumText):
1883         (WebCore::AXMeterGaugeRegionSuboptimalText):
1884         (WebCore::AXMeterGaugeRegionLessGoodText):
1885         * platform/LocalizedStrings.h:
1886
1887 2016-10-19  Dave Hyatt  <hyatt@apple.com>
1888
1889         [CSS Parser] Fix named color parsing
1890         https://bugs.webkit.org/show_bug.cgi?id=163662
1891
1892         Reviewed by Zalan Bujtas.
1893
1894         Named color parsing in the old parser for extended colors relied on constructing a Color with the
1895         name and doing a lookup that way.
1896
1897         The new parser allows the back end to hold a primitive identifier value for extended colors.
1898
1899         StyleColor contains a helper function for looking up the correct color.
1900
1901         This patch switches both the old and the new parsers over to the new StyleColor function.
1902
1903         Also remove some asserts from the CSSSelectorList, since the new parser allows it to be empty and
1904         detects parsing failure that way.
1905
1906         * css/CSSSelectorList.cpp:
1907         (WebCore::CSSSelectorList::CSSSelectorList):
1908         (WebCore::CSSSelectorList::operator=):
1909         * css/StyleColor.cpp:
1910         (WebCore::StyleColor::isColorKeyword):
1911         * css/StyleResolver.cpp:
1912         (WebCore::StyleResolver::colorFromPrimitiveValue):
1913         (WebCore::colorForCSSValue): Deleted.
1914
1915 2016-10-19  Youenn Fablet  <youenn@apple.com>
1916
1917         Remove SecurityOrigin::taintsCanvas
1918         https://bugs.webkit.org/show_bug.cgi?id=163594
1919
1920         Reviewed by Darin Adler.
1921
1922         No change of behavior.
1923
1924         * html/canvas/CanvasRenderingContext.cpp:
1925         (WebCore::CanvasRenderingContext::wouldTaintOrigin):
1926         * page/SecurityOrigin.cpp:
1927         (WebCore::SecurityOrigin::canReceiveDragData):
1928         (WebCore::SecurityOrigin::taintsCanvas): Deleted.
1929         * page/SecurityOrigin.h:
1930
1931 2016-10-18  Dave Hyatt  <hyatt@apple.com>
1932
1933         [CSS Parser] Fix compound selector parsing.
1934         https://bugs.webkit.org/show_bug.cgi?id=163649
1935
1936         Reviewed by Darin Adler.
1937
1938         The new CSS parser is failing to handle compound selectors. The code has an assumption that the
1939         first value in the RelationType enum is SubSelector. This patch changes the enum to have the same
1940         name used in Blink, RelationType, and to make the ordering be exactly the same.
1941
1942         * css/CSSSelector.h:
1943         (WebCore::CSSSelector::relation):
1944         (WebCore::CSSSelector::setRelation):
1945         * css/SelectorChecker.cpp:
1946         (WebCore::SelectorChecker::matchRecursively):
1947         (WebCore::canMatchHoverOrActiveInQuirksMode):
1948         (WebCore::SelectorChecker::determineLinkMatchType):
1949         * css/SelectorFilter.cpp:
1950         (WebCore::SelectorFilter::collectIdentifierHashes):
1951         * css/parser/CSSParserValues.cpp:
1952         (WebCore::CSSParserSelector::insertTagHistory):
1953         (WebCore::CSSParserSelector::appendTagHistory):
1954         * css/parser/CSSParserValues.h:
1955         (WebCore::CSSParserSelector::setRelation):
1956         * css/parser/CSSSelectorParser.cpp:
1957         (WebCore::CSSSelectorParser::consumeComplexSelector):
1958         (WebCore::CSSSelectorParser::consumeCombinator):
1959         * css/parser/CSSSelectorParser.h:
1960         * cssjit/SelectorCompiler.cpp:
1961         (WebCore::SelectorCompiler::fragmentRelationForSelectorRelation):
1962         (WebCore::SelectorCompiler::constructFragmentsInternal):
1963
1964 2016-10-19  Javier Fernandez  <jfernandez@igalia.com>
1965
1966         Web Inspector: Debugger buttons positioned incorrectly, align-content default value is unexpected
1967         https://bugs.webkit.org/show_bug.cgi?id=163572
1968
1969         Reviewed by Sergio Villar Senin.
1970
1971         We only allow the new CSS Box Alignment syntax when the Grid Layout
1972         feature is enabled. Due to flexbox backward compatibility we have
1973         implemented a different code path for the style initial/default values
1974         assignment. However, we have incorrectly resolved both align-content
1975         and justify-content to 'flex-start' when grid layout is disabled.
1976
1977         This patch changes the approach, so we set 'normal' (the value specified
1978         by the new syntax) for both properties, but using the values defined in
1979         the old syntax (Flexbox specification) at computed style resolution.
1980
1981         Since 'stretch' is the default value for the align-content property, this
1982         issue implies that any flexbox line with an undefined height will be
1983         laid out incorrectly, if not explicitly set via CSS, because flex items
1984         can't use the available height, even though they use 'stretch' for their
1985         'align-self' properties.
1986
1987         Test: css3/flexbox/flexbox-lines-must-be-stretched-by-default.html
1988
1989         * css/CSSComputedStyleDeclaration.cpp:
1990         (WebCore::valueForContentPositionAndDistributionWithOverflowAlignment):
1991         (WebCore::ComputedStyleExtractor::propertyValue):
1992         * rendering/style/RenderStyle.h:
1993         (WebCore::RenderStyle::initialContentAlignment):
1994
1995 2016-10-19  Carlos Alberto Lopez Perez  <clopez@igalia.com>
1996
1997         [GTK] REGRESSION(r207396) Build broken with Clang.
1998         https://bugs.webkit.org/show_bug.cgi?id=163599
1999
2000         Suggested and reviewed by Darin Adler.
2001
2002         * css/CSSPrimitiveValue.cpp:
2003         (WebCore::CSSPrimitiveValue::getStringValue):
2004
2005 2016-10-19  Darin Adler  <darin@apple.com>
2006
2007         Try to fix build.
2008
2009         * page/PerformanceUserTiming.cpp: Add back class name; needed by some compiler versions.
2010
2011 2016-10-19  Carlos Garcia Campos  <cgarcia@igalia.com>
2012
2013         Unreviewed. Fix the build after r207522.
2014
2015         * page/PerformanceUserTiming.cpp: Include PerformanceTiming.h.
2016
2017 2016-10-19  Carlos Garcia Campos  <cgarcia@igalia.com>
2018
2019         Unreviewed. Fix the build after r207519.
2020
2021         The build error is:
2022         IDL ATTRIBUTE CHECKER ERROR: Unknown IDL attribute [PassContext] is found at TestRunner.idl.
2023
2024         Because PassContext was removed from IDLAttributes.txt in rr207519, but it's implemented by
2025         CodeGeneratorTestRunner.pm and used by TestRunner.idl.
2026
2027         * bindings/scripts/IDLAttributes.txt: Bring back PassContext.
2028
2029 2016-10-19  Carlos Garcia Campos  <cgarcia@igalia.com>
2030
2031         Unreviewed. Fix the build with GCC 4.9 after r207463.
2032
2033         Add constructors to MediaConstraintsData.
2034
2035         * Modules/mediastream/MediaConstraintsImpl.h:
2036         (WebCore::MediaConstraintsData::MediaConstraintsData):
2037
2038 2016-10-19  Jer Noble  <jer.noble@apple.com>
2039
2040         [Mac][MSE] Movies with a 'mehd' box have a zero-duration
2041         https://bugs.webkit.org/show_bug.cgi?id=163641
2042
2043         Reviewed by Darin Adler.
2044
2045         Test: media/media-source/media-source-init-segment-duration.html
2046
2047         The canonical (ISO/IEC 14496-12:2012) way to signal the duration of a fragmented media file is to add a
2048         'mehd' box to the 'mvex' container box specifying the duration of the fragment. Support this through the
2049         AVAsset -overallDurationHint property.
2050
2051         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
2052         (WebCore::SourceBufferPrivateAVFObjC::didParseStreamDataAsAsset):
2053         * platform/spi/mac/AVFoundationSPI.h:
2054
2055 2016-10-18  Darin Adler  <darin@apple.com>
2056
2057         Move many miscellaneous classes from ExceptionCode to Exception
2058         https://bugs.webkit.org/show_bug.cgi?id=163645
2059
2060         Reviewed by Ryosuke Niwa.
2061
2062         * bindings/js/JSCryptoCustom.cpp:
2063         (WebCore::JSCrypto::getRandomValues): Use propagateException.
2064         * bindings/js/JSDOMWindowCustom.cpp:
2065         (WebCore::handlePostMessage): Ditto.
2066         (WebCore::JSDOMWindow::setTimeout): Use toJSNumber.
2067         (WebCore::JSDOMWindow::setInterval): Ditto.
2068         * bindings/js/JSStorageCustom.cpp:
2069         (WebCore::JSStorage::nameGetter): Use propagateException.
2070         (WebCore::JSStorage::deleteProperty): Ditto.
2071         (WebCore::JSStorage::getOwnPropertyNames): Ditto.
2072         (WebCore::JSStorage::putDelegate): Ditto.
2073
2074         * loader/appcache/DOMApplicationCache.cpp:
2075         (WebCore::DOMApplicationCache::update): Use ExceptionOr.
2076         (WebCore::DOMApplicationCache::swapCache): Ditto.
2077         * loader/appcache/DOMApplicationCache.h: Update for above changes.
2078         * loader/appcache/DOMApplicationCache.idl: Use non-legacy exceptions.
2079
2080         * page/Crypto.cpp:
2081         (WebCore::Crypto::getRandomValues): Use ExceptionOr.
2082         (WebCore::Crypto::webkitSubtle): Ditto.
2083         * page/Crypto.h: Updated for above changes.
2084         * page/Crypto.idl: Use non-legacy exceptions.
2085
2086         * page/DOMWindow.cpp:
2087         (WebCore::DOMWindow::DOMWindow): Initialize many data members in
2088         the class definition instead of here.
2089         (WebCore::DOMWindow::page): Use nullptr.
2090         (WebCore::DOMWindow::screen): Ditto.
2091         (WebCore::DOMWindow::crypto): Ditto.
2092         (WebCore::DOMWindow::locationbar): Ditto.
2093         (WebCore::DOMWindow::menubar): Ditto.
2094         (WebCore::DOMWindow::personalbar): Ditto.
2095         (WebCore::DOMWindow::scrollbars): Ditto.
2096         (WebCore::DOMWindow::statusbar): Ditto.
2097         (WebCore::DOMWindow::toolbar): Ditto.
2098         (WebCore::DOMWindow::applicationCache): Ditto.
2099         (WebCore::DOMWindow::sessionStorage): Use ExceptionOr.
2100         (WebCore::DOMWindow::localStorage): Ditto.
2101         (WebCore::DOMWindow::postMessage): Ditto.
2102         (WebCore::DOMWindow::frameElement): Use nullptr.
2103         (WebCore::DOMWindow::self): Ditto.
2104         (WebCore::DOMWindow::opener): Ditto.
2105         (WebCore::DOMWindow::parent): Ditto.
2106         (WebCore::DOMWindow::top): Ditto.
2107         (WebCore::DOMWindow::getComputedStyle): Use Ref.
2108         (WebCore::DOMWindow::setTimeout): Use ExceptionOr.
2109         (WebCore::DOMWindow::setInterval): Ditto.
2110         (WebCore::didAddStorageEventListener): Use a reference instead of a
2111         pointer, and ignore return value instead of using IGNORE_EXCEPTION.
2112         (WebCore::DOMWindow::addEventListener): Pass reference to function above.
2113         (WebCore::DOMWindow::dispatchEvent): Use enum class version of PageStatus.
2114         * page/DOMWindow.h: Updated for changes above. Also changed indentatation.
2115         * page/DOMWindow.idl: Use non-legacy exceptions.
2116
2117         * page/EventSource.cpp:
2118         (WebCore::EventSource::create): Use ExceptionOr.
2119         * page/EventSource.h: Updated for change above.
2120         * page/EventSource.idl: Use non-legacy exception.
2121
2122         * page/Location.cpp:
2123         (WebCore::Location::setProtocol): Use ExceptionOr.
2124         * page/Location.h: Updated for change above.
2125         * page/Location.idl: Use non-legacy exception.
2126
2127         * page/Performance.cpp:
2128         (WebCore::Performance::Performance): Remove unnecessary initialization of
2129         smart pointer to null, and moved initialization of m_resourceTimingBufferSize
2130         to the header.
2131         (WebCore::Performance::navigation): Made non-const and return a reference.
2132         (WebCore::Performance::timing): Ditto.
2133         (WebCore::Performance::addResourceTiming): Change LoadTiming argument to use
2134         a const& instead of passing in a copy.
2135         (WebCore::Performance::webkitMark): Use ExceptionOr and make_unique.
2136         (WebCore::Performance::webkitClearMarks): Ditto.
2137         (WebCore::Performance::webkitMeasure): Ditto.
2138         (WebCore::Performance::webkitClearMeasures): Ditto.
2139         (WebCore::Performance::reduceTimeResolution): Use std::floor.
2140         * page/Performance.h: Updated for above changes. Removed unneeded includes.
2141         Made more things private. Removed unneeded reference counting of UserTiming.
2142         * page/Performance.idl: Use non-legacy exceptions.
2143
2144         * page/PerformanceUserTiming.cpp:
2145         (WebCore::restrictedMarkFunction): Removed unneeded class name.
2146         (WebCore::UserTiming::UserTiming): Take a reference instead of a pointer.
2147         (WebCore::UserTiming::mark): Use ExceptionOr.
2148         (WebCore::UserTiming::findExistingMarkStartTime): Ditto.
2149         (WebCore::UserTiming::measure): Ditto.
2150         (WebCore::getEntrySequenceByName): Simplified code using HashMap::get.
2151         * page/PerformanceUserTiming.h: Updated for above changes. Removed reference
2152         counting since this is a single-owner object.
2153
2154         * page/UserMessageHandler.cpp:
2155         (WebCore::UserMessageHandler::postMessage): Use ExceptionOr.
2156         * page/UserMessageHandler.h: Updated for above change.
2157         * page/UserMessageHandler.idl: Use non-legacy exception.
2158
2159         * storage/Storage.cpp:
2160         (WebCore::Storage::length): Use ExceptionOr.
2161         (WebCore::Storage::key): Ditto.
2162         (WebCore::Storage::getItem): Ditto.
2163         (WebCore::Storage::setItem): Ditto.
2164         (WebCore::Storage::removeItem): Ditto.
2165         (WebCore::Storage::clear): Ditto.
2166         (WebCore::Storage::contains): Ditto.
2167         * storage/Storage.h: Updated for above change.
2168         * storage/Storage.idl: Use non-legacy exceptions.
2169
2170         * storage/StorageEventDispatcher.cpp:
2171         (WebCore::StorageEventDispatcher::dispatchSessionStorageEventsToFrames):
2172         Updated for ExceptionOr.
2173         (WebCore::StorageEventDispatcher::dispatchLocalStorageEventsToFrames): Ditto.
2174
2175 2016-10-18  Darin Adler  <darin@apple.com>
2176
2177         Move internal testing classes from ExceptionCode to Exception
2178         https://bugs.webkit.org/show_bug.cgi?id=163553
2179
2180         Reviewed by Ryosuke Niwa.
2181
2182         * bindings/js/JSDOMBinding.h: Added toJSArray. Also exported a function that
2183         is now needed in the testing library.
2184         * bindings/scripts/CodeGeneratorJS.pm:
2185         (NativeToJSValue): Added code to handle the jsArray case with an exception.
2186
2187         * css/parser/CSSPropertyParser.cpp: Fix #if to make code compile when
2188         CSS_SCROLL_SNAP is not enabled.
2189
2190         * dom/Element.cpp:
2191         (WebCore::Element::createShadowRoot): Changed return type to a raw pointer.
2192         There is no reason it needs to be a RefPtr.
2193         * dom/Element.h: Updated for above change.
2194
2195         * svg/SVGPathStringBuilder.h: Exported class and made more public so it can
2196         be used in test code.
2197
2198         * svg/SVGPathUtilities.cpp:
2199         (WebCore::pathIteratorForBuildingString): Deleted. Needed only for test code,
2200         so moved into there.
2201         (WebCore::buildStringFromPath): Deleted. Ditto.
2202         * svg/SVGPathUtilities.h: Removed buildStringFromPath.
2203
2204         * testing/InternalSettings.cpp: Simplified the guard macro and used the all
2205         capitals style that our style guide prescribes for non-function-like macros.
2206         (WebCore::InternalSettings::create): Moved here, no longer inline Use m_page.
2207         (WebCore::InternalSettings::resetToConsistentState): Updated since settings
2208         returns a reference.
2209         (WebCore::InternalSettings::settings): Changed to return a reference and
2210         assert that m_page is not null; functions all check m_page for null first.
2211         (WebCore::InternalSettings::setTouchEventEmulationEnabled): Updated to use
2212         ExceptionOr, do an m_page check, and use settings that returns a reference.
2213         (WebCore::InternalSettings::setStandardFontFamily): Ditto.
2214         (WebCore::InternalSettings::setSerifFontFamily): Ditto.
2215         (WebCore::InternalSettings::setSansSerifFontFamily): Ditto.
2216         (WebCore::InternalSettings::setFixedFontFamily): Ditto.
2217         (WebCore::InternalSettings::setCursiveFontFamily): Ditto.
2218         (WebCore::InternalSettings::setFantasyFontFamily): Ditto.
2219         (WebCore::InternalSettings::setPictographFontFamily): Ditto.
2220         (WebCore::InternalSettings::setTextAutosizingEnabled): Ditto.
2221         (WebCore::InternalSettings::setTextAutosizingWindowSizeOverride): Ditto.
2222         (WebCore::InternalSettings::setMediaTypeOverride): Ditto.
2223         (WebCore::InternalSettings::setCanStartMedia): Ditto.
2224         (WebCore::InternalSettings::setAllowsAirPlayForMediaPlayback): Ditto.
2225         (WebCore::InternalSettings::setEditingBehavior): Ditto.
2226         (WebCore::InternalSettings::setShouldDisplayTrackKind): Ditto.
2227         (WebCore::InternalSettings::shouldDisplayTrackKind): Ditto.
2228         (WebCore::InternalSettings::setStorageBlockingPolicy): Ditto.
2229         (WebCore::InternalSettings::setPreferMIMETypeForImages): Ditto.
2230         (WebCore::InternalSettings::setImagesEnabled): Ditto.
2231         (WebCore::InternalSettings::setPDFImageCachingPolicy): Ditto.
2232         (WebCore::InternalSettings::setMinimumTimerInterval): Ditto.
2233         (WebCore::InternalSettings::setDefaultVideoPosterURL): Ditto.
2234         (WebCore::InternalSettings::setForcePendingWebGLPolicy): Ditto.
2235         (WebCore::InternalSettings::setTimeWithoutMouseMovementBeforeHidingControls): Ditto.
2236         (WebCore::InternalSettings::setUseLegacyBackgroundSizeShorthandBehavior): Ditto.
2237         (WebCore::InternalSettings::setAutoscrollForDragAndDropEnabled): Ditto.
2238         (WebCore::InternalSettings::setFontFallbackPrefersPictographs): Ditto.
2239         (WebCore::InternalSettings::setWebFontsAlwaysFallBack): Ditto.
2240         (WebCore::InternalSettings::setQuickTimePluginReplacementEnabled): Ditto.
2241         (WebCore::InternalSettings::setYouTubeFlashPluginReplacementEnabled): Ditto.
2242         (WebCore::InternalSettings::setBackgroundShouldExtendBeyondPage): Ditto.
2243         (WebCore::InternalSettings::setShouldConvertPositionStyleOnCopy): Ditto.
2244         (WebCore::InternalSettings::setScrollingTreeIncludesFrames): Ditto.
2245         (WebCore::InternalSettings::setAllowsInlineMediaPlayback): Ditto.
2246         (WebCore::InternalSettings::setAllowsInlineMediaPlaybackAfterFullscreen): Ditto.
2247         (WebCore::InternalSettings::setInlineMediaPlaybackRequiresPlaysInlineAttribute): Ditto.
2248         (WebCore::InternalSettings::setIndexedDBWorkersEnabled): Ditto.
2249         (WebCore::InternalSettings::userInterfaceDirectionPolicy): Ditto.
2250         (WebCore::InternalSettings::setUserInterfaceDirectionPolicy): Ditto.
2251         (WebCore::InternalSettings::systemLayoutDirection): Ditto.
2252         (WebCore::InternalSettings::setSystemLayoutDirection): Ditto.
2253         (WebCore::InternalSettings::variationFontsEnabled): Ditto.
2254         (WebCore::InternalSettings::setVariationFontsEnabled): Ditto.
2255         (WebCore::InternalSettings::forcedPrefersReducedMotionValue): Ditto.
2256         (WebCore::InternalSettings::setForcedPrefersReducedMotionValue): Ditto.
2257         * testing/InternalSettings.h: Updated for above changes. Also moved Backup to make
2258         it private instead of public.
2259         * testing/InternalSettings.idl: Use non-legacy execption. Also removed unneeded
2260         exception for setIndexedDBWorkersEnabled.
2261
2262         * testing/Internals.cpp: Marked InspectorStubFrontend final and made everything private.
2263         (WebCore::Internals::setCanShowModalDialogOverride): Use ExceptionOr.
2264         (WebCore::Internals::lastSpatialNavigationCandidateCount): Ditto.
2265         (WebCore::Internals::animationsAreSuspended): Ditto.
2266         (WebCore::Internals::suspendAnimations): Ditto.
2267         (WebCore::Internals::resumeAnimations): Ditto.
2268         (WebCore::Internals::pauseAnimationAtTimeOnElement): Ditto.
2269         (WebCore::Internals::pauseAnimationAtTimeOnPseudoElement): Ditto.
2270         (WebCore::Internals::pauseTransitionAtTimeOnElement): Ditto.
2271         (WebCore::Internals::pauseTransitionAtTimeOnPseudoElement): Ditto.
2272         (WebCore::Internals::elementRenderTreeAsText): Ditto.
2273         (WebCore::Internals::ensureShadowRoot): Ditto.
2274         (WebCore::Internals::createShadowRoot): Ditto.
2275         (WebCore::Internals::shadowRootType): Ditto.
2276         (WebCore::Internals::isTimerThrottled): Ditto.
2277         (WebCore::Internals::formControlStateOfPreviousHistoryItem): Ditto.
2278         (WebCore::Internals::setFormControlStateOfPreviousHistoryItem): Ditto.
2279         (WebCore::Internals::absoluteCaretBounds): Ditto.
2280         (WebCore::Internals::inspectorHighlightRects): Ditto.
2281         (WebCore::Internals::inspectorHighlightObject): Ditto.
2282         (WebCore::Internals::markerCountForNode): Ditto.
2283         (WebCore::Internals::markerAt): Ditto.
2284         (WebCore::Internals::markerRangeForNode): Ditto.
2285         (WebCore::Internals::markerDescriptionForNode): Ditto.
2286         (WebCore::Internals::dumpMarkerRects): Ditto.
2287         (WebCore::Internals::setMarkedTextMatchesAreHighlighted): Ditto.
2288         (WebCore::Internals::setScrollViewPosition): Ditto.
2289         (WebCore::Internals::setViewBaseBackgroundColor): Ditto.
2290         (WebCore::Internals::setPagination): Ditto.
2291         (WebCore::Internals::setPaginationLineGridEnabled): Ditto.
2292         (WebCore::Internals::configurationForViewport): Ditto.
2293         (WebCore::Internals::wasLastChangeUserEdit): Ditto.
2294         (WebCore::Internals::scrollElementToRect): Ditto.
2295         (WebCore::Internals::autofillFieldName): Ditto.
2296         (WebCore::Internals::paintControlTints): Ditto.
2297         (WebCore::Internals::rangeForDictionaryLookupAtLocation): Ditto.
2298         (WebCore::Internals::setDelegatesScrolling): Ditto.
2299         (WebCore::Internals::lastSpellCheckRequestSequence): Ditto.
2300         (WebCore::Internals::lastSpellCheckProcessedSequence): Ditto.
2301         (WebCore::Internals::wheelEventHandlerCount): Ditto.
2302         (WebCore::Internals::touchEventHandlerCount): Ditto.
2303         (WebCore::Internals::nodesFromRect): Ditto.
2304         (WebCore::Internals::setBatteryStatus): Ditto.
2305         (WebCore::Internals::setDeviceProximity): Ditto.
2306         (WebCore::Internals::hasSpellingMarker): Ditto.
2307         (WebCore::Internals::hasAutocorrectedMarker): Ditto.
2308         (WebCore::Internals::handleAcceptedCandidate): Ditto.
2309         (WebCore::Internals::isOverwriteModeEnabled): Ditto.
2310         (WebCore::Internals::toggleOverwriteModeEnabled): Ditto.
2311         (WebCore::Internals::countMatchesForText): Ditto.
2312         (WebCore::Internals::countFindMatches): Ditto.
2313         (WebCore::Internals::setInspectorIsUnderTest): Ditto.
2314         (WebCore::Internals::hasGrammarMarker): Ditto.
2315         (WebCore::Internals::numberOfScrollableAreas): Ditto.
2316         (WebCore::Internals::isPageBoxVisible): Ditto.
2317         (WebCore::Internals::layerTreeAsText): Ditto.
2318         (WebCore::Internals::repaintRectsAsText): Ditto.
2319         (WebCore::Internals::scrollingStateTreeAsText): Ditto.
2320         (WebCore::Internals::mainThreadScrollingReasons): Ditto.
2321         (WebCore::Internals::nonFastScrollableRects): Ditto.
2322         (WebCore::Internals::setElementUsesDisplayListDrawing): Ditto.
2323         (WebCore::Internals::setElementTracksDisplayListReplay): Ditto.
2324         (WebCore::Internals::displayListForElement): Ditto.
2325         (WebCore::Internals::replayDisplayListForElement): Ditto.
2326         (WebCore::Internals::garbageCollectDocumentResources): Ditto.
2327         (WebCore::Internals::insertAuthorCSS): Ditto.
2328         (WebCore::Internals::insertUserCSS): Ditto.
2329         (WebCore::Internals::pageProperty): Ditto.
2330         (WebCore::Internals::pageSizeAndMarginsInPixels): Ditto.
2331         (WebCore::Internals::setPageScaleFactor): Ditto.
2332         (WebCore::Internals::setPageZoomFactor): Ditto.
2333         (WebCore::Internals::setTextZoomFactor): Ditto.
2334         (WebCore::Internals::setUseFixedLayout): Ditto.
2335         (WebCore::Internals::setFixedLayoutSize): Ditto.
2336         (WebCore::Internals::setViewExposedRect): Ditto.
2337         (WebCore::Internals::setHeaderHeight): Ditto.
2338         (WebCore::Internals::setFooterHeight): Ditto.
2339         (WebCore::Internals::setTopContentInset): Ditto.
2340         (WebCore::Internals::setApplicationCacheOriginQuota): Ditto.
2341         (WebCore::Internals::startTrackingRepaints): Ditto.
2342         (WebCore::Internals::stopTrackingRepaints): Ditto.
2343         (WebCore::Internals::startTrackingLayerFlushes): Ditto.
2344         (WebCore::Internals::layerFlushCount): Ditto.
2345         (WebCore::Internals::startTrackingStyleRecalcs): Ditto.
2346         (WebCore::Internals::styleRecalcCount): Ditto.
2347         (WebCore::Internals::startTrackingCompositingUpdates): Ditto.
2348         (WebCore::Internals::compositingUpdateCount): Ditto.
2349         (WebCore::Internals::updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks): Ditto.
2350         (WebCore::Internals::getCurrentCursorInfo): Ditto.
2351         (WebCore::Internals::mediaElementHasCharacteristic): Ditto.
2352         (WebCore::Internals::captionsStyleSheetOverride): Ditto.
2353         (WebCore::Internals::setCaptionsStyleSheetOverride): Ditto.
2354         (WebCore::Internals::setPrimaryAudioTrackLanguageOverride): Ditto.
2355         (WebCore::Internals::setCaptionDisplayMode): Ditto.
2356         (WebCore::Internals::selectionBounds): Ditto.
2357         (WebCore::Internals::isVibrating): Ditto.
2358         (WebCore::Internals::isPluginUnavailabilityIndicatorObscured): Ditto.
2359         (WebCore::Internals::beginMediaSessionInterruption): Ditto.
2360         (WebCore::Internals::setMediaSessionRestrictions): Ditto.
2361         (WebCore::Internals::postRemoteControlCommand): Ditto.
2362         (WebCore::Internals::setMockMediaPlaybackTargetPickerState): Ditto.
2363         (WebCore::Internals::installMockPageOverlay): Ditto.
2364         (WebCore::Internals::pageOverlayLayerTreeAsText): Ditto.
2365         (WebCore::Internals::scrollSnapOffsets): Ditto.
2366         (WebCore::Internals::pathStringWithShrinkWrappedRects): Moved the code that builds
2367         the path string in here for now since it's only used for this testing.
2368         (WebCore::Internals::resourceLoadStatisticsForOrigin): Take a const String&.
2369
2370         * testing/Internals.h: Updated for above changes.
2371         * testing/Internals.idl: Use non-legacy exceptions.
2372
2373 2016-10-18  Chris Dumez  <cdumez@apple.com>
2374
2375         [Web IDL] Drop webkit-specific extended attributes that are no longer useful
2376         https://bugs.webkit.org/show_bug.cgi?id=163643
2377
2378         Reviewed by Ryosuke Niwa.
2379
2380         Drop webkit-specific IDL extended attributes that are no longer useful:
2381         - [CustomReturn]: I believe this used to be for ObjC bindings. It has
2382           no impact in JS bindings.
2383         - [Deletable]: It only had an impact on static attributes and was only
2384           used on HTMLAllCollection.all, which is not static. I updated the
2385           bindings generator to so that static attributes are now configurable
2386           by default (unless marked as [Unforgeable], as per Web IDL [1]. This
2387           causes Notification.permission (This only static attribute we have)
2388           to become deletable. This behavior is consistent with the specification
2389           and with Chrome. I added test coverage for this.
2390         - [ImplementationNamespace]: Implemented but unused.
2391         - [PassContext]: Not implemented and unused.
2392         - [TypedArray=*]: Not implemented and unused.
2393
2394         [1] https://heycam.github.io/webidl/#es-attributes
2395
2396         Test: fast/notifications/notification-permisssion-deletable.html
2397
2398         * bindings/scripts/CodeGeneratorJS.pm:
2399         (GetNamespaceForInterface):
2400         (GenerateImplementation):
2401         * bindings/scripts/IDLAttributes.txt:
2402         * bindings/scripts/test/JS/JSTestInterface.cpp:
2403         * bindings/scripts/test/JS/JSTestObj.cpp:
2404         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
2405         * dom/Node.idl:
2406         * html/HTMLDocument.idl:
2407
2408 2016-10-18  Sam Weinig  <sam@webkit.org>
2409
2410         Replace std::experimental::variant with WTF::Variant (or similar)
2411         https://bugs.webkit.org/show_bug.cgi?id=163626
2412
2413         Reviewed by Chris Dumez.
2414
2415         Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc.
2416         into the WTF namespace.
2417
2418         * Modules/fetch/FetchBody.h:
2419         (WebCore::FetchBody::isBlob):
2420         (WebCore::FetchBody::isFormData):
2421         (WebCore::FetchBody::isArrayBuffer):
2422         (WebCore::FetchBody::isArrayBufferView):
2423         (WebCore::FetchBody::isURLSearchParams):
2424         (WebCore::FetchBody::isText):
2425         (WebCore::FetchBody::blobBody):
2426         (WebCore::FetchBody::formDataBody):
2427         (WebCore::FetchBody::arrayBufferBody):
2428         (WebCore::FetchBody::arrayBufferViewBody):
2429         (WebCore::FetchBody::textBody):
2430         (WebCore::FetchBody::urlSearchParamsBody):
2431         * bindings/generic/IDLTypes.h:
2432         * dom/ExceptionOr.h:
2433         (WebCore::ExceptionOr<ReturnType>::hasException):
2434         (WebCore::ExceptionOr<ReturnType>::releaseException):
2435         (WebCore::ExceptionOr<ReturnType>::releaseReturnValue):
2436         * dom/MessageEvent.cpp:
2437         (WebCore::MessageEvent::source):
2438         * dom/MessageEvent.h:
2439         * dom/Node.cpp:
2440         (WebCore::nodeSetPreTransformedFromNodeOrStringVector):
2441         (WebCore::Node::convertNodesOrStringsIntoNode):
2442         * dom/Node.h:
2443         * html/HTMLOptionsCollection.h:
2444         * html/HTMLSelectElement.cpp:
2445         (WebCore::HTMLSelectElement::add):
2446         * html/HTMLSelectElement.h:
2447         * html/track/TrackEvent.cpp:
2448         (WebCore::TrackEvent::TrackEvent):
2449         * html/track/TrackEvent.h:
2450
2451 2016-10-18  Chris Dumez  <cdumez@apple.com>
2452
2453         Unreviewed, rebaseline bindings tests after Sam's r207505.
2454
2455         * bindings/scripts/test/JS/JSTestCallback.cpp:
2456         (WebCore::JSTestCallback::callbackWithSerializedScriptValueParam):
2457         * bindings/scripts/test/JS/JSTestCallbackFunction.cpp:
2458         (WebCore::JSTestCallbackFunction::callbackWithSerializedScriptValueParam):
2459         * bindings/scripts/test/JS/JSTestObj.cpp:
2460         (WebCore::jsTestObjPrototypeFunctionSerializedValueCaller):
2461         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
2462         (WebCore::jsTestSerializedScriptValueInterfaceValueGetter):
2463         (WebCore::jsTestSerializedScriptValueInterfaceReadonlyValueGetter):
2464         (WebCore::jsTestSerializedScriptValueInterfaceCachedValueGetter):
2465         (WebCore::jsTestSerializedScriptValueInterfaceCachedReadonlyValueGetter):
2466         (WebCore::setJSTestSerializedScriptValueInterfaceValueFunction):
2467         (WebCore::setJSTestSerializedScriptValueInterfaceCachedValueFunction):
2468         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
2469         (WebCore::jsTestTypedefsImmutableSerializedScriptValueGetter):
2470         (WebCore::setJSTestTypedefsImmutableSerializedScriptValueFunction):
2471
2472 2016-10-18  Chris Dumez  <cdumez@apple.com>
2473
2474         [Web IDL] Kill support for [LegacyConstructorTemplate=Event] / [LegacyInitializedByEventConstructor]
2475         https://bugs.webkit.org/show_bug.cgi?id=163630
2476
2477         Reviewed by Darin Adler.
2478
2479         Kill support for [LegacyConstructorTemplate=Event] / [LegacyInitializedByEventConstructor] in our
2480         IDL now that all our events use proper constructors instead.
2481
2482         * bindings/scripts/CodeGenerator.pm:
2483         * bindings/scripts/CodeGeneratorJS.pm:
2484         (GenerateHeader):
2485         (GenerateConstructorDefinition):
2486         (GenerateConstructorHelperMethods):
2487         (IsConstructable):
2488         * bindings/scripts/IDLAttributes.txt:
2489         * dom/Event.h:
2490         (WebCore::Event::create):
2491         * dom/Event.idl:
2492         * dom/UIEvent.h:
2493         (WebCore::UIEvent::create):
2494         * dom/UIEvent.idl:
2495
2496 2016-10-18  Chris Dumez  <cdumez@apple.com>
2497
2498         Changing details.open should cause a toggle event to be fired asynchronously
2499         https://bugs.webkit.org/show_bug.cgi?id=163568
2500
2501         Reviewed by Darin Adler.
2502
2503         Changing details.open should cause a toggle event to be fired asynchronously:
2504         - https://html.spec.whatwg.org/#details-notification-task-steps
2505
2506         Firefox and Chrome implement this, we don't.
2507
2508         Test: imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-details-element/toggleEvent.html
2509
2510         * dom/EventNames.h:
2511         * dom/GlobalEventHandlers.idl:
2512         * html/HTMLAttributeNames.in:
2513         * html/HTMLDetailsElement.cpp:
2514         (WebCore::detailToggleEventSender):
2515         (WebCore::HTMLDetailsElement::~HTMLDetailsElement):
2516         (WebCore::HTMLDetailsElement::dispatchPendingEvent):
2517         (WebCore::HTMLDetailsElement::parseAttribute):
2518         * html/HTMLDetailsElement.h:
2519         * html/HTMLElement.cpp:
2520         (WebCore::HTMLElement::createEventHandlerNameMap):
2521
2522 2016-10-18  Dave Hyatt  <hyatt@apple.com>
2523
2524         [CSS Parser] Enable basic parser testing.
2525         https://bugs.webkit.org/show_bug.cgi?id=163639
2526
2527         Reviewed by Dean Jackson.
2528
2529         * css/SelectorChecker.cpp:
2530         (WebCore::SelectorChecker::matchRecursively):
2531         Remove the ASSERT_NOT_REACHED on the new shadow selectors. We need to implement this
2532         eventually, but it's better to not assert on that for now.
2533
2534         * css/parser/CSSParserValues.cpp:
2535         (WebCore::CSSParserSelector::isHostPseudoSelector):
2536         Make sure to check that we're a pseudoclass selector first, since otherwise we'll assert.
2537
2538         * css/parser/CSSParserValues.h:
2539         (WebCore::CSSParserSelector::needsImplicitShadowCombinatorForMatching):
2540         Make sure to check that we're a pseudoelement selector first, since otherwise we'll assert.
2541
2542         * css/parser/CSSPropertyParser.cpp:
2543         (WebCore::CSSPropertyParser::addExpandedPropertyForValue):
2544         copyRef is needed here, since a singleton value is being propagated to all the expanded shorthand properties.
2545
2546         (WebCore::parseSingleShadow):
2547         (WebCore::CSSPropertyParser::consumeFont):
2548         Remove the font properties that aren't part of our shorthand. We will need to revisit this eventually as it seems
2549         some of the font properties should be reset as part of this shorthand but aren't.
2550 '
2551         * css/parser/CSSPropertyParserHelpers.cpp:
2552         (WebCore::CSSPropertyParserHelpers::consumeInteger):
2553         Just return a number for now instead of the parser_integer type.
2554
2555         * css/parser/CSSSelectorParser.cpp:
2556         (WebCore::CSSSelectorParser::consumePseudo):
2557         Clean this up so that it doesn't assert by making sure to add qualifying checks for the appropriate match type.
2558
2559 2016-10-18  Ryosuke Niwa  <rniwa@webkit.org>
2560
2561         Update the comment for HTML Imports as there is now a proposal to use ES6 Modules for this.
2562         Also replace the contact by me since I'm most familiar with this feature.
2563
2564         * features.json:
2565
2566 2016-10-18  Ryosuke Niwa  <rniwa@webkit.org>
2567
2568         Update the status of shadow DOM API to "Done" with a comment saying we're still fixing bugs.
2569
2570         Also update my contact information since I'm no longer on Twitter.
2571
2572         * features.json:
2573
2574 2016-10-18  Chris Dumez  <cdumez@apple.com>
2575
2576         Provide better form validation messages
2577         https://bugs.webkit.org/show_bug.cgi?id=163584
2578
2579         Reviewed by Darin Adler.
2580
2581         Provide better form validation messages that match more closely the ones
2582         from Chrome and Firefox.
2583
2584         No new tests, updated existing tests.
2585
2586         * English.lproj/Localizable.strings:
2587         * platform/LocalizedStrings.cpp:
2588         (WebCore::validationMessageValueMissingText):
2589         (WebCore::validationMessageValueMissingForCheckboxText):
2590         (WebCore::validationMessageValueMissingForFileText):
2591         (WebCore::validationMessageValueMissingForMultipleFileText):
2592         (WebCore::validationMessageValueMissingForRadioText):
2593         (WebCore::validationMessageValueMissingForSelectText):
2594         (WebCore::validationMessageTypeMismatchText):
2595         (WebCore::validationMessageTypeMismatchForEmailText):
2596         (WebCore::validationMessageTypeMismatchForMultipleEmailText):
2597         (WebCore::validationMessageTypeMismatchForURLText):
2598         (WebCore::validationMessagePatternMismatchText):
2599         (WebCore::validationMessageTooShortText):
2600         (WebCore::validationMessageTooLongText):
2601         (WebCore::validationMessageRangeUnderflowText):
2602         (WebCore::validationMessageRangeOverflowText):
2603         (WebCore::validationMessageStepMismatchText):
2604         (WebCore::validationMessageBadInputForNumberText):
2605
2606 2016-10-18  Dave Hyatt  <hyatt@apple.com>
2607
2608         Fix GTK build.
2609
2610         * css/parser/CSSPropertyParser.cpp:
2611         (WebCore::CSSPropertyParser::parseSingleValue):
2612
2613 2016-10-18  Sam Weinig  <sam@webkit.org>
2614
2615         Simplify SerializedScriptValue, MessagePortArray and ArrayBufferArray to ease generation
2616         https://bugs.webkit.org/show_bug.cgi?id=163625
2617
2618         Reviewed by Chris Dumez.
2619
2620         - Replace uses of MessagePortArray (a.k.a. Vector<RefPtr<MessagePort>, 1>) with Vector<RefPtr<MessagePort>>.
2621         - Replace uses of ArrayBufferArray (a.k.a. Vector<RefPtr<ArrayBuffer>, 1>) with Vector<RefPtr<ArrayBuffer>>.
2622         - Add convenience functions to SerializedScriptValue to allow calling with fewer parameters.
2623         - Move MessagePorts and ArrayBuffers more where possible.
2624
2625         * Modules/indexeddb/IDBObjectStore.cpp:
2626         (WebCore::IDBObjectStore::putOrAdd):
2627         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
2628         (WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd):
2629         * bindings/js/IDBBindingUtilities.cpp:
2630         (WebCore::deserializeIDBValueToJSValue):
2631         * bindings/js/JSCustomEventCustom.cpp:
2632         (WebCore::JSCustomEvent::detail):
2633         * bindings/js/JSHistoryCustom.cpp:
2634         (WebCore::JSHistory::state):
2635         (WebCore::JSHistory::pushState):
2636         (WebCore::JSHistory::replaceState):
2637         * bindings/js/JSPopStateEventCustom.cpp:
2638         (WebCore::JSPopStateEvent::state):
2639         * dom/CustomEvent.cpp:
2640         (WebCore::CustomEvent::trySerializeDetail):
2641         * dom/ErrorEvent.cpp:
2642         (WebCore::ErrorEvent::sanitizedErrorValue):
2643         (WebCore::ErrorEvent::trySerializeError):
2644         * dom/PopStateEvent.cpp:
2645         (WebCore::PopStateEvent::trySerializeState):
2646         * page/DOMWindow.cpp:
2647         (WebCore::DOMWindow::postMessage):
2648         * page/DOMWindow.h:
2649         * workers/DedicatedWorkerGlobalScope.cpp:
2650         (WebCore::DedicatedWorkerGlobalScope::postMessage):
2651         * workers/DedicatedWorkerGlobalScope.h:
2652         * workers/Worker.cpp:
2653         (WebCore::Worker::postMessage):
2654         * workers/Worker.h:
2655         * bindings/js/JSDOMWindowCustom.cpp:
2656         (WebCore::handlePostMessage):
2657         * bindings/js/JSDictionary.cpp:
2658         (WebCore::JSDictionary::convertValue):
2659         * bindings/js/JSDictionary.h:
2660         Updated for new SerializedScriptValue interface/vector naming.
2661
2662         * bindings/js/JSMessageEventCustom.cpp:
2663         (WebCore::handleInitMessageEvent):
2664         Update handleInitMessageEvent to check for exceptions and use convert for the MessagePort sequence.
2665
2666         * bindings/js/JSMessagePortCustom.cpp:
2667         (WebCore::extractTransferables):
2668         (WebCore::fillMessagePortArray): Deleted.
2669         * bindings/js/JSMessagePortCustom.h:
2670         (WebCore::handlePostMessage):
2671         Rename fillMessagePortArray to extractTransferables to better express what it does.
2672
2673         * bindings/js/SerializedScriptValue.cpp:
2674         (WebCore::CloneSerializer::serialize):
2675         (WebCore::CloneSerializer::CloneSerializer):
2676         (WebCore::CloneSerializer::fillTransferMap):
2677         (WebCore::CloneSerializer::dumpIfTerminal):
2678         (WebCore::CloneDeserializer::deserialize):
2679         (WebCore::CloneDeserializer::CloneDeserializer):
2680         (WebCore::CloneDeserializer::readTerminal):
2681         (WebCore::SerializedScriptValue::transferArrayBuffers):
2682         (WebCore::SerializedScriptValue::create):
2683         (WebCore::SerializedScriptValue::deserialize):
2684         * bindings/js/SerializedScriptValue.h:
2685         Simplify interface to allow more callers to avoid passing default arguments. Use ExecState& more.
2686         * bindings/scripts/CodeGeneratorJS.pm:
2687         (GetNativeVectorType):
2688         Remove special case for MessagePort.
2689         (JSValueToNative):
2690         (NativeToJSValue):
2691         Updated for new SerializedScriptValue interface.
2692
2693         * dom/MessageEvent.cpp:
2694         (WebCore::MessageEvent::MessageEvent):
2695         (WebCore::MessageEvent::create):
2696         (WebCore::MessageEvent::initMessageEvent):
2697         (WebCore::MessageEvent::trySerializeData):
2698         * dom/MessageEvent.h:
2699         Store the MessagePort sequence as a Vector<RefPtr<MessagePort>> rather than in a unique_ptr.
2700
2701         * dom/MessageEvent.idl:
2702         Update last type in init functions to be sequence<MessagePort> rather than Array. They are still
2703         custom, as we don't quite generate these correctly yet. 
2704
2705         * dom/MessagePort.cpp:
2706         (WebCore::MessagePort::postMessage):
2707         (WebCore::MessagePort::dispatchMessages):
2708         (WebCore::MessagePort::disentanglePorts):
2709         (WebCore::MessagePort::entanglePorts):
2710         * dom/MessagePort.h:
2711         Update interface to take MessagePort vectors by rvalue reference.
2712
2713 2016-10-18  Chris Dumez  <cdumez@apple.com>
2714
2715         [iOS] Drop JSDictionary::convertValue() overload taking a TouchList
2716         https://bugs.webkit.org/show_bug.cgi?id=163620
2717
2718         Reviewed by Sam Weinig.
2719
2720         Drop JSDictionary::convertValue() overload taking a TouchList now that
2721         TouchEvent is using a proper constructor with a TouchEventInit
2722         dictionary on iOS.
2723
2724         * bindings/js/JSDictionary.cpp:
2725
2726 2016-10-18  Dean Jackson  <dino@apple.com>
2727
2728         Remove CSS_SHAPES feature definition. This should always be on.
2729         https://bugs.webkit.org/show_bug.cgi?id=163628
2730         <rdar://problem/28834613>
2731
2732         Reviewed by Tim Horton.
2733
2734         CSS Shapes is in Candidate Recommendation. It's a core part
2735         of CSS. It should always be enabled.
2736
2737         * Configurations/FeatureDefines.xcconfig:
2738         * css/CSSComputedStyleDeclaration.cpp:
2739         (WebCore::shapePropertyValue):
2740         (WebCore::ComputedStyleExtractor::propertyValue):
2741         * css/CSSPropertyNames.in:
2742         * css/CSSValueKeywords.in:
2743         * css/StyleBuilderConverter.h:
2744         (WebCore::StyleBuilderConverter::convertShapeValue):
2745         * css/parser/CSSParser.cpp:
2746         (WebCore::isSimpleLengthPropertyID):
2747         (WebCore::CSSParser::parseValue):
2748         (WebCore::CSSParser::parseShapeProperty):
2749         * css/parser/CSSParser.h:
2750         * inspector/InspectorOverlay.cpp:
2751         (WebCore::buildObjectForShapeOutside):
2752         (WebCore::buildObjectForElementData):
2753         * page/animation/CSSPropertyAnimation.cpp:
2754         (WebCore::blendFunc):
2755         (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
2756         * rendering/FloatingObjects.cpp:
2757         (WebCore::FindNextFloatLogicalBottomAdapter::collectIfNeeded):
2758         (WebCore::ComputeFloatOffsetForLineLayoutAdapter<FloatingObject::FloatLeft>::updateOffsetIfNeeded):
2759         (WebCore::ComputeFloatOffsetForLineLayoutAdapter<FloatingObject::FloatRight>::updateOffsetIfNeeded):
2760         * rendering/RenderBlock.cpp:
2761         * rendering/RenderBlockFlow.cpp:
2762         (WebCore::RenderBlockFlow::positionNewFloats):
2763         * rendering/RenderBox.cpp:
2764         (WebCore::RenderBox::~RenderBox):
2765         (WebCore::RenderBox::styleDidChange):
2766         (WebCore::RenderBox::updateShapeOutsideInfoAfterStyleChange):
2767         (WebCore::isCandidateForOpaquenessTest):
2768         (WebCore::RenderBox::imageChanged):
2769         * rendering/RenderBox.h:
2770         (WebCore::RenderBox::markShapeOutsideDependentsForLayout):
2771         * rendering/RenderElement.cpp:
2772         (WebCore::RenderElement::~RenderElement):
2773         (WebCore::RenderElement::updateShapeImage):
2774         (WebCore::RenderElement::initializeStyle):
2775         (WebCore::RenderElement::setStyle):
2776         * rendering/RenderElement.h:
2777         (WebCore::RenderElement::hasShapeOutside):
2778         * rendering/SimpleLineLayout.cpp:
2779         (WebCore::SimpleLineLayout::canUseForWithReason):
2780         * rendering/line/LineWidth.cpp:
2781         (WebCore::LineWidth::shrinkAvailableWidthForNewFloatIfNeeded):
2782         (WebCore::LineWidth::wrapNextToShapeOutside):
2783         (WebCore::LineWidth::fitBelowFloats):
2784         * rendering/line/LineWidth.h:
2785         * rendering/shapes/ShapeOutsideInfo.cpp:
2786         * rendering/shapes/ShapeOutsideInfo.h:
2787         * rendering/style/RenderStyle.cpp:
2788         (WebCore::RenderStyle::changeRequiresLayout):
2789         (WebCore::RenderStyle::changeRequiresRepaint):
2790         * rendering/style/RenderStyle.h:
2791         (WebCore::RenderStyle::initialShapeImageThreshold):
2792         * rendering/style/ShapeValue.cpp:
2793         * rendering/style/ShapeValue.h:
2794         * rendering/style/StyleRareNonInheritedData.cpp:
2795         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
2796         (WebCore::StyleRareNonInheritedData::operator==):
2797         * rendering/style/StyleRareNonInheritedData.h:
2798         * style/StylePendingResources.cpp:
2799         (WebCore::Style::loadPendingResources):
2800
2801 2016-10-18  Chris Dumez  <cdumez@apple.com>
2802
2803         convertDictionary<>() no longer needs to return an Optional<> type
2804         https://bugs.webkit.org/show_bug.cgi?id=163624
2805
2806         Reviewed by Sam Weinig.
2807
2808         convertDictionary<>() no longer needs to return an Optional<> type now
2809         that our dictionary structures are all default constructible after
2810         <https://trac.webkit.org/changeset/206974>.
2811
2812         * bindings/js/JSDOMConvert.h:
2813         * bindings/scripts/CodeGeneratorJS.pm:
2814         (GenerateDictionaryHeaderContent):
2815         (GenerateDictionaryImplementationContent):
2816         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
2817         (WebCore::convertDictionary<TestEventConstructor::Init>):
2818         * bindings/scripts/test/JS/JSTestEventConstructor.h:
2819         * bindings/scripts/test/JS/JSTestObj.cpp:
2820         (WebCore::convertDictionary<TestObj::Dictionary>):
2821         (WebCore::convertDictionary<TestObj::DictionaryThatShouldNotTolerateNull>):
2822         (WebCore::convertDictionary<TestObj::DictionaryThatShouldTolerateNull>):
2823         (WebCore::convertDictionary<AlternateDictionaryName>):
2824         (WebCore::convertDictionary<TestObj::ParentDictionary>):
2825         (WebCore::convertDictionary<TestObj::ChildDictionary>):
2826         * bindings/scripts/test/JS/JSTestObj.h:
2827         * bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
2828         (WebCore::convertDictionary<DictionaryImplName>):
2829         * bindings/scripts/test/JS/JSTestStandaloneDictionary.h:
2830
2831 2016-10-18  Chris Dumez  <cdumez@apple.com>
2832
2833         Leverage new union type support for HTMLSelectElement.add() / HTMLOptionsCollection.add()
2834         https://bugs.webkit.org/show_bug.cgi?id=163608
2835
2836         Reviewed by Ryosuke Niwa.
2837
2838         Leverage new union type support for HTMLSelectElement.add() / HTMLOptionsCollection.add():
2839         - https://html.spec.whatwg.org/#htmlselectelement
2840         - https://html.spec.whatwg.org/#htmloptionscollection
2841
2842         No new tests, rebaseline existing test.
2843
2844         * bindings/scripts/CodeGeneratorJS.pm:
2845         (GenerateDefaultValue):
2846         (GenerateParametersCheck):
2847         * bindings/scripts/test/JS/JSTestObj.cpp:
2848         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalSequenceIsEmptyCaller):
2849         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
2850         (WebCore::constructJSTestOverloadedConstructorsWithSequence1):
2851         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
2852         (WebCore::jsTestTypedefsPrototypeFunctionFuncCaller):
2853         * html/HTMLOptGroupElement.idl:
2854         * html/HTMLOptionsCollection.cpp:
2855         (WebCore::HTMLOptionsCollection::add):
2856         * html/HTMLOptionsCollection.h:
2857         * html/HTMLOptionsCollection.idl:
2858         * html/HTMLSelectElement.cpp:
2859         (WebCore::HTMLSelectElement::add):
2860         (WebCore::HTMLSelectElement::setOption):
2861         (WebCore::HTMLSelectElement::setLength):
2862         * html/HTMLSelectElement.h:
2863         * html/HTMLSelectElement.idl:
2864
2865 2016-10-18  Aaron Chu  <aaron_chu@apple.com>
2866
2867         Web Inspector: AXI: focused/focusable state should be based on Accessibility Object instead of Element
2868         https://bugs.webkit.org/show_bug.cgi?id=163088
2869         <rdar://problem/16421985>
2870
2871         Reviewed by Darin Adler.
2872
2873         Changed code in InspectDOMAgent so that it determines the focusability of a Node based
2874         on the AccessibilityNodeObject and not the Element class.
2875
2876         Covered by existing tests: 
2877         LayoutTests/inspector/dom/getAccessibilityPropertiesForNode.html
2878
2879         * inspector/InspectorDOMAgent.cpp:
2880         (WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
2881
2882 2016-10-18  Anders Carlsson  <andersca@apple.com>
2883
2884         Get rid of more WebHistoryItem cruft
2885         https://bugs.webkit.org/show_bug.cgi?id=163623
2886
2887         Reviewed by Tim Horton.
2888
2889         * history/HistoryItem.cpp:
2890         (WebCore::HistoryItem::HistoryItem):
2891         * history/HistoryItem.h:
2892         (WebCore::HistoryItem::setViewportArguments):
2893         (WebCore::HistoryItem::bookmarkID): Deleted.
2894         (WebCore::HistoryItem::setBookmarkID): Deleted.
2895         (WebCore::HistoryItem::sharedLinkUniqueIdentifier): Deleted.
2896         (WebCore::HistoryItem::setSharedLinkUniqueIdentifier): Deleted.
2897
2898 2016-10-18  Dave Hyatt  <hyatt@apple.com>
2899
2900         Fix Windows build.
2901  
2902         * css/parser/CSSPropertyParser.cpp:
2903         (WebCore::CSSPropertyParser::parseSingleValue):
2904
2905 2016-10-18  Antoine Quint  <graouts@apple.com>
2906
2907         Modern media controls don't update their rendering correctly
2908         https://bugs.webkit.org/show_bug.cgi?id=163603
2909         <rdar://problem/28826022>
2910
2911         Reviewed by Dean Jackson.
2912
2913         There are rendering issues when we use an absolutely-positioned element
2914         as the top-most element in a media element's shadow root (webkit.org/b/163592).
2915         Since we only need for that element to be positioned, we can use "position: relative"
2916         instead, which removes the rendering issues.
2917
2918         * Modules/modern-media-controls/controls/media-controls.css:
2919         (.media-controls):
2920         (.media-controls,): Deleted.
2921
2922 2016-10-18  Dean Jackson  <dino@apple.com>
2923
2924         Add preliminary support for extended colors to WebCore::Color
2925         https://bugs.webkit.org/show_bug.cgi?id=162878
2926         <rdar://problem/28596413>
2927
2928         Follow-up review comments from Darin Adler.
2929
2930         * html/canvas/CanvasGradient.cpp:
2931         (WebCore::CanvasGradient::addColorStop): Use nullptr.
2932         * platform/graphics/Color.cpp:
2933         (WebCore::Color::Color): Explicitly zero before assigning the pointer.
2934         * platform/graphics/Color.h: Add some comments about the failings of operator== and hash.
2935         (WebCore::Color::Color): Add some static_asserts to the constructors. Move the empty and deleted values
2936         to static constants.
2937         (WebCore::Color::isHashTableDeletedValue):
2938         (WebCore::Color::hash): Replacement for asUint64, which was only being used for a hash.
2939         (WebCore::Color::asUint64): Deleted.
2940         * platform/graphics/ColorHash.h: Use new hash functions. Use "using" instead of typedef.
2941         (WTF::ColorHash::hash):
2942
2943 2016-10-18  Ryosuke Niwa  <rniwa@webkit.org>
2944
2945         REGRESSION (r201471): Keyboard remains visible when swiping back on twitter.com
2946         https://bugs.webkit.org/show_bug.cgi?id=163581
2947         <rdar://problem/27739558>
2948
2949         Reviewed by Simon Fraser.
2950
2951         The bug was caused by Chrome::elementDidBlur not getting called, which resulted in
2952         StopAssistingNode not getting sent to the UI process.
2953
2954         Test: fast/forms/ios/hide-keyboard-on-node-removal.html
2955
2956         * dom/Document.cpp:
2957         (WebCore::Document::setFocusedElement): Restore the behavior prior to r201471 by calling
2958         Chrome::elementDidBlur explicitly.
2959         * html/HTMLTextFormControlElement.cpp:
2960         (WebCore::HTMLTextFormControlElement::dispatchBlurEvent): Added a comment about ordering.
2961
2962 2016-10-17  Anders Carlsson  <andersca@apple.com>
2963
2964         Move some history specific HistoryItem code to WebHistoryItem
2965         https://bugs.webkit.org/show_bug.cgi?id=163567
2966
2967         Reviewed by Tim Horton.
2968
2969         * history/HistoryItem.cpp:
2970         (WebCore::HistoryItem::addRedirectURL): Deleted.
2971         (WebCore::HistoryItem::redirectURLs): Deleted.
2972         (WebCore::HistoryItem::setRedirectURLs): Deleted.
2973         * history/HistoryItem.h:
2974
2975 2016-10-18  Dave Hyatt  <hyatt@apple.com>
2976
2977         [CSS Parser] Get all the properties turned on
2978         https://bugs.webkit.org/show_bug.cgi?id=163605
2979
2980         Reviewed by Dean Jackson.
2981
2982         * WebCore.xcodeproj/project.pbxproj:
2983         * css/CSSFunctionValue.h:
2984         * css/CSSPendingSubstitutionValue.cpp: Added.
2985         (WebCore::CSSPendingSubstitutionValue::customCSSText):
2986         * css/CSSPendingSubstitutionValue.h: Added.
2987         (WebCore::CSSPendingSubstitutionValue::create):
2988         (WebCore::CSSPendingSubstitutionValue::shorthandValue):
2989         (WebCore::CSSPendingSubstitutionValue::shorthandPropertyId):
2990         (WebCore::CSSPendingSubstitutionValue::equals):
2991         (WebCore::CSSPendingSubstitutionValue::CSSPendingSubstitutionValue):
2992         * css/CSSValue.cpp:
2993         (WebCore::CSSValue::cssText):
2994         (WebCore::CSSValue::destroy):
2995         * css/CSSValue.h:
2996         (WebCore::CSSValue::isPendingSubstitutionValue):
2997         * css/CSSValueKeywords.in:
2998         * css/StylePropertyShorthand.cpp:
2999         (WebCore::transitionShorthandForParsing):
3000         * css/StylePropertyShorthand.h:
3001         * css/parser/CSSParser.cpp:
3002         (WebCore::CSSParser::completeURL):
3003         * css/parser/CSSParserImpl.cpp:
3004         (WebCore::CSSParserImpl::parseValue):
3005         (WebCore::CSSParserImpl::consumeDeclaration):
3006         (WebCore::CSSParserImpl::consumeDeclarationValue):
3007         * css/parser/CSSParserMode.h:
3008         (WebCore::CSSParserContext::completeURL):
3009         * css/parser/CSSParserToken.cpp:
3010         (WebCore::CSSParserToken::parseAsCSSPropertyID):
3011         (WebCore::CSSParserToken::parseAsUnresolvedCSSPropertyID): Deleted.
3012         * css/parser/CSSParserToken.h:
3013         * css/parser/CSSPropertyParser.cpp:
3014         (WebCore::cssPropertyID):
3015         (WebCore::CSSPropertyParser::addProperty):
3016         (WebCore::CSSPropertyParser::addExpandedPropertyForValue):
3017         (WebCore::CSSPropertyParser::parseValue):
3018         (WebCore::CSSPropertyParser::parseSingleValue):
3019         (WebCore::CSSPropertyParser::parseValueStart):
3020         (WebCore::CSSPropertyParser::consumeCSSWideKeyword):
3021         (WebCore::consumeTransformOrigin):
3022         (WebCore::consumeWillChange):
3023         (WebCore::consumeFontFeatureTag):
3024         (WebCore::consumeFontFeatureSettings):
3025         (WebCore::consumePage):
3026         (WebCore::consumeQuotes):
3027         (WebCore::FontVariantLigaturesParser::consumeLigature):
3028         (WebCore::FontVariantLigaturesParser::finalizeValue):
3029         (WebCore::consumeFontVariantLigatures):
3030         (WebCore::consumeFontVariantCaps):
3031         (WebCore::FontVariantNumericParser::consumeNumeric):
3032         (WebCore::FontVariantNumericParser::finalizeValue):
3033         (WebCore::consumeFontVariantNumeric):
3034         (WebCore::consumeFontVariantCSS21):
3035         (WebCore::consumeFontVariantList):
3036         (WebCore::consumeFontWeight):
3037         (WebCore::consumeFamilyName):
3038         (WebCore::consumeGenericFamily):
3039         (WebCore::consumeFontFamily):
3040         (WebCore::consumeSpacing):
3041         (WebCore::consumeTabSize):
3042         (WebCore::consumeTextSizeAdjust):
3043         (WebCore::consumeFontSize):
3044         (WebCore::consumeLineHeight):
3045         (WebCore::createPrimitiveValuePair):
3046         (WebCore::consumeCounter):
3047         (WebCore::consumePageSize):
3048         (WebCore::consumeSize):
3049         (WebCore::consumeTextIndent):
3050         (WebCore::validWidthOrHeightKeyword):
3051         (WebCore::consumeMaxWidthOrHeight):
3052         (WebCore::consumeWidthOrHeight):
3053         (WebCore::consumeMarginOrOffset):
3054         (WebCore::consumeClipComponent):
3055         (WebCore::consumeClip):
3056         (WebCore::consumeTouchAction):
3057         (WebCore::consumeLineClamp):
3058         (WebCore::consumeLocale):
3059         (WebCore::consumeColumnWidth):
3060         (WebCore::consumeColumnCount):
3061         (WebCore::consumeColumnGap):
3062         (WebCore::consumeColumnSpan):
3063         (WebCore::consumeZoom):
3064         (WebCore::consumeAnimationIterationCount):
3065         (WebCore::consumeAnimationName):
3066         (WebCore::consumeTransitionProperty):
3067         (WebCore::consumeCubicBezier):
3068         (WebCore::consumeAnimationTimingFunction):
3069         (WebCore::consumeAnimationValue):
3070         (WebCore::isValidAnimationPropertyList):
3071         (WebCore::consumeAnimationPropertyList):
3072         (WebCore::CSSPropertyParser::consumeAnimationShorthand):
3073         (WebCore::consumeZIndex):
3074         (WebCore::parseSingleShadow):
3075         (WebCore::consumeShadow):
3076         (WebCore::consumeFilterFunction):
3077         (WebCore::consumeFilter):
3078         (WebCore::consumeTextDecorationLine):
3079         (WebCore::consumeTextEmphasisStyle):
3080         (WebCore::consumeOutlineColor):
3081         (WebCore::consumeLineWidth):
3082         (WebCore::consumeBorderWidth):
3083         (WebCore::consumeTextStrokeWidth):
3084         (WebCore::consumeColumnRuleWidth):
3085         (WebCore::consumeTranslate3d):
3086         (WebCore::consumeNumbers):
3087         (WebCore::consumePerspective):
3088         (WebCore::consumeTransformValue):
3089         (WebCore::consumeTransform):
3090         (WebCore::consumePositionLonghand):
3091         (WebCore::consumePositionX):
3092         (WebCore::consumePositionY):
3093         (WebCore::consumePaintStroke):
3094         (WebCore::consumePaintOrder):
3095         (WebCore::consumeNoneOrURI):
3096         (WebCore::consumeFlexBasis):
3097         (WebCore::consumeStrokeDasharray):
3098         (WebCore::consumeBaselineShift):
3099         (WebCore::consumeRxOrRy):
3100         (WebCore::consumeCursor):
3101         (WebCore::consumeAttr):
3102         (WebCore::consumeCounterContent):
3103         (WebCore::consumeContent):
3104         (WebCore::consumePositionList):
3105         (WebCore::consumeScrollSnapCoordinate):
3106         (WebCore::consumeScrollSnapPoints):
3107         (WebCore::consumeBorderRadiusCorner):
3108         (WebCore::consumeVerticalAlign):
3109         (WebCore::consumeShapeRadius):
3110         (WebCore::consumeBasicShapeCircle):
3111         (WebCore::consumeBasicShapeEllipse):
3112         (WebCore::consumeBasicShapePolygon):
3113         (WebCore::complete4Sides):
3114         (WebCore::consumeRadii):
3115         (WebCore::consumeBasicShapeInset):
3116         (WebCore::consumeBasicShape):
3117         (WebCore::consumeWebkitClipPath):
3118         (WebCore::consumeShapeOutside):
3119         (WebCore::consumeContentDistributionOverflowPosition):
3120         (WebCore::consumeBorderImageRepeatKeyword):
3121         (WebCore::consumeBorderImageRepeat):
3122         (WebCore::consumeBorderImageSlice):
3123         (WebCore::consumeBorderImageOutset):
3124         (WebCore::consumeBorderImageWidth):
3125         (WebCore::consumeBorderImageComponents):
3126         (WebCore::consumeWebkitBorderImage):
3127         (WebCore::consumeReflect):
3128         (WebCore::consumeImageOrientation):
3129         (WebCore::consumeBackgroundBlendMode):
3130         (WebCore::consumeBackgroundAttachment):
3131         (WebCore::consumeBackgroundBox):
3132         (WebCore::consumeBackgroundComposite):
3133         (WebCore::consumePrefixedBackgroundBox):
3134         (WebCore::consumeBackgroundSize):
3135         (WebCore::consumeGridAutoFlow):
3136         (WebCore::consumeBackgroundComponent):
3137         (WebCore::addBackgroundValue):
3138         (WebCore::consumeCommaSeparatedBackgroundComponent):
3139         (WebCore::consumeSelfPositionKeyword):
3140         (WebCore::consumeSelfPositionOverflowPosition):
3141         (WebCore::consumeAlignItems):
3142         (WebCore::consumeJustifyItems):
3143         (WebCore::consumeFitContent):
3144         (WebCore::consumeCustomIdentForGridLine):
3145         (WebCore::consumeGridLine):
3146         (WebCore::isGridTrackFixedSized):
3147         (WebCore::consumeGridBreadth):
3148         (WebCore::consumeGridTrackSize):
3149         (WebCore::consumeGridLineNames):
3150         (WebCore::consumeGridTrackRepeatFunction):
3151         (WebCore::consumeGridTrackList):
3152         (WebCore::consumeGridTemplatesRowsOrColumns):
3153         (WebCore::consumeGridTemplateAreas):
3154         (WebCore::consumeFontFaceUnicodeRange):
3155         (WebCore::consumeFontFaceSrcURI):
3156         (WebCore::consumeFontFaceSrcLocal):
3157         (WebCore::consumeFontFaceSrc):
3158         (WebCore::CSSPropertyParser::parseFontFaceDescriptor):
3159         (WebCore::CSSPropertyParser::consumeSystemFont):
3160         (WebCore::CSSPropertyParser::consumeFont):
3161         (WebCore::CSSPropertyParser::consumeFontVariantShorthand):
3162         (WebCore::CSSPropertyParser::consumeBorderSpacing):
3163         (WebCore::consumeSingleViewportDescriptor):
3164         (WebCore::CSSPropertyParser::parseViewportDescriptor):
3165         (WebCore::consumeColumnWidthOrCount):
3166         (WebCore::CSSPropertyParser::consumeColumns):
3167         (WebCore::CSSPropertyParser::consumeShorthandGreedily):
3168         (WebCore::CSSPropertyParser::consumeFlex):
3169         (WebCore::CSSPropertyParser::consumeBorder):
3170         (WebCore::CSSPropertyParser::consume4Values):
3171         (WebCore::CSSPropertyParser::consumeBorderImage):
3172         (WebCore::CSSPropertyParser::consumeLegacyBreakProperty):
3173         (WebCore::consumeBackgroundPosition):
3174         (WebCore::consumeRepeatStyleComponent):
3175         (WebCore::consumeRepeatStyle):
3176         (WebCore::CSSPropertyParser::consumeBackgroundShorthand):
3177         (WebCore::CSSPropertyParser::consumeGridItemPositionShorthand):
3178         (WebCore::CSSPropertyParser::consumeGridAreaShorthand):
3179         (WebCore::CSSPropertyParser::consumeGridTemplateRowsAndAreasAndColumns):
3180         (WebCore::CSSPropertyParser::consumeGridTemplateShorthand):
3181         (WebCore::CSSPropertyParser::consumeGridShorthand):
3182         (WebCore::CSSPropertyParser::parseShorthand):
3183         (WebCore::unresolvedCSSPropertyID): Deleted.
3184         * css/parser/CSSPropertyParser.h:
3185         * css/parser/CSSPropertyParserHelpers.cpp:
3186         (WebCore::CSSPropertyParserHelpers::consumeIdent):
3187         (WebCore::CSSPropertyParserHelpers::consumeCustomIdent):
3188         (WebCore::CSSPropertyParserHelpers::consumeString):
3189         (WebCore::CSSPropertyParserHelpers::consumeImageSet):
3190         * css/parser/CSSPropertyParserHelpers.h:
3191
3192 2016-10-18  Brent Fulgham  <bfulgham@apple.com>
3193
3194         Correct Document::removeAllEventListeners
3195         https://bugs.webkit.org/show_bug.cgi?id=163558
3196         <rdar://problem/28716840>
3197
3198         Reviewed by Chris Dumez.
3199
3200         Tested by fast/dom/node-move-to-new-document-crash-main.html.
3201
3202         * dom/Document.cpp:
3203         (WebCore::Document::removeAllEventListeners): Clear out the wheel and
3204         touch event targets when clearing all data.
3205
3206 2016-10-18  Dean Jackson  <dino@apple.com>
3207
3208         Remove dependency cycle with UIKit
3209         https://bugs.webkit.org/show_bug.cgi?id=163577
3210         <rdar://problem/28786160>
3211
3212         Reviewed by Tim Horton.
3213
3214         Soft link against UIKit. Followup patch because
3215         I screwed up and forgot to edit the simulator
3216         configuration.
3217
3218         * Configurations/WebCoreTestSupport.xcconfig:
3219
3220 2016-10-18  Said Abou-Hallawa  <sabouhallawa@apple.com>
3221
3222         SVGCSSParser: m_implicitShorthand value is not reset after adding the shorthand property
3223         https://bugs.webkit.org/show_bug.cgi?id=116470
3224
3225         Reviewed by Simon Fraser.
3226
3227         When we encounter a shorthand css property, we set m_implicitShorthand
3228         to true to tell addProperty() later that the individual properties are
3229         all set through a short hand one. We need to make sure that setting 
3230         m_implicitShorthand to true will not be leaked after finishing parsing
3231         the short hand property.
3232
3233         Test: fast/css/implicit-property-restore.html
3234
3235         * css/parser/CSSParser.cpp:
3236         (WebCore::CSSParser::parseValue):
3237         (WebCore::CSSParser::parseFillShorthand):
3238         (WebCore::CSSParser::parseShorthand):
3239         (WebCore::CSSParser::parse4Values):
3240         (WebCore::CSSParser::parseBorderRadius):
3241         (WTF::ImplicitScope::ImplicitScope): Deleted.
3242         (WTF::ImplicitScope::~ImplicitScope): Deleted.
3243         Get rid of ImplicitScope and replace its calls by TemporaryChange<bool>.
3244         
3245         * css/parser/SVGCSSParser.cpp:
3246         (WebCore::CSSParser::parseSVGValue):
3247         Restore m_implicitShorthand value after setting it temporarily to true.
3248
3249 2016-10-18  Chris Dumez  <cdumez@apple.com>
3250
3251         Update TrackEvent to stop using legacy [ConstructorTemplate=Event]
3252         https://bugs.webkit.org/show_bug.cgi?id=163580
3253
3254         Reviewed by Sam Weinig.
3255
3256         Update TrackEvent to stop using legacy [ConstructorTemplate=Event]
3257         and use a regular constructor as in the specification:
3258         - https://html.spec.whatwg.org/#the-trackevent-interface
3259
3260         No new tests, updated existing tests.
3261
3262         * html/track/TrackEvent.cpp:
3263         (WebCore::TrackEvent::TrackEvent):
3264         * html/track/TrackEvent.h:
3265         * html/track/TrackEvent.idl:
3266
3267 2016-10-18  Commit Queue  <commit-queue@webkit.org>
3268
3269         Unreviewed, rolling out r207409.
3270         https://bugs.webkit.org/show_bug.cgi?id=163602
3271
3272         Introduced many test failures and timeouts, causing release
3273         bot to exit early (Requested by mcatanzaro on #webkit).
3274
3275         Reverted changeset:
3276
3277         "[GTK] Several tests crashing on debug bot in (anonymous
3278         namespace)::MediaPlayerPrivateGStreamerBase::repaint"
3279         https://bugs.webkit.org/show_bug.cgi?id=163511
3280         http://trac.webkit.org/changeset/207409
3281
3282 2016-10-18  Eric Carlson  <eric.carlson@apple.com>
3283
3284         [MediaStream] Resolve constraints and enumerate devices in the UI process
3285         https://bugs.webkit.org/show_bug.cgi?id=162147
3286         <rdar://problem/28803569>
3287
3288         Reviewed by Darin Adler.
3289
3290         Restructure gUM constraint validation and MediaDevices.enumerateDevices so all media device
3291         access happens in the UI process.
3292
3293         No new tests, updated results of existing tests.
3294
3295         * CMakeLists.txt: Add MediaDevicesEnumerationRequest.cpp, delete UserMediaPermissionCheck.cpp.
3296
3297         * Modules/mediastream/MediaConstraintsImpl.cpp:
3298         (WebCore::MediaConstraintsImpl::create): Only create from MediaConstraintsData.
3299         (WebCore::MediaConstraintsImpl::initialize): Deleted.
3300         * Modules/mediastream/MediaConstraintsImpl.h:
3301
3302         * Modules/mediastream/MediaDevicesEnumerationRequest.cpp: Added.
3303         (WebCore::MediaDevicesEnumerationRequest::create):
3304         (WebCore::MediaDevicesEnumerationRequest::MediaDevicesEnumerationRequest):
3305         (WebCore::MediaDevicesEnumerationRequest::~MediaDevicesEnumerationRequest):
3306         (WebCore::MediaDevicesEnumerationRequest::userMediaDocumentOrigin):
3307         (WebCore::MediaDevicesEnumerationRequest::topLevelDocumentOrigin):
3308         (WebCore::MediaDevicesEnumerationRequest::contextDestroyed):
3309         (WebCore::MediaDevicesEnumerationRequest::start):
3310         (WebCore::MediaDevicesEnumerationRequest::cancel):
3311         (WebCore::MediaDevicesEnumerationRequest::setDeviceInfo):
3312         (WebCore::MediaDevicesEnumerationRequest::finish):
3313         * Modules/mediastream/MediaDevicesEnumerationRequest.h: Added.
3314
3315         * Modules/mediastream/MediaDevicesRequest.cpp:
3316         (WebCore::MediaDevicesRequest::~MediaDevicesRequest): Clear the enumeration request.
3317         (WebCore::MediaDevicesRequest::contextDestroyed): Ditto.
3318         (WebCore::MediaDevicesRequest::start): Create and use a MediaDevicesEnumerationRequest.
3319         (WebCore::MediaDevicesRequest::didCompletePermissionCheck): Deleted.
3320         * Modules/mediastream/MediaDevicesRequest.h:
3321
3322         * Modules/mediastream/UserMediaClient.h:
3323         * Modules/mediastream/UserMediaController.h:
3324         (WebCore::UserMediaController::enumerateMediaDevices): New.
3325         (WebCore::UserMediaController::cancelMediaDevicesEnumerationRequest): New.
3326         (WebCore::UserMediaController::checkUserMediaPermission): Deleted.
3327         (WebCore::UserMediaController::cancelUserMediaPermissionCheck): Deleted.
3328
3329         * Modules/mediastream/UserMediaPermissionCheck.h: Deleted.
3330         * Modules/mediastream/UserMediaPermissionCheck.cpp: Deleted.
3331
3332         * Modules/mediastream/UserMediaRequest.cpp:
3333         (WebCore::UserMediaRequest::UserMediaRequest):
3334         (WebCore::UserMediaRequest::start):
3335         (WebCore::UserMediaRequest::allow):
3336         (WebCore::UserMediaRequest::deny):
3337         (WebCore::UserMediaRequest::constraintsValidated): Deleted.
3338         (WebCore::UserMediaRequest::userMediaAccessGranted): Deleted.
3339         (WebCore::UserMediaRequest::userMediaAccessDenied): Deleted.
3340         (WebCore::UserMediaRequest::constraintsInvalid): Deleted.
3341         (WebCore::UserMediaRequest::didCreateStream): Deleted.
3342         (WebCore::UserMediaRequest::failedToCreateStreamWithConstraintsError): Deleted.
3343         (WebCore::UserMediaRequest::failedToCreateStreamWithPermissionError): Deleted.
3344         * Modules/mediastream/UserMediaRequest.h:
3345
3346         * WebCore.xcodeproj/project.pbxproj: Add MediaDevicesEnumerationRequest.*.
3347
3348         * platform/mediastream/CaptureDevice.h:
3349         (WebCore::CaptureDevice::CaptureDevice):
3350         (WebCore::CaptureDevice::setPersistentId): Add setter for argument decoder.
3351         (WebCore::CaptureDevice::setLabel): Ditto.
3352         (WebCore::CaptureDevice::setGroupId): Ditto.
3353         (WebCore::CaptureDevice::setKind): Ditto.
3354
3355         * platform/mediastream/CaptureDeviceManager.h: Remove unnecessary include.
3356
3357         * platform/mediastream/MediaConstraints.h:
3358         (WebCore::MediaConstraint::encode): New.
3359         (WebCore::MediaConstraint::decode): Ditto.
3360         (WebCore::NumericConstraint::encode): Ditto.
3361         (WebCore::NumericConstraint::decode): Ditto.
3362
3363         * platform/mediastream/MediaStreamCreationClient.h: Deleted.
3364
3365         * platform/mediastream/RealtimeMediaSourceCenter.h: Use completion handlers instead of client interface.
3366
3367         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
3368         (WebCore::AVCaptureDeviceManager::refreshCaptureDeviceList): Drive-by fix: don't initialize
3369         group id, we don't support it.
3370
3371         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
3372         (WebCore::RealtimeMediaSourceCenterMac::validateRequestConstraints): Update for interface change.
3373         (WebCore::RealtimeMediaSourceCenterMac::createMediaStream): Ditto.
3374         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.h:
3375
3376         * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp:
3377         (WebCore::RealtimeMediaSourceCenterOwr::validateRequestConstraints): Ditto.
3378         (WebCore::RealtimeMediaSourceCenterOwr::createMediaStream): Ditto.
3379         (WebCore::RealtimeMediaSourceCenterOwr::mediaSourcesAvailable): Ditto.
3380         * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.h:
3381
3382         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
3383         (WebCore::MockRealtimeMediaSourceCenter::validateRequestConstraints): Ditto.
3384         (WebCore::MockRealtimeMediaSourceCenter::createMediaStream): Ditto.
3385         * platform/mock/MockRealtimeMediaSourceCenter.h:
3386
3387 2016-10-18  Zan Dobersek  <zdobersek@igalia.com>
3388
3389         [WebIDL] Support BufferSource
3390         https://bugs.webkit.org/show_bug.cgi?id=163541
3391
3392         Reviewed by Youenn Fablet.
3393
3394         Add support for the BufferSource typedef in WebIDL. The implementation
3395         adds the necessary handling for this type in the generator scripts and
3396         the specialization of the Converter<> template for the IDLBufferSource
3397         struct that enables exposing ArrayBuffer or ArrayBufferView objects by
3398         having WebCore::BufferSource objects pointing to their data.
3399
3400         The SourceBuffer interface in the MSE module has the appendBuffer()
3401         operation modified to accept a BufferSource parameter, instead of
3402         overloading it for ArrayBuffer and ArrayBufferView parameters.
3403
3404         The bindings generator tests cover BufferSource as both an operation
3405         parameter and as a dictionary member.
3406
3407         * Modules/mediasource/SourceBuffer.cpp:
3408         (WebCore::SourceBuffer::appendBuffer):
3409         (WebCore::SourceBuffer::appendBufferInternal):
3410         * Modules/mediasource/SourceBuffer.h:
3411         * Modules/mediasource/SourceBuffer.idl:
3412         * WebCore.xcodeproj/project.pbxproj:
3413         * bindings/generic/IDLTypes.h:
3414         * bindings/js/BufferSource.h: Added.
3415         * bindings/js/JSDOMConvert.h:
3416         (WebCore::Converter<IDLBufferSource>::convert):
3417         * bindings/scripts/CodeGenerator.pm:
3418         (SkipIncludeHeader):
3419         (IsWrapperType):
3420         * bindings/scripts/CodeGeneratorJS.pm:
3421         (AddClassForwardIfNeeded):
3422         (GetBaseIDLType):
3423         (IsHandledByDOMConvert):
3424         * bindings/scripts/test/JS/JSTestObj.cpp:
3425         (WebCore::convertDictionary<TestObj::Dictionary>):
3426         (WebCore::jsTestObjPrototypeFunctionBufferSourceParameter):
3427         (WebCore::jsTestObjPrototypeFunctionBufferSourceParameterCaller):
3428         * bindings/scripts/test/TestObj.idl:
3429
3430 2016-10-18  Javier Fernandez  <jfernandez@igalia.com>
3431
3432         [css-grid] Different width of grid container between initial load and refresh
3433         https://bugs.webkit.org/show_bug.cgi?id=163535
3434
3435         Reviewed by Manuel Rego Casasnovas.
3436
3437         Grid's layout logic manages two different override sizes; one it's
3438         designed to implement the grid item's stretching behavior, identified
3439         with the concept of 'overrideContentLogicalSize'; there is another
3440         override size, known as overrideContainingBlockContentLogicalSize,
3441         used to implement the Grid Area abstraction, which will behave as
3442         the actual containing block of any grid item.
3443
3444         During grid's layout logic these override sizes are set according
3445         to the CSS style rules. This affects how the grid container and its
3446         children are going to be sized during layout. Grid Tracks sizing
3447         algorithm depends on these override sizes.
3448
3449         In order to ensure that the tracks sizing algorithm produces the
3450         same results when it's run consecutively several times, we need to
3451         clear these override sizes and perform a layout of the affected grid
3452         items. Otherwise, the affected items will return sizing values which
3453         depend on the override values set in the previous layout, which in
3454         some cases, like orthogonal flows, may change through different runs
3455         of the sizing algorithm.
3456
3457         Test: fast/css-grid-layout/repeating-layout-must-produce-the-same-results.html
3458
3459         * rendering/RenderGrid.cpp:
3460         (WebCore::RenderGrid::layoutBlock):
3461
3462 2016-10-18  Youenn Fablet  <youenn@apple.com>
3463
3464         CachedResourceLoader should not need to remove fragment identifier
3465         https://bugs.webkit.org/show_bug.cgi?id=163015
3466
3467         Reviewed by Darin Adler.
3468
3469         No expected change for non-window port.
3470         For window port, CachedResourceLoader will strip the fragment identifier of the URL passed to subresourceForURL
3471         before querying the memory cache.
3472
3473         Removing the fragment identifier from the request stored in CachedResourceRequest.
3474         The fragment identifier is stored in a separate field.
3475
3476         This allows CachedResourceLoader to not care about fragment identifier.
3477         CachedResource can then get access to it.
3478
3479         * loader/cache/CachedResource.cpp:
3480         (WebCore::CachedResource::CachedResource):
3481         (WebCore::CachedResource::finishRequestInitialization): Deleted.
3482         * loader/cache/CachedResource.h:
3483         * loader/cache/CachedResourceLoader.cpp:
3484         (WebCore::CachedResourceLoader::cachedResource):
3485         Updated the method taking a const String& to strip the fragment identifier if needed.
3486         Updated the method taking a const URL& to assert if the fragment identifier is present.
3487         (WebCore::CachedResourceLoader::requestUserCSSStyleSheet):
3488         (WebCore::CachedResourceLoader::requestResource):
3489         * loader/cache/CachedResourceRequest.cpp:
3490         (WebCore::CachedResourceRequest::CachedResourceRequest):
3491         (WebCore::CachedResourceRequest::splitFragmentIdentifierFromRequestURL):
3492         * loader/cache/CachedResourceRequest.h:
3493         (WebCore::CachedResourceRequest::releaseFragmentIdentifier):
3494         (WebCore::CachedResourceRequest::clearFragmentIdentifier):
3495         * loader/cache/MemoryCache.cpp:
3496         (WebCore::MemoryCache::shouldRemoveFragmentIdentifier):
3497         (WebCore::MemoryCache::removeFragmentIdentifierIfNeeded):
3498         (WebCore::MemoryCache::revalidationSucceeded):
3499         (WebCore::MemoryCache::resourceForRequest):
3500         * loader/cache/MemoryCache.h:
3501
3502 2016-10-18  Antti Koivisto  <antti@apple.com>
3503
3504         Rename setNeedsStyleRecalc to invalidateStyle
3505         https://bugs.webkit.org/show_bug.cgi?id=163542
3506
3507         Reviewed by Darin Adler.
3508
3509         Also rename StyleChangeType enum and some related functions for clarity. For example
3510
3511             element.setNeedsStyleRecalc(SyntheticStyleChange);
3512
3513         becomes
3514
3515             element.invalidateStyleAndLayerComposition();
3516
3517         * WebCore.xcodeproj/project.pbxproj:
3518         * css/StyleInvalidationAnalysis.cpp:
3519         (WebCore::StyleInvalidationAnalysis::invalidateIfNeeded):
3520         * dom/Document.cpp:
3521         (WebCore::Document::recalcStyle):
3522         (WebCore::Document::updateViewportUnitsOnResize):
3523         (WebCore::Document::setCSSTarget):
3524         (WebCore::unwrapFullScreenRenderer):
3525         (WebCore::Document::setAnimatingFullScreen):
3526         * dom/Element.cpp:
3527         (WebCore::Element::setActive):
3528         (WebCore::Element::setFocus):
3529         (WebCore::Element::setHovered):
3530         (WebCore::Element::attributeChanged):
3531         (WebCore::Element::invalidateStyle):
3532         (WebCore::Element::invalidateStyleAndLayerComposition):
3533         (WebCore::Element::invalidateStyleForSubtree):
3534         (WebCore::Element::invalidateStyleAndRenderersForSubtree):
3535
3536             Move public invalidation functions to Element tightening typing.
3537             Use separate functions instead of enum values.
3538             This way the call sites look nicer and only useful combinations are exposed.
3539
3540         (WebCore::Element::addShadowRoot):
3541         (WebCore::checkForEmptyStyleChange):
3542         (WebCore::checkForSiblingStyleChanges):
3543         (WebCore::Element::needsStyleInvalidation):
3544         (WebCore::Element::setContainsFullScreenElement):
3545         * dom/Element.h:
3546         (WebCore::Element::setHasFocusWithin):
3547         * dom/Node.cpp:
3548         (WebCore::computeEditabilityFromComputedStyle):
3549         (WebCore::Node::adjustStyleValidity):
3550
3551             Update validity and mode separately. There was a potential bug here where
3552             SyntheticStyleChange could overwrite FullStyleChange (no known repro).
3553
3554         (WebCore::Node::updateAncestorsForStyleRecalc):
3555         (WebCore::Node::invalidateStyle):
3556         (WebCore::Node::insertedInto):
3557         (WebCore::Node::setNeedsStyleRecalc): Deleted.
3558         * dom/Node.h:
3559         (WebCore::Node::needsStyleRecalc):
3560         (WebCore::Node::styleValidity):
3561         (WebCore::Node::styleResolutionShouldRecompositeLayer):
3562         (WebCore::Node::setHasValidStyle):
3563         (WebCore::Node::styleChangeType): Deleted.
3564         (WebCore::Node::clearNeedsStyleRecalc): Deleted.
3565         (WebCore::Node::setStyleChange): Deleted.
3566         * dom/RadioButtonGroups.cpp:
3567         (WebCore::RadioButtonGroup::remove):
3568         (WebCore::RadioButtonGroup::setNeedsStyleRecalcForAllButtons):
3569         * dom/ShadowRoot.cpp:
3570         (WebCore::ShadowRoot::setResetStyleInheritance):
3571         * dom/SlotAssignment.cpp:
3572         (WebCore::SlotAssignment::addSlotElementByName):
3573         (WebCore::SlotAssignment::removeSlotElementByName):
3574         (WebCore::SlotAssignment::didChangeSlot):
3575         * dom/StyledElement.cpp:
3576         (WebCore::StyledElement::attributeChanged):
3577         (WebCore::StyledElement::styleAttributeChanged):
3578         (WebCore::StyledElement::invalidateStyleAttribute):
3579         * dom/Text.cpp:
3580         (WebCore::Text::updateRendererAfterContentChange):
3581         * dom/VisitedLinkState.cpp:
3582         (WebCore::VisitedLinkState::invalidateStyleForAllLinks):
3583         (WebCore::VisitedLinkState::invalidateStyleForLink):
3584         * editing/FrameSelection.cpp:
3585         (WebCore::FrameSelection::focusedOrActiveStateChanged):
3586         * html/BaseDateAndTimeInputType.cpp:
3587         (WebCore::BaseDateAndTimeInputType::minOrMaxAttributeChanged):
3588         * html/FileInputType.cpp:
3589         (WebCore::FileInputType::setValue):
3590         * html/HTMLAnchorElement.cpp:
3591         (WebCore::HTMLAnchorElement::parseAttribute):
3592         * html/HTMLBodyElement.cpp:
3593         (WebCore::HTMLBodyElement::parseAttribute):
3594         * html/HTMLCanvasElement.cpp:
3595         (WebCore::HTMLCanvasElement::getContext):
3596         (WebCore::HTMLCanvasElement::createImageBuffer):
3597         * html/HTMLElement.cpp:
3598         (WebCore::HTMLElement::adjustDirectionalityIfNeededAfterChildAttributeChanged):
3599         (WebCore::HTMLElement::calculateAndAdjustDirectionality):
3600         * html/HTMLFieldSetElement.cpp:
3601         (WebCore::HTMLFieldSetElement::addInvalidDescendant):
3602         (WebCore::HTMLFieldSetElement::removeInvalidDescendant):
3603         * html/HTMLFormControlElement.cpp:
3604         (WebCore::HTMLFormControlElement::disabledStateChanged):
3605         (WebCore::HTMLFormControlElement::readOnlyAttributeChanged):
3606         (WebCore::HTMLFormControlElement::requiredAttributeChanged):
3607         (WebCore::HTMLFormControlElement::setNeedsWillValidateCheck):
3608         (WebCore::HTMLFormControlElement::updateValidity):
3609         * html/HTMLFormElement.cpp:
3610         (WebCore::HTMLFormElement::registerFormElement):
3611         (WebCore::HTMLFormElement::registerInvalidAssociatedFormControl):
3612         (WebCore::HTMLFormElement::removeInvalidAssociatedFormControlIfNeeded):
3613         (WebCore::HTMLFormElement::resetDefaultButton):
3614         * html/HTMLFrameElementBase.cpp:
3615         (WebCore::HTMLFrameElementBase::finishedInsertingSubtree):
3616         * html/HTMLFrameOwnerElement.cpp:
3617         (WebCore::HTMLFrameOwnerElement::scheduleinvalidateStyleAndLayerComposition):
3618         (WebCore::HTMLFrameOwnerElement::scheduleSetNeedsStyleRecalc): Deleted.
3619         * html/HTMLFrameOwnerElement.h:
3620         * html/HTMLFrameSetElement.cpp:
3621         (WebCore::HTMLFrameSetElement::parseAttribute):
3622         (WebCore::HTMLFrameSetElement::willRecalcStyle):
3623         * html/HTMLInputElement.cpp:
3624         (WebCore::HTMLInputElement::runPostTypeUpdateTasks):
3625         (WebCore::HTMLInputElement::parseAttribute):
3626         (WebCore::HTMLInputElement::setChecked):
3627         (WebCore::HTMLInputElement::setIndeterminate):
3628         (WebCore::HTMLInputElement::setAutoFilled):
3629         (WebCore::HTMLInputElement::maxLengthAttributeChanged):
3630         (WebCore::HTMLInputElement::minLengthAttributeChanged):
3631         * html/HTMLLinkElement.cpp:
3632         (WebCore::HTMLLinkElement::parseAttribute):
3633         * html/HTMLMediaElement.cpp:
3634         (WebCore::HTMLMediaElement::mediaPlayerRenderingModeChanged):
3635         (WebCore::HTMLMediaElement::setVideoFullscreenLayer):
3636         * html/HTMLObjectElement.cpp:
3637         (WebCore::HTMLObjectElement::parseAttribute):
3638         (WebCore::HTMLObjectElement::childrenChanged):
3639         (WebCore::HTMLObjectElement::renderFallbackContent):
3640         * html/HTMLOptGroupElement.cpp:
3641         (WebCore::HTMLOptGroupElement::parseAttribute):
3642         * html/HTMLOptionElement.cpp:
3643         (WebCore::HTMLOptionElement::parseAttribute):
3644         (WebCore::HTMLOptionElement::setSelectedState):
3645         * html/HTMLPlugInElement.cpp:
3646         (WebCore::HTMLPlugInElement::didAddUserAgentShadowRoot):
3647         * html/HTMLPlugInImageElement.cpp:
3648         (WebCore::HTMLPlugInImageElement::setDisplayState):
3649         (WebCore::HTMLPlugInImageElement::willRecalcStyle):
3650         (WebCore::HTMLPlugInImageElement::finishParsingChildren):
3651         (WebCore::HTMLPlugInImageElement::resumeFromDocumentSuspension):
3652         (WebCore::HTMLPlugInImageElement::removeSnapshotTimerFired):
3653         (WebCore::HTMLPlugInImageElement::restartSnapshottedPlugIn):
3654         * html/HTMLProgressElement.cpp:
3655         (WebCore::HTMLProgressElement::didElementStateChange):
3656         * html/HTMLSelectElement.cpp:
3657         (WebCore::HTMLSelectElement::parseAttribute):
3658         (WebCore::HTMLSelectElement::setRecalcListItems):
3659         (WebCore::HTMLSelectElement::parseMultipleAttribute):
3660         (WebCore::HTMLSelectElement::reset):
3661         * html/HTMLTableElement.cpp:
3662         (WebCore::isTableCellAncestor):
3663         (WebCore::setTableCellsChanged):
3664         (WebCore::HTMLTableElement::parseAttribute):
3665         * html/HTMLTextAreaElement.cpp:
3666         (WebCore::HTMLTextAreaElement::setValueCommon):
3667         * html/HTMLTextFormControlElement.cpp:
3668         (WebCore::HTMLTextFormControlElement::updatePlaceholderVisibility):
3669         * html/InputType.cpp:
3670         (WebCore::InputType::setValue):
3671         * html/NumberInputType.cpp:
3672         (WebCore::NumberInputType::minOrMaxAttributeChanged):
3673         * html/TextFieldInputType.cpp:
3674         (WebCore::TextFieldInputType::subtreeHasChanged):
3675         * mathml/MathMLElement.cpp:
3676         (WebCore::MathMLElement::parseAttribute):
3677         * mathml/MathMLSelectElement.cpp:
3678         (WebCore::MathMLSelectElement::updateSelectedChild):
3679         * page/animation/AnimationBase.cpp:
3680         (WebCore::AnimationBase::setNeedsStyleRecalc):
3681         * page/animation/AnimationController.cpp:
3682         (WebCore::AnimationControllerPrivate::clear):
3683         (WebCore::AnimationControllerPrivate::updateAnimations):
3684         (WebCore::AnimationControllerPrivate::fireEventsAndUpdateStyle):
3685         (WebCore::AnimationControllerPrivate::pauseAnimationAtTime):
3686         (WebCore::AnimationControllerPrivate::pauseTransitionAtTime):
3687         (WebCore::AnimationController::cancelAnimations):
3688         * rendering/RenderImage.cpp:
3689         (WebCore::RenderImage::imageChanged):
3690         * rendering/RenderLayer.cpp:
3691         (WebCore::RenderLayer::calculateClipRects):
3692         * rendering/RenderLayerCompositor.cpp:
3693         (WebCore::RenderLayerCompositor::attachRootLayer):
3694         (WebCore::RenderLayerCompositor::detachRootLayer):
3695         (WebCore::RenderLayerCompositor::notifyIFramesOfCompositingChange):
3696         * rendering/RenderObject.cpp:
3697         (WebCore::RenderObject::updateDragState):
3698         * rendering/svg/SVGResourcesCache.cpp:
3699         (WebCore::SVGResourcesCache::clientStyleChanged):
3700         * style/AttributeChangeInvalidation.cpp:
3701         (WebCore::Style::AttributeChangeInvalidation::invalidateStyle):
3702         * style/ClassChangeInvalidation.cpp:
3703         (WebCore::Style::ClassChangeInvalidation::invalidateStyle):
3704         * style/IdChangeInvalidation.cpp:
3705         (WebCore::Style::IdChangeInvalidation::invalidateStyle):
3706         * style/RenderTreeUpdater.cpp:
3707         (WebCore::RenderTreeUpdater::updateElementRenderer):
3708         * style/StyleScope.cpp:
3709         (WebCore::Style::Scope::updateActiveStyleSheets):
3710         * style/StyleTreeResolver.cpp:
3711         (WebCore::Style::resetStyleForNonRenderedDescendants):
3712         (WebCore::Style::TreeResolver::resolveElement):
3713         (WebCore::Style::TreeResolver::createAnimatedElementUpdate):
3714         (WebCore::Style::TreeResolver::popParent):
3715         (WebCore::Style::clearNeedsStyleResolution):
3716         (WebCore::Style::TreeResolver::resolveComposedTree):
3717         * style/StyleUpdate.h:
3718         * style/StyleValidity.h: Added.
3719
3720             StyleChangeType enum splits into Style::Validity and Style::InvalidationMode.
3721             Move to a file of its own.
3722
3723         * svg/SVGAElement.cpp:
3724         (WebCore::SVGAElement::svgAttributeChanged):
3725         * svg/SVGAnimateElementBase.cpp:
3726         (WebCore::applyCSSPropertyToTarget):
3727         (WebCore::removeCSSPropertyFromTarget):
3728         * svg/SVGElement.cpp:
3729         (WebCore::SVGElement::willRecalcStyle):
3730         * svg/SVGElement.h:
3731         (WebCore::SVGElement::invalidateSVGPresentationAttributeStyle):
3732         * svg/SVGTests.cpp:
3733         (WebCore::SVGTests::handleAttributeChange):
3734         * svg/SVGUseElement.cpp:
3735         (WebCore::SVGUseElement::invalidateShadowTree):
3736         * testing/Internals.cpp:
3737         (WebCore::styleValidityToToString):
3738         (WebCore::Internals::styleChangeType):
3739         (WebCore::styleChangeTypeToString): Deleted.
3740
3741 2016-10-17  Sergio Villar Senin  <svillar@igalia.com>
3742
3743         [css-grid] Constrain by min|max-height on auto repeat computation
3744         https://bugs.webkit.org/show_bug.cgi?id=163540
3745
3746         Reviewed by Darin Adler.
3747
3748         The max-height (if definite) is used to compute the number of auto repeat rows whenever the
3749         height is indefinite. We were using the min-height only in case both values were indefinite.
3750
3751         Although not explicitly mentioned by grid specs, it's reasonable to assume that
3752         the min-height trumps the used value of height/max-height like it always does, per CSS
3753         2.2. Note that the number of rows still needs to fit within that size even if using
3754         min-height, because we're just using min-height to compute the used value of the height
3755         property. If both height and max-height are indefinite we keep doing the same, i.e., compute
3756         the minimum number of rows that fulfill min-height (if definite).
3757
3758         * rendering/RenderGrid.cpp:
3759         (WebCore::RenderGrid::computeAutoRepeatTracksCount):
3760
3761 2016-10-17  Yusuke Suzuki  <utatane.tea@gmail.com>
3762
3763         [DOMJIT] Use NativeCallFrameTracer for operations used for DOMJIT slow calls
3764         https://bugs.webkit.org/show_bug.cgi?id=163586
3765
3766         Reviewed by Saam Barati.
3767
3768         * domjit/JSNodeDOMJIT.cpp:
3769         (WebCore::toWrapperSlow):
3770
3771 2016-10-18  Ryuan Choi  <ryuan.choi@navercorp.com>
3772
3773         [EFL] Build break since r207442
3774         https://bugs.webkit.org/show_bug.cgi?id=163587
3775
3776         Unreviewed.
3777
3778         Since r207442, setRGB is moved to private.
3779
3780         * rendering/RenderThemeEfl.cpp:
3781         (WebCore::fillColorsFromEdjeClass):
3782
3783 2016-10-17  Dean Jackson  <dino@apple.com>
3784
3785         Remove dependency cycle with UIKit
3786         https://bugs.webkit.org/show_bug.cgi?id=163577
3787         <rdar://problem/28786160>
3788
3789         Reviewed by Tim Horton.
3790
3791         Soft link against UIKit.
3792
3793         * Configurations/WebCoreTestSupport.xcconfig:
3794         * testing/Internals.mm:
3795
3796 2016-10-17  Dean Jackson  <dino@apple.com>
3797
3798         Allow creation of ExtendedColors and make Color immutable
3799         https://bugs.webkit.org/show_bug.cgi?id=163557
3800         <rdar://problem/28805360>
3801
3802         Reviewed by Darin Adler and Dave Hyatt.
3803
3804         1. Support the creation of ExtendedColor objects via the
3805         Color class.
3806
3807         2. Fix the remaining few places where a Color object is
3808         modified after creation, instead creating a new Color.
3809         Move all the mutation methods into the private section,
3810         making Color now immutable.
3811
3812         Changes to Color are covered by existing tests. Changes
3813         to ExtendedColor are covered by the ExtendedColor API test.
3814
3815         * css/parser/CSSParser.cpp:
3816         (WebCore::CSSParser::fastParseColor): Return a new named Color.
3817
3818         * dom/Document.cpp:
3819         (WebCore::Document::resetActiveLinkColor): Set to be the named "red" color.
3820
3821         * html/HTMLElement.cpp:
3822         (WebCore::HTMLElement::addHTMLColorToStyle): Use the string-based constructor
3823         where possible.
3824
3825         * page/CaptionUserPreferencesMediaAF.cpp:
3826         (WebCore::CaptionUserPreferencesMediaAF::captionsTextEdgeCSS): No need to
3827         use the string "black" here - we have a constant value.
3828
3829         * platform/graphics/cairo/GraphicsContextCairo.cpp: Don't use setRGB.
3830
3831         * platform/graphics/Color.cpp:
3832         (WebCore::findNamedColor): Move this up in the file.
3833         (WebCore::Color::Color): Copy in the code from setNamedColor. Also
3834         add a constructor for ExtendedColor.
3835         (WebCore::Color::serialized): Call ExtendedColor's serializer if necessary.
3836         (WebCore::Color::cssText): Ditto.
3837         (WebCore::Color::setNamedColor): Deleted.
3838         (WebCore::Color::tagAsExtended): Deleted.
3839
3840         * platform/graphics/Color.h: Add a new constructor.
3841         (WebCore::Color::setRGB): Move to private.
3842
3843         * platform/graphics/ExtendedColor.cpp:
3844         (WebCore::ExtendedColor::cssText): Implement serializer.
3845         * platform/graphics/ExtendedColor.h:
3846
3847         * rendering/style/RenderStyle.cpp:
3848         (WebCore::RenderStyle::colorIncludingFallback): Construct a new Color rather than changing an existing object.
3849
3850 2016-10-17  Simon Fraser  <simon.fraser@apple.com>
3851
3852         Implement DOMRect/DOMRectReadOnly
3853         https://bugs.webkit.org/show_bug.cgi?id=163464
3854
3855         Reviewed by Darin Adler.
3856         
3857         Implement the DOMRectInit/DOMRectReadOnly/DOMRect interfaces specified in
3858         https://dev.w3.org/fxtf/geometry/
3859         
3860         DOMRects allow negative height/width and require double storage, so we can't just
3861         use FloatRect for storage. They also require handling of NaN and Infinity.
3862         
3863         To have the left/right/top/bottom accessors follow IEEE NaN rules, we need to use
3864         custom min/max functions that return NaN if either argument is NaN, so add 
3865         nanPropagatingMin/nanPropagatingMax helpers to MathExtras.h.
3866
3867         Test: fast/dom/domrect.html
3868
3869         * CMakeLists.txt:
3870         * DerivedSources.make:
3871         * WebCore.xcodeproj/project.pbxproj:
3872         * dom/DOMRect.h: Added.
3873         (WebCore::DOMRect::create):
3874         (WebCore::DOMRect::fromRect):
3875         (WebCore::DOMRect::setX):
3876         (WebCore::DOMRect::setY):
3877         (WebCore::DOMRect::setWidth):
3878         (WebCore::DOMRect::setHeight):
3879         (WebCore::DOMRect::DOMRect):
3880         * dom/DOMRect.idl: Added.
3881         * dom/DOMRectInit.h: Added.
3882         * dom/DOMRectInit.idl: Added.
3883         * dom/DOMRectReadOnly.h: Added.
3884         (WebCore::DOMRectReadOnly::create):
3885         (WebCore::DOMRectReadOnly::fromRect):
3886         (WebCore::DOMRectReadOnly::x):
3887         (WebCore::DOMRectReadOnly::y):
3888         (WebCore::DOMRectReadOnly::width):
3889         (WebCore::DOMRectReadOnly::height):
3890         (WebCore::DOMRectReadOnly::top):
3891         (WebCore::DOMRectReadOnly::right):
3892         (WebCore::DOMRectReadOnly::bottom):
3893         (WebCore::DOMRectReadOnly::left):
3894         (WebCore::DOMRectReadOnly::DOMRectReadOnly):
3895         * dom/DOMRectReadOnly.idl: Added.
3896
3897 2016-10-17  Antoine Quint  <graouts@apple.com>
3898
3899         [Modern Media Controls] Basic MediaController
3900         https://bugs.webkit.org/show_bug.cgi?id=163539
3901         <rdar://problem/28797542>
3902
3903         Reviewed by Darin Adler.
3904
3905         We add a new main.js file which acts as the entry point by implementing the createControls()
3906         function that HTMLMediaElement::ensureMediaControlsInjectedScript() once the shadow root has
3907         been created. That functions creates an instance of the new MediaController class, which is
3908         the controller object that will handle communication between the media controls and the media
3909         element. At first, this MediaController class is very limited and assumes macOS inline
3910         layout traits and forces a start button to be shown over the media, which can be played
3911         to start the media and show the full controls. More functionality will be added by future patches.
3912
3913         Tests: media/modern-media-controls/media-controller/media-controller-click-to-start.html
3914                media/modern-media-controls/media-controller/media-controller-constructor.html
3915                media/modern-media-controls/media-controller/media-controller-resize.html
3916
3917         * Modules/modern-media-controls/main.js: Added.
3918         (createControls):
3919         * Modules/modern-media-controls/media/media-controller.js: Added.
3920         (MediaController):
3921         (MediaController.prototype.set pageScaleFactor):
3922         (MediaController.prototype.set usesLTRUserInterfaceLayoutDirection):
3923         (MediaController.prototype.handleEvent):
3924         (MediaController.prototype.buttonWasClicked):
3925         (MediaController.prototype._updateControlsSize):
3926         * WebCore.xcodeproj/project.pbxproj:
3927         * rendering/RenderThemeMac.mm:
3928         (WebCore::RenderThemeMac::mediaControlsStyleSheet):
3929         (WebCore::RenderThemeMac::mediaControlsScript):
3930
3931 2016-10-17  Anders Carlsson  <andersca@apple.com>
3932
3933         Remove an unused HistoryItem function
3934         https://bugs.webkit.org/show_bug.cgi?id=163565
3935
3936         Reviewed by Tim Horton.
3937
3938         * history/HistoryItem.cpp:
3939         (WebCore::HistoryItem::isAncestorOf): Deleted.
3940         * history/HistoryItem.h:
3941
3942 2016-10-17  Nan Wang  <n_wang@apple.com>
3943
3944         AX: [Mac] mapping for output elements
3945         https://bugs.webkit.org/show_bug.cgi?id=163471
3946
3947         Reviewed by Chris Fleizach.
3948
3949         Mapped the output element to status role and exposed its text content
3950         as AXTitle. 
3951
3952         Test: accessibility/mac/output-element.html
3953
3954         * English.lproj/Localizable.strings:
3955         * accessibility/AccessibilityNodeObject.cpp:
3956         (WebCore::AccessibilityNodeObject::visibleText):
3957         * accessibility/AccessibilityObject.cpp:
3958         (WebCore::AccessibilityObject::isOutput):
3959         * accessibility/AccessibilityObject.h:
3960         * accessibility/AccessibilityRenderObject.cpp:
3961         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
3962         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3963         (-[WebAccessibilityObjectWrapper roleDescription]):
3964         * platform/LocalizedStrings.cpp:
3965         (WebCore::AXOutputText):
3966         * platform/LocalizedStrings.h:
3967         * platform/efl/LocalizedStringsEfl.cpp:
3968         (WebCore::AXOutputText):
3969         * platform/gtk/LocalizedStringsGtk.cpp:
3970         (WebCore::AXOutputText):
3971
3972 2016-10-17  Yusuke Suzuki  <utatane.tea@gmail.com>
3973
3974         [DOMJIT] Use DOMJIT::Patchpoint in IC
3975         https://bugs.webkit.org/show_bug.cgi?id=163223
3976
3977         Reviewed by Saam Barati.
3978
3979         Make DOMJITPatchpointParams non-const.
3980
3981         * domjit/DOMJITHelpers.h:
3982         (WebCore::DOMJITHelpers::toWrapper):
3983         * domjit/JSNodeDOMJIT.cpp:
3984         (WebCore::createCallDOMForOffsetAccess):
3985         (WebCore::checkNode):
3986         (WebCore::NodeNodeTypeDOMJIT::callDOM):
3987
3988 2016-10-17  Chris Dumez  <cdumez@apple.com>
3989
3990         Move form.reportValidity() behind InteractiveFormValidation setting
3991         https://bugs.webkit.org/show_bug.cgi?id=163550
3992
3993         Reviewed by Darin Adler.
3994
3995         Move form.reportValidity() behind InteractiveFormValidation setting for consistency
3996         given that the two features are strongly related.
3997
3998         Also enable the setting by default so we can get feedback on the implementation.
3999
4000         Demos:
4001         - Interactive form validation: http://jsfiddle.net/tj_vantoll/HdSqt/
4002         - Report validity: https://googlechrome.github.io/samples/report-validity/
4003
4004         * bindings/generic/RuntimeEnabledFeatures.h:
4005         (WebCore::RuntimeEnabledFeatures::setInteractiveFormValidationEnabled):
4006         (WebCore::RuntimeEnabledFeatures::interactiveFormValidationEnabled):
4007         * html/HTMLButtonElement.idl:
4008         * html/HTMLFieldSetElement.idl:
4009         * html/HTMLFormElement.idl:
4010         * html/HTMLInputElement.idl:
4011         * html/HTMLKeygenElement.idl:
4012         * html/HTMLObjectElement.idl:
4013         * html/HTMLOutputElement.idl:
4014         * html/HTMLSelectElement.idl:
4015         * html/HTMLTextAreaElement.idl:
4016
4017 2016-10-17  Antoine Quint  <graouts@apple.com>
4018
4019         [Modern Media Controls] Add a MediaControlsHost API to retrieve images as base64
4020         https://bugs.webkit.org/show_bug.cgi?id=163502
4021         <rdar://problem/28792017>
4022
4023         Reviewed by Darin Adler.
4024
4025         Add a new `base64StringForIconAndPlatform()` method to MediaControlsHost such that we
4026         may load images from the modern-media-controls directory in the WebCore.framework bundle.
4027         We use this new method in the iconService singleton when a `mediaControlsHost` is set,
4028         which will be set in a later patch.
4029
4030         * Modules/mediacontrols/MediaControlsHost.cpp:
4031         (WebCore::MediaControlsHost::base64StringForIconAndPlatform):
4032         * Modules/mediacontrols/MediaControlsHost.h:
4033         * Modules/mediacontrols/MediaControlsHost.idl:
4034         * Modules/modern-media-controls/controls/icon-service.js:
4035         (const.iconService.new.IconService.prototype.urlForIconNameAndLayoutTraits):
4036         (const.iconService.new.IconService):
4037         * rendering/RenderTheme.h:
4038         (WebCore::RenderTheme::mediaControlsBase64StringForIconAndPlatform):
4039         (WebCore::RenderTheme::mediaControlsScript): Deleted.
4040         * rendering/RenderThemeMac.h:
4041         * rendering/RenderThemeMac.mm:
4042         (WebCore::RenderThemeMac::mediaControlsBase64StringForIconAndPlatform):
4043
4044 2016-10-17  Antoine Quint  <graouts@apple.com>
4045
4046         [Modern Media Controls] Add a MediaControlsHost API to retrieve the shadow root CSS
4047         https://bugs.webkit.org/show_bug.cgi?id=163501
4048         <rdar://problem/28792014>
4049
4050         Reviewed by Darin Adler.
4051
4052         Add a new `shadowRootCSSText` property to MediaControlsHost so that we may obtain the
4053         concatenated CSS sources for the media controls shadow root via JS. Actually using this
4054         API will be done in a later patch. We also no longer inject those styles as a user-agent
4055         stylesheet when the runtime flag is on since it will no longer be necessary.
4056
4057         * Modules/mediacontrols/MediaControlsHost.cpp:
4058         (WebCore::MediaControlsHost::shadowRootCSSText):
4059         * Modules/mediacontrols/MediaControlsHost.h:
4060         * Modules/mediacontrols/MediaControlsHost.idl:
4061         * css/CSSDefaultStyleSheets.cpp:
4062         (WebCore::CSSDefaultStyleSheets::ensureDefaultStyleSheetsForElement):
4063
4064 2016-10-17  Simon Fraser  <simon.fraser@apple.com>
4065
4066         Implement DOMPoint/DOMPointReadOnly
4067         https://bugs.webkit.org/show_bug.cgi?id=133916
4068
4069         Reviewed by Darin Adler.
4070
4071         Patch mostly by Dirk Schultz <krit@webkit.org>.
4072
4073         Implement DOMPoint/DOMPointReadOnly following https://drafts.fxtf.org/geometry/
4074         (although we may need to match https://www.w3.org/TR/geometry-1/ to be compatible
4075         with Chrome).
4076         
4077         Test: geometry/DOMPoint-001.html
4078
4079         * CMakeLists.txt:
4080         * DerivedSources.make:
4081         * WebCore.xcodeproj/project.pbxproj:
4082         * dom/DOMPoint.h: Added.
4083         * dom/DOMPoint.idl: Added.
4084         * dom/DOMPointInit.h: Added.
4085         * dom/DOMPointInit.idl: Added.
4086         * dom/DOMPointReadOnly.h: Added.
4087         (WebCore::DOMPointReadOnly::create):
4088         (WebCore::DOMPointReadOnly::fromPoint):
4089         (WebCore::DOMPointReadOnly::x):
4090         (WebCore::DOMPointReadOnly::y):
4091         (WebCore::DOMPointReadOnly::z):
4092         (WebCore::DOMPointReadOnly::w):
4093         (WebCore::DOMPointReadOnly::DOMPointReadOnly):
4094         * dom/DOMPointReadOnly.idl: Added.
4095
4096 2016-10-17  Antoine Quint  <graouts@apple.com>
4097
4098         [Modern Media Controls] Use modern-media-controls module sources for media controls stylesheet and script injection
4099         https://bugs.webkit.org/show_bug.cgi?id=163500
4100         <rdar://problem/28792010>
4101
4102         Reviewed by Darin Adler.
4103
4104         Add files from the Modules/modern-media-controls directory to the Xcode project and add a copy phase
4105         to copy those files with their directory stucture as a subdirectory of the WebCore.framework Resources
4106         directory.
4107
4108         Additionally, use the modern-media-controls Module CSS and JS files when concatenating the media controls
4109         scripts and styles in RenderTheme when the runtime flag is on.
4110
4111         * WebCore.xcodeproj/project.pbxproj:
4112         * rendering/RenderThemeMac.mm:
4113         (WebCore::RenderThemeMac::mediaControlsStyleSheet):
4114         (WebCore::RenderThemeMac::mediaControlsScript):