Add support for reportValidity() on form and form control elements
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2016-10-15  Chris Dumez  <cdumez@apple.com>
2
3         Add support for reportValidity() on form and form control elements
4         https://bugs.webkit.org/show_bug.cgi?id=163479
5
6         Reviewed by Darin Adler.
7
8         Add support for reportValidity() on form and form control elements:
9         - https://html.spec.whatwg.org/#dom-form-reportvalidity
10         - https://html.spec.whatwg.org/#dom-cva-reportvalidity
11
12         Firefox and Chrome already support this.
13
14         Demo: https://googlechrome.github.io/samples/report-validity/
15
16         No new tests, rebaselined existing tests.
17
18         * html/HTMLButtonElement.idl:
19         * html/HTMLFieldSetElement.idl:
20         * html/HTMLFormElement.idl:
21         * html/HTMLInputElement.idl:
22         * html/HTMLKeygenElement.idl:
23         * html/HTMLObjectElement.idl:
24         * html/HTMLOutputElement.idl:
25         * html/HTMLSelectElement.idl:
26         * html/HTMLTextAreaElement.idl:
27         Add reportValidity() operation.
28
29         * html/HTMLFormControlElement.cpp:
30         (WebCore::HTMLFormControlElement::checkValidity):
31
32         (WebCore::HTMLFormControlElement::reportValidity):
33         Add implementation for reportValidity() for form control elements.
34         First, it calls checkValidity() and returns early if there is no
35         constraint violation. if the JS canceled the 'invalid' event
36         fired by checkValidity(), then return early as well, as per the
37         specification. If the element is focusable, we scroll to it,
38         focus it and show the validation message. Otherwise, we log a
39         error message to the console. The last part of the behavior
40         matches what we already did in HTMLFormElement::validateInteractively()
41         and complies with the behavior in the specification.
42
43         (WebCore::HTMLFormControlElement::focusAndShowValidationMessage):
44         Add utility function to scroll to the form control element, focus
45         it and show its validation message. This code was moved from
46         HTMLFormElement::validateInteractively() so that it could be reused
47         in HTMLFormControlElement::reportValidity().
48
49         * html/HTMLFormControlElement.h:
50         * html/HTMLFormElement.cpp:
51         (WebCore::HTMLFormElement::validateInteractively):
52         Move the early abort checks to the existing call site (prepareForSubmission)
53         so that we can reuse this method for reportValidity().
54
55         (WebCore::HTMLFormElement::prepareForSubmission):
56         Only call validateInteractively() if we really should validate. Those checks
57         used to be in validateInteractively() but I moved them here so we could more
58         easily reuse validateInteractively().
59
60         (WebCore::HTMLFormElement::checkValidity):
61         (WebCore::HTMLFormElement::checkInvalidControlsAndCollectUnhandled):
62         Update Vector type to be a Vector of HTMLFormControlElement given that we
63         only add HTMLFormControlElement objects to it and that it results it simpler
64         code.
65
66         (WebCore::HTMLFormElement::reportValidity):
67         Add implementation for reportValidity() for form elements. The
68         implementation calls our already existing validateInteractively()
69         method, as per the specification.
70
71         * html/HTMLFormElement.h:
72
73         * html/HTMLObjectElement.h:
74         reportValidity() returns true unconditionally for object elements,
75         similarly to checkValidity().
76
77 2016-10-15  Simon Fraser  <simon.fraser@apple.com>
78
79         Sort the project file.
80
81         * WebCore.xcodeproj/project.pbxproj:
82
83 2016-10-15  Simon Fraser  <simon.fraser@apple.com>
84
85         Implement serializer = { attribute }
86         https://bugs.webkit.org/show_bug.cgi?id=163466
87
88         Reviewed by Darin Adler.
89
90         Fix the code generator to generate code for serializer = { attribute }.
91         In IDLParser, extend domSerializable with flags for the 'inherit', 'getter' and
92         'attribute' values (the first two are still unsupported). Fix parseSerializationPattern()
93         to detect these; it needs to create the domSerializable() now. Basic support
94         for isSerializableAttribute() is added (primitive types only).
95         
96         GenerateSerializerFunction is fixed to output code for the serializable attributes
97         in the order specified in "serializer = {}", as specified in WebIDL.
98         
99         Removed custom serialization for ClientRect and PerformanceTiming.
100         
101         Other minor cleanup to always get $interfaceName from $interface->name, and to fix
102         ObjectConstructor.h to be included as <runtime/ObjectConstructor.h>.
103
104         * CMakeLists.txt:
105         * WebCore.xcodeproj/project.pbxproj:
106         * bindings/js/JSBindingsAllInOne.cpp:
107         * bindings/js/JSClientRectCustom.cpp: Removed.
108         * bindings/js/JSPerformanceTimingCustom.cpp: Removed.
109         * bindings/scripts/CodeGeneratorJS.pm:
110         (GenerateImplementation):
111         (GenerateSerializerFunction):
112         * bindings/scripts/IDLParser.pm:
113         (parseSerializerRest):
114         (parseSerializationPattern):
115         (parseSerializationAttributes):
116         (isSerializableAttribute):
117         (applyMemberList):
118         * bindings/scripts/test/JS/JSTestNode.cpp:
119         * bindings/scripts/test/JS/JSTestObj.cpp:
120         (WebCore::jsTestObjPrototypeFunctionToJSONCaller):
121         * bindings/scripts/test/JS/JSTestSerialization.cpp: Added.
122         * bindings/scripts/test/JS/JSTestSerialization.h: Added.
123         * bindings/scripts/test/TestObj.idl:
124         * bindings/scripts/test/TestSerialization.idl: Copied from Source/WebCore/dom/ClientRect.idl.
125         * dom/ClientRect.idl:
126         * page/PerformanceTiming.idl:
127
128 2016-10-15  Michael Catanzaro  <mcatanzaro@igalia.com>
129
130         [GTK] Restore user agent quirk for Yahoo
131         https://bugs.webkit.org/show_bug.cgi?id=163481
132
133         Reviewed by Carlos Garcia Campos.
134
135         finance.yahoo.com is sending a mobile version in response to our standard user agent.
136
137         * platform/gtk/UserAgentGtk.cpp:
138         (WebCore::urlRequiresMacintoshPlatform):
139
140 2016-10-15  Chris Dumez  <cdumez@apple.com>
141
142         Setting HTMLMediaElement.volume to NaN or Inf should throw a TypeError
143         https://bugs.webkit.org/show_bug.cgi?id=163472
144
145         Reviewed by Sam Weinig.
146
147         Setting HTMLMediaElement.volume to NaN or Inf should throw a TypeError:
148         - https://html.spec.whatwg.org/#dom-media-volume
149
150         This is because the attribute is of type double (not unrestricted double in the IDL).
151
152         Chrome and Firefox agree with the specification. WebKit throws an IndexSizeErr instead.
153
154         No new tests, rebaselined existing test.
155
156         * html/HTMLMediaElement.idl:
157
158 2016-10-15  Zalan Bujtas  <zalan@apple.com>
159
160         CounterNode::resetRenderers is so inefficient.
161         https://bugs.webkit.org/show_bug.cgi?id=163480
162
163         Reviewed by Simon Fraser.
164
165         CounterNode::resetRenderers() removes all the associated renderers from this CounterNode
166         and sets the dirty bit on them.
167         This patch does all that in a loop, instead of traversing the linked tree on each removal.
168
169         No change in functionality.
170
171         * rendering/CounterNode.cpp:
172         (WebCore::CounterNode::CounterNode):
173         (WebCore::CounterNode::~CounterNode):
174         (WebCore::CounterNode::nextInPreOrderAfterChildren):
175         (WebCore::CounterNode::lastDescendant):
176         (WebCore::CounterNode::addRenderer): These assertions do not seem super useful.
177         (WebCore::CounterNode::removeRenderer):
178         (WebCore::CounterNode::resetRenderers):
179         (WebCore::CounterNode::insertAfter):
180         (WebCore::CounterNode::removeChild):
181         * rendering/CounterNode.h:
182         * rendering/RenderCounter.cpp:
183         (WebCore::makeCounterNode):
184         (WebCore::RenderCounter::RenderCounter):
185         (WebCore::RenderCounter::~RenderCounter):
186         (WebCore::RenderCounter::originalText):
187         (WebCore::updateCounters):
188         (WebCore::RenderCounter::invalidate): Deleted.
189         * rendering/RenderCounter.h:
190
191 2016-10-15  Antoine Quint  <graouts@apple.com>
192
193         [Modern Media Controls] macOS inline controls
194         https://bugs.webkit.org/show_bug.cgi?id=163444
195         <rdar://problem/27989473>
196
197         Reviewed by Dean Jackson.
198
199         Introducing the new MacOSMediaControls and MacOSInlineMediaControls classes. MacOSMediaControls is a MediaControls subclass
200         that adds specific buttons to the macOS platform and sets the layout traits to be macOS. This class has a new subclass,
201         MacOSInlineMediaControls, which sets the layout traits to also include inline and implements custom layout to drop
202         controls as necessary as the width of the controls varies. It also shows the volume slider when the mute button is hovered.
203         
204         Tests: media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-buttons-styles.html
205                media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-constructor.html
206                media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-controls-bar-styles.html
207                media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-layout.html
208                media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-time-control-styles.html
209                media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-volume-slider-visibility.html
210                media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-volume-styles.html
211                media/modern-media-controls/macos-inline-media-controls/macos-inline-media-dropping-controls.html
212                media/modern-media-controls/macos-media-controls/macos-media-controls.html
213
214         * Modules/modern-media-controls/controls/macos-inline-media-controls.css: Added.
215         (.media-controls.mac.inline > .controls-bar):
216         (.media-controls.mac.inline > .controls-bar > *):
217         (.media-controls.mac.inline button):
218         (.media-controls.mac.inline button:active):
219         (.media-controls.mac.inline > .controls-bar button):
220         (.media-controls.mac.inline > .controls-bar,):
221         (.media-controls.mac.inline button.play-pause):
222         (.media-controls.mac.inline button.skip-back):
223         (.media-controls.mac.inline .scrubber.slider):
224         (.media-controls.mac.inline button.mute):
225         (.media-controls.mac.inline button.airplay):
226         (.media-controls.mac.inline button.pip):
227         (.media-controls.mac.inline button.tracks):
228         (.media-controls.mac.inline button.fullscreen):
229         (.media-controls.mac.inline .time-label):
230         (.media-controls.mac.inline .volume-slider-container):
231         (.media-controls.mac.inline .volume-slider-container:before):
232         (.media-controls.mac.inline .volume.slider):
233         * Modules/modern-media-controls/controls/macos-inline-media-controls.js: Added.
234         (MacOSInlineMediaControls.prototype.layout):
235         (MacOSInlineMediaControls.prototype.handleEvent):
236         * Modules/modern-media-controls/controls/macos-media-controls.js: Added.
237         (MacOSMediaControls):
238
239 2016-10-14  Antti Koivisto  <antti@apple.com>
240
241         100% CPU on homedepot.com page
242         https://bugs.webkit.org/show_bug.cgi?id=163452
243         <rdar://problem/28730708>
244
245         Reviewed by Simon Fraser.
246
247         The site has a keyframe animation on body. Currently this causes the animation to invalidate the
248         style of the entire document.
249
250         Animations use SyntheticStyleChange to invalidate elements when animation progresses and currently
251         that causes full subtree invalidation. However animation only ever affect individual elements and
252         the normal style resolution mechanism should be able to deal with things like inheritance as needed.
253
254         Test: fast/animation/animation-style-update-size.html
255
256         * dom/Document.cpp:
257         (WebCore::Document::recalcStyle):
258         * dom/Document.h:
259         (WebCore::Document::lastStyleUpdateSizeForTesting):
260
261             Testing support.
262
263         * style/StyleTreeResolver.cpp:
264         (WebCore::Style::TreeResolver::resolveElement):
265
266             Don't force subtree style resolution for SyntheticStyleChange.
267
268         * style/StyleUpdate.h:
269         (WebCore::Style::Update::size):
270         * testing/Internals.cpp:
271         (WebCore::Internals::lastStyleUpdateSize):
272         * testing/Internals.h:
273         * testing/Internals.idl:
274
275 2016-10-14  Chris Dumez  <cdumez@apple.com>
276
277         Setting HTMLMediaElement.muted to the same value should not fire a volume change event
278         https://bugs.webkit.org/show_bug.cgi?id=163474
279
280         Reviewed by Eric Carlson.
281
282         Setting HTMLMediaElement.muted to the same value should not fire a volume
283         change event:
284         - https://html.spec.whatwg.org/#dom-media-muted
285
286         Chrome and Firefox agree with the specification.
287
288         No new tests, rebaselined existing test.
289
290         * html/HTMLMediaElement.cpp:
291         (WebCore::HTMLMediaElement::setMuted):
292
293 2016-10-14  Dean Jackson  <dino@apple.com>
294
295         Add Display P3 ColorSpace
296         https://bugs.webkit.org/show_bug.cgi?id=162880
297         <rdar://problem/28598564>
298
299         Reviewed by Sam Weinig.
300
301         Re-landing with a version that hopefully compiles on El Capitan.
302
303         Add a new ColorSpace for Display P3.
304
305         This will be tested once the Color class can create
306         objects that reference other color spaces.
307
308         * platform/graphics/ColorSpace.h:
309         * platform/graphics/cg/GraphicsContextCG.cpp:
310         (WebCore::displayP3ColorSpaceRef):
311         * platform/graphics/cg/GraphicsContextCG.h:
312         (WebCore::cachedCGColorSpace):
313
314 2016-10-14  Brent Fulgham  <bfulgham@apple.com>
315
316         [Win][Direct2D] Minor cleanups
317         https://bugs.webkit.org/show_bug.cgi?id=162953
318
319         Reviewed by Dean Jackson.
320
321         Code cleanup. No change in behavior.
322
323         * platform/graphics/win/ImageDecoderDirect2D.cpp:
324         (WebCore::ImageDecoder::frameIsCompleteAtIndex):
325         (WebCore::ImageDecoder::frameBytesAtIndex):
326
327 2016-10-14  Alex Christensen  <achristensen@webkit.org>
328
329         Fix CMake build.
330
331         * PlatformMac.cmake:
332
333 2016-10-14  Anders Carlsson  <andersca@apple.com>
334
335         Pass on networking settings to the PKPaymentRequest
336         https://bugs.webkit.org/show_bug.cgi?id=163462
337         rdar://problem/28567629
338
339         Reviewed by Dan Bernstein.
340
341         Add new SPI.
342
343         * platform/spi/cocoa/PassKitSPI.h:
344
345 2016-10-14  Dean Jackson  <dino@apple.com>
346
347         CSS parsing should use Color not RGBA32
348         https://bugs.webkit.org/show_bug.cgi?id=163423
349         <rdar://problem/28766903>
350
351         Reviewed by Simon Fraser.
352
353         Re-landing this after it was rolled out in https://trac.webkit.org/r207342.
354
355         In order to allow CSS to use the ExtendedColor variant of
356         Color, we need to stop using RGBA32. This is a fairly big
357         change that goes through all the places in the parser
358         related to colors, and moves them from RGBA32 to Color.
359
360         No change in functionality, so covered by existing tests.
361
362         * WebCore.xcodeproj/project.pbxproj: Add the new ColorHash.h file.
363
364         * css/CSSPrimitiveValue.cpp: CSSPrimitiveValue now can hold a Color*
365         rather than an unsigned int for colors.
366         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
367         (WebCore::CSSPrimitiveValue::cleanup):
368         (WebCore::CSSPrimitiveValue::getRGBColorValue):
369         (WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText):
370         (WebCore::CSSPrimitiveValue::cloneForCSSOM):
371         (WebCore::CSSPrimitiveValue::equals):
372         * css/CSSPrimitiveValue.h: Move to Color* and also use some
373         nullptrs.
374         * css/CSSPrimitiveValueMappings.h:
375         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Add a new inline
376         constructor.
377
378         * css/CSSValuePool.cpp: Move to Color.
379         (WebCore::CSSValuePool::CSSValuePool):
380         (WebCore::CSSValuePool::createColorValue):
381         * css/CSSValuePool.h: Change the ColorValueCache to a new type.
382
383         * css/StyleResolver.cpp: Move to Color.
384         (WebCore::StyleResolver::colorFromPrimitiveValue):
385         * css/parser/CSSParser.cpp:
386         (WebCore::parseColorValue):
387         (WebCore::CSSParser::parseColor):
388         (WebCore::CSSParser::parseColorFromString):
389         (WebCore::CSSParser::parseSystemColor):
390         (WebCore::fastParseColorInternal):
391         (WebCore::CSSParser::fastParseColor):
392         (WebCore::CSSParser::parseColorFromValue):
393         * css/parser/CSSParser.h:
394         * css/parser/CSSParserFastPaths.cpp:
395         (WebCore::fastParseColorInternal):
396         (WebCore::CSSParserFastPaths::parseColor):
397         * css/parser/CSSPropertyParserHelpers.cpp:
398         (WebCore::CSSPropertyParserHelpers::consumeColor):
399         * css/parser/SVGCSSParser.cpp:
400         (WebCore::CSSParser::parseSVGValue):
401         (WebCore::CSSParser::parseSVGPaint):
402         (WebCore::CSSParser::parseSVGColor):
403         * editing/EditingStyle.cpp:
404         (WebCore::cssValueToColor):
405         (WebCore::textColorFromStyle):
406         (WebCore::backgroundColorFromStyle):
407         (WebCore::rgbaBackgroundColorInEffect):
408         (WebCore::EditingStyle::prepareToApplyAt):
409         (WebCore::isTransparentColorValue):
410         (WebCore::cssValueToRGBA): Deleted.
411         * editing/cocoa/HTMLConverter.mm:
412         (HTMLConverterCaches::colorPropertyValueForNode):
413         * html/HTMLBodyElement.cpp:
414         (WebCore::HTMLBodyElement::parseAttribute):
415         * html/canvas/CanvasGradient.cpp:
416         (WebCore::CanvasGradient::addColorStop):
417         * html/canvas/CanvasRenderingContext2D.cpp: Ditto, but leave a FIXME to
418         remind myself to come back when colorWithOverrideAlpha has been updated.
419         (WebCore::CanvasRenderingContext2D::setStrokeStyle):
420         (WebCore::CanvasRenderingContext2D::setFillStyle):
421         (WebCore::CanvasRenderingContext2D::setShadowColor):
422         (WebCore::CanvasRenderingContext2D::setShadow):
423         * html/canvas/CanvasStyle.cpp:
424         (WebCore::isCurrentColorString):
425         (WebCore::parseColor):
426         (WebCore::currentColor):
427         (WebCore::parseColorOrCurrentColor):
428         (WebCore::CanvasStyle::createFromString):
429         (WebCore::CanvasStyle::createFromStringWithOverrideAlpha):
430         * html/canvas/CanvasStyle.h:
431         * svg/SVGColor.cpp:
432         (WebCore::SVGColor::colorFromRGBColorString):
433
434         * platform/graphics/Color.h: Add new constructors for the special
435         empty and deleted Color values used in HashTables.
436         (WebCore::Color::Color):
437         (WebCore::Color::isHashTableDeletedValue):
438         (WebCore::Color::asUint64): New accessor to get the raw uint64_t value.
439
440         * platform/graphics/ColorHash.h: Added. Implement the traits for a Color HashTable.
441         (WTF::ColorHash::hash):
442         (WTF::ColorHash::equal):
443         (WTF::HashTraits<WebCore::Color>::emptyValue):
444         (WTF::HashTraits<WebCore::Color>::constructDeletedValue):
445         (WTF::HashTraits<WebCore::Color>::isDeletedValue):
446
447 2016-10-14  Brent Fulgham  <bfulgham@apple.com>
448
449         [Win][Direct2D] Implement basic SVG support
450         https://bugs.webkit.org/show_bug.cgi?id=163349
451
452         Reviewed by Brent Fulgham.
453
454         Direct2D needs access to the target graphics context when generating bitmap
455         images so that it can properly match pixel format and other settings.
456
457         Add implementations for a number of drawing primitives used in the SVG
458         test cases. Correct some differences between CG and Direct2D for drawing
459         different primitives.
460
461         No new tests. Tested by existing 'svg' tests.
462
463         * platform/graphics/BitmapImage.cpp:
464        (WebCore::BitmapImage::frameImageAtIndex): Take optional target graphics
465        context. Also pass the graphics context to the image decoder.
466        (WebCore::BitmapImage::nativeImage): Accept an optional target context.
467        (WebCore::BitmapImage::nativeImageForCurrentFrame): Ditto.
468        (WebCore::BitmapImage::draw): Pass target graphics context to the
469        'frameImageAtIndex' method.
470         * platform/graphics/BitmapImage.h:
471         * platform/graphics/Image.h:
472         * platform/graphics/ImageBuffer.cpp:
473         (WebCore::ImageBuffer::create): Moved from header. Add create function that
474         takes an optional GraphicsContext argument.
475         * platform/graphics/ImageBuffer.h:
476         * platform/graphics/ImageFrameCache.cpp: Add missing include needed to build
477         under Direct2D.
478         * platform/graphics/ImageSource.cpp:
479         (WebCore::ImageSource::setDecoderTargetContext): Added.
480         (WebCore::ImageSource::setRenderTarget): Deleted.
481         * platform/graphics/ImageSource.h:
482         * platform/graphics/Pattern.h:
483         * platform/graphics/win/GraphicsContextDirect2D.cpp:
484         (WebCore::GraphicsContextPlatformPrivate::endDraw): Log error state instead of crashing
485         each time.
486         (WebCore::GraphicsContext::drawEllipse): Ellipses are defined in D2D as a center, an
487         X-radius, and a Y-radius.
488         (WebCore::GraphicsContext::applyStrokePattern):
489         (WebCore::GraphicsContext::applyFillPattern):
490         (WebCore::GraphicsContext::clearRect): Use 'Clear' function if possible. Don't clear
491         anything if the clear rect is outside the drawing area.
492         (WebCore::GraphicsContext::strokeRect): Provide implementation (needed by SVG).
493         (WebCore::GraphicsContext::platformFillEllipse): Ellipses are defined in D2D as
494         a center, an X-radius, and a Y-radius.
495         (WebCore::GraphicsContext::platformStrokeEllipse): Ditto.
496         * platform/graphics/win/ImageBufferDirect2D.cpp:
497         (WebCore::ImageBuffer::createCompatibleBuffer): Accept optional GraphicsContext argument.
498         (WebCore::ImageBuffer::ImageBuffer): Ditto.
499         * platform/graphics/win/ImageDecoderDirect2D.cpp:
500         (WebCore::ImageDecoder::setTargetContext): Renamed from 'setRenderTarget'.
501         (WebCore::ImageDecoder::createFrameImageAtIndex): Take optional GraphicsContext argument.
502         (WebCore::ImageDecoder::setRenderTarget): Deleted.
503         * platform/graphics/win/ImageDecoderDirect2D.h:
504         * platform/graphics/win/ImageDirect2D.cpp:
505         (WebCore::BitmapImage::setRenderTarget): Deleted.
506         * platform/graphics/win/NativeImageDirect2D.cpp: Add missing include.
507         * platform/graphics/win/PatternDirect2D.cpp: 
508         (WebCore::Pattern::createPlatformPattern): Revise for new signature.
509         * rendering/FilterEffectRenderer.cpp:
510         (WebCore::FilterEffectRenderer::allocateBackingStoreIfNeeded): Pass GraphicsContext
511         to ImageBuffer constructor.
512         (WebCore::FilterEffectRendererHelper::beginFilterEffect): Pass target context to
513         filter when allocating backing store.
514         * rendering/FilterEffectRenderer.h: Add GraphicsContext as argument to constructor.
515         * rendering/RenderLayer.cpp:
516         (WebCore::RenderLayer::hasFilterThatIsPainting): Supply GraphicsContext argument when
517         building new FilterEffectRenderer and helper.
518         (WebCore::RenderLayer::setupFilters): Ditto.
519         * svg/graphics/SVGImage.cpp:
520         (WebCore::SVGImage::nativeImageForCurrentFrame): Revise to take optional GraphicsContext
521         argument.
522         (WebCore::SVGImage::nativeImage): Ditto.
523         * svg/graphics/SVGImage.h:
524         * svg/graphics/SVGImageForContainer.cpp:
525         (WebCore::SVGImageForContainer::nativeImageForCurrentFrame): Ditto.
526         * svg/graphics/SVGImageForContainer.h:
527
528 2016-10-14  Chris Dumez  <cdumez@apple.com>
529
530         Unreviewed, rolling out r207319.
531
532         Regressed Dromaeo and may have caused crashes under
533         GuardMalloc (rdar://problem/28780835)
534
535         Reverted changeset:
536
537         "[Web IDL] Add support for [SameObject] extended attribute"
538         https://bugs.webkit.org/show_bug.cgi?id=163414
539         http://trac.webkit.org/changeset/207319
540
541 2016-10-14  Anders Carlsson  <andersca@apple.com>
542
543         Clean up BackForwardClient
544         https://bugs.webkit.org/show_bug.cgi?id=163454
545
546         Reviewed by Sam Weinig.
547
548         Remove iOS specific member functions that are only used from WebKit.
549
550         * history/BackForwardClient.h:
551         * loader/EmptyClients.cpp:
552
553 2016-10-13  Anders Carlsson  <andersca@apple.com>
554
555         Move BackForwardList from WebCore to WebKitLegacy
556         https://bugs.webkit.org/show_bug.cgi?id=163418
557
558         Reviewed by Tim Horton.
559
560         * CMakeLists.txt:
561         * WebCore.xcodeproj/project.pbxproj:
562         * history/BackForwardController.cpp:
563         (WebCore::BackForwardController::BackForwardController):
564         * history/BackForwardController.h:
565         * loader/EmptyClients.cpp:
566         (WebCore::fillWithEmptyClients):
567         * page/Page.cpp:
568         (WebCore::Page::Page):
569
570 2016-10-14  Manuel Rego Casasnovas  <rego@igalia.com>
571
572         [css-grid] Changing the argument on fit-content() doesn't cause the grid to be relayout
573         https://bugs.webkit.org/show_bug.cgi?id=163434
574
575         Reviewed by Sergio Villar Senin.
576
577         When fit-content() was implemented a new attribute
578         m_fitContentTrackBreadth was added to GridTrackSize.
579         However we forgot to include it in the == operator implementation,
580         so we were missing the changes on that value.
581
582         Now if you change the argument of a fit-content() track,
583         the track size is properly recomputed.
584
585         Test: fast/css-grid-layout/grid-change-fit-content-argument.html
586
587         * rendering/style/GridTrackSize.h:
588         (WebCore::GridTrackSize::operator==): Check m_fitContentTrackBreadth.
589
590 2016-10-14  Commit Queue  <commit-queue@webkit.org>
591
592         Unreviewed, rolling out r207317.
593         https://bugs.webkit.org/show_bug.cgi?id=163448
594
595         This change caused an existing LayoutTest to fail on all
596         platforms (Requested by ryanhaddad on #webkit).
597
598         Reverted changeset:
599
600         "CSS parsing should use Color not RGBA32"
601         https://bugs.webkit.org/show_bug.cgi?id=163423
602         http://trac.webkit.org/changeset/207317
603
604 2016-10-14  Antti Koivisto  <antti@apple.com>
605
606         Share inline stylesheets between shadow trees
607         https://bugs.webkit.org/show_bug.cgi?id=163353
608
609         Reviewed by Ryosuke Niwa and Andreas Kling.
610
611         If shadow trees have identical inline stylesheets the data structures can be shared.
612         In future this will also allow sharing style resolvers.
613
614         * css/CSSStyleSheet.cpp:
615         (WebCore::CSSStyleSheet::createInline):
616
617             Move StyleSheetContents construction to the client.
618
619         * css/parser/CSSParserMode.h:
620         (WebCore::CSSParserContextHash::hash):
621         (WebCore::CSSParserContextHash::equal):
622         (WTF::HashTraits<WebCore::CSSParserContext>::constructDeletedValue):
623         (WTF::HashTraits<WebCore::CSSParserContext>::isDeletedValue):
624         (WTF::HashTraits<WebCore::CSSParserContext>::emptyValue):
625
626             Make CSSParserContext hashable.
627
628         * dom/ExtensionStyleSheets.cpp:
629         (WebCore::createExtensionsStyleSheet):
630         (WebCore::ExtensionStyleSheets::pageUserSheet):
631         (WebCore::ExtensionStyleSheets::updateInjectedStyleSheetCache):
632
633             Don't use CSSStyleSheet::createInline, these are not really inline stylesheets.
634             Code cleanups.
635
636         * dom/InlineStyleSheetOwner.cpp:
637         (WebCore::parserContextForForElement):
638         (WebCore::makeInlineStyleSheetCacheKey):
639         (WebCore::inlineStyleSheetCache):
640
641             Implement a simple cache for sharing stylesheets with identical text and context.
642
643         (WebCore::InlineStyleSheetOwner::createSheet):
644         (WebCore::InlineStyleSheetOwner::clearCache):
645         * dom/InlineStyleSheetOwner.h:
646         * platform/MemoryPressureHandler.cpp:
647         (WebCore::MemoryPressureHandler::releaseNoncriticalMemory):
648
649 2016-10-14  Chris Dumez  <cdumez@apple.com>
650
651         [Mac] Allow throttling of background tabs that have media elements with no audible audio
652         https://bugs.webkit.org/show_bug.cgi?id=163402
653         <rdar://problem/28056151>
654
655         Reviewed by Gavin Barraclough.
656
657         Allow throttling of background tabs that have media elements with no audible audio.
658         We were taking an media assertion from the PageThrottler as soon as there was a
659         media element playing on the page. This prevented throttling of background tabs
660         even if those media elements had no audible audio, which was unfortunate.
661
662         We now have more fine-grained rules for when HTMLMediaElement should take an
663         assertion. I also added release logging to help debug such issues in the
664         future.
665
666         * html/HTMLMediaElement.cpp:
667         (WebCore::HTMLMediaElement::setMuted):
668         (WebCore::HTMLMediaElement::updateVolume):
669         (WebCore::HTMLMediaElement::updatePlayState):
670         (WebCore::HTMLMediaElement::updateAudioAssertionState):
671         (WebCore::HTMLMediaElement::effectiveMuted): Deleted.
672         * html/HTMLMediaElement.h:
673
674 2016-10-14  Romain Bellessort  <romain.bellessort@crf.canon.fr>
675
676         [Readable Streams API] Cleanup patch, fix small inconsistencies
677         https://bugs.webkit.org/show_bug.cgi?id=163329
678
679         Reviewed by Youenn Fablet.
680
681         Cleanup patch, fixed 3 small inconsistences between implementation and spec.
682
683         No change in behaviour.
684
685         * Modules/streams/ReadableStream.idl: Added optional parameter in getReader.
686         * Modules/streams/ReadableStreamDefaultController.js:
687         (error): Call readableStreamDefaultControllerError instead of readableStreamError.
688         * Modules/streams/ReadableStreamInternals.js: Added missing ASSERT in readableStreamDefaultControllerCallPullIfNeeded.
689
690 2016-10-14  Youenn Fablet  <youenn@apple.com>
691
692         http://trac.webkit.org/changeset/207330 broke Mac Windows build
693         https://bugs.webkit.org/show_bug.cgi?id=163442
694
695         Unreviewed.
696
697         * platform/network/cf/ResourceRequestCFNet.cpp:
698         (WebCore::toPlatformRequestCachePolicy): Do not explicitly use CFURLRequestCachePolicy enumeration values.
699
700 2016-10-14  Zan Dobersek  <zdobersek@igalia.com>
701
702         [Cairo] GraphicsContext3D::ImageExtractor fails to extract images
703         https://bugs.webkit.org/show_bug.cgi?id=163439
704
705         Reviewed by Carlos Garcia Campos.
706
707         In the Cairo implementation of GraphicsContext3D::ImageExtractor,
708         don't check for frame completeness at index 0. This information
709         is now cached only after the frame for that index is decoded and
710         marked as completed, which is done after this check.
711
712         Becuase of this the current check forces extractImage() to return
713         early and abort WebGL texture uploads from image sources.
714
715         This bug was most likely exposed after the refactoring in r206481.
716         https://trac.webkit.org/changeset/206481
717
718         * platform/graphics/cairo/GraphicsContext3DCairo.cpp:
719         (WebCore::GraphicsContext3D::ImageExtractor::extractImage):
720
721 2016-10-14  Youenn Fablet  <youenn@apple.com>
722
723         MediaResourceLoader should use CachedResource::ressourceError to do CORS checks
724         https://bugs.webkit.org/show_bug.cgi?id=163279
725
726         Reviewed by Darin Adler.
727
728         Covered by existing tests.
729
730         * loader/MediaResourceLoader.cpp:
731         (WebCore::MediaResource::responseReceived): Making use of CachedResource::ressourceError to detect CORS failures.
732         * loader/cache/CachedResourceLoader.cpp:
733         (WebCore::CachedResourceLoader::shouldUpdateCachedResourceWithCurrentRequest): Activating loader options checks
734         before reusing the resource.
735         (WebCore::isResourceSuitableForDirectReuse): Disabling direct reuse of MediaResource since reuse of raw
736         resources does not work yet for media resources.
737
738 2016-10-14  Youenn Fablet  <youenn@apple.com>
739
740         Make NetworkCache aware of fetch cache mode
741         https://bugs.webkit.org/show_bug.cgi?id=163332
742
743         Reviewed by Antti Koivisto.
744
745         Tests: imported/w3c/web-platform-tests/fetch/api/request/request-cache-default-conditional.html
746                imported/w3c/web-platform-tests/fetch/api/request/request-cache-default.html
747                imported/w3c/web-platform-tests/fetch/api/request/request-cache-force-cache.html
748                imported/w3c/web-platform-tests/fetch/api/request/request-cache-no-cache.html
749                imported/w3c/web-platform-tests/fetch/api/request/request-cache-no-store.html
750                imported/w3c/web-platform-tests/fetch/api/request/request-cache-only-if-cached.html
751                imported/w3c/web-platform-tests/fetch/api/request/request-cache-reload.html
752
753         * loader/cache/CachedResourceLoader.cpp:
754         (WebCore::updateRequestAccordingCacheMode): Setting request cache policy according cache mode.
755         Basically, these two are about the same.
756         (WebCore::CachedResourceLoader::determineRevalidationPolicy): Making use of cache policy instead of cache mode.
757         * platform/network/ResourceRequestBase.h: Adding new cache policies, aligned with fetch cache modes.
758         * platform/network/cf/ResourceRequestCFNet.cpp:
759         (WebCore::toPlatformRequestCachePolicy): If policy is not supported by CFNetwork, fallback to ReloadIgnoringCacheData.
760         This is the best approximate we might find.
761         (WebCore::ResourceRequest::doUpdatePlatformHTTPBody):
762         (WebCore::ResourceRequest::doUpdateResourceRequest): Only updating cache policy, if cache policy is the default.
763         * platform/network/cf/ResourceRequestCFNet.h:
764         * platform/network/cocoa/ResourceRequestCocoa.mm: Doing the same modifications as for ResourceRequestCFNet.
765         (WebCore::ResourceRequest::doUpdateResourceRequest):
766         (WebCore::toPlatformRequestCachePolicy):
767         (WebCore::ResourceRequest::doUpdatePlatformRequest):
768
769 2016-10-13  Youenn Fablet  <youenn@apple.com>
770
771         Binding generated code for private operations should assert for casted-this checks
772         https://bugs.webkit.org/show_bug.cgi?id=163326
773
774         Reviewed by Darin Adler.
775
776         Covered by existing tests.
777
778         Private operations are not exposed to user scripts and are only called by built-in scripts or other WebKit-controlled code.
779         The call sites already ensure that the caller is of the right type so there is no need to do that work twice.
780
781         Introducing a casted-this-error Assert mode for casted-this checks, which may be reused for other binding generated code.
782         Updated binding generator to use that mode for private operations.
783
784         * bindings/js/JSDOMBinding.h:
785         (WebCore::BindingCaller::callPromiseOperation):
786         (WebCore::BindingCaller::callOperation):
787         * bindings/scripts/CodeGeneratorJS.pm:
788         (GenerateImplementation):
789         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
790         (WebCore::jsTestGlobalObjectInstanceFunctionTestPrivateFunction):
791         * bindings/scripts/test/JS/JSTestObj.cpp:
792         (WebCore::jsTestObjPrototypeFunctionPrivateMethod):
793
794 2016-10-13  Carlos Garcia Campos  <cgarcia@igalia.com>
795
796         WebView and WebPage URLs not updated after URL is modified by InjectedBundlePageResourceLoadClient::willSendRequestForFrame
797         https://bugs.webkit.org/show_bug.cgi?id=146306
798
799         Reviewed by Darin Adler.
800
801         Notify about the provisional URL change when new request set for main resource load in DocumentLoader has a
802         different URL than the previous one.
803
804         * loader/DocumentLoader.cpp:
805         (WebCore::DocumentLoader::setRequest):
806
807 2016-10-13  Youenn Fablet  <youenn@apple.com>
808
809         Update serializer and iterator binding generated code
810         https://bugs.webkit.org/show_bug.cgi?id=163325
811
812         Reviewed by Darin Adler.
813
814         No change of behavior.
815         Covered by existing tests and rebased binding generated code.
816
817         Making use of BindingCaller::callOperation within serializer and iterator operations.
818         Refactored serializer code to use direct attribute getters.
819
820         * bindings/js/JSDOMIterator.h:
821         (WebCore::iteratorCreate):
822         (WebCore::iteratorForEach):
823         * bindings/scripts/CodeGeneratorJS.pm:
824         (GenerateSerializerFunction):
825         (GenerateImplementationIterableFunctions):
826         * bindings/scripts/test/JS/JSTestIterable.cpp:
827         (WebCore::jsTestIterablePrototypeFunctionSymbolIteratorCaller):
828         (WebCore::jsTestIterablePrototypeFunctionSymbolIterator):
829         (WebCore::jsTestIterablePrototypeFunctionEntriesCaller):
830         (WebCore::jsTestIterablePrototypeFunctionEntries):
831         (WebCore::jsTestIterablePrototypeFunctionKeysCaller):
832         (WebCore::jsTestIterablePrototypeFunctionKeys):
833         (WebCore::jsTestIterablePrototypeFunctionValuesCaller):
834         (WebCore::jsTestIterablePrototypeFunctionValues):
835         (WebCore::jsTestIterablePrototypeFunctionForEachCaller):
836         (WebCore::jsTestIterablePrototypeFunctionForEach):
837         * bindings/scripts/test/JS/JSTestNode.cpp:
838         (WebCore::jsTestNodePrototypeFunctionSymbolIteratorCaller):
839         (WebCore::jsTestNodePrototypeFunctionSymbolIterator):
840         (WebCore::jsTestNodePrototypeFunctionEntriesCaller):
841         (WebCore::jsTestNodePrototypeFunctionEntries):
842         (WebCore::jsTestNodePrototypeFunctionKeysCaller):
843         (WebCore::jsTestNodePrototypeFunctionKeys):
844         (WebCore::jsTestNodePrototypeFunctionValuesCaller):
845         (WebCore::jsTestNodePrototypeFunctionValues):
846         (WebCore::jsTestNodePrototypeFunctionForEachCaller):
847         (WebCore::jsTestNodePrototypeFunctionForEach):
848         (WebCore::jsTestNodePrototypeFunctionToJSON):
849         * bindings/scripts/test/JS/JSTestObj.cpp:
850         (WebCore::jsTestObjPrototypeFunctionToJSON):
851
852 2016-10-13  Alex Christensen  <achristensen@webkit.org>
853
854         Fix API test after r207318.
855         https://bugs.webkit.org/show_bug.cgi?id=162951
856
857         This fixes the API test WebKit2.PendingAPIRequestURL which asserted when trying to hash a null String.
858
859         * loader/DocumentLoader.cpp:
860         (WebCore::isRemoteWebArchive):
861         If the mimeType is a null String, it is not in the set webArchiveMIMETypes, so return false instead of hashing it.
862
863 2016-10-13  Alex Christensen  <achristensen@webkit.org>
864
865         Hosts of URLs with non-special schemes should be case-sensitive, and non-ASCII characters in such hosts should be punycode-encoded
866         https://bugs.webkit.org/show_bug.cgi?id=163413
867
868         Reviewed by Tim Horton.
869
870         This retains compatibility with the canonicalization Chrome, Firefox, and Safari with uppercase characters
871         in the hosts of URLs with unrecognized schemes.  Safari treats such characters as the host, while Firefox
872         and Chrome treat such characters as part of the path, starting with the "//" after the ':'
873         Behavior of non-ASCII characters is inconsistent, and since we need to have a host, we should punycode-encode
874         the host to be consistent with special schemes because percent-encoding hosts sometimes is inconsistent.
875         
876         This solution was proposed to the spec in https://github.com/whatwg/url/issues/148
877
878         Covered by updated API and layout tests.
879
880         * platform/URLParser.cpp:
881         (WebCore::URLParser::parse):
882         (WebCore::URLParser::percentDecode):
883         (WebCore::URLParser::domainToASCII):
884         (WebCore::URLParser::hasInvalidDomainCharacter):
885         (WebCore::URLParser::parseHostAndPort):
886         (WebCore::URLParser::formURLDecode):
887         (WebCore::percentDecode): Deleted.
888         (WebCore::domainToASCII): Deleted.
889         (WebCore::hasInvalidDomainCharacter): Deleted.
890         (WebCore::formURLDecode): Deleted.
891         * platform/URLParser.h:
892
893 2016-10-13  Chris Dumez  <cdumez@apple.com>
894
895         [Web IDL] Add support for [SameObject] extended attribute
896         https://bugs.webkit.org/show_bug.cgi?id=163414
897
898         Reviewed by Darin Adler.
899
900         Add support for [SameObject] Web IDL extended attribute:
901         - https://heycam.github.io/webidl/#SameObject
902
903         Start using it on DOM / HTML attributes where the specification
904         mandates it.
905
906         Test: js/dom/SameObject-support.html
907
908         * bindings/scripts/CodeGeneratorJS.pm:
909         (ShouldCacheAttribute):
910         (GenerateHeader):
911         (GenerateImplementation):
912         * bindings/scripts/IDLAttributes.txt:
913         * dom/DataTransfer.idl:
914         * dom/Document.idl:
915         * dom/Element.idl:
916         * dom/MutationRecord.idl:
917         * dom/Node.idl:
918         * dom/NodeIterator.idl:
919         * dom/ParentNode.idl:
920         * dom/TreeWalker.idl:
921         * html/HTMLAnchorElement.idl:
922         * html/HTMLAreaElement.idl:
923         * html/HTMLButtonElement.idl:
924         * html/HTMLDataListElement.idl:
925         * html/HTMLDocument.idl:
926         * html/HTMLElement.idl:
927         * html/HTMLFieldSetElement.idl:
928         * html/HTMLFormElement.idl:
929         * html/HTMLIFrameElement.idl:
930         * html/HTMLInputElement.idl:
931         * html/HTMLKeygenElement.idl:
932         * html/HTMLLinkElement.idl:
933         * html/HTMLMapElement.idl:
934         * html/HTMLMediaElement.idl:
935         * html/HTMLMeterElement.idl:
936         * html/HTMLOutputElement.idl:
937         * html/HTMLProgressElement.idl:
938         * html/HTMLSelectElement.idl:
939         * html/HTMLTableElement.idl:
940         * html/HTMLTableRowElement.idl:
941         * html/HTMLTableSectionElement.idl:
942         * html/HTMLTextAreaElement.idl:
943         * page/Location.idl:
944         * page/Navigator.idl:
945
946 2016-10-13  Andy Estes  <aestes@apple.com>
947
948         [iOS] Support Web Archive previews generated by QuickLook
949         https://bugs.webkit.org/show_bug.cgi?id=162951
950         <rdar://problem/28607920>
951
952         Reviewed by Brady Eidson.
953
954         QuickLook might generate a Web Archive preview for some resource types, but WebKit would
955         refuse to load it due to the prohibition on loading remote Web Archives. Even though the
956         original resource might be from a remote origin, the QuickLook-generated preview is a
957         trusted local resource, so allow it to be loaded.
958
959         No test possible.
960
961         * loader/DocumentLoader.cpp:
962         (WebCore::isRemoteWebArchive): Added. Moved the remote web archive check from
963         continueAfterContentPolicy() to here, and added a check for responses containing the
964         QuickLook preview protocol.
965         (WebCore::DocumentLoader::continueAfterContentPolicy): Called isRemoteWebArchive().
966
967 2016-10-13  Dean Jackson  <dino@apple.com>
968
969         CSS parsing should use Color not RGBA32
970         https://bugs.webkit.org/show_bug.cgi?id=163423
971         <rdar://problem/28766903>
972
973         Reviewed by Simon Fraser.
974
975         In order to allow CSS to use the ExtendedColor variant of
976         Color, we need to stop using RGBA32. This is a fairly big
977         change that goes through all the places in the parser
978         related to colors, and moves them from RGBA32 to Color.
979
980         No change in functionality, so covered by existing tests.
981
982         * WebCore.xcodeproj/project.pbxproj: Add the new ColorHash.h file.
983
984         * css/CSSPrimitiveValue.cpp: CSSPrimitiveValue now can hold a Color*
985         rather than an unsigned int for colors.
986         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
987         (WebCore::CSSPrimitiveValue::cleanup):
988         (WebCore::CSSPrimitiveValue::getRGBColorValue):
989         (WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText):
990         (WebCore::CSSPrimitiveValue::cloneForCSSOM):
991         (WebCore::CSSPrimitiveValue::equals):
992         * css/CSSPrimitiveValue.h: Move to Color* and also use some
993         nullptrs.
994         * css/CSSPrimitiveValueMappings.h:
995         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Add a new inline
996         constructor.
997
998         * css/CSSValuePool.cpp: Move to Color.
999         (WebCore::CSSValuePool::CSSValuePool):
1000         (WebCore::CSSValuePool::createColorValue):
1001         * css/CSSValuePool.h: Change the ColorValueCache to a new type.
1002
1003         * css/StyleResolver.cpp: Move to Color.
1004         (WebCore::StyleResolver::colorFromPrimitiveValue):
1005         * css/parser/CSSParser.cpp:
1006         (WebCore::parseColorValue):
1007         (WebCore::CSSParser::parseColor):
1008         (WebCore::CSSParser::parseColorFromString):
1009         (WebCore::CSSParser::parseSystemColor):
1010         (WebCore::fastParseColorInternal):
1011         (WebCore::CSSParser::fastParseColor):
1012         (WebCore::CSSParser::parseColorFromValue):
1013         * css/parser/CSSParser.h:
1014         * css/parser/CSSParserFastPaths.cpp:
1015         (WebCore::fastParseColorInternal):
1016         (WebCore::CSSParserFastPaths::parseColor):
1017         * css/parser/CSSPropertyParserHelpers.cpp:
1018         (WebCore::CSSPropertyParserHelpers::consumeColor):
1019         * css/parser/SVGCSSParser.cpp:
1020         (WebCore::CSSParser::parseSVGValue):
1021         (WebCore::CSSParser::parseSVGPaint):
1022         (WebCore::CSSParser::parseSVGColor):
1023         * editing/EditingStyle.cpp:
1024         (WebCore::cssValueToColor):
1025         (WebCore::textColorFromStyle):
1026         (WebCore::backgroundColorFromStyle):
1027         (WebCore::rgbaBackgroundColorInEffect):
1028         (WebCore::EditingStyle::prepareToApplyAt):
1029         (WebCore::isTransparentColorValue):
1030         (WebCore::cssValueToRGBA): Deleted.
1031         * editing/cocoa/HTMLConverter.mm:
1032         (HTMLConverterCaches::colorPropertyValueForNode):
1033         * html/HTMLBodyElement.cpp:
1034         (WebCore::HTMLBodyElement::parseAttribute):
1035         * html/canvas/CanvasGradient.cpp:
1036         (WebCore::CanvasGradient::addColorStop):
1037         * html/canvas/CanvasRenderingContext2D.cpp: Ditto, but leave a FIXME to
1038         remind myself to come back when colorWithOverrideAlpha has been updated.
1039         (WebCore::CanvasRenderingContext2D::setStrokeStyle):
1040         (WebCore::CanvasRenderingContext2D::setFillStyle):
1041         (WebCore::CanvasRenderingContext2D::setShadowColor):
1042         (WebCore::CanvasRenderingContext2D::setShadow):
1043         * html/canvas/CanvasStyle.cpp:
1044         (WebCore::isCurrentColorString):
1045         (WebCore::parseColor):
1046         (WebCore::currentColor):
1047         (WebCore::parseColorOrCurrentColor):
1048         (WebCore::CanvasStyle::createFromString):
1049         (WebCore::CanvasStyle::createFromStringWithOverrideAlpha):
1050         * html/canvas/CanvasStyle.h:
1051         * svg/SVGColor.cpp:
1052         (WebCore::SVGColor::colorFromRGBColorString):
1053
1054         * platform/graphics/Color.h: Add new constructors for the special
1055         empty and deleted Color values used in HashTables.
1056         (WebCore::Color::Color):
1057         (WebCore::Color::isHashTableDeletedValue):
1058         (WebCore::Color::asUint64): New accessor to get the raw uint64_t value.
1059
1060         * platform/graphics/ColorHash.h: Added. Implement the traits for a Color HashTable.
1061         (WTF::ColorHash::hash):
1062         (WTF::ColorHash::equal):
1063         (WTF::HashTraits<WebCore::Color>::emptyValue):
1064         (WTF::HashTraits<WebCore::Color>::constructDeletedValue):
1065         (WTF::HashTraits<WebCore::Color>::isDeletedValue):
1066
1067 2016-10-13  Nan Wang  <n_wang@apple.com>
1068
1069         AX: [Mac] better accessibility support for Summary elements
1070         https://bugs.webkit.org/show_bug.cgi?id=163367
1071         <rdar://problem/28745010>
1072
1073         Reviewed by Chris Fleizach.
1074
1075         Exposed summary elements as AXButton and used the text node's content
1076         as AXTitle. Also exposed the details parent's expanded status on the summary
1077         element, so that users would see it as a collapsed/expanded button.
1078
1079         Changes are covered in the modified tests.
1080
1081         * accessibility/AccessibilityObject.cpp:
1082         (WebCore::AccessibilityObject::parentObjectUnignored):
1083         (WebCore::AccessibilityObject::scrollViewAncestor):
1084         (WebCore::AccessibilityObject::headingElementForNode):
1085         (WebCore::AccessibilityObject::matchedParent):
1086         (WebCore::AccessibilityObject::isDescendantOfObject):
1087         (WebCore::AccessibilityObject::isInsideARIALiveRegion):
1088         (WebCore::AccessibilityObject::elementAccessibilityHitTest):
1089         (WebCore::AccessibilityObject::isExpanded):
1090         (WebCore::AccessibilityObject::isARIAHidden):
1091         (WebCore::AccessibilityObject::focusableAncestor):
1092         (WebCore::AccessibilityObject::editableAncestor):
1093         * accessibility/AccessibilityObject.h:
1094         (WebCore::AccessibilityObject::isSummary):
1095         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1096         (-[WebAccessibilityObjectWrapper _accessibilityListAncestor]):
1097         (-[WebAccessibilityObjectWrapper _accessibilityLandmarkAncestor]):
1098         (-[WebAccessibilityObjectWrapper _accessibilityTableAncestor]):
1099         (-[WebAccessibilityObjectWrapper _accessibilityFieldsetAncestor]):
1100         (-[WebAccessibilityObjectWrapper tableCellParent]):
1101         (-[WebAccessibilityObjectWrapper tableParent]):
1102         (-[WebAccessibilityObjectWrapper convertPointToScreenSpace:]):
1103         (-[WebAccessibilityObjectWrapper convertRectToScreenSpace:]):
1104         (-[WebAccessibilityObjectWrapper detailParentForSummaryObject:]):
1105         (-[WebAccessibilityObjectWrapper detailParentForObject:]):
1106         (matchedParent): Deleted.
1107         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1108         (-[WebAccessibilityObjectWrapper additionalAccessibilityAttributeNames]):
1109         (createAccessibilityRoleMap):
1110         (-[WebAccessibilityObjectWrapper roleDescription]):
1111         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
1112
1113 2016-10-13  Zalan Bujtas  <zalan@apple.com>
1114
1115         [Clean RenderTree] LayoutTests/imported/blink/fast/table/crash-bad-child-table-continuation.html fails.
1116         https://bugs.webkit.org/show_bug.cgi?id=163399
1117
1118         Reviewed by David Hyatt.
1119
1120         When we try to insert a renderer before a child whose direct parent is a (anonymus) RenderTable, continuation logic
1121         should dismiss the RenderTable as the parent and find a more appropriate ancestor.
1122         RenderTables assumes a certain descendant tree structure which might not be available in the continuation.
1123
1124         Will be testable with webkit.org/b/162834
1125
1126         * rendering/RenderInline.cpp:
1127         (WebCore::canUseAsParentForContinuation):
1128         (WebCore::RenderInline::addChildToContinuation):
1129
1130 2016-10-13  Alex Christensen  <achristensen@webkit.org>
1131
1132         Disable URLParser for non-Safari iOS and Mac apps for now
1133         https://bugs.webkit.org/show_bug.cgi?id=163397
1134
1135         Reviewed by Tim Horton.
1136
1137         r207268 was an awful hack, and it was insufficient.
1138         Disable the URLParser for other apps for now.  Hopefully we can enable it everywhere soon.
1139
1140         No change in behavior for testing infrastructure.  
1141         Old URLs were well tested before making the switch, and nothing has changed for them.
1142
1143         * platform/URLParser.cpp:
1144         (WebCore::URLParser::parse):
1145         (WebCore::URLParser::parseHostAndPort):
1146         (WebCore::URLParser::setEnabled):
1147         (WebCore::URLParser::enabled):
1148         * platform/URLParser.h:
1149
1150 2016-10-13  Chris Dumez  <cdumez@apple.com>
1151
1152         Rename [ConstructorTemplate=*] to [LegacyConstructorTemplate=*]
1153         https://bugs.webkit.org/show_bug.cgi?id=163390
1154
1155         Reviewed by Darin Adler.
1156
1157         Rename [ConstructorTemplate=*] to [LegacyConstructorTemplate=*] as the
1158         modern way of doing this is to use a constructor that takes in a
1159         dictionary. I am working on getting rid of this extended attribute
1160         entirely but the remaining uses require better support for union types.
1161
1162         * Modules/applepay/ApplePayValidateMerchantEvent.idl:
1163         * Modules/indexeddb/IDBVersionChangeEvent.idl:
1164         * Modules/mediastream/RTCTrackEvent.idl:
1165         * bindings/scripts/CodeGenerator.pm:
1166         (IsConstructorTemplate):
1167         * bindings/scripts/CodeGeneratorJS.pm:
1168         (GenerateConstructorDefinition):
1169         (IsConstructable):
1170         * bindings/scripts/IDLAttributes.txt:
1171         * dom/Event.idl:
1172         * dom/ProgressEvent.idl:
1173         * dom/UIEvent.idl:
1174         * html/track/TrackEvent.idl:
1175
1176 2016-10-13  Ryan Haddad  <ryanhaddad@apple.com>
1177
1178         Unreviewed, rolling out r207297.
1179
1180         This change broke the iOS build.
1181
1182         Reverted changeset:
1183
1184         "Disable URLParser for non-Safari iOS and Mac apps for now"
1185         https://bugs.webkit.org/show_bug.cgi?id=163397
1186         http://trac.webkit.org/changeset/207297
1187
1188 2016-10-13  Anders Carlsson  <andersca@apple.com>
1189
1190         Get rid of the HistoryItemVector typedef
1191         https://bugs.webkit.org/show_bug.cgi?id=163398
1192
1193         Reviewed by Beth Dakin.
1194
1195         Expand the HistoryitemVector typedef instead to make it more clear what types we are dealing with.
1196
1197         * history/BackForwardList.cpp:
1198         (WebCore::BackForwardList::backListWithLimit):
1199         (WebCore::BackForwardList::forwardListWithLimit):
1200         (WebCore::BackForwardList::entries):
1201         * history/BackForwardList.h:
1202         * history/HistoryItem.cpp:
1203         (WebCore::HistoryItem::children):
1204         * history/HistoryItem.h:
1205         * loader/HistoryController.cpp:
1206         (WebCore::HistoryController::currentFramesMatchItem):
1207
1208 2016-10-13  Antoine Quint  <graouts@apple.com>
1209
1210         [Modern Media Controls] MediaControls base class
1211         https://bugs.webkit.org/show_bug.cgi?id=163387
1212         <rdar://problem/28753955>
1213
1214         Reviewed by Dean Jackson.
1215
1216         Introducing the new MediaControls class which will serve as a basis for all media controls.
1217         We will introduce specific MediaControls subclasses for macOS inline, macOS fullscreen and
1218         iOS inline in future patches.
1219
1220         Tests: media/modern-media-controls/media-controls/media-controls-constructor.html
1221                media/modern-media-controls/media-controls/media-controls-placard.html
1222                media/modern-media-controls/media-controls/media-controls-start-button.html
1223
1224         * Modules/modern-media-controls/controls/media-controls.css: Added.
1225         (.media-controls,):
1226         * Modules/modern-media-controls/controls/media-controls.js: Added.
1227         (MediaControls.):
1228         (MediaControls.prototype.get showsStartButton):
1229         (MediaControls.prototype.set showsStartButton):
1230         (MediaControls.prototype.get showsPlacard):
1231         (MediaControls.prototype.showPlacard):
1232         (MediaControls.prototype.hidePlacard):
1233
1234 2016-10-13  Alex Christensen  <achristensen@webkit.org>
1235
1236         Disable URLParser for non-Safari iOS and Mac apps for now
1237         https://bugs.webkit.org/show_bug.cgi?id=163397
1238
1239         Reviewed by Tim Horton.
1240
1241         r207268 was an awful hack, and it was insufficient.
1242         Disable the URLParser for other apps for now.  Hopefully we can enable it everywhere soon.
1243
1244         No change in behavior for testing infrastructure.  
1245         Old URLs were well tested before making the switch, and nothing has changed for them.
1246
1247         * platform/URLParser.cpp:
1248         (WebCore::URLParser::parse):
1249         (WebCore::URLParser::parseHostAndPort):
1250         (WebCore::URLParser::setEnabled):
1251         (WebCore::URLParser::enabled):
1252         * platform/URLParser.h:
1253
1254 2016-10-13  Antoine Quint  <graouts@apple.com>
1255
1256         [Modern Media Controls] TimeControl and TimeLabel
1257         https://bugs.webkit.org/show_bug.cgi?id=163356
1258         <rdar://problem/28741376>
1259
1260         Reviewed by Dean Jackson.
1261
1262         We introduce the TimeControl and TimeLabel classes. A TimeControl object
1263         provides two TimeLabels, one for the elapsed time, one for the remaining
1264         time, and a Scrubber in between them. Depending on a TimeControl's width,
1265         it will adjust its layout such that the scrubber takes all the available
1266         space between the labels, and can indicate whether it's large enough to
1267         meet the minimal required width to show the scrubber, such that a container
1268         node may decide not to show the TimeControl at all.
1269
1270         TimeLabel nodes simply show an integer time value in miliseconds in a
1271         nicely formatted way.
1272
1273         Tests: media/modern-media-controls/time-control/time-control.html
1274                media/modern-media-controls/time-label/time-label.html
1275
1276         * Modules/modern-media-controls/controls/time-control.js: Added.
1277         (TimeControl.prototype.get width):
1278         (TimeControl.prototype.set width):
1279         (TimeControl.prototype.get isSufficientlyWide):
1280         * Modules/modern-media-controls/controls/time-label.css: Added.
1281         (.time-label):
1282         * Modules/modern-media-controls/controls/time-label.js: Added.
1283         (TimeLabel.prototype.get value):
1284         (TimeLabel.prototype.set value):
1285         (TimeLabel.prototype.commitProperty):
1286         (TimeLabel.prototype._formattedTime):
1287
1288 2016-10-13  Jer Noble  <jer.noble@apple.com>
1289
1290         CRASH at WebCore::SourceBuffer::removeCodedFrames + 37
1291         https://bugs.webkit.org/show_bug.cgi?id=163336
1292
1293         Reviewed by Alex Christensen.
1294
1295         Test: media/media-source/media-source-remove-crash.html
1296
1297         A null-deref crash can occur if a SourceBuffer is removed from a MediaSource after
1298         SourceBuffer.remove() is called, but before the removeTimer is fired.
1299
1300         * Modules/mediasource/SourceBuffer.cpp:
1301         (WebCore::SourceBuffer::removeTimerFired):
1302
1303 2016-10-13  Michael Catanzaro  <mcatanzaro@igalia.com>
1304
1305         [SOUP] SHOULD NEVER BE REACHED ../../Source/WebCore/platform/URL.cpp(1291) : void WebCore::URL::parse(const WTF::String&)
1306         https://bugs.webkit.org/show_bug.cgi?id=163392
1307
1308         Reviewed by Alex Christensen.
1309
1310         Fix the URL constructor to work with URLParser.
1311
1312         * platform/soup/URLSoup.cpp:
1313         (WebCore::URL::URL):
1314
1315 2016-10-13  Ryan Haddad  <ryanhaddad@apple.com>
1316
1317         Unreviewed, rolling out r207286.
1318
1319         Caused LayoutTest http/tests/misc/acid3.html to fail.
1320
1321         Reverted changeset:
1322
1323         "Share inline stylesheets between shadow trees"
1324         https://bugs.webkit.org/show_bug.cgi?id=163353
1325         http://trac.webkit.org/changeset/207286
1326
1327 2016-10-13  Sergio Villar Senin  <svillar@igalia.com>
1328
1329         [css-grid] Use min-size instead of min-content contribution for intrinsic maximums resolution
1330         https://bugs.webkit.org/show_bug.cgi?id=163283
1331
1332         Reviewed by Manuel Rego Casasnovas.
1333
1334         This was recently modified in the specs
1335         https://hg.csswg.org/drafts/diff/575fb847e29d/css-grid/Overview.bs. Specifically this is
1336         addressing the last one. It used to be "min-content contribution" but now it says "min-size
1337         contribution".
1338
1339         * rendering/RenderGrid.cpp:
1340         (WebCore::RenderGrid::currentItemSizeForTrackSizeComputationPhase):
1341
1342 2016-10-11  Sergio Villar Senin  <svillar@igalia.com>
1343
1344         [css-grid] Fix intrinsic maximums resolution with fit-content and auto
1345         https://bugs.webkit.org/show_bug.cgi?id=163282
1346
1347         Reviewed by Manuel Rego Casasnovas.
1348
1349         The step 2.5 in section 12.5 https://drafts.csswg.org/css-grid/#algo-content of the specs,
1350         details how to sizes tracks with intrinsic max track sizing functions.
1351
1352         Not so long ago there were only two max track sizing functions min-content and max-content
1353         (auto was always resolved to max-content). However there were some recent changes that force
1354         us to consider 2 new values: auto (which is not internally translated to max-content
1355         although it still works the same) and specially the newly added fit-content.
1356
1357         Some of the new test cases are commented due to bug http://wkb.ug/163283.
1358
1359         Test: fast/css-grid-layout/grid-intrinsic-maximums.html
1360
1361         * rendering/RenderGrid.cpp:
1362         (WebCore::RenderGrid::shouldProcessTrackForTrackSizeComputationPhase):
1363         * rendering/style/GridTrackSize.h:
1364         (WebCore::GridTrackSize::cacheMinMaxTrackBreadthTypes):
1365         (WebCore::GridTrackSize::hasIntrinsicMinTrackBreadth):
1366         (WebCore::GridTrackSize::hasIntrinsicMaxTrackBreadth):
1367         (WebCore::GridTrackSize::hasAutoOrMinContentMinTrackBreadthAndIntrinsicMaxTrackBreadth):
1368
1369 2016-10-13  Miguel Gomez  <magomez@igalia.com>
1370
1371         [GTK] Video playback doesn't work properly with accelerated compositing disabled
1372         https://bugs.webkit.org/show_bug.cgi?id=163386
1373
1374         Reviewed by Carlos Garcia Campos.
1375
1376         Trigger a repaint of the player when a new frame arrives and accelerated compositing is disabled.
1377
1378         Covered by existent tests.
1379
1380         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1381         (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
1382
1383 2016-10-13  Antti Koivisto  <antti@apple.com>
1384
1385         Share inline stylesheets between shadow trees
1386         https://bugs.webkit.org/show_bug.cgi?id=163353
1387
1388         Reviewed by Ryosuke Niwa and Andreas Kling.
1389
1390         If shadow trees have identical inline stylesheets the data structures can be shared.
1391         In future this will also allow sharing style resolvers.
1392
1393         * css/parser/CSSParserMode.h:
1394         (WebCore::CSSParserContextHash::hash):
1395         (WebCore::CSSParserContextHash::equal):
1396         (WTF::HashTraits<WebCore::CSSParserContext>::constructDeletedValue):
1397         (WTF::HashTraits<WebCore::CSSParserContext>::isDeletedValue):
1398         (WTF::HashTraits<WebCore::CSSParserContext>::emptyValue):
1399
1400             Make CSSParserContext hashable.
1401
1402         * dom/InlineStyleSheetOwner.cpp:
1403         (WebCore::makeInlineStyleSheetCacheKey):
1404         (WebCore::inlineStyleSheetCache):
1405
1406             Implement a simple cache for sharing stylesheets with identical text and context.
1407
1408         (WebCore::InlineStyleSheetOwner::createSheet):
1409         (WebCore::InlineStyleSheetOwner::clearCache):
1410         * dom/InlineStyleSheetOwner.h:
1411         * platform/MemoryPressureHandler.cpp:
1412         (WebCore::MemoryPressureHandler::releaseNoncriticalMemory):
1413
1414 2016-10-13  Antti Koivisto  <antti@apple.com>
1415
1416         Revert patch landed with wrong commit message.
1417
1418 2016-10-12  Per Arne Vollan  <pvollan@apple.com>
1419
1420         [Win] Encode function pointers.
1421         https://bugs.webkit.org/show_bug.cgi?id=163331
1422
1423         Reviewed by Brent Fulgham.
1424
1425         We should encode stored function pointers.
1426
1427         * platform/win/SoftLinking.h:
1428
1429 2016-10-13  Youenn Fablet  <youenn@apple.com>
1430
1431         Remove CachedResourceRequest::mutableResourceRequest
1432         https://bugs.webkit.org/show_bug.cgi?id=163277
1433
1434         Reviewed by Sam Weinig.
1435
1436         No change of behavior.
1437
1438         Removing CachedResourceRequest::mutableResourceRequest requires call sites to either update the ResourceRequest
1439         before creating the CachedResourceRequest or to add methods at CachedResourceRequest.
1440
1441         Adding CachedResourceRequest::releaseResourceRequest for CachedResource constructor.
1442
1443         Most new CachedResourceRequest methods are used by CachedResourceLoader which is passed a CachedResourceRequest.
1444         This allows code in CachedResourceLoader to be easier to read.
1445
1446         * css/CSSImageSetValue.cpp:
1447         (WebCore::CSSImageSetValue::loadBestFitImage):
1448         * css/CSSImageValue.cpp:
1449         (WebCore::CSSImageValue::loadImage):
1450         * dom/ScriptElement.cpp:
1451         (WebCore::ScriptElement::requestScriptWithCache):
1452         * loader/CrossOriginAccessControl.cpp:
1453         (WebCore::createAccessControlPreflightRequest):
1454         * loader/CrossOriginAccessControl.h:
1455         * loader/CrossOriginPreflightChecker.cpp:
1456         (WebCore::CrossOriginPreflightChecker::startPreflight):
1457         (WebCore::CrossOriginPreflightChecker::doPreflight):
1458         * loader/DocumentThreadableLoader.cpp:
1459         (WebCore::DocumentThreadableLoader::loadRequest):
1460         * loader/MediaResourceLoader.cpp:
1461         (WebCore::MediaResourceLoader::requestResource):
1462         * loader/cache/CachedResource.cpp:
1463         (WebCore::CachedResource::CachedResource):
1464         * loader/cache/CachedResourceLoader.cpp:
1465         (WebCore::CachedResourceLoader::requestImage):
1466         (WebCore::CachedResourceLoader::requestUserCSSStyleSheet):
1467         (WebCore::CachedResourceLoader::prepareFetch):
1468         (WebCore::CachedResourceLoader::updateHTTPRequestHeaders):
1469         (WebCore::CachedResourceLoader::requestResource):
1470         (WebCore::acceptHeaderValueFromType): Deleted.
1471         (WebCore::updateRequestAccordingCacheMode): Deleted.
1472         * loader/cache/CachedResourceRequest.cpp:
1473         (WebCore::CachedResourceRequest::setAsPotentiallyCrossOrigin):
1474         (WebCore::CachedResourceRequest::updateForAccessControl):
1475         (WebCore::CachedResourceRequest::upgradeInsecureRequestIfNeeded):
1476         (WebCore::CachedResourceRequest::setDomainForCachePartition):
1477         (WebCore::acceptHeaderValueFromType):
1478         (WebCore::CachedResourceRequest::setAcceptHeaderIfNone):
1479         (WebCore::CachedResourceRequest::updateAccordingCacheMode):
1480         (WebCore::CachedResourceRequest::removeFragmentIdentifierIfNeeded):
1481         (WebCore::CachedResourceRequest::applyBlockedStatus):
1482         * loader/cache/CachedResourceRequest.h:
1483         (WebCore::CachedResourceRequest::releaseResourceRequest):
1484         (WebCore::CachedResourceRequest::setCachingPolicy):
1485         (WebCore::CachedResourceRequest::mutableResourceRequest): Deleted.
1486         (WebCore::CachedResourceRequest::setCacheModeToNoStore): Deleted.
1487         * loader/icon/IconLoader.cpp:
1488         (WebCore::IconLoader::startLoading):
1489         * platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp:
1490         (WebCore::WebCoreAVCFResourceLoader::startLoading):
1491         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
1492         (WebCore::WebCoreAVFResourceLoader::startLoading):
1493
1494 2016-10-13  Antti Koivisto  <antti@apple.com>
1495
1496         Support scoped style for user agent shadow trees
1497         https://bugs.webkit.org/show_bug.cgi?id=163212
1498         <rdar://problem/28715318>
1499
1500         Reviewed by Ryosuke Niwa and Andreas Kling.
1501
1502         This patch adds support for user agent shadow trees that have scoped style. This means
1503         that the shadows can be styled via <style> elements contained in the tree instead of
1504         using pseudo elements on the global UA sheet. Since the style is scoped it can use
1505         normal id and class selectors.
1506
1507         Elements in the shadow tree can still be exposed for author styling if needed by giving
1508         them pseudo ids
1509
1510         The patch also uses the new mechanism for the <meter> element.
1511
1512         The mechanism is not optimized yet, each shadow tree gets its own copy of style-related data
1513         structures. This can be improved later.
1514
1515         * CMakeLists.txt:
1516         * DerivedSources.make:
1517         * WebCore.xcodeproj/project.pbxproj:
1518         * css/ElementRuleCollector.cpp:
1519         (WebCore::MatchRequest::MatchRequest):
1520         (WebCore::ElementRuleCollector::addMatchedRule):
1521         (WebCore::ElementRuleCollector::matchAuthorShadowPseudoElementRules):
1522
1523             Make treeContextOrdinal an int so we can use negative ordinals. This is used to allow author pseudo
1524             elements from earlier tree context to win over the shadow tree (matching CSS scoping spec language).
1525
1526         * css/ElementRuleCollector.h:
1527         * css/StyleResolver.cpp:
1528         (WebCore::StyleResolver::MatchResult::addMatchedProperties):
1529         (WebCore::StyleResolver::CascadedProperties::addImportantMatches):
1530         * css/StyleResolver.h:
1531         * css/html.css:
1532         (meter::-webkit-meter-inner-element): Deleted.
1533         (meter::-webkit-meter-bar): Deleted.
1534         (meter::-webkit-meter-optimum-value): Deleted.
1535         (meter::-webkit-meter-suboptimum-value): Deleted.
1536         (meter::-webkit-meter-even-less-good-value): Deleted.
1537
1538             Remove meter pseudo elements from the UA sheet.
1539
1540         * html/HTMLMeterElement.cpp:
1541         (WebCore::HTMLMeterElement::childShouldCreateRenderer):
1542
1543             Don't create shadow renderers when we have appearance (are using RenderMeter).
1544
1545         (WebCore::setValueClass):
1546
1547             Move this logic here from MeterShadowElement.cpp.
1548             Set both class and pseudo id. The latter is needed to keep author styling working.
1549
1550         (WebCore::HTMLMeterElement::didElementStateChange):
1551         (WebCore::HTMLMeterElement::renderMeter):
1552
1553             RenderMeter is now only instantiated when appearance is enabled.
1554
1555         (WebCore::HTMLMeterElement::didAddUserAgentShadowRoot):
1556
1557             Build the shadow tree out of <div>s instead of special shadow elements.
1558
1559         * html/HTMLMeterElement.h:
1560         * html/shadow/MeterShadowElement.cpp: Removed.
1561         * html/shadow/MeterShadowElement.h: Removed.
1562
1563             Not needed anymore.
1564
1565         * html/shadow/meterElementShadow.css: Added.
1566         (div#inner):
1567         (div#bar):
1568         (div#value):
1569         (div#value.optimum):
1570         (div#value.suboptimum):
1571         (div#value.even-less-good):
1572
1573             Stylesheet for meter element shadow tree using normal id and class selectors.
1574
1575         * style/StyleScope.cpp:
1576         (WebCore::Style::Scope::shouldUseSharedUserAgentShadowTreeStyleResolver):
1577
1578             Switch to per-scope style resolver for UA shadow trees if there is stylesheets in the tree.
1579
1580         (WebCore::Style::Scope::resolver):
1581         (WebCore::Style::Scope::resolverIfExists):
1582         * style/StyleScope.h:
1583
1584 2016-10-12  Chris Dumez  <cdumez@apple.com>
1585
1586         [Web IDL] Drop support for legacy [ConstructorConditional=*]
1587         https://bugs.webkit.org/show_bug.cgi?id=163368
1588
1589         Reviewed by Ryosuke Niwa.
1590
1591         Drop support for legacy [ConstructorConditional=*] webkit-specific IDL
1592         extended attribute. This was introduced to disable DOM4 event
1593         constructors at compile time. However, nowadays, those constructors are
1594         enabled everywhere.
1595
1596         * Configurations/FeatureDefines.xcconfig:
1597         * bindings/scripts/CodeGenerator.pm:
1598         (GenerateConstructorConditionalString): Deleted.
1599         * bindings/scripts/CodeGeneratorJS.pm:
1600         (GenerateConstructorHelperMethods):
1601         * bindings/scripts/IDLAttributes.txt:
1602         * bindings/scripts/test/JS/JSTestInterface.cpp:
1603         (WebCore::JSTestInterfaceConstructor::getConstructData): Deleted.
1604         * bindings/scripts/test/TestInterface.idl:
1605         * dom/UIEvent.idl:
1606
1607 2016-10-12  Chris Dumez  <cdumez@apple.com>
1608
1609         The bindings generator should provide a better error message when it does not find a dictionary definition
1610         https://bugs.webkit.org/show_bug.cgi?id=163377
1611
1612         Reviewed by Ryosuke Niwa.
1613
1614         The bindings generator should provide a better error message when it does
1615         not find a dictionary definition.
1616
1617         * bindings/scripts/CodeGenerator.pm:
1618         (GetDictionaryByName):
1619         * bindings/scripts/CodeGeneratorJS.pm:
1620         (assert):
1621         (GenerateDictionaryImplementationContent):
1622         (GenerateHeader):
1623         (GenerateDictionaryHeader):
1624
1625 2016-10-12  Chris Dumez  <cdumez@apple.com>
1626
1627         Update WebKitMediaKeyMessageEvent / WebKitMediaKeyNeededEvent to stop using legacy [ConstructorTemplate=Event]
1628         https://bugs.webkit.org/show_bug.cgi?id=163369
1629
1630         Reviewed by Ryosuke Niwa.
1631
1632         Update WebKitMediaKeyMessageEvent / WebKitMediaKeyNeededEvent to stop
1633         using legacy [ConstructorTemplate=Event] and use regular constructors
1634         instead.
1635
1636         This also adds support for having dictionary members that are typed
1637         arrays because this was needed.
1638
1639         Test: fast/events/webkit-media-key-events-constructor.html
1640
1641         * Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.cpp:
1642         (WebCore::WebKitMediaKeyMessageEvent::WebKitMediaKeyMessageEvent):
1643         * Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.h:
1644         (WebCore::WebKitMediaKeyMessageEvent::create):
1645         (WebCore::WebKitMediaKeyMessageEvent::createForBindings): Deleted.
1646         * Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.idl:
1647         * Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.cpp:
1648         (WebCore::WebKitMediaKeyNeededEvent::WebKitMediaKeyNeededEvent):
1649         * Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.h:
1650         (WebCore::WebKitMediaKeyNeededEvent::create):
1651         (WebCore::WebKitMediaKeyNeededEvent::createForBindings): Deleted.
1652         * Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.idl:
1653         * bindings/js/JSDOMConvert.h:
1654         (WebCore::Converter<IDLInterface<JSC::GenericTypedArrayView<Adaptor>>>::convert):
1655         * bindings/scripts/CodeGeneratorJS.pm:
1656         (GenerateDefaultValue):
1657         * dom/InputEvent.cpp:
1658         (WebCore::InputEvent::InputEvent):
1659         * dom/InputEvent.h:
1660         * dom/InputEvent.idl:
1661
1662 2016-10-12  Chris Dumez  <cdumez@apple.com>
1663
1664         Update HTMLSelectElement::recalcListItems() to ignore nested optgroup elements
1665         https://bugs.webkit.org/show_bug.cgi?id=163358
1666
1667         Reviewed by Kent Tamura.
1668
1669         Update HTMLSelectElement::recalcListItems() to ignore nested optgroup elements.
1670         As per the specification, we only want optgroup elements that are direct
1671         children of the select element. This also matches the behavior of Chrome.
1672
1673         Test: fast/dom/HTMLSelectElement/nested-optgroup.html
1674
1675         * html/HTMLSelectElement.cpp:
1676         (WebCore::HTMLSelectElement::recalcListItems):
1677
1678 2016-10-12  Zalan Bujtas  <zalan@apple.com>
1679
1680         RenderRubyRun should not mark child renderers dirty at the end of layout.
1681         https://bugs.webkit.org/show_bug.cgi?id=163359
1682         <rdar://problem/28711840>
1683
1684         Reviewed by David Hyatt.
1685
1686         The current layout logic does not support marking renderers dirty for subsequent layouts.
1687         Layout needs to exit with a clean tree.
1688         Should relayoutChild be insufficient, we could also mark the base/text dirty for the justified content.
1689
1690         Test: fast/ruby/rubyrun-has-bad-child.html
1691
1692         * rendering/RenderBlockLineLayout.cpp:
1693         (WebCore::RenderBlockFlow::updateRubyForJustifiedText):
1694         * rendering/RenderRubyRun.cpp:
1695         (WebCore::RenderRubyRun::layout):
1696         (WebCore::RenderRubyRun::layoutBlock):
1697         * rendering/RenderRubyRun.h:
1698
1699 2016-10-12  Simon Fraser  <simon.fraser@apple.com>
1700
1701         Crash when using megaplan.ru
1702         https://bugs.webkit.org/show_bug.cgi?id=163276
1703         rdar://problem/28446672
1704
1705         Reviewed by Sam Weinig.
1706
1707         Make sure we allocate enough space in the vector of CGPoints that we use for path building.
1708
1709         Test: css3/masking/large-clip-path.html
1710
1711         * platform/graphics/cg/PathCG.cpp:
1712         (WebCore::Path::polygonPathFromPoints):
1713
1714 2016-10-12  Alex Christensen  <achristensen@webkit.org>
1715
1716         Fix out-of-bounds reading in URLParser when parsing improperly percent-encoded values
1717         https://bugs.webkit.org/show_bug.cgi?id=163376
1718
1719         Reviewed by Saam Barati.
1720
1721         Covered by new API tests, which used to crash under asan.
1722
1723         * platform/URLParser.cpp:
1724         (WebCore::percentDecode):
1725         If you subtract 2 from size_t's smaller than 2, you're gonna have a bad time.
1726
1727 2016-10-12  Alex Christensen  <achristensen@webkit.org>
1728
1729         Mail needs nonspecial URLs to keep case in host and not have slash after host
1730         https://bugs.webkit.org/show_bug.cgi?id=163373
1731
1732         Reviewed by Saam Barati.
1733         
1734         Mail uses urls like scheme://HoSt which were not changed when canonicalized 
1735         before enabling the URLParser but now are canonicalized to scheme://host/
1736         I manually verified this fixes the issue.
1737         This should be reverted once Mail will accept modern canonicalized URLs.
1738
1739         * platform/URLParser.cpp:
1740         (WebCore::URLParser::parse):
1741         (WebCore::URLParser::parseHostAndPort):
1742         * platform/URLParser.h:
1743         If the application is mail and the scheme is nonspecial, don't make the host lower case and don't add a slash after the host.
1744
1745 2016-10-11  Dean Jackson  <dino@apple.com>
1746
1747         Add preliminary support for extended colors to WebCore::Color
1748         https://bugs.webkit.org/show_bug.cgi?id=162878
1749         <rdar://problem/28596413>
1750
1751         Reviewed by Darin Adler.
1752
1753         Add an ExtendedColor class that will hold the data necessary
1754         for wider-than-sRGB (and more precise) colors. In order to
1755         avoid increasing the size of Color, implement a tagged
1756         pointer that is either referencing an ExtendedColor, or
1757         is a 64-bit number with the top 32-bits being the RGBA, and
1758         the bottom 2 bits indicating an invalid RGBA or a valid RGBA,
1759         plus the tag.
1760
1761         Add copy constructors and operator= so that the new Color objects
1762         are correctly copied.
1763
1764         There isn't yet a way to create an ExtendedColor. That's coming
1765         in a followup patch (and will require changes to the CSS parser).
1766
1767         Covered by existing tests, and new API tests in Color.
1768
1769         * CMakeLists.txt:
1770         * WebCore.xcodeproj/project.pbxproj: Add new files.
1771
1772         * platform/graphics/Color.cpp: Update everything to use m_rgbaAndFlags
1773         instead of m_color + m_valid.
1774         (WebCore::Color::Color):
1775         (WebCore::Color::~Color):
1776         (WebCore::Color::operator=):
1777         (WebCore::Color::nameForRenderTreeAsText):
1778         (WebCore::Color::setNamedColor):
1779         (WebCore::Color::light):
1780         (WebCore::Color::dark):
1781         (WebCore::Color::setValid):
1782         (WebCore::Color::setExtended):
1783         (WebCore::Color::isExtended):
1784         (WebCore::Color::asExtended):
1785         * platform/graphics/Color.h: Implement the tagged union.
1786         (WebCore::Color::Color):
1787         (WebCore::Color::isValid):
1788         (WebCore::Color::red):
1789         (WebCore::Color::green):
1790         (WebCore::Color::blue):
1791         (WebCore::Color::alpha):
1792         (WebCore::Color::rgb):
1793         (WebCore::Color::setRGB):
1794         (WebCore::operator==):
1795
1796         * platform/graphics/ExtendedColor.cpp: New file. Holds floating point
1797         red, green, blue and alpha, plus a color space.
1798         (WebCore::ExtendedColor::create):
1799         (WebCore::ExtendedColor::~ExtendedColor):
1800         (WebCore::ExtendedColor::ref):
1801         (WebCore::ExtendedColor::deref):
1802         * platform/graphics/ExtendedColor.h:
1803         (WebCore::ExtendedColor::red):
1804         (WebCore::ExtendedColor::green):
1805         (WebCore::ExtendedColor::blue):
1806         (WebCore::ExtendedColor::alpha):
1807         (WebCore::ExtendedColor::colorSpace):
1808         (WebCore::ExtendedColor::ExtendedColor):
1809
1810         * platform/graphics/cg/ColorCG.cpp: Update the constructors for
1811         the platform specific color classes.
1812         (WebCore::Color::Color):
1813         * platform/graphics/gtk/ColorGtk.cpp:
1814         (WebCore::Color::Color):
1815         * platform/graphics/win/ColorDirect2D.cpp:
1816         (WebCore::Color::Color):
1817
1818         * rendering/RenderEmbeddedObject.cpp: Use NeverDestroyed.
1819         (WebCore::replacementTextRoundedRectPressedColor):
1820         (WebCore::replacementTextRoundedRectColor):
1821         (WebCore::replacementTextColor):
1822         (WebCore::unavailablePluginBorderColor):
1823
1824         * rendering/RenderFrameSet.cpp: Ditto.
1825         (WebCore::borderStartEdgeColor):
1826         (WebCore::borderEndEdgeColor):
1827         (WebCore::borderFillColor):
1828
1829         * rendering/RenderTableCell.cpp: This grows in size slightly
1830         because it can no longer pack bits.
1831
1832 2016-10-12  Antoine Quint  <graouts@apple.com>
1833
1834         [Modern Media Controls] Sliders: scrubber and volume
1835         https://bugs.webkit.org/show_bug.cgi?id=163328
1836         <rdar://problem/28733838>
1837
1838         Reviewed by Dean Jackson.
1839
1840         We add a new Slider class that provides a custom slider backed by an
1841         invisible <input type="range"> element and a fill underlay to provide
1842         a custom color between the left edge of the slider and the slider thumb.
1843         As the slider's value changes, a UI delegate receives messages to track
1844         such changes.
1845
1846         Tests: media/modern-media-controls/scrubber/scrubber.html
1847                media/modern-media-controls/slider/slider-constructor.html
1848                media/modern-media-controls/slider/slider-fill.html
1849                media/modern-media-controls/slider/slider-styles.html
1850                media/modern-media-controls/volume-slider/volume-slider-value.html
1851                media/modern-media-controls/volume-slider/volume-slider.html
1852
1853         * Modules/modern-media-controls/controls/scrubber.css: Added.
1854         (.scrubber.slider > input::-webkit-slider-thumb):
1855         * Modules/modern-media-controls/controls/scrubber.js: Added.
1856         (Scrubber):
1857         * Modules/modern-media-controls/controls/slider.css: Added.
1858         (.slider):
1859         (.slider > input,):
1860         (.slider > .fill):
1861         (.slider > input):
1862         (.slider > input::-webkit-slider-thumb):
1863         * Modules/modern-media-controls/controls/slider.js: Added.
1864         (Slider.prototype.get value):
1865         (Slider.prototype.set value):
1866         (Slider.prototype.get width):
1867         (Slider.prototype.set width):
1868         (Slider.prototype.handleEvent):
1869         (Slider.prototype.commitProperty):
1870         (Slider.prototype._handleInputEvent):
1871         (Slider.prototype._handleChangeEvent):
1872         (Slider.prototype._updateFill):
1873         * Modules/modern-media-controls/controls/volume-slider.css: Added.
1874         (.volume.slider > input::-webkit-slider-thumb):
1875         * Modules/modern-media-controls/controls/volume-slider.js: Added.
1876         (VolumeSlider):
1877
1878 2016-10-12  Wenson Hsieh  <wenson_hsieh@apple.com>
1879
1880         Add experimental support for the "formatForeColor" inputType
1881         https://bugs.webkit.org/show_bug.cgi?id=163348
1882         <rdar://problem/28739334>
1883
1884         Reviewed by Ryosuke Niwa.
1885
1886         Adds support for the "formatForeColor" attribute. This patch introduces a simple hook in Editor.cpp to extract
1887         data for an input event from an EditingStyle when performing an editing action.
1888
1889         Test: fast/events/input-events-forecolor-data.html
1890
1891         * editing/EditCommand.cpp:
1892         (WebCore::inputTypeNameForEditingAction):
1893         * editing/Editor.cpp:
1894         (WebCore::inputEventDataForEditingStyleAndAction):
1895
1896         Added a new static helper to compute the data attribute of an InputEvent when handling a style change.
1897
1898         (WebCore::Editor::computeAndSetTypingStyle):
1899
1900 2016-10-12  Chris Dumez  <cdumez@apple.com>
1901
1902         [Web IDL] Generated bindings include the wrong header when ImplementedAs is used on a dictionary
1903         https://bugs.webkit.org/show_bug.cgi?id=163352
1904
1905         Reviewed by Ryosuke Niwa.
1906
1907         Generated bindings include the wrong header when ImplementedAs is used
1908         on a dictionary.
1909
1910         * bindings/scripts/CodeGeneratorJS.pm:
1911         (GenerateDictionaryHeader):
1912         * bindings/scripts/test/JS/JSTestObj.cpp:
1913         (WebCore::jsTestObjPrototypeFunctionOperationWithExternalDictionaryParameterCaller):
1914         * bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
1915         (WebCore::convertDictionary<DictionaryImplName>):
1916         (WebCore::convertDictionary<TestStandaloneDictionary>): Deleted.
1917         * bindings/scripts/test/JS/JSTestStandaloneDictionary.h:
1918         * bindings/scripts/test/TestStandaloneDictionary.idl:
1919
1920 2016-10-12  Yusuke Suzuki  <utatane.tea@gmail.com>
1921
1922         [DOMJIT][JSC] Explore the way to embed nodeType into JSC::JSType in WebCore
1923         https://bugs.webkit.org/show_bug.cgi?id=163245
1924
1925         Reviewed by Filip Pizlo.
1926
1927         Node.nodeType accessor is so frequently called. For example, jQuery's $ function uses
1928         this to distinguish DOM objects from the other JS objects. So every time you call `$(dom)`,
1929         nodeType accessor is called. In addition to that, jQuery's prev, next, parent etc. also uses
1930         this `nodeType`. And Ember.js also uses it. And ... So this function is super critical for DOM
1931         performance.
1932
1933         The challenge is that there is no room for putting NodeType into C++ Node class. Node class
1934         has a 32bit field to store some data. However, these bits are already exhausted. Extending
1935         Node class is unacceptable since it significantly enlarges memory consumption of WebKit (Node
1936         is everywhere!). Unfortunately, current Node::nodeType is implemented as a virtual function
1937         even though this function is frequently called from JS world.
1938
1939         Interestingly, we already store some duplicate data in JSObject, JSC::JSType. WebCore already
1940         extends it with JSElementType, JSNodeType, and JSDocumentWrapperType. And these types are
1941         corresponding to specific NodeTypes. For example, JSElementType should have ELEMENT_NODE type.
1942
1943         This patch further extends this JSC::JSType in WebCore side safely. We embed NodeType bits into
1944         JSC::JSType. This design offers significantly faster nodeType implementation. Furthermore, it
1945         makes DOMJIT easy for nodeType accessor.
1946
1947         Even without the IC change[1], Dromaeo dom-query shows 8 - 10% improvement,
1948         1452.96 runs/s vs 1578.56 runs/s. We can expect that this improvement will be applied to the
1949         other benchmarks / real applications when the IC change is landed.
1950
1951         [1]: https://bugs.webkit.org/show_bug.cgi?id=163226
1952
1953         * WebCore.xcodeproj/project.pbxproj:
1954         * bindings/js/JSDOMWrapper.h:
1955         * bindings/js/JSNodeCustom.h:
1956         (WebCore::JSNode::nodeType):
1957         * bindings/scripts/CodeGeneratorJS.pm:
1958         (GetJSTypeForNode):
1959         (GenerateHeader):
1960         * dom/Node.idl:
1961         * dom/NodeConstants.h: Copied from Source/JavaScriptCore/domjit/DOMJITGetterSetter.h.
1962         * domjit/JSNodeDOMJIT.cpp:
1963         (WebCore::createCallDOMForOffsetAccess):
1964         (WebCore::NodeFirstChildDOMJIT::callDOM):
1965         (WebCore::NodeLastChildDOMJIT::callDOM):
1966         (WebCore::NodeNextSiblingDOMJIT::callDOM):
1967         (WebCore::NodePreviousSiblingDOMJIT::callDOM):
1968         (WebCore::NodeParentNodeDOMJIT::callDOM):
1969         (WebCore::NodeNodeTypeDOMJIT::checkDOM):
1970         (WebCore::NodeNodeTypeDOMJIT::callDOM):
1971
1972 2016-10-12  Chris Dumez  <cdumez@apple.com>
1973
1974         Update more events to stop using legacy [ConstructorTemplate=Event]
1975         https://bugs.webkit.org/show_bug.cgi?id=163339
1976
1977         Reviewed by Ryosuke Niwa.
1978
1979         Update more events to stop using legacy [ConstructorTemplate=Event]
1980         and use regular constructors instead.
1981
1982         No new tests, updated existing tests.
1983
1984         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
1985         (WebCore::convertDictionary<TestEventConstructor::Init>):
1986         (WebCore::JSTestEventConstructorConstructor::construct):
1987         (WebCore::JSTestEventConstructorConstructor::prototypeForStructure):
1988         (WebCore::JSTestEventConstructor::JSTestEventConstructor):
1989         (WebCore::JSTestEventConstructor::createPrototype):
1990         (WebCore::JSTestEventConstructorPrototype::create): Deleted.
1991         (WebCore::JSTestEventConstructorPrototype::createStructure): Deleted.
1992         (WebCore::JSTestEventConstructorPrototype::JSTestEventConstructorPrototype): Deleted.
1993         (WebCore::setJSTestEventConstructorConstructor): Deleted.
1994         (WebCore::JSTestEventConstructor::getConstructor): Deleted.
1995         * bindings/scripts/test/JS/JSTestEventConstructor.h:
1996         (WebCore::JSTestEventConstructor::wrapped):
1997         (WebCore::JSTestEventConstructor::create): Deleted.
1998         (WebCore::toJS): Deleted.
1999         (WebCore::toJSNewlyCreated): Deleted.
2000         * bindings/scripts/test/TestEventConstructor.idl:
2001         * css/CSSFontFaceLoadEvent.cpp:
2002         (WebCore::CSSFontFaceLoadEvent::CSSFontFaceLoadEvent):
2003         * css/CSSFontFaceLoadEvent.h:
2004         * css/CSSFontFaceLoadEvent.idl:
2005         * html/canvas/WebGLContextEvent.cpp:
2006         (WebCore::WebGLContextEvent::WebGLContextEvent):
2007         * html/canvas/WebGLContextEvent.h:
2008         * html/canvas/WebGLContextEvent.idl:
2009         * storage/StorageEvent.cpp:
2010         (WebCore::StorageEvent::create):
2011         (WebCore::StorageEvent::StorageEvent):
2012         * storage/StorageEvent.h:
2013         * storage/StorageEvent.idl:
2014
2015 2016-10-12  Andreas Kling  <akling@apple.com>
2016
2017         Make Document::existingAXObjectCache() fast with accessibility disabled.
2018         <https://webkit.org/b/163347>
2019
2020         Reviewed by Antti Koivisto.
2021
2022         Instruments says we were spending 2.3% of Dromaeo/dom-modify.html in this function,
2023         traversing ancestors. Track whether we've ever had a cache, and use that knowledge
2024         to return early if possible.
2025
2026         * dom/Document.cpp:
2027         (WebCore::Document::existingAXObjectCache):
2028         (WebCore::Document::axObjectCache):
2029
2030 2016-10-12  Jeremy Huddleston Sequoia  <jeremyhu@apple.com>
2031
2032         [SOUP] trunk r207192 fails to compile due to missing std::function being unavailable (missing #include <functional>)
2033         https://bugs.webkit.org/show_bug.cgi?id=163340
2034
2035         Reviewed by Michael Catanzaro.
2036
2037         * platform/network/soup/SoupNetworkSession.h: Add missing #include <functional>
2038
2039 2016-10-12  Brent Fulgham  <bfulgham@apple.com>
2040
2041         [WebGL] Revise vertex array attribute checks to account for lazy memory allocation.
2042         https://bugs.webkit.org/show_bug.cgi?id=163149
2043         <rdar://problem/28629774>
2044
2045         Reviewed by Dean Jackson.
2046
2047         Tested by fast/canvas/webgl/webgl-drawarrays-crash-2.html
2048
2049         * html/canvas/WebGLRenderingContextBase.cpp:
2050         (WebCore::WebGLRenderingContextBase::validateVertexAttributes):
2051
2052 2016-10-12  Wenson Hsieh  <wenson_hsieh@apple.com>
2053
2054         Now playing media sessions are always cleared for the active foreground tab
2055         https://bugs.webkit.org/show_bug.cgi?id=163310
2056         <rdar://problem/28573301>
2057
2058         Reviewed by Jer Noble.
2059
2060         Currently, we clear out Now Playing info whenever we set the visibility of Now Playing controls to Never. This
2061         is incorrect, as the Now Playing session needs to still be active (just not visible) in this state. Instead, we
2062         should not be taking the active/foregrounded-ness of a media session for Now Playing into account in
2063         MediaElementSession::canShowControlsManager so that even if a media session is in the active/foreground tab, we
2064         will update the Now Playing session with the latest info. However, when setting the visibility, we now check
2065         and see if the session allows Now Playing visibility, and set the Now Playing visibility to Always or Never
2066         depending on the answer.
2067
2068         Tweaked existing unit tests in NowPlayingControlsTests.
2069
2070         * html/MediaElementSession.cpp:
2071         (WebCore::MediaElementSession::canShowControlsManager):
2072         (WebCore::MediaElementSession::allowsNowPlayingControlsVisibility):
2073         (WebCore::MediaElementSession::pageAllowsNowPlayingControls): Deleted.
2074         * html/MediaElementSession.h:
2075         * platform/audio/PlatformMediaSession.h:
2076         (WebCore::PlatformMediaSession::allowsNowPlayingControlsVisibility):
2077         * platform/audio/mac/MediaSessionManagerMac.mm:
2078         (WebCore::MediaSessionManagerMac::updateNowPlayingInfo):
2079
2080 2016-10-12  Zalan Bujtas  <zalan@apple.com>
2081
2082         Refactor LineLayoutState's float box handling.
2083         https://bugs.webkit.org/show_bug.cgi?id=163286
2084
2085         Reviewed by David Hyatt.
2086         
2087         We keep track of float boxes both per line (RootInlineBox::m_floats) and
2088         per flow block (LineLayoutState::m_floats) during layout.
2089         As we lay out the lines and iterate through RootInlineBox::m_floats, we
2090         increment LineLayoutState::m_floatIndex. This LineLayoutState::m_floatIndex is
2091         later used to find the matching float box in the per-block-flow float list.
2092         This logic works fine as long as the lists and the index manipulation are tightly coded.
2093         However due to the complexity of the line/float layout code, this is no longer the case.
2094
2095         This patch makes float box handling more secure by changing this index based setup
2096         to a list iterator. It helps to eliminate potential vector overflow issues.
2097
2098         LineLayoutState::FloatList (new class) keeps track of all the floats for the block flow.
2099         It groups the float box related functions/members and provides an iterator interface to ensure safer
2100         syncing between this and the line based floats.
2101
2102         No change in functionality.
2103
2104         * rendering/RenderBlockFlow.h:
2105         * rendering/RenderBlockLineLayout.cpp:
2106         (WebCore::RenderBlockFlow::appendFloatingObjectToLastLine):
2107         (WebCore::repaintDirtyFloats):
2108         (WebCore::RenderBlockFlow::layoutRunsAndFloats):
2109         (WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):
2110         (WebCore::RenderBlockFlow::linkToEndLineIfNeeded):
2111         (WebCore::RenderBlockFlow::layoutLineBoxes):
2112         (WebCore::RenderBlockFlow::checkFloatInCleanLine):
2113         (WebCore::RenderBlockFlow::determineStartPosition):
2114         (WebCore::RenderBlockFlow::determineEndPosition):
2115         (WebCore::RenderBlockFlow::repaintDirtyFloats): Deleted.
2116         (WebCore::RenderBlockFlow::checkFloatsInCleanLine): Deleted.
2117         * rendering/line/LineLayoutState.h:
2118         (WebCore::FloatWithRect::create):
2119         (WebCore::FloatWithRect::renderer):
2120         (WebCore::FloatWithRect::rect):
2121         (WebCore::FloatWithRect::everHadLayout):
2122         (WebCore::FloatWithRect::adjustRect):
2123         (WebCore::FloatWithRect::FloatWithRect):
2124         (WebCore::LineLayoutState::FloatList::append):
2125         (WebCore::LineLayoutState::FloatList::setLastFloat):
2126         (WebCore::LineLayoutState::FloatList::lastFloat):
2127         (WebCore::LineLayoutState::FloatList::setLastCleanFloat):
2128         (WebCore::LineLayoutState::FloatList::lastCleanFloat):
2129         (WebCore::LineLayoutState::FloatList::floatWithRect):
2130         (WebCore::LineLayoutState::FloatList::begin):
2131         (WebCore::LineLayoutState::FloatList::end):
2132         (WebCore::LineLayoutState::FloatList::find):
2133         (WebCore::LineLayoutState::FloatList::isEmpty):
2134         (WebCore::LineLayoutState::LineLayoutState):
2135         (WebCore::LineLayoutState::floatList):
2136         (WebCore::LineLayoutState::lastFloat): Deleted.
2137         (WebCore::LineLayoutState::setLastFloat): Deleted.
2138         (WebCore::LineLayoutState::floats): Deleted.
2139         (WebCore::LineLayoutState::floatIndex): Deleted.
2140         (WebCore::LineLayoutState::setFloatIndex): Deleted.
2141
2142 2016-10-12  Said Abou-Hallawa  <sabouhallawa@apple.com>
2143
2144         Unreviewed, fix Windows build break after r207182.
2145
2146         * platform/graphics/cg/ImageDecoderCG.cpp:
2147
2148 2016-10-12  Chris Dumez  <cdumez@apple.com>
2149
2150         Update remaining DOM events to stop using legacy [ConstructorTemplate=Event]
2151         https://bugs.webkit.org/show_bug.cgi?id=163319
2152
2153         Reviewed by Darin Adler.
2154
2155         Update remaining DOM events to stop using legacy [ConstructorTemplate=Event]
2156         and use regular constructors instead.
2157
2158         No new tests, updated existing tests.
2159
2160         * dom/AutocompleteErrorEvent.h:
2161         * dom/AutocompleteErrorEvent.idl:
2162         * dom/BeforeLoadEvent.h:
2163         * dom/BeforeLoadEvent.idl:
2164         * dom/CompositionEvent.cpp:
2165         (WebCore::CompositionEvent::CompositionEvent):
2166         * dom/CompositionEvent.h:
2167         * dom/CompositionEvent.idl:
2168         * dom/ErrorEvent.cpp:
2169         (WebCore::ErrorEvent::ErrorEvent):
2170         * dom/ErrorEvent.h:
2171         * dom/ErrorEvent.idl:
2172         * dom/FocusEvent.cpp:
2173         (WebCore::FocusEvent::FocusEvent):
2174         * dom/FocusEvent.h:
2175         * dom/FocusEvent.idl:
2176         * dom/HashChangeEvent.h:
2177         * dom/HashChangeEvent.idl:
2178         * dom/OverflowEvent.cpp:
2179         (WebCore::OverflowEvent::OverflowEvent):
2180         * dom/OverflowEvent.h:
2181         * dom/OverflowEvent.idl:
2182         * dom/PageTransitionEvent.cpp:
2183         (WebCore::PageTransitionEvent::PageTransitionEvent):
2184         * dom/PageTransitionEvent.h:
2185         * dom/PageTransitionEvent.idl:
2186         * dom/PopStateEvent.cpp:
2187         (WebCore::PopStateEvent::PopStateEvent):
2188         (WebCore::PopStateEvent::create):
2189         * dom/PopStateEvent.h:
2190         * dom/PopStateEvent.idl:
2191         * dom/SecurityPolicyViolationEvent.h:
2192         * dom/SecurityPolicyViolationEvent.idl:
2193         * dom/TouchEvent.cpp:
2194         (WebCore::TouchEvent::TouchEvent):
2195         * dom/TouchEvent.h:
2196         * dom/TouchEvent.idl:
2197         * dom/TransitionEvent.cpp:
2198         (WebCore::TransitionEvent::TransitionEvent):
2199         * dom/TransitionEvent.h:
2200         * dom/TransitionEvent.idl:
2201         * dom/WebKitAnimationEvent.cpp:
2202         (WebCore::WebKitAnimationEvent::WebKitAnimationEvent):
2203         * dom/WebKitAnimationEvent.h:
2204         * dom/WebKitAnimationEvent.idl:
2205         * dom/WebKitTransitionEvent.cpp:
2206         (WebCore::WebKitTransitionEvent::WebKitTransitionEvent):
2207         * dom/WebKitTransitionEvent.h:
2208         * dom/WebKitTransitionEvent.idl:
2209
2210 2016-10-12  Chris Dumez  <cdumez@apple.com>
2211
2212         Stop using PassRefPtr in platform/efl
2213         https://bugs.webkit.org/show_bug.cgi?id=163321
2214
2215         Reviewed by Laszlo Gombos.
2216
2217         Stop using PassRefPtr in platform/efl.
2218
2219         * platform/efl/BatteryProviderEfl.cpp:
2220         (WebCore::batteryProperties):
2221         (WebCore::BatteryProviderEfl::setBatteryStatus):
2222         (WebCore::BatteryProviderEfl::dispatchEvent):
2223         * platform/efl/BatteryProviderEfl.h:
2224         * platform/efl/BatteryProviderEflClient.h:
2225         * platform/efl/PlatformSpeechSynthesisProviderEfl.cpp:
2226         (WebCore::PlatformSpeechSynthesisProviderEfl::voiceName):
2227         (WebCore::PlatformSpeechSynthesisProviderEfl::speak):
2228         * platform/efl/PlatformSpeechSynthesisProviderEfl.h:
2229
2230 2016-10-12  Youenn Fablet  <youenn@apple.com>
2231
2232         Attribute setter binding generated code should use more references
2233         https://bugs.webkit.org/show_bug.cgi?id=163275
2234
2235         Reviewed by Alex Christensen.
2236
2237         No change of behavior.
2238
2239         * bindings/scripts/CodeGeneratorJS.pm:
2240         (JSValueToNative):
2241         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
2242         * bindings/scripts/test/JS/JSTestInterface.cpp:
2243         * bindings/scripts/test/JS/JSTestNode.cpp:
2244         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
2245         * bindings/scripts/test/JS/JSTestObj.cpp:
2246         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
2247         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
2248
2249 2016-10-11  Youenn Fablet  <youenn@apple.com>
2250
2251         Refactor binding generated casted-this checks for methods
2252         https://bugs.webkit.org/show_bug.cgi?id=163198
2253
2254         Reviewed by Darin Adler.
2255
2256         Covered by existing tests and binding rebased tests..
2257
2258         Introducing BindingCaller::callMethod and callPromiseMethod to encapsulate casted-this checks for methods.
2259         This is supported for all methods except seralizer and iterators methods.
2260
2261         Introduced castForMethod similarly to castForAttribute.
2262         Moved this from static methods of JSClass to static methods of BindingCaller<JSClass>
2263         This allows removing the corresponding declarations from JSClass header file.
2264
2265         Note the difference of handling thisValue between the two in case of CustomProxyToJSObject.
2266         This should be made more consistent.
2267
2268         In case of bad casted this check, CustomProxyToJSObject objects will throw a TypeError with an error message like other methods.
2269         Before the patch, a TypeError without error message was thrown.
2270
2271         EventTarget being different, added a specialization of BindingCaller for it.
2272         This allows also removing some binding generated code dedicated to EventTarget.
2273         A similar approach might also be done for CustomProxyToJSObject objects to further simplify the binding generator.
2274
2275
2276         * bindings/js/JSDOMBinding.cpp:
2277         (WebCore::rejectPromiseWithThisTypeError):
2278         * bindings/js/JSDOMBinding.h:
2279         (WebCore::BindingCaller::callPromiseMethod):
2280         (WebCore::BindingCaller::callMethod):
2281         * bindings/js/JSEventTargetCustom.h:
2282         (WebCore::BindingCaller<JSEventTarget>::callMethod):
2283         * bindings/scripts/CodeGeneratorJS.pm:
2284         (GenerateHeader):
2285         (GenerateImplementation):
2286         (GenerateFunctionCastedThis): Deleted.
2287         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
2288         * bindings/scripts/test/JS/JSTestActiveDOMObject.h:
2289         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
2290         * bindings/scripts/test/JS/JSTestCustomNamedGetter.h:
2291         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
2292         * bindings/scripts/test/JS/JSTestEventTarget.h:
2293         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
2294         * bindings/scripts/test/JS/JSTestGlobalObject.h:
2295         * bindings/scripts/test/JS/JSTestInterface.cpp:
2296         * bindings/scripts/test/JS/JSTestInterface.h:
2297         * bindings/scripts/test/JS/JSTestIterable.cpp:
2298         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
2299         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.h:
2300         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
2301         * bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
2302         * bindings/scripts/test/JS/JSTestNode.cpp:
2303         * bindings/scripts/test/JS/JSTestNode.h:
2304         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
2305         * bindings/scripts/test/JS/JSTestNondeterministic.h:
2306         * bindings/scripts/test/JS/JSTestObj.cpp:
2307         * bindings/scripts/test/JS/JSTestObj.h:
2308         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
2309         * bindings/scripts/test/JS/JSTestOverrideBuiltins.h:
2310         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
2311         * bindings/scripts/test/JS/JSTestTypedefs.h:
2312
2313 2016-10-11  Youenn Fablet  <youenn@apple.com>
2314
2315         MediaResourceLoader::requestResource should take a ResourceRequest&& as input
2316         https://bugs.webkit.org/show_bug.cgi?id=160397
2317
2318         Reviewed by Alex Christensen.
2319
2320         No change in behavior.
2321
2322         * loader/MediaResourceLoader.cpp:
2323         (WebCore::MediaResourceLoader::requestResource): Passing a ResourceRequest&& as input parameter.
2324         * loader/MediaResourceLoader.h:
2325         * platform/graphics/PlatformMediaResourceLoader.h: Ditto.
2326         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
2327         (webKitWebSrcStart): Creating an extra copy since MediaResourceLoader::requestResource expects a Resourcerequest&&.
2328
2329 2016-10-11  Chris Dumez  <cdumez@apple.com>
2330
2331         Update AnimationEvent to stop using legacy [ConstructorTemplate=Event]
2332         https://bugs.webkit.org/show_bug.cgi?id=163312
2333
2334         Reviewed by Ryosuke Niwa.
2335
2336         Update AnimationEvent to stop using legacy [ConstructorTemplate=Event]
2337         and use a regular constructor as in the specification:
2338         - https://drafts.csswg.org/css-animations/#interface-animationevent
2339
2340         * dom/AnimationEvent.cpp:
2341         (WebCore::AnimationEvent::AnimationEvent):
2342         * dom/AnimationEvent.h:
2343         * dom/AnimationEvent.idl:
2344
2345 2016-10-11  Chris Dumez  <cdumez@apple.com>
2346
2347         Update DeviceProximityEvent to stop using legacy [ConstructorTemplate=Event]
2348         https://bugs.webkit.org/show_bug.cgi?id=163311
2349
2350         Reviewed by Ryosuke Niwa.
2351
2352         Update DeviceProximityEvent to stop using legacy [ConstructorTemplate=Event]
2353         and use a regular constructor instead, as in the specification:
2354         - https://www.w3.org/TR/2015/WD-proximity-20150903/#deviceproximityevent-interface
2355
2356         * Modules/proximity/DeviceProximityEvent.cpp:
2357         (WebCore::DeviceProximityEvent::DeviceProximityEvent):
2358         * Modules/proximity/DeviceProximityEvent.h:
2359         (WebCore::DeviceProximityEvent::create):
2360         (WebCore::DeviceProximityEventInit::DeviceProximityEventInit): Deleted.
2361         * Modules/proximity/DeviceProximityEvent.idl:
2362
2363 2016-10-11  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
2364
2365         Unreviewed, EFL build fix because of r207173.
2366
2367         * testing/InternalSettings.cpp:
2368         (WebCore::InternalSettings::forcedPrefersReducedMotionValue):
2369
2370 2016-10-11  Said Abou-Hallawa  <sabouhallawa@apple.com>
2371
2372         [CG] Add the option to immediately decode an image frame and control its memory caching
2373         https://bugs.webkit.org/show_bug.cgi?id=163298
2374
2375         Reviewed by Simon Fraser.
2376
2377         This patch fixes two things. (1) An option is added to immediately decode an
2378         image frame. This can be done by adding kCGImageSourceShouldCacheImmediately
2379         to the ImageSource options dictionary. (2) BitmapImage should also control
2380         when the image frame is actually deleted from memory. This can be done by
2381         calling CGImageSourceCreateThumbnailAtIndex(). CG does not keep a reference
2382         to the returned CGImageRef.
2383
2384         * platform/graphics/ImageFrame.h: Adding the DecodingMode enum class.
2385         Ideally this should be a member of ImageDecoder class. But since we
2386         have three header files for ImageDecoder, this can be added here till
2387         the three files combined in one header file.
2388
2389         * platform/graphics/ImageFrameCache.cpp:
2390         (WebCore::ImageFrameCache::setRenderTarget): Deleted.
2391         * platform/graphics/ImageFrameCache.h:
2392         * platform/graphics/ImageSource.cpp:
2393         (WebCore::ImageSource::setRenderTarget):
2394         * platform/graphics/ImageSource.h:
2395         (WebCore::ImageSource::setRenderTarget): Deleted.
2396         Unrelated change. The native image decoder is available from the ImageSource.
2397         ImageSource::setTarget() does not need not to get it through ImageFrameCache.
2398         
2399         * platform/graphics/cg/ImageDecoderCG.cpp:
2400         (WebCore::createImageSourceOptions): Clean this function by using CFMutableDictionary.
2401         (WebCore::imageSourceOptions): Cache two default ImageSource options and create new
2402         ones for the non default cases.
2403
2404         (WebCore::ImageDecoder::createFrameImageAtIndex): Use the appropriate ImageSource function
2405
2406         * platform/graphics/cg/ImageDecoderCG.h:
2407         * platform/graphics/win/ImageDecoderDirect2D.cpp:
2408         (WebCore::ImageDecoder::createFrameImageAtIndex):
2409         * platform/graphics/win/ImageDecoderDirect2D.h:
2410         * platform/image-decoders/ImageDecoder.cpp:
2411         (WebCore::ImageDecoder::createFrameImageAtIndex):
2412         * platform/image-decoders/ImageDecoder.h:
2413          Change functions' signature to include a DecodingMode argument.
2414
2415 2016-10-11  Chris Dumez  <cdumez@apple.com>
2416
2417         select.options may return too many option elements
2418         https://bugs.webkit.org/show_bug.cgi?id=163296
2419
2420         Reviewed by Ryosuke Niwa.
2421
2422         select.options may return too many option elements. We're only supposed
2423         to return the option element children of the select element, and the
2424         option element children of all the optgroup element children of the
2425         select element, in tree order:
2426         - https://html.spec.whatwg.org/#dom-select-options
2427         - https://html.spec.whatwg.org/#concept-select-option-list
2428
2429         Firefox and Chrome agrees with the specification. However, WebKit was
2430         returning all the option elements that are descendants of the select
2431         element.
2432
2433         Test: imported/w3c/web-platform-tests/html/infrastructure/common-dom-interfaces/collections/htmloptionscollection.html
2434
2435         * html/HTMLOptionsCollection.h:
2436
2437 2016-10-11  Alex Christensen  <achristensen@webkit.org>
2438
2439         Fix assertion when creating first WebCore::URL from non-main thread after r207162
2440         https://bugs.webkit.org/show_bug.cgi?id=163304
2441
2442         Reviewed by Filip Pizlo.
2443
2444         This fixes assertions when running UserContentWorld.NormalWorld API tests.
2445
2446         * platform/text/TextEncodingRegistry.cpp:
2447         (WebCore::buildBaseTextCodecMaps):
2448         (WebCore::atomicCanonicalTextEncodingName):
2449         The new URLParser requires a TextEncoding& in its constructor, which defaults to UTF8Encoding.
2450         When creating the first TextEncoding in a process, it calls buildBaseTextCodecMaps which asserts
2451         it's on the main thread because it initializes static variables.  Since we are getting a lock right 
2452         after this call anyway, just put this function call inside the lock.
2453
2454 2016-10-11  Dean Jackson  <dino@apple.com>
2455
2456         color-gamut media query shouldn't ASSERT on invalid values
2457         https://bugs.webkit.org/show_bug.cgi?id=163303
2458         <rdar://problem/28724566>
2459
2460         Reviewed by Simon Fraser.
2461
2462         Remove the ASSERT_NOT_REACHED in the evaluation, since it
2463         can be hit when there is a valid CSS keyword that is not
2464         expected in the query.
2465
2466         Updated fast/media/mq-color-gamut.html
2467
2468         * css/MediaQueryEvaluator.cpp:
2469         (WebCore::colorGamutEvaluate):
2470
2471 2016-10-11  Chris Dumez  <cdumez@apple.com>
2472
2473         Update MediaStream events to stop using legacy [ConstructorTemplate=Event]
2474         https://bugs.webkit.org/show_bug.cgi?id=163289
2475
2476         Reviewed by Sam Weinig.
2477
2478         Update MediaStream events to stop using legacy [ConstructorTemplate=Event]
2479         and use regular constructors instead.
2480
2481         * Modules/mediastream/MediaStreamEvent.cpp:
2482         (WebCore::MediaStreamEvent::create):
2483         (WebCore::MediaStreamEvent::MediaStreamEvent):
2484         * Modules/mediastream/MediaStreamEvent.h:
2485         * Modules/mediastream/MediaStreamEvent.idl:
2486         * Modules/mediastream/MediaStreamTrackEvent.cpp:
2487         (WebCore::MediaStreamTrackEvent::create):
2488         (WebCore::MediaStreamTrackEvent::MediaStreamTrackEvent):
2489         * Modules/mediastream/MediaStreamTrackEvent.h:
2490         * Modules/mediastream/MediaStreamTrackEvent.idl:
2491         * Modules/mediastream/OverconstrainedErrorEvent.h:
2492         (WebCore::OverconstrainedErrorEvent::create):
2493         (WebCore::OverconstrainedErrorEvent::OverconstrainedErrorEvent):
2494         (WebCore::OverconstrainedErrorEvent::~OverconstrainedErrorEvent): Deleted.
2495         * Modules/mediastream/OverconstrainedErrorEvent.idl:
2496         * Modules/mediastream/RTCDTMFToneChangeEvent.cpp:
2497         (WebCore::RTCDTMFToneChangeEvent::create):
2498         (WebCore::RTCDTMFToneChangeEvent::RTCDTMFToneChangeEvent):
2499         * Modules/mediastream/RTCDTMFToneChangeEvent.h:
2500         * Modules/mediastream/RTCDTMFToneChangeEvent.idl:
2501         * Modules/mediastream/RTCTrackEvent.cpp:
2502         (WebCore::RTCTrackEvent::create):
2503         (WebCore::RTCTrackEvent::RTCTrackEvent):
2504         * Modules/mediastream/RTCTrackEvent.h:
2505         * Modules/mediastream/RTCTrackEvent.idl:
2506
2507 2016-10-11  Chris Dumez  <cdumez@apple.com>
2508
2509         Update UIRequestEvent to stop using legacy [ConstructorTemplate=Event]
2510         https://bugs.webkit.org/show_bug.cgi?id=163288
2511
2512         Reviewed by Darin Adler.
2513
2514         Update UIRequestEvent to stop using legacy [ConstructorTemplate=Event]
2515         and use a constructor as in the specification:
2516         - https://dvcs.w3.org/hg/IndieUI/raw-file/default/src/indie-ui-events.html#UIRequestEvent
2517
2518         * Modules/indieui/UIRequestEvent.cpp:
2519         (WebCore::UIRequestEvent::create):
2520         (WebCore::UIRequestEvent::UIRequestEvent):
2521         (WebCore::UIRequestEvent::createForBindings): Deleted.
2522         * Modules/indieui/UIRequestEvent.h:
2523         * Modules/indieui/UIRequestEvent.idl:
2524
2525 2016-10-11  Dean Jackson  <dino@apple.com>
2526
2527         Implement prefers-reduced-motion media query
2528         https://bugs.webkit.org/show_bug.cgi?id=163250
2529         <rdar://problem/28704129>
2530
2531         Reviewed by Simon Fraser.
2532
2533         Implement the prefers-reduced-motion media query, as
2534         described in https://github.com/w3c/csswg-drafts/issues/442.
2535
2536         Tests: fast/media/mq-prefers-reduced-motion-forced-value.html
2537                fast/media/mq-prefers-reduced-motion.html
2538
2539         * Configurations/WebCoreTestSupport.xcconfig: Link against AppKit and UIKit.
2540
2541         * css/CSSValueKeywords.in: New keyword for "reduce".
2542
2543         * css/MediaFeatureNames.h: Add prefers-reduced-motion.
2544         * css/MediaQueryEvaluator.cpp:
2545         (WebCore::prefersReducedMotionEvaluate):
2546         * css/MediaQueryExp.cpp:
2547         (WebCore::featureWithValidIdent):
2548         (WebCore::isFeatureValidWithoutValue):
2549
2550         * platform/Theme.h: New API to detect the system accessibility settings.
2551         (WebCore::Theme::userPrefersReducedMotion):
2552         * platform/ios/ThemeIOS.h:
2553         * platform/ios/ThemeIOS.mm:
2554         (WebCore::ThemeIOS::userPrefersReducedMotion):
2555         * platform/mac/ThemeMac.h:
2556         * platform/mac/ThemeMac.mm:
2557         (WebCore::ThemeMac::userPrefersReducedMotion):
2558
2559         * testing/Internals.cpp: Expose the same API to internals, so that
2560         a test can examine the value too.
2561         (WebCore::Internals::userPrefersReducedMotion):
2562         * testing/Internals.h:
2563         * testing/Internals.idl:
2564         * testing/Internals.mm:
2565         (WebCore::Internals::userPrefersReducedMotion):
2566
2567         * page/Settings.h: New setting to override the system value...
2568         * page/Settings.in:
2569
2570         * testing/InternalSettings.cpp: ... plumbed through internals.
2571         (WebCore::InternalSettings::Backup::Backup):
2572         (WebCore::InternalSettings::Backup::restoreTo):
2573         (WebCore::InternalSettings::forcedPrefersReducedMotionValue):
2574         (WebCore::InternalSettings::setForcedPrefersReducedMotionValue):
2575         * testing/InternalSettings.h:
2576         * testing/InternalSettings.idl:
2577         * testing/Internals.cpp:
2578         (WebCore::Internals::userPrefersReducedMotion):
2579         * testing/Internals.h:
2580         * testing/Internals.idl:
2581         * testing/Internals.mm:
2582         (WebCore::Internals::userPrefersReducedMotion):
2583
2584
2585 2016-10-10  Ryosuke Niwa  <rniwa@webkit.org>
2586
2587         Annotate DOM API with CEReactions
2588         https://bugs.webkit.org/show_bug.cgi?id=163268
2589
2590         Reviewed by Darin Adler.
2591
2592         Added CEReactions IDL attribute to APIs defined in https://dom.spec.whatwg.org.
2593
2594         No new tests since existing tests cover the code change.
2595         Added a dedicated code generation test: JSTestCEReactions.idl and TestCEReactionsStringifier.idl.
2596
2597         * bindings/scripts/CodeGeneratorJS.pm:
2598         (GenerateImplementation): Generate CustomElementReactionStack in attribute setters. In the case of PutForwards,
2599         check the extended attributes of the target attribute's stringifier.
2600         * bindings/scripts/test/JS/JSTestCEReactions.cpp: Added.
2601         * bindings/scripts/test/JS/JSTestCEReactions.h: Added.
2602         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp: Added.
2603         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.h: Added.
2604         * bindings/scripts/test/JS/JSTestObj.cpp:
2605         (WebCore::jsTestObjPrototypeFunctionMethodWithNeedsCustomElementReactionStack): Deleted.
2606         * bindings/scripts/test/TestCEReactions.idl: Added.
2607         * bindings/scripts/test/TestCEReactionsStringifier.idl: Added.
2608         * bindings/scripts/test/TestObj.idl:
2609         * dom/Attr.idl:
2610         * dom/ChildNode.idl:
2611         * dom/Document.idl:
2612         * dom/Element.idl:
2613         * dom/NamedNodeMap.idl:
2614         * dom/Node.idl:
2615         * dom/ParentNode.idl:
2616         * dom/Range.idl:
2617         * html/DOMTokenList.idl:
2618
2619 2016-10-11  Chris Dumez  <cdumez@apple.com>
2620
2621         Update CloseEvent to stop using legacy [ConstructorTemplate=Event]
2622         https://bugs.webkit.org/show_bug.cgi?id=163293
2623
2624         Reviewed by Darin Adler.
2625
2626         Update CloseEvent to stop using legacy [ConstructorTemplate=Event] and
2627         use a regular constructor as in the specification:
2628         - https://html.spec.whatwg.org/multipage/comms.html#the-closeevent-interfaces
2629
2630         No new tests, updated existing test.
2631
2632         * Modules/websockets/CloseEvent.h:
2633         (WebCore::CloseEvent::create):
2634         (WebCore::CloseEvent::CloseEvent):
2635         * Modules/websockets/CloseEvent.idl:
2636
2637 2016-10-11  Yusuke Suzuki  <utatane.tea@gmail.com>
2638
2639         [DOMJIT] DOMJIT::Patchpoint should have a way to receive constant folded arguments
2640         https://bugs.webkit.org/show_bug.cgi?id=163224
2641
2642         Reviewed by Filip Pizlo.
2643
2644         * domjit/DOMJITHelpers.h:
2645         (WebCore::DOMJITHelpers::toWrapper):
2646         * domjit/JSNodeDOMJIT.cpp:
2647         (WebCore::createCallDOMForOffsetAccess):
2648
2649 2016-10-11  Alex Christensen  <achristensen@webkit.org>
2650
2651         Enable URLParser by default
2652         https://bugs.webkit.org/show_bug.cgi?id=162660
2653         <rdar://28601706>
2654
2655         Reviewed by Sam Weinig.
2656
2657         Covered by updates to many LayoutTests.
2658
2659         * platform/URLParser.cpp:
2660         Make the default value true for URLParser::enabled.
2661         This is the most impactful and well-documented one-line change I've ever written.
2662
2663 2016-10-11  Daniel Bates  <dabates@apple.com>
2664
2665         [iOS] REGRESSION (r197953): User gesture required to load video in iOS 9-built apps
2666         https://bugs.webkit.org/show_bug.cgi?id=163244
2667         <rdar://problem/27250015>
2668
2669         Reviewed by Jer Noble.
2670
2671         Adds a new setting to toggle requiring a user gesture to load a video (enabled by default).
2672         Disable this setting for apps built against iOS 9 or earlier.
2673
2674         Tests: media/loadedmetadata-fires-without-user-gesture-when-setRequiresUserGestureToLoadVideo-false.html
2675                media/require-user-gesture-to-load-video.html
2676
2677         * html/HTMLMediaElement.cpp:
2678         (WebCore::HTMLMediaElement::HTMLMediaElement): Only require a user gesture to load a video
2679         when Settings::requiresUserGestureToLoadVideo() is true.
2680         * page/Settings.cpp: Enable setting requiresUserGestureToLoadVideo by default.
2681         * page/Settings.in: Add setting, requiresUserGestureToLoadVideo.
2682
2683 2016-10-11  Sam Weinig  <sam@webkit.org>
2684
2685         Fix the iOS build.
2686
2687         * bindings/js/JSDOMConvert.h:
2688
2689 2016-10-11  Daniel Bates  <dabates@apple.com>
2690
2691         [iOS] Sandbox QuickLook previews
2692         https://bugs.webkit.org/show_bug.cgi?id=163240
2693         <rdar://problem/25961633>
2694
2695         Fix bad merge following r207151.
2696
2697         * platform/network/cf/ResourceResponse.h: Define m_isQuickLook.
2698
2699 2016-10-11  Daniel Bates  <dabates@apple.com>
2700
2701         [iOS] Sandbox QuickLook previews
2702         https://bugs.webkit.org/show_bug.cgi?id=163240
2703         <rdar://problem/25961633>
2704
2705         Reviewed by Brent Fulgham.
2706
2707         Use a unique origin for- and limit the capabilities of- QuickLook previews.
2708
2709         Tests: http/tests/quicklook/at-import-stylesheet-blocked.html
2710                http/tests/quicklook/base-url-blocked.html
2711                http/tests/quicklook/cross-origin-iframe-blocked.html
2712                http/tests/quicklook/csp-header-ignored.html
2713                http/tests/quicklook/document-domain-is-empty-string.html
2714                http/tests/quicklook/external-stylesheet-blocked.html
2715                http/tests/quicklook/hide-referer-on-navigation.html
2716                http/tests/quicklook/submit-form-blocked.html
2717                http/tests/quicklook/top-navigation-blocked.html
2718
2719         * dom/Document.cpp:
2720         (WebCore::Document::processHttpEquiv): Call ContentSecurityPolicy::didReceiveHeader().
2721         (WebCore::Document::processReferrerPolicy): Do not process referrer policy for QuickLook previews.
2722         (WebCore::Document::initSecurityContext): Apply sandbox for QuickLook previews.
2723         (WebCore::Document::shouldEnforceQuickLookSandbox): Added.
2724         (WebCore::Document::applyQuickLookSandbox): Added.
2725         * dom/Document.h:
2726         * page/csp/ContentSecurityPolicy.h: Change accessibility of didReceiveHeader() from private to public.
2727         (WebCore::ContentSecurityPolicy::processHTTPEquiv): Deleted.
2728         * platform/network/cf/ResourceResponse.h:
2729         (WebCore::ResourceResponse::isQuickLook): Added.
2730         (WebCore::ResourceResponse::setIsQuickLook): Added.
2731         * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:
2732         (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveResponse): Modified to mark
2733         resource response as a QuickLook preview, if appropriate. Also remove the name of the first argument
2734         and the need to use UNUSED_PARAM(connection) as we no longer make use of the first argument
2735         following r207151.
2736         * platform/network/ios/QuickLook.mm:
2737         (-[WebResourceLoaderQuickLookDelegate _sendDidReceiveResponseIfNecessary]): Ditto.
2738         * platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
2739         (-[WebCoreResourceHandleAsDelegate connection:didReceiveResponse:]): Ditto. Fix style nits,
2740         including renaming the function argument "r" to "resource" to better describe its purpose.
2741
2742 2016-10-11  Alex Christensen  <achristensen@webkit.org>
2743
2744         Fix bindings tests after r207150.
2745
2746         * bindings/scripts/test/JS/JSTestObj.cpp:
2747         (WebCore::convertDictionary<TestObj::Dictionary>):
2748
2749 2016-10-11  Alex Christensen  <achristensen@webkit.org>
2750
2751         URLParser should percent-encode non-ASCII and non-printable characters in fragment
2752         https://bugs.webkit.org/show_bug.cgi?id=163287
2753
2754         Reviewed by Brady Eidson.
2755
2756         Based on discussion in https://github.com/whatwg/url/issues/150
2757         If that discussion decides to keep the spec as-is (which keeps non-ASCII characters in the fragment
2758         to match IE and Edge's behavior, which Chrome has followed for special schemes) then we can revert
2759         this change later after enabling the URL parser.  Making this change keeps behavior matching Safari
2760         and Firefox, as well as Chrome's handling of non-special schemes, such as data URLs.
2761
2762         Covered by updated API tests.
2763
2764         * platform/URLParser.cpp:
2765         (WebCore::URLParser::appendToASCIIBuffer):
2766         (WebCore::URLParser::copyURLPartsUntil):
2767         (WebCore::URLParser::syntaxViolation):
2768         (WebCore::URLParser::currentPosition):
2769         (WebCore::URLParser::parse):
2770         (WebCore::URLParser::fragmentSyntaxViolation): Deleted.
2771         * platform/URLParser.h:
2772         No more non-ASCII characters in canonicalized URLs.
2773
2774 2016-10-11  Alex Christensen  <achristensen@webkit.org>
2775
2776         Remove dead networking code
2777         https://bugs.webkit.org/show_bug.cgi?id=163263
2778
2779         Reviewed by Daniel Bates.
2780
2781         There are no more Cocoa platforms using CFURLConnection.
2782         USE(CFNETWORK) is being replaced by USE(CFURLCONNECTION) and it is only used on the AppleWin port.
2783
2784         No change in behavior.
2785
2786         * WebCore.xcodeproj/project.pbxproj:
2787         * WebCorePrefix.h:
2788         * loader/DocumentLoader.h:
2789         * loader/EmptyClients.h:
2790         * loader/FrameLoaderClient.h:
2791         * loader/ResourceLoader.cpp:
2792         (WebCore::ResourceLoader::didReceiveAuthenticationChallenge):
2793         * loader/ResourceLoader.h:
2794         * loader/SubresourceLoader.h:
2795         * loader/cf/ResourceLoaderCFNet.cpp:
2796         * loader/cocoa/SubresourceLoaderCocoa.mm:
2797         (WebCore::SubresourceLoader::willCacheResponse): Deleted.
2798         * loader/mac/DocumentLoaderMac.cpp:
2799         * loader/mac/ResourceLoaderMac.mm:
2800         (WebCore::ResourceLoader::willCacheResponse): Deleted.
2801         * page/mac/PageMac.mm:
2802         (WebCore::Page::platformInitialize):
2803         (WebCore::Page::addSchedulePair):
2804         (WebCore::Page::removeSchedulePair):
2805         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2806         (WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForResponseToAuthenticationChallenge):
2807         (WebCore::WebCoreNSURLAuthenticationChallengeClient::create): Deleted.
2808         (WebCore::WebCoreNSURLAuthenticationChallengeClient::WebCoreNSURLAuthenticationChallengeClient): Deleted.
2809         * platform/mac/WebCoreSystemInterface.h:
2810         * platform/network/NetworkStorageSession.h:
2811         * platform/network/ProtectionSpace.h:
2812         * platform/network/ProtectionSpaceBase.cpp:
2813         * platform/network/ResourceHandle.cpp:
2814         * platform/network/ResourceHandle.h:
2815         * platform/network/ResourceHandleClient.cpp:
2816         * platform/network/ResourceHandleClient.h:
2817         (WebCore::ResourceHandleClient::willCacheResponse):
2818         (WebCore::ResourceHandleClient::shouldCacheResponse):
2819         * platform/network/ResourceHandleInternal.h:
2820         (WebCore::ResourceHandleInternal::ResourceHandleInternal):
2821         * platform/network/ResourceRequestBase.cpp:
2822         * platform/network/cf/AuthenticationCF.cpp:
2823         (WebCore::AuthenticationChallenge::AuthenticationChallenge):
2824         (WebCore::createCF):
2825         (WebCore::core):
2826         * platform/network/cf/AuthenticationCF.h:
2827         * platform/network/cf/AuthenticationChallenge.h:
2828         * platform/network/cf/CookieJarCFNet.cpp:
2829         * platform/network/cf/CredentialStorageCFNet.cpp:
2830         (WebCore::CredentialStorage::getFromPersistentStorage):
2831         (WebCore::CredentialStorage::saveToPersistentStorage): Deleted.
2832         * platform/network/cf/LoaderRunLoopCF.cpp:
2833         * platform/network/cf/LoaderRunLoopCF.h:
2834         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
2835         (WebCore::NetworkStorageSession::cookieStorage):
2836         * platform/network/cf/ProtectionSpaceCFNet.cpp:
2837         * platform/network/cf/ProtectionSpaceCFNet.h:
2838         * platform/network/cf/ResourceError.h:
2839         * platform/network/cf/ResourceErrorCF.cpp:
2840         * platform/network/cf/ResourceHandleCFNet.cpp:
2841         (WebCore::shouldSniffConnectionProperty):
2842         (WebCore::ResourceHandle::createCFURLConnection):
2843         (WebCore::ResourceHandle::start):
2844         (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
2845         (WebCore::ResourceHandle::tryHandlePasswordBasedAuthentication):
2846         (WebCore::ResourceHandle::receivedCredential):
2847         (WebCore::ResourceHandle::schedule): Deleted.
2848         (WebCore::ResourceHandle::unschedule): Deleted.
2849         * platform/network/cf/ResourceHandleCFURLConnectionDelegate.cpp:
2850         * platform/network/cf/ResourceHandleCFURLConnectionDelegate.h:
2851         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
2852         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::setupRequest):
2853         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse):
2854         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::canRespondToProtectionSpace):
2855         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.h:
2856         * platform/network/cf/ResourceRequest.h:
2857         (WebCore::ResourceRequest::encodingRequiresPlatformData):
2858         * platform/network/cf/ResourceRequestCFNet.cpp:
2859         (WebCore::findCFURLRequestCopyContentDispositionEncodingFallbackArrayFunction):
2860         (WebCore::ResourceRequest::doUpdatePlatformRequest):
2861         (WebCore::ResourceRequest::doUpdatePlatformHTTPBody):
2862         (WebCore::ResourceRequest::doUpdateResourceRequest):
2863         (WebCore::ResourceRequest::setStorageSession):
2864         (WebCore::findCFURLRequestSetContentDispositionEncodingFallbackArrayFunction): Deleted.
2865         * platform/network/cf/ResourceRequestCFNet.h:
2866         * platform/network/cf/ResourceResponse.h:
2867         (WebCore::ResourceResponse::ResourceResponse):
2868         * platform/network/cf/ResourceResponseCFNet.cpp:
2869         (WebCore::ResourceResponse::cfURLResponse):
2870         (WebCore::ResourceResponse::platformCertificateInfo):
2871         * platform/network/cf/SynchronousLoaderClientCFNet.cpp:
2872         * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:
2873         (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::setupRequest):
2874         (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::setupConnectionScheduling):
2875         (WebCore::adjustMIMETypeIfNecessary):
2876         (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveResponse):
2877         (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::willCacheResponse):
2878         (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::canRespondToProtectionSpace):
2879         * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.h:
2880         * platform/network/cocoa/CredentialCocoa.h:
2881         * platform/network/cocoa/CredentialCocoa.mm:
2882         (WebCore::Credential::Credential): Deleted.
2883         (WebCore::Credential::cfCredential): Deleted.
2884         * platform/network/cocoa/ProtectionSpaceCocoa.h:
2885         * platform/network/cocoa/ProtectionSpaceCocoa.mm:
2886         (WebCore::ProtectionSpace::ProtectionSpace): Deleted.
2887         (WebCore::ProtectionSpace::cfSpace): Deleted.
2888         * platform/network/cocoa/ResourceRequestCocoa.mm:
2889         (WebCore::ResourceRequest::nsURLRequest):
2890         * platform/network/cocoa/ResourceResponseCocoa.mm:
2891         (WebCore::ResourceResponse::platformCertificateInfo):
2892         (WebCore::ResourceResponse::nsURLResponse): Deleted.
2893         (WebCore::ResourceResponse::ResourceResponse): Deleted.
2894         * platform/network/ios/QuickLook.h:
2895         * platform/network/ios/QuickLook.mm:
2896         (-[WebQuickLookHandleAsDelegate initWithConnectionDelegate:]): Deleted.
2897         (-[WebQuickLookHandleAsDelegate connection:didReceiveDataArray:]): Deleted.
2898         (-[WebQuickLookHandleAsDelegate connection:didReceiveData:lengthReceived:]): Deleted.
2899         (-[WebQuickLookHandleAsDelegate connectionDidFinishLoading:]): Deleted.
2900         (-[WebQuickLookHandleAsDelegate connection:didFailWithError:]): Deleted.
2901         (-[WebQuickLookHandleAsDelegate detachHandle]): Deleted.
2902         (WebCore::QuickLookHandle::create): Deleted.
2903         (WebCore::QuickLookHandle::cfResponse): Deleted.
2904         * platform/network/ios/ResourceHandleIOS.mm: Removed.
2905         * platform/network/ios/ResourceRequestIOS.mm: Removed.
2906         * platform/network/mac/AuthenticationMac.mm:
2907         (-[WebCoreAuthenticationClientAsChallengeSender setCFChallenge:]): Deleted.
2908         (-[WebCoreAuthenticationClientAsChallengeSender cfChallenge]): Deleted.
2909         (WebCore::core): Deleted.
2910         (WebCore::mac): Deleted.
2911         * platform/network/mac/CookieJarMac.mm:
2912         (WebCore::setCookiesFromDOM):
2913         (WebCore::cookieStorage):
2914         (WebCore::addCookie):
2915         * platform/network/mac/CredentialStorageMac.mm:
2916         * platform/network/mac/FormDataStreamMac.h:
2917         * platform/network/mac/FormDataStreamMac.mm:
2918         * platform/network/mac/ResourceErrorMac.mm:
2919         (NSErrorFromCFError): Deleted.
2920         (WebCore::ResourceError::ResourceError): Deleted.
2921         (WebCore::ResourceError::nsError): Deleted.
2922         (WebCore::ResourceError::operator NSError *): Deleted.
2923         * platform/network/mac/ResourceHandleMac.mm:
2924         (WebCore::ResourceHandle::continueWillCacheResponse):
2925         (WebCore::ResourceHandle::getConnectionTimingData): Deleted.
2926         * platform/network/mac/ResourceRequestMac.mm: Removed.
2927         * platform/network/mac/SynchronousLoaderClient.mm:
2928         (WebCore::SynchronousLoaderClient::platformBadResponseError):
2929         * platform/network/mac/WebCoreResourceHandleAsDelegate.h:
2930         * platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
2931         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.h:
2932         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
2933         * platform/network/mac/WebCoreURLResponse.mm:
2934         (WebCore::synthesizeRedirectResponseIfNecessary):
2935         * platform/win/TemporaryLinkStubs.cpp:
2936         * testing/js/WebCoreTestSupportPrefix.h:
2937
2938 2016-10-10  Sam Weinig  <sam@webkit.org>
2939
2940         Use IDLTypes in more places
2941         https://bugs.webkit.org/show_bug.cgi?id=163247
2942
2943         Reviewed by Darin Adler.
2944
2945         Switch JS -> Native type conversions to use convert<IDLType>(...) rather
2946         than convert<NativeType>(...). This allows us to differentiate things like
2947         conversion from JSValue to DOMString vs. JSValue to USVString which have different
2948         rules.
2949
2950         * bindings/generic/IDLTypes.h:
2951         Add predicate for integer types.
2952
2953         * bindings/js/IDBBindingUtilities.cpp:
2954         (WebCore::idbKeyPathFromValue):
2955         * bindings/js/JSApplePaySessionCustom.cpp:
2956         (WebCore::JSApplePaySession::completeShippingMethodSelection):
2957         (WebCore::JSApplePaySession::completeShippingContactSelection):
2958         * bindings/js/JSCryptoAlgorithmDictionary.cpp:
2959         (WebCore::createAesKeyGenParams):
2960         (WebCore::createRsaKeyGenParams):
2961         * bindings/js/JSCustomElementRegistryCustom.cpp:
2962         (WebCore::JSCustomElementRegistry::define):
2963         * bindings/js/JSDocumentCustom.cpp:
2964         (WebCore::JSDocument::getCSSCanvasContext):
2965         * bindings/js/JSMockContentFilterSettingsCustom.cpp:
2966         (WebCore::JSMockContentFilterSettings::setDecisionPoint):
2967         (WebCore::toDecision):
2968         * bindings/js/JSNodeFilterCustom.cpp:
2969         (WebCore::JSNodeFilter::acceptNode):
2970         Switch to new convert<IDLType> style.
2971
2972         * bindings/js/JSDOMBinding.h:
2973         (WebCore::toRefPtrNativeArray): Deleted.
2974         (WebCore::toNativeArray): Deleted.
2975         These can now be called as convert<IDLSequence<IDLInterface<T>>> and convert<IDLType> respectively.
2976
2977         * bindings/js/JSDOMConvert.h:
2978         (WebCore::Converter<IDLNullable<T>>::convert):
2979         (WebCore::Converter<IDLBoolean>::convert):
2980         (WebCore::Converter<IDLInterface<T>>::convert):
2981         (WebCore::Converter<IDLByte>::convert):
2982         (WebCore::Converter<IDLOctet>::convert):
2983         (WebCore::Converter<IDLShort>::convert):
2984         (WebCore::Converter<IDLUnsignedShort>::convert):
2985         (WebCore::Converter<IDLLong>::convert):
2986         (WebCore::Converter<IDLUnsignedLong>::convert):
2987         (WebCore::Converter<IDLLongLong>::convert):
2988         (WebCore::Converter<IDLUnsignedLongLong>::convert):
2989         (WebCore::Converter<IDLFloat>::convert):
2990         (WebCore::Converter<IDLUnrestrictedFloat>::convert):
2991         (WebCore::Converter<IDLDouble>::convert):
2992         (WebCore::Converter<IDLUnrestrictedDouble>::convert):
2993         (WebCore::Converter<IDLDOMString>::convert):
2994         (WebCore::Converter<IDLUSVString>::convert):
2995         (WebCore::Detail::ArrayConverter::convert):
2996         (WebCore::Converter<IDLSequence<T>>::convert):
2997         (WebCore::Converter<IDLFrozenArray<T>>::convert):
2998         (WebCore::Converter<IDLDictionary<T>>::convert):
2999         (WebCore::Converter<IDLEnumeration<T>>::convert):
3000         (WebCore::Detail::VariadicConverterBase::convert):
3001         (WebCore::Detail::VariadicConverterBase<IDLInterface<T>>::convert):
3002         (WebCore::convertVariadicArguments):
3003         (WebCore::convertWrapperType): Deleted.
3004         (WebCore::convertWrapperTypeSequence): Deleted.
3005         (WebCore::Converter<bool>::convert): Deleted.
3006         (WebCore::Converter<String>::convert): Deleted.
3007         (WebCore::Converter<Vector<T>>::convert): Deleted.
3008         (WebCore::Converter<int8_t>::convert): Deleted.
3009         (WebCore::Converter<uint8_t>::convert): Deleted.
3010         (WebCore::Converter<int16_t>::convert): Deleted.
3011         (WebCore::Converter<uint16_t>::convert): Deleted.
3012         (WebCore::Converter<int32_t>::convert): Deleted.
3013         (WebCore::Converter<uint32_t>::convert): Deleted.
3014         (WebCore::Converter<int64_t>::convert): Deleted.
3015         (WebCore::Converter<uint64_t>::convert): Deleted.
3016         Switch Converter to be specialized on IDLTypes. Add support for IDLNullable, IDLSequence, and IDLFrozenArray.
3017
3018         * bindings/scripts/CodeGenerator.pm:
3019         (GetFlattenedMemberTypes): Deleted.
3020         (GetNumberOfNullableMemberTypes): Deleted.
3021         (GetIDLUnionMemberTypes): Deleted.
3022         (GetBaseIDLType): Deleted.
3023         (GetIDLType): Deleted.
3024         Move IDLType conversion logic to CodeGeneratorJS so it can use GetEnumerationClassName and GetDictionaryClassName.
3025
3026         * bindings/scripts/CodeGeneratorJS.pm:
3027         (AddToImplIncludesForIDLType):
3028         Add support for sequences, FrozenArrays and external dictionaries.
3029
3030         (GenerateEnumerationsImplementationContent):
3031         (GenerateEnumerationsHeaderContent):
3032         Change the name of parse<enum> and convert<enum> to parseEnumeration<enum> and convertEnumeration<enum>
3033         to make them more consistent with dictionary conversion specialization and not interfere with the convert
3034         function specialization.
3035
3036         (GenerateDictionaryImplementationContent):
3037         Simplify by using convert<IDLType>.
3038
3039         (GetFlattenedMemberTypes):
3040         (GetNumberOfNullableMemberTypes):
3041         (GetIDLUnionMemberTypes):
3042         (GetBaseIDLType):
3043         (GetIDLType):
3044         Moved from CodeGenerator.pm
3045
3046         (IsHandledByDOMConvert):
3047         (JSValueToNative):
3048         Start switching JSValueToNative over to using convert<IDLType>. Use IsHandledByDOMConvert as a predicate
3049         for what is supported.
3050
3051         * bindings/scripts/IDLParser.pm:
3052         (applyTypedefs):
3053         (cloneType):
3054         (applyTypedefsForSignature):
3055         (parseTypedef):
3056         (parseOperationOrIterator):
3057         (parseSpecialOperation):
3058         Make typedefs work with aggregate types (unions, sequences and FrozenArrays).
3059
3060         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
3061         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
3062         * bindings/scripts/test/JS/JSTestObj.cpp:
3063         * bindings/scripts/test/JS/JSTestObj.h:
3064         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
3065         * bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
3066         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
3067         Update test results.
3068
3069         * bindings/scripts/test/TestTypedefs.idl:
3070         Add additional tests for typedefs that use unions and sequences.
3071
3072         * testing/InternalSettings.idl:
3073         Change the name of a parameter to avoid a name collision.
3074
3075 2016-10-11  Konstantin Tokarev  <annulen@yandex.ru>
3076
3077         Fixed compilation with !ENABLE(SVG_FONTS)
3078         https://bugs.webkit.org/show_bug.cgi?id=163281
3079
3080         Reviewed by Csaba Osztrogon√°c.
3081
3082         No new tests needed.
3083
3084         * loader/cache/CachedResourceLoader.cpp:
3085         (WebCore::CachedResourceLoader::shouldUpdateCachedResourceWithCurrentRequest):
3086
3087 2016-10-11  Brent Fulgham  <bfulgham@apple.com>
3088
3089         Unreviewed build fix after r207140.
3090
3091         * PlatformAppleWin.cmake: Add missing compile file.
3092
3093 2016-10-10  Brent Fulgham  <bfulgham@apple.com>
3094
3095         [Win][Direct2D] Add initial Pattern handling implementation
3096         https://bugs.webkit.org/show_bug.cgi?id=163270
3097
3098         Reviewed by Simon Fraser.
3099
3100         Provide an implemenation of Patterns for Direct2D.
3101
3102         No new tests. Covered by fast/borders/border-image-01.html and others.
3103
3104         * platform/graphics/GraphicsContext.h:
3105         * platform/graphics/Pattern.h: Add D2D definitions.
3106         * platform/graphics/win/GraphicsContextDirect2D.cpp:
3107         (WebCore::GraphicsContext::solidStrokeBrush): Use a more generic return type.
3108         (WebCore::GraphicsContext::solidFillBrush): Ditto.
3109         (WebCore::GraphicsContext::patternStrokeBrush): Added.
3110         (WebCore::GraphicsContext::patternFillBrush): Added.
3111         (WebCore::GraphicsContext::drawPattern): Provide D2D implementation.
3112         (WebCore::GraphicsContext::applyStrokePattern): Ditto.
3113         (WebCore::GraphicsContext::applyFillPattern): Ditto.
3114         (WebCore::GraphicsContext::drawPath): Use stroke pattern if available.
3115         (WebCore::GraphicsContext::fillPath): Use fill pattern if available.
3116         (WebCore::GraphicsContext::strokePath): Use stroke pattern if available.
3117         (WebCore::GraphicsContext::fillRect): Use fill pattern if available.
3118         * platform/graphics/win/GraphicsContextPlatformPrivateDirect2D.h:
3119         * platform/graphics/win/PatternDirect2D.cpp: Added.
3120
3121 2016-10-11  Per Arne Vollan  <pvollan@apple.com>
3122
3123         [Win] Compile fix.
3124         https://bugs.webkit.org/show_bug.cgi?id=163272
3125
3126         Reviewed by Brent Fulgham.
3127
3128         When compiling with older SDKs, some CoreText symbols are redefined.
3129         This patch checks if the relevant CoreText header file has been
3130         included before defining the symbol.
3131
3132         * platform/spi/win/CoreTextSPIWin.h:
3133
3134 2016-10-11  Antoine Quint  <graouts@apple.com>
3135
3136         [Modern Media Controls] Buttons container
3137         https://bugs.webkit.org/show_bug.cgi?id=163238
3138         <rdar://problem/28701864>
3139
3140         Reviewed by Dean Jackson.
3141
3142         We add a new ButtonsContainer class which contains a group of Button objects
3143         and positions them based on the provided padding and margin between buttons.
3144         Buttons that aren't enabled or marked as dropped are not added to the tree of
3145         LayoutNodes, and thus the DOM.
3146
3147         Additionally, we fix a few issues we found while working on tests for ButtonsContainer
3148         where LayoutNodes would schedule layout callbacks even when they would not do any work
3149         during the layout callback due to not resetting the `needsLayout` flag to false and
3150         removing any scheduled tasks when a layout was completed.
3151
3152         Finally, we fix a few style issues that had not been caught so far and an unused
3153         `size` property on IconButton.
3154
3155         Tests: media/modern-media-controls/buttons-container/buttons-container-buttons-property.html
3156                media/modern-media-controls/buttons-container/buttons-container-constructor.html
3157                media/modern-media-controls/buttons-container/buttons-container-layout.html
3158
3159         * Modules/modern-media-controls/controls/airplay-button.js:
3160         (AirplayButton.prototype.set on):
3161         (AirplayButton):
3162         * Modules/modern-media-controls/controls/buttons-container.css:
3163         (.buttons-container):
3164         * Modules/modern-media-controls/controls/buttons-container.js:
3165         (ButtonsContainer.prototype.get buttons):
3166         (ButtonsContainer.prototype.set buttons):
3167         (ButtonsContainer.prototype.layout):
3168         * Modules/modern-media-controls/controls/icon-button.js:
3169         * Modules/modern-media-controls/controls/layout-node.js:
3170         (LayoutNode.prototype.set needsLayout):
3171         (LayoutNode.prototype.markDirtyProperty):
3172         (LayoutNode.prototype._markNodeManipulation):
3173         (LayoutNode.prototype._updateDirtyState):
3174         (performScheduledLayout):
3175         (elementFromString):
3176         * Modules/modern-media-controls/controls/scheduler.js:
3177         (const.scheduler.new.prototype.unscheduleLayout):
3178
3179 2016-10-11  Youenn Fablet  <youenn@apple.com>
3180
3181         [Fetch API] Support Request cache mode
3182         https://bugs.webkit.org/show_bug.cgi?id=162281
3183
3184         Reviewed by Alex Christensen.
3185
3186         Covered by updated test.
3187
3188         Added support for only-if-cached mode at Request level.
3189
3190         Added support for cache mode at CachedResourceLoader, by setting HTTP headers and ResourceRequest cache policy
3191         based on https://fetch.spec.whatwg.org/#concept-request-cache-mode and https://fetch.spec.whatwg.org/#http-network-or-cache-fetch.
3192
3193         Disabled default cache policy computation (done in FrameLoader) when cache mode is different from the default.
3194         Activated no-store cache mode for EventSource as per https://html.spec.whatwg.org/#the-eventsource-interface.
3195
3196         * Modules/fetch/FetchRequest.cpp:
3197         (WebCore::setCache): Adding support for only-if-cached.
3198         (WebCore::buildOptions): Throw if only-if-cached and fetch mode is not same-origin.
3199         * loader/FetchOptions.h: Adding support for only-if-cached.
3200         * loader/FrameLoader.cpp:
3201         (WebCore::FrameLoader::defaultRequestCachingPolicy): Introduced to ease readability.
3202         (WebCore::FrameLoader::addExtraFieldsToRequest): Updating cache policy only if request has the default cache policy.
3203         This allows bypassing the default behavior for fetch cache mode different from "default".
3204         * loader/FrameLoader.h:
3205         * loader/cache/CachedResourceLoader.cpp:
3206         (WebCore::updateRequestAccordingCacheMode): Introduced to set headers and request cache policy according fetch cache mode.
3207         (WebCore::CachedResourceLoader::requestResource):
3208         (WebCore::CachedResourceLoader::loadResource):
3209         (WebCore::CachedResourceLoader::determineRevalidationPolicy): Ensure bypassing the memory cache in no-store and reload cases.
3210         We reload in case of cache mode=reload to refresh the meory cache entry.
3211         * loader/cache/CachedResourceRequest.h:
3212         (WebCore::CachedResourceRequest::setCacheModeToNoStore):
3213         * page/EventSource.cpp:
3214         (WebCore::EventSource::connect): Use no-store cache mode as per https://html.spec.whatwg.org/#the-eventsource-interface.
3215         * platform/network/HTTPHeaderMap.cpp:
3216         (WebCore::HTTPHeaderMap::addIfNotPresent): Helper routine.
3217         * platform/network/HTTPHeaderMap.h:
3218         * platform/network/HTTPHeaderValues.cpp:
3219         * platform/network/HTTPHeaderValues.h:
3220         * platform/network/ResourceRequestBase.cpp:
3221         (WebCore::ResourceRequestBase::addHTTPHeaderFieldIfNotPresent):
3222         (WebCore::ResourceRequestBase::addHTTPHeaderField):
3223         (WebCore::ResourceRequestBase::hasHTTPHeaderField):
3224         * platform/network/ResourceRequestBase.h:
3225
3226 2016-10-10  Antti Koivisto  <antti@apple.com>
3227
3228         Stop copying author shadow pseudo rules into shadow tree style resolver
3229         https://bugs.webkit.org/show_bug.cgi?id=163232
3230
3231         Reviewed by Darin Adler.
3232
3233         * css/ElementRuleCollector.cpp:
3234         (WebCore::ElementRuleCollector::collectMatchingRules):
3235         (WebCore::ElementRuleCollector::matchAuthorRules):
3236         (WebCore::ElementRuleCollector::matchAuthorShadowPseudoElementRules):
3237
3238             If we are resolving a user agent shadow tree also look up pseudo element rules from the host scope author sheet.
3239             This is needed to keep web exposed ::-webkit-foo pseudo elements working.
3240
3241         (WebCore::ElementRuleCollector::collectMatchingShadowPseudoElementRules):
3242
3243             Factor to a function.
3244
3245         * css/ElementRuleCollector.h:
3246         * css/RuleSet.cpp:
3247         (WebCore::RuleSet::copyShadowPseudoElementRulesFrom): Deleted.
3248         * css/RuleSet.h:
3249         * dom/Document.cpp:
3250         (WebCore::Document::userAgentShadowTreeStyleResolver):
3251         * style/StyleScope.cpp:
3252         (WebCore::Style::Scope::updateStyleResolver):
3253
3254             No need to awkwardly copy these rules anymore.
3255
3256 2016-10-11  Chris Dumez  <cdumez@apple.com>
3257
3258         Update IDBVersionChangeEvent to stop using legacy [ConstructorTemplate=Event]
3259         https://bugs.webkit.org/show_bug.cgi?id=163266
3260
3261         Reviewed by Darin Adler.
3262
3263         Update IDBVersionChangeEvent to stop using legacy [ConstructorTemplate=Event]
3264         and use a regular constructor instead, as in the specification:
3265         - http://w3c.github.io/IndexedDB/#request-idbversionchangeevent
3266
3267         This patch also fixes a bug where the IDBVersionChangeEvent was ignoring the
3268         EventInit dictionary members passed by the JavaScript (e.g. bubbles).
3269
3270         No new tests, updated existing test.
3271
3272         * Modules/indexeddb/IDBVersionChangeEvent.cpp:
3273         (WebCore::IDBVersionChangeEvent::IDBVersionChangeEvent):
3274         * Modules/indexeddb/IDBVersionChangeEvent.h:
3275         * Modules/indexeddb/IDBVersionChangeEvent.idl:
3276         * bindings/js/JSDOMConvert.h:
3277         (WebCore::convertNullable):
3278         (WebCore::convert): Deleted.
3279         * bindings/scripts/CodeGeneratorJS.pm:
3280         (GenerateDefaultValue):
3281         (GenerateDictionaryImplementationContent):
3282         * bindings/scripts/test/JS/JSTestObj.cpp:
3283         (WebCore::convertDictionary<TestObj::Dictionary>):
3284         * bindings/scripts/test/TestObj.idl:
3285
3286 2016-10-11  Chris Dumez  <cdumez@apple.com>
3287
3288         Update WebKitPlaybackTargetAvailabilityEvent to stop using legacy [ConstructorTemplate=Event]
3289         https://bugs.webkit.org/show_bug.cgi?id=163265
3290
3291         Reviewed by Darin Adler.
3292
3293         Update WebKitPlaybackTargetAvailabilityEvent to stop using legacy
3294         [ConstructorTemplate=Event] and use a regular constructor instead.
3295
3296         * Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.cpp:
3297         (WebCore::WebKitPlaybackTargetAvailabilityEvent::WebKitPlaybackTargetAvailabilityEvent):
3298         * Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.h:
3299         (WebCore::WebKitPlaybackTargetAvailabilityEvent::createForBindings):
3300         (WebCore::WebKitPlaybackTargetAvailabilityEvent::~WebKitPlaybackTargetAvailabilityEvent): Deleted.
3301         * Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.idl:
3302
3303 2016-10-10  Zan Dobersek  <zdobersek@igalia.com>
3304
3305         Add ENABLE_ENCRYPTED_MEDIA configuration option
3306         https://bugs.webkit.org/show_bug.cgi?id=163219
3307
3308         Reviewed by Darin Adler.
3309
3310         * Configurations/FeatureDefines.xcconfig:
3311         Add the ENABLE_ENCRYPTED_MEDIA configuration option. It will be used
3312         to enable or disable the new EME implementation at build-time.
3313         * DerivedSources.make: Group the legacy option and the new option together.
3314
3315 2016-10-10  Youenn Fablet  <youenn@apple.com>
3316
3317         CachedResourceRequest constructor should be made more efficient
3318         https://bugs.webkit.org/show_bug.cgi?id=163210
3319
3320         Reviewed by Alex Christensen.
3321
3322         No change of behavior.
3323
3324         Refactoring to use one CachedResourceRequest constructor that will move its request and charset to improve efficiency.
3325
3326         * css/StyleRuleImport.cpp:
3327         (WebCore::StyleRuleImport::requestStyleSheet):
3328         * dom/ProcessingInstruction.cpp:
3329         (WebCore::ProcessingInstruction::checkStyleSheet):
3330         * html/HTMLLinkElement.cpp:
3331         (WebCore::HTMLLinkElement::process):
3332         * html/parser/HTMLResourcePreloader.cpp:
3333         (WebCore::PreloadRequest::resourceRequest):
3334         * loader/cache/CachedResourceRequest.cpp:
3335         (WebCore::CachedResourceRequest::CachedResourceRequest):
3336         * loader/cache/CachedResourceRequest.h:
3337
3338 2016-10-10  Adam Bergkvist  <adam.bergkvist@ericsson.com> and Alejandro G. Castro <alex@igalia.com>
3339
3340         WebRTC: Make MediaEndpointPeerConnection handle remotely assigned mids correctly
3341         https://bugs.webkit.org/show_bug.cgi?id=163202
3342
3343         Reviewed by Eric Carlson.
3344
3345         An RTCRtpTransceiver has a null mid until it's been associated with a
3346         media description (with a mid) [1]. During that time, it's identified by
3347         a provisional mid that might become its real mid, but the transceiver
3348         can also get its mid assigned by a remote media description. In the
3349         second case, the mid value is initially unknown. A transceiver's
3350         RTCRtpSender must directly (synchronously in the script) provide a muted
3351         remote source that is playable by, for example, a media element. This
3352         source is initially registered in the MediaEndpoint (WebRTC backend)
3353         with the transceiver's provisional mid. So, if the real mid is set by a
3354         remote description, the registered mid must be updated to preserve the
3355         association between the registered source and the transceiver.
3356
3357         [1] https://w3c.github.io/webrtc-pc/archives/20160913/webrtc.html#dom-rtcrtptransceiver-mid
3358
3359         Test: fast/mediastream/RTCPeerConnection-remotely-assigned-transceiver-mid.html
3360
3361         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
3362         Don't break after finding the first transceiver in the loop that builds the send source map.
3363         Update the mid used to register the muted remote source if the a transceiver's mid gets
3364         assigned by a remote media description.
3365         (WebCore::createSourceMap):
3366         (WebCore::MediaEndpointPeerConnection::setRemoteDescriptionTask):
3367         * platform/mediastream/MediaEndpoint.cpp:
3368         * platform/mediastream/MediaEndpoint.h:
3369         * platform/mock/MockMediaEndpoint.cpp:
3370         (WebCore::MockMediaEndpoint::MockMediaEndpoint):
3371         (WebCore::MockMediaEndpoint::updateReceiveConfiguration):
3372         (WebCore::MockMediaEndpoint::updateSendConfiguration):
3373         (WebCore::MockMediaEndpoint::createMutedRemoteSource):
3374         (WebCore::MockMediaEndpoint::replaceMutedRemoteSourceMid):
3375         (WebCore::MockMediaEndpoint::emulatePlatformEvent):
3376         Add "unmute-remote-sources-by-mid" action that emulates data arriving on media descriptions
3377         which unmutes the remote sources.
3378         (WebCore::MockMediaEndpoint::updateConfigurationMids):
3379         (WebCore::MockMediaEndpoint::unmuteRemoteSourcesByMid):
3380         (WebCore::MockMediaEndpoint::unmuteTimerFired):
3381         * platform/mock/MockMediaEndpoint.h:
3382
3383 2016-10-10  Darin Adler  <darin@apple.com>
3384
3385         Move audio module off of legacy exceptions
3386         https://bugs.webkit.org/show_bug.cgi?id=163269
3387
3388         Reviewed by Alex Christensen.
3389
3390         * Modules/webaudio/AnalyserNode.cpp:
3391         (WebCore::AnalyserNode::setFftSize): Use ExceptionOr.
3392         (WebCore::AnalyserNode::setMinDecibels): Ditto.
3393         (WebCore::AnalyserNode::setMaxDecibels): Ditto.
3394         (WebCore::AnalyserNode::setSmoothingTimeConstant): Ditto.
3395         * Modules/webaudio/AnalyserNode.h: Update for above.
3396         * Modules/webaudio/AnalyserNode.idl: Ditto.
3397
3398         * Modules/webaudio/AudioBasicInspectorNode.cpp:
3399         (WebCore::AudioBasicInspectorNode::AudioBasicInspectorNode):
3400         Initialize m_needAutomaticPull in class definition.
3401         (WebCore::AudioBasicInspectorNode::connect): Use ExceptionOr.
3402         (WebCore::AudioBasicInspectorNode::disconnect): Ditto.
3403         * Modules/webaudio/AudioBasicInspectorNode.h: Updated for above.
3404
3405         * Modules/webaudio/AudioBuffer.cpp:
3406         (WebCore::AudioBuffer::createFromAudioFileData): Use reference.
3407         (WebCore::AudioBuffer::AudioBuffer): Initialize m_gain in class definition.
3408         (WebCore::AudioBuffer::getChannelData): Use ExceptionOr.
3409         (WebCore::AudioBuffer::channelData): Rename to disambiguate with getChannelData.
3410         (WebCore::AudioBuffer::zero): Use modern for loop.
3411         * Modules/webaudio/AudioBuffer.h: Update for above.
3412         * Modules/webaudio/AudioBuffer.idl: Ditto.
3413
3414         * Modules/webaudio/AudioBufferSourceNode.cpp:
3415         (WebCore::AudioBufferSourceNode::process): Use reference.
3416         (WebCore::AudioBufferSourceNode::setBuffer): Use channelData.
3417         (WebCore::AudioBufferSourceNode::start): Use ExceptionOr.
3418         (WebCore::AudioBufferSourceNode::startPlaying): Ditto.
3419         * Modules/webaudio/AudioBufferSourceNode.h: Update for above.
3420         * Modules/webaudio/AudioBufferSourceNode.idl: Ditto.
3421
3422         * Modules/webaudio/AudioContext.cpp:
3423         (WebCore::AudioContext::createBuffer): Use ExceptionOr.
3424         (WebCore::AudioContext::createMediaElementSource): Ditto.
3425         (WebCore::AudioContext::createMediaStreamSource): Ditto.
3426         (WebCore::AudioContext::createScriptProcessor): Ditto.
3427         (WebCore::AudioContext::createDelay): Ditto.
3428         (WebCore::AudioContext::createChannelSplitter): Ditto.
3429         (WebCore::AudioContext::createChannelMerger): Ditto.
3430         (WebCore::AudioContext::createPeriodicWave): Ditto.
3431         * Modules/webaudio/AudioContext.h: Update for above.
3432         * Modules/webaudio/AudioContext.idl: Ditto.
3433
3434         * Modules/webaudio/AudioDestinationNode.h: Use unsigned instead
3435         of unsigned long for maxChannelCount.
3436
3437         * Modules/webaudio/AudioNode.cpp:
3438         (WebCore::AudioNode::connect): Use ExceptionOr.
3439         (WebCore::AudioNode::disconnect): Ditto.
3440         (WebCore::AudioNode::channelCount): Use unsigned.
3441         (WebCore::AudioNode::setChannelCount): Use ExceptionOr and unsigned.
3442         (WebCore::AudioNode::setChannelCountMode): Ditto.
3443         (WebCore::AudioNode::setChannelInterpretation): Ditto.
3444         * Modules/webaudio/AudioNode.h: Update for above.
3445         * Modules/webaudio/AudioNode.idl: Ditto.
3446
3447        &nb