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