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