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