e787361ce637caa30e64b1067b95dab28b389eef
[WebKit.git] / Source / WebCore / ChangeLog
1 2016-09-09  Alex Christensen  <achristensen@webkit.org>
2
3         URLParser should parse URLs with non-special schemes
4         https://bugs.webkit.org/show_bug.cgi?id=161786
5
6         Reviewed by Andy Estes.
7
8         Covered by new API tests.
9
10         * platform/URLParser.cpp:
11         (WebCore::URLParser::parse):
12         There's no reason for a SchemeEndCheckForSlashes state now that we can copy iterators.
13         It's not in the spec and not needed.
14         Also, move things around a little so parsing special or non-special schemes
15         followed by one or two slashes works correctly.
16
17 2016-09-09  Chris Dumez  <cdumez@apple.com>
18
19         Regression(r186020): Null dereference in getStartDate()
20         https://bugs.webkit.org/show_bug.cgi?id=161733
21
22         Reviewed by Eric Carlson.
23
24         Update HTMLMediaElement::getStartDate() to return NaN if m_player is null,
25         instead of crashing.
26
27         Test: fast/media/getStartDate-NaN.html
28
29         * bindings/js/IDBBindingUtilities.cpp:
30         (WebCore::toJS):
31         Add a FIXME comment as this code is using jsDateOrNull() but should
32         probably be using jsDate() as per:
33         - http://w3c.github.io/IndexedDB/#request-convert-a-key-to-a-value
34
35         * bindings/js/JSDOMBinding.cpp:
36         (WebCore::jsDate):
37         (WebCore::jsDateOrNull):
38         * bindings/js/JSDOMBinding.h:
39         - Rename jsDateOrNaN() to jsDate() as this is the default behavior. Also,
40           return new Date(NaN) instead of NaN if the implementation returns NaN.
41           The IDL says we should return a Date, not a number.
42         - Update jsDateOrNull() to only return jsNull() if the native value is
43           NaN, instead of doing so for every value that is not finite. Our
44           convention is to use NaN as special value to represent null in JS.
45
46         * bindings/scripts/CodeGeneratorJS.pm:
47         (NativeToJSValue):
48         When converting a native value (double) into a Date, rely on the fact
49         that the type is nullable when deciding if we should call jsDate() or
50         jsDateOrNull() to convert. This way, we no longe need a WebKit specific
51         [TreatReturnedDateAs=Null|NaN] IDL extended attribute.
52
53         * bindings/scripts/IDLAttributes.txt:
54         * html/HTMLInputElement.idl:
55         Mark valueAsDate attribute as nullable, as per the specification:
56         - https://html.spec.whatwg.org/#htmlinputelement
57
58         * html/HTMLMediaElement.cpp:
59         (WebCore::HTMLMediaElement::getStartDate):
60         Return NaN if m_player is null instead of crashing. The reason I decided
61         to return NaN is because the specification [1] says to return a new Date
62         object representing the current timeline offset. The spec of timeline
63         offset [2] says that the initial timeline offset value is NaN.
64         [1] https://html.spec.whatwg.org/#dom-media-getstartdate
65         [2] https://html.spec.whatwg.org/#timeline-offset
66
67         * bindings/scripts/IDLAttributes.txt:
68         * html/HTMLMediaElement.idl:
69         Drop [TreatReturnedDateAs] attribute as it is no longer supported.
70
71 2016-09-09  Youenn Fablet  <youenn@apple.com>
72
73         ASSERTION FAILED: promise.inherits(JSPromise::info())
74         https://bugs.webkit.org/show_bug.cgi?id=161632
75         <rdar://problem/28184743>
76
77         Reviewed by Mark Lam.
78
79         Test: fetch/fetch-worker-crash.html
80
81         * bindings/js/JSDOMPromise.h:
82         (WebCore::callPromiseFunction): Returning early if created promise is null.
83         Passing directly a DeferredWrapper to the generated code.
84         * bindings/scripts/CodeGeneratorJS.pm: Updated to take a DeferredWrapper.
85         (GenerateImplementation):
86         (GenerateReturnParameters):
87         * bindings/scripts/test/JS/JSTestObj.cpp: Rebasing expectations.
88         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionPromise):
89         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithFloatArgumentPromise):
90         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithExceptionPromise):
91         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithOptionalIntArgumentPromise):
92         (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction1Promise):
93         (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction2Promise):
94         (WebCore::jsTestObjConstructorFunctionTestStaticPromiseFunctionPromise):
95         (WebCore::jsTestObjConstructorFunctionTestStaticPromiseFunctionWithExceptionPromise):
96
97 2016-09-09  Myles C. Maxfield  <mmaxfield@apple.com>
98
99         [Cocoa] Improve performance of glyph advance metrics gathering
100         https://bugs.webkit.org/show_bug.cgi?id=161119
101
102         Reviewed by Simon Fraser.
103
104         Most of the glyphs in a GlyphPage are never read from. Therefore, we can get a performance boost
105         by not populating as many items in the GlyphPage. Because of the performance characteristics of
106         CTFontGetGlyphsForCharacters(), a better size for a GlyphPage is 16 items. This, coupled with
107         using CTFontGetUnsummedAdvancesForGlyphsAndStyle(), causes between a 0.01%-0.5% speedup on PLT.
108
109         No new tests because there is no behavior change.
110
111         * platform/graphics/Font.cpp:
112         (WebCore::Font::initCharWidths):
113         (WebCore::Font::platformGlyphInit):
114         (WebCore::createAndFillGlyphPage):
115         * platform/graphics/Font.h:
116         (WebCore::Font::widthForGlyph):
117         * platform/graphics/GlyphMetricsMap.h:
118         * platform/graphics/GlyphPage.h:
119         * platform/graphics/cocoa/FontCocoa.mm:
120         * platform/spi/cocoa/CoreTextSPI.h:
121         (WebCore::Font::platformWidthForGlyph):
122         (WebCore::canUseFastGlyphAdvanceGetter): Deleted.
123
124 2016-09-09  Antti Koivisto  <antti@apple.com>
125
126         v3: WebContent crash due to RELEASE_ASSERT in WebCore: WebCore::StyleResolver::styleForElement
127         https://bugs.webkit.org/show_bug.cgi?id=161689
128
129         Reviewed by Andreas Kling.
130
131         These crashes happen because synchronously triggered resource loads generate callbacks that may end up
132         deleting the resource loader.
133
134         Stop triggering resource loads from StyleResolver. Instead trigger them when applying style to render tree.
135
136         * css/StyleResolver.cpp:
137         (WebCore::StyleResolver::~StyleResolver):
138
139             Replace the RELEASE_ASSERT against deletion during resource loads by a general isDeleted assert.
140
141         (WebCore::StyleResolver::styleForElement):
142         (WebCore::StyleResolver::styleForKeyframe):
143         (WebCore::StyleResolver::pseudoStyleForElement):
144         (WebCore::StyleResolver::styleForPage):
145         (WebCore::StyleResolver::applyMatchedProperties):
146         (WebCore::StyleResolver::loadPendingResources): Deleted.
147         * css/StyleResolver.h:
148         * page/animation/KeyframeAnimation.cpp:
149         (WebCore::KeyframeAnimation::KeyframeAnimation):
150         (WebCore::KeyframeAnimation::resolveKeyframeStyles):
151
152             Ensure resource load for all animation frames.
153
154         * page/animation/KeyframeAnimation.h:
155         * rendering/RenderElement.cpp:
156         (WebCore::RenderElement::createFor):
157         (WebCore::RenderElement::initializeStyle):
158
159             Load resources when renderer initializes a style.
160
161         (WebCore::RenderElement::setStyle):
162         (WebCore::RenderElement::getUncachedPseudoStyle):
163
164             Load resources for pseudo styles.
165
166         * rendering/RenderImage.cpp:
167         (WebCore::RenderImage::RenderImage):
168         (WebCore::RenderImage::styleWillChange):
169
170             Shuffle image resource initialization out from constructor so initializeStyle gets called before.
171
172         * rendering/RenderImage.h:
173         * rendering/style/StyleCachedImage.cpp:
174         (WebCore::StyleCachedImage::StyleCachedImage):
175
176             Track pending status with a bit instead of implicitly by the existence of CachedResource.
177             This is useful for asserts.
178
179         (WebCore::StyleCachedImage::load):
180         (WebCore::StyleCachedImage::isPending):
181         (WebCore::StyleCachedImage::addClient):
182         (WebCore::StyleCachedImage::removeClient):
183         (WebCore::StyleCachedImage::image):
184         * rendering/style/StyleCachedImage.h:
185
186 2016-09-08  Yusuke Suzuki  <utatane.tea@gmail.com>
187
188         ScriptRunner should be driven by PendingScript rather than ScriptElement
189         https://bugs.webkit.org/show_bug.cgi?id=161726
190
191         Reviewed by Ryosuke Niwa.
192
193         Tests: js/dom/document-write-in-error-event.html
194                js/dom/document-write-in-load-event.html
195
196         ScriptRunner is driven by ScriptElement::notifyFinished. While ScriptRunner is driven by this,
197         HTMLScriptRunner does not use it. Instead, HTMLScriptRunner uses PendingScriptClient. As a result,
198         ScriptElement::notifyFinished is used only when the script is annotated with "defer" or "async"
199         while all the external script will load the LoadableScript. It is confusing.
200         This patch removes ScriptElement::notifyFinished and use PendingScript's observability
201         in ScriptRunner instead.
202
203         This patch also fixes the behavior about ignore-destructive-writes counter[1]. When dispatching
204         the load and error events, this ignore-destructive-writes counter should not be incremeneted by
205         this execution. The added tests ensure this behavior.
206
207         [1]: https://html.spec.whatwg.org/multipage/scripting.html#execute-the-script-block
208
209         * dom/ScriptElement.cpp: Drop LoadableScriptClient interface.
210         (WebCore::ScriptElement::prepareScript): Do not use addClient. ScriptRunner use PendingScript::{setClient,clearClient} instead.
211         (WebCore::ScriptElement::executeScriptForScriptRunner): IgnoreDestructiveWriteCountIncrementer will be done in ScriptElement::executeScript.
212         So no need to do it here, that's duplicated.
213         (WebCore::ScriptElement::~ScriptElement): Deleted. ScriptElement does not use addClient/removeClient.
214         (WebCore::ScriptElement::stopLoadRequest): Deleted.
215         (WebCore::ScriptElement::executeScriptForHTMLScriptRunner): Deleted. executeScriptForHTMLScriptRunner and executeScriptForScriptRunner are
216         merged into executeScriptForRunner.
217         (WebCore::ScriptElement::notifyFinished): Deleted.
218         * dom/ScriptElement.h:
219         (WebCore::ScriptElement::~ScriptElement):
220         (WebCore::ScriptElement::willExecuteInOrder): Used in ScriptRunner to determine whether the script is async or defer.
221         (WebCore::ScriptElement::willExecuteWhenDocumentFinishedParsing): Deleted.
222         * dom/ScriptRunner.cpp:
223         (WebCore::ScriptRunner::~ScriptRunner): HashSet's iterator will return `const PendingScript&`.
224         Another option is using HashSet<RefPtr<PendingScript>>. Here, we use a little bit weired const_cast.
225         (WebCore::ScriptRunner::queueScriptForExecution): Use PendingScript::setClient to wait loading.
226         (WebCore::ScriptRunner::notifyFinished): Notify the script ready here.
227         (WebCore::ScriptRunner::timerFired): Use executeScriptForScriptRunner.
228         (WebCore::ScriptRunner::notifyScriptReady): Deleted.
229         * dom/ScriptRunner.h:
230         * html/parser/HTMLScriptRunner.cpp:
231         (WebCore::HTMLScriptRunner::executePendingScriptAndDispatchEvent): Use executeScriptForScriptRunner.
232
233 2016-09-08  Yusuke Suzuki  <utatane.tea@gmail.com>
234
235         [WTF] HashTable's rehash is not compatible to Ref<T> and ASan
236         https://bugs.webkit.org/show_bug.cgi?id=161763
237
238         Reviewed by Mark Lam.
239
240         Include wtf/text/StringHash.h to avoid linking errors in EFL port.
241
242         * loader/ResourceLoadStatistics.h:
243
244 2016-09-08  Chris Dumez  <cdumez@apple.com>
245
246         HTMLObjectElement.hspace / vspace attributes should be unsigned
247         https://bugs.webkit.org/show_bug.cgi?id=161766
248
249         Reviewed by Ryosuke Niwa.
250
251         HTMLObjectElement.hspace / vspace attributes should be unsigned:
252         - https://html.spec.whatwg.org/#HTMLObjectElement-partial
253
254         Firefox agrees with the specification but those were signed in WebKit.
255
256         No new tests, rebaselined existing test.
257
258         * html/HTMLObjectElement.idl:
259
260 2016-09-08  Chris Dumez  <cdumez@apple.com>
261
262         HTMLObjectElement.codebase attribute should reflect as a URL
263         https://bugs.webkit.org/show_bug.cgi?id=161768
264
265         Reviewed by Alex Christensen.
266
267         HTMLObjectElement.codebase attribute should reflect as a URL:
268         - https://html.spec.whatwg.org/#dom-applet-codebase
269
270         Chrome and Firefox agree with the specification.
271
272         No new test, rebaselined existing test.
273
274         * html/HTMLObjectElement.idl:
275
276 2016-09-08  Chris Dumez  <cdumez@apple.com>
277
278         ol.start may return incorrect value for reversed lists when not explicitly set
279         https://bugs.webkit.org/show_bug.cgi?id=161713
280
281         Reviewed by Zalan Bujtas.
282
283         ol.start may return incorrect value for reversed lists when not explicitly set.
284         This is because we're supposed to return the number of rendered <li> child
285         elements, which relies on layout. However, we did not make sure the layout is
286         up-to-date before counting the number of li child elements. This patch fixes
287         the issue.
288
289         No new tests, rebaselined existing tests.
290
291         * html/HTMLOListElement.h:
292
293 2016-09-08  Chris Dumez  <cdumez@apple.com>
294
295         Add support for HTMLIframeElement.allowFullscreen attribute
296         https://bugs.webkit.org/show_bug.cgi?id=161757
297
298         Reviewed by Sam Weinig.
299
300         Add support for HTMLIframeElement.allowFullscreen attribute:
301         - https://html.spec.whatwg.org/#dom-iframe-allowfullscreen
302
303         Firefox and Chrome already support it, unprefixed.
304
305         Note that the HTMLIframeElement.allowFullscreen attribute reflects the
306         allowfullscreen content attribute which we already support.
307
308         Test: fullscreen/full-screen-iframe-allowFullscreen.html
309
310         * html/HTMLIFrameElement.idl:
311
312 2016-09-08  Chris Dumez  <cdumez@apple.com>
313
314         frame.longDesc / iframe.longDesc should reflect as a URL
315         https://bugs.webkit.org/show_bug.cgi?id=161764
316
317         Reviewed by Alex Christensen.
318
319         frame.longDesc / iframe.longDesc should reflect as a URL:
320         - https://html.spec.whatwg.org/#dom-iframe-longdesc
321         - https://html.spec.whatwg.org/#dom-frame-longdesc
322
323         They already do in Chrome and Firefox.
324
325         No new tests, rebaselined existing tests.
326
327         * html/HTMLFrameElement.idl:
328         * html/HTMLIFrameElement.idl:
329
330 2016-09-08  Alex Christensen  <achristensen@webkit.org>
331
332         URLParser: Handle \ in paths of special URLs according to spec
333         https://bugs.webkit.org/show_bug.cgi?id=161781
334
335         Reviewed by Tim Horton.
336
337         Covered by new API tests.
338
339         * platform/URLParser.cpp:
340         (WebCore::bufferView):
341         (WebCore::URLParser::copyURLPartsUntil):
342         (WebCore::URLParser::parse):
343         * platform/URLParser.h:
344
345 2016-09-08  Said Abou-Hallawa  <sabouhallawa@apple.com>
346
347         Move the BitmapImage platform dependent code to a new file named NativeImage[CG|Cairo].cpp
348         https://bugs.webkit.org/show_bug.cgi?id=158684
349
350         Reviewed by Simon Fraser.
351
352         This is a refactoring patch. It moves the BitmapImage platform dependent
353         code from BitmapImage to NativeImage[CG|Cairo].cpp. The new APIs are
354         responsible of drawing a NativeImagePtr and answering some metadata queries.
355
356         No new tests -- Code refactoring, no behavior change.
357
358         * PlatformAppleWin.cmake:
359         * PlatformEfl.cmake:
360         * PlatformGTK.cmake:
361         * PlatformMac.cmake:
362         * PlatformWinCairo.cmake:
363         * WebCore.xcodeproj/project.pbxproj:
364         * loader/cache/MemoryCache.h:
365         * loader/icon/IconDatabaseBase.h:
366         * page/mac/TextIndicatorWindow.mm:
367         (-[WebTextIndicatorView initWithFrame:textIndicator:margin:offset:]):
368         (createContentCrossfadeAnimation):
369         * platform/graphics/BitmapImage.cpp:
370         (WebCore::BitmapImage::BitmapImage):
371         (WebCore::BitmapImage::destroyDecodedData):
372         (WebCore::BitmapImage::destroyDecodedDataIfNecessary):
373         (WebCore::BitmapImage::dataChanged):
374         (WebCore::BitmapImage::ensureFrameAtIndexIsCached):
375         (WebCore::BitmapImage::frameImageAtIndex):
376         (WebCore::BitmapImage::nativeImage):
377         (WebCore::BitmapImage::nativeImageForCurrentFrame):
378         (WebCore::BitmapImage::nativeImageOfSize):
379         (WebCore::BitmapImage::framesNativeImages):
380         (WebCore::BitmapImage::frameIsCompleteAtIndex):
381         (WebCore::BitmapImage::frameDurationAtIndex):
382         (WebCore::BitmapImage::frameHasAlphaAtIndex):
383         (WebCore::BitmapImage::frameOrientationAtIndex):
384         (WebCore::BitmapImage::singlePixelSolidColor):
385         (WebCore::BitmapImage::draw):
386         (WebCore::BitmapImage::drawPattern):
387         (WebCore::BitmapImage::canAnimate):
388         (WebCore::BitmapImage::clearTimer):
389         (WebCore::BitmapImage::startTimer):
390         (WebCore::BitmapImage::stopAnimation):
391         (WebCore::BitmapImage::resetAnimation):
392         (WebCore::BitmapImage::hasSingleSecurityOrigin): Deleted.
393         (WebCore::BitmapImage::filenameExtension): Deleted.
394         (WebCore::BitmapImage::ensureFrameIsCached): Deleted.
395         * platform/graphics/BitmapImage.h:
396         (WebCore::FrameData::FrameData):
397         m_hasAlpha can be initialized with false because it is accessed only in
398         BitmapImage::frameHasAlphaAtIndex() and it is guarded by m_haveMetadata.
399         Both m_haveMetadata and m_hasAlpha are set in BitmapImage constructor
400         and in BitmapImage::cacheFrame().
401         
402         (WebCore::FrameData::~FrameData):
403         (WebCore::FrameData::clear):
404         * platform/graphics/Icon.h:
405         * platform/graphics/Image.h:
406         (WebCore::Image::nativeImage):
407         (WebCore::Image::nativeImageOfSize):
408         (WebCore::Image::framesNativeImages):
409         (WebCore::Image::orientationForCurrentFrame): Deleted.
410         (WebCore::Image::getCGImageRef): Deleted.
411         (WebCore::Image::getFirstCGImageRefOfSize): Deleted.
412         (WebCore::Image::getCGImageArray): Deleted.
413         * platform/graphics/ImageSource.cpp:
414         (WebCore::ImageSource::calculateMaximumSubsamplingLevel):
415         (WebCore::ImageSource::size):
416         (WebCore::ImageSource::sizeRespectingOrientation):
417         * platform/graphics/ImageSource.h:
418         * platform/graphics/MediaPlayer.h:
419         * platform/graphics/NativeImage.h: Added.
420         * platform/graphics/NativeImagePtr.h: Removed.
421         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
422         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updatePausedImage):
423         * platform/graphics/cairo/BitmapImageCairo.cpp: Removed.
424         * platform/graphics/cairo/NativeImageCairo.cpp: Added.
425         (WebCore::nativeImageSize):
426         (WebCore::nativeImageHasAlpha):
427         (WebCore::nativeImageSinglePixelSolidColor):
428         (WebCore::subsamplingScale):
429         (WebCore::drawNativeImage):
430         (WebCore::clearNativeImageSubImages):
431         * platform/graphics/cg/BitmapImageCG.cpp: Removed.
432         * platform/graphics/cg/ImageDecoderCG.cpp:
433         (WebCore::ImageDecoder::size):
434         * platform/graphics/cg/ImageDecoderCG.h:
435         * platform/graphics/cg/NativeImageCG.cpp: Added.
436         (WebCore::nativeImageSize):
437         (WebCore::nativeImageHasAlpha):
438         (WebCore::nativeImageSinglePixelSolidColor):
439         (WebCore::subsamplingScale):
440         (WebCore::drawNativeImage):
441         (WebCore::clearNativeImageSubImages):
442         * platform/graphics/cg/PatternCG.cpp:
443         (WebCore::Pattern::createPlatformPattern):
444         * platform/graphics/cocoa/TextTrackRepresentationCocoa.mm:
445         (TextTrackRepresentationCocoa::update):
446         * platform/graphics/mac/ImageMac.mm:
447         (WebCore::BitmapImage::getTIFFRepresentation):
448         * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
449         (WebCore::MockRealtimeVideoSourceMac::updatePlatformLayer):
450         (WebCore::MockRealtimeVideoSourceMac::updateSampleBuffer):
451         * platform/win/DragImageCGWin.cpp:
452         (WebCore::createDragImageFromImage):
453
454 2016-09-08  Alex Christensen  <achristensen@webkit.org>
455
456         URLParser: Parsing empty URLs with a base URL should return the base URL
457         https://bugs.webkit.org/show_bug.cgi?id=161777
458
459         Reviewed by Tim Horton.
460
461         Covered by an API test and progress towards passing all web platform tests when using URLParser.
462
463         * platform/URLParser.cpp:
464         (WebCore::URLParser::parse):
465
466 2016-09-08  Alex Christensen  <achristensen@webkit.org>
467
468         URLParser failures should preserve the original input string
469         https://bugs.webkit.org/show_bug.cgi?id=161769
470
471         Reviewed by Tim Horton.
472
473         No new tests, but covered by updates to API tests.
474         This also represents many newly passing web platform tests when using URLParser.
475
476         * platform/URLParser.cpp:
477         (WebCore::URLParser::failure):
478         (WebCore::URLParser::parse):
479         * platform/URLParser.h:
480
481 2016-09-08  Alex Christensen  <achristensen@webkit.org>
482
483         URLParser should parse URLs with a user but no password
484         https://bugs.webkit.org/show_bug.cgi?id=161773
485
486         Reviewed by Brady Eidson.
487
488         Covered by new API tests.
489
490         * platform/URLParser.cpp:
491         (WebCore::URLParser::parseAuthority):
492
493 2016-09-08  Alex Christensen  <achristensen@webkit.org>
494
495         Fix URLs after r205669.
496         https://bugs.webkit.org/show_bug.cgi?id=161731
497
498         * platform/URLParser.cpp:
499         (WebCore::URLParser::enabled):
500         I accidentally committed enabling the URLParser by default.  Not ready yet.
501
502 2016-09-08  Chris Dumez  <cdumez@apple.com>
503
504         Align proto getter / setter behavior with other browsers
505         https://bugs.webkit.org/show_bug.cgi?id=161455
506
507         Reviewed by Saam Barati.
508
509         Align cross-origin __proto__ getter / setter behavior with other
510         browsers and the specification:
511
512         [[SetPrototypeOf]] should throw a TypeError:
513         - https://html.spec.whatwg.org/#windowproxy-setprototypeof
514         - https://html.spec.whatwg.org/#location-setprototypeof
515         - https://tc39.github.io/ecma262/#sec-object.setprototypeof (step 5)
516
517         [[GetPrototypeOf]] should return null cross-origin:
518         - https://html.spec.whatwg.org/#windowproxy-getprototypeof
519         - https://html.spec.whatwg.org/#location-getprototypeof
520
521         Test: js/dom/setPrototypeOf-location-window.html
522
523         * bindings/js/JSDOMWindowBase.cpp:
524         (WebCore::JSDOMWindowBase::JSDOMWindowBase): Deleted.
525         * bindings/js/JSDOMWindowCustom.cpp:
526         (WebCore::JSDOMWindow::setPrototype):
527         (WebCore::JSDOMWindow::getPrototype):
528         (WebCore::JSDOMWindow::preventExtensions):
529         * bindings/js/JSLocationCustom.cpp:
530         (WebCore::JSLocation::setPrototype):
531         (WebCore::JSLocation::getPrototype):
532         * bindings/js/JSWorkerGlobalScopeBase.cpp:
533         (WebCore::JSWorkerGlobalScopeBase::supportsRichSourceInfo): Deleted.
534         * bindings/js/JSWorkerGlobalScopeBase.h:
535         * bindings/scripts/CodeGeneratorJS.pm:
536         (GenerateHeader):
537         * bindings/scripts/IDLAttributes.txt:
538         * page/DOMWindow.idl:
539         * page/Location.idl:
540
541 2016-09-08  Alex Christensen  <achristensen@webkit.org>
542
543         URLParser should parse ports after IPv4 and IPv6 hosts
544         https://bugs.webkit.org/show_bug.cgi?id=161731
545
546         Reviewed by Brady Eidson.
547
548         Covered by new API tests.
549
550         * platform/URLParser.cpp:
551         (WebCore::URLParser::parsePort):
552         (WebCore::URLParser::parseHost):
553
554 2016-09-08  Alex Christensen  <achristensen@webkit.org>
555
556         URLParser should correctly handle \ in path
557         https://bugs.webkit.org/show_bug.cgi?id=161762
558
559         Reviewed by Brady Eidson.
560
561         Covered by new API tests.
562
563         * platform/URLParser.cpp:
564         (WebCore::isSpecialScheme):
565         (WebCore::bufferView):
566         (WebCore::URLParser::parse):
567         Treat \ as / in the path of special URLs as described in the spec and tested in web platform tests.
568         Also a slight performance improvement using StringViews instead of copied Strings.
569
570 2016-09-08  Alex Christensen  <achristensen@webkit.org>
571
572         URLParser should handle URLs with empty authority
573         https://bugs.webkit.org/show_bug.cgi?id=161711
574
575         Reviewed by Brady Eidson.
576
577         Covered by new API tests.
578
579         * platform/URLParser.cpp:
580         (WebCore::URLParser::parse):
581         (WebCore::URLParser::parseAuthority):
582
583 2016-09-08  Chris Dumez  <cdumez@apple.com>
584
585         HTMLImageElement.hspace / vspace attributes should be unsigned
586         https://bugs.webkit.org/show_bug.cgi?id=161754
587
588         Reviewed by Alex Christensen.
589
590         HTMLImageElement.hspace / vspace attributes should be unsigned:
591         - https://html.spec.whatwg.org/#HTMLImageElement-partial
592
593         Firefox agrees with the specification, however, those were signed in
594         webKit.
595
596         No new tests, rebaselined existing test.
597
598         * html/HTMLImageElement.idl:
599
600 2016-09-08  Chris Dumez  <cdumez@apple.com>
601
602         Update parseHTMLNonNegativeInteger() to return an unsigned value
603         https://bugs.webkit.org/show_bug.cgi?id=161759
604
605         Reviewed by Alex Christensen.
606
607         Update parseHTMLNonNegativeInteger() to return an unsigned value instead
608         of a signed one as the value can never be negative.
609
610         * html/HTMLElement.cpp:
611         (WebCore::HTMLElement::parseBorderWidthAttribute):
612         * html/HTMLImageElement.cpp:
613         (WebCore::HTMLImageElement::width):
614         (WebCore::HTMLImageElement::height):
615         * html/HTMLInputElement.cpp:
616         (WebCore::HTMLInputElement::maxLengthAttributeChanged):
617         (WebCore::HTMLInputElement::minLengthAttributeChanged):
618         * html/HTMLTextAreaElement.cpp:
619         (WebCore::HTMLTextAreaElement::maxLengthAttributeChanged):
620         (WebCore::HTMLTextAreaElement::minLengthAttributeChanged):
621         * html/ImageInputType.cpp:
622         (WebCore::ImageInputType::height):
623         (WebCore::ImageInputType::width):
624         * html/parser/HTMLParserIdioms.cpp:
625         (WebCore::parseHTMLNonNegativeInteger):
626         (WebCore::parseHTTPRefreshInternal):
627         * html/parser/HTMLParserIdioms.h:
628
629 2016-09-08  Said Abou-Hallawa  <sabouhallawa@apple.com>
630
631         Get rid of the color profile from ImageFrame and ImageDecoder
632         https://bugs.webkit.org/show_bug.cgi?id=159699
633
634         Reviewed by Simon Fraser.
635
636         The color profile is set but it is never used.
637
638         * platform/image-decoders/ImageDecoder.cpp:
639         (WebCore::ImageFrame::setColorProfile): Deleted.
640         * platform/image-decoders/ImageDecoder.h:
641         * platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
642         (WebCore::JPEGImageReader::decode):
643         (WebCore::JPEGImageDecoder::outputScanlines):
644         (WebCore::readColorProfile): Deleted.
645         * platform/image-decoders/jpeg/JPEGImageDecoder.h:
646         * platform/image-decoders/png/PNGImageDecoder.cpp:
647         (WebCore::PNGImageDecoder::headerAvailable):
648         (WebCore::PNGImageDecoder::rowAvailable):
649         (WebCore::readColorProfile): Deleted.
650
651 2016-09-08  Dave Hyatt  <hyatt@apple.com>
652
653         [CSS Parser] Add support for new CSS selector parsing
654         https://bugs.webkit.org/show_bug.cgi?id=161749
655
656         Reviewed by Dean Jackson.
657
658         * CMakeLists.txt:
659         * WebCore.xcodeproj/project.pbxproj:
660         * contentextensions/ContentExtensionParser.cpp:
661         (WebCore::ContentExtensions::isValidSelector):
662         * css/CSSDefaultStyleSheets.cpp:
663         (WebCore::parseUASheet):
664         * css/CSSFontFaceSet.cpp:
665         (WebCore::CSSFontFaceSet::matchingFaces):
666         * css/CSSGrammar.y.in:
667         * css/CSSSelector.cpp:
668         (WebCore::CSSSelector::selectorText):
669         * css/CSSSelector.h:
670         * css/DOMCSSNamespace.cpp:
671         (WebCore::DOMCSSNamespace::supports):
672         * css/FontFace.cpp:
673         (WebCore::FontFace::parseString):
674         (WebCore::FontFace::setVariant):
675         * css/MediaList.cpp:
676         (WebCore::MediaQuerySet::internalParse):
677         (WebCore::MediaQuerySet::parse):
678         * css/SelectorChecker.cpp:
679         (WebCore::SelectorChecker::matchRecursively):
680         * css/SelectorFilter.cpp:
681         (WebCore::SelectorFilter::collectIdentifierHashes):
682         * css/SelectorPseudoClassAndCompatibilityElementMap.in:
683         * css/SelectorPseudoTypeMap.h:
684         * css/SourceSizeList.cpp:
685         (WebCore::parseSizesAttribute):
686         * css/StyleProperties.cpp:
687         (WebCore::MutableStyleProperties::MutableStyleProperties):
688         * css/StyleProperties.h:
689         * css/StyleRuleImport.cpp:
690         (WebCore::StyleRuleImport::setCSSStyleSheet):
691         * css/StyleSheetContents.cpp:
692         (WebCore::StyleSheetContents::StyleSheetContents):
693         (WebCore::StyleSheetContents::parserAddNamespace):
694         (WebCore::StyleSheetContents::namespaceURIFromPrefix):
695         (WebCore::StyleSheetContents::determineNamespace): Deleted.
696         * css/StyleSheetContents.h:
697         * css/WebKitCSSMatrix.cpp:
698         (WebCore::WebKitCSSMatrix::setMatrixValue):
699         * css/makeSelectorPseudoClassAndCompatibilityElementMap.py:
700         * css/parser/CSSParser.cpp:
701         (WebCore::strictCSSParserContext):
702         (WebCore::CSSParserContext::CSSParserContext):
703         (WebCore::CSSParser::parseColor):
704         (WebCore::CSSParser::shouldAcceptUnitLessValues):
705         (WebCore::CSSParser::parseValue):
706         (WebCore::CSSParser::parseColumnWidth):
707         (WebCore::CSSParser::parseColumnCount):
708         (WebCore::CSSParser::parseFontWeight):
709         (WebCore::CSSParser::parseColorParameters):
710         (WebCore::CSSParser::parseHSLParameters):
711         (WebCore::CSSParser::parseShadow):
712         (WebCore::CSSParser::parseBorderImageSlice):
713         (WebCore::CSSParser::parseBorderImageQuad):
714         (WebCore::CSSParser::parseDeprecatedLinearGradient):
715         (WebCore::CSSParser::parseLinearGradient):
716         (WebCore::CSSParser::parseTransformValue):
717         (WebCore::CSSParser::parseBuiltinFilterArguments):
718         (WebCore::CSSParser::determineNameInNamespace):
719         * css/parser/CSSParser.h:
720         (WebCore::CSSParser::inStrictMode):
721         (WebCore::CSSParser::inQuirksMode):
722         * css/parser/CSSParserMode.h:
723         (WebCore::isQuirksModeBehavior):
724         (WebCore::isUASheetBehavior):
725         (WebCore::isUnitLessLengthParsingEnabledForMode):
726         (WebCore::isCSSViewportParsingEnabledForMode):
727         (WebCore::strictToCSSParserMode):
728         (WebCore::isStrictParserMode):
729         * css/parser/CSSParserValues.cpp:
730         (WebCore::CSSParserSelector::parsePseudoElementSelectorFromStringView):
731         (WebCore::CSSParserSelector::parsePseudoClassSelectorFromStringView):
732         (WebCore::CSSParserSelector::setSelectorList):
733         (WebCore::CSSParserSelector::appendTagHistory):
734         (WebCore::CSSParserSelector::releaseTagHistory):
735         (WebCore::CSSParserSelector::isHostPseudoSelector):
736         * css/parser/CSSParserValues.h:
737         (WebCore::CSSParserSelector::match):
738         (WebCore::CSSParserSelector::pseudoElementType):
739         (WebCore::CSSParserSelector::selectorList):
740         (WebCore::CSSParserSelector::needsImplicitShadowCombinatorForMatching):
741         * css/parser/CSSPropertyParser.h:
742         (WebCore::CSSPropertyParser::inQuirksMode):
743         * css/parser/CSSSelectorParser.cpp: Added.
744         (WebCore::CSSSelectorParser::parseSelector):
745         (WebCore::CSSSelectorParser::CSSSelectorParser):
746         (WebCore::CSSSelectorParser::consumeComplexSelectorList):
747         (WebCore::CSSSelectorParser::consumeCompoundSelectorList):
748         (WebCore::CSSSelectorParser::consumeComplexSelector):
749         (WebCore::CSSSelectorParser::consumeCompoundSelector):
750         (WebCore::CSSSelectorParser::consumeSimpleSelector):
751         (WebCore::CSSSelectorParser::consumeName):
752         (WebCore::CSSSelectorParser::consumeId):
753         (WebCore::CSSSelectorParser::consumeClass):
754         (WebCore::CSSSelectorParser::consumeAttribute):
755         (WebCore::CSSSelectorParser::consumePseudo):
756         (WebCore::CSSSelectorParser::consumeCombinator):
757         (WebCore::CSSSelectorParser::consumeAttributeMatch):
758         (WebCore::CSSSelectorParser::consumeAttributeFlags):
759         (WebCore::CSSSelectorParser::consumeANPlusB):
760         (WebCore::CSSSelectorParser::defaultNamespace):
761         (WebCore::CSSSelectorParser::determineNamespace):
762         (WebCore::CSSSelectorParser::prependTypeSelectorIfNeeded):
763         (WebCore::CSSSelectorParser::addSimpleSelectorToCompound):
764         (WebCore::CSSSelectorParser::splitCompoundAtImplicitShadowCrossingCombinator):
765         * css/parser/CSSSelectorParser.h: Added.
766         (WebCore::CSSSelectorParser::DisallowPseudoElementsScope::DisallowPseudoElementsScope):
767         (WebCore::CSSSelectorParser::DisallowPseudoElementsScope::~DisallowPseudoElementsScope):
768         * cssjit/SelectorCompiler.cpp:
769         (WebCore::SelectorCompiler::fragmentRelationForSelectorRelation):
770         * dom/StyledElement.cpp:
771         (WebCore::StyledElement::rebuildPresentationAttributeStyle):
772         * svg/SVGFontFaceElement.cpp:
773         (WebCore::SVGFontFaceElement::SVGFontFaceElement):
774
775 2016-09-08  Simon Fraser  <simon.fraser@apple.com>
776
777         Don't run transitions to or from undefined Lengths
778         https://bugs.webkit.org/show_bug.cgi?id=161750
779         rdar://problem/28170460
780
781         Reviewed by Zalan Bujtas.
782
783         For properties like max-height whose default value is 'none', we would erroneously
784         attempt to run transitions/animations, and then assert when one of the endpoints
785         was undefined.
786
787         So don't attempt to blend such Length values, just as do when they are auto.
788
789         Fixes some transitions on apple.com and developer.apple.com.
790
791         Test: transitions/transition-to-from-undefined.html
792
793         * page/animation/CSSPropertyAnimation.cpp:
794         (WebCore::CSSPropertyAnimation::blendProperties):
795         * platform/Length.cpp:
796         (WebCore::blend):
797
798 2016-09-08  Myles C. Maxfield  <mmaxfield@apple.com>
799
800         Support new emoji group candidates
801         https://bugs.webkit.org/show_bug.cgi?id=161664
802         <rdar://problem/24802695>
803         <rdar://problem/27666433>
804
805         Reviewed by Simon Fraser.
806
807         Support more emoji group candidates. This includes joining groups into a single glyph, as
808         well as atomic deletions of the entire group when the backspace key is pressed.
809
810         Tests: editing/deleting/delete-emoji.html:
811                fast/text/emoji-num-glyphs.html:
812
813         * platform/text/CharacterProperties.h:
814         (WebCore::isEmojiGroupCandidate):
815
816 2016-09-08  Chris Dumez  <cdumez@apple.com>
817
818         HTMLImageElement.width / height attributes should be unsigned
819         https://bugs.webkit.org/show_bug.cgi?id=161730
820
821         Reviewed by Alex Christensen.
822
823         HTMLImageElement.width / height attributes should be unsigned as per
824         the HTML specification:
825         - https://html.spec.whatwg.org/#htmlimageelement
826
827         However, they are signed in WebKit. Firefox agrees with the
828         specification.
829
830         No new tests, rebaselined existing test.
831
832         * bindings/js/JSImageConstructor.cpp:
833         (WebCore::JSImageConstructor::construct):
834         (WebCore::createImageConstructor): Deleted.
835         * html/HTMLImageElement.cpp:
836         (WebCore::HTMLImageElement::createForJSConstructor):
837         (WebCore::HTMLImageElement::width):
838         (WebCore::HTMLImageElement::height):
839         (WebCore::HTMLImageElement::setHeight):
840         (WebCore::HTMLImageElement::setWidth):
841         * html/HTMLImageElement.h:
842         * html/HTMLImageElement.idl:
843         * html/ImageDocument.cpp:
844         (WebCore::ImageDocument::restoreImageSize):
845
846 2016-09-08  Filip Pizlo  <fpizlo@apple.com>
847
848         Move JSMap/JSSet over to Auxiliary MarkedSpace
849         https://bugs.webkit.org/show_bug.cgi?id=161744
850
851         Reviewed by Saam Barati.
852
853         No new tests because no change in behavior.
854
855         * bindings/js/SerializedScriptValue.cpp:
856
857 2016-09-08  Commit Queue  <commit-queue@webkit.org>
858
859         Unreviewed, rolling out r205652.
860         https://bugs.webkit.org/show_bug.cgi?id=161748
861
862         Crashing under ASan (Requested by yusukesuzuki on #webkit).
863
864         Reverted changeset:
865
866         "ScriptRunner should be driven by PendingScript rather than
867         ScriptElement"
868         https://bugs.webkit.org/show_bug.cgi?id=161726
869         http://trac.webkit.org/changeset/205652
870
871 2016-09-08  Yusuke Suzuki  <utatane.tea@gmail.com>
872
873         ScriptRunner should be driven by PendingScript rather than ScriptElement
874         https://bugs.webkit.org/show_bug.cgi?id=161726
875
876         Reviewed by Ryosuke Niwa.
877
878         ScriptRunner is driven by ScriptElement::notifyFinished. While ScriptRunner is driven by this,
879         HTMLScriptRunner does not use it. Instead, HTMLScriptRunner uses PendingScriptClient. As a result,
880         ScriptElement::notifyFinished is used only when the script is annotated with "defer" or "async"
881         while all the external script will load the LoadableScript. It is confusing.
882         This patch removes ScriptElement::notifyFinished and use PendingScript's observability
883         in ScriptRunner instead.
884
885         This patch also fixes the behavior about ignore-destructive-writes counter[1]. When dispatching
886         the load and error events, this ignore-destructive-writes counter should not be incremeneted by
887         this execution. The added tests ensure this behavior.
888
889         [1]: https://html.spec.whatwg.org/multipage/scripting.html#execute-the-script-block
890
891         * dom/ScriptElement.cpp: Drop LoadableScriptClient interface.
892         (WebCore::ScriptElement::prepareScript): Do not use addClient. ScriptRunner use PendingScript::{setClient,clearClient} instead.
893         (WebCore::ScriptElement::executeScriptForScriptRunner): IgnoreDestructiveWriteCountIncrementer will be done in ScriptElement::executeScript.
894         So no need to do it here, that's duplicated.
895         (WebCore::ScriptElement::~ScriptElement): Deleted. ScriptElement does not use addClient/removeClient.
896         (WebCore::ScriptElement::stopLoadRequest): Deleted.
897         (WebCore::ScriptElement::executeScriptForHTMLScriptRunner): Deleted. executeScriptForHTMLScriptRunner and executeScriptForScriptRunner are
898         merged into executeScriptForRunner.
899         (WebCore::ScriptElement::notifyFinished): Deleted.
900         * dom/ScriptElement.h:
901         (WebCore::ScriptElement::~ScriptElement):
902         (WebCore::ScriptElement::willExecuteInOrder): Used in ScriptRunner to determine whether the script is async or defer.
903         (WebCore::ScriptElement::willExecuteWhenDocumentFinishedParsing): Deleted.
904         * dom/ScriptRunner.cpp:
905         (WebCore::ScriptRunner::~ScriptRunner): HashSet's iterator will return `const PendingScript&`.
906         Another option is using HashSet<RefPtr<PendingScript>>. Here, we use a little bit weired const_cast.
907         (WebCore::ScriptRunner::queueScriptForExecution): Use PendingScript::setClient to wait loading.
908         (WebCore::ScriptRunner::notifyFinished): Notify the script ready here.
909         (WebCore::ScriptRunner::timerFired): Use executeScriptForScriptRunner.
910         (WebCore::ScriptRunner::notifyScriptReady): Deleted.
911         * dom/ScriptRunner.h:
912         * html/parser/HTMLScriptRunner.cpp:
913         (WebCore::HTMLScriptRunner::executePendingScriptAndDispatchEvent): Use executeScriptForScriptRunner.
914
915 2016-09-08  Alex Christensen  <achristensen@webkit.org>
916
917         Re-land r205580 after r205649 fixed the test failures
918         https://bugs.webkit.org/show_bug.cgi?id=161668
919
920         Re-landing changesets:
921
922         "Punycode encode non-ascii hosts in URLParser"
923         https://bugs.webkit.org/show_bug.cgi?id=161655
924         http://trac.webkit.org/changeset/205521
925
926         "Fix query-only and fragment-only relative URLs when using
927         URLParser"
928         https://bugs.webkit.org/show_bug.cgi?id=161657
929         http://trac.webkit.org/changeset/205526
930
931         "URLParser should parse / as a relative URL"
932         https://bugs.webkit.org/show_bug.cgi?id=161667
933         http://trac.webkit.org/changeset/205532
934
935 2016-09-08  Alex Christensen  <achristensen@webkit.org>
936
937         Add range check in URLParser's serializeIPv6
938         https://bugs.webkit.org/show_bug.cgi?id=161743
939
940         Reviewed by David Kilzer.
941
942         No new tests, but this fixes API tests in some release builds after
943         the patch from https://bugs.webkit.org/show_bug.cgi?id=161668 is recommitted.
944
945         * platform/URLParser.cpp:
946         (WebCore::serializeIPv6):
947         Don't go out of bounds.  Don't assume that the memory immediately after the end of the array will be empty.
948
949 2016-09-07  Alex Christensen  <achristensen@webkit.org>
950
951         Roll out r205580 and r205582.
952         https://bugs.webkit.org/show_bug.cgi?id=161668
953
954         I need to figure out why this is failing on the bots before landing any more URLParser progress.
955
956 2016-09-07  Yusuke Suzuki  <utatane.tea@gmail.com>
957
958         Unreviewed, EFL build fix after r205581
959         https://bugs.webkit.org/show_bug.cgi?id=161674
960
961         * dom/LoadableClassicScript.cpp:
962         (WebCore::LoadableClassicScript::notifyFinished):
963
964 2016-09-07  Alex Christensen  <achristensen@webkit.org>
965
966         Fix API tests after r205580
967         https://bugs.webkit.org/show_bug.cgi?id=161668
968
969         No new tests, but this fixes API tests on bots.
970
971         * platform/URLParser.cpp:
972         (WebCore::domainToASCII):
973         This function seems to be appending characters to strings sometimes on some configurations.
974         This definitely needs further investigation, but this will fix the bots, and nothing else
975         will be affected because the URLParser is disabled by default.
976
977 2016-09-07  Yusuke Suzuki  <utatane.tea@gmail.com>
978
979         Introduce abstract class LoadableScript for classic script and module graph
980         https://bugs.webkit.org/show_bug.cgi?id=161674
981
982         Reviewed by Ryosuke Niwa.
983
984         To prepare for ScriptModuleGraph, we introduce the abstract class over the classic script
985         and the module script, LoadableScript.
986
987         No behavior change.
988
989         * CMakeLists.txt:
990         * WebCore.xcodeproj/project.pbxproj:
991         * dom/LoadableClassicScript.cpp: Added. LoadableClassicScript is the derived class from the
992         LoadableScript. In the module patch, we will introduce LoadableScriptModuleGraph which is also
993         the derived class from the LoadableScript. It is used for the external classic script.
994         A CachedResourceHandle used here alone does not prevent the underlying CachedResource from purging its
995         data buffer. This LoadableClassicScript holds a client until this class is destroyed in order to
996         guarantee that the data buffer will not be purged.
997         (WebCore::LoadableClassicScript::create):
998         (WebCore::LoadableClassicScript::LoadableClassicScript):
999         (WebCore::LoadableClassicScript::~LoadableClassicScript):
1000         (WebCore::LoadableClassicScript::isLoaded):
1001         (WebCore::LoadableClassicScript::wasErrored): Beyond the boolean value, this can return the detail
1002         of the error. This detailed information will be used to report it to the inspector in the ScriptElement.
1003         (WebCore::LoadableClassicScript::wasCanceled):
1004         (WebCore::LoadableClassicScript::notifyFinished): Nosniff and cross-origin loading errors are handled here,
1005         instead of exposing CachedScript*.
1006         (WebCore::LoadableClassicScript::execute): Execute the cached script by using the given ScriptElement.
1007         * dom/LoadableClassicScript.h: Copied from Source/WebCore/dom/PendingScript.h.
1008         (isType):
1009         * dom/LoadableScript.cpp: Copied from Source/WebCore/dom/ScriptRunner.h. New wrapper for CachedScript
1010         and ScriptModuleGraph. We introduce a new wrapper to handle the above 2 things in the same way.
1011         We take the way to introduce a new wrapper instead of introducing a new interface that is inherited by
1012         CachedScript and ScriptModuleGraph. This is because ScriptModuleGraph is ref-counted while CachedScript
1013         is managed by CachedResourceHandle. While this patch does not contain ScriptModuleGraph part, this
1014         should be added in the module patch and at that time, this should be managed by this LoadableScript's
1015         subclass. And we introduce TypeCasts traits for LoadableScript to allow `is<>` and `downcast<>`.
1016         (WebCore::LoadableScript::addClient):
1017         (WebCore::LoadableScript::removeClient):
1018         (WebCore::LoadableScript::notifyClientFinished):
1019         * dom/LoadableScript.h: Copied from Source/WebCore/dom/ScriptRunner.h.
1020         (WebCore::LoadableScript::~LoadableScript):
1021         (WebCore::LoadableScript::isClassicScript):
1022         (WebCore::LoadableScript::isModuleGraph):
1023         * dom/LoadableScriptClient.h: Copied from Source/WebCore/dom/ScriptRunner.h.
1024         (WebCore::LoadableScriptClient::~LoadableScriptClient):
1025         * dom/PendingScript.cpp: Use LoadableScript instead of CachedScript.
1026         (WebCore::PendingScript::create):
1027         (WebCore::PendingScript::PendingScript):
1028         (WebCore::PendingScript::~PendingScript):
1029         (WebCore::PendingScript::loadableScript):
1030         (WebCore::PendingScript::notifyFinished):
1031         (WebCore::PendingScript::isLoaded):
1032         (WebCore::PendingScript::wasErrored):
1033         (WebCore::PendingScript::cachedScript): Deleted.
1034         * dom/PendingScript.h:
1035         * dom/ScriptElement.cpp:
1036         (WebCore::ScriptElement::ScriptElement):
1037         (WebCore::ScriptElement::handleSourceAttribute): Change sourceUrl to sourceURL to be consistent.
1038         (WebCore::ScriptElement::prepareScript):
1039         (WebCore::ScriptElement::requestClassicScript): requestScript is renamed to requestClassicScript.
1040         (WebCore::ScriptElement::requestScriptWithCache): Extract the code requesting the
1041         CachedScript from requestScript. This will also be used by the module fetcher.
1042         (WebCore::ScriptElement::executeScript): Now inspector error reporting is also done in this function.
1043         When an error occurs, LoadableScript::wasErrored() returns the error which may include the information
1044         to report the error to the inspector. nosniff and cross-origin loading errors are now detected by the
1045         LoadableClassicScript and reported through this wasErrored().
1046         (WebCore::ScriptElement::stopLoadRequest):
1047         (WebCore::ScriptElement::executeScriptAndDispatchEvent):
1048         (WebCore::ScriptElement::executeScriptForScriptRunner): Move the code from ScriptRunner. This function
1049         calls removeClient(*this) because ScriptRunner is driven by the ScriptElement's notification. Only when using
1050         ScriptRunner, we call addClient(*this) for ScriptElement. This is tricky, we should refactor this in the separated
1051         bug (https://bugs.webkit.org/show_bug.cgi?id=161726).
1052         (WebCore::ScriptElement::executeScriptForHTMLScriptRunner): Move the code from HTMLScriptRunner.
1053         (WebCore::ScriptElement::notifyFinished):
1054         (WebCore::ScriptElement::requestScript): Deleted.
1055         (WebCore::ScriptElement::execute): Deleted.
1056         * dom/ScriptElement.h:
1057         (WebCore::ScriptElement::loadableScript):
1058         (WebCore::ScriptElement::cachedScript): Deleted.
1059         * dom/ScriptRunner.cpp:
1060         (WebCore::ScriptRunner::queueScriptForExecution):
1061         (WebCore::ScriptRunner::timerFired): Use ScriptElement::executeScriptForScriptRunner.
1062         * dom/ScriptRunner.h:
1063         * html/parser/HTMLScriptRunner.cpp:
1064         (WebCore::HTMLScriptRunner::executePendingScriptAndDispatchEvent):
1065         (WebCore::requestPendingScript):
1066         (WebCore::HTMLScriptRunner::requestParsingBlockingScript):
1067         (WebCore::HTMLScriptRunner::sourceFromPendingScript): Deleted.
1068         * html/parser/HTMLScriptRunner.h: Use ScriptElement::executeScriptForHTMLScriptRunner.
1069         * xml/parser/XMLDocumentParserLibxml2.cpp: Currently, we do nothing about XMLDocument in this patch.
1070         We should support the module script, but before that, we should refactor this pending script handling.
1071         (WebCore::XMLDocumentParser::endElementNs):
1072
1073 2016-09-07  Alex Christensen  <achristensen@webkit.org>
1074
1075         Unreviewed, revert r205533.
1076         https://bugs.webkit.org/show_bug.cgi?id=161668
1077
1078         Re-landing changesets:
1079
1080         "Punycode encode non-ascii hosts in URLParser"
1081         https://bugs.webkit.org/show_bug.cgi?id=161655
1082         http://trac.webkit.org/changeset/205521
1083
1084         "Fix query-only and fragment-only relative URLs when using
1085         URLParser"
1086         https://bugs.webkit.org/show_bug.cgi?id=161657
1087         http://trac.webkit.org/changeset/205526
1088
1089         "URLParser should parse / as a relative URL"
1090         https://bugs.webkit.org/show_bug.cgi?id=161667
1091         http://trac.webkit.org/changeset/205532
1092
1093 2016-09-07  Simon Fraser  <simon.fraser@apple.com>
1094
1095         Enable the <meter> element on iOS
1096         https://bugs.webkit.org/show_bug.cgi?id=161714
1097         rdar://problem/8978410
1098
1099         Reviewed by Tim Horton.
1100
1101         Define ENABLE_METER_ELEMENT unconditionally now.
1102         
1103         Rendering falls back to html.css rendering, which makes <meter> looks similar between
1104         macOS and iOS.
1105
1106         Tested by enabling existing tests.
1107
1108         * Configurations/FeatureDefines.xcconfig:
1109
1110 2016-09-07  Eric Carlson  <eric.carlson@apple.com>
1111
1112         [MediaStream] applyConstraints pt. 2 - advanced constraints
1113         https://bugs.webkit.org/show_bug.cgi?id=161715
1114         <rdar://problem/28195461>
1115
1116         Reviewed by Dean Jackson.
1117
1118         Test: fast/mediastream/apply-constraints-advanced.html
1119
1120         * platform/mediastream/MediaConstraints.cpp:
1121         (WebCore::MediaConstraint::create): Return Ref<>, not RefPtr<>.
1122         (WebCore::MediaConstraint::copy): New
1123         (WebCore::IntConstraint::copy): Ditto.
1124         (WebCore::DoubleConstraint::copy): Ditto.
1125         (WebCore::BooleanConstraint::copy): Ditto.
1126         (WebCore::StringConstraint::copy): Ditto.
1127         (WebCore::StringConstraint::fitnessDistance): New, compute the fitness distance between the
1128           constraint and the specified value.
1129         (WebCore::StringConstraint::merge): New, merge value into constraint.
1130         (WebCore::FlattenedConstraint::set): New, add or replace a constraint.
1131         (WebCore::FlattenedConstraint::merge): New, merge or add a constraint.
1132         * platform/mediastream/MediaConstraints.h:
1133         (WebCore::MediaConstraint::fitnessDistance):
1134         (WebCore::MediaConstraint::merge):
1135         (WebCore::NumericConstraint::nearlyEqual):
1136         (WebCore::FlattenedConstraint::isEmpty):
1137         (WebCore::FlattenedConstraint::begin):
1138         (WebCore::FlattenedConstraint::end):
1139         (WebCore::MediaConstraint::~MediaConstraint): Deleted.
1140         (WebCore::MediaConstraint::find): Deleted.
1141         (WebCore::MediaConstraint::getIdeal): Deleted.
1142
1143         * platform/mediastream/RealtimeMediaSource.cpp:
1144         (WebCore::RealtimeMediaSource::fitnessDistance): Return the fitness distance between the source
1145           capabilities and a constraint.
1146         (WebCore::applyNumericConstraint): New, apply a numeric constraint.
1147         (WebCore::RealtimeMediaSource::applyConstraint): Use applyNumericConstraint.
1148         (WebCore::RealtimeMediaSource::selectSettings): New, implement the SelectSettings algorithm
1149         (WebCore::RealtimeMediaSource::applyConstraints):
1150         (WebCore::RealtimeMediaSource::supportsConstraint): Deleted.
1151         (WebCore::value): Deleted.
1152         * platform/mediastream/RealtimeMediaSource.h:
1153
1154 2016-09-07  Mark Lam  <mark.lam@apple.com>
1155
1156         Add CatchScope and force all exception checks to be via ThrowScope or CatchScope.
1157         https://bugs.webkit.org/show_bug.cgi?id=161498
1158
1159         Reviewed by Geoffrey Garen.
1160
1161         No new test because there is no behavior change in general except for 1 bug fix.
1162         That bug is already caught by existing tests with the introduction of the CatchScope.
1163
1164         Fixes a bug in JSEventListener::handleEvent() where the exception thrown from
1165         a failed attempt to get the handleEvent callback is not handled.
1166
1167         * ForwardingHeaders/runtime/CatchScope.h: Added.
1168         * Modules/encryptedmedia/CDMSessionClearKey.cpp:
1169         (WebCore::CDMSessionClearKey::update):
1170         * Modules/indexeddb/IDBObjectStore.cpp:
1171         (WebCore::IDBObjectStore::putOrAdd):
1172         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1173         (WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd):
1174         * Modules/mediastream/SDPProcessor.cpp:
1175         (WebCore::SDPProcessor::callScript):
1176         * Modules/plugins/QuickTimePluginReplacement.mm:
1177         (WebCore::QuickTimePluginReplacement::ensureReplacementScriptInjected):
1178         (WebCore::QuickTimePluginReplacement::installReplacement):
1179         * bindings/js/ArrayValue.cpp:
1180         (WebCore::ArrayValue::get):
1181         * bindings/js/Dictionary.cpp:
1182         (WebCore::Dictionary::getOwnPropertiesAsStringHashMap):
1183         * bindings/js/IDBBindingUtilities.cpp:
1184         (WebCore::toJS):
1185         * bindings/js/JSApplePaySessionCustom.cpp:
1186         (WebCore::JSApplePaySession::completeShippingMethodSelection):
1187         (WebCore::JSApplePaySession::completeShippingContactSelection):
1188         (WebCore::JSApplePaySession::completePaymentMethodSelection):
1189         * bindings/js/JSAudioTrackCustom.cpp:
1190         (WebCore::JSAudioTrack::setKind):
1191         (WebCore::JSAudioTrack::setLanguage):
1192         * bindings/js/JSBlobCustom.cpp:
1193         (WebCore::constructJSBlob):
1194         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
1195         (WebCore::JSCSSStyleDeclaration::getPropertyCSSValue):
1196         * bindings/js/JSCommandLineAPIHostCustom.cpp:
1197         (WebCore::getJSListenerFunctions):
1198         * bindings/js/JSCryptoAlgorithmDictionary.cpp:
1199         (WebCore::JSCryptoAlgorithmDictionary::getAlgorithmIdentifier):
1200         (WebCore::getHashAlgorithm):
1201         (WebCore::createAesCbcParams):
1202         (WebCore::createAesKeyGenParams):
1203         (WebCore::createHmacParams):
1204         (WebCore::createHmacKeyParams):
1205         (WebCore::createRsaKeyGenParams):
1206         (WebCore::createRsaOaepParams):
1207         (WebCore::createRsaSsaParams):
1208         * bindings/js/JSCryptoKeySerializationJWK.cpp:
1209         (WebCore::getJSArrayFromJSON):
1210         (WebCore::getStringFromJSON):
1211         (WebCore::getBooleanFromJSON):
1212         (WebCore::JSCryptoKeySerializationJWK::JSCryptoKeySerializationJWK):
1213         (WebCore::JSCryptoKeySerializationJWK::reconcileUsages):
1214         (WebCore::JSCryptoKeySerializationJWK::keyDataOctetSequence):
1215         (WebCore::JSCryptoKeySerializationJWK::keyDataRSAComponents):
1216         (WebCore::JSCryptoKeySerializationJWK::keyData):
1217         (WebCore::buildJSONForRSAComponents):
1218         (WebCore::addUsagesToJSON):
1219         (WebCore::JSCryptoKeySerializationJWK::serialize):
1220         * bindings/js/JSCustomElementInterface.cpp:
1221         (WebCore::JSCustomElementInterface::constructElement):
1222         (WebCore::constructCustomElementSynchronously):
1223         (WebCore::JSCustomElementInterface::upgradeElement):
1224         * bindings/js/JSCustomElementRegistryCustom.cpp:
1225         (WebCore::getCustomElementCallback):
1226         (WebCore::JSCustomElementRegistry::define):
1227         (WebCore::whenDefinedPromise):
1228         (WebCore::JSCustomElementRegistry::whenDefined):
1229         * bindings/js/JSDOMBinding.cpp:
1230         (WebCore::valueToUSVString):
1231         (WebCore::reportException):
1232         (WebCore::reportCurrentException):
1233         (WebCore::setDOMException):
1234         (WebCore::hasIteratorMethod):
1235         (WebCore::toSmallerInt):
1236         (WebCore::toSmallerUInt):
1237         (WebCore::toInt32EnforceRange):
1238         (WebCore::toUInt32EnforceRange):
1239         (WebCore::toInt64EnforceRange):
1240         (WebCore::toUInt64EnforceRange):
1241         (WebCore::throwNotSupportedError):
1242         (WebCore::throwInvalidStateError):
1243         (WebCore::throwSecurityError):
1244         * bindings/js/JSDOMBinding.h:
1245         (WebCore::toJSSequence):
1246         (WebCore::toJS):
1247         (WebCore::jsFrozenArray):
1248         (WebCore::NativeValueTraits<String>::nativeValue):
1249         (WebCore::NativeValueTraits<unsigned>::nativeValue):
1250         (WebCore::NativeValueTraits<float>::nativeValue):
1251         (WebCore::NativeValueTraits<double>::nativeValue):
1252         (WebCore::toNativeArray):
1253         * bindings/js/JSDOMGlobalObject.cpp:
1254         (WebCore::makeThisTypeErrorForBuiltins):
1255         (WebCore::makeGetterTypeErrorForBuiltins):
1256         * bindings/js/JSDOMGlobalObjectTask.cpp:
1257         * bindings/js/JSDOMIterator.h:
1258         (WebCore::iteratorForEach):
1259         * bindings/js/JSDOMPromise.cpp:
1260         (WebCore::rejectPromiseWithExceptionIfAny):
1261         * bindings/js/JSDOMPromise.h:
1262         (WebCore::callPromiseFunction):
1263         * bindings/js/JSDOMStringMapCustom.cpp:
1264         (WebCore::JSDOMStringMap::putDelegate):
1265         * bindings/js/JSDOMWindowBase.cpp:
1266         (WebCore::JSDOMWindowMicrotaskCallback::call):
1267         * bindings/js/JSDOMWindowCustom.cpp:
1268         (WebCore::JSDOMWindow::setLocation):
1269         (WebCore::JSDOMWindow::open):
1270         (WebCore::JSDOMWindow::showModalDialog):
1271         (WebCore::handlePostMessage):
1272         (WebCore::JSDOMWindow::setTimeout):
1273         (WebCore::JSDOMWindow::setInterval):
1274         * bindings/js/JSDataCueCustom.cpp:
1275         (WebCore::constructJSDataCue):
1276         * bindings/js/JSDeviceMotionEventCustom.cpp:
1277         (WebCore::readAccelerationArgument):
1278         (WebCore::readRotationRateArgument):
1279         (WebCore::JSDeviceMotionEvent::initDeviceMotionEvent):
1280         * bindings/js/JSDictionary.cpp:
1281         (WebCore::JSDictionary::tryGetProperty):
1282         (WebCore::JSDictionary::convertValue):
1283         * bindings/js/JSDictionary.h:
1284         (WebCore::JSDictionary::tryGetPropertyAndResult):
1285         * bindings/js/JSDocumentCustom.cpp:
1286         (WebCore::JSDocument::getCSSCanvasContext):
1287         * bindings/js/JSEventListener.cpp:
1288         (WebCore::JSEventListener::handleEvent):
1289         * bindings/js/JSFileCustom.cpp:
1290         (WebCore::constructJSFile):
1291         * bindings/js/JSGeolocationCustom.cpp:
1292         (WebCore::createPositionOptions):
1293         (WebCore::JSGeolocation::getCurrentPosition):
1294         (WebCore::JSGeolocation::watchPosition):
1295         * bindings/js/JSHTMLAllCollectionCustom.cpp:
1296         (WebCore::callHTMLAllCollection):
1297         * bindings/js/JSHTMLCanvasElementCustom.cpp:
1298         (WebCore::get3DContextAttributes):
1299         (WebCore::JSHTMLCanvasElement::getContext):
1300         (WebCore::JSHTMLCanvasElement::probablySupportsContext):
1301         * bindings/js/JSHTMLElementCustom.cpp:
1302         (WebCore::constructJSHTMLElement):
1303         * bindings/js/JSHistoryCustom.cpp:
1304         (WebCore::JSHistory::pushState):
1305         (WebCore::JSHistory::replaceState):
1306         * bindings/js/JSIDBDatabaseCustom.cpp:
1307         (WebCore::JSIDBDatabase::createObjectStore):
1308         * bindings/js/JSLazyEventListener.cpp:
1309         (WebCore::JSLazyEventListener::initializeJSFunction):
1310         * bindings/js/JSMainThreadExecState.h:
1311         (WebCore::JSMainThreadExecState::linkAndEvaluateModule):
1312         (WebCore::JSMainThreadExecState::~JSMainThreadExecState):
1313         * bindings/js/JSMessageEventCustom.cpp:
1314         (WebCore::handleInitMessageEvent):
1315         * bindings/js/JSMessagePortCustom.cpp:
1316         (WebCore::fillMessagePortArray):
1317         * bindings/js/JSMessagePortCustom.h:
1318         (WebCore::handlePostMessage):
1319         * bindings/js/JSMockContentFilterSettingsCustom.cpp:
1320         (WebCore::JSMockContentFilterSettings::setDecisionPoint):
1321         (WebCore::toDecision):
1322         (WebCore::JSMockContentFilterSettings::setDecision):
1323         (WebCore::JSMockContentFilterSettings::setUnblockRequestDecision):
1324         * bindings/js/JSNodeFilterCustom.cpp:
1325         (WebCore::JSNodeFilter::acceptNode):
1326         * bindings/js/JSNodeOrString.cpp:
1327         (WebCore::toNodeOrStringVector):
1328         * bindings/js/JSSQLTransactionCustom.cpp:
1329         (WebCore::JSSQLTransaction::executeSql):
1330         * bindings/js/JSSVGLengthCustom.cpp:
1331         (WebCore::JSSVGLength::convertToSpecifiedUnits):
1332         * bindings/js/JSStorageCustom.cpp:
1333         (WebCore::JSStorage::getOwnPropertyNames):
1334         (WebCore::JSStorage::putDelegate):
1335         * bindings/js/JSTextTrackCustom.cpp:
1336         (WebCore::JSTextTrack::setLanguage):
1337         * bindings/js/JSVideoTrackCustom.cpp:
1338         (WebCore::JSVideoTrack::setKind):
1339         (WebCore::JSVideoTrack::setLanguage):
1340         * bindings/js/JSWebGL2RenderingContextCustom.cpp:
1341         (WebCore::JSWebGL2RenderingContext::getIndexedParameter):
1342         * bindings/js/JSWebGLRenderingContextBaseCustom.cpp:
1343         (WebCore::getObjectParameter):
1344         (WebCore::JSWebGLRenderingContextBase::getExtension):
1345         (WebCore::JSWebGLRenderingContextBase::getFramebufferAttachmentParameter):
1346         (WebCore::JSWebGLRenderingContextBase::getParameter):
1347         (WebCore::JSWebGLRenderingContextBase::getProgramParameter):
1348         (WebCore::JSWebGLRenderingContextBase::getShaderParameter):
1349         (WebCore::toVector):
1350         (WebCore::dataFunctionf):
1351         (WebCore::dataFunctionMatrix):
1352         * bindings/js/JSWebKitSubtleCryptoCustom.cpp:
1353         (WebCore::createAlgorithmFromJSValue):
1354         (WebCore::cryptoKeyFormatFromJSValue):
1355         (WebCore::cryptoKeyUsagesFromJSValue):
1356         (WebCore::JSWebKitSubtleCrypto::encrypt):
1357         (WebCore::JSWebKitSubtleCrypto::decrypt):
1358         (WebCore::JSWebKitSubtleCrypto::sign):
1359         (WebCore::JSWebKitSubtleCrypto::verify):
1360         (WebCore::JSWebKitSubtleCrypto::digest):
1361         (WebCore::JSWebKitSubtleCrypto::generateKey):
1362         (WebCore::importKey):
1363         (WebCore::JSWebKitSubtleCrypto::importKey):
1364         (WebCore::exportKey):
1365         (WebCore::JSWebKitSubtleCrypto::exportKey):
1366         (WebCore::JSWebKitSubtleCrypto::wrapKey):
1367         (WebCore::JSWebKitSubtleCrypto::unwrapKey):
1368         * bindings/js/JSWorkerCustom.cpp:
1369         (WebCore::constructJSWorker):
1370         * bindings/js/JSWorkerGlobalScopeCustom.cpp:
1371         (WebCore::JSWorkerGlobalScope::importScripts):
1372         (WebCore::JSWorkerGlobalScope::setTimeout):
1373         (WebCore::JSWorkerGlobalScope::setInterval):
1374         * bindings/js/ReadableStreamDefaultController.cpp:
1375         (WebCore::ReadableStreamDefaultController::invoke):
1376         (WebCore::ReadableStreamDefaultController::isControlledReadableStreamLocked):
1377         * bindings/js/ReadableStreamDefaultController.h:
1378         (WebCore::ReadableStreamDefaultController::enqueue):
1379         * bindings/js/ScheduledAction.cpp:
1380         (WebCore::ScheduledAction::create):
1381         * bindings/js/ScriptGlobalObject.cpp:
1382         (WebCore::ScriptGlobalObject::set):
1383         * bindings/js/SerializedScriptValue.cpp:
1384         (WebCore::CloneBase::shouldTerminate):
1385         (WebCore::CloneDeserializer::deserialize):
1386         (WebCore::SerializedScriptValue::create):
1387         (WebCore::SerializedScriptValue::deserialize):
1388         * bindings/js/WorkerScriptController.cpp:
1389         (WebCore::WorkerScriptController::evaluate):
1390         * bindings/scripts/CodeGeneratorJS.pm:
1391         (GenerateDictionaryImplementationContent):
1392         (GenerateImplementation):
1393         (GenerateParametersCheck):
1394         (GenerateImplementationFunctionCall):
1395         (GenerateConstructorDefinition):
1396         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
1397         (WebCore::jsTestActiveDOMObjectPrototypeFunctionPostMessage):
1398         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
1399         (WebCore::jsTestCustomNamedGetterPrototypeFunctionAnotherFunction):
1400         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
1401         (WebCore::JSTestEventConstructorConstructor::construct):
1402         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
1403         (WebCore::jsTestEventTargetPrototypeFunctionItem):
1404         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
1405         (WebCore::setJSTestGlobalObjectRegularAttribute):
1406         (WebCore::setJSTestGlobalObjectPublicAndPrivateAttribute):
1407         (WebCore::setJSTestGlobalObjectPublicAndPrivateConditionalAttribute):
1408         (WebCore::setJSTestGlobalObjectEnabledAtRuntimeAttribute):
1409         (WebCore::jsTestGlobalObjectInstanceFunctionRegularOperation):
1410         (WebCore::jsTestGlobalObjectInstanceFunctionEnabledAtRuntimeOperation1):
1411         (WebCore::jsTestGlobalObjectInstanceFunctionEnabledAtRuntimeOperation2):
1412         * bindings/scripts/test/JS/JSTestInterface.cpp:
1413         (WebCore::JSTestInterfaceConstructor::construct):
1414         (WebCore::setJSTestInterfaceConstructorImplementsStaticAttr):
1415         (WebCore::setJSTestInterfaceImplementsStr2):
1416         (WebCore::setJSTestInterfaceImplementsStr3):
1417         (WebCore::setJSTestInterfaceImplementsNode):
1418         (WebCore::setJSTestInterfaceConstructorSupplementalStaticAttr):
1419         (WebCore::setJSTestInterfaceSupplementalStr2):
1420         (WebCore::setJSTestInterfaceSupplementalStr3):
1421         (WebCore::setJSTestInterfaceSupplementalNode):
1422         (WebCore::jsTestInterfacePrototypeFunctionImplementsMethod2):
1423         (WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod2):
1424         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
1425         (WebCore::setJSTestJSBuiltinConstructorTestAttributeRWCustom):
1426         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
1427         (WebCore::JSTestNamedConstructorNamedConstructor::construct):
1428         * bindings/scripts/test/JS/JSTestNode.cpp:
1429         (WebCore::setJSTestNodeName):
1430         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
1431         (WebCore::setJSTestNondeterministicNondeterministicWriteableAttr):
1432         (WebCore::setJSTestNondeterministicNondeterministicExceptionAttr):
1433         (WebCore::setJSTestNondeterministicNondeterministicGetterExceptionAttr):
1434         (WebCore::setJSTestNondeterministicNondeterministicSetterExceptionAttr):
1435         * bindings/scripts/test/JS/JSTestObj.cpp:
1436         (WebCore::convertDictionary<TestObj::Dictionary>):
1437         (WebCore::convertDictionary<TestObj::DictionaryThatShouldNotTolerateNull>):
1438         (WebCore::convertDictionary<TestObj::DictionaryThatShouldTolerateNull>):
1439         (WebCore::convertDictionary<AlternateDictionaryName>):
1440         (WebCore::setJSTestObjConstructorStaticStringAttr):
1441         (WebCore::setJSTestObjTestSubObjEnabledBySettingConstructor):
1442         (WebCore::setJSTestObjEnumAttr):
1443         (WebCore::setJSTestObjByteAttr):
1444         (WebCore::setJSTestObjOctetAttr):
1445         (WebCore::setJSTestObjShortAttr):
1446         (WebCore::setJSTestObjClampedShortAttr):
1447         (WebCore::setJSTestObjEnforceRangeShortAttr):
1448         (WebCore::setJSTestObjUnsignedShortAttr):
1449         (WebCore::setJSTestObjLongAttr):
1450         (WebCore::setJSTestObjLongLongAttr):
1451         (WebCore::setJSTestObjUnsignedLongLongAttr):
1452         (WebCore::setJSTestObjStringAttr):
1453         (WebCore::setJSTestObjUsvstringAttr):
1454         (WebCore::setJSTestObjTestObjAttr):
1455         (WebCore::setJSTestObjTestNullableObjAttr):
1456         (WebCore::setJSTestObjLenientTestObjAttr):
1457         (WebCore::setJSTestObjStringAttrTreatingNullAsEmptyString):
1458         (WebCore::setJSTestObjUsvstringAttrTreatingNullAsEmptyString):
1459         (WebCore::setJSTestObjImplementationEnumAttr):
1460         (WebCore::setJSTestObjXMLObjAttr):
1461         (WebCore::setJSTestObjCreate):
1462         (WebCore::setJSTestObjReflectedStringAttr):
1463         (WebCore::setJSTestObjReflectedUSVStringAttr):
1464         (WebCore::setJSTestObjReflectedIntegralAttr):
1465         (WebCore::setJSTestObjReflectedUnsignedIntegralAttr):
1466         (WebCore::setJSTestObjReflectedBooleanAttr):
1467         (WebCore::setJSTestObjReflectedURLAttr):
1468         (WebCore::setJSTestObjReflectedUSVURLAttr):
1469         (WebCore::setJSTestObjReflectedCustomIntegralAttr):
1470         (WebCore::setJSTestObjReflectedCustomBooleanAttr):
1471         (WebCore::setJSTestObjReflectedCustomURLAttr):
1472         (WebCore::setJSTestObjEnabledAtRuntimeAttribute):
1473         (WebCore::setJSTestObjTypedArrayAttr):
1474         (WebCore::setJSTestObjAttrWithGetterException):
1475         (WebCore::setJSTestObjAttrWithGetterExceptionWithMessage):
1476         (WebCore::setJSTestObjAttrWithSetterException):
1477         (WebCore::setJSTestObjAttrWithSetterExceptionWithMessage):
1478         (WebCore::setJSTestObjStringAttrWithGetterException):
1479         (WebCore::setJSTestObjStringAttrWithSetterException):
1480         (WebCore::setJSTestObjCustomAttr):
1481         (WebCore::setJSTestObjOnfoo):
1482         (WebCore::setJSTestObjOnwebkitfoo):
1483         (WebCore::setJSTestObjWithScriptStateAttribute):
1484         (WebCore::setJSTestObjWithCallWithAndSetterCallWithAttribute):
1485         (WebCore::setJSTestObjWithScriptExecutionContextAttribute):
1486         (WebCore::setJSTestObjWithScriptStateAttributeRaises):
1487         (WebCore::setJSTestObjWithScriptExecutionContextAttributeRaises):
1488         (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttribute):
1489         (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttributeRaises):
1490         (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute):
1491         (WebCore::setJSTestObjWithScriptArgumentsAndCallStackAttribute):
1492         (WebCore::setJSTestObjConditionalAttr1):
1493         (WebCore::setJSTestObjConditionalAttr2):
1494         (WebCore::setJSTestObjConditionalAttr3):
1495         (WebCore::setJSTestObjConditionalAttr4Constructor):
1496         (WebCore::setJSTestObjConditionalAttr5Constructor):
1497         (WebCore::setJSTestObjConditionalAttr6Constructor):
1498         (WebCore::setJSTestObjAnyAttribute):
1499         (WebCore::setJSTestObjMutablePoint):
1500         (WebCore::setJSTestObjImmutablePoint):
1501         (WebCore::setJSTestObjStrawberry):
1502         (WebCore::setJSTestObjId):
1503         (WebCore::setJSTestObjReplaceableAttribute):
1504         (WebCore::setJSTestObjNullableLongSettableAttribute):
1505         (WebCore::setJSTestObjNullableStringSettableAttribute):
1506         (WebCore::setJSTestObjNullableUSVStringSettableAttribute):
1507         (WebCore::setJSTestObjNullableStringValue):
1508         (WebCore::setJSTestObjAttributeWithReservedEnumType):
1509         (WebCore::setJSTestObjPutForwardsAttribute):
1510         (WebCore::setJSTestObjPutForwardsNullableAttribute):
1511         (WebCore::setJSTestObjStringifierAttribute):
1512         (WebCore::jsTestObjPrototypeFunctionEnabledAtRuntimeOperation1):
1513         (WebCore::jsTestObjPrototypeFunctionEnabledAtRuntimeOperation2):
1514         (WebCore::jsTestObjPrototypeFunctionVoidMethodWithArgs):
1515         (WebCore::jsTestObjPrototypeFunctionByteMethodWithArgs):
1516         (WebCore::jsTestObjPrototypeFunctionOctetMethodWithArgs):
1517         (WebCore::jsTestObjPrototypeFunctionLongMethodWithArgs):
1518         (WebCore::jsTestObjPrototypeFunctionObjMethodWithArgs):
1519         (WebCore::jsTestObjPrototypeFunctionMethodWithArgTreatingNullAsEmptyString):
1520         (WebCore::jsTestObjPrototypeFunctionMethodWithXPathNSResolverParameter):
1521         (WebCore::jsTestObjPrototypeFunctionNullableStringSpecialMethod):
1522         (WebCore::jsTestObjPrototypeFunctionMethodWithEnumArg):
1523         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalEnumArg):
1524         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalEnumArgAndDefaultValue):
1525         (WebCore::jsTestObjPrototypeFunctionMethodThatRequiresAllArgsAndThrows):
1526         (WebCore::jsTestObjPrototypeFunctionMethodWithUSVStringArg):
1527         (WebCore::jsTestObjPrototypeFunctionMethodWithNullableUSVStringArg):
1528         (WebCore::jsTestObjPrototypeFunctionMethodWithUSVStringArgTreatingNullAsEmptyString):
1529         (WebCore::jsTestObjPrototypeFunctionSerializedValue):
1530         (WebCore::jsTestObjPrototypeFunctionPrivateMethod):
1531         (WebCore::jsTestObjPrototypeFunctionPublicAndPrivateMethod):
1532         (WebCore::jsTestObjPrototypeFunctionAddEventListener):
1533         (WebCore::jsTestObjPrototypeFunctionRemoveEventListener):
1534         (WebCore::jsTestObjPrototypeFunctionWithScriptStateObj):
1535         (WebCore::jsTestObjPrototypeFunctionWithScriptStateObjException):
1536         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateObjException):
1537         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateWithSpaces):
1538         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalArg):
1539         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalArgAndDefaultValue):
1540         (WebCore::jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndOptionalArg):
1541         (WebCore::jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndTwoOptionalArgs):
1542         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalString):
1543         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalUSVString):
1544         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomicString):
1545         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringAndDefaultValue):
1546         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomicStringAndDefaultValue):
1547         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringIsNull):
1548         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringIsUndefined):
1549         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomicStringIsNull):
1550         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringIsEmptyString):
1551         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalUSVStringIsEmptyString):
1552         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomicStringIsEmptyString):
1553         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalDoubleIsNaN):
1554         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalFloatIsNaN):
1555         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalLongLong):
1556         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalLongLongIsZero):
1557         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalUnsignedLongLong):
1558         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalUnsignedLongLongIsZero):
1559         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalSequence):
1560         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalSequenceIsEmpty):
1561         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalBoolean):
1562         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalBooleanIsFalse):
1563         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalXPathNSResolver):
1564         (WebCore::jsTestObjPrototypeFunctionMethodWithNonCallbackArgAndCallbackArg):
1565         (WebCore::jsTestObjPrototypeFunctionMethodWithNonCallbackArgAndCallbackFunctionArg):
1566         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod1):
1567         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod2):
1568         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod3):
1569         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod4):
1570         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod7):
1571         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod9):
1572         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod10):
1573         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod11):
1574         (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter1):
1575         (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter2):
1576         (WebCore::jsTestObjConstructorFunctionClassMethodWithOptional):
1577         (WebCore::jsTestObjConstructorFunctionOverloadedMethod11):
1578         (WebCore::jsTestObjConstructorFunctionOverloadedMethod12):
1579         (WebCore::jsTestObjPrototypeFunctionClassMethodWithClamp):
1580         (WebCore::jsTestObjPrototypeFunctionClassMethodWithEnforceRange):
1581         (WebCore::jsTestObjPrototypeFunctionMethodWithUnsignedLongSequence):
1582         (WebCore::jsTestObjPrototypeFunctionStringArrayFunction):
1583         (WebCore::jsTestObjPrototypeFunctionMethodWithAndWithoutNullableSequence):
1584         (WebCore::jsTestObjPrototypeFunctionGetElementById):
1585         (WebCore::jsTestObjPrototypeFunctionConvert3):
1586         (WebCore::jsTestObjPrototypeFunctionConvert4):
1587         (WebCore::jsTestObjPrototypeFunctionVariadicStringMethod):
1588         (WebCore::jsTestObjPrototypeFunctionVariadicDoubleMethod):
1589         (WebCore::jsTestObjPrototypeFunctionAny):
1590         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithFloatArgumentPromise):
1591         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithOptionalIntArgumentPromise):
1592         (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction1Promise):
1593         (WebCore::jsTestObjPrototypeFunctionConditionalOverload1):
1594         (WebCore::jsTestObjPrototypeFunctionConditionalOverload2):
1595         (WebCore::jsTestObjPrototypeFunctionSingleConditionalOverload1):
1596         (WebCore::jsTestObjPrototypeFunctionSingleConditionalOverload2):
1597         (WebCore::jsTestObjPrototypeFunctionAttachShadowRoot):
1598         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
1599         (WebCore::constructJSTestOverloadedConstructors1):
1600         (WebCore::constructJSTestOverloadedConstructors2):
1601         (WebCore::constructJSTestOverloadedConstructors4):
1602         (WebCore::constructJSTestOverloadedConstructors5):
1603         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
1604         (WebCore::constructJSTestOverloadedConstructorsWithSequence1):
1605         (WebCore::constructJSTestOverloadedConstructorsWithSequence2):
1606         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
1607         (WebCore::jsTestOverrideBuiltinsPrototypeFunctionNamedItem):
1608         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
1609         (WebCore::setJSTestSerializedScriptValueInterfaceValue):
1610         (WebCore::setJSTestSerializedScriptValueInterfaceCachedValue):
1611         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
1612         (WebCore::JSTestTypedefsConstructor::construct):
1613         (WebCore::setJSTestTypedefsUnsignedLongLongAttr):
1614         (WebCore::setJSTestTypedefsImmutableSerializedScriptValue):
1615         (WebCore::setJSTestTypedefsAttrWithGetterException):
1616         (WebCore::setJSTestTypedefsAttrWithSetterException):
1617         (WebCore::setJSTestTypedefsStringAttrWithGetterException):
1618         (WebCore::setJSTestTypedefsStringAttrWithSetterException):
1619         (WebCore::jsTestTypedefsPrototypeFunctionFunc):
1620         (WebCore::jsTestTypedefsPrototypeFunctionSetShadow):
1621         (WebCore::jsTestTypedefsPrototypeFunctionMethodWithSequenceArg):
1622         (WebCore::jsTestTypedefsPrototypeFunctionNullableSequenceArg):
1623         (WebCore::jsTestTypedefsPrototypeFunctionFuncWithClamp):
1624         (WebCore::jsTestTypedefsPrototypeFunctionStringSequenceFunction):
1625         (WebCore::jsTestTypedefsPrototypeFunctionStringSequenceFunction2):
1626         (WebCore::jsTestTypedefsPrototypeFunctionCallWithSequenceThatRequiresInclude):
1627         * bridge/NP_jsobject.cpp:
1628         (_NPN_InvokeDefault):
1629         (_NPN_Invoke):
1630         (_NPN_Evaluate):
1631         (_NPN_GetProperty):
1632         (_NPN_SetProperty):
1633         (_NPN_RemoveProperty):
1634         (_NPN_HasProperty):
1635         (_NPN_HasMethod):
1636         (_NPN_Enumerate):
1637         (_NPN_Construct):
1638         * bridge/c/c_instance.cpp:
1639         (JSC::Bindings::CInstance::moveGlobalExceptionToExecState):
1640         * bridge/objc/WebScriptObject.mm:
1641         (WebCore::addExceptionToConsole):
1642         (-[WebScriptObject callWebScriptMethod:withArguments:]):
1643         (-[WebScriptObject evaluateWebScript:]):
1644         (-[WebScriptObject setValue:forKey:]):
1645         (-[WebScriptObject valueForKey:]):
1646         (-[WebScriptObject removeWebScriptKey:]):
1647         (-[WebScriptObject hasWebScriptKey:]):
1648         (-[WebScriptObject webScriptValueAtIndex:]):
1649         (-[WebScriptObject setWebScriptValueAtIndex:value:]):
1650         * contentextensions/ContentExtensionParser.cpp:
1651         (WebCore::ContentExtensions::getDomainList):
1652         (WebCore::ContentExtensions::getTypeFlags):
1653         (WebCore::ContentExtensions::loadTrigger):
1654         (WebCore::ContentExtensions::loadAction):
1655         (WebCore::ContentExtensions::loadEncodedRules):
1656         * html/HTMLMediaElement.cpp:
1657         (WebCore::controllerJSValue):
1658         (WebCore::HTMLMediaElement::updateCaptionContainer):
1659         (WebCore::HTMLMediaElement::ensureMediaControlsInjectedScript):
1660         (WebCore::HTMLMediaElement::didAddUserAgentShadowRoot):
1661         (WebCore::HTMLMediaElement::updateMediaControlsAfterPresentationModeChange):
1662         (WebCore::HTMLMediaElement::getCurrentMediaControlsStatus):
1663         * html/HTMLPlugInImageElement.cpp:
1664         (WebCore::HTMLPlugInImageElement::didAddUserAgentShadowRoot):
1665
1666 2016-09-07  Chris Dumez  <cdumez@apple.com>
1667
1668         Fix handling of negative radius in HTMLAreaElement's coords when in circle state
1669         https://bugs.webkit.org/show_bug.cgi?id=161690
1670
1671         Reviewed by Daniel Bates.
1672
1673         Fix handling of negative radius in HTMLAreaElement's coords when in
1674         circle state:
1675         - https://html.spec.whatwg.org/#attr-area-shape-circle
1676
1677         The radius must be non-negative as per the specification. However, our
1678         code fails to check.
1679
1680         Firefox and Chrome both reject negative radius.
1681
1682         No new tests, rebaselined existing test.
1683
1684         * html/HTMLAreaElement.cpp:
1685         (WebCore::HTMLAreaElement::getRegion):
1686
1687 2016-09-07  Chris Dumez  <cdumez@apple.com>
1688
1689         Align HTMLAreaElement shape parsing with the specification
1690         https://bugs.webkit.org/show_bug.cgi?id=161698
1691
1692         Reviewed by Daniel Bates.
1693
1694         Align HTMLAreaElement shape parsing with the specification:
1695         - https://html.spec.whatwg.org/#attr-area-shape
1696
1697         In particular, add support for circ / polygon non conforming shapes
1698         and use rectangle as default state.
1699
1700         This also aligns our behavior with Chrome.
1701
1702         No new tests, rebaselined existing test.
1703
1704         * html/HTMLAreaElement.cpp:
1705         (WebCore::HTMLAreaElement::parseAttribute):
1706
1707 2016-09-07  Daniel Bates  <dabates@apple.com>
1708
1709         Fix WebCore build when building for device with iOS 10 beta SDK
1710
1711         Define SPI macro kIOReturnSuccess.
1712
1713         * platform/spi/cocoa/IOReturnSPI.h:
1714
1715 2016-09-07  Michael Catanzaro  <mcatanzaro@igalia.com>
1716
1717         [EFL] Switch to ENABLE_NETWORK_CACHE
1718         https://bugs.webkit.org/show_bug.cgi?id=152676
1719
1720         Reviewed by Alex Christensen.
1721
1722         * PlatformEfl.cmake: Add GRefPtrSoup to build.
1723         * platform/network/soup/SoupNetworkSession.cpp:
1724         (WebCore::SoupNetworkSession::clearOldSoupCache): Renamed from clearCache.
1725         (WebCore::SoupNetworkSession::setCache): Deleted.
1726         (WebCore::SoupNetworkSession::cache): Deleted.
1727         (WebCore::SoupNetworkSession::clearCache): Deleted.
1728         * platform/network/soup/SoupNetworkSession.h:
1729
1730 2016-09-07  Chris Dumez  <cdumez@apple.com>
1731
1732         Drop legacy canvas.probablySupportsContext()
1733         https://bugs.webkit.org/show_bug.cgi?id=161692
1734
1735         Reviewed by Alex Christensen.
1736
1737         Drop legacy canvas.probablySupportsContext() as it is no longer in the specification:
1738         - https://html.spec.whatwg.org/#htmlcanvaselement
1739
1740         Firefox and Chrome do not support canvas.probablySupportsContext().
1741
1742         No new tests, rebaselined existing test.
1743
1744         * bindings/js/JSHTMLCanvasElementCustom.cpp:
1745         (WebCore::JSHTMLCanvasElement::probablySupportsContext): Deleted.
1746         * html/HTMLCanvasElement.cpp:
1747         (WebCore::HTMLCanvasElement::getContext):
1748         (WebCore::HTMLCanvasElement::probablySupportsContext): Deleted.
1749         * html/HTMLCanvasElement.h:
1750         * html/HTMLCanvasElement.idl:
1751
1752 2016-09-07  Simon Fraser  <simon.fraser@apple.com>
1753
1754         Rename ScrollBehavior to ScrollAlignment::Behavior
1755         https://bugs.webkit.org/show_bug.cgi?id=161677
1756
1757         Reviewed by Tim Horton.
1758
1759         Free up ScrollBehavior for future use with CSS OM View scrolling by renaming the
1760         existing ScrollBehavior, which is about alignment when scrolling into view.
1761
1762         Renamed ScrollBehavior* to ScrollAlignment.*, and made ScrollBehavior an enum class
1763         in the struct.
1764
1765         No behavior change.
1766
1767         * CMakeLists.txt:
1768         * WebCore.xcodeproj/project.pbxproj:
1769         * editing/FrameSelection.h:
1770         * rendering/RenderLayer.cpp:
1771         (WebCore::RenderLayer::getRectToExpose):
1772         * rendering/RenderObject.h:
1773         * rendering/RenderingAllInOne.cpp:
1774         * rendering/ScrollAlignment.cpp: Renamed from Source/WebCore/rendering/ScrollBehavior.cpp.
1775         * rendering/ScrollAlignment.h: Renamed from Source/WebCore/rendering/ScrollBehavior.h.
1776         (WebCore::ScrollAlignment::getVisibleBehavior):
1777         (WebCore::ScrollAlignment::getPartialBehavior):
1778         (WebCore::ScrollAlignment::getHiddenBehavior):
1779         * rendering/ScrollBehavior.h:
1780         (WebCore::ScrollAlignment::getVisibleBehavior): Deleted.
1781         (WebCore::ScrollAlignment::getPartialBehavior): Deleted.
1782         (WebCore::ScrollAlignment::getHiddenBehavior): Deleted.
1783
1784 2016-09-07  Dave Hyatt  <hyatt@apple.com>
1785
1786         Add CSSAtRule id info for new parser
1787         https://bugs.webkit.org/show_bug.cgi?id=161695
1788
1789         Reviewed by Sam Weinig.
1790
1791         * WebCore.xcodeproj/project.pbxproj:
1792         * css/parser/CSSAtRuleID.cpp: Added.
1793         (WebCore::cssAtRuleID):
1794         * css/parser/CSSAtRuleID.h: Added.
1795
1796 2016-09-07  Youenn Fablet  <youenn@apple.com>
1797
1798         [Streams API] Separate compile flag for ReadableStream and WritableStream
1799         https://bugs.webkit.org/show_bug.cgi?id=161044
1800
1801         Reviewed by Alex Christensen.
1802
1803         Moving from STREAMS_API to READABLE_STREAM_API and WRITABLE_STREAM_API compilation flags.
1804         No change of behavior.
1805
1806         * CMakeLists.txt: Triggering regeneration of builtin wrapper files based on individual builtin header file content change to cope with @conditional changes.
1807         * Configurations/FeatureDefines.xcconfig:
1808         * DerivedSources.cpp:
1809         * DerivedSources.make: Triggering regeneration of builtin wrapper files based on file content change to cope with @conditional changes.
1810         * Modules/fetch/FetchBody.cpp:
1811         * Modules/fetch/FetchBody.h:
1812         * Modules/fetch/FetchBodyOwner.cpp:
1813         (WebCore::FetchBodyOwner::isDisturbed):
1814         (WebCore::FetchBodyOwner::blobLoadingSucceeded):
1815         (WebCore::FetchBodyOwner::blobLoadingFailed):
1816         (WebCore::FetchBodyOwner::blobChunk):
1817         * Modules/fetch/FetchBodyOwner.h:
1818         * Modules/fetch/FetchResponse.cpp:
1819         (WebCore::FetchResponse::BodyLoader::didSucceed):
1820         (WebCore::FetchResponse::BodyLoader::didFail):
1821         (WebCore::FetchResponse::BodyLoader::didReceiveData):
1822         * Modules/fetch/FetchResponse.h:
1823         * Modules/fetch/FetchResponse.idl:
1824         * Modules/fetch/FetchResponse.js:
1825         (initializeFetchResponse):
1826         * Modules/fetch/FetchResponseSource.cpp:
1827         * Modules/fetch/FetchResponseSource.h:
1828         * Modules/streams/ByteLengthQueuingStrategy.idl:
1829         * Modules/streams/ByteLengthQueuingStrategy.js:
1830         * Modules/streams/CountQueuingStrategy.idl:
1831         * Modules/streams/CountQueuingStrategy.js:
1832         * Modules/streams/ReadableStream.idl:
1833         * Modules/streams/ReadableStream.js:
1834         * Modules/streams/ReadableStreamDefaultController.idl:
1835         * Modules/streams/ReadableStreamDefaultController.js:
1836         * Modules/streams/ReadableStreamDefaultReader.idl:
1837         * Modules/streams/ReadableStreamDefaultReader.js:
1838         * Modules/streams/ReadableStreamInternals.js:
1839         * Modules/streams/ReadableStreamSource.h:
1840         * Modules/streams/ReadableStreamSource.idl:
1841         * Modules/streams/StreamInternals.js:
1842         * Modules/streams/WritableStream.idl:
1843         * Modules/streams/WritableStream.js:
1844         * Modules/streams/WritableStreamInternals.js:
1845         * bindings/js/JSDOMGlobalObject.cpp:
1846         (WebCore::JSDOMGlobalObject::addBuiltinGlobals):
1847         * bindings/js/JSReadableStreamPrivateConstructors.cpp:
1848         * bindings/js/JSReadableStreamPrivateConstructors.h:
1849         * bindings/js/JSReadableStreamSourceCustom.cpp:
1850         * bindings/js/ReadableStreamDefaultController.cpp:
1851         * bindings/js/ReadableStreamDefaultController.h:
1852         * testing/Internals.cpp:
1853         * testing/Internals.h:
1854         * testing/Internals.idl:
1855
1856 2016-09-07  Carlos Garcia Campos  <cgarcia@igalia.com>
1857
1858         [GTK] Crash of WebProcess on the last WebView disconnect
1859         https://bugs.webkit.org/show_bug.cgi?id=161605
1860
1861         Reviewed by Michael Catanzaro.
1862
1863         Stop tracking X11 GL contexts to be cleanered on an exit handler. This was added to work around bugs on drivers,
1864         and it's assuming that all GLContext not deleted when the exit handler is called are leaked, which is no longer
1865         true, because PlatformDisplay now owns a GLContext and is deleted after exit handlers.
1866
1867         * platform/graphics/GLContext.cpp:
1868         (WebCore::GLContext::GLContext):
1869         (WebCore::GLContext::~GLContext):
1870         (WebCore::activeContextList): Deleted.
1871         (WebCore::GLContext::addActiveContext): Deleted.
1872         (WebCore::GLContext::removeActiveContext): Deleted.
1873         (WebCore::GLContext::cleanupActiveContextsAtExit): Deleted.
1874
1875 2016-09-07  Nael Ouedraogo  <nael.ouedraogo@crf.canon.fr>
1876
1877         Templatize JS bindings code generator of functions with variadic parameters
1878         https://bugs.webkit.org/show_bug.cgi?id=158835
1879
1880         Reviewed by Darin Adler.
1881
1882         Add template functions to handle function with variadic parameter for DOM objects.
1883
1884         * Modules/mediastream/RTCPeerConnection.cpp:
1885         (WebCore::RTCPeerConnection::addTrack):
1886         * Modules/mediastream/RTCPeerConnection.h:
1887         * bindings/js/JSDOMBinding.h:
1888         (WebCore::VariadicHelperBase::convert):
1889         (WebCore::toArguments):
1890         (WebCore::jsFrozenArray):
1891         (WebCore::toRefPtrNativeArray):
1892         (WebCore::toNativeArray):
1893         * bindings/scripts/CodeGeneratorJS.pm:
1894         (GenerateParametersCheck):
1895         (GetVariadicType):
1896         * bindings/scripts/test/JS/JSTestObj.cpp:
1897         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod12):
1898         (WebCore::jsTestObjPrototypeFunctionVariadicStringMethod):
1899         (WebCore::jsTestObjPrototypeFunctionVariadicDoubleMethod):
1900         (WebCore::jsTestObjPrototypeFunctionVariadicNodeMethod):
1901         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod):
1902         (WebCore::jsTestObjPrototypeFunctionAny):
1903         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
1904         (WebCore::constructJSTestOverloadedConstructors5):
1905
1906 2016-09-06  Commit Queue  <commit-queue@webkit.org>
1907
1908         Unreviewed, rolling out r205521, r205526, and r205532.
1909         https://bugs.webkit.org/show_bug.cgi?id=161668
1910
1911         broke API tests (Requested by alexchristensen on #webkit).
1912
1913         Reverted changesets:
1914
1915         "Punycode encode non-ascii hosts in URLParser"
1916         https://bugs.webkit.org/show_bug.cgi?id=161655
1917         http://trac.webkit.org/changeset/205521
1918
1919         "Fix query-only and fragment-only relative URLs when using
1920         URLParser"
1921         https://bugs.webkit.org/show_bug.cgi?id=161657
1922         http://trac.webkit.org/changeset/205526
1923
1924         "URLParser should parse / as a relative URL"
1925         https://bugs.webkit.org/show_bug.cgi?id=161667
1926         http://trac.webkit.org/changeset/205532
1927
1928 2016-09-06  Alex Christensen  <achristensen@webkit.org>
1929
1930         URLParser should parse / as a relative URL
1931         https://bugs.webkit.org/show_bug.cgi?id=161667
1932
1933         Reviewed by Tim Horton.
1934
1935         Covered by a new API test.
1936
1937         * platform/URLParser.cpp:
1938         (WebCore::URLParser::parse):
1939
1940 2016-09-06  Joseph Pecoraro  <pecoraro@apple.com>
1941
1942         Web Inspector: Avoid linkifying some schemes in console logs
1943         https://bugs.webkit.org/show_bug.cgi?id=161648
1944         <rdar://problem/16413270>
1945
1946         Reviewed by Brian Burg.
1947
1948         * inspector/InspectorFrontendHost.cpp:
1949         (WebCore::InspectorFrontendHost::openInNewTab):
1950         If a javascript: link is passed just ignore it.
1951
1952 2016-09-06  Alex Christensen  <achristensen@webkit.org>
1953
1954         Fix query-only and fragment-only relative URLs when using URLParser
1955         https://bugs.webkit.org/show_bug.cgi?id=161657
1956
1957         Reviewed by Tim Horton.
1958
1959         Covered by new API tests and progress towards passing the web platform tests when using URLParser.
1960
1961         * platform/URLParser.cpp:
1962         (WebCore::URLParser::parse):
1963
1964 2016-09-06  Chris Dumez  <cdumez@apple.com>
1965
1966         Add support for input.minLength / textArea.minLength
1967         https://bugs.webkit.org/show_bug.cgi?id=161644
1968
1969         Reviewed by Darin Adler.
1970
1971         Add support for input.minLength / textArea.minLength:
1972         - https://html.spec.whatwg.org/#dom-input-minlength
1973         - https://html.spec.whatwg.org/#dom-textarea-minlength
1974
1975         Chrome implements this, Firefox does not yet.
1976
1977         No new tests, rebaselined existing tests.
1978
1979         * html/FormAssociatedElement.cpp:
1980         (WebCore::FormAssociatedElement::tooShort):
1981         (WebCore::FormAssociatedElement::valid):
1982         (WebCore::FormAssociatedElement::typeMismatch): Deleted.
1983         * html/FormAssociatedElement.h:
1984         * html/HTMLAttributeNames.in:
1985         * html/HTMLInputElement.cpp:
1986         (WebCore::HTMLInputElement::HTMLInputElement):
1987         (WebCore::HTMLInputElement::isValidValue):
1988         (WebCore::HTMLInputElement::tooShort):
1989         (WebCore::HTMLInputElement::tooLong):
1990         (WebCore::HTMLInputElement::parseAttribute):
1991         (WebCore::HTMLInputElement::effectiveMaxLength):
1992         (WebCore::HTMLInputElement::maxLengthAttributeChanged):
1993         (WebCore::HTMLInputElement::minLengthAttributeChanged):
1994         (WebCore::HTMLInputElement::patternMismatch): Deleted.
1995         (WebCore::parseAcceptAttribute): Deleted.
1996         (WebCore::HTMLInputElement::isEnumeratable): Deleted.
1997         (WebCore::HTMLInputElement::supportLabels): Deleted.
1998         * html/HTMLInputElement.h:
1999         (WebCore::HTMLInputElement::supportsMinLength):
2000         (WebCore::HTMLInputElement::supportsMaxLength): Deleted.
2001         * html/HTMLInputElement.idl:
2002         * html/HTMLTextAreaElement.cpp:
2003         (WebCore::HTMLTextAreaElement::parseAttribute):
2004         (WebCore::HTMLTextAreaElement::maxLengthAttributeChanged):
2005         (WebCore::HTMLTextAreaElement::minLengthAttributeChanged):
2006         (WebCore::HTMLTextAreaElement::validationMessage):
2007         (WebCore::HTMLTextAreaElement::tooShort):
2008         (WebCore::HTMLTextAreaElement::tooLong):
2009         (WebCore::HTMLTextAreaElement::isValidValue):
2010         * html/HTMLTextAreaElement.h:
2011         * html/HTMLTextAreaElement.idl:
2012         * html/HTMLTextFormControlElement.cpp:
2013         (WebCore::HTMLTextFormControlElement::setMaxLength):
2014         (WebCore::HTMLTextFormControlElement::setMinLength):
2015         * html/HTMLTextFormControlElement.h:
2016         (WebCore::HTMLTextFormControlElement::maxLength):
2017         (WebCore::HTMLTextFormControlElement::setMaxLength):
2018         (WebCore::HTMLTextFormControlElement::minLength):
2019         (WebCore::HTMLTextFormControlElement::setMinLength):
2020         * html/InputType.cpp:
2021         (WebCore::InputType::validationMessage):
2022         * html/ValidityState.idl:
2023         * platform/LocalizedStrings.cpp:
2024         (WebCore::validationMessageTooShortText):
2025         * platform/LocalizedStrings.h:
2026
2027 2016-09-06  Alex Christensen  <achristensen@webkit.org>
2028
2029         Punycode encode non-ascii hosts in URLParser
2030         https://bugs.webkit.org/show_bug.cgi?id=161655
2031
2032         Reviewed by Tim Horton.
2033
2034         Covered by new API tests based on the web platform tests.
2035
2036         * platform/URLParser.cpp:
2037         (WebCore::URLParser::parse):
2038         (WebCore::containsOnlyASCII):
2039         (WebCore::domainToASCII):
2040
2041 2016-09-06  Saam Barati  <sbarati@apple.com>
2042
2043         Make JSMap and JSSet faster
2044         https://bugs.webkit.org/show_bug.cgi?id=160989
2045
2046         Reviewed by Filip Pizlo.
2047
2048         * ForwardingHeaders/runtime/HashMapImpl.h: Added.
2049         * ForwardingHeaders/runtime/MapBase.h: Added.
2050         * bindings/js/SerializedScriptValue.cpp:
2051         (WebCore::CloneSerializer::serialize):
2052         (WebCore::CloneDeserializer::deserialize):
2053
2054 2016-09-06  Myles C. Maxfield  <mmaxfield@apple.com>
2055
2056         Strikethrough positions are erroneously snapped twice
2057         https://bugs.webkit.org/show_bug.cgi?id=161647
2058         <rdar://problem/11542470>
2059
2060         Reviewed by Zalan Bujtas.
2061
2062         Because we're using an int for the position of the baseline, the math to calculate the
2063         strikethrough position is snapped. Then, we snap it again inside GraphicsContext.
2064
2065         Test: fast/text/strikethrough-int.html
2066
2067         * rendering/InlineTextBox.cpp:
2068         (WebCore::InlineTextBox::paintDecoration):
2069         * rendering/TextDecorationPainter.h:
2070         (WebCore::TextDecorationPainter::setBaseline):
2071
2072 2016-09-06  David Kilzer  <ddkilzer@apple.com>
2073
2074         [iOS] Remove soft linking of MobileCoreServices.framework
2075         <https://webkit.org/b/161641>
2076         <rdar://problem/10420118>
2077
2078         Reviewed by Darin Adler.
2079
2080         * Configurations/WebCore.xcconfig: Add hard link to
2081         MobileCoreServices.framework.
2082
2083         * editing/ios/EditorIOS.mm: Change #include to #import.
2084         * platform/graphics/cg/ImageSourceCGMac.mm:
2085         * platform/graphics/mac/ImageMac.mm:
2086         * platform/ios/PasteboardIOS.mm:
2087         * platform/ios/PlatformPasteboardIOS.mm:
2088         * platform/network/ios/WebCoreURLResponseIOS.mm:
2089         * platform/network/mac/UTIUtilities.mm:
2090         - Rearrange import statements as needed.
2091         - Remove soft link to MobileCoreServices.framework.
2092         - Add import of <MobileCoreServices/MobileCoreServices.h> as
2093           needed.
2094
2095         * rendering/RenderThemeIOS.mm: Remove unused soft link to
2096         MobileCoreServices.framework.
2097
2098 2016-09-06  Chris Dumez  <cdumez@apple.com>
2099
2100         Align srcset attribute parsing with the HTML specification
2101         https://bugs.webkit.org/show_bug.cgi?id=161636
2102
2103         Reviewed by Darin Adler.
2104
2105         Align srcset attribute parsing with the HTML specification:
2106         - https://html.spec.whatwg.org/#parse-a-srcset-attribute
2107
2108         The new behavior is also consistent with Firefox and Chrome
2109         as all 3 browsers now pass 100% of the checks at:
2110         - http://w3c-test.org/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute.html
2111
2112         No new tests, rebaselined existing tests.
2113
2114         * html/parser/HTMLParserIdioms.cpp:
2115         (WebCore::parseValidHTMLNonNegativeIntegerInternal):
2116         (WebCore::parseValidHTMLNonNegativeInteger):
2117         (WebCore::parseValidHTMLFloatingPointNumberInternal):
2118         (WebCore::parseValidHTMLFloatingPointNumber):
2119         * html/parser/HTMLParserIdioms.h:
2120         Add convenience for parsing *valid* HTML non-negative integers and
2121         *valid* floating point number values.
2122
2123         * html/parser/HTMLSrcsetParser.cpp:
2124         (WebCore::parseDescriptors):
2125         - Use parseValidHTMLFloatingPointNumber() to parse density so that the value
2126           is parsed as a valid HTML floating point number value, as per the spec.
2127         - Use parseValidHTMLNonNegativeInteger() to parse width and height so that
2128           the value is parsed as a valid HTML non-negative integer value, as per the
2129           spec.
2130         - Return false if descriptor does not have a h, w and x at the end as per:
2131           https://html.spec.whatwg.org/#parse-a-srcset-attribute (step 13: Anything else)
2132         - Return false if height is set but not width, as per:
2133           https://html.spec.whatwg.org/#parse-a-srcset-attribute (step 14)
2134
2135         (WebCore::parseImageCandidatesFromSrcsetAttribute):
2136         - Skip whitespace if URL does not end with a comma instead of assuming there is
2137           a single space character, as per:
2138           https://html.spec.whatwg.org/#parse-a-srcset-attribute (step 8. Otherwise 1.)
2139
2140 2016-09-06  Fujii Hironori  <Hironori.Fujii@sony.com>
2141
2142         [CMake] Decouple generating bindings of WebCore and WebCoreTestSupport
2143         https://bugs.webkit.org/show_bug.cgi?id=161474
2144
2145         Generating bindings of WebCore and WebCoreTestSupport shares a
2146         single supplementalDependencyFile.  But, nothing supplements any
2147         IDL of WebCoreTestSupport.  This introduces unnecessary
2148         dependencies.
2149
2150         Reviewed by Alex Christensen.
2151
2152         * CMakeLists.txt: Do not input any IDL of WebCoreTestSupport to
2153         preprocess-idls.pl.  Do not use supplementalDependencyFile to
2154         generate bindings of WebCoreTestSupport.  Add SettingsMacros.h as
2155         a source file of WebCoreDerivedSources to ensure make_settings.pl
2156         is finished before compiling WebCoreDerivedSources.
2157
2158 2016-09-06  Zalan Bujtas  <zalan@apple.com>
2159
2160         ASSERTION FAILED: !paintInfo.overlapTestRequests->contains(this) in WebCore::RenderWidget::paintContents
2161         https://bugs.webkit.org/show_bug.cgi?id=135602
2162         <rdar://problem/27701733>
2163
2164         Reviewed by Simon Fraser.
2165
2166         ASSERT is updated to support multiple fragments painting. We just have to ensure that the FrameView's rect
2167         has not changed between the 2 paintContents calls.  
2168
2169         Test: fast/layers/assert-on-overlap-testing-with-frames-inside-columns.html
2170
2171         * rendering/RenderWidget.cpp:
2172         (WebCore::RenderWidget::paintContents):
2173
2174 2016-09-06  Commit Queue  <commit-queue@webkit.org>
2175
2176         Unreviewed, rolling out r205504.
2177         https://bugs.webkit.org/show_bug.cgi?id=161645
2178
2179         Broke the iOS device build (Requested by ryanhaddad on
2180         #webkit).
2181
2182         Reverted changeset:
2183
2184         "Make JSMap and JSSet faster"
2185         https://bugs.webkit.org/show_bug.cgi?id=160989
2186         http://trac.webkit.org/changeset/205504
2187
2188 2016-09-06  Zalan Bujtas  <zalan@apple.com>
2189
2190         Remove unused overlap checking functions from FrameView.
2191         https://bugs.webkit.org/show_bug.cgi?id=161635
2192
2193         Reviewed by Simon Fraser.
2194
2195         No change in functionality.
2196
2197         * page/FrameView.cpp:
2198         (WebCore::FrameView::isOverlappedIncludingAncestors): Deleted.
2199         * page/FrameView.h:
2200
2201 2016-09-06  Simon Fraser  <simon.fraser@apple.com>
2202
2203         Align element.scroll() / scrollTo() / scrollBy() with the CSSOM specification
2204         https://bugs.webkit.org/show_bug.cgi?id=161610
2205
2206         Reviewed by Darin Adler, Chris Dumez.
2207
2208         Implement Element.scroll(), scrollBy() and scrollTo() with x,y and ScrollToOptions
2209         on Element, according to <https://drafts.csswg.org/cssom-view/#element-scrolling-members>
2210
2211         WebKit's behavior of treating scrolls on the body element in both quirks and strict mode
2212         is preserved.
2213
2214         Tests: fast/dom/Element/scrolling-funtions-on-body-quirks.html
2215                fast/dom/Element/scrolling-funtions-on-body.html
2216                fast/dom/Element/scrolling-funtions-on-element.html
2217
2218         * dom/Element.cpp:
2219         (WebCore::Element::scrollBy):
2220         (WebCore::normalizeNonFiniteValue):
2221         (WebCore::Element::scrollTo):
2222         * dom/Element.h:
2223         * dom/Element.idl:
2224         * html/HTMLBodyElement.cpp:
2225         (WebCore::HTMLBodyElement::scrollTo):
2226         * html/HTMLBodyElement.h:
2227
2228 2016-09-06  Saam Barati  <sbarati@apple.com>
2229
2230         Make JSMap and JSSet faster
2231         https://bugs.webkit.org/show_bug.cgi?id=160989
2232
2233         Reviewed by Filip Pizlo.
2234
2235         * ForwardingHeaders/runtime/HashMapImpl.h: Added.
2236         * ForwardingHeaders/runtime/MapBase.h: Added.
2237         * bindings/js/SerializedScriptValue.cpp:
2238         (WebCore::CloneSerializer::serialize):
2239         (WebCore::CloneDeserializer::deserialize):
2240
2241 2016-09-05  Alex Christensen  <achristensen@webkit.org>
2242
2243         Implement relative file urls and begin implementing character encoding in URLParser
2244         https://bugs.webkit.org/show_bug.cgi?id=161618
2245
2246         Reviewed by Tim Horton.
2247
2248         Covered by new API tests.
2249         Also, this is a significant step towards passing the URL web platform tests when using the URLParser,
2250         which is still off by default.
2251
2252         * platform/URLParser.cpp:
2253         (WebCore::isInSimpleEncodeSet):
2254         (WebCore::isInDefaultEncodeSet):
2255         (WebCore::isInUserInfoEncodeSet):
2256         (WebCore::isInvalidDomainCharacter):
2257         (WebCore::shouldCopyFileURL):
2258         (WebCore::percentEncode):
2259         (WebCore::utf8PercentEncode):
2260         (WebCore::encodeQuery):
2261         (WebCore::isDefaultPort):
2262         (WebCore::isPercentEncodedDot):
2263         (WebCore::URLParser::parse):
2264         (WebCore::percentDecode):
2265         (WebCore::domainToASCII):
2266         (WebCore::hasInvalidDomainCharacter):
2267         (WebCore::URLParser::parsePort):
2268         (WebCore::URLParser::parseHost):
2269         (WebCore::isTabOrNewline): Deleted.
2270         * platform/URLParser.h:
2271
2272 2016-09-06  Daniel Bates  <dabates@apple.com>
2273
2274         Fix the Apple-internal build following <https://trac.webkit.org/changeset/205488>
2275         (https://bugs.webkit.org/show_bug.cgi?id=161090)
2276
2277         Use the default linkage for QuartzCore constants to match the linkage used for such constants
2278         in the Apple-internal SDK.
2279
2280         * platform/spi/cocoa/QuartzCoreSPI.h:
2281
2282 2016-09-06  Daniel Bates  <dabates@apple.com>
2283
2284         <table> inside <div align="right"> with large content inside = no scrollbar
2285         https://bugs.webkit.org/show_bug.cgi?id=3352
2286
2287         Reviewed by Brent Fulgham.
2288
2289         Respect "right" text-alignment only if the width of the child does not overflow the
2290         width of its containing block. This makes our margin computation more closely conform
2291         to section "Block-level, non-replaced elements in normal flow" of the CSS 2.1
2292         spec., <http://www.w3.org/TR/CSS21/>, and to the behavior observed in Firefox, Chrome,
2293         IE version 9 or later and Microsoft Edge.
2294
2295         Test: fast/block/align-overflow-child.html
2296
2297         * rendering/RenderBox.cpp:
2298         (WebCore::RenderBox::computeInlineDirectionMargins):
2299
2300 2016-09-06  Daniel Bates  <dabates@apple.com>
2301
2302         Remove EXTERN_C from WTF
2303         https://bugs.webkit.org/show_bug.cgi?id=161090
2304
2305         Reviewed by Brent Fulgham.
2306
2307         Guard external C declarations in WTF_EXTERN_C_BEGIN, WTF_EXTERN_C_END.
2308
2309         * platform/spi/cf/CFLocaleSPI.h:
2310         * platform/spi/cf/CFNetworkConnectionCacheSPI.h:
2311         * platform/spi/cf/CFNetworkSPI.h: Additionally, remove the workaround for <rdar://problem/18337182>
2312         as this bug was fixed in El Capitan.
2313         * platform/spi/cf/CFUtilitiesSPI.h:
2314         * platform/spi/cocoa/CoreTextSPI.h:
2315         * platform/spi/cocoa/DataDetectorsCoreSPI.h:
2316         * platform/spi/cocoa/IOPMLibSPI.h:
2317         * platform/spi/cocoa/MachVMSPI.h:
2318         * platform/spi/cocoa/QuartzCoreSPI.h:
2319         * platform/spi/ios/MobileGestaltSPI.h:
2320         * platform/spi/ios/QuickLookSPI.h:
2321         * platform/spi/win/CoreTextSPIWin.cpp:
2322         * platform/spi/win/CoreTextSPIWin.h:
2323
2324 2016-09-06  Ryan Haddad  <ryanhaddad@apple.com>
2325
2326         Unreviewed, rolling out r205407.
2327
2328         Not the correct way to implement this functionality
2329
2330         Reverted changeset:
2331
2332         "Consult with the FrameLoaderClient about whether or not
2333         content extensions should be enabled when loading this URL."
2334         https://bugs.webkit.org/show_bug.cgi?id=161441
2335         http://trac.webkit.org/changeset/205407
2336
2337 2016-09-06  Youenn Fablet  <youenn@apple.com>
2338
2339         http/tests/security/contentSecurityPolicy/worker-csp-blocks-xhr-redirect-cross-origin.html is flaky
2340         https://bugs.webkit.org/show_bug.cgi?id=161627
2341
2342         Reviewed by Darin Adler.
2343
2344         Covered by changed expectation.
2345
2346         * loader/DocumentThreadableLoader.cpp:
2347         (WebCore::DocumentThreadableLoader::redirectReceived): Clearing the resource in lieu of clearing the request. This will stop the resource load.
2348         * loader/SubresourceLoader.cpp:
2349         (WebCore::SubresourceLoader::didReceiveResponse): Adding an ASSERT to ensure that no valid redirect responses is mistakenly processed here.
2350
2351 2016-09-06  Zalan Bujtas  <zalan@apple.com>
2352
2353         ASSERTION FAILED: !currBox->needsLayout() in WebCore::RenderBlock::checkPositionedObjectsNeedLayout
2354         https://bugs.webkit.org/show_bug.cgi?id=120291
2355         <rdar://problem/27683456>
2356
2357         Reviewed by David Hyatt.
2358
2359         This patch ensures that we always set the 'positioned child needs layout' bit on the containing block
2360         when a new positioned descendant gets inserted. It fixes cases for simplified layout when
2361         we ended up not laying out the descendant element. 
2362
2363         Test: fast/block/positioning/assert-when-positioned-descendant-is-not-getting-laid-out.html
2364
2365         * rendering/RenderBlock.cpp:
2366         (WebCore::RenderBlock::insertPositionedObject):
2367
2368 2016-09-06  Youenn Fablet  <youenn@apple.com>
2369
2370         CachedResourceLoader is not taking into account fetch options to use or not cached resources
2371         https://bugs.webkit.org/show_bug.cgi?id=161389
2372
2373         Reviewed by Darin Adler.
2374
2375         Tests: http/tests/fetch/fetching-same-resource-with-diffferent-options.html
2376                http/tests/security/cross-origin-cached-resource-parallel.html
2377                http/tests/security/cross-origin-cached-resource.html
2378                http/tests/security/load-image-after-redirection-2.html
2379                http/tests/security/shape-outside-and-cached-resources.html
2380
2381         Adding CORS checks for the response in case of CORS fetch mode, in SubresourceLoader.
2382         Removing the CORS checks in Image and DocumentThreadableLoader.
2383
2384         The direction of this patch is to make CachedResource origin-specific/fetch mode specific.
2385
2386         This will remove the need for CachedResource clients to do CORS checks when receiving the notifyFinished call.
2387         This will also make the computation of whether a resource is clean or not much easier since the CachedResource knowd its origin and its response tainting.
2388
2389         Removing the CORS checks at ImageLoader creates the risk of using some cached resources loaded from previously no-cors mode without doing the actual CORS check.
2390         Note that the risk was already there in case of a resource loaded through redirections.
2391         Reusing a cached resource for a load with different options also leads to bad computation of the resource tainting.
2392
2393         As a first step, improvements are done but only for CachedImage resources.
2394
2395         This patch limits the direct reuse of cached resources as follow:
2396         - If the request and existing resources have different origins.
2397         - If the fetch mode is different between request and existing resource.
2398
2399         In those cases, a new CachedResource is created with the correct options and origin.
2400         The data and response of the CachedResource found in the cache are copied efficiently in the new CachedResource, if the matching CachedResource finished loading (CachedImage specific).
2401
2402         If the matching CachedResource is still loading, we trigger a reload (with caching=false to not disturb the being loaded resource).
2403         This should be made more efficient at some point, especially if the matching CachedResource already has its response set.
2404
2405         This triggers a change of behavior: previously, the CORS checks were done by the ImageLoader when the resource was finished loading.
2406         The CORS checks were controlled by the crossOrigin attribute, which may be set or unset between the load start and the load end.
2407
2408         Now the crossOrigin attribute is checked at load start. If it is set, the CORS checks will happen even if the attribute is unset before the end of the load.
2409         This is more consistent as the actual request was built with CORS enabled.
2410
2411         * loader/CrossOriginPreflightChecker.cpp:
2412         (WebCore::CrossOriginPreflightChecker::startPreflight): Setting correctly the preflight options as per fetch spec.
2413         * loader/DocumentThreadableLoader.cpp:
2414         (WebCore::DocumentThreadableLoader::didReceiveResponse): Removing CORS check.
2415         (WebCore::DocumentThreadableLoader::loadRequest): Adding CORS check in sync mode.
2416         * loader/ImageLoader.cpp:
2417         (WebCore::ImageLoader::updateFromElement):
2418         (WebCore::ImageLoader::notifyFinished):
2419         * loader/SubresourceLoader.cpp:
2420         (WebCore::SubresourceLoader::didReceiveResponse): Adding CORS checks to the response
2421         (WebCore::SubresourceLoader::checkResponseCrossOriginAccessControl): Helper routine to do CORS checks
2422         * loader/SubresourceLoader.h:
2423         * loader/cache/CachedImage.cpp:
2424         (WebCore::CachedImage::cloneData): Responsible to set image content from another CachedImage.
2425         * loader/cache/CachedImage.h:
2426         * loader/cache/CachedResource.cpp:
2427         (WebCore::CachedResource::computeOrigin): Helper routine to set the origin and whether the resource is cross-origin or not.
2428         (WebCore::CachedResource::load): Using computeOrigin.
2429         (WebCore::CachedResource::loadFrom): Loading from a CachedResource from the same type and which finished loading.
2430         * loader/cache/CachedResource.h:
2431         (WebCore::CachedResource::cloneData):
2432         * loader/cache/CachedResourceLoader.cpp:
2433         (WebCore::CachedResourceLoader::updateCachedResourceWithCurrentRequest): Helper routine responsible to adapt the CachedResource
2434         that can be reused to the origin and options of a new request.
2435         (WebCore::CachedResourceLoader::requestResource): Calling updateCachedResourceWithCurrentRequest before actually returning the resource.
2436         (WebCore::CachedResourceLoader::determineRevalidationPolicy): Space clean-up.
2437         * loader/cache/CachedResourceLoader.h:
2438         * loader/cache/CachedResourceRequest.h:
2439         (WebCore::CachedResourceRequest::setCachingPolicy):
2440         * style/StylePendingResources.cpp:
2441         (WebCore::Style::loadPendingImage): Allowing data URLs for ShapeOutside data.
2442
2443 2016-09-05  Darin Adler  <darin@apple.com>
2444
2445         More bindings improvements, particularly things not needed for JavaScript bindings
2446         https://bugs.webkit.org/show_bug.cgi?id=161572
2447
2448         Reviewed by Sam Weinig.
2449
2450         * WebCore.xcodeproj/project.pbxproj: Export a couple of files needed for legacy bindings.
2451
2452         * bindings/js/JSDOMWindowCustom.cpp:
2453         (WebCore::addCrossOriginWindowPropertyNames): Mark array const.
2454         * bindings/js/JSLocationCustom.cpp:
2455         (WebCore::addCrossOriginLocationPropertyNames): Ditto.
2456
2457         * dom/DOMImplementation.cpp:
2458         (WebCore::addString): Deleted.
2459         (WebCore::isSupportedSVG10Feature): Deleted.
2460         (WebCore::isSupportedSVG11Feature): Deleted.
2461         (WebCore::DOMImplementation::hasFeature): Deleted.
2462
2463         * dom/DOMImplementation.h: Changed hasFeature to take no arguments and to always
2464         return true, as specified in the DOM spec.
2465
2466         * dom/DOMImplementation.idl: Removed the arguments to hasFeature.
2467
2468         * dom/Document.cpp:
2469         (WebCore::Document::defaultCharsetForLegacyBindings): Renamed from
2470         defaultCharsetForBindings, because this function is used only by the
2471         non-JavaScript bindings.
2472         * dom/Document.h: Updated for the above.
2473
2474         * dom/DocumentType.h: Removed entitiesForBindings,
2475         notationsForBindings, and internalSubsetForBindings, all of which were
2476         empty functions. The empty implementations are now in the legacy bindings.
2477
2478         * dom/Element.cpp:
2479         (WebCore::Element::dispatchSimulatedClickForBindings): Deleted.
2480         This code is now at the single call site, in HTMLElement.
2481         * dom/Element.h: Updated for the above change.
2482
2483         * dom/Node.cpp:
2484         (WebCore::Node::isSupportedForBindings): Deleted. This is only used in the
2485         legacy bindings, and since it only returns a value other than "true" for
2486         SVG features, it is now in the SVGTests class.
2487         * dom/Node.h: Updated for the above change.
2488
2489         * html/HTMLElement.cpp:
2490         (WebCore::HTMLElement::click): Call simulateClick with the appropriate
2491         arguments rather than calling dispatchSimulatedClickForBindings.
2492
2493         * svg/SVGTests.cpp:
2494         (WebCore::supportedSVGFeatures): Added. Moved here from DOMImplementation,
2495         but also refactored.
2496         (WebCore::SVGTests::isValid): Changed to use the function above, rather than
2497         calling DOMImplementation::hasFeature. This change fixes a bug where feature names
2498         that do not look like valid SVG feature names, names such as "xxx", were returning
2499         true claiming that the feature was supported. This behavior was helpful in the
2500         general DOMImplementation function, but harmful here. This bug was causing test
2501         failures in some of our SVG tests.
2502         (WebCore::SVGTests::hasFeatureForLegacyBindings): Added. Uses the set above to
2503         implement the legacy behavior of hasFeature. It's better to have this in parallel
2504         with the SVGTests::isValid function rather than having either depend on the other.
2505
2506         * svg/SVGTests.h: Added exported SVGTests::isValid function.
2507
2508 2016-09-05  Commit Queue  <commit-queue@webkit.org>
2509
2510         Unreviewed, rolling out r205450.
2511         https://bugs.webkit.org/show_bug.cgi?id=161614
2512
2513         Made tests flaky, causing false positives on EWS (Requested by
2514         ap on #webkit).
2515
2516         Reverted changeset:
2517
2518         "CachedResourceLoader is not taking into account fetch options
2519         to use or not cached resources"
2520         https://bugs.webkit.org/show_bug.cgi?id=161389
2521         http://trac.webkit.org/changeset/205450
2522
2523 2016-08-31  Filip Pizlo  <fpizlo@apple.com>
2524
2525         Butterflies should be allocated in Auxiliary MarkedSpace instead of CopiedSpace and we should rewrite as much of the GC as needed to make this not a regression
2526         https://bugs.webkit.org/show_bug.cgi?id=160125
2527
2528         Reviewed by Geoffrey Garen and Keith Miller.
2529
2530         No new tests because no new WebCore behavior.
2531         
2532         Just rewiring #includes.
2533
2534         * ForwardingHeaders/heap/HeapInlines.h: Added.
2535         * ForwardingHeaders/interpreter/Interpreter.h: Removed.
2536         * ForwardingHeaders/runtime/AuxiliaryBarrierInlines.h: Added.
2537         * Modules/indexeddb/IDBCursorWithValue.cpp:
2538         * Modules/indexeddb/client/TransactionOperation.cpp:
2539         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
2540         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
2541         * bindings/js/JSApplePayPaymentAuthorizedEventCustom.cpp:
2542         * bindings/js/JSApplePayPaymentMethodSelectedEventCustom.cpp:
2543         * bindings/js/JSApplePayShippingContactSelectedEventCustom.cpp:
2544         * bindings/js/JSApplePayShippingMethodSelectedEventCustom.cpp:
2545         * bindings/js/JSClientRectCustom.cpp:
2546         * bindings/js/JSDOMBinding.cpp:
2547         * bindings/js/JSDOMBinding.h:
2548         * bindings/js/JSDeviceMotionEventCustom.cpp:
2549         * bindings/js/JSDeviceOrientationEventCustom.cpp:
2550         * bindings/js/JSErrorEventCustom.cpp:
2551         * bindings/js/JSIDBCursorWithValueCustom.cpp:
2552         * bindings/js/JSIDBIndexCustom.cpp:
2553         * bindings/js/JSPopStateEventCustom.cpp:
2554         * bindings/js/JSWebGL2RenderingContextCustom.cpp:
2555         * bindings/js/JSWorkerGlobalScopeCustom.cpp:
2556         * bindings/js/WorkerScriptController.cpp:
2557         * contentextensions/ContentExtensionParser.cpp:
2558         * dom/ErrorEvent.cpp:
2559         * html/HTMLCanvasElement.cpp:
2560         * html/MediaDocument.cpp:
2561         * inspector/CommandLineAPIModule.cpp:
2562         * loader/EmptyClients.cpp:
2563         * page/CaptionUserPreferences.cpp:
2564         * page/Frame.cpp:
2565         * page/PageGroup.cpp:
2566         * page/UserContentController.cpp:
2567         * platform/mock/mediasource/MockBox.cpp:
2568         * testing/GCObservation.cpp:
2569
2570 2016-09-05  Fujii Hironori  <Hironori.Fujii@sony.com>
2571
2572         run-bindings-tests fails since r205422
2573         https://bugs.webkit.org/show_bug.cgi?id=161595
2574
2575         Reviewed by Darin Adler.
2576
2577         Rebaseline binding tests after r205422.
2578
2579         * bindings/scripts/test/JS/JSInterfaceName.cpp:
2580         * bindings/scripts/test/JS/JSInterfaceName.h:
2581         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
2582         * bindings/scripts/test/JS/JSTestActiveDOMObject.h:
2583         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
2584         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.h:
2585         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
2586         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h:
2587         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
2588         * bindings/scripts/test/JS/JSTestCustomNamedGetter.h:
2589         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
2590         * bindings/scripts/test/JS/JSTestEventConstructor.h:
2591         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
2592         * bindings/scripts/test/JS/JSTestEventTarget.h:
2593         * bindings/scripts/test/JS/JSTestException.cpp:
2594         * bindings/scripts/test/JS/JSTestException.h:
2595         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
2596         * bindings/scripts/test/JS/JSTestGenerateIsReachable.h:
2597         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
2598         * bindings/scripts/test/JS/JSTestGlobalObject.h:
2599         * bindings/scripts/test/JS/JSTestInterface.cpp:
2600         * bindings/scripts/test/JS/JSTestInterface.h:
2601         * bindings/scripts/test/JS/JSTestIterable.cpp:
2602         * bindings/scripts/test/JS/JSTestIterable.h:
2603         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
2604         * bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
2605         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
2606         * bindings/scripts/test/JS/JSTestNamedConstructor.h:
2607         * bindings/scripts/test/JS/JSTestNode.cpp:
2608         * bindings/scripts/test/JS/JSTestNode.h:
2609         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
2610         * bindings/scripts/test/JS/JSTestNondeterministic.h:
2611         * bindings/scripts/test/JS/JSTestObj.cpp:
2612         * bindings/scripts/test/JS/JSTestObj.h:
2613         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
2614         * bindings/scripts/test/JS/JSTestOverloadedConstructors.h:
2615         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
2616         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.h:
2617         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
2618         * bindings/scripts/test/JS/JSTestOverrideBuiltins.h:
2619         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
2620         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
2621         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
2622         * bindings/scripts/test/JS/JSTestTypedefs.h:
2623         * bindings/scripts/test/JS/JSattribute.cpp:
2624         * bindings/scripts/test/JS/JSattribute.h:
2625         * bindings/scripts/test/JS/JSreadonly.cpp:
2626         * bindings/scripts/test/JS/JSreadonly.h:
2627
2628 2016-09-05  Fujii Hironori  <Hironori.Fujii@sony.com>
2629
2630         [CMake] Duplicated IDL files in WebCore_IDL_FILES
2631         https://bugs.webkit.org/show_bug.cgi?id=161592
2632
2633         Reviewed by Darin Adler.
2634
2635         * CMakeLists.txt: Removed duplicated IDL files.
2636         * DerivedSources.cpp: Added #if ENABLE(USER_MESSAGE_HANDLERS)
2637
2638 2016-09-05  Joseph Pecoraro  <pecoraro@apple.com>
2639
2640         [Mac] Static Analyzer warnings about unused values in CDMSessionAVStreamSession.mm
2641         https://bugs.webkit.org/show_bug.cgi?id=161598
2642
2643         Reviewed by Darin Adler.
2644
2645         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.h:
2646         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
2647         (WebCore::CDMSessionAVStreamSession::generateKeyReleaseMessage):
2648         Make this parameter a reference again, accidentally lost in r195410.
2649         Now assignments to the parameter make sense.
2650
2651 2016-09-05  Youenn Fablet  <youenn@apple.com>
2652
2653         Clean CSS stylesheets should be accessible from JavaScript
2654         https://bugs.webkit.org/show_bug.cgi?id=158728
2655
2656         Reviewed by Darin Adler.
2657
2658         Covered by updated tests.
2659
2660         Making use of the resource response type to evaluate whether to make the CSS stylesheets visible
2661         for stylesheet link elements and for stylesheet processing instructions.
2662         Ideally, the origin flag should be a boolean.
2663
2664         To keep behavior consistent in cors-check-unaware cases, the flag might remain unset.
2665         In that case, the behavior remains the same (checking of the stylesheet URL).
2666         The origin flag is set to true or false only in case of fetch mode being set to cors using the crossorigin attribute.
2667
2668         Updated CSSStyleSheet::create to take a Node reference. Updated callers accordingly.
2669
2670         * contentextensions/ContentExtensionStyleSheet.cpp:
2671         (WebCore::ContentExtensions::ContentExtensionStyleSheet::ContentExtensionStyleSheet): Updated to pass a Node reference and not pointer.
2672         * css/CSSStyleSheet.cpp:
2673         (WebCore::CSSStyleSheet::create): Makes origin flag undefined if boolean parameter is not passed.
2674         Otherwise origin flag is set according given boolean value.
2675         (WebCore::CSSStyleSheet::createInline): Makes origin flag set to true.
2676         (WebCore::CSSStyleSheet::CSSStyleSheet): Adding origin flag initialization.
2677         (WebCore::CSSStyleSheet::canAccessRules): Returning according the origin flag if set.
2678         Returning as before in case the flag is not set.
2679         * css/CSSStyleSheet.h: Adding origin clean flag.
2680         * dom/ExtensionStyleSheets.cpp:
2681         (WebCore::ExtensionStyleSheets::addUserStyleSheet):
2682         (WebCore::ExtensionStyleSheets::addAuthorStyleSheetForTesting):
2683         (WebCore::ExtensionStyleSheets::maybeAddContentExtensionSheet):
2684         * html/HTMLLinkElement.cpp:
2685         (WebCore::HTMLLinkElement::initializeStyleSheet): Helper routine used in setCSSStyleSheet.
2686         Sets origin clean flag if the resource is clean.
2687         (WebCore::HTMLLinkElement::setCSSStyleSheet): Making use of initializeStyleSheet.
2688         * html/HTMLLinkElement.h:
2689
2690 2016-09-05  Youenn Fablet  <youenn@apple.com>
2691
2692         CachedResourceLoader is not taking into account fetch options to use or not cached resources
2693         https://bugs.webkit.org/show_bug.cgi?id=161389
2694
2695         Reviewed by Darin Adler.
2696
2697         Tests: http/tests/fetch/fetching-same-resource-with-diffferent-options.html
2698                http/tests/security/cross-origin-cached-resource-parallel.html
2699                http/tests/security/cross-origin-cached-resource.html
2700                http/tests/security/load-image-after-redirection-2.html
2701                http/tests/security/shape-outside-and-cached-resources.html
2702
2703         Adding CORS checks for the response in case of CORS fetch mode, in SubresourceLoader.
2704         Removing the CORS checks in Image and DocumentThreadableLoader.
2705
2706         The direction of this patch is to make CachedResource origin-specific/fetch mode specific.
2707
2708         This will remove the need for CachedResource clients to do CORS checks when receiving the notifyFinished call.
2709         This will also make the computation of whether a resource is clean or not much easier since the CachedResource knowd its origin and its response tainting.
2710
2711         Removing the CORS checks at ImageLoader creates the risk of using some cached resources loaded from previously no-cors mode without doing the actual CORS check.
2712         Note that the risk was already there in case of a resource loaded through redirections.
2713         Reusing a cached resource for a load with different options also leads to bad computation of the resource tainting.
2714
2715         As a first step, improvements are done but only for CachedImage resources.
2716
2717         This patch limits the direct reuse of cached resources as follow:
2718         - If the request and existing resources have different origins.
2719         - If the fetch mode is different between request and existing resource.
2720
2721         In those cases, a new CachedResource is created with the correct options and origin.
2722         The data and response of the CachedResource found in the cache are copied efficiently in the new CachedResource, if the matching CachedResource finished loading (CachedImage specific).
2723
2724         If the matching CachedResource is still loading, we trigger a reload (with caching=false to not disturb the being loaded resource).
2725         This should be made more efficient at some point, especially if the matching CachedResource already has its response set.
2726
2727         This triggers a change of behavior: previously, the CORS checks were done by the ImageLoader when the resource was finished loading.
2728         The CORS checks were controlled by the crossOrigin attribute, which may be set or unset between the load start and the load end.
2729
2730         Now the crossOrigin attribute is checked at load start. If it is set, the CORS checks will happen even if the attribute is unset before the end of the load.
2731         This is more consistent as the actual request was built with CORS enabled.
2732
2733         * loader/CrossOriginPreflightChecker.cpp:
2734         (WebCore::CrossOriginPreflightChecker::startPreflight): Setting correctly the preflight options as per fetch spec.
2735         * loader/DocumentThreadableLoader.cpp:
2736         (WebCore::DocumentThreadableLoader::didReceiveResponse): Removing CORS check.
2737         (WebCore::DocumentThreadableLoader::loadRequest): Adding CORS check in sync mode.
2738         * loader/ImageLoader.cpp:
2739         (WebCore::ImageLoader::updateFromElement):
2740         (WebCore::ImageLoader::notifyFinished):
2741         * loader/SubresourceLoader.cpp:
2742         (WebCore::SubresourceLoader::didReceiveResponse): Adding CORS checks to the response
2743         (WebCore::SubresourceLoader::checkResponseCrossOriginAccessControl): Helper routine to do CORS checks
2744         * loader/SubresourceLoader.h:
2745         * loader/cache/CachedImage.cpp:
2746         (WebCore::CachedImage::cloneData): Responsible to set image content from another CachedImage.
2747         * loader/cache/CachedImage.h:
2748         * loader/cache/CachedResource.cpp:
2749         (WebCore::CachedResource::computeOrigin): Helper routine to set the origin and whether the resource is cross-origin or not.
2750         (WebCore::CachedResource::load): Using computeOrigin.
2751         (WebCore::CachedResource::loadFrom): Loading from a CachedResource from the same type and which finished loading.
2752         * loader/cache/CachedResource.h:
2753         (WebCore::CachedResource::cloneData):
2754         * loader/cache/CachedResourceLoader.cpp:
2755         (WebCore::CachedResourceLoader::updateCachedResourceWithCurrentRequest): Helper routine responsible to adapt the CachedResource
2756         that can be reused to the origin and options of a new request.
2757         (WebCore::CachedResourceLoader::requestResource): Calling updateCachedResourceWithCurrentRequest before actually returning the resource.
2758         (WebCore::CachedResourceLoader::determineRevalidationPolicy): Space clean-up.
2759         * loader/cache/CachedResourceLoader.h:
2760         * loader/cache/CachedResourceRequest.h:
2761         (WebCore::CachedResourceRequest::setCachingPolicy):
2762         * style/StylePendingResources.cpp:
2763         (WebCore::Style::loadPendingImage): Allowing data URLs for ShapeOutside data.
2764
2765 2016-09-05  Frederic Wang  <fwang@igalia.com>
2766
2767         More refactoring of RenderMathMLScripts
2768         https://bugs.webkit.org/show_bug.cgi?id=161371
2769
2770         Reviewed by Darin Adler.
2771
2772         This is a follow-up of bug 161084. The function getScriptMetricsAndLayoutIfNeeded was quite
2773         complicated and it was not obvious that we have to call it twice with the same reference
2774         to a struture holding vertical metrics. We extract the part retrieving layout parameters
2775         into verticalParameters and move its layoutIfNeeded calls into layoutBlock. Then it can
2776         be reduced to a simple function that retrieve the vertical metrics in one call.
2777         We also improve getBaseAndScripts to make clear that it is performing validation. It returns
2778         a ReferenceChildren structure encapsulating pointers to important children so that we no
2779         longer pass these pointers as function parameters. We continue to need them to browse the
2780         list of prescripts & postscripts but we refactor a bit the loop to avoid explicit mention
2781         of RenderBox*.
2782
2783         No new tests, already covered by existing tests.
2784
2785         * rendering/mathml/RenderMathMLScripts.cpp:
2786         (WebCore::RenderMathMLScripts::validateAndGetReferenceChildren): We now store the pointers to
2787         the base, firstPostScript and firstPreScript children in the ReferenceChildren structure. We
2788         also add a pointer to the prescriptDelimiter for convenience.
2789         (WebCore::RenderMathMLScripts::italicCorrection): Use the ReferenceChildren structure so that
2790         we are sure the base has been validated before calling this function.
2791         (WebCore::RenderMathMLScripts::computePreferredLogicalWidths): Retrieve the reference
2792         children with validateAndGetReferenceChildren instead of calling getBaseAndScripts and use
2793         ReferenceChildren to handle these children and to call italicCorrection. The loops for
2794         SubSup, UnderOver, Multiscripts are also rewritten a bit to avoid declaring a null RenderBox*
2795         outside of them and hence allow to use auto.
2796         (WebCore::RenderMathMLScripts::verticalParameters): This part to extract the layout
2797         parameters is extracted from getScriptMetricsAndLayoutIfNeeded. The parameters are returned
2798         as a VerticalParameters struct.
2799         (WebCore::RenderMathMLScripts::verticalMetrics): This is the remaining part of
2800         getScriptMetricsAndLayoutIfNeeded It used to call layoutIfNeeded on children and to
2801         calculate maximum vertical metrics. For Multiscripts it was called twice: We did a first
2802         call to handle the prescripts and then pass the result again in the second call to handle
2803         the postscripts. We modify a bit the loop so that all the scripts are handled in one call and
2804         hence we can directly return a VerticalMetrics. Again, the reference children are now handled
2805         using the ReferenceChildren structure passed as a parameter.
2806         (WebCore::RenderMathMLScripts::layoutBlock): We retrieve the reference children with
2807         validateAndGetReferenceChildren instead of calling getBaseAndScripts and use
2808         ReferenceChildren to handle these children and to call italicCorrection. We layout all the
2809         children if needed in one loop at the beginning instead of doing that when their vertical
2810         metrics are needed. We can now also retrieve vertical metrics with a single call.
2811         (WebCore::RenderMathMLScripts::getBaseAndScripts): Renamed validateAndGetReferenceChildren.
2812         (WebCore::RenderMathMLScripts::getScriptMetricsAndLayoutIfNeeded): Deleted. Split into
2813         verticalParameters and verticalMetrics.
2814         * rendering/mathml/RenderMathMLScripts.h: New structure to handle the pointers to reference
2815         children. Update the signature of getBaseAndScripts to use this struture and give a clearer
2816         name. Update the signature of italicCorrection to use this structure too. Add a new structure
2817         VerticalParameters and declare the helper function to retrieve them. Rename ScriptMetrics
2818         to VerticalMetrics and update the signature of the function needed to retrieve it.
2819
2820 2016-09-05  Zan Dobersek  <zdobersek@igalia.com>
2821
2822         MediaPlayerPrivateGStreamerBase: improve build guards in nativeImageForCurrentTime()
2823         https://bugs.webkit.org/show_bug.cgi?id=161594
2824
2825         Reviewed by Philippe Normand.
2826
2827         Guard the uses of cairo-gl API in nativeImageForCurrentTime() with the
2828         USE(CAIRO) && ENABLE(ACCELERATED_2D_CANVAS) pair of build guards. This
2829         API is only made available when the ACCELERATED_2D_CANVAS option is
2830         enabled. Placing the guards this way thus avoids compilation errors
2831         when compiling USE_GSTREAMER_GL code without the accelerated 2D canvas
2832         support enabled.
2833
2834         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2835         (WebCore::MediaPlayerPrivateGStreamerBase::nativeImageForCurrentTime):
2836
2837 2016-09-04  Sam Weinig  <sam@webkit.org>
2838
2839         Remove the CREATE_DOM_WRAPPER macro
2840         https://bugs.webkit.org/show_bug.cgi?id=161580
2841
2842         Reviewed by Dan Bernstein.
2843
2844         The CREATE_DOM_WRAPPER has irritated me for too long! Replace it
2845         with direct calls to createWrapper<ImplementationType>, which has
2846         been upgraded to not require specifying both the implementation type
2847         and the wrapper type by way of the new JSDOMWrapperConverterTraits
2848         struct which provides mapping from ImplementationType -> JSWrapper.
2849         createWrapper<ImplementationType> has also been upgraded to have a
2850         specialization for when the object being passed in needs to be casted.
2851
2852         * bindings/js/JSAnimationTimelineCustom.cpp:
2853         (WebCore::toJSNewlyCreated):
2854         * bindings/js/JSBlobCustom.cpp:
2855         (WebCore::toJSNewlyCreated):
2856         (WebCore::constructJSBlob):
2857         * bindings/js/JSCSSRuleCustom.cpp:
2858         (WebCore::toJSNewlyCreated):
2859         * bindings/js/JSCSSValueCustom.cpp:
2860         (WebCore::toJSNewlyCreated):
2861         * bindings/js/JSDataCueCustom.cpp:
2862         (WebCore::constructJSDataCue):
2863         * bindings/js/JSDocumentCustom.cpp:
2864         (WebCore::createNewDocumentWrapper):
2865         * bindings/js/JSDocumentFragmentCustom.cpp:
2866         (WebCore::toJSNewlyCreated):
2867         * bindings/js/JSElementCustom.cpp:
2868         (WebCore::createNewElementWrapper):
2869         * bindings/js/JSEventCustom.cpp:
2870         (WebCore::toJSNewlyCreated):
2871         * bindings/js/JSFileCustom.cpp:
2872         (WebCore::constructJSFile):
2873         * bindings/js/JSHTMLCollectionCustom.cpp:
2874         (WebCore::toJSNewlyCreated):
2875         * bindings/js/JSHTMLDocumentCustom.cpp:
2876         (WebCore::toJSNewlyCreated):
2877         * bindings/js/JSIDBCursorCustom.cpp:
2878         (WebCore::toJSNewlyCreated):
2879         * bindings/js/JSImageDataCustom.cpp:
2880         (WebCore::toJSNewlyCreated):
2881         * bindings/js/JSNodeCustom.cpp:
2882         (WebCore::createWrapperInline):
2883         * bindings/js/JSNodeListCustom.cpp:
2884         (WebCore::createWrapper):
2885         * bindings/js/JSPerformanceEntryCustom.cpp:
2886         (WebCore::toJSNewlyCreated):
2887         * bindings/js/JSSVGPathSegCustom.cpp:
2888         (WebCore::toJSNewlyCreated):
2889         * bindings/js/JSStyleSheetCustom.cpp:
2890         (WebCore::toJSNewlyCreated):
2891         * bindings/js/JSTextCustom.cpp:
2892         (WebCore::toJSNewlyCreated):
2893         * bindings/js/JSTextTrackCueCustom.cpp:
2894         (WebCore::toJSNewlyCreated):
2895         * bindings/js/JSWebGLRenderingContextBaseCustom.cpp:
2896         (WebCore::toJSNewlyCreated):
2897         * bindings/js/JSXMLDocumentCustom.cpp:
2898         (WebCore::toJSNewlyCreated):
2899         * dom/make_names.pl:
2900         (printWrapperFunctions):
2901         (printWrapperFactoryCppFile):
2902         Replace CREATE_DOM_WRAPPER with direct calls to createWrapper.
2903
2904         * bindings/js/JSWorkerGlobalScopeBase.h:
2905         Add #include of JSDOMWrapper.h to allow generated subclasses to use 
2906         JSDOMWrapperConverterTraits.
2907
2908         * bindings/js/JSDOMBinding.h:
2909         (WebCore::castDOMObjectForWrapperCreation): Deleted.
2910         Remove CREATE_DOM_WRAPPER and castDOMObjectForWrapperCreation and 
2911         specialize createWrapper.
2912
2913         * bindings/js/JSDOMWrapper.h:
2914         Forward declare JSDOMWrapperConverterTraits.
2915
2916         * bindings/scripts/CodeGeneratorJS.pm:
2917         (GenerateHeader):
2918         Add specialization of JSDOMWrapperConverterTraits for each header.
2919
2920         (GenerateImplementation):
2921         (GenerateConstructorDefinition):
2922         Replace CREATE_DOM_WRAPPER with direct calls to createWrapper.
2923
2924 2016-09-04  Antti Koivisto  <antti@apple.com>
2925
2926         Remove Style::PendingResources
2927         https://bugs.webkit.org/show_bug.cgi?id=161574
2928
2929         Reviewed by Andreas Kling.
2930
2931         RenderStyle contains all the information needed to initialize resource loads. There is no need for this side structure.
2932
2933         * css/CSSFilterImageValue.cpp:
2934         (WebCore::CSSFilterImageValue::loadSubimages):
2935
2936             Load external SVG resources along with any image resources.
2937
2938         * css/CSSToStyleMap.cpp:
2939         (WebCore::CSSToStyleMap::styleImage):
2940         (WebCore::CSSToStyleMap::mapFillImage):
2941         (WebCore::CSSToStyleMap::mapNinePieceImage):
2942         * css/CSSToStyleMap.h:
2943         * css/StyleBuilderConverter.h:
2944         (WebCore::StyleBuilderConverter::convertStyleImage):
2945         (WebCore::StyleBuilderConverter::convertShapeValue):
2946         * css/StyleBuilderCustom.h:
2947         (WebCore::StyleBuilderCustom::applyValueCursor):
2948         (WebCore::StyleBuilderCustom::applyValueContent):
2949         * css/StyleResolver.cpp:
2950         (WebCore::StyleResolver::State::clear):
2951         (WebCore::StyleResolver::styleImage):
2952         (WebCore::StyleResolver::createFilterOperations):
2953         (WebCore::StyleResolver::loadPendingResources):
2954         (WebCore::StyleResolver::State::ensurePendingResources): Deleted.
2955         (WebCore::StyleResolver::styleCachedImageFromValue): Deleted.
2956         (WebCore::StyleResolver::styleGeneratedImageFromValue): Deleted.
2957         * css/StyleResolver.h:
2958         (WebCore::StyleResolver::State::takePendingResources): Deleted.
2959         * platform/graphics/filters/FilterOperation.cpp:
2960         (WebCore::ReferenceFilterOperation::loadExternalDocumentIfNeeded):
2961         (WebCore::ReferenceFilterOperation::getOrCreateCachedSVGDocumentReference): Deleted.
2962         * platform/graphics/filters/FilterOperation.h:
2963         (WebCore::ReferenceFilterOperation::cachedSVGDocumentReference):
2964         * rendering/style/StyleCachedImage.cpp:
2965         (WebCore::StyleCachedImage::StyleCachedImage):
2966         * style/StylePendingResources.cpp:
2967         (WebCore::Style::loadPendingResources):
2968
2969             Trigger resource loads by checking pending resources in RenderStyle unconditionally. Keeping track of them
2970             separately wasn't necessary or a meaningful optimization.
2971
2972         (WebCore::Style::loadPendingImages): Deleted.
2973         (WebCore::Style::loadPendingSVGFilters): Deleted.
2974         * style/StylePendingResources.h:
2975
2976 2016-09-04  Antti Koivisto  <antti@apple.com>
2977
2978         Reverse ownership relation of StyleCachedImage and CSSImageValue
2979         https://bugs.webkit.org/show_bug.cgi?id=161447
2980
2981         Reviewed by Andreas Kling.
2982
2983         Currently StyleCachedImage (which represents an image in RenderStyle) has a weak ref to the
2984         underlying CSSImageValue/CSSImageSetValue which actually owns it. This is awkwards especially since
2985         StyleGeneratedImage, the other StyleImage subclass has reversed relationship where it refs
2986         the underlying CSSImageGeneratorValue.
2987
2988         This patch makes StyleCachedImage similar to StyleGeneratedImage. StyleCachedImage now refs the
2989         underlying CSSImageValue/CSSImageSetValue. CSSImageValues no longer need to know about StyleCachedImage.
2990         Instead they reference CachedImages (memory cache objects) directly. StyleCachedImage instances are now
2991         conceptually unique to RenderStyle instances. Actual resources are shared as before by sharing CachedImages.
2992
2993         * css/CSSCursorImageValue.cpp:
2994         (WebCore::CSSCursorImageValue::loadImage):
2995         (WebCore::CSSCursorImageValue::cachedImage):
2996         (WebCore::CSSCursorImageValue::styleImage): Deleted.
2997         * css/CSSCursorImageValue.h:
2998         * css/CSSImageGeneratorValue.cpp:
2999         (WebCore::CSSImageGeneratorValue::cachedImageForCSSValue):
3000         * css/CSSImageSetValue.cpp:
3001         (WebCore::CSSImageSetValue::~CSSImageSetValue):
3002         (WebCore::CSSImageSetValue::loadBestFitImage):
3003         (WebCore::CSSImageSetValue::traverseSubresources):
3004         (WebCore::CSSImageSetValue::styleImage): Deleted.
3005         * css/CSSImageSetValue.h:
3006         * css/CSSImageValue.cpp:
3007         (WebCore::CSSImageValue::CSSImageValue):
3008         (WebCore::CSSImageValue::~CSSImageValue):
3009         (WebCore::CSSImageValue::isPending):
3010         (WebCore::CSSImageValue::loadImage):
3011         (WebCore::CSSImageValue::traverseSubresources):
3012         (WebCore::CSSImageValue::knownToBeOpaque):
3013         (WebCore::CSSImageValue::styleImage): Deleted.
3014         * css/CSSImageValue.h:
3015         * css/StyleBuilderCustom.h:
3016         (WebCore::StyleBuilderCustom::applyValueContent):
3017         * css/StyleResolver.cpp:
3018         (WebCore::StyleResolver::styleImage):
3019         (WebCore::StyleResolver::styleCachedImageFromValue):
3020         (WebCore::StyleResolver::styleGeneratedImageFromValue):
3021         (WebCore::StyleResolver::cachedOrPendingFromValue): Deleted.
3022         (WebCore::StyleResolver::generatedOrPendingFromValue): Deleted.
3023         (WebCore::StyleResolver::setOrPendingFromValue): Deleted.
3024         (WebCore::StyleResolver::cursorOrPendingFromValue): Deleted.
3025         * css/StyleResolver.h:
3026         * editing/TextIterator.cpp:
3027         (WebCore::fullyClipsContents):
3028         * page/PageSerializer.cpp:
3029         (WebCore::PageSerializer::retrieveResourcesForProperties):
3030         * rendering/style/FillLayer.cpp:
3031         (WebCore::FillLayer::imagesIdentical):
3032
3033             Compare data equality instead of pointer equality for StyleImages (since StyleImages are no longer shared).
3034
3035         (WebCore::layerImagesIdentical): Deleted.
3036         * rendering/style/StyleCachedImage.cpp:
3037         (WebCore::StyleCachedImage::StyleCachedImage):
3038         (WebCore::StyleCachedImage::~StyleCachedImage):
3039         (WebCore::StyleCachedImage::cachedImage):
3040         (WebCore::StyleCachedImage::cssValue):
3041         (WebCore::StyleCachedImage::canRender):
3042         (WebCore::StyleCachedImage::isPending):
3043         (WebCore::StyleCachedImage::isLoaded):
3044         (WebCore::StyleCachedImage::errorOccurred):
3045         (WebCore::StyleCachedImage::imageSize):
3046         (WebCore::StyleCachedImage::imageHasRelativeWidth):
3047         (WebCore::StyleCachedImage::imageHasRelativeHeight):
3048         (WebCore::StyleCachedImage::computeIntrinsicDimensions):
3049         (WebCore::StyleCachedImage::usesImageContainerSize):
3050         (WebCore::StyleCachedImage::setContainerSizeForRenderer):
3051         (WebCore::StyleCachedImage::addClient):
3052         (WebCore::StyleCachedImage::removeClient):
3053         (WebCore::StyleCachedImage::image):
3054         (WebCore::StyleCachedImage::knownToBeOpaque):
3055         (WebCore::StyleCachedImage::setCachedImage): Deleted.
3056         * rendering/style/StyleCachedImage.h:
3057
3058 2016-09-03  Wenson Hsieh  <wenson_hsieh@apple.com>
3059
3060         Media controls behave strangely when videos mute from within a playing handler
3061         https://bugs.webkit.org/show_bug.cgi?id=161559
3062         <rdar://problem/28018438>
3063
3064         Reviewed by Darin Adler.
3065
3066         Defer showing media controls until after the media element has fired its onplaying handler. This handles cases
3067         where videos that autoplay may initially meet the criteria for main content, but once the video begins to play,
3068         the page may change the media in some way (e.g. muting) that makes the video no longer main content. This causes
3069         media controls to flicker in and out.
3070
3071         These changes are covered by existing unit tests, which have been refactored to check media controller state
3072         after all autoplaying videos have begun playing. Also adds an additional unit test.
3073
3074         * html/HTMLMediaElement.cpp:
3075         (WebCore::HTMLMediaElement::notifyAboutPlaying):
3076         (WebCore::HTMLMediaElement::hasEverNotifiedAboutPlaying):
3077         * html/HTMLMediaElement.h:
3078         * html/MediaElementSession.cpp:
3079         (WebCore::MediaElementSession::canShowControlsManager):
3080
3081 2016-09-03  Ryosuke Niwa  <rniwa@webkit.org>
3082
3083         Update the semantics of defined-ness of custom elements per spec changes
3084         https://bugs.webkit.org/show_bug.cgi?id=161570
3085
3086         Reviewed by Darin Adler.
3087
3088         This patch adds the notion of a custom element that failed to construct or upgrade so that :defined
3089         doesn't apply to such an element. We also set the defined flag inside the HTMLElement constructor in
3090         the case of synchronous construction instead of waiting for the custom element constructor to finish.
3091         https://dom.spec.whatwg.org/#concept-create-element
3092
3093         Conceptually, there are four distinct states for an element:
3094         1. The element is a built-in element
3095         2. The element is a custom element yet to be defined (an upgrade candidate).
3096         3. The element is a well-defined custom element (constructed or upgraded).
3097         4. The element has failed to construct or upgrade as a custom element (because the custom element
3098         constructor threw an exception or returned an unexpected object).
3099
3100         In the latest DOM/HTML specifications, these states are called as 1. "uncustomized", 2. "undefined",
3101         3. "custom", and 4. "failed": https://dom.spec.whatwg.org/#concept-element-defined
3102
3103         This patch refactors Node flags to introduce these distinct states as the following:
3104         1. Neither IsCustomElement nor IsEditingTextOrUnresolvedCustomElementFlag is set.
3105         2. IsCustomElement and IsEditingTextOrUnresolvedCustomElementFlag are set.
3106         isCustomElementUpgradeCandidate() and isUndefinedCustomElement() return true.
3107         3. IsCustomElement is set and IsEditingTextOrUnresolvedCustomElementFlag is unset.
3108         isDefinedCustomElement() returns true.
3109         4. IsCustomElement is unset and IsEditingTextOrUnresolvedCustomElementFlag is set.
3110         isFailedCustomElement() and isUndefinedCustomElement() return true.
3111
3112         Per a spec change, this patch also makes :defined applied to a synchronously constructed custom element
3113         immediately after super() call in the constructor. When the constructor throws an exception or fails to
3114         return the right element, the HTML parser marks the fallback element with setIsUndefinedCustomElement.
3115
3116         Tests: fast/custom-elements/defined-pseudo-class.html
3117                fast/custom-elements/defined-rule.html
3118                fast/custom-elements/upgrading/Node-cloneNode.html
3119
3120         * bindings/js/JSCustomElementInterface.cpp:
3121         (WebCore::JSCustomElementInterface::constructElement): Don't set :defined flag here since that's done
3122         in the HTMLElement constructor now.
3123         (WebCore::JSCustomElementInterface::upgradeElement): Mark the element as failed-to-upgrade as needed.
3124         * bindings/js/JSElementCustom.cpp:
3125         (WebCore::toJSNewlyCreated):
3126         * bindings/js/JSHTMLElementCustom.cpp:
3127         (WebCore::constructJSHTMLElement):
3128         * css/SelectorCheckerTestFunctions.h:
3129         (WebCore::isDefinedElement):
3130         * dom/CustomElementReactionQueue.cpp:
3131         (WebCore::CustomElementReactionQueue::enqueueElementUpgradeIfDefined): Enqueue custom element reactions
3132         only if the element is well defined (successfully constructed or upgraded).
3133         (WebCore::CustomElementReactionQueue::enqueueConnectedCallbackIfNeeded): Ditto.
3134         (WebCore::CustomElementReactionQueue::enqueueDisconnectedCallbackIfNeeded): Ditto.
3135         (WebCore::CustomElementReactionQueue::enqueueAdoptedCallbackIfNeeded): Ditto.
3136         (WebCore::CustomElementReactionQueue::enqueueAttributeChangedCallbackIfNeeded): Ditto.
3137         * dom/CustomElementRegistry.cpp:
3138         (WebCore::enqueueUpgradeInShadowIncludingTreeOrder):
3139         * dom/Document.cpp:
3140         (WebCore::createUpgradeCandidateElement):
3141         (WebCore::createFallbackHTMLElement):
3142         * dom/Element.cpp:
3143         (WebCore::Element::attributeChanged):
3144         (WebCore::Element::didMoveToNewDocument):
3145         (WebCore::Element::insertedInto):
3146         (WebCore::Element::removedFrom):
3147         (WebCore::Element::setCustomElementIsResolved): Deleted.
3148         (WebCore::Element::setIsDefinedCustomElement): Renamed from setCustomElementIsResolved.
3149         (WebCore::Element::setIsFailedCustomElement): Added.
3150         (WebCore::Element::setIsCustomElementUpgradeCandidate): Added.
3151         (WebCore::Element::customElementInterface):
3152         * dom/Element.h:
3153         * dom/Node.h:
3154         (WebCore::Node::setIsCustomElement): Deleted.
3155         (WebCore::Node::isUndefinedCustomElement): Renamed from isUnresolvedCustomElement.
3156         (WebCore::Node::setIsUnresolvedCustomElement): Deleted.
3157         (WebCore::Node::isCustomElementUpgradeCandidate): Added.
3158         (WebCore::Node::isDefinedCustomElement): Renamed from isCustomElement.
3159         (WebCore::Node::isFailedCustomElement): Added.
3160         * dom/make_names.pl:
3161         (printWrapperFactoryCppFile): Use the HTMLElement wrapper on upgrade candidates. When a custom element
3162         failed to upgrade, the HTMLElement constructor would have created the wrapper so we never run this code.
3163         * html/parser/HTMLConstructionSite.cpp:
3164         (WebCore::HTMLConstructionSite::createHTMLElementOrFindCustomElementInterface): 
3165         * html/parser/HTMLDocumentParser.cpp:
3166         (WebCore::HTMLDocumentParser::runScriptsForPausedTreeBuilder): Mark the HTMLUnknownElement created when
3167         the custom element constructor failed to run successfully as a failed custom element so that :define
3168         wouldn't apply to this element.
3169
3170 2016-09-03  Wenson Hsieh  <wenson_hsieh@apple.com>
3171
3172         Refactor the heuristic for showing media controls to take all media sessions into account
3173         https://bugs.webkit.org/show_bug.cgi?id=161503
3174         <rdar://problem/28033783>
3175
3176         Reviewed by Darin Adler.
3177
3178         Currently, when selecting a media session to show playback controls for, we grab the first media session that
3179         passes our heuristic. Using this method, we are unable to take additional factors into account, such as whether
3180         another media session's element is scrolled in view, or if another media session has been interacted with more
3181         recently. To address this, we make the following changes:
3182
3183             1.  Consider the list of all MediaElementSessions.
3184
3185             2.  Select only the MediaElementSessions capable of showing media controls and sort the list by a special
3186                 heuristic that takes visibility and time of last user interaction into account. The first element on
3187                 this list is the strongest candidate for main content.
3188
3189             3.  If this strongest candidate is visible in the viewport, or it is playing with audio, we return this
3190                 as the chosen candidate. Otherwise, we return this session only if no other non-candidate video could be
3191                 confused as the main content (i.e. the non-candidate video is not only visible in the viewport, but also
3192                 large enough to be considered main content).
3193
3194         Using this new method of determining the video to show controls for, we retain previous behavior for pages with
3195         a single video. On pages with multiple videos, the above logic ensures that if the current controlled video is
3196         paused, scrolled out of view, and then a new video is scrolled into view, we will either hide media controls to
3197         avoid confusion if that video could be confused for main content (using the mechanism in step 3), or we
3198         hook up the media controls to the new video if it satisfies main content (using the mechanism in step 2).
3199
3200         This patch also adds 6 new TestWebKitAPI unit tests.
3201
3202         * html/HTMLMediaElement.cpp:
3203         (WebCore::mediaElementSessionInfoForSession):
3204         (WebCore::preferMediaControlsForCandidateSessionOverOtherCandidateSession):
3205         (WebCore::mediaSessionMayBeConfusedWithMainContent):
3206         (WebCore::bestMediaSessionForShowingPlaybackControlsManager):
3207         (WebCore::HTMLMediaElement::didAttachRenderers):
3208         (WebCore::HTMLMediaElement::layoutSizeChanged):
3209         (WebCore::HTMLMediaElement::isVisibleInViewportChanged):
3210         (WebCore::HTMLMediaElement::resetPlaybackSessionState):
3211         (WebCore::HTMLMediaElement::isVisibleInViewport):
3212         (WebCore::HTMLMediaElement::updatePlaybackControlsManager):
3213         * html/HTMLMediaElement.h:
3214         * html/MediaElementSession.cpp:
3215         (WebCore::MediaElementSession::removeBehaviorRestriction):
3216         (WebCore::MediaElementSession::canShowControlsManager):
3217         (WebCore::MediaElementSession::isLargeEnoughForMainContent):
3218         (WebCore::MediaElementSession::mostRecentUserInteractionTime):
3219         (WebCore::MediaElementSession::wantsToObserveViewportVisibilityForMediaControls):
3220         (WebCore::MediaElementSession::wantsToObserveViewportVisibilityForAutoplay):
3221         (WebCore::MediaElementSession::resetPlaybackSessionState):
3222         (WebCore::MediaElementSession::canControlControlsManager): Deleted.
3223         * html/MediaElementSession.h:
3224         * platform/audio/PlatformMediaSession.h:
3225         (WebCore::PlatformMediaSession::resetPlaybackSessionState):
3226         (WebCore::PlatformMediaSession::canControlControlsManager): Deleted.
3227         * platform/audio/PlatformMediaSessionManager.cpp:
3228         (WebCore::PlatformMediaSessionManager::currentSessionsMatching):
3229         (WebCore::PlatformMediaSessionManager::currentSessionMatching): Deleted.
3230         * platform/audio/PlatformMediaSessionManager.h:
3231         * platform/cocoa/WebPlaybackSessionModelMediaElement.mm:
3232         (WebPlaybackSessionModelMediaElement::setMediaElement):
3233
3234 2016-09-03  Darin Adler  <darin@apple.com>
3235
3236         Streamline DOMImplementation, and move it to our new DOM exception system
3237         https://bugs.webkit.org/show_bug.cgi?id=161295
3238
3239         Reviewed by Ryosuke Niwa.
3240
3241         * WebCore.xcodeproj/project.pbxproj: Added new headers to project.
3242
3243         * bindings/js/JSDOMBinding.h:
3244         (WebCore::toJS): Added an overload for ExceptionOr<>; this handles the
3245         exception case here so it doesn't need to be handled in generated code
3246         for the binding. Implemented here so that ExceptionOr.h does not know
3247         about bindings. But since this is a template, it will only compile when
3248         instantiated and there is no need to include ExceptionOr.h and indirectly
3249         the Variant.h header in this header.
3250         (WebCore::toJSNewlyCreated): Ditto.
3251
3252         * bindings/scripts/CodeGeneratorJS.pm:
3253         (GenerateCallbackImplementation): Refer to JSC::Exception with explicit
3254         namespace to avoid ambiguity with WebCore::Exception.
3255
3256         * dom/DOMImplementation.cpp:
3257         (WebCore::DOMImplementation::createDocumentType): Changed to return
3258         ExceptionOr.
3259         (WebCore::createXMLDocument): Added. Helper used in createDocument.
3260         (WebCore::DOMImplementation::getInterface): Deleted. This was unused.
3261         (WebCore::DOMImplementation::createDocument): Changed to return
3262         ExceptionOr.
3263         (WebCore::DOMImplementation::createCSSStyleSheet): Removed the unused
3264         ExceptionCode out argument.
3265         (WebCore::isValidXMLMIMETypeChar): Deleted. Moved to MIMETypeRegistry.
3266         (WebCore::DOMImplementation::isXMLMIMEType): Ditto.
3267         (WebCore::DOMImplementation::isTextMIMEType): Ditto.
3268
3269         * dom/DOMImplementation.h: Changed functions as described above to
3270         return ExceptionOr values. Also removed unused getInterface function,
3271         and isXMLMIMEType and isTextMIMEType, which both moved to the
3272         MIMETypeRegistry class alongside all the other similar MIME type
3273         functions.
3274
3275         * dom/DOMImplementation.idl: Reorganized this to match the IDL files
3276         in the specifications a little better. Also removed [RaisesException]
3277         since that is only needed for the old legacy ExceptionCode& style.
3278
3279         * dom/Document.cpp:
3280         (WebCore::Document::setXMLVersion): Removed call to the
3281         DOMImplementation::hasFeature function since the values passed in
3282         unconditionally result in the return value "true". This is left over
3283         either from specification language, or from an ancient version of this
3284         code that worked in a "no XML supported" mode.
3285         (WebCore::Document::setXMLStandalone): Ditto.
3286
3287         * dom/Document.h: Removed the ExceptionCode& out argument from setXMLStandalone.
3288         * dom/Document.idl: Removed [SetterRaisesException] from xmlStandalone.
3289
3290         * dom/Exception.h: Added.
3291         * dom/ExceptionOr.h: Added.
3292
3293         * html/HTMLTemplateElement.cpp: Removed unneeded include of DOMImplementation.h.
3294
3295         * inspector/InspectorPageAgent.cpp:
3296         (WebCore::createXHRTextDecoder): Use isXMLMIMEType in its new location in
3297         MIMETypeRegistry.
3298         * inspector/NetworkResourcesData.cpp:
3299         (WebCore::createOtherResourceTextDecoder): Ditto.
3300
3301         * loader/FrameLoader.cpp: Removed unneeded include of DOMImplementation.h.
3302
3303         * loader/TextResourceDecoder.cpp:
3304         (WebCore::TextResourceDecoder::determineContentType): Use isXMLMIMEType in its
3305         new location in MIMETypeRegistry.
3306
3307         * platform/MIMETypeRegistry.cpp:
3308         (WebCore::MIMETypeRegistry::isTextMIMEType): Added. Moved here from
3309         DOMImplementation.
3310         (WebCore::isValidXMLMIMETypeChar): Ditto.
3311         (WebCore::MIMETypeRegistry::isXMLMIMEType): Ditto.
3312
3313         * platform/MIMETypeRegistry.h: Added isXMLMIMEType and isTextMIMEType.
3314         Made isUnsupportedTextMIMEType private.
3315
3316         * svg/SVGElement.cpp:
3317         (WebCore::SVGElement::isSupported): Deleted. This function was never called.
3318         * svg/SVGElement.h: Updated for the above change.
3319
3320         * xml/XMLHttpRequest.cpp:
3321         (WebCore::XMLHttpRequest::responseIsXML): Use isXMLMIMEType in its new
3322         location in MIMETypeRegistry.
3323
3324         * xml/parser/XMLDocumentParserLibxml2.cpp:
3325         (WebCore::XMLDocumentParser::startDocument): Updated since setXMLStandalone
3326         no longer can raise an exception.
3327
3328 2016-09-03  Ryosuke Niwa  <rniwa@webkit.org>
3329
3330         Unbreak customElements.whenDefined after r205383 with a crash fix
3331         https://bugs.webkit.org/show_bug.cgi?id=161562
3332
3333         Reviewed by Darin Adler.
3334
3335         The crash was caused by DeferredWrapper::contextDestroyed not calling ContextDestructionObserver::contextDestroyed.
3336
3337         This caused m_scriptExecutionContext to not being set to nullptr when the Document was destroyed before DOMWindow
3338         during a single GC sweeping, and resulted in a use-after-free in ContextDestructionObserver's destructor.
3339
3340         Fixed the crash and reverted r205383.
3341
3342         Tests: fast/custom-elements/CustomElementRegistry.html
3343
3344         * bindings/js/JSCustomElementRegistryCustom.cpp:
3345         (WebCore::whenDefinedPromise):
3346         * bindings/js/JSDOMPromise.cpp:
3347         (WebCore::DeferredWrapper::contextDestroyed): Fixed the crash.
3348         * dom/CustomElementRegistry.cpp:
3349         (WebCore::CustomElementRegistry::addElementDefinition):
3350         * dom/CustomElementRegistry.h:
3351         (WebCore::CustomElementRegistry::promiseMap):
3352
3353 2016-09-03  Chris Dumez  <cdumez@apple.com>
3354
3355         Align cross-Origin Object.getOwnPropertyNames() with the HTML specification
3356         https://bugs.webkit.org/show_bug.cgi?id=161457
3357
3358         Reviewed by Darin Adler.
3359
3360         Align cross-Origin Object.getOwnPropertyNames() with the HTML specification:
3361         - https://html.spec.whatwg.org/#windowproxy-ownpropertykeys
3362         - https://html.spec.whatwg.org/#location-ownpropertykeys
3363         - https://html.spec.whatwg.org/#crossoriginproperties-(-o-)
3364
3365         We should list cross origin properties.
3366
3367         Firefox complies with the specification. However, WebKit was returning an
3368         empty array and logs a security error message.
3369
3370         No new tests, updated existing test.
3371
3372         * bindings/js/JSDOMWindowCustom.cpp:
3373         (WebCore::addCrossOriginPropertyNames):
3374         (WebCore::JSDOMWindow::getOwnPropertyNames):
3375         * bindings/js/JSLocationCustom.cpp:
3376         (WebCore::addCrossOriginPropertyNames):
3377         (WebCore::JSLocation::getOwnPropertyNames):
3378
3379 2016-09-03  Frédéric Wang  <fwang@igalia.com>
3380
3381         Constructors of MathML renderers should only accept MathMLPresentationElement-derived classes
3382         https://bugs.webkit.org/show_bug.cgi?id=161378
3383
3384         Reviewed by Darin Adler.
3385
3386         We update constructors of RenderMathMLBlock, to only accept MathMLPresentationElement
3387         instances as a parameter. Similarly, we make the constructor of RenderMathMLToken only
3388         accept MathMLTokenElement instances.
3389
3390         No new tests, behavior is unchanged.
3391
3392         * rendering/mathml/RenderMathMLBlock.cpp:
3393         (WebCore::RenderMathMLBlock::RenderMathMLBlock):
3394         * rendering/mathml/RenderMathMLBlock.h:
3395         * rendering/mathml/RenderMathMLToken.cpp:
3396         (WebCore::RenderMathMLToken::RenderMathMLToken):
3397         * rendering/mathml/RenderMathMLToken.h:
3398
3399 2016-09-03  Brian Weinstein  <bweinstein@apple.com>
3400
3401         Consult with the FrameLoaderClient about whether or not content extensions should be enabled when loading this URL.
3402         https://bugs.webkit.org/show_bug.cgi?id=161441
3403
3404         Reviewed by Darin Adler.
3405
3406         * loader/DocumentLoader.cpp:
3407         (WebCore::DocumentLoader::startLoadingMainResource): If content extensions aren't already disabled, consult with the
3408         FrameLoaderClient about whether or not we should use content extensions for this URL.
3409         * loader/FrameLoaderClient.h: Add the FrameLoaderClient call to determine if we should use content extensions for a given
3410         URL...
3411         * loader/EmptyClients.h: ... And add a stub implementation.
3412
3413 2016-09-03  Michael Catanzaro  <mcatanzaro@igalia.com>
3414
3415         Silence -Wparentheses warning triggered by r205266
3416
3417         Unreviewed
3418
3419         * platform/URL.cpp:
3420         (WebCore::URL::URL):
3421
3422 2016-09-03  Joseph Pecoraro  <pecoraro@apple.com>
3423
3424         Use ASCIILiteral in some more places
3425         https://bugs.webkit.org/show_bug.cgi?id=161557
3426
3427         Reviewed by Darin Adler.
3428
3429         * Modules/indexeddb/IDBDatabaseException.cpp:
3430         (WebCore::IDBDatabaseException::getErrorName):
3431         (WebCore::IDBDatabaseException::getErrorDescription):
3432         * Modules/websockets/WebSocket.cpp:
3433         (WebCore::WebSocket::binaryType):
3434         * css/FontFace.cpp:
3435         (WebCore::FontFace::stretch):
3436         (WebCore::FontFace::unicodeRange):
3437         (WebCore::FontFace::featureSettings):
3438         * html/canvas/WebGLRenderingContextBase.cpp:
3439         * html/parser/HTMLPreloadScanner.cpp:
3440         (WebCore::TokenPreloadScanner::initiatorFor):
3441         * loader/FormSubmission.cpp:
3442         (WebCore::FormSubmission::Attributes::parseEncodingType):
3443         * page/SecurityOrigin.cpp:
3444         (WebCore::SecurityOrigin::toRawString):
3445         * platform/graphics/cg/ImageBufferCG.cpp:
3446         (WebCore::CGImageToDataURL):
3447         (WebCore::ImageBuffer::toDataURL):
3448         (WebCore::ImageDataToDataURL):
3449         * svg/graphics/SVGImage.cpp:
3450         (WebCore::SVGImage::filenameExtension):
3451
3452 2016-09-03  Chris Dumez  <cdumez@apple.com>
3453
3454         Object.preventExtensions(window) should throw a TypeError
3455         https://bugs.webkit.org/show_bug.cgi?id=161554
3456
3457         Reviewed by Darin Adler.
3458
3459         Object.preventExtensions(window) should throw a TypeError.
3460
3461         [[PreventExtensions]] should return false for Window:
3462         - https://html.spec.whatwg.org/#windowproxy-preventextensions
3463
3464         EcmaScript says that Object.preventExtensions() should throw a TypeError
3465         if [[PreventExtension]] returns false:
3466         - https://tc39.github.io/ecma262/#sec-object.preventextensions
3467
3468         No new tests, updated existing test.
3469
3470         * bindings/js/JSDOMWindowCustom.cpp:
3471         (WebCore::JSDOMWindow::preventExtensions):
3472
3473 2016-09-03  Chris Dumez  <cdumez@apple.com>
3474
3475         Align meta element http-equiv="refresh" parsing with the HTML specification
3476         https://bugs.webkit.org/show_bug.cgi?id=161543
3477
3478         Reviewed by Darin Adler.
3479
3480         Align meta element http-equiv="refresh" parsing with the HTML specification:
3481         - https://html.spec.whatwg.org/multipage/semantics.html#attr-meta-http-equiv-refresh
3482
3483         Tests: imported/w3c/web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/parsing.html
3484
3485         * dom/Document.cpp:
3486         (WebCore::Document::processHttpEquiv):
3487         * html/parser/HTMLParserIdioms.cpp:
3488         (WebCore::parseHTTPRefreshInternal):
3489         (WebCore::parseMetaHTTPEquivRefresh):
3490         * html/parser/HTMLParserIdioms.h:
3491         * loader/FrameLoader.cpp:
3492         (WebCore::FrameLoader::receivedFirstData):
3493         * platform/network/HTTPParsers.cpp:
3494         (WebCore::skipWhiteSpace):
3495         (WebCore::skipEquals):
3496         (WebCore::parseHTTPRefresh):
3497         (WebCore::parseXSSProtectionHeader):
3498         (WebCore::skipValue): Deleted.
3499         * platform/network/HTTPParsers.h:
3500
3501 2016-09-02  Myles C. Maxfield  <mmaxfield@apple.com>
3502
3503         [Cocoa] Distinguish between paint advances and base advances
3504         https://bugs.webkit.org/show_bug.cgi?id=160892
3505
3506         Reviewed by Simon Fraser.
3507
3508         This patch introduces the concept of a layout (or "base") advance which is distinct
3509         from a painting advance. In extremely complicated scripts such as Urdu, it is common
3510         for a glyph advance to be negative in the horizontal direction, and have large advances
3511         in the vertical direction. In particular, in cursive scripts, the glyph placement is
3512         only indirectly related to where the actual characters lie. Conceptually, these glyph
3513         locations are correct for painting, but are not correct when performing width
3514         measurements.
3515
3516         In many text engines, glyph shaping actually can be split into two phases: adjusting
3517         advances, and then placing glyphs relative to those advances. The secondary glyph
3518         placement step is much more context-sensitive than the first step. In addition, when
3519         multiple glyphs combine to form a character, it is common for one glyph to own the
3520         full base advance for the character, and for the other glyphs in the character to
3521         have zero base advances. (Then, in the glyph placement phase, the other glyphs get
3522         placed all around.)
3523
3524         Because of the context-insensitivity of the base advances, it is valuable to use
3525         these for text measurement. Then, when we want to paint, we should add in the extra
3526         origins. This dramatically improves the layout of complex fonts like Noto Nastaliq.
3527
3528         This patch migrates WebKit to use this two-phase shaping.
3529
3530         No new tests just yet, because I have to create a font which exercises the
3531         advanced glyph placement support.
3532
3533         * platform/graphics/GlyphBuffer.h:
3534         (WebCore::GlyphBufferAdvance::setHeight):
3535         (WebCore::GlyphBufferAdvance::setWidth): Deleted.
3536         * platform/graphics/TextRun.h:
3537         (WebCore::TextRun::TextRun):
3538         (WebCore::TextRun::shouldDisableLayoutSpecificAdvances):
3539         (WebCore::TextRun::setShouldDisableLayoutSpecificAdvances):
3540         (WebCore::TextRun::spacingDisabled): Deleted.
3541         (WebCore::TextRun::setCharacterScanForCodePath): Deleted.
3542         * platform/graphics/cocoa/FontCascadeCocoa.mm:
3543         (WebCore::FontCascade::getGlyphsAndAdvancesForComplexText):
3544         * platform/graphics/mac/ComplexTextController.cpp:
3545         (WebCore::ComplexTextController::ComplexTextController):
3546         (WebCore::ComplexTextController::offsetForPosition):
3547         (WebCore::ComplexTextController::collectComplexTextRuns):
3548         (WebCore::ComplexTextController::ComplexTextRun::setIsNonMonotonic):
3549         (WebCore::ComplexTextController::runWidthSoFarFraction):
3550         (WebCore::ComplexTextController::advance):
3551         (WebCore::ComplexTextController::adjustGlyphsAndAdvances):
3552         * platform/graphics/mac/ComplexTextController.h:
3553         (WebCore::ComplexTextController::ComplexTextRun::create):
3554         (WebCore::ComplexTextController::ComplexTextRun::baseAdvances):
3555         (WebCore::ComplexTextController::ComplexTextRun::glyphOrigins):
3556         (WebCore::ComplexTextController::useLayoutSpecificAdvances):
3557         (WebCore::ComplexTextController::finalRoundingWidth): Deleted.
3558         (WebCore::ComplexTextController::ComplexTextRun::advances): Deleted.
3559         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
3560         (SOFT_LINK):
3561         (WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun):
3562         (WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
3563         * platform/spi/cocoa/CoreTextSPI.h:
3564
3565 2016-09-02  Zalan Bujtas  <zalan@apple.com>
3566
3567         Should never be reached failure in WebCore::floatValueForLength
3568         https://bugs.webkit.org/show_bug.cgi?id=139397
3569         <rdar://problem/27704376>
3570
3571         Reviewed by Simon Fraser.
3572
3573         floatValueForLength can't resolve unspecified Length types. Filter them out and return 0 as if they were auto.
3574
3575         Test: svg/css/assert-on-non-resolvable-dimension.html
3576
3577         * svg/SVGLengthContext.cpp:
3578         (WebCore::SVGLengthContext::valueForLength):
3579
3580 2016-09-02  Joseph Pecoraro  <pecoraro@apple.com>
3581
3582         [Mac] Remove unnecessary RetainPtr in NeverDestroyed value
3583         https://bugs.webkit.org/show_bug.cgi?id=161553
3584
3585         Reviewed by Daniel Bates.
3586
3587         * platform/ios/WebCoreMotionManager.mm:
3588         (+[WebCoreMotionManager sharedManager]):
3589
3590 2016-09-02  Alex Christensen  <achristensen@webkit.org>
3591
3592         URLParser should parse file URLs
3593         https://bugs.webkit.org/show_bug.cgi?id=161556
3594
3595         Reviewed by Tim Horton.
3596
3597         Added new API tests.
3598
3599         * platform/URLParser.cpp:
3600         (WebCore::isWindowsDriveLetter):
3601         (WebCore::shouldCopyFileURL):
3602         (WebCore::URLParser::parse):
3603         (WebCore::URLParser::parseHost):
3604         * platform/URLParser.h:
3605
3606 2016-09-02  Ryosuke Niwa  <rniwa@webkit.org>
3607
3608         Add validations for a synchronously constructed custom element
3609         https://bugs.webkit.org/show_bug.cgi?id=161528
3610
3611         Reviewed by Yusuke Suzuki.
3612
3613         The latest DOM specification has sanity checks when creating an element with the synchronous custom elements flag set
3614         in 6.1.3 through 10:
3615         3. If result does not implement the HTMLElement interface, throw a TypeError.
3616         4. If result's attribute list is not empty, then throw a NotSupportedError.
3617         5. If result has children, then throw a NotSupportedError.
3618         6. If result's parent is not null, then throw a NotSupportedError.
3619         7. If result's node document is not document, then throw a NotSupportedError.
3620         8. If result's namespace is not the HTML namespace, then throw a NotSupportedError.
3621         9. If result's local name is not equal to localName, then throw a NotSupportedError.
3622
3623         Add all these checks to JSCustomElementInterface::constructElement.
3624
3625         Tests: fast/custom-elements/Document-createElement.html
3626
3627         * bindings/js/JSCustomElementInterface.cpp:
3628         (WebCore::JSCustomElementInterface::constructElement): Report the exception thrown during parsing instead of just
3629         clearing and ignoring it.
3630         (WebCore::constructCustomElementSynchronously): Extracted out of constructElement so that we can also catch TypeError
3631         and NotSupportedError we throw in constructElement for the parser.
3632
3633 2016-09-02  Zalan Bujtas  <zalan@apple.com>
3634
3635         ASSERT_NOT_REACHED() is touched in WebCore::valueForLength
3636         https://bugs.webkit.org/show_bug.cgi?id=123337
3637         <rdar://problem/27684121>
3638
3639         Reviewed by Simon Fraser.
3640
3641         Do not try to use unspecified height value while resolving logical height for table row.
3642
3643         Test: fast/table/assert-on-non-resolvable-row-dimension.html
3644
3645         * rendering/RenderTableCell.h:
3646         (WebCore::RenderTableCell::logicalHeightForRowSizing):
3647
3648 2016-09-02  Ryosuke Niwa  <rniwa@webkit.org>
3649
3650         Temporarily break customElements.whenDefined to remove flaky crashes
3651         https://bugs.webkit.org/show_bug.cgi?id=161555
3652
3653         Reviewed by Chris Dumez.
3654
3655         Remove HashMap of DeferredWrapper which causes a crash during destruction.
3656         This breaks the semantics of "whenDefined" for now.
3657
3658         * bindings/js/JSCustomElementRegistryCustom.cpp:
3659         (WebCore::whenDefinedPromise):
3660         * dom/CustomElementRegistry.cpp:
3661         (WebCore::CustomElementRegistry::addElementDefinition):
3662         * dom/CustomElementRegistry.h:
3663         (WebCore::CustomElementRegistry::promiseMap): Deleted.
3664
3665 2016-09-02  Ryan Haddad  <ryanhaddad@apple.com>
3666         Unreviewed, rolling out r205373.
3667
3668         This change causes LayoutTest crashes under GuardMalloc
3669
3670         Reverted changeset:
3671
3672         "[Cocoa] Distinguish between paint advances and base advances"
3673         https://bugs.webkit.org/show_bug.cgi?id=160892
3674         http://trac.webkit.org/changeset/205373
3675
3676 2016-09-02  Beth Dakin  <bdakin@apple.com>
3677
3678         Need to updateEditorState if an element change edit-ability without changing 
3679         selection
3680         https://bugs.webkit.org/show_bug.cgi?id=161546
3681         -and corresponding-
3682         rdar://problem/27806012
3683
3684         Reviewed by Ryosuke Niwa.
3685
3686         Call into the client in case edited state needs to be updated. 
3687         * editing/FrameSelection.cpp:
3688         (WebCore::FrameSelection::updateAppearanceAfterLayout):
3689         * loader/EmptyClients.h:
3690         * page/EditorClient.h:
3691
3692 2016-09-02  Zalan Bujtas  <zalan@apple.com>
3693
3694         ASSERTION FAILED: !m_committedWidth in WebCore::LineWidth::fitBelowFloats
3695         https://bugs.webkit.org/show_bug.cgi?id=149462
3696         <rdar://problem/27710841>
3697
3698         Reviewed by David Hyatt.
3699
3700         In certain cases (multiple spans on the same line with negativ marings), the LineWidth::m_committedWidth > 0
3701         check is not sufficient to decide if some content has already been committed to the current line.
3702         This patch adds a flag to indicate if we ever committed to the current line. 
3703
3704         Test: fast/text/assert-when-text-with-negative-margin-sibling-does-not-fit.html
3705
3706         * rendering/line/BreakingContext.h:
3707         (WebCore::BreakingContext::handleText):
3708         * rendering/line/LineWidth.h:
3709         (WebCore::LineWidth::hasCommitted):
3710
3711 2016-09-02  Myles C. Maxfield  <mmaxfield@apple.com>
3712
3713         [Cocoa] Distinguish between paint advances and base advances
3714         https://bugs.webkit.org/show_bug.cgi?id=160892
3715
3716         Reviewed by Simon Fraser.
3717
3718         This patch introduces the concept of a layout (or "base") advance which is distinct
3719         from a painting advance. In extremely complicated scripts such as Urdu, it is common
3720         for a glyph advance to be negative in the horizontal direction, and have large advances
3721         in the vertical direction. In particular, in cursive scripts, the glyph placement is
3722         only indirectly related to where the actual characters lie. Conceptually, these glyph
3723         locations are correct for painting, but are not correct when performing width
3724         measurements.
3725
3726         In many text engines, glyph shaping actually can be split into two phases: adjusting
3727         advances, and then placing glyphs relative to those advances. The secondary glyph
3728         placement step is much more context-sensitive than the first step. In addition, when
3729         multiple glyphs combine to form a character, it is common for one glyph to own the
3730         full base advance for the character, and for the other glyphs in the character to
3731         have zero base advances. (Then, in the glyph placement phase, the other glyphs get
3732         placed all around.)
3733
3734         Because of the context-insensitivity of the base advances, it is valuable to use
3735         these for text measurement. Then, when we want to paint, we should add in the extra
3736         origins. This dramatically improves the layout of complex fonts like Noto Nastaliq.
3737
3738         This patch migrates WebKit to use this two-phase shaping.
3739
3740         No new tests just yet, because I have to create a font which exercises the
3741         advanced glyph placement support.
3742
3743         * platform/graphics/GlyphBuffer.h:
3744         (WebCore::GlyphBufferAdvance::setHeight):
3745         (WebCore::GlyphBufferAdvance::setWidth): Deleted.
3746         * platform/graphics/TextRun.h:
3747         (WebCore::TextRun::TextRun):
3748         (WebCore::TextRun::shouldDisableLayoutSpecificAdvances):
3749         (WebCore::TextRun::setShouldDisableLayoutSpecificAdvances):
3750         (WebCore::TextRun::spacingDisabled): Deleted.
3751         (WebCore::TextRun::setCharacterScanForCodePath): Deleted.
3752         * platform/graphics/cocoa/FontCascadeCocoa.mm:
3753         (WebCore::FontCascade::getGlyphsAndAdvancesForComplexText):
3754         * platform/graphics/mac/ComplexTextController.cpp:
3755         (WebCore::ComplexTextController::ComplexTextController):
3756         (WebCore::ComplexTextController::offsetForPosition):
3757         (WebCore::ComplexTextController::collectComplexTextRuns):
3758         (WebCore::ComplexTextController::ComplexTextRun::setIsNonMonotonic):
3759         (WebCore::ComplexTextController::runWidthSoFarFraction):
3760         (WebCore::ComplexTextController::advance):
3761         (WebCore::ComplexTextController::adjustGlyphsAndAdvances):
3762         * platform/graphics/mac/ComplexTextController.h:
3763         (WebCore::ComplexTextController::ComplexTextRun::create):
3764         (WebCore::ComplexTextController::ComplexTextRun::baseAdvances):
3765         (WebCore::ComplexTextController::ComplexTextRun::glyphOrigins):
3766         (WebCore::ComplexTextController::useLayoutSpecificAdvances):
3767         (WebCore::ComplexTextController::finalRoundingWidth): Deleted.
3768         (WebCore::ComplexTextController::ComplexTextRun::advances): Deleted.
3769         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
3770         (SOFT_LINK):
3771         (WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun):
3772         (WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
3773         * platform/spi/cocoa/CoreTextSPI.h:
3774
3775 2016-09-02  Chris Dumez  <cdumez@apple.com>
3776
3777         Unreviewed, roll out r205354 because it caused JSC test failures
3778
3779         * bindings/js/JSDOMWindowBase.cpp:
3780         (WebCore::shouldAllowAccessFrom):
3781         * bindings/js/JSDOMWindowCustom.cpp:
3782         (WebCore::JSDOMWindow::preventExtensions): Deleted.
3783         (WebCore::JSDOMWindow::setLocation): Deleted.
3784         * bindings/js/JSLocationCustom.cpp:
3785         (WebCore::JSLocation::preventExtensions): Deleted.
3786         (WebCore::JSLocationPrototype::putDelegate): Deleted.
3787         (WebCore::JSLocationPrototype::defineOwnProperty): Deleted.
3788         * bindings/js/JSWorkerGlobalScopeBase.cpp:
3789         (WebCore::JSWorkerGlobalScopeBase::allowsAccessFrom):
3790         * bindings/js/JSWorkerGlobalScopeBase.h:
3791         * bindings/scripts/CodeGeneratorJS.pm:
3792         (GenerateHeader):
3793         * bindings/scripts/IDLAttributes.txt:
3794         * page/DOMWindow.idl:
3795         * page/Location.idl:
3796
3797 2016-09-02  Joseph Pecoraro  <pecoraro@apple.com>
3798
3799         Web Inspector: Provide a way to open an inspector frontend for a remote target
3800         https://bugs.webkit.org/show_bug.cgi?id=161515
3801         <rdar://problem/13182127>
3802
3803         Reviewed by Brian Burg.
3804
3805         Previously WebKit inspector frontend clients could only
3806         create a frontend for a web page with the latest protocol.
3807         Now it may create a frontend for a "javascript" or "web"
3808         debuggable that may be current or an older protocol.
3809
3810         The frontend already supports these configurations by
3811         checking and calling InspectorFrontendHost methods
3812         that may or may not have existed previously:
3813
3814         - debuggableType was always "web" but frontend supports "javascript"
3815         - inspectorBackendCommandsURLs was absent so the frontend used the most current
3816             - rename this to backendCommandsURL
3817         
3818         Formalize the methods and have them delegate to the
3819         frontend client opening the frontend.
3820
3821         * inspector/InspectorFrontendClient.h:
3822         (WebCore::InspectorFrontendClient::backendCommandsURL):
3823         (WebCore::InspectorFrontendClient::debuggableType):
3824         * inspector/InspectorFrontendHost.cpp:
3825         (WebCore::InspectorFrontendHost::localizedStringsURL):
3826         (WebCore::InspectorFrontendHost::backendCommandsURL):
3827         (WebCore::InspectorFrontendHost::debuggableType):
3828         * inspector/InspectorFrontendHost.h:
3829         * inspector/InspectorFrontendHost.idl:
3830         Formalize and give default values to InspectorFrontentHost methods.
3831
3832 2016-09-02  Dave Hyatt  <hyatt@apple.com>
3833
3834         Add support for media query parsing using new CSS Parser
3835         https://bugs.webkit.org/show_bug.cgi?id=161537
3836
3837         Reviewed by Dean Jackson.
3838
3839         * CMakeLists.txt:
3840         * WebCore.xcodeproj/project.pbxproj:
3841         * css/MediaQueryExp.cpp:
3842         (WebCore::featureWithValidIdent):
3843         (WebCore::featureWithValidDensity):
3844         (WebCore::featureWithValidPositiveLength):
3845         (WebCore::featureWithPositiveInteger):
3846         (WebCore::featureWithPositiveNumber):
3847         (WebCore::featureWithZeroOrOne):
3848         (WebCore::isFeatureValidWithIdentifier):
3849         (WebCore::MediaQueryExpression::MediaQueryExpression):
3850         * css/MediaQueryExp.h:
3851         * css/parser/CSSParserIdioms.cpp: Added.
3852         (WebCore::convertToASCIILowercaseInPlace):
3853         * css/parser/CSSParserIdioms.h:
3854         * css/parser/CSSParserToken.cpp:
3855         (WebCore::convertToASCIILowercaseInPlace):
3856         * css/parser/MediaQueryBlockWatcher.cpp: Added.
3857         (WebCore::MediaQueryBlockWatcher::MediaQueryBlockWatcher):
3858         (WebCore::MediaQueryBlockWatcher::handleToken):
3859         * css/parser/MediaQueryBlockWatcher.h: Added.
3860         (WebCore::MediaQueryBlockWatcher::blockLevel):
3861         * css/parser/MediaQueryParser.cpp: Added.
3862         (WebCore::MediaQueryParser::parseMediaQuerySet):
3863         (WebCore::MediaQueryParser::parseMediaCondition):
3864         (WebCore::MediaQueryParser::MediaQueryParser):
3865         (WebCore::MediaQueryParser::~MediaQueryParser):
3866         (WebCore::MediaQueryParser::setStateAndRestrict):
3867         (WebCore::MediaQueryParser::readRestrictor):
3868         (WebCore::MediaQueryParser::readMediaNot):
3869         (WebCore::isRestrictorOrLogicalOperator):
3870         (WebCore::MediaQueryParser::readMediaType):
3871         (WebCore::MediaQueryParser::commitMediaQuery):
3872         (WebCore::MediaQueryParser::readAnd):
3873         (WebCore::MediaQueryParser::readFeatureStart):
3874         (WebCore::MediaQueryParser::readFeature):
3875         (WebCore::MediaQueryParser::readFeatureColon):
3876         (WebCore::MediaQueryParser::readFeatureValue):
3877         (WebCore::MediaQueryParser::readFeatureEnd):
3878         (WebCore::MediaQueryParser::skipUntilComma):
3879         (WebCore::MediaQueryParser::skipUntilBlockEnd):
3880         (WebCore::MediaQueryParser::done):
3881         (WebCore::MediaQueryParser::handleBlocks):
3882         (WebCore::MediaQueryParser::processToken):
3883         (WebCore::MediaQueryParser::parseInternal):
3884         (WebCore::MediaQueryData::MediaQueryData):
3885         (WebCore::MediaQueryData::clear):
3886         (WebCore::MediaQueryData::addExpression):
3887         (WebCore::MediaQueryData::tryAddParserToken):
3888         (WebCore::MediaQueryData::setMediaType):
3889         * css/parser/MediaQueryParser.h: Added.
3890         (WebCore::MediaQueryData::restrictor):
3891         (WebCore::MediaQueryData::expressions):
3892         (WebCore::MediaQueryData::mediaType):
3893         (WebCore::MediaQueryData::currentMediaQueryChanged):
3894         (WebCore::MediaQueryData::setRestrictor):
3895         (WebCore::MediaQueryData::setMediaFeature):
3896
3897 2016-07-08  Jer Noble  <jer.noble@apple.com>
3898
3899         Refactor WebPlaybackSessionModelMediaElement to be client based.
3900         https://bugs.webkit.org/show_bug.cgi?id=159580
3901
3902         Reviewed by Eric Carlson.
3903
3904         Add client callback interfaces to both WebPlaybackSessionModel and WebVideoFullscreenModel, where each object
3905         can have multiple clients, and so the object will both store current values and also notify those clients
3906         when the values change. After this change, there is no need to have the models know about their associated
3907         interfaces explicitly.
3908
3909         * platform/cocoa/WebPlaybackSessionInterface.h:
3910         * platform/cocoa/WebPlaybackSessionModel.h:
3911         (WebCore::WebPlaybackSessionModelClient::~WebPlaybackSessionModelClient):
3912         (WebCore::WebPlaybackSessionModelClient::durationChanged):
3913         (WebCore::WebPlaybackSessionModelClient::currentTimeChanged):
3914         (WebCore::WebPlaybackSessionModelClient::bufferedTimeChanged):
3915         (WebCore::WebPlaybackSessionModelClient::rateChanged):
3916         (WebCore::WebPlaybackSessionModelClient::seekableRangesChanged):
3917         (WebCore::WebPlaybackSessionModelClient::canPlayFastReverseChanged):
3918         (WebCore::WebPlaybackSessionModelClient::audioMediaSelectionOptionsChanged):
3919         (WebCore::WebPlaybackSessionModelClient::legibleMediaSelectionOptionsChanged):
3920         (WebCore::WebPlaybackSessionModelClient::externalPlaybackChanged):
3921         (WebCore::WebPlaybackSessionModelClient::wirelessVideoPlaybackDisabledChanged):
3922         * platform/cocoa/WebPlaybackSessionModelMediaElement.h:
3923         * platform/cocoa/WebPlaybackSessionModelMediaElement.mm:
3924         (WebPlaybackSessionModelMediaElement::setMediaElement):
3925         (WebPlaybackSessionModelMediaElement::updateForEventName):
3926         (WebPlaybackSessionModelMediaElement::addClient):
3927         (WebPlaybackSessionModelMediaElement::removeClient):
3928         (WebPlaybackSessionModelMediaElement::updateLegibleOptions):
3929         (WebPlaybackSessionModelMediaElement::observedEventNames):
3930         (WebPlaybackSessionModelMediaElement::eventNameAll):
3931         (WebPlaybackSessionModelMediaElement::audioMediaSelectionOptions):
3932         (WebPlaybackSessionModelMediaElement::audioMediaSelectedIndex):
3933         (WebPlaybackSessionModelMediaElement::legibleMediaSelectedIndex):
3934         (WebPlaybackSessionModelMediaElement::externalPlaybackEnabled):
3935         (WebPlaybackSessionModelMediaElement::externalPlaybackTargetType):
3936         (WebPlaybackSessionModelMediaElement::externalPlaybackLocalizedDeviceName):
3937         (WebPlaybackSessionModelMediaElement::wirelessVideoPlaybackDisabled):
3938         (WebPlaybackSessionModelMediaElement::setWebPlaybackSessionInterface): Deleted.
3939         * platform/cocoa/WebVideoFullscreenInterface.h:
3940         * platform/cocoa/WebVideoFullscreenModel.h:
3941         (WebCore::WebVideoFullscreenModelClient::~WebVideoFullscreenModelClient):
3942         * platform/cocoa/WebVideoFullscreenModelVideoElement.h:
3943         (WebCore::WebVideoFullscreenModelVideoElement::create):
3944         (WebCore::WebVideoFullscreenModelVideoElement::playbackSessionModel): Deleted.
3945         * platform/cocoa/WebVideoFullscreenModelVideoElement.mm:
3946         (WebVideoFullscreenModelVideoElement::WebVideoFullscreenModelVideoElement):
3947         (WebVideoFullscreenModelVideoElement::setVideoElement):
3948         (WebVideoFullscreenModelVideoElement::updateForEventName):
3949         (WebVideoFullscreenModelVideoElement::addClient):
3950         (WebVideoFullscreenModelVideoElement::removeClient):
3951         (WebVideoFullscreenModelVideoElement::setHasVideo):
3952         (WebVideoFullscreenModelVideoElement::setVideoDimensions):
3953         (WebVideoFullscreenModelVideoElement::setWebVideoFullscreenInterface): Deleted.
3954         * platform/ios/WebAVPlayerController.h:
3955         * platform/ios/WebAVPlayerController.mm:
3956         (-[WebAVPlayerController resetState]): Deleted.
3957         * platform/ios/WebPlaybackSessionInterfaceAVKit.h:
3958         (WebCore::WebPlaybackSessionInterfaceAVKitClient::~WebPlaybackSessionInterfaceAVKitClient): Deleted.
3959         * platform/ios/WebPlaybackSessionInterfaceAVKit.mm:
3960         (WebCore::WebPlaybackSessionInterfaceAVKit::WebPlaybackSessionInterfaceAVKit):
3961         (WebCore::WebPlaybackSessionInterfaceAVKit::~WebPlaybackSessionInterfaceAVKit):
3962         (WebCore::WebPlaybackSessionInterfaceAVKit::resetMediaState):
3963         (WebCore::WebPlaybackSessionInterfaceAVKit::durationChanged):
3964         (WebCore::WebPlaybackSessionInterfaceAVKit::currentTimeChanged):
3965         (WebCore::WebPlaybackSessionInterfaceAVKit::bufferedTimeChanged):
3966         (WebCore::WebPlaybackSessionInterfaceAVKit::rateChanged):
3967         (WebCore::WebPlaybackSessionInterfaceAVKit::seekableRangesChanged):
3968         (WebCore::WebPlaybackSessionInterfaceAVKit::canPlayFastReverseChanged):
3969         (WebCore::WebPlaybackSessionInterfaceAVKit::audioMediaSelectionOptionsChanged):
3970         (WebCore::WebPlaybackSessionInterfaceAVKit::legibleMediaSelectionOptionsChanged):
3971         (WebCore::WebPlaybackSessionInterfaceAVKit::externalPlaybackChanged):
3972         (WebCore::WebPlaybackSessionInterfaceAVKit::wirelessVideoPlaybackDisabledChanged):
3973         (WebCore::WebPlaybackSessionInterfaceAVKit::invalidate):
3974         (WebCore::WebPlaybackSessionInterfaceAVKit::setWebPlaybackSessionModel): Deleted.
3975         (WebCore::WebPlaybackSessionInterfaceAVKit::setDuration): Deleted.
3976         (WebCore::WebPlaybackSessionInterfaceAVKit::setCurrentTime): Deleted.
3977         (WebCore::WebPlaybackSessionInterfaceAVKit::setBufferedTime): Deleted.
3978         (WebCore::WebPlaybackSessionInterfaceAVKit::setRate): Deleted.
3979         (WebCore::WebPlaybackSessionInterfaceAVKit::setSeekableRanges): Deleted.
3980         (WebCore::WebPlaybackSessionInterfaceAVKit::setCanPlayFastReverse): Deleted.
3981         (WebCore::WebPlaybackSessionInterfaceAVKit::setAudioMediaSelectionOptions): Deleted.
3982         (WebCore::WebPlaybackSessionInterfaceAVKit::setLegibleMediaSelectionOptions): Deleted.
3983         (WebCore::WebPlaybackSessionInterfaceAVKit::setExternalPlayback): Deleted.
3984         (WebCore::WebPlaybackSessionInterfaceAVKit::setWirelessVideoPlaybackDisabled): Deleted.
3985         (WebCore::WebPlaybackSessionInterfaceAVKit::wirelessVideoPlaybackDisabled): Deleted.
3986         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
3987         (WebVideoFullscreenControllerContext::didSetupFullscreen):
3988         (WebVideoFullscreenControllerContext::didExitFullscreen):
3989         (WebVideoFullscreenControllerContext::didCleanupFullscreen):
3990         (WebVideoFullscreenControllerContext::durationChanged):
3991         (WebVideoFullscreenControllerContext::currentTimeChanged):
3992         (WebVideoFullscreenControllerContext::bufferedTimeChanged):
3993         (WebVideoFullscreenControllerContext::rateChanged):
3994         (WebVideoFullscreenControllerContext::hasVideoChanged):
3995         (WebVideoFullscreenControllerContext::videoDimensionsChanged):
3996         (WebVideoFullscreenControllerContext::seekableRangesChanged):
3997         (WebVideoFullscreenControllerContext::canPlayFastReverseChanged):
3998         (WebVideoFullscreenControllerContext::audioMediaSelectionOptionsChanged):
3999         (WebVideoFullscreenControllerContext::legibleMediaSelectionOptionsChanged):
4000         (WebVideoFullscreenControllerContext::externalPlaybackChanged):
4001         (WebVideoFullscreenControllerContext::wirelessVideoPlaybackDisabledChanged):
4002         (WebVideoFullscreenControllerContext::addClient):
4003         (WebVideoFullscreenControllerContext::removeClient):
4004         (WebVideoFullscreenControllerContext::requestFullscreenMode):
4005         (WebVideoFullscreenControllerContext::setVideoLayerFrame):
4006         (WebVideoFullscreenControllerContext::setVideoLayerGravity):
4007         (WebVideoFullscreenControllerContext::fullscreenModeChanged):
4008         (WebVideoFullscreenControllerContext::isVisible):
4009         (WebVideoFullscreenControllerContext::hasVideo):
4010         (WebVideoFullscreenControllerContext::videoDimensions):
4011         (WebVideoFullscreenControllerContext::play):
4012         (WebVideoFullscreenControllerContext::pause):
4013         (WebVideoFullscreenControllerContext::togglePlayState):
4014         (WebVideoFullscreenControllerContext::beginScrubbing):
4015         (WebVideoFullscreenControllerContext::endScrubbing):
4016         (WebVideoFullscreenControllerContext::seekToTime):
4017         (WebVideoFullscreenControllerContext::fastSeek):
4018         (WebVideoFullscreenControllerContext::beginScanningForward):
4019         (WebVideoFullscreenControllerContext::beginScanningBackward):
4020         (WebVideoFullscreenControllerContext::endScanning):
4021         (WebVideoFullscreenControllerContext::selectAudioMediaOption):
4022         (WebVideoFullscreenControllerContext::selectLegibleMediaOption):
4023         (WebVideoFullscreenControllerContext::duration):
4024         (WebVideoFullscreenControllerContext::currentTime):
4025         (WebVideoFullscreenControllerContext::bufferedTime):
4026         (WebVideoFullscreenControllerContext::isPlaying):
4027         (WebVideoFullscreenControllerContext::playbackRate):
4028         (WebVideoFullscreenControllerContext::seekableRanges):
4029         (WebVideoFullscreenControllerContext::canPlayFastReverse):
4030         (WebVideoFullscreenControllerContext::audioMediaSelectionOptions):
4031         (WebVideoFullscreenControllerContext::audioMediaSelectedIndex):
4032         (WebVideoFullscreenControllerContext::legibleMediaSelectionOptions):
4033         (WebVideoFullscreenControllerContext::legibleMediaSelectedIndex):
4034         (WebVideoFullscreenControllerContext::externalPlaybackEnabled):
4035         (WebVideoFullscreenControllerContext::externalPlaybackTargetType):
4036         (WebVideoFullscreenControllerContext::externalPlaybackLocalizedDeviceName):
4037         (WebVideoFullscreenControllerContext::wirelessVideoPlaybackDisabled):
4038         (WebVideoFullscreenControllerContext::setUpFullscreen):
4039         (WebVideoFullscreenControllerContext::exitFullscreen):
4040         (WebVideoFullscreenControllerContext::requestHideAndExitFullscreen):
4041         (WebVideoFullscreenControllerContext::resetMediaState): Deleted.
4042         (WebVideoFullscreenControllerContext::setDuration): Deleted.
4043         (WebVideoFullscreenControllerContext::setCurrentTime): Deleted.
4044         (WebVideoFullscreenControllerContext::setBufferedTime): Deleted.
4045         (WebVideoFullscreenControllerContext::setRate): Deleted.
4046         (WebVideoFullscreenControllerContext::setVideoDimensions): Deleted.
4047         (WebVideoFullscreenControllerContext::setSeekableRanges): Deleted.
4048         (WebVideoFullscreenControllerContext::setCanPlayFastReverse): Deleted.
4049         (WebVideoFullscreenControllerContext::setAudioMediaSelectionOptions): Deleted.
4050         (WebVideoFullscreenControllerContext::setLegibleMediaSelectionOptions): Deleted.
4051         (WebVideoFullscreenControllerContext::setExternalPlayback): Deleted.
4052       &nbs