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