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