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