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