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