[XHR] Cache response JS object in case of arraybuffer and blob response types
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2016-07-20  Youenn Fablet  <youenn@apple.com>
2
3         [XHR] Cache response JS object in case of arraybuffer and blob response types
4         https://bugs.webkit.org/show_bug.cgi?id=128903
5
6         Reviewed by Alex Christensen.
7
8         Covered by existing and modified tests.
9
10         Making response getter a JS builtin that caches response in @response private slot.
11         Handling invalidation of cached response with @responseCacheIsValid new private method.
12         Handling creation of cached response with @retrieveResponse new private method which reuses most of
13         JSXMLHttpRequest::response previous code.
14
15         Caching of responses is activated whenever load ended without any error for blob and arraybuffer response types.
16
17         Caching of response for document is also activated in case the response getter is used but not if responseXML getter is used.
18
19         * CMakeLists.txt: Adding XMLHttpRequest.js.
20         * DerivedSources.make: Ditto.
21         * bindings/js/JSXMLHttpRequestCustom.cpp:
22         (WebCore::JSXMLHttpRequest::retrieveResponse): Implements creation of to-be-cached response.
23         (WebCore::JSXMLHttpRequest::response): Deleted.
24         * bindings/js/WebCoreBuiltinNames.h: Adding new private names.
25         * xml/XMLHttpRequest.cpp:
26         (WebCore::XMLHttpRequest::didCacheResponse): Renamed from didCacheResponseJSON as all response types are now cached.
27         (WebCore::XMLHttpRequest::didCacheResponseJSON): Deleted.
28         * xml/XMLHttpRequest.h:
29         * xml/XMLHttpRequest.idl:
30
31 2016-07-20  Youenn Fablet  <youenn@apple.com>
32
33         Remove crossOriginRequestPolicy from ThreadableLoaderOptions
34         https://bugs.webkit.org/show_bug.cgi?id=159417
35
36         Reviewed by Alex Christensen.
37
38         No observable change.
39
40         * Modules/fetch/FetchLoader.cpp:
41         (WebCore::FetchLoader::start): DenyCrossOriginRequests -> FetchOptions::Mode::SameOrigin.
42         * fileapi/FileReaderLoader.cpp:
43         (WebCore::FileReaderLoader::start): DenyCrossOriginRequests -> FetchOptions::Mode::SameOrigin.
44         * inspector/InspectorNetworkAgent.cpp:
45         (WebCore::InspectorNetworkAgent::loadResource): AllowCrossOriginRequests -> FetchOptions::Mode::NoCors.
46         * loader/DocumentThreadableLoader.cpp:
47         (WebCore::DocumentThreadableLoader::DocumentThreadableLoader): Ditto.
48         (WebCore::DocumentThreadableLoader::makeCrossOriginAccessRequest): UseAccessControl -> FetchOptions::Mode::Cors.
49         (WebCore::DocumentThreadableLoader::redirectReceived): Ditto.
50         (WebCore::DocumentThreadableLoader::didReceiveResponse): Ditto.
51         (WebCore::DocumentThreadableLoader::loadRequest): Use NoCors as option passed to ResourceLoader. This allows
52         desactivating ResourceLoader CORS checks as they are done in DocumentThreadableLoader right now. In the future,
53         these checks should be moved to ResourceLoader and DocumentThreadableLoader should directly pass the fetch mode
54         option.
55         (WebCore::DocumentThreadableLoader::isAllowedRedirect): AllowCrossOriginRequests -> FetchOptions::Mode::NoCors.
56         * loader/ThreadableLoader.cpp:
57         (WebCore::ThreadableLoaderOptions::ThreadableLoaderOptions): Removing CrossOriginRequestPolicy.
58         * loader/ThreadableLoader.h: Ditto.
59         * loader/WorkerThreadableLoader.cpp:
60         (WebCore::LoaderTaskOptions::LoaderTaskOptions): Ditto.
61         * page/EventSource.cpp:
62         (WebCore::EventSource::connect): UseAccessControl -> FetchOptions::Mode::Cors.
63         * workers/Worker.cpp:
64         (WebCore::Worker::create): DenyCrossOriginRequests -> FetchOptions::Mode::SameOrigin.
65         * workers/WorkerGlobalScope.cpp:
66         (WebCore::WorkerGlobalScope::importScripts): AllowCrossOriginRequests -> FetchOptions::Mode::NoCors.
67         * workers/WorkerScriptLoader.cpp:
68         (WebCore::WorkerScriptLoader::loadSynchronously):
69         (WebCore::WorkerScriptLoader::loadAsynchronously):
70         * workers/WorkerScriptLoader.h:
71         * xml/XMLHttpRequest.cpp:
72         (WebCore::XMLHttpRequest::createRequest):
73
74 2016-07-20  Chris Dumez  <cdumez@apple.com>
75
76         Fix null handling of several Document attributes
77         https://bugs.webkit.org/show_bug.cgi?id=159997
78
79         Reviewed by Ryosuke Niwa.
80
81         Fix null handling of the following Document attributes: title, cookie
82         and domain.
83
84         In WebKit, they were all marked as [TreatNullAs=EmptyString], which
85         does not match the specification:
86         - https://html.spec.whatwg.org/multipage/dom.html#document
87
88         Details for each attribute:
89         - title: null is now treated as the string "null", thus setting the
90           document title to "null". This matches Firefox and Chrome.
91         - cookie: adds a "null" cookie instead of being a no-op. This matches
92                   both Firefox and Chrome.
93         - domain: Calls setDomain(String("null")) instead of
94                   setDomain(String()). This throws an exception because "null"
95                   is not a suffix of the effective domain name. The behavior
96                   is the same in Firefox and Chrome. Previously, we were
97                   already throwing an exception since setting the domain to
98                   the empty string throws, as per the specification.
99
100         Test: http/tests//dom/document-attributes-null-handling.html
101
102         * dom/Document.idl:
103
104 2016-07-20  Commit Queue  <commit-queue@webkit.org>
105
106         Unreviewed, rolling out r203471.
107         https://bugs.webkit.org/show_bug.cgi?id=160003
108
109         many iOS-simulator tests are failing (Requested by litherum on
110         #webkit).
111
112         Reverted changeset:
113
114         "[iPhone] Playing a video on tudou.com plays only sound, no
115         video"
116         https://bugs.webkit.org/show_bug.cgi?id=159967
117         http://trac.webkit.org/changeset/203471
118
119 2016-07-19  Ryosuke Niwa  <rniwa@webkit.org>
120
121         iOS: Cannot paste images in RTF content
122         https://bugs.webkit.org/show_bug.cgi?id=159964
123         <rdar://problem/27442806>
124
125         Reviewed by Enrica Casucci.
126
127         The bug was caused by setDefersLoading(true) not deferring image loading for the parsed fragment.
128         Worked around this bug by disabling image loading while parsing the document fragment.
129
130         * editing/ios/EditorIOS.mm:
131         (WebCore::Editor::createFragmentAndAddResources):
132
133 2016-07-20  Brady Eidson  <beidson@apple.com>
134
135         Address a small FIXME in IDB code.
136         https://bugs.webkit.org/show_bug.cgi?id=159999
137
138         Reviewed by Andy Estes.
139
140         No new tests (No behavior change).
141
142         * Modules/indexeddb/IDBRequest.cpp:
143         (WebCore::IDBRequest::IDBRequest):
144         
145         * Modules/indexeddb/shared/IDBResourceIdentifier.cpp:
146         (WebCore::IDBResourceIdentifier::IDBResourceIdentifier): Deleted.
147         * Modules/indexeddb/shared/IDBResourceIdentifier.h:
148
149 2016-07-20  Brady Eidson  <beidson@apple.com>
150
151         Remove some "modernFoo"s from IndexedDB code.
152         https://bugs.webkit.org/show_bug.cgi?id=159985
153
154         Reviewed by Andy Estes.
155
156         No new tests (No known behavior change).
157
158         * Modules/indexeddb/IDBCursor.cpp:
159         (WebCore::IDBCursor::IDBCursor):
160         (WebCore::IDBCursor::~IDBCursor):
161         (WebCore::IDBCursor::sourcesDeleted):
162         (WebCore::IDBCursor::effectiveObjectStore):
163         (WebCore::IDBCursor::transaction):
164         (WebCore::IDBCursor::direction):
165         (WebCore::IDBCursor::update):
166         (WebCore::IDBCursor::advance):
167         (WebCore::IDBCursor::continueFunction):
168         (WebCore::IDBCursor::uncheckedIterateCursor):
169         (WebCore::IDBCursor::deleteFunction):
170         (WebCore::IDBCursor::setGetResult):
171         
172         * Modules/indexeddb/IDBIndex.cpp:
173         (WebCore::IDBIndex::IDBIndex):
174         (WebCore::IDBIndex::~IDBIndex):
175         (WebCore::IDBIndex::hasPendingActivity):
176         (WebCore::IDBIndex::name):
177         (WebCore::IDBIndex::objectStore):
178         (WebCore::IDBIndex::keyPath):
179         (WebCore::IDBIndex::unique):
180         (WebCore::IDBIndex::multiEntry):
181         (WebCore::IDBIndex::openCursor):
182         (WebCore::IDBIndex::doCount):
183         (WebCore::IDBIndex::openKeyCursor):
184         (WebCore::IDBIndex::doGet):
185         (WebCore::IDBIndex::doGetKey):
186         (WebCore::IDBIndex::markAsDeleted):
187         * Modules/indexeddb/IDBIndex.h:
188         
189         * Modules/indexeddb/IDBObjectStore.cpp:
190         (WebCore::IDBObjectStore::transaction):
191         (WebCore::IDBObjectStore::deleteFunction): Deleted.
192         (WebCore::IDBObjectStore::modernDelete): Deleted.
193         * Modules/indexeddb/IDBObjectStore.h:
194         
195         * bindings/js/JSIDBIndexCustom.cpp:
196         (WebCore::JSIDBIndex::visitAdditionalChildren):
197
198 2016-07-20  Chris Dumez  <cdumez@apple.com>
199
200         Stop using valueToStringWithNullCheck() in JSCSSStyleDeclaration::putDelegate()
201         https://bugs.webkit.org/show_bug.cgi?id=159982
202
203         Reviewed by Ryosuke Niwa.
204
205         valueToStringWithNullCheck() treats null as the null String() which is
206         legacy / non standard behavior. The specification says we should treat
207         null as the empty string:
208         - https://drafts.csswg.org/cssom/#dom-cssstyledeclaration-camel-cased-attribute
209
210         Therefore, we should be using valueToStringTreatingNullAsEmptyString() instead.
211
212         In practice, there is no web-exposed behavior change because
213         MutableStyleProperties::setProperty() removes the property wether the
214         value is the null String or the empty String.
215
216         This behavior is correct since the specification says that we should
217         remove the property if the value is the empty string:
218         - https://drafts.csswg.org/cssom/#dom-cssstyledeclaration-setproperty (step 4)
219
220         I added test coverage to make sure we behave according to specification.
221         This test is passing in Firefox, Chrome and in WebKit (before and after
222         my change).
223
224         Test: fast/css/CSSStyleDeclaration-property-setter.html
225
226         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
227         (WebCore::JSCSSStyleDeclaration::putDelegate):
228
229 2016-07-20  Chris Dumez  <cdumez@apple.com>
230
231         Fix null handling of HTMLFrameElement.marginWidth / marginHeight
232         https://bugs.webkit.org/show_bug.cgi?id=159987
233
234         Reviewed by Ryosuke Niwa.
235
236         Fix null handling of HTMLFrameElement.marginWidth / marginHeight:
237         - https://html.spec.whatwg.org/multipage/obsolete.html#htmlframeelement
238
239         We are supposed to treat null as the empty string but we treat it as
240         the string "null".
241
242         Firefox and Chrome both match the specification.
243
244         No new tests, updated existing tests.
245
246         * html/HTMLFrameElement.idl:
247
248 2016-07-20  Wenson Hsieh  <wenson_hsieh@apple.com>
249
250         Pausing autoplayed media should not remove all restrictions for that media element
251         https://bugs.webkit.org/show_bug.cgi?id=159988
252
253         Reviewed by Jon Lee.
254
255         Localizes the removal of behavior restrictions introduced in r203464 upon pausing an
256         autoplaying video to just affect the hiding or showing of the media controller. This
257         prevents pages from using Javascript to start playing autoplaying videos that have
258         been paused by the user.
259
260         * html/HTMLMediaElement.cpp:
261         (WebCore::HTMLMediaElement::pause):
262
263 2016-07-20  Myles C. Maxfield  <mmaxfield@apple.com>
264
265         [iPhone] Playing a video on tudou.com plays only sound, no video
266         https://bugs.webkit.org/show_bug.cgi?id=159967
267         <rdar://problem/26964090>
268
269         Reviewed by Jon Lee.
270
271         WebKit recently starting honoring the playsinline and webkit-playsinline
272         attribute on iPhones. However, because these attributes previously did
273         nothing, some sites (such as Todou) were setting them on their content
274         and expecting that they are not honored. In this specific case, the
275         video is absolutely positioned to be 1 pixel x 1 pixel.
276
277         Previously, with iOS 9, apps could set the allowsInlineMediaPlayback
278         property on their WKWebView, which would honor the webkit-playsinline
279         attribute. Safari on iPhones didn't do this.
280
281         In order to not break these existing apps, it's important that the
282         allowsInlineMediaPlayback preference still allows webkit-playsinline
283         videos to play inline in apps using WKWebView. However, in Safari, these
284         videos should play fullscreen. (Todou videos have webkit-playsinline
285         but not playsinline.)
286
287         Therefore, in Safari, videos with playsinline should be inline, but
288         videos with webkit-playsinline should be fullscreen. In apps using
289         WKWebViews, if the app sets allowsInlineMediaPlayback, then videos with
290         playsinline should be inline, and videos with webkit-playsinline should
291         also be inline. Videos on iPad and Mac should all be inline by default.
292
293         We can create some truth tables for the cases which need to be covered:
294
295         All apps on Mac / iPad:
296         Presence of playsinline | Presence of webkit-playsinline | Result
297         ========================|================================|===========
298         Not present             | Not present                    | Inline
299         Present                 | Not present                    | Inline
300         Not Present             | Present                        | Inline
301         Present                 | Present                        | Inline
302
303         Safari on iPhone:
304         Presence of playsinline | Presence of webkit-playsinline | Result
305         ========================|================================|===========
306         Not present             | Not present                    | Fullscreen
307         Present                 | Not present                    | Inline
308         Not Present             | Present                        | Fullscreen
309         Present                 | Present                        | Inline
310
311         App on iPhone which sets allowsInlineMediaPlayback:
312         Presence of playsinline | Presence of webkit-playsinline | Result
313         ========================|================================|===========
314         Not present             | Not present                    | Fullscreen
315         Present                 | Not present                    | Inline
316         Not Present             | Present                        | Inline
317         Present                 | Present                        | Inline
318
319         The way to distinguish Safari from another app is to create an SPI
320         boolean preference which Safari can set. This is already how the
321         iPhone and iPad are differentiated using the requiresPlayInlineAttribute
322         which Safari sets but other apps don't. However, this preference is
323         no longer sufficient because Safari should now be discriminating
324         between the playsinline and webkit-playsinline attributes. Therefore,
325         this preference should be extended to two boolean preferences, which
326         this patch adds:
327
328         allowsInlineMediaPlaybackWithPlaysInlineAttribute
329         allowsInlineMediaPlaybackWithWebKitPlaysInlineAttribute
330
331         Safari on iPhone will set
332         allowsInlineMediaPlaybackWithWebKitPlaysInlineAttribute to true,
333         and allowsInlineMediaPlaybackWithWebKitPlaysInlineAttribute to
334         false. Other apps on iPhone will get their defaults values (because they
335         are SPI) which means they will both be true. On iPad and Mac, apps will
336         use the defaults values where both are false.
337
338         This patch adds support for these two preferences, but does not remove
339         the existing inlineMediaPlaybackRequiresPlaysInlineAttribute preference.
340         I will remove the exising preference as soon as I update Safari to migrate
341         off of it.
342
343         Test: media/video-playsinline.html
344
345         * html/MediaElementSession.cpp:
346         (WebCore::MediaElementSession::requiresFullscreenForVideoPlayback):
347         * page/Settings.cpp:
348         * page/Settings.in:
349         * testing/InternalSettings.cpp:
350         (WebCore::InternalSettings::Backup::Backup):
351         (WebCore::InternalSettings::Backup::restoreTo):
352         (WebCore::InternalSettings::setAllowsInlineMediaPlaybackWithPlaysInlineAttribute):
353         (WebCore::InternalSettings::setAllowsInlineMediaPlaybackWithWebKitPlaysInlineAttribute):
354         * testing/InternalSettings.h:
355         * testing/InternalSettings.idl:
356
357 2016-07-20  Chris Dumez  <cdumez@apple.com>
358
359         Get rid of custom bindings code for XMLHttpRequest.open()
360         https://bugs.webkit.org/show_bug.cgi?id=159984
361
362         Reviewed by Ryosuke Niwa.
363
364         Get rid of custom bindings code for XMLHttpRequest.open() as the
365         bindings generator is able to generate it.
366
367         Relevant specification:
368         - https://xhr.spec.whatwg.org/#xmlhttprequest
369
370         The issue is that legacy content prevents treating the 'async' argument
371         being undefined identical from it being omitted. However, this can be
372         achieved by using overloading in IDL, like in the specification.
373
374         No new tests, already covered by the following tests:
375         - http/tests/xmlhttprequest/basic-auth.html
376         - http/tests/xmlhttprequest/open-async-overload.html
377
378         * bindings/js/JSXMLHttpRequestCustom.cpp:
379         (WebCore::SendFunctor::SendFunctor): Deleted.
380         (WebCore::SendFunctor::line): Deleted.
381         (WebCore::SendFunctor::column): Deleted.
382         (WebCore::SendFunctor::url): Deleted.
383         (WebCore::SendFunctor::operator()): Deleted.
384         * xml/XMLHttpRequest.cpp:
385         (WebCore::XMLHttpRequest::open):
386         * xml/XMLHttpRequest.h:
387         * xml/XMLHttpRequest.idl:
388
389 2016-07-20  Rawinder Singh  <rawinder.singh-webkit@cisra.canon.com.au>
390
391         Mark overriden methods in WebCore/svg final classes as final
392         https://bugs.webkit.org/show_bug.cgi?id=159966
393
394         Reviewed by Michael Catanzaro.
395
396         Update WebCore/svg classes so that overriden methods in final classes are marked final.
397
398         * svg/SVGAElement.h:
399         * svg/SVGAltGlyphDefElement.h:
400         * svg/SVGAltGlyphItemElement.h:
401         * svg/SVGAnimateTransformElement.h:
402         * svg/SVGAnimatedColor.h:
403         * svg/SVGCircleElement.h:
404         * svg/SVGClipPathElement.h:
405         * svg/SVGCursorElement.h:
406         * svg/SVGDefsElement.h:
407         * svg/SVGDescElement.h:
408         * svg/SVGEllipseElement.h:
409         * svg/SVGFEMergeNodeElement.h:
410         * svg/SVGFilterElement.h:
411         * svg/SVGFontElement.h:
412         * svg/SVGFontFaceElement.h:
413         * svg/SVGFontFaceFormatElement.h:
414         * svg/SVGFontFaceNameElement.h:
415         * svg/SVGFontFaceSrcElement.h:
416         * svg/SVGFontFaceUriElement.h:
417         * svg/SVGForeignObjectElement.h:
418         * svg/SVGGElement.h:
419         * svg/SVGGlyphElement.h:
420         * svg/SVGGlyphRefElement.h:
421         * svg/SVGHKernElement.h:
422         * svg/SVGImageElement.h:
423         * svg/SVGLineElement.h:
424         * svg/SVGMPathElement.h:
425         * svg/SVGMaskElement.h:
426         * svg/SVGMetadataElement.h:
427         * svg/SVGMissingGlyphElement.h:
428         * svg/SVGPathBuilder.h:
429         * svg/SVGPathByteStreamBuilder.h:
430         * svg/SVGPathByteStreamSource.h:
431         * svg/SVGPathElement.h:
432         * svg/SVGPathSegArcAbs.h:
433         * svg/SVGPathSegArcRel.h:
434         * svg/SVGPathSegClosePath.h:
435         * svg/SVGPathSegCurvetoCubicAbs.h:
436         * svg/SVGPathSegCurvetoCubicRel.h:
437         * svg/SVGPathSegCurvetoCubicSmoothAbs.h:
438         * svg/SVGPathSegCurvetoCubicSmoothRel.h:
439         * svg/SVGPathSegCurvetoQuadraticAbs.h:
440         * svg/SVGPathSegCurvetoQuadraticRel.h:
441         * svg/SVGPathSegCurvetoQuadraticSmoothAbs.h:
442         * svg/SVGPathSegCurvetoQuadraticSmoothRel.h:
443         * svg/SVGPathSegLinetoAbs.h:
444         * svg/SVGPathSegLinetoHorizontalAbs.h:
445         * svg/SVGPathSegLinetoHorizontalRel.h:
446         * svg/SVGPathSegLinetoRel.h:
447         * svg/SVGPathSegLinetoVerticalAbs.h:
448         * svg/SVGPathSegLinetoVerticalRel.h:
449         * svg/SVGPathSegListBuilder.h:
450         * svg/SVGPathSegListSource.h:
451         * svg/SVGPathSegMovetoAbs.h:
452         * svg/SVGPathSegMovetoRel.h:
453         * svg/SVGPathStringSource.h:
454         * svg/SVGPathTraversalStateBuilder.h:
455         * svg/SVGPatternElement.h:
456         * svg/SVGRectElement.h:
457         * svg/SVGScriptElement.h:
458         * svg/SVGStopElement.h:
459         * svg/SVGStyleElement.h:
460         * svg/SVGSwitchElement.h:
461         * svg/SVGTRefElement.cpp:
462         * svg/SVGTitleElement.h:
463         * svg/SVGToOTFFontConversion.cpp:
464         * svg/SVGUnknownElement.h:
465         * svg/SVGVKernElement.h:
466         * svg/SVGViewElement.h:
467         * svg/SVGZoomEvent.h:
468         * svg/animation/SVGSMILElement.cpp:
469         * svg/graphics/SVGImage.h:
470         * svg/graphics/SVGImageClients.h:
471         * svg/graphics/SVGImageForContainer.h:
472         * svg/graphics/filters/SVGFEImage.h:
473         * svg/graphics/filters/SVGFilter.h:
474         * svg/properties/SVGAnimatedEnumerationPropertyTearOff.h:
475         * svg/properties/SVGAnimatedPathSegListPropertyTearOff.h:
476         * svg/properties/SVGAnimatedPropertyTearOff.h:
477         * svg/properties/SVGAnimatedTransformListPropertyTearOff.h:
478         * svg/properties/SVGMatrixTearOff.h:
479         * svg/properties/SVGPathSegListPropertyTearOff.h:
480
481 2016-07-20  Brady Eidson  <beidson@apple.com>
482
483         Transition most IDB interfaces from ScriptExecutionContext to ExecState.
484         https://bugs.webkit.org/show_bug.cgi?id=159975
485
486         Reviewed by Alex Christensen.
487
488         No new tests (No known behavior change).
489
490         * Modules/indexeddb/IDBCursor.cpp:
491         (WebCore::IDBCursor::continueFunction):
492         (WebCore::IDBCursor::deleteFunction):
493         * Modules/indexeddb/IDBCursor.h:
494         * Modules/indexeddb/IDBCursor.idl:
495
496         * Modules/indexeddb/IDBDatabase.idl:
497
498         * Modules/indexeddb/IDBFactory.cpp:
499         (WebCore::IDBFactory::cmp):
500         * Modules/indexeddb/IDBFactory.h:
501         * Modules/indexeddb/IDBFactory.idl:
502
503         * Modules/indexeddb/IDBIndex.cpp:
504         (WebCore::IDBIndex::openCursor):
505         (WebCore::IDBIndex::count):
506         (WebCore::IDBIndex::doCount):
507         (WebCore::IDBIndex::openKeyCursor):
508         (WebCore::IDBIndex::get):
509         (WebCore::IDBIndex::doGet):
510         (WebCore::IDBIndex::getKey):
511         (WebCore::IDBIndex::doGetKey):
512         * Modules/indexeddb/IDBIndex.h:
513         * Modules/indexeddb/IDBIndex.idl:
514
515         * Modules/indexeddb/IDBKeyRange.cpp:
516         (WebCore::IDBKeyRange::only): Deleted.
517         * Modules/indexeddb/IDBKeyRange.h:
518
519         * Modules/indexeddb/IDBObjectStore.cpp:
520         (WebCore::IDBObjectStore::openCursor):
521         (WebCore::IDBObjectStore::get):
522         (WebCore::IDBObjectStore::putOrAdd):
523         (WebCore::IDBObjectStore::deleteFunction):
524         (WebCore::IDBObjectStore::doDelete):
525         (WebCore::IDBObjectStore::modernDelete):
526         (WebCore::IDBObjectStore::clear):
527         (WebCore::IDBObjectStore::createIndex):
528         (WebCore::IDBObjectStore::count):
529         (WebCore::IDBObjectStore::doCount):
530         * Modules/indexeddb/IDBObjectStore.h:
531         * Modules/indexeddb/IDBObjectStore.idl:
532
533         * Modules/indexeddb/IDBTransaction.cpp:
534         (WebCore::IDBTransaction::requestOpenCursor):
535         (WebCore::IDBTransaction::doRequestOpenCursor):
536         (WebCore::IDBTransaction::requestGetRecord):
537         (WebCore::IDBTransaction::requestGetValue):
538         (WebCore::IDBTransaction::requestGetKey):
539         (WebCore::IDBTransaction::requestIndexRecord):
540         (WebCore::IDBTransaction::requestCount):
541         (WebCore::IDBTransaction::requestDeleteRecord):
542         (WebCore::IDBTransaction::requestClearObjectStore):
543         (WebCore::IDBTransaction::requestPutOrAdd):
544         * Modules/indexeddb/IDBTransaction.h:
545
546         * inspector/InspectorIndexedDBAgent.cpp:
547
548 2016-07-20  Wenson Hsieh  <wenson_hsieh@apple.com>
549
550         Media controls don't appear when pausing a small autoplaying video
551         https://bugs.webkit.org/show_bug.cgi?id=159972
552         <rdar://problem/27180657>
553
554         Reviewed by Beth Dakin.
555
556         When pausing an autoplaying video, remove behavior restrictions for the
557         initial user gesture and show media controls.
558
559         New WebKit API test. See VideoControlsManagerSingleSmallAutoplayingVideo.
560
561         * html/HTMLMediaElement.cpp:
562         (WebCore::HTMLMediaElement::pause):
563
564 2016-07-20  Chris Dumez  <cdumez@apple.com>
565
566         Fix null handling of HTMLMediaElement.mediaGroup
567         https://bugs.webkit.org/show_bug.cgi?id=159974
568
569         Reviewed by Eric Carlson.
570
571         Fix null handling of HTMLMediaElement.mediaGroup to match the specification:
572         - https://www.w3.org/TR/html5/embedded-content-0.html#media-elements
573
574         null is supposed to be treated as the String "null". This patch aligns
575         our behavior with the specification. I tested Firefox and Chrome but both
576         do not have this attribute on HTMLMediaElement.
577
578         Also remove support for [TreatNullAs=LegacyNullString] from our bindings
579         generator as HTMLMediaElement.mediaGroup was the last user.
580
581         No new tests, rebaselined existing test.
582
583         * bindings/scripts/CodeGeneratorJS.pm:
584         (JSValueToNative):
585         * bindings/scripts/IDLAttributes.txt:
586         * html/HTMLMediaElement.idl:
587
588 2016-07-20  Chris Dumez  <cdumez@apple.com>
589
590         CSSStyleDeclaration.setProperty() should be able to unset "important" on a property
591         https://bugs.webkit.org/show_bug.cgi?id=159959
592
593         Reviewed by Alexey Proskuryakov.
594
595         CSSStyleDeclaration.setProperty() should be able to unsert "important"
596         on a property as per the latest specification:
597         - https://drafts.csswg.org/cssom/#dom-cssstyledeclaration-setproperty
598         - https://drafts.csswg.org/cssom/#dom-cssstyledeclaration-camel-cased-attribute
599
600         Firefox and Chrome match the specification here but WebKit was ignoring calls
601         to setProperty() if there is already an "important" property wit this name
602         and if the new property does not have the "important" flag set.
603
604         This behavior was added a long time ago via Bug 60007. However, it does not
605         match the latest specification or other browsers.
606
607         Test: fast/css/CSSStyleDeclaration-setProperty-unset-important.html
608
609         * css/StyleProperties.cpp:
610         (WebCore::MutableStyleProperties::addParsedProperty):
611         Drop code that was added via Bug 60007 as this behavior no longer matches the
612         specification or other browsers. The layout test added in Bug 60007 fails in
613         other browsers and was updated in this patch to match the specification.
614
615 2016-07-20  Commit Queue  <commit-queue@webkit.org>
616
617         Unreviewed, rolling out r203423.
618         https://bugs.webkit.org/show_bug.cgi?id=159977
619
620         The test for this change is failing on Mac Release WK2
621         (Requested by ryanhaddad on #webkit).
622
623         Reverted changeset:
624
625         "HTMLVideoElement frames do not update on iOS when src is a
626         MediaStream blob"
627         https://bugs.webkit.org/show_bug.cgi?id=159833
628         http://trac.webkit.org/changeset/203423
629
630 2016-07-20  Chris Dumez  <cdumez@apple.com>
631
632         Fix null handling of HTMLSelectElement.value attribute
633         https://bugs.webkit.org/show_bug.cgi?id=159925
634
635         Reviewed by Benjamin Poulain.
636
637         Fix null handling of HTMLSelectElement.value attribute:
638         - https://html.spec.whatwg.org/multipage/forms.html#htmlselectelement
639
640         We were treating null as the null String which would end up setting
641         selectedIndex to -1. However, we should treat null as the String "null"
642         which would set the selectedIndex to the index of the <option> element
643         whose value is "null".
644
645         Firefox and Chrome match the specification.
646
647         Test: fast/dom/HTMLSelectElement/value-null-handling.html
648
649         * html/HTMLSelectElement.cpp:
650         (WebCore::HTMLSelectElement::setValue):
651         * html/HTMLSelectElement.idl:
652
653 2016-07-20  Chris Dumez  <cdumez@apple.com>
654
655         PostResolutionCallbackDisabler can resume pending requests while a ResourceLoadSuspender is alive
656         https://bugs.webkit.org/show_bug.cgi?id=159962
657         <rdar://problem/21439264>
658
659         Reviewed by David Kilzer.
660
661         PostResolutionCallbackDisabler can resume pending requests while a ResourceLoadSuspender
662         is alive. We have both PostResolutionCallbackDisabler and ResourceLoadSuspender that
663         call LoaderStrategy::suspendPendingRequests() / LoaderStrategy::resumePendingRequests().
664         However, PostResolutionCallbackDisabler and ResourceLoadSuspender are not aware of each
665         other. It is therefore possible for a PostResolutionCallbackDisabler object to get
666         destroyed, causing LoaderStrategy::resumePendingRequests() to be called while a
667         ResourceLoadSuspender object is alive.
668
669         This leads to hard to investigate crashes where we end up re-entering WebKit and killing
670         the style resolver.
671
672         This patch drops ResourceLoadSuspender and uses PostResolutionCallbackDisabler instead.
673         There was only one user of ResourceLoadSuspender and PostResolutionCallbackDisabler
674         is better because it manages a resolutionNestingDepth counter internally to make sure
675         it only calls LoaderStrategy::resumePendingRequests() once all
676         PostResolutionCallbackDisabler instances are destroyed.
677
678         No new tests, there is no easy way to reproduce the crashes.
679
680         * dom/Document.cpp:
681         (WebCore::Document::styleForElementIgnoringPendingStylesheets):
682         * loader/LoaderStrategy.cpp:
683         (WebCore::ResourceLoadSuspender::ResourceLoadSuspender): Deleted.
684         (WebCore::ResourceLoadSuspender::~ResourceLoadSuspender): Deleted.
685         * loader/LoaderStrategy.h:
686
687 2016-07-19  Youenn Fablet  <youenn@apple.com>
688
689         [Fetch API] Add a JS builtin to implement https://fetch.spec.whatwg.org/#concept-headers-fill
690         https://bugs.webkit.org/show_bug.cgi?id=159932
691
692         Reviewed by Alex Christensen.
693
694         Covered by existing tests.
695
696         Refactoring Headers initializeWith to use the new built-in internal that implements
697         https://fetch.spec.whatwg.org/#concept-headers-fill.
698
699         Refactoring Response constructor to put more checks in the JS builtin fucntion called within constructor.
700         Making use of the new built-in internal that implements https://fetch.spec.whatwg.org/#concept-headers-fill.
701
702         * CMakeLists.txt: Adding FetchHeadersInternals.js
703         * DerivedSources.make: Ditto.
704         * Modules/fetch/FetchHeaders.js:
705         (initializeFetchHeaders): Using fillFetchHeaders new built-in internal.
706         * Modules/fetch/FetchInternals.js: Added.
707         (fillFetchHeaders):
708         * Modules/fetch/FetchResponse.cpp: Refactoring to do more in the JS built-in. Splitting of initializeWith so
709         that the checks are done in the order defined by the spec.
710         (WebCore::FetchResponse::setStatus):
711         (WebCore::FetchResponse::initializeWith):
712         (WebCore::isNullBodyStatus): Deleted.
713         * Modules/fetch/FetchResponse.h:
714         * Modules/fetch/FetchResponse.idl:
715         * Modules/fetch/FetchResponse.js:
716         (initializeFetchResponse): New built-in internal.
717         * WebCore.xcodeproj/project.pbxproj:
718         * bindings/js/WebCoreBuiltinNames.h:
719
720 2016-07-19  Chris Dumez  <cdumez@apple.com>
721
722         Fix null handling of SVGScriptElement.type attribute
723         https://bugs.webkit.org/show_bug.cgi?id=159927
724
725         Reviewed by Benjamin Poulain.
726
727         Fix null handling of SVGScriptElement.type attribute:
728         - https://www.w3.org/TR/SVG2/interact.html#InterfaceSVGScriptElement
729
730         We were treating null as the null String which would end up removing
731         the 'type' content attribute. However, we should treat null as the
732         String "null".
733
734         Firefox and Chrome match the specification.
735
736         No new tests, updated existing test.
737
738         * svg/SVGScriptElement.idl:
739
740 2016-07-19  Chris Dumez  <cdumez@apple.com>
741
742         Fix null handling of several HTMLDocument attributes
743         https://bugs.webkit.org/show_bug.cgi?id=159923
744
745         Reviewed by Benjamin Poulain.
746
747         Fix null handling of several HTMLDocument attributes:
748         - https://html.spec.whatwg.org/multipage/dom.html#document
749         - https://html.spec.whatwg.org/multipage/obsolete.html#document-partial
750
751         In particular, null handling was incorrect in WebKit for 'dir',
752         'bgColor', 'fgColor', 'alinkColor', 'linkColor' and 'vlinkColor'.
753
754         Firefox and Chrome match the specification.
755
756         Test: fast/dom/HTMLDocument/null-handling.html
757
758         * html/HTMLDocument.idl:
759
760 2016-07-19  Chris Dumez  <cdumez@apple.com>
761
762         Document.createElementNS() / createAttributeNS() parameters should be mandatory
763         https://bugs.webkit.org/show_bug.cgi?id=159938
764
765         Reviewed by Benjamin Poulain.
766
767         Document.createElementNS() / createAttributeNS() parameters should be mandatory:
768         - https://dom.spec.whatwg.org/#document
769
770         They were optional in WebKit. However, Firefox and Chrome both match the
771         specification.
772
773         No new tests, rebaselined existing tests.
774
775         * dom/Document.idl:
776
777 2016-07-19  Benjamin Poulain  <bpoulain@apple.com>
778
779         Use getElementById for attribute matching if the attribute name is html's id
780         https://bugs.webkit.org/show_bug.cgi?id=159960
781
782         Reviewed by Chris Dumez.
783
784         Elliott Sprehn discovered YUI makes heavy uses of querySelector with [id=value]
785         (https://bugs.chromium.org/p/chromium/issues/detail?id=627242).
786
787         If we are not in quirks mode, IdForStyleResolution has the same value
788         as the Id attribute. We can use the same optimization for both cases.
789
790         Tests: fast/selectors/id-attribute-querySelector-used-as-id-selector-quirks.html
791                fast/selectors/id-attribute-querySelector-used-as-id-selector.html
792
793         * dom/SelectorQuery.cpp:
794         (WebCore::canBeUsedForIdFastPath):
795         (WebCore::findIdMatchingType):
796         (WebCore::SelectorDataList::SelectorDataList):
797         (WebCore::selectorForIdLookup):
798         (WebCore::filterRootById):
799
800 2016-07-19  Chris Dumez  <cdumez@apple.com>
801
802         Drop SVGElement.xmlbase attribute
803         https://bugs.webkit.org/show_bug.cgi?id=159926
804
805         Reviewed by Benjamin Poulain.
806
807         Drop SVGElement.xmlbase attribute as it is no longer part of the
808         specification:
809         - https://www.w3.org/TR/SVG2/types.html#InterfaceSVGElement
810
811         Both Firefox and Chrome have already dropped support for
812         SVGElement.xmlbase.
813
814         Chrome's intent to remove:
815         https://groups.google.com/a/chromium.org/forum/#!msg/blink-dev/TfwMq4d25hk/C-v_iC_wKfAJ
816
817         Test: svg/dom/SVGElement-xmlbase.html
818
819         * svg/SVGElement.cpp:
820         (WebCore::SVGElement::removedFrom): Deleted.
821         * svg/SVGElement.h:
822         * svg/SVGElement.idl:
823
824 2016-07-19  Chris Dumez  <cdumez@apple.com>
825
826         Align CSSStyleDeclaration.setProperty() with the specification
827         https://bugs.webkit.org/show_bug.cgi?id=159955
828
829         Reviewed by Benjamin Poulain.
830
831         Align CSSStyleDeclaration.setProperty() with the specification:
832         - https://drafts.csswg.org/cssom/#the-cssstyledeclaration-interface
833
834         In particular, the following changes were needed:
835         1. The 'value' parameter should not be optional
836         2. The 'priority' parameter should treat null as the empty string
837            rather than the string "null".
838         3. The 'priority' parameter's default value should be the empty string,
839            not the string "undefined".
840         4. CSSStyleDeclaration.setProperty() should return early if 'priority'
841            is not the empty string and is not an ASCII case-insensitive match
842            for the string "important".
843
844         Chrome matches the specification entirely.
845         Firefox matches the specification with the exception that it does a
846         case-sensitive match for "important".
847
848         Test: fast/css/CSSStyleDeclaration-setProperty.html
849
850         * css/CSSStyleDeclaration.idl:
851         * css/PropertySetCSSStyleDeclaration.cpp:
852         (WebCore::PropertySetCSSStyleDeclaration::setProperty):
853
854 2016-07-19  Daniel Bates  <dabates@apple.com>
855
856         CSP: Improve support for multiple policies to more closely conform to the CSP Level 2 spec.
857         https://bugs.webkit.org/show_bug.cgi?id=159841
858         <rdar://problem/27381684>
859
860         Reviewed by Brent Fulgham.
861
862         Implement a first pass at sending multiple violation reports so as to more closely
863         conform to section Enforcing multiple policies of the Content Security Policy Level 2 spec.,
864         <https://w3c.github.io/webappsec-csp/2/> (Editor's Draft, 25 April 2016).
865
866         Tests: http/tests/security/contentSecurityPolicy/1.1/script-blocked-sends-multiple-reports.php
867                http/tests/security/contentSecurityPolicy/1.1/scripthash-allowed-by-enforced-policy-and-blocked-by-report-policy.php
868                http/tests/security/contentSecurityPolicy/1.1/scripthash-allowed-by-enforced-policy-and-blocked-by-report-policy2.php
869                http/tests/security/contentSecurityPolicy/1.1/scripthash-allowed-by-legacy-enforced-policy-and-blocked-by-report-policy.php
870                http/tests/security/contentSecurityPolicy/1.1/scripthash-allowed-by-legacy-enforced-policy-and-blocked-by-report-policy2.php
871                http/tests/security/contentSecurityPolicy/1.1/scripthash-blocked-by-enforced-policy-and-allowed-by-report-policy.php
872                http/tests/security/contentSecurityPolicy/1.1/scripthash-blocked-by-enforced-policy-and-allowed-by-report-policy2.php
873                http/tests/security/contentSecurityPolicy/1.1/scripthash-blocked-by-legacy-enforced-policy-and-allowed-by-report-policy.php
874                http/tests/security/contentSecurityPolicy/1.1/scripthash-blocked-by-legacy-enforced-policy-and-allowed-by-report-policy2.php
875                http/tests/security/contentSecurityPolicy/1.1/scripthash-blocked-by-legacy-enforced-policy-and-blocked-by-report-policy.php
876                http/tests/security/contentSecurityPolicy/1.1/scripthash-blocked-by-legacy-enforced-policy-and-blocked-by-report-policy2.php
877                http/tests/security/contentSecurityPolicy/1.1/scripthash-in-enforced-policy-and-not-in-report-only.html
878                http/tests/security/contentSecurityPolicy/1.1/scripthash-in-one-enforced-policy-neither-in-another-enforced-policy-nor-report-policy.html
879                http/tests/security/contentSecurityPolicy/1.1/scriptnonce-allowed-by-enforced-policy-and-blocked-by-report-policy.php
880                http/tests/security/contentSecurityPolicy/1.1/scriptnonce-allowed-by-enforced-policy-and-blocked-by-report-policy2.php
881                http/tests/security/contentSecurityPolicy/1.1/scriptnonce-allowed-by-legacy-enforced-policy-and-blocked-by-report-policy.php
882                http/tests/security/contentSecurityPolicy/1.1/scriptnonce-allowed-by-legacy-enforced-policy-and-blocked-by-report-policy2.php
883                http/tests/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-enforced-policy-and-allowed-by-report-policy.php
884                http/tests/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-enforced-policy-and-allowed-by-report-policy2.php
885                http/tests/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-legacy-enforced-policy-and-allowed-by-report-policy.php
886                http/tests/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-legacy-enforced-policy-and-allowed-by-report-policy2.php
887                http/tests/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-legacy-enforced-policy-and-blocked-by-report-policy.php
888                http/tests/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-legacy-enforced-policy-and-blocked-by-report-policy2.php
889                http/tests/security/contentSecurityPolicy/1.1/scriptnonce-in-enforced-policy-and-not-in-report-only.html
890                http/tests/security/contentSecurityPolicy/1.1/scriptnonce-in-one-enforced-policy-neither-in-another-enforced-policy-nor-report-policy.html
891                http/tests/security/contentSecurityPolicy/1.1/scriptnonce-multiple-policies.html
892
893         * page/csp/ContentSecurityPolicy.cpp:
894         (WebCore::ContentSecurityPolicy::allPoliciesWithDispositionAllow): Added. Returns whether the resource
895         is allowed by all of the policies with the specified disposition.
896         (WebCore::ContentSecurityPolicy::allPoliciesAllow): Added. Returns whether the resource is allowed by
897         all of the enforced policies.
898         (WebCore::ContentSecurityPolicy::findHashOfContentInPolicies): Formerly named foundHashOfContentInAllPolicies.
899         Modified to return a ("has found hash in all enforced policies, "has found hash in all report-only policies)-pair
900         so that we can differentiate whether the hash violated an enforced policy or a report-only policy.
901         (WebCore::ContentSecurityPolicy::allowJavaScriptURLs): Write in terms of ContentSecurityPolicy::allPoliciesAllow().
902         (WebCore::ContentSecurityPolicy::allowInlineEventHandlers): Ditto.
903         (WebCore::ContentSecurityPolicy::allowScriptWithNonce): For now only accept a nonce if it is allowed by
904         all enforced policies. As a side effect of this change is that we only send a CSP violation report when a
905         nonce violates a report-only policy only if the nonce also violates one or more enforced policies. We will
906         address this limitation in <https://bugs.webkit.org/show_bug.cgi?id=159830>.
907         (WebCore::ContentSecurityPolicy::allowStyleWithNonce): Ditto.
908         (WebCore::ContentSecurityPolicy::allowInlineScript): Differentiate between a hash/'unsafe-inline' that
909         matches/is contained in all enforce policies and a hash/'unsafe-inline' that matches/is contained in all
910         report-only policies so that we only allow the resource for the former. As a side effect of this change
911         we may report that a resource violated a policy even if it contained the hash. See <https://bugs.webkit.org/show_bug.cgi?id=159832>
912         for more details.
913         (WebCore::ContentSecurityPolicy::allowInlineStyle): Ditto.
914         (WebCore::ContentSecurityPolicy::allowEval): Write in terms of ContentSecurityPolicy::allPoliciesAllow().
915         (WebCore::ContentSecurityPolicy::allowFrameAncestors): Ditto.
916         (WebCore::ContentSecurityPolicy::allowPluginType): Ditto.
917         (WebCore::ContentSecurityPolicy::allowScriptFromSource): Ditto.
918         (WebCore::ContentSecurityPolicy::allowObjectFromSource): Ditto.
919         (WebCore::ContentSecurityPolicy::allowChildFrameFromSource): Ditto.
920         (WebCore::ContentSecurityPolicy::allowChildContextFromSource): Ditto.
921         (WebCore::ContentSecurityPolicy::allowImageFromSource): Ditto.
922         (WebCore::ContentSecurityPolicy::allowStyleFromSource): Ditto.
923         (WebCore::ContentSecurityPolicy::allowFontFromSource): Ditto.
924         (WebCore::ContentSecurityPolicy::allowMediaFromSource): Ditto.
925         (WebCore::ContentSecurityPolicy::allowConnectToSource): Ditto.
926         (WebCore::ContentSecurityPolicy::allowFormAction): Ditto.
927         (WebCore::ContentSecurityPolicy::allowBaseURI): Ditto.
928         (WebCore::ContentSecurityPolicy::foundHashOfContentInAllPolicies): Deleted.
929         * page/csp/ContentSecurityPolicy.h:
930         (WebCore::ContentSecurityPolicy::violatedDirectiveInAnyPolicy): Deleted.
931
932 2016-07-19  Chris Dumez  <cdumez@apple.com>
933
934         Fix null handling of HTMLScriptElement.text attribute
935         https://bugs.webkit.org/show_bug.cgi?id=159943
936
937         Reviewed by Benjamin Poulain.
938
939         Fix null handling of HTMLScriptElement.text attribute:
940         - https://html.spec.whatwg.org/multipage/scripting.html#the-script-element
941
942         We should treat null as the "null" String but we were treating it as
943         the empty string.
944
945         Firefox and Chrome match the specification.
946
947         No new tests, rebaselined existing test.
948
949         * html/HTMLScriptElement.idl:
950
951 2016-07-19  Chris Dumez  <cdumez@apple.com>
952
953         autocapitalize attribute should not use [TreatNullAs=LegacyNullString]
954         https://bugs.webkit.org/show_bug.cgi?id=159934
955
956         Reviewed by Benjamin Poulain.
957
958         autocapitalize attribute should not use [TreatNullAs=LegacyNullString]. This is
959         non-standard and we want to drop support for it from the bindings generator.
960
961         Instead, use [TreatNullAs=EmptyString] in order to maintain existing behavior
962         given that both a missing/empty attribute result in using the default
963         autocapitalization mode and that autocapitalize returns the empty string by
964         default.
965
966         Test: platform/ios-simulator/ios/fast/forms/autocapitalize-null.html
967
968         * html/HTMLFormElement.idl:
969         * html/HTMLInputElement.idl:
970         * html/HTMLTextAreaElement.idl:
971
972 2016-07-19  Zalan Bujtas  <zalan@apple.com>
973
974         REGRESSION(r203415): ASSERTION FAILED: !m_layoutRoot->container() || !m_layoutRoot->container()->needsLayout()
975         https://bugs.webkit.org/show_bug.cgi?id=159952
976
977         Reviewed by Simon Fraser.
978
979         Update ASSERTs to reflect new functionality, that is, now we can end up in a state
980         where the container (RenderView) of one of the dirty subtrees is dirty.
981         See r203415.
982  
983         Covered by editing/pasteboard/drag-drop-input-in-svg.svg
984
985         * page/FrameView.cpp:
986         (WebCore::FrameView::scheduleRelayoutOfSubtree):
987
988 2016-07-19  Dean Jackson  <dino@apple.com>
989
990         REGRESSION(202927): The first slide is the only displayed slide when Quicklooking a Keynote file
991         https://bugs.webkit.org/show_bug.cgi?id=159948
992         <rdar://problem/27391012>
993
994         Reviewed by Simon Fraser.
995
996         There is an iOS bug (<rdar://problem/27416744>) that is causing us
997         to not always get a color space on CGContextRefs. Investigation of this
998         exposed some optimizations we can take when we are creating ImageBuffers.
999         In particular, if we have a bitmap context or an IOSurfaceContext we
1000         can simply copy their color space using API. Otherwise we stick with
1001         the existing CGContextCopyDeviceColorSpace.
1002
1003         Lastly, if for some reason we are unable to copy the device color space,
1004         we should fall back to sRGB.
1005
1006         * platform/graphics/cg/ImageBufferCG.cpp:
1007         (WebCore::ImageBuffer::createCompatibleBuffer):
1008         * platform/spi/cg/CoreGraphicsSPI.h: Add some SPI and enums.
1009
1010
1011 2016-07-19  George Ruan  <gruan@apple.com>
1012
1013         HTMLVideoElement frames do not update on iOS when src is a MediaStream blob
1014         https://bugs.webkit.org/show_bug.cgi?id=159833
1015         <rdar://problem/27379487>
1016
1017         Reviewed by Eric Carlson.
1018
1019         Test: fast/mediastream/MediaStream-video-element-displays-buffer.html
1020
1021         * WebCore.xcodeproj/project.pbxproj:
1022         * platform/graphics/avfoundation/MediaSampleAVFObjC.h: Change create to return a Ref<T> instead
1023         of RefPtr<T>
1024         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h: Make observer of
1025         MediaStreamTrackPrivate and make MediaPlayer use an AVSampleBufferDisplayLayer instead of CALayer.
1026         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm: Ditto.
1027         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::~MediaPlayerPrivateMediaStreamAVFObjC): Clean up
1028         observers and AVSampleBufferDisplayLayer
1029         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::isAvailable): Ensures AVSampleBufferDisplayLayer
1030         is available.
1031         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueAudioSampleBufferFromTrack): Placeholder.
1032         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSampleBufferFromTrack): Responsible
1033         for enqueuing sample buffers to the active video track.
1034         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayer): Ensures that an AVSampleBufferDisplayLayer
1035         exists.
1036         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::destroyLayer): Destroys the AVSampleBufferDisplayLayer.
1037         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::platformLayer): Replace CALayer with AVSampleBufferDisplayLayer.
1038         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::currentDisplayMode): Ditto.
1039         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::sampleBufferUpdated): Called from MediaStreamTrackPrivate when a
1040         new SampleBuffer is available.
1041         (WebCore::updateTracksOfType): Manage adding and removing self as observer from tracks.
1042         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateTracks): Replace CALayer with AVSampleBufferDisplayLayer
1043         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::acceleratedRenderingStateChanged): Copied from
1044         MediaPlayerPrivateMediaSourceAVFObjC.mm
1045         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::load): Deleted CALayer.
1046         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateDisplayMode): Deleted process of updating CALayer.
1047         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateIntrinsicSize): Deleted CALayer.
1048         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::createPreviewLayers): Deleted.
1049         * platform/mediastream/MediaStreamPrivate.cpp:
1050         (WebCore::MediaStreamPrivate::updateActiveVideoTrack): Remove redundant check.
1051         * platform/mediastream/MediaStreamTrackPrivate.cpp:
1052         (WebCore::MediaStreamTrackPrivate::sourceHasMoreMediaData): Called from RealtimeMediaSource when a new SampleBuffer
1053         is available.
1054         * platform/mediastream/MediaStreamTrackPrivate.h:
1055         (WebCore::MediaStreamTrackPrivate::Observer::sampleBufferUpdated): Relays to MediaPlayerPrivateMediaStream that
1056         a new SampleBuffer is available to enqueue to the AVSampleBufferDisplayLayer.
1057         * platform/mediastream/RealtimeMediaSource.cpp:
1058         (WebCore::RealtimeMediaSource::mediaDataUpdated): Relays to all observers that a new SampleBuffer is available.
1059         * platform/mediastream/RealtimeMediaSource.h:
1060         * platform/mediastream/mac/AVVideoCaptureSource.mm:
1061         (WebCore::AVVideoCaptureSource::processNewFrame): Calls mediaDataUpdated when a new SampleBuffer is captured.
1062
1063 2016-07-19  Anders Carlsson  <andersca@apple.com>
1064
1065         Get rid of a #define private public hack in WebCore
1066         https://bugs.webkit.org/show_bug.cgi?id=159953
1067
1068         Reviewed by Dan Bernstein.
1069
1070         Use @package instead.
1071
1072         * bindings/objc/DOMInternal.h:
1073         * bindings/objc/DOMObject.h:
1074
1075 2016-07-19  Andreas Kling  <akling@apple.com>
1076
1077         Fix SharedBuffer leak in MockContentFilter::replacementData().
1078         <https://webkit.org/b/159945>
1079
1080         Reviewed by Andy Estes.
1081
1082         Spotted on leaks bot. This code was pretty explicit about how it's going to leak.
1083         Since this is in the mock filter, it only affected layout tests.
1084
1085         * testing/MockContentFilter.cpp:
1086         (WebCore::MockContentFilter::replacementData):
1087
1088 2016-07-19  Zalan Bujtas  <zalan@apple.com>
1089
1090         theguardian.co.uk crossword puzzles are sometimes not displaying text
1091         https://bugs.webkit.org/show_bug.cgi?id=159924
1092         <rdar://problem/27409483>
1093
1094         Reviewed by Simon Fraser.
1095
1096         This patch fixes the case when
1097         - 2 disjoint subtrees are dirty
1098         - RenderView is also dirty.
1099         and we end up not laying out one of the 2 subtrees.
1100
1101         In FrameView::scheduleRelayoutOfSubtree, we assume that when the RenderView is dirty
1102         we already have a pending full layout which means that any previous subtree layouts have already been
1103         converted to full layouts.
1104         However this assumption is incorrect. RenderView can get dirty without checking if there's
1105         already a pending subtree layout.
1106         One option to solve this problem would be to override RenderObject::setNeedsLayout in RenderView
1107         so that when the RenderView gets dirty, we could also convert any pending subtree layout to full layout.
1108         However RenderObject::setNeedsLayout is a hot function and making it virtual would impact performance.
1109         The other option is to always normalize subtree layouts in FrameView::scheduleRelayoutOfSubtree().
1110         This patch implements the second option.
1111
1112         Test: fast/misc/subtree-layouts.html
1113
1114         * page/FrameView.cpp:
1115         (WebCore::FrameView::scheduleRelayoutOfSubtree):
1116
1117 2016-07-19  Anders Carlsson  <andersca@apple.com>
1118
1119         Some payment authorization status values should keep the sheet active
1120         https://bugs.webkit.org/show_bug.cgi?id=159936
1121         rdar://problem/26756701
1122
1123         Reviewed by Tim Horton.
1124
1125         * Modules/applepay/ApplePaySession.cpp:
1126         (WebCore::ApplePaySession::completePayment):
1127         Keep the sheet active if the status isn't a final state status.
1128
1129         * Modules/applepay/PaymentAuthorizationStatus.h:
1130         (WebCore::isFinalStateStatus):
1131         Add a new helper function that returns whether a given payment authorization status is "final",
1132         meaning that once that status has been passed to completePayment, the session is finished.
1133
1134 2016-07-19  Nan Wang  <n_wang@apple.com>
1135
1136         AX: Incorrect behavior for word related text marker functions when there's collapsed whitespace
1137         https://bugs.webkit.org/show_bug.cgi?id=159910
1138
1139         Reviewed by Chris Fleizach.
1140
1141         We are getting a bad CharacterOffset when there's collapsed whitespace. Added a TraverseOptionValidateOffset
1142         option to make sure we are getting the correct CharacterOffset based on the corresponding Range offset. And
1143         fixed a word navigation issue based on that.
1144
1145         Test: accessibility/mac/text-marker-word-nav-collapsed-whitespace.html
1146
1147         * accessibility/AXObjectCache.cpp:
1148         (WebCore::AXObjectCache::traverseToOffsetInRange):
1149         (WebCore::AXObjectCache::rangeForNodeContents):
1150         (WebCore::AXObjectCache::startOrEndCharacterOffsetForRange):
1151         (WebCore::AXObjectCache::characterOffsetFromVisiblePosition):
1152         (WebCore::AXObjectCache::rightWordRange):
1153         (WebCore::AXObjectCache::previousBoundary):
1154         * accessibility/AXObjectCache.h:
1155         (WebCore::AXObjectCache::isNodeInUse):
1156
1157 2016-07-19  Youenn Fablet  <youenn@apple.com>
1158
1159         [Streams API] ReadableStreamController methods should throw if its stream is not readable
1160         https://bugs.webkit.org/show_bug.cgi?id=159871
1161
1162         Reviewed by Xabier Rodriguez-Calvar.
1163
1164         Spec now mandates close and enqueue to throw if ReadableStream is not readable.
1165         Covered by rebased and/or modified tests.
1166
1167         * Modules/streams/ReadableStreamController.js:
1168         (enqueue): Throwing a TypeError if controlled stream is not readable.
1169         (close): Ditto.
1170
1171 2016-07-19  Simon Fraser  <simon.fraser@apple.com>
1172
1173         Bubbles appear split for a brief moment in Messages
1174         https://bugs.webkit.org/show_bug.cgi?id=159915
1175         rdar://problem/27182267
1176
1177         Reviewed by David Hyatt.
1178
1179         RenderView::repaintRootContents() had a long-standing bug in WebView when the
1180         view is scrolled. repaint() uses visualOverflowRect() but, for the 
1181         RenderView, the visualOverflowRect() is the initial containing block
1182         which is anchored at 0,0. When the view is scrolled it's clipped out and
1183         calls to repaintRootContents() have no effect.
1184         
1185         Change repaintRootContents() to use layoutOverflowRect(). ScrollView::repaintContentRectangle()
1186         will clip it to the view if necessary.
1187
1188         Test: fast/repaint/scrolled-view-full-repaint.html
1189
1190         * rendering/RenderView.cpp:
1191         (WebCore::RenderView::repaintRootContents):
1192
1193 2016-07-19  Dan Bernstein  <mitz@apple.com>
1194
1195         <rdar://problem/27420308> WebCore-7602.1.42 fails to build: error: unused parameter 'vm'
1196
1197         * bindings/js/JSDOMGlobalObject.cpp:
1198         (WebCore::JSDOMGlobalObject::addBuiltinGlobals): Fixed the !ENABLE(STREAMS_API) build.
1199
1200 2016-07-19  Youenn Fablet  <youenn@apple.com>
1201
1202         [Streams API] Make ReadableStream properties not enumerable
1203         https://bugs.webkit.org/show_bug.cgi?id=159868
1204
1205         Reviewed by Darin Adler.
1206
1207         Covered by rebased tests.
1208
1209         Uopdating IDL definitions to mark all functions/attributes as not enumerable.
1210         Updating IDL constructor definitions to correctly compute constructor length.
1211         Updating built-in implementation to correctly compute pipeTo length to 1 (second parameter being optional).
1212
1213         * Modules/streams/ReadableStream.idl:
1214         * Modules/streams/ReadableStream.js:
1215         * Modules/streams/ReadableStreamController.idl:
1216         * Modules/streams/ReadableStreamReader.idl:
1217
1218 2016-07-19  Chris Dumez  <cdumez@apple.com>
1219
1220         form.enctype / encoding / method should treat null as "null" string
1221         https://bugs.webkit.org/show_bug.cgi?id=159916
1222
1223         Reviewed by Ryosuke Niwa.
1224
1225         form.enctype / encoding / method should treat null as "null" string:
1226         - https://html.spec.whatwg.org/multipage/forms.html#htmlformelement
1227
1228         Previously, WebKit would treat null as the null String, which would
1229         end up removing the existing attribute.
1230
1231         Firefox and Chrome match the specification.
1232
1233         Test: fast/dom/HTMLFormElement/null-handling.html
1234
1235         * html/HTMLFormElement.h:
1236         * html/HTMLFormElement.idl:
1237
1238 2016-07-18  Csaba Osztrogon√°c  <ossy@webkit.org>
1239
1240         All-in-one buildfix after r202439
1241         https://bugs.webkit.org/show_bug.cgi?id=159877
1242
1243         Reviewed by Chris Dumez.
1244
1245         * Modules/webaudio/AudioDestinationNode.h:
1246         (WebCore::AudioDestinationNode::resume):
1247         (WebCore::AudioDestinationNode::suspend):
1248         (WebCore::AudioDestinationNode::close):
1249
1250 2016-07-18  Frederic Wang  <fwang@igalia.com>
1251
1252         Move parsing of subscriptshift and superscriptshift from rendering to element classes
1253         https://bugs.webkit.org/show_bug.cgi?id=159622
1254
1255         Reviewed by Darin Adler.
1256
1257         We introduce a new MathMLScriptsElement that is used for elements msub, msup, msubsup and
1258         mmultiscripts in order to create RenderMathMLScripts and parse and expose the values of the
1259         subscriptshift and superscriptshift attributes. This is one more step toward moving MathML
1260         attribute parsing to the DOM (bug 156536).
1261
1262         No new tests, rendering is unchanged.
1263
1264         * CMakeLists.txt: Add MathMLScriptsElement files.
1265         * WebCore.xcodeproj/project.pbxproj: Ditto.
1266         * mathml/MathMLAllInOne.cpp: Ditto.
1267         * mathml/MathMLInlineContainerElement.cpp: Remove handling of scripts.
1268         (WebCore::MathMLInlineContainerElement::createElementRenderer): Deleted.
1269         * mathml/MathMLScriptsElement.cpp: Added. New class to handle scripted elements supporting
1270         parsing for the subscriptshift and superscriptshift MathML lengths.
1271         (WebCore::MathMLScriptsElement::MathMLScriptsElement):
1272         (WebCore::MathMLScriptsElement::create):
1273         (WebCore::MathMLScriptsElement::subscriptShift): Expose the cached length for the shift,
1274         parsing the attribute again if necessary.
1275         (WebCore::MathMLScriptsElement::superscriptShift): Ditto.
1276         (WebCore::MathMLScriptsElement::parseAttribute): Mark attributes dirty.
1277         (WebCore::MathMLScriptsElement::createElementRenderer): Create RenderMathMLScripts.
1278         * mathml/MathMLScriptsElement.h: Ditto.
1279         * mathml/mathtags.in: Map msub, msup, msubsup and mmultiscripts to MathMLScriptsElement.
1280         * rendering/mathml/RenderMathMLScripts.cpp:
1281         (WebCore::RenderMathMLScripts::scriptsElement): Helper function to cast the node to a
1282         MathMLScriptsElement.
1283         (WebCore::RenderMathMLScripts::getScriptMetricsAndLayoutIfNeeded): Resolve the attributes
1284         using the functions from the MathMLScriptsElement class.
1285         * rendering/mathml/RenderMathMLScripts.h: Declare scriptsElement.
1286
1287 2016-07-18  Frederic Wang  <fwang@igalia.com>
1288
1289         Do not store gap and shift parameters on RenderMathMLFraction
1290         https://bugs.webkit.org/show_bug.cgi?id=159876
1291
1292         Reviewed by Darin Adler.
1293
1294         After r203285, the stack and fraction layout parameters are only used in layoutBlock so we
1295         do not need to store them on the class. We remove them and split updateLayoutParameters into
1296         three functions: one to update the linethickness and two others to retrieve the fraction and
1297         stack respectively.
1298
1299         No new tests, rendering is unchanged.
1300
1301         * rendering/mathml/RenderMathMLFraction.cpp:
1302         (WebCore::RenderMathMLFraction::updateLineThickness): Move code to update thickness members here.
1303         (WebCore::RenderMathMLFraction::getFractionParameters): Move code to retrieve fraction parameters here.
1304         (WebCore::RenderMathMLFraction::getStackParameters): Move code to retrieve stack parameters here.
1305         (WebCore::RenderMathMLFraction::layoutBlock): Use the new helper functions and local variables
1306         for fraction and stack parameters.
1307         (WebCore::RenderMathMLFraction::updateLayoutParameters): Deleted.
1308         * rendering/mathml/RenderMathMLFraction.h: Declare new helper functions and remove members
1309         for stack and fraction parameters.
1310
1311 2016-07-18  Chris Dumez  <cdumez@apple.com>
1312
1313         input.formEnctype / formMethod and button.formEnctype / formMethod / type should treat null as "null"
1314         https://bugs.webkit.org/show_bug.cgi?id=159908
1315
1316         Reviewed by Alex Christensen.
1317
1318         input.formEnctype / formMethod and button.formEnctype / formMethod / type
1319         should treat null as "null" String:
1320         - https://html.spec.whatwg.org/multipage/forms.html#htmlinputelement
1321         - https://html.spec.whatwg.org/multipage/forms.html#htmlbuttonelement
1322
1323         In WebKit, we would treat null as a null String which would end up
1324         removing the corresponding attribute. This does not match the
1325         specification. Firefox and Chrome match the specification here.
1326
1327         Tests:
1328         - fast/dom/HTMLButtonElement/null-handling.html
1329         - fast/dom/HTMLInputElement/null-handling.html
1330
1331         * html/HTMLButtonElement.idl:
1332         * html/HTMLInputElement.idl:
1333
1334 2016-07-18  Alex Christensen  <achristensen@webkit.org>
1335
1336         webbookmarksd needs to use the same AppCache directory as MobileSafari
1337         https://bugs.webkit.org/show_bug.cgi?id=159912
1338
1339         Reviewed by Alexey Proskuryakov.
1340
1341         No new tests.  This only changes behavior for webbookmarksd.
1342
1343         * platform/RuntimeApplicationChecks.h:
1344         * platform/RuntimeApplicationChecks.mm:
1345         (WebCore::IOSApplication::isWebBookmarksD): Added.
1346
1347 2016-07-18  Chris Dumez  <cdumez@apple.com>
1348
1349         EventTarget.dispatchEvent() parameter should not be nullable
1350         https://bugs.webkit.org/show_bug.cgi?id=159897
1351
1352         Reviewed by Benjamin Poulain.
1353
1354         EventTarget.dispatchEvent() parameter should not be nullable:
1355         - https://dom.spec.whatwg.org/#interface-eventtarget
1356
1357         Even though the parameter was marked as nullable in our IDL, our
1358         implementation does a null check and we already throw a TypeError
1359         when calling dispatchEvent(null).
1360
1361         Update our IDL so that it matches the specification and so that
1362         the null check is generated in the bindings instead.
1363
1364         No new tests, rebaseline existing tests.
1365
1366         * dom/EventTarget.cpp:
1367         (WebCore::EventTarget::dispatchEventForBindings):
1368         * dom/EventTarget.h:
1369         * dom/EventTarget.idl:
1370
1371 2016-07-18  Chris Dumez  <cdumez@apple.com>
1372
1373         DocType's publicId / systemId should not be nullable
1374         https://bugs.webkit.org/show_bug.cgi?id=159901
1375
1376         Reviewed by Benjamin Poulain.
1377
1378         DocType's publicId / systemId should not be nullable. While they were
1379         not marked as nullable in our IDL, they could be stored as null Strings
1380         in our implementation depending on how the Node was constructed. This
1381         led to subtle bugs where String() != emptyString().
1382
1383         In particular, Node.isEqualNode() would return false when DocumentType
1384         nodes would mismatch because of their publicId / systemId being null
1385         instead of the emptyString.
1386
1387         Serialization would DocumentType nodes would also be wrong when
1388         publicId / systemId were empty Strings instead of null strings. The
1389         new behavior now matches:
1390         - https://www.w3.org/TR/DOM-Parsing/#dfn-concept-serialize-doctype (steps 7-9)
1391
1392         To address these issues, we now always store publicId / systemId as
1393         non-null Strings inside the DocumentType class.
1394
1395         Test: fast/dom/DocumentType/isEqualNode.html
1396
1397         * dom/DocumentType.cpp:
1398         (WebCore::DocumentType::DocumentType):
1399         * editing/MarkupAccumulator.cpp:
1400         (WebCore::MarkupAccumulator::appendDocumentType):
1401
1402 2016-07-18  Jeremy Jones  <jeremyj@apple.com>
1403
1404         If previous media session interruptions were prevented, still allow subsequent interruptions to try.
1405         https://bugs.webkit.org/show_bug.cgi?id=157553
1406         rdar://problem/25740804
1407
1408         Reviewed by Eric Carlson.
1409
1410         Test: platform/ios-simulator/media/video-interruption-suspendunderlock.html
1411
1412         When suspending under lock on iOS, there is first a resign active event, then a
1413         suspend under lock. PiP prevents resign active from interrupting playback. But it should allow the
1414         suspend under lock to interrupt playback.
1415
1416         Currently if there are nested interruptions only the first one is acted upon.
1417
1418         This change allows subsequent, nested interruptions to have a chance to interrupt playback if the
1419         previous interruptions were ignored.
1420
1421         This test is for iPad only, so it must be run manually.
1422
1423         * html/HTMLMediaElement.cpp:
1424         (WebCore::HTMLMediaElement::shouldOverrideBackgroundPlaybackRestriction):
1425         * platform/audio/PlatformMediaSession.cpp:
1426         (WebCore::PlatformMediaSession::beginInterruption):
1427         * testing/Internals.cpp:
1428         (WebCore::Internals::beginMediaSessionInterruption):
1429
1430 2016-07-18  Brent Fulgham  <bfulgham@apple.com>
1431
1432         Don't associate form-associated elements with forms in other trees.
1433         https://bugs.webkit.org/show_bug.cgi?id=119451
1434         <rdar://problem/27382946>
1435
1436         Change is based on the Blink change (patch by <adamk@chromium.org>):
1437         <https://chromium.googlesource.com/chromium/blink/+/0b33128be67e7845d495d5219614c02ccfe7a414>
1438
1439         Reviewed by Chris Dumez.
1440
1441         Prevent elements from being associated with forms that are not part of the same home subtree.
1442         This brings us in line with the WhatWG HTML specification as of September, 2013.
1443
1444         Tests: fast/forms/image-disconnected-during-parse.html
1445                fast/forms/input-disconnected-during-parse.html
1446
1447         * dom/Element.h:
1448         (WebCore::Node::rootElement): Added.
1449         * html/FormAssociatedElement.cpp:
1450         (WebCore::FormAssociatedElement::insertedInto): If the element is associated with a form that
1451         is not part of the same tree, remove the association.
1452         * html/HTMLImageElement.cpp:
1453         (WebCore::HTMLImageElement::insertedInto): Ditto.
1454
1455 2016-07-18  Anders Carlsson  <andersca@apple.com>
1456
1457         WebKit nightly fails to build on macOS Sierra
1458         https://bugs.webkit.org/show_bug.cgi?id=159902
1459         rdar://problem/27365672
1460
1461         Reviewed by Tim Horton.
1462
1463         * Modules/applepay/cocoa/PaymentCocoa.mm:
1464         * Modules/applepay/cocoa/PaymentContactCocoa.mm:
1465         * Modules/applepay/cocoa/PaymentMerchantSessionCocoa.mm:
1466         * Modules/applepay/cocoa/PaymentMethodCocoa.mm:
1467         Use new PassKitSPI header.
1468
1469         * WebCore.xcodeproj/project.pbxproj:
1470         Add new PassKitSPI header.
1471
1472         * icu/unicode/ucurr.h: Added.
1473         Add ucurr.h from ICU.
1474
1475         * platform/spi/cocoa/PassKitSPI.h: Added.
1476         Add new PassKitSPI header.
1477
1478 2016-07-18  Dean Jackson  <dino@apple.com>
1479
1480         REGRESSION (r202950): Image zoom animations are broken at medium.com (159861)
1481         https://bugs.webkit.org/show_bug.cgi?id=159906
1482         <rdar://problem/27391725>
1483
1484         Reviewed by Simon Fraser.
1485
1486         The fix for webkit.org/b/157569 in r200769 broke AMP pages.
1487         The followup fix for webkit.org/b/159450 in r202950 broke Medium pages.
1488
1489         Revert them both until we have better testing.
1490
1491         * css/CSSParser.cpp:
1492         (WebCore::CSSParser::addPropertyWithPrefixingVariant):
1493         (WebCore::CSSParser::parseValue):
1494         (WebCore::CSSParser::parseAnimationShorthand):
1495         (WebCore::CSSParser::parseTransitionShorthand): Deleted.
1496         * css/CSSPropertyNames.in:
1497         * css/PropertySetCSSStyleDeclaration.cpp:
1498         (WebCore::PropertySetCSSStyleDeclaration::getPropertyCSSValue):
1499         (WebCore::PropertySetCSSStyleDeclaration::getPropertyValue):
1500         (WebCore::PropertySetCSSStyleDeclaration::getPropertyCSSValueInternal):
1501         (WebCore::PropertySetCSSStyleDeclaration::getPropertyValueInternal):
1502         * css/StyleProperties.cpp:
1503         (WebCore::MutableStyleProperties::removeShorthandProperty):
1504         (WebCore::MutableStyleProperties::removeProperty):
1505         (WebCore::MutableStyleProperties::removePrefixedOrUnprefixedProperty):
1506         (WebCore::MutableStyleProperties::setProperty):
1507         (WebCore::getIndexInShorthandVectorForPrefixingVariant):
1508         (WebCore::MutableStyleProperties::appendPrefixingVariantProperty):
1509         (WebCore::MutableStyleProperties::setPrefixingVariantProperty):
1510         (WebCore::StyleProperties::asText): Deleted.
1511         * css/StyleProperties.h:
1512
1513 2016-07-18  Andreas Kling  <akling@apple.com>
1514
1515         There should be a way to simulate memory pressure in layout tests
1516         <https://webkit.org/b/159743>
1517
1518         Reviewed by Simon Fraser.
1519
1520         Add three window.internal APIs:
1521
1522             - boolean isUnderMemoryPressure (readonly attribute)
1523             - void beginSimulatedMemoryPressure()
1524             - void endSimulatedMemoryPressure()
1525
1526         These make it possible to write tests that exercise behaviors that only
1527         occur during memory pressure situations.
1528
1529         I also implemented the "org.WebKit.lowMemory" notification handler using the new API.
1530
1531         Test: memory/memory-pressure-simulation.html
1532
1533         * platform/MemoryPressureHandler.cpp:
1534         (WebCore::MemoryPressureHandler::beginSimulatedMemoryPressure):
1535         (WebCore::MemoryPressureHandler::endSimulatedMemoryPressure):
1536         * platform/MemoryPressureHandler.h:
1537         (WebCore::MemoryPressureHandler::isUnderMemoryPressure):
1538         * platform/cocoa/MemoryPressureHandlerCocoa.mm:
1539         (WebCore::MemoryPressureHandler::platformReleaseMemory):
1540         (WebCore::MemoryPressureHandler::install):
1541         * testing/Internals.cpp:
1542         (WebCore::Internals::isUnderMemoryPressure):
1543         (WebCore::Internals::beginSimulatedMemoryPressure):
1544         (WebCore::Internals::endSimulatedMemoryPressure):
1545         * testing/Internals.h:
1546         * testing/Internals.idl:
1547
1548 2016-07-18  Said Abou-Hallawa  <sabouhallawa@apple,com>
1549
1550         [iOS] PDFDocumentImage should cache only a sub image of the PDF when caching the whole image is expensive
1551         https://bugs.webkit.org/show_bug.cgi?id=158715
1552
1553         Reviewed by Dean Jackson.
1554
1555         Test: fast/images/displaced-non-cached-pdf.html
1556
1557         For iOS, we need to ensure the size of the cached PDF images will not
1558         exceed some limit. Also we should be caching only a sub image of the PDF
1559         if caching the whole image will exceed the memory limit.
1560
1561         * page/Settings.cpp:
1562         (WebCore::Settings::Settings):
1563         (WebCore::Settings::setCachedPDFImageEnabled):
1564         * page/Settings.h:
1565         (WebCore::Settings::isCachedPDFImageEnabled):
1566             Add an option to disable caching the PDF images.
1567
1568         * platform/graphics/cg/PDFDocumentImage.cpp:
1569         (WebCore::PDFDocumentImage::setCachedPDFImageEnabled):
1570             Allow the caller of draw() to disable caching the PDF images.
1571         
1572         (WebCore::PDFDocumentImage::cacheParametersMatch):
1573             Match the context dirty rectangle with the cached image rectangle.
1574         
1575         (WebCore::transformContextForPainting):
1576             When preparing the context for drawing the PDF, take the location 
1577             of the destination rectangle into account. We do not need to scale
1578             the location of the source rectangle because we scale the size of
1579             the rectangle but we don't scale the whole coordinate system.
1580
1581         (WebCore::cachedImageRect):
1582             Calculate the rectangle of the cached image such that it does not
1583             exceed the limit. Start from the center of the dirty rectangle and
1584             then expand around it.
1585             
1586         (WebCore::PDFDocumentImage::decodedSizeChanged):
1587             In addition to notifying the ImageObserver, it keeps track of the size
1588             of all the cached PDF images.
1589
1590         (WebCore::PDFDocumentImage::updateCachedImageIfNeeded):
1591             Ensure the size of all the cached images does not exceed the limit
1592             
1593         (WebCore::PDFDocumentImage::destroyDecodedData):
1594         * platform/graphics/cg/PDFDocumentImage.h:
1595
1596         * rendering/RenderImage.cpp:
1597         (WebCore::RenderImage::paintIntoRect):
1598             Pass the option to disable caching the PDF images to PDFDocumentImage.
1599
1600         * testing/InternalSettings.cpp:
1601         (WebCore::InternalSettings::Backup::Backup):
1602         (WebCore::InternalSettings::Backup::restoreTo):
1603         (WebCore::InternalSettings::setCachedPDFImageEnabled):
1604         * testing/InternalSettings.h:
1605         * testing/InternalSettings.idl:
1606             Add an internal option to disable caching the PDF images.
1607
1608 2016-07-18  Chris Dumez  <cdumez@apple.com>
1609
1610         The 2 first parameters to addEventListener() / removeEventListener() should be mandatory
1611         https://bugs.webkit.org/show_bug.cgi?id=158008
1612
1613         Reviewed by Darin Adler.
1614
1615         The 2 first parameters to addEventListener() / removeEventListener() should be
1616         mandatory:
1617         - https://dom.spec.whatwg.org/#interface-eventtarget
1618
1619         Firefox 46 and Chrome 50 both match the specification and throw an exception when those
1620         parameters are omitted. However, those parameters were marked as optional in WebKit and
1621         the calls were no-ops if those parameters were omitted. This patch aligns our behavior
1622         with the specification and other browsers.
1623
1624         Test: fast/dom/eventtarget-api-parameters.html
1625
1626         * bindings/scripts/CodeGeneratorJS.pm:
1627         (GetFunctionLength): Deleted.
1628         * dom/EventTarget.idl:
1629
1630 2016-07-18  Brent Fulgham  <bfulgham@apple.com>
1631
1632         Unreviewed, rolling out r203373.
1633
1634         Unaddressed
1635
1636         Reverted changeset:
1637
1638         "Don't associate form-associated elements with forms in other
1639         trees."
1640         https://bugs.webkit.org/show_bug.cgi?id=119451
1641         http://trac.webkit.org/changeset/203373
1642
1643 2016-07-18  Brent Fulgham  <bfulgham@apple.com>
1644
1645         Don't associate form-associated elements with forms in other trees.
1646         https://bugs.webkit.org/show_bug.cgi?id=119451
1647         <rdar://problem/27382946>
1648
1649         Change is based on the Blink change (patch by <adamk@chromium.org>):
1650         <https://chromium.googlesource.com/chromium/blink/+/0b33128be67e7845d495d5219614c02ccfe7a414>
1651
1652         Reviewed by Zalan Bujtas.
1653
1654         Prevent elements from being associated with forms that are not part of the same home subtree.
1655         This brings us in line with the WhatWG HTML specification as of September, 2013.
1656
1657         Tests: fast/forms/image-disconnected-during-parse.html
1658                fast/forms/input-disconnected-during-parse.html
1659
1660         * dom/NodeTraversal.h:
1661         (WebCore::NodeTraversal::highestAncestorOrSelf): Added.
1662         * html/FormAssociatedElement.cpp:
1663         (WebCore::FormAssociatedElement::insertedInto): If the element is associated with a form that
1664         is not part of the same tree, remove the association.
1665         * html/HTMLImageElement.cpp:
1666         (WebCore::HTMLImageElement::insertedInto): Ditto.
1667
1668 2016-07-18  George Ruan  <gruan@apple.com>
1669
1670         Move MediaSampleAVFObjC into its own file
1671         https://bugs.webkit.org/show_bug.cgi?id=159796
1672         <rdar://problem/27362488>
1673
1674         In preparation for a feature that uses MediaSampleAVFObjC, but does
1675         not need SourceBufferPrivateAVFObjC, it is beneficial to move
1676         MediaSampleAVFObjC to its own file.
1677
1678         Reviewed by Eric Carlson.
1679
1680         * WebCore.xcodeproj/project.pbxproj:
1681         * platform/MediaSample.h: Allow setting trackID to associate
1682         MediaSample id with MediaStreamTrackPrivate id.
1683         * platform/graphics/avfoundation/MediaSampleAVFObjC.h: Added.
1684         * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm: Moved
1685         from MediaSampleAVFObjC
1686         (WebCore::MediaSampleAVFObjC::presentationTime):
1687         (WebCore::MediaSampleAVFObjC::decodeTime):
1688         (WebCore::MediaSampleAVFObjC::duration):
1689         (WebCore::MediaSampleAVFObjC::sizeInBytes):
1690         (WebCore::MediaSampleAVFObjC::platformSample):
1691         (WebCore::CMSampleBufferIsRandomAccess):
1692         (WebCore::MediaSampleAVFObjC::flags):
1693         (WebCore::MediaSampleAVFObjC::presentationSize):
1694         (WebCore::MediaSampleAVFObjC::dump):
1695         (WebCore::MediaSampleAVFObjC::offsetTimestampsBy):
1696         (WebCore::MediaSampleAVFObjC::setTimestamps):
1697         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1698         Moved MediaSampleAVFObjC to its own file.
1699         (WebCore::MediaSampleAVFObjC::platformSample): Deleted.
1700         (WebCore::CMSampleBufferIsRandomAccess): Deleted.
1701         (WebCore::MediaSampleAVFObjC::flags): Deleted.
1702         (WebCore::MediaSampleAVFObjC::presentationSize): Deleted.
1703         (WebCore::MediaSampleAVFObjC::dump): Deleted.
1704         (WebCore::MediaSampleAVFObjC::offsetTimestampsBy): Deleted.
1705         (WebCore::MediaSampleAVFObjC::setTimestamps): Deleted.
1706         * platform/mock/mediasource/MockSourceBufferPrivate.cpp:
1707
1708 2016-07-18  Eric Carlson  <eric.carlson@apple.com>
1709
1710         [MSE][Mac] Pass AVSampleBufferDisplayLayer HDCP status to a newly created key session
1711         https://bugs.webkit.org/show_bug.cgi?id=159812
1712         <rdar://problem/27371624>
1713
1714         Reviewed by Jon Lee.
1715
1716         No new tests, it isn't possible to test this with our current testing infrastructure.
1717
1718         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
1719         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1720         (WebCore::SourceBufferPrivateAVFObjC::setCDMSession): Call layerDidReceiveError if there has
1721         been an HDCP error.
1722         (WebCore::SourceBufferPrivateAVFObjC::rendererDidReceiveError): Remember an HDCP error.
1723
1724 2016-07-18  Yoav Weiss  <yoav@yoav.ws>
1725
1726         Add preload to features.json
1727         https://bugs.webkit.org/show_bug.cgi?id=159872
1728
1729         Reviewed by Darin Adler.
1730
1731         No new tests but no functional change.
1732
1733         * features.json:
1734
1735 2016-07-18  Youenn Fablet  <youenn@apple.com>
1736
1737         [Streams API] ReadableStream should throw a RangeError in case of NaN highWaterMark
1738         https://bugs.webkit.org/show_bug.cgi?id=159870
1739
1740         Reviewed by Xabier Rodriguez-Calvar.
1741
1742         Covered by rebased test.
1743
1744         * Modules/streams/StreamInternals.js:
1745         (validateAndNormalizeQueuingStrategy): Throwing a RangeError in lieu of a TypeError in case of NaN highWaterMark.
1746
1747 2016-07-18  Csaba Osztrogon√°c  <ossy@webkit.org>
1748
1749         Windows buildfix after r203338
1750         https://bugs.webkit.org/show_bug.cgi?id=159875
1751
1752         Unreviewed buildfix.
1753
1754         * dom/UserGestureIndicator.h:
1755         (WebCore::UserGestureToken::addDestructionObserver):
1756
1757 2016-07-18  Carlos Garcia Campos  <cgarcia@igalia.com>
1758
1759         MemoryPressureHandler doesn't work if cgroups aren't present in Linux
1760         https://bugs.webkit.org/show_bug.cgi?id=155255
1761
1762         Reviewed by Sergio Villar Senin.
1763
1764         Allow to pass an eventFD file descriptor to the MemoryPressureHandler to be monitorized in case cgroups are not
1765         available.
1766
1767         * platform/MemoryPressureHandler.h:
1768         * platform/linux/MemoryPressureHandlerLinux.cpp:
1769
1770 2016-07-17  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
1771
1772         Clean up PassRefPtr uses in Modules/encryptedmedia, Modules/speech, and Modules/quota
1773         https://bugs.webkit.org/show_bug.cgi?id=159701
1774
1775         Reviewed by Alex Christensen.
1776
1777         No new tests, no behavior changes.
1778
1779         * Modules/encryptedmedia/CDM.h:
1780         * Modules/encryptedmedia/MediaKeySession.h:
1781         * Modules/encryptedmedia/MediaKeys.h:
1782         * Modules/quota/DOMWindowQuota.cpp:
1783         * Modules/quota/StorageErrorCallback.cpp:
1784         (WebCore::StorageErrorCallback::CallbackTask::CallbackTask):
1785         * Modules/quota/StorageErrorCallback.h:
1786         * Modules/quota/StorageInfo.h:
1787         * Modules/quota/StorageQuota.h:
1788         * Modules/speech/DOMWindowSpeechSynthesis.cpp:
1789         * Modules/speech/SpeechSynthesis.cpp:
1790         (WebCore::SpeechSynthesis::getVoices):
1791         (WebCore::SpeechSynthesis::startSpeakingImmediately):
1792         (WebCore::SpeechSynthesis::speak):
1793         (WebCore::SpeechSynthesis::cancel):
1794         (WebCore::SpeechSynthesis::handleSpeakingCompleted):
1795         (WebCore::SpeechSynthesis::boundaryEventOccurred):
1796         (WebCore::SpeechSynthesis::didStartSpeaking):
1797         (WebCore::SpeechSynthesis::didPauseSpeaking):
1798         (WebCore::SpeechSynthesis::didResumeSpeaking):
1799         (WebCore::SpeechSynthesis::didFinishSpeaking):
1800         (WebCore::SpeechSynthesis::speakingErrorOccurred):
1801         * Modules/speech/SpeechSynthesis.h:
1802         * Modules/speech/SpeechSynthesisEvent.h:
1803         * Modules/speech/SpeechSynthesisUtterance.h:
1804         * Modules/speech/SpeechSynthesisVoice.cpp:
1805         (WebCore::SpeechSynthesisVoice::create):
1806         (WebCore::SpeechSynthesisVoice::SpeechSynthesisVoice):
1807         * Modules/speech/SpeechSynthesisVoice.h:
1808         * platform/PlatformSpeechSynthesizer.h:
1809         * platform/efl/PlatformSpeechSynthesisProviderEfl.cpp:
1810         (WebCore::PlatformSpeechSynthesisProviderEfl::fireSpeechEvent):
1811         * platform/mock/PlatformSpeechSynthesizerMock.cpp:
1812         (WebCore::PlatformSpeechSynthesizerMock::speakingFinished):
1813         (WebCore::PlatformSpeechSynthesizerMock::speak):
1814         (WebCore::PlatformSpeechSynthesizerMock::cancel):
1815         (WebCore::PlatformSpeechSynthesizerMock::pause):
1816         (WebCore::PlatformSpeechSynthesizerMock::resume):
1817
1818 2016-07-16  Sam Weinig  <sam@webkit.org>
1819
1820         [WebKit API] Add SPI to track multiple navigations caused by a single user gesture
1821         <rdar://problem/26554137>
1822         https://bugs.webkit.org/show_bug.cgi?id=159856
1823
1824         Reviewed by Dan Bernstein.
1825
1826         - Adds a new RefCounted object to represent a unique user gesture, called UserGestureToken.
1827         - Makes UserGestureIndicator track UserGestureToken.
1828         - Refines UserGestureIndicator's interface to use Optional and a smaller enum set
1829           to represent the different initial states.
1830         - Stores UserGestureTokens on objects that want to forward user gesture state (DOMTimer, 
1831           postMessage, and ScheduledNavigation) rather than just a boolean.
1832
1833         * accessibility/AccessibilityNodeObject.cpp:
1834         (WebCore::AccessibilityNodeObject::increment):
1835         (WebCore::AccessibilityNodeObject::decrement):
1836         * accessibility/AccessibilityObject.cpp:
1837         (WebCore::AccessibilityObject::press):
1838         * bindings/js/ScriptController.cpp:
1839         (WebCore::ScriptController::executeScriptInWorld):
1840         (WebCore::ScriptController::executeScript):
1841         Update for new UserGestureIndicator interface.
1842
1843         * dom/UserGestureIndicator.cpp:
1844         (WebCore::currentToken):
1845         (WebCore::UserGestureToken::~UserGestureToken):
1846         (WebCore::UserGestureIndicator::UserGestureIndicator):
1847         (WebCore::UserGestureIndicator::~UserGestureIndicator):
1848         (WebCore::UserGestureIndicator::currentUserGesture):
1849         (WebCore::UserGestureIndicator::processingUserGesture):
1850         (WebCore::UserGestureIndicator::processingUserGestureForMedia):
1851         (WebCore::isDefinite): Deleted.
1852         * dom/UserGestureIndicator.h:
1853         (WebCore::UserGestureToken::create):
1854         (WebCore::UserGestureToken::state):
1855         (WebCore::UserGestureToken::processingUserGesture):
1856         (WebCore::UserGestureToken::processingUserGestureForMedia):
1857         (WebCore::UserGestureToken::addDestructionObserver):
1858         (WebCore::UserGestureToken::UserGestureToken):
1859         Add UserGestureToken and track the current one explicitly.
1860
1861         * html/HTMLMediaElement.cpp:
1862         (WebCore::HTMLMediaElement::didReceiveRemoteControlCommand):
1863         * inspector/InspectorFrontendClientLocal.cpp:
1864         (WebCore::InspectorFrontendClientLocal::openInNewTab):
1865         * inspector/InspectorFrontendHost.cpp:
1866         * inspector/InspectorPageAgent.cpp:
1867         (WebCore::InspectorPageAgent::navigate):
1868         Update for new UserGestureIndicator interface.
1869
1870         * loader/NavigationAction.cpp:
1871         (WebCore::NavigationAction::NavigationAction):
1872         * loader/NavigationAction.h:
1873         (WebCore::NavigationAction::userGestureToken):
1874         (WebCore::NavigationAction::processingUserGesture):
1875         * loader/NavigationScheduler.cpp:
1876         (WebCore::ScheduledNavigation::ScheduledNavigation):
1877         (WebCore::ScheduledNavigation::~ScheduledNavigation):
1878         (WebCore::ScheduledNavigation::lockBackForwardList):
1879         (WebCore::ScheduledNavigation::wasDuringLoad):
1880         (WebCore::ScheduledNavigation::isLocationChange):
1881         (WebCore::ScheduledNavigation::userGestureToForward):
1882         (WebCore::ScheduledNavigation::clearUserGesture):
1883         (WebCore::NavigationScheduler::mustLockBackForwardList):
1884         (WebCore::NavigationScheduler::scheduleFormSubmission):
1885         (WebCore::ScheduledNavigation::wasUserGesture): Deleted.
1886         * page/DOMTimer.cpp:
1887         (WebCore::shouldForwardUserGesture):
1888         (WebCore::userGestureTokenToForward):
1889         (WebCore::DOMTimer::DOMTimer):
1890         (WebCore::DOMTimer::fired):
1891         * page/DOMTimer.h:
1892         * page/DOMWindow.cpp:
1893         (WebCore::PostMessageTimer::PostMessageTimer):
1894         Store the active UserGestureToken rather than just a bit.
1895
1896         * page/EventHandler.cpp:
1897         (WebCore::EventHandler::handleMousePressEvent):
1898         (WebCore::EventHandler::handleMouseDoubleClickEvent):
1899         (WebCore::EventHandler::handleMouseReleaseEvent):
1900         (WebCore::EventHandler::keyEvent):
1901         (WebCore::EventHandler::handleTouchEvent):
1902         * rendering/HitTestResult.cpp:
1903         (WebCore::HitTestResult::toggleMediaFullscreenState):
1904         (WebCore::HitTestResult::enterFullscreenForVideo):
1905         (WebCore::HitTestResult::toggleEnhancedFullscreenForVideo):
1906         Update for new UserGestureIndicator interface.
1907
1908 2016-07-17  Ryosuke Niwa  <rniwa@webkit.org>
1909
1910         Rename fastHasAttribute to hasAttributeWithoutSynchronization
1911         https://bugs.webkit.org/show_bug.cgi?id=159864
1912
1913         Reviewed by Chris Dumez.
1914
1915         Renamed Rename fastHasAttribute to hasAttributeWithoutSynchronization for clarity.
1916
1917         * accessibility/AccessibilityListBoxOption.cpp:
1918         (WebCore::AccessibilityListBoxOption::isEnabled):
1919         * accessibility/AccessibilityObject.cpp:
1920         (WebCore::AccessibilityObject::hasAttribute):
1921         (WebCore::AccessibilityObject::getAttribute):
1922         * accessibility/AccessibilityRenderObject.cpp:
1923         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
1924         * bindings/scripts/CodeGenerator.pm:
1925         (GetterExpression):
1926         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
1927         * bindings/scripts/test/JS/JSTestObj.cpp:
1928         (WebCore::jsTestObjReflectedBooleanAttr):
1929         (WebCore::jsTestObjReflectedCustomBooleanAttr):
1930         * bindings/scripts/test/ObjC/DOMTestObj.mm:
1931         (-[DOMTestObj reflectedBooleanAttr]):
1932         (-[DOMTestObj setReflectedBooleanAttr:]):
1933         (-[DOMTestObj reflectedCustomBooleanAttr]):
1934         (-[DOMTestObj setReflectedCustomBooleanAttr:]):
1935         * dom/Document.cpp:
1936         (WebCore::Document::hasManifest):
1937         (WebCore::Document::doctype):
1938         * dom/Element.h:
1939         (WebCore::Node::parentElement):
1940         (WebCore::Element::hasAttributeWithoutSynchronization):
1941         (WebCore::Element::fastHasAttribute): Deleted.
1942         * editing/ApplyStyleCommand.cpp:
1943         (WebCore::ApplyStyleCommand::removeEmbeddingUpToEnclosingBlock):
1944         * editing/DeleteSelectionCommand.cpp:
1945         (WebCore::DeleteSelectionCommand::makeStylingElementsDirectChildrenOfEditableRootToPreventStyleLoss):
1946         * editing/markup.cpp:
1947         (WebCore::createMarkupInternal):
1948         * html/ColorInputType.cpp:
1949         (WebCore::ColorInputType::shouldShowSuggestions):
1950         * html/FileInputType.cpp:
1951         (WebCore::FileInputType::handleDOMActivateEvent):
1952         (WebCore::FileInputType::receiveDroppedFiles):
1953         * html/FormAssociatedElement.cpp:
1954         (WebCore::FormAssociatedElement::didMoveToNewDocument):
1955         (WebCore::FormAssociatedElement::insertedInto):
1956         (WebCore::FormAssociatedElement::removedFrom):
1957         (WebCore::FormAssociatedElement::formAttributeChanged):
1958         * html/FormController.cpp:
1959         (WebCore::ownerFormForState):
1960         * html/GenericCachedHTMLCollection.cpp:
1961         (WebCore::GenericCachedHTMLCollection<traversalType>::elementMatches):
1962         * html/HTMLAnchorElement.cpp:
1963         (WebCore::HTMLAnchorElement::draggable):
1964         (WebCore::HTMLAnchorElement::href):
1965         (WebCore::HTMLAnchorElement::sendPings):
1966         * html/HTMLAppletElement.cpp:
1967         (WebCore::HTMLAppletElement::rendererIsNeeded):
1968         * html/HTMLElement.cpp:
1969         (WebCore::HTMLElement::collectStyleForPresentationAttribute):
1970         (WebCore::elementAffectsDirectionality):
1971         (WebCore::setHasDirAutoFlagRecursively):
1972         * html/HTMLEmbedElement.cpp:
1973         (WebCore::HTMLEmbedElement::rendererIsNeeded):
1974         * html/HTMLFieldSetElement.cpp:
1975         (WebCore::updateFromControlElementsAncestorDisabledStateUnder):
1976         (WebCore::HTMLFieldSetElement::disabledAttributeChanged):
1977         (WebCore::HTMLFieldSetElement::disabledStateChanged):
1978         (WebCore::HTMLFieldSetElement::childrenChanged):
1979         * html/HTMLFormControlElement.cpp:
1980         (WebCore::HTMLFormControlElement::formNoValidate):
1981         (WebCore::HTMLFormControlElement::formAction):
1982         (WebCore::HTMLFormControlElement::computeIsDisabledByFieldsetAncestor):
1983         (WebCore::shouldAutofocus):
1984         * html/HTMLFormElement.cpp:
1985         (WebCore::HTMLFormElement::formElementIndex):
1986         (WebCore::HTMLFormElement::noValidate):
1987         * html/HTMLFrameElement.cpp:
1988         (WebCore::HTMLFrameElement::noResize):
1989         (WebCore::HTMLFrameElement::didAttachRenderers):
1990         * html/HTMLFrameElementBase.cpp:
1991         (WebCore::HTMLFrameElementBase::parseAttribute):
1992         (WebCore::HTMLFrameElementBase::location):
1993         * html/HTMLHRElement.cpp:
1994         (WebCore::HTMLHRElement::collectStyleForPresentationAttribute):
1995         * html/HTMLImageElement.cpp:
1996         (WebCore::HTMLImageElement::isServerMap):
1997         * html/HTMLInputElement.cpp:
1998         (WebCore::HTMLInputElement::finishParsingChildren):
1999         (WebCore::HTMLInputElement::matchesDefaultPseudoClass):
2000         (WebCore::HTMLInputElement::isActivatedSubmit):
2001         (WebCore::HTMLInputElement::reset):
2002         (WebCore::HTMLInputElement::multiple):
2003         (WebCore::HTMLInputElement::setSize):
2004         (WebCore::HTMLInputElement::shouldUseMediaCapture):
2005         * html/HTMLMarqueeElement.cpp:
2006         (WebCore::HTMLMarqueeElement::minimumDelay):
2007         * html/HTMLMediaElement.cpp:
2008         (WebCore::HTMLMediaElement::insertedInto):
2009         (WebCore::HTMLMediaElement::selectMediaResource):
2010         (WebCore::HTMLMediaElement::loadResource):
2011         (WebCore::HTMLMediaElement::autoplay):
2012         (WebCore::HTMLMediaElement::preload):
2013         (WebCore::HTMLMediaElement::loop):
2014         (WebCore::HTMLMediaElement::setLoop):
2015         (WebCore::HTMLMediaElement::controls):
2016         (WebCore::HTMLMediaElement::setControls):
2017         (WebCore::HTMLMediaElement::muted):
2018         (WebCore::HTMLMediaElement::setMuted):
2019         (WebCore::HTMLMediaElement::selectNextSourceChild):
2020         (WebCore::HTMLMediaElement::sourceWasAdded):
2021         (WebCore::HTMLMediaElement::mediaSessionTitle):
2022         * html/HTMLObjectElement.cpp:
2023         (WebCore::HTMLObjectElement::parseAttribute):
2024         * html/HTMLOptGroupElement.cpp:
2025         (WebCore::HTMLOptGroupElement::isDisabledFormControl):
2026         (WebCore::HTMLOptGroupElement::isFocusable):
2027         * html/HTMLOptionElement.cpp:
2028         (WebCore::HTMLOptionElement::matchesDefaultPseudoClass):
2029         (WebCore::HTMLOptionElement::text):
2030         * html/HTMLProgressElement.cpp:
2031         (WebCore::HTMLProgressElement::isDeterminate):
2032         (WebCore::HTMLProgressElement::didElementStateChange):
2033         * html/HTMLScriptElement.cpp:
2034         (WebCore::HTMLScriptElement::async):
2035         (WebCore::HTMLScriptElement::setCrossOrigin):
2036         (WebCore::HTMLScriptElement::asyncAttributeValue):
2037         (WebCore::HTMLScriptElement::deferAttributeValue):
2038         (WebCore::HTMLScriptElement::hasSourceAttribute):
2039         (WebCore::HTMLScriptElement::dispatchLoadEvent):
2040         * html/HTMLSelectElement.cpp:
2041         (WebCore::HTMLSelectElement::reset):
2042         * html/HTMLTrackElement.cpp:
2043         (WebCore::HTMLTrackElement::isDefault):
2044         (WebCore::HTMLTrackElement::ensureTrack):
2045         (WebCore::HTMLTrackElement::loadTimerFired):
2046         * html/MediaElementSession.cpp:
2047         (WebCore::MediaElementSession::wirelessVideoPlaybackDisabled):
2048         (WebCore::MediaElementSession::requiresFullscreenForVideoPlayback):
2049         (WebCore::MediaElementSession::allowsAutomaticMediaDataLoading):
2050         * html/SearchInputType.cpp:
2051         (WebCore::SearchInputType::searchEventsShouldBeDispatched):
2052         (WebCore::SearchInputType::didSetValueByUserEdit):
2053         * inspector/InspectorDOMAgent.cpp:
2054         (WebCore::InspectorDOMAgent::buildObjectForNode):
2055         * loader/FrameLoader.cpp:
2056         (WebCore::FrameLoader::shouldTreatURLAsSrcdocDocument):
2057         (WebCore::FrameLoader::findFrameForNavigation):
2058         * loader/ImageLoader.cpp:
2059         (WebCore::ImageLoader::notifyFinished):
2060         * mathml/MathMLSelectElement.cpp:
2061         (WebCore::MathMLSelectElement::getSelectedSemanticsChild):
2062         * rendering/RenderTableCell.cpp:
2063         (WebCore::RenderTableCell::computePreferredLogicalWidths):
2064         * rendering/RenderThemeIOS.mm:
2065         (WebCore::RenderThemeIOS::adjustMenuListButtonStyle):
2066         * rendering/SimpleLineLayout.cpp:
2067         (WebCore::SimpleLineLayout::canUseForWithReason):
2068         * rendering/svg/RenderSVGResourceClipper.cpp:
2069         (WebCore::RenderSVGResourceClipper::drawContentIntoMaskImage):
2070         * svg/SVGAnimateMotionElement.cpp:
2071         (WebCore::SVGAnimateMotionElement::updateAnimationPath):
2072         * svg/SVGAnimationElement.cpp:
2073         (WebCore::SVGAnimationElement::startedActiveInterval):
2074         (WebCore::SVGAnimationElement::updateAnimation):
2075         * svg/animation/SVGSMILElement.cpp:
2076         (WebCore::SVGSMILElement::insertedInto):
2077
2078 2016-07-17  Brady Eidson  <beidson@apple.com>
2079
2080         Exceptions logged to the JS console should use toString().
2081         https://bugs.webkit.org/show_bug.cgi?id=159855
2082
2083         Reviewed by Darin Adler.
2084
2085         No new tests (No change in behavior).
2086
2087         * bindings/js/JSDOMBinding.cpp:
2088         (WebCore::reportException):
2089
2090         * dom/DOMCoreException.h:
2091         (WebCore::DOMCoreException::DOMCoreException):
2092
2093         * dom/ExceptionBase.cpp:
2094         (WebCore::ExceptionBase::ExceptionBase):
2095         (WebCore::ExceptionBase::toString):
2096         (WebCore::ExceptionBase::consoleErrorMessage): Deleted.
2097         * dom/ExceptionBase.h:
2098         (WebCore::ExceptionBase::description): Deleted.
2099
2100         * svg/SVGException.h:
2101
2102         * xml/XPathException.h:
2103         (WebCore::XPathException::XPathException):
2104
2105 2016-07-17  Brady Eidson  <beidson@apple.com>
2106
2107         Update DOMCoreException to use the description in toString().
2108         https://bugs.webkit.org/show_bug.cgi?id=159857
2109
2110         Reviewed by Darin Adler.
2111
2112         No new tests (Covered by changes to existing tests).
2113
2114         * bindings/js/JSDOMBinding.cpp:
2115         (WebCore::createDOMException):
2116
2117         * dom/DOMCoreException.h:
2118         (WebCore::DOMCoreException::DOMCoreException):
2119         (WebCore::DOMCoreException::createWithDescriptionAsMessage): Deleted.
2120
2121 2016-07-17  Myles C. Maxfield  <mmaxfield@apple.com>
2122
2123         Support new emoji group candidates
2124         https://bugs.webkit.org/show_bug.cgi?id=159755
2125         <rdar://problem/27325521>
2126
2127         Reviewed by Dean Jackson.
2128
2129         There are a few code points which should be able to be joined (with ZWJ) to
2130         either U+2640 or U+2642 to change the gender of the emoji. These patterns
2131         should also work with an additional 0xFE0F variation selector. This patch
2132         adds these new patterns to our existing emoji group candidate infrastructure.
2133
2134         Tests: fast/text/emoji-gender-2-3.html
2135                fast/text/emoji-gender-2-4.html
2136                fast/text/emoji-gender-2-5.html
2137                fast/text/emoji-gender-2-6.html
2138                fast/text/emoji-gender-2-7.html
2139                fast/text/emoji-gender-2-8.html
2140                fast/text/emoji-gender-2-9.html
2141                fast/text/emoji-gender-2.html
2142                fast/text/emoji-gender-3.html
2143                fast/text/emoji-gender-4.html
2144                fast/text/emoji-gender-5.html
2145                fast/text/emoji-gender-6.html
2146                fast/text/emoji-gender-7.html
2147                fast/text/emoji-gender-8.html
2148                fast/text/emoji-gender-9.html
2149                fast/text/emoji-gender-fe0f-3.html
2150                fast/text/emoji-gender-fe0f-4.html
2151                fast/text/emoji-gender-fe0f-5.html
2152                fast/text/emoji-gender-fe0f-6.html
2153                fast/text/emoji-gender-fe0f-7.html
2154                fast/text/emoji-gender-fe0f-8.html
2155                fast/text/emoji-gender-fe0f-9.html
2156                fast/text/emoji-gender.html
2157                fast/text/emoji-num-glyphs.html
2158                fast/text/emoji-single-parent-family-2.html
2159                fast/text/emoji-single-parent-family.html
2160
2161         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
2162         (WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun): Removed incorrect ASSERT()s.
2163         * platform/graphics/FontCascade.cpp:
2164         (WebCore::FontCascade::characterRangeCodePath):
2165         * platform/text/CharacterProperties.h:
2166         (WebCore::isEmojiGroupCandidate):
2167
2168 2016-07-16  Brady Eidson  <beidson@apple.com>
2169
2170         Update SVGException to use the description in toString().
2171         https://bugs.webkit.org/show_bug.cgi?id=159847
2172
2173         Reviewed by Darin Adler.
2174
2175         No new tests (Covered by changes to existing tests).
2176
2177         * bindings/js/JSDOMBinding.cpp:
2178         (WebCore::reportException): use consoleErrorMessage for now.
2179
2180         * dom/ExceptionBase.cpp:
2181         (WebCore::ExceptionBase::consoleErrorMessage):
2182         * dom/ExceptionBase.h:
2183
2184         * svg/SVGException.h:
2185
2186 2016-07-16  Chris Dumez  <cdumez@apple.com>
2187
2188         Use fastHasAttribute() when possible
2189         https://bugs.webkit.org/show_bug.cgi?id=159838
2190
2191         Reviewed by Ryosuke Niwa.
2192
2193         Use fastHasAttribute() when possible, for performance.
2194
2195         * editing/DeleteSelectionCommand.cpp:
2196         (WebCore::DeleteSelectionCommand::makeStylingElementsDirectChildrenOfEditableRootToPreventStyleLoss):
2197         * editing/markup.cpp:
2198         (WebCore::createMarkupInternal):
2199         * html/HTMLAnchorElement.cpp:
2200         (WebCore::HTMLAnchorElement::draggable):
2201         * html/HTMLFrameElementBase.cpp:
2202         (WebCore::HTMLFrameElementBase::parseAttribute):
2203         * mathml/MathMLSelectElement.cpp:
2204         (WebCore::MathMLSelectElement::getSelectedSemanticsChild):
2205         * rendering/RenderThemeIOS.mm:
2206         (WebCore::RenderThemeIOS::adjustMenuListButtonStyle):
2207
2208 2016-07-16  Ryosuke Niwa  <rniwa@webkit.org>
2209
2210         Rename fastGetAttribute to attributeWithoutSynchronization
2211         https://bugs.webkit.org/show_bug.cgi?id=159852
2212
2213         Reviewed by Darin Adler.
2214
2215         Renamed fastGetAttribute to attributeWithoutSynchronization for clarity.
2216
2217         * accessibility/AXObjectCache.cpp:
2218         (WebCore::AXObjectCache::findAriaModalNodes):
2219         (WebCore::nodeHasRole):
2220         (WebCore::AXObjectCache::handleLiveRegionCreated):
2221         (WebCore::AXObjectCache::handleMenuItemSelected):
2222         (WebCore::AXObjectCache::handleAriaModalChange):
2223         (WebCore::isNodeAriaVisible):
2224         * accessibility/AccessibilityNodeObject.cpp:
2225         (WebCore::siblingWithAriaRole):
2226         (WebCore::AccessibilityNodeObject::titleElementText):
2227         (WebCore::AccessibilityNodeObject::alternativeTextForWebArea):
2228         (WebCore::AccessibilityNodeObject::hierarchicalLevel):
2229         (WebCore::AccessibilityNodeObject::stringValue):
2230         (WebCore::accessibleNameForNode):
2231         * accessibility/AccessibilityObject.cpp:
2232         (WebCore::AccessibilityObject::contentEditableAttributeIsEnabled):
2233         (WebCore::AccessibilityObject::getAttribute):
2234         * accessibility/AccessibilityRenderObject.cpp:
2235         (WebCore::AccessibilityRenderObject::stringValue):
2236         (WebCore::AccessibilityRenderObject::exposesTitleUIElement):
2237         * accessibility/AccessibilitySVGElement.cpp:
2238         (WebCore::AccessibilitySVGElement::childElementWithMatchingLanguage):
2239         (WebCore::AccessibilitySVGElement::accessibilityDescription):
2240         * bindings/objc/DOM.mm:
2241         (-[DOMHTMLLinkElement _mediaQueryMatches]):
2242         * bindings/scripts/CodeGenerator.pm:
2243         (GetterExpression):
2244         * bindings/scripts/CodeGeneratorObjC.pm:
2245         (GenerateImplementation):
2246         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
2247         * bindings/scripts/test/JS/JSTestObj.cpp:
2248         (WebCore::jsTestObjReflectedStringAttr):
2249         * dom/AuthorStyleSheets.cpp:
2250         (WebCore::AuthorStyleSheets::collectActiveStyleSheets):
2251         * dom/Document.cpp:
2252         (WebCore::Document::buildAccessKeyMap):
2253         (WebCore::Document::processBaseElement):
2254         * dom/DocumentOrderedMap.cpp:
2255         (WebCore::DocumentOrderedMap::getElementByLabelForAttribute):
2256         * dom/Element.cpp:
2257         (WebCore::Element::imageSourceURL):
2258         (WebCore::Element::rendererIsNeeded):
2259         (WebCore::Element::insertedInto):
2260         (WebCore::Element::removedFrom):
2261         (WebCore::Element::pseudo):
2262         (WebCore::Element::setPseudo):
2263         (WebCore::Element::spellcheckAttributeState):
2264         (WebCore::Element::canContainRangeEndPoint):
2265         (WebCore::Element::completeURLsInAttributeValue):
2266         * dom/Element.h:
2267         (WebCore::Element::fastHasAttribute):
2268         (WebCore::Element::attributeWithoutSynchronization):
2269         (WebCore::Element::fastGetAttribute): Deleted.
2270         * dom/InlineStyleSheetOwner.cpp:
2271         (WebCore::InlineStyleSheetOwner::createSheet):
2272         * dom/ScriptElement.cpp:
2273         (WebCore::ScriptElement::requestScript):
2274         (WebCore::ScriptElement::executeScript):
2275         * dom/SlotAssignment.cpp:
2276         (WebCore::slotNameFromSlotAttribute):
2277         (WebCore::SlotAssignment::SlotAssignment):
2278         (WebCore::recursivelyFireSlotChangeEvent):
2279         (WebCore::SlotAssignment::didChangeSlot):
2280         (WebCore::SlotAssignment::hostChildElementDidChange):
2281         (WebCore::SlotAssignment::assignedNodesForSlot):
2282         (WebCore::SlotAssignment::resolveAllSlotElements):
2283         * dom/TreeScope.cpp:
2284         (WebCore::TreeScope::labelElementForId):
2285         * dom/VisitedLinkState.cpp:
2286         (WebCore::linkAttribute):
2287         * editing/ApplyStyleCommand.cpp:
2288         (WebCore::isLegacyAppleStyleSpan):
2289         (WebCore::hasNoAttributeOrOnlyStyleAttribute):
2290         * editing/EditingStyle.cpp:
2291         (WebCore::EditingStyle::elementIsStyledSpanOrHTMLEquivalent):
2292         * editing/ReplaceSelectionCommand.cpp:
2293         (WebCore::isInterchangeNewlineNode):
2294         (WebCore::isInterchangeConvertedSpaceSpan):
2295         (WebCore::positionAvoidingPrecedingNodes):
2296         (WebCore::isMailPasteAsQuotationNode):
2297         (WebCore::isHeaderElement):
2298         (WebCore::isInlineNodeWithStyle):
2299         * editing/TextIterator.cpp:
2300         (WebCore::isRendererReplacedElement):
2301         * editing/cocoa/DataDetection.mm:
2302         (WebCore::DataDetection::isDataDetectorLink):
2303         (WebCore::DataDetection::requiresExtendedContext):
2304         (WebCore::DataDetection::dataDetectorIdentifier):
2305         (WebCore::DataDetection::shouldCancelDefaultAction):
2306         (WebCore::removeResultLinksFromAnchor):
2307         (WebCore::searchForLinkRemovingExistingDDLinks):
2308         * editing/gtk/EditorGtk.cpp:
2309         (WebCore::elementURL):
2310         * editing/htmlediting.cpp:
2311         (WebCore::isTabSpanNode):
2312         (WebCore::isTabSpanTextNode):
2313         (WebCore::isMailBlockquote):
2314         (WebCore::caretMinOffset):
2315         * editing/markup.cpp:
2316         (WebCore::createFragmentFromMarkup):
2317         * html/Autofill.cpp:
2318         (WebCore::AutofillData::createFromHTMLFormControlElement):
2319         * html/BaseTextInputType.cpp:
2320         (WebCore::BaseTextInputType::patternMismatch):
2321         * html/DateInputType.cpp:
2322         (WebCore::DateInputType::createStepRange):
2323         * html/DateTimeInputType.cpp:
2324         (WebCore::DateTimeInputType::createStepRange):
2325         * html/DateTimeLocalInputType.cpp:
2326         (WebCore::DateTimeLocalInputType::createStepRange):
2327         * html/FormAssociatedElement.cpp:
2328         (WebCore::FormAssociatedElement::findAssociatedForm):
2329         (WebCore::FormAssociatedElement::resetFormAttributeTargetObserver):
2330         (WebCore::FormAssociatedElement::formAttributeTargetChanged):
2331         * html/HTMLAnchorElement.cpp:
2332         (WebCore::HTMLAnchorElement::draggable):
2333         (WebCore::HTMLAnchorElement::href):
2334         (WebCore::HTMLAnchorElement::setHref):
2335         (WebCore::HTMLAnchorElement::target):
2336         (WebCore::HTMLAnchorElement::origin):
2337         (WebCore::HTMLAnchorElement::sendPings):
2338         (WebCore::HTMLAnchorElement::handleClick):
2339         * html/HTMLAnchorElement.h:
2340         (WebCore::HTMLAnchorElement::visitedLinkHash):
2341         * html/HTMLAppletElement.cpp:
2342         (WebCore::HTMLAppletElement::updateWidget):
2343         * html/HTMLAreaElement.cpp:
2344         (WebCore::HTMLAreaElement::target):
2345         * html/HTMLAttachmentElement.cpp:
2346         (WebCore::HTMLAttachmentElement::attachmentTitle):
2347         (WebCore::HTMLAttachmentElement::attachmentType):
2348         * html/HTMLBaseElement.cpp:
2349         (WebCore::HTMLBaseElement::target):
2350         (WebCore::HTMLBaseElement::href):
2351         * html/HTMLBodyElement.cpp:
2352         (WebCore::HTMLBodyElement::addSubresourceAttributeURLs):
2353         * html/HTMLButtonElement.cpp:
2354         (WebCore::HTMLButtonElement::value):
2355         (WebCore::HTMLButtonElement::computeWillValidate):
2356         * html/HTMLCanvasElement.cpp:
2357         (WebCore::HTMLCanvasElement::reset):
2358         * html/HTMLDocument.cpp:
2359         (WebCore::HTMLDocument::bgColor):
2360         (WebCore::HTMLDocument::setBgColor):
2361         (WebCore::HTMLDocument::fgColor):
2362         (WebCore::HTMLDocument::setFgColor):
2363         (WebCore::HTMLDocument::alinkColor):
2364         (WebCore::HTMLDocument::setAlinkColor):
2365         (WebCore::HTMLDocument::linkColor):
2366         (WebCore::HTMLDocument::setLinkColor):
2367         (WebCore::HTMLDocument::vlinkColor):
2368         (WebCore::HTMLDocument::setVlinkColor):
2369         * html/HTMLElement.cpp:
2370         (WebCore::contentEditableType):
2371         (WebCore::HTMLElement::collectStyleForPresentationAttribute):
2372         (WebCore::HTMLElement::dir):
2373         (WebCore::HTMLElement::setDir):
2374         (WebCore::HTMLElement::draggable):
2375         (WebCore::HTMLElement::setDraggable):
2376         (WebCore::HTMLElement::title):
2377         (WebCore::HTMLElement::tabIndex):
2378         (WebCore::HTMLElement::translateAttributeMode):
2379         (WebCore::HTMLElement::hasDirectionAuto):
2380         (WebCore::HTMLElement::directionality):
2381         * html/HTMLEmbedElement.cpp:
2382         (WebCore::HTMLEmbedElement::imageSourceURL):
2383         (WebCore::HTMLEmbedElement::addSubresourceAttributeURLs):
2384         * html/HTMLFormControlElement.cpp:
2385         (WebCore::HTMLFormControlElement::formEnctype):
2386         (WebCore::HTMLFormControlElement::formMethod):
2387         (WebCore::HTMLFormControlElement::formAction):
2388         (WebCore::HTMLFormControlElement::autocorrect):
2389         (WebCore::HTMLFormControlElement::autocapitalizeType):
2390         * html/HTMLFormElement.cpp:
2391         (WebCore::HTMLFormElement::autocorrect):
2392         (WebCore::HTMLFormElement::autocapitalizeType):
2393         (WebCore::HTMLFormElement::autocapitalize):
2394         (WebCore::HTMLFormElement::action):
2395         (WebCore::HTMLFormElement::setAction):
2396         (WebCore::HTMLFormElement::target):
2397         (WebCore::HTMLFormElement::wasUserSubmitted):
2398         (WebCore::HTMLFormElement::shouldAutocomplete):
2399         (WebCore::HTMLFormElement::finishParsingChildren):
2400         (WebCore::HTMLFormElement::autocomplete):
2401         * html/HTMLFrameElementBase.cpp:
2402         (WebCore::HTMLFrameElementBase::location):
2403         (WebCore::HTMLFrameElementBase::setLocation):
2404         * html/HTMLHtmlElement.cpp:
2405         (WebCore::HTMLHtmlElement::insertedByParser):
2406         * html/HTMLImageElement.cpp:
2407         (WebCore::HTMLImageElement::imageSourceURL):
2408         (WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
2409         (WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
2410         (WebCore::HTMLImageElement::selectImageSource):
2411         (WebCore::HTMLImageElement::altText):
2412         (WebCore::HTMLImageElement::createElementRenderer):
2413         (WebCore::HTMLImageElement::width):
2414         (WebCore::HTMLImageElement::height):
2415         (WebCore::HTMLImageElement::alt):
2416         (WebCore::HTMLImageElement::draggable):
2417         (WebCore::HTMLImageElement::setHeight):
2418         (WebCore::HTMLImageElement::src):
2419         (WebCore::HTMLImageElement::setSrc):
2420         (WebCore::HTMLImageElement::addSubresourceAttributeURLs):
2421         (WebCore::HTMLImageElement::didMoveToNewDocument):
2422         (WebCore::HTMLImageElement::isServerMap):
2423         (WebCore::HTMLImageElement::crossOrigin):
2424         * html/HTMLInputElement.cpp:
2425         (WebCore::HTMLInputElement::updateType):
2426         (WebCore::HTMLInputElement::initializeInputType):
2427         (WebCore::HTMLInputElement::altText):
2428         (WebCore::HTMLInputElement::value):
2429         (WebCore::HTMLInputElement::defaultValue):
2430         (WebCore::HTMLInputElement::setDefaultValue):
2431         (WebCore::HTMLInputElement::acceptMIMETypes):
2432         (WebCore::HTMLInputElement::acceptFileExtensions):
2433         (WebCore::HTMLInputElement::accept):
2434         (WebCore::HTMLInputElement::alt):
2435         (WebCore::HTMLInputElement::effectiveMaxLength):
2436         (WebCore::HTMLInputElement::src):
2437         (WebCore::HTMLInputElement::setAutoFilled):
2438         (WebCore::HTMLInputElement::dataList):
2439         (WebCore::HTMLInputElement::resetListAttributeTargetObserver):
2440         * html/HTMLKeygenElement.cpp:
2441         (WebCore::HTMLKeygenElement::isKeytypeRSA):
2442         (WebCore::HTMLKeygenElement::appendFormData):
2443         * html/HTMLLIElement.cpp:
2444         (WebCore::HTMLLIElement::didAttachRenderers):
2445         (WebCore::HTMLLIElement::parseValue):
2446         * html/HTMLLabelElement.cpp:
2447         (WebCore::HTMLLabelElement::control):
2448         * html/HTMLLinkElement.cpp:
2449         (WebCore::HTMLLinkElement::crossOrigin):
2450         (WebCore::HTMLLinkElement::process):
2451         (WebCore::HTMLLinkElement::href):
2452         (WebCore::HTMLLinkElement::rel):
2453         (WebCore::HTMLLinkElement::target):
2454         (WebCore::HTMLLinkElement::type):
2455         (WebCore::HTMLLinkElement::iconType):
2456         * html/HTMLMarqueeElement.cpp:
2457         (WebCore::HTMLMarqueeElement::scrollAmount):
2458         (WebCore::HTMLMarqueeElement::setScrollAmount):
2459         (WebCore::HTMLMarqueeElement::scrollDelay):
2460         (WebCore::HTMLMarqueeElement::setScrollDelay):
2461         (WebCore::HTMLMarqueeElement::loop):
2462         * html/HTMLMediaElement.cpp:
2463         (WebCore::HTMLMediaElement::insertedInto):
2464         (WebCore::HTMLMediaElement::crossOrigin):
2465         (WebCore::HTMLMediaElement::networkState):
2466         (WebCore::HTMLMediaElement::mediaSessionTitle):
2467         (WebCore::HTMLMediaElement::doesHaveAttribute):
2468         * html/HTMLMetaElement.cpp:
2469         (WebCore::HTMLMetaElement::process):
2470         (WebCore::HTMLMetaElement::content):
2471         (WebCore::HTMLMetaElement::httpEquiv):
2472         (WebCore::HTMLMetaElement::name):
2473         * html/HTMLMeterElement.cpp:
2474         (WebCore::HTMLMeterElement::min):
2475         (WebCore::HTMLMeterElement::setMin):
2476         (WebCore::HTMLMeterElement::max):
2477         (WebCore::HTMLMeterElement::setMax):
2478         (WebCore::HTMLMeterElement::value):
2479         (WebCore::HTMLMeterElement::low):
2480         (WebCore::HTMLMeterElement::high):
2481         (WebCore::HTMLMeterElement::optimum):
2482         * html/HTMLObjectElement.cpp:
2483         (WebCore::HTMLObjectElement::shouldAllowQuickTimeClassIdQuirk):
2484         (WebCore::HTMLObjectElement::hasValidClassId):
2485         (WebCore::HTMLObjectElement::imageSourceURL):
2486         (WebCore::HTMLObjectElement::renderFallbackContent):
2487         (WebCore::HTMLObjectElement::containsJavaApplet):
2488         (WebCore::HTMLObjectElement::addSubresourceAttributeURLs):
2489         * html/HTMLOptGroupElement.cpp:
2490         (WebCore::HTMLOptGroupElement::groupLabelText):
2491         * html/HTMLOptionElement.cpp:
2492         (WebCore::HTMLOptionElement::value):
2493         (WebCore::HTMLOptionElement::label):
2494         * html/HTMLParamElement.cpp:
2495         (WebCore::HTMLParamElement::value):
2496         (WebCore::HTMLParamElement::isURLParameter):
2497         * html/HTMLProgressElement.cpp:
2498         (WebCore::HTMLProgressElement::value):
2499         (WebCore::HTMLProgressElement::max):
2500         * html/HTMLScriptElement.cpp:
2501         (WebCore::HTMLScriptElement::crossOrigin):
2502         (WebCore::HTMLScriptElement::src):
2503         (WebCore::HTMLScriptElement::sourceAttributeValue):
2504         (WebCore::HTMLScriptElement::charsetAttributeValue):
2505         (WebCore::HTMLScriptElement::typeAttributeValue):
2506         (WebCore::HTMLScriptElement::languageAttributeValue):
2507         (WebCore::HTMLScriptElement::forAttributeValue):
2508         (WebCore::HTMLScriptElement::eventAttributeValue):
2509         (WebCore::HTMLScriptElement::asyncAttributeValue):
2510         * html/HTMLSlotElement.cpp:
2511         (WebCore::HTMLSlotElement::insertedInto):
2512         (WebCore::HTMLSlotElement::removedFrom):
2513         * html/HTMLSourceElement.cpp:
2514         (WebCore::HTMLSourceElement::media):
2515         (WebCore::HTMLSourceElement::setMedia):
2516         (WebCore::HTMLSourceElement::type):
2517         (WebCore::HTMLSourceElement::setType):
2518         * html/HTMLTableCellElement.cpp:
2519         (WebCore::HTMLTableCellElement::colSpanForBindings):
2520         (WebCore::HTMLTableCellElement::rowSpan):
2521         (WebCore::HTMLTableCellElement::rowSpanForBindings):
2522         (WebCore::HTMLTableCellElement::cellIndex):
2523         (WebCore::HTMLTableCellElement::abbr):
2524         (WebCore::HTMLTableCellElement::axis):
2525         (WebCore::HTMLTableCellElement::setColSpanForBindings):
2526         (WebCore::HTMLTableCellElement::headers):
2527         (WebCore::HTMLTableCellElement::setRowSpanForBindings):
2528         (WebCore::HTMLTableCellElement::scope):
2529         (WebCore::HTMLTableCellElement::addSubresourceAttributeURLs):
2530         (WebCore::HTMLTableCellElement::cellAbove):
2531         * html/HTMLTableColElement.cpp:
2532         (WebCore::HTMLTableColElement::width):
2533         * html/HTMLTableElement.cpp:
2534         (WebCore::HTMLTableElement::rules):
2535         (WebCore::HTMLTableElement::summary):
2536         (WebCore::HTMLTableElement::addSubresourceAttributeURLs):
2537         * html/HTMLTableSectionElement.cpp:
2538         (WebCore::HTMLTableSectionElement::align):
2539         (WebCore::HTMLTableSectionElement::setAlign):
2540         (WebCore::HTMLTableSectionElement::ch):
2541         (WebCore::HTMLTableSectionElement::setCh):
2542         (WebCore::HTMLTableSectionElement::chOff):
2543         (WebCore::HTMLTableSectionElement::setChOff):
2544         (WebCore::HTMLTableSectionElement::vAlign):
2545         (WebCore::HTMLTableSectionElement::setVAlign):
2546         * html/HTMLTextAreaElement.cpp:
2547         (WebCore::HTMLTextAreaElement::appendFormData):
2548         * html/HTMLTextFormControlElement.cpp:
2549         (WebCore::HTMLTextFormControlElement::strippedPlaceholder):
2550         (WebCore::HTMLTextFormControlElement::isPlaceholderEmpty):
2551         (WebCore::HTMLTextFormControlElement::directionForFormData):
2552         * html/HTMLTrackElement.cpp:
2553         (WebCore::HTMLTrackElement::srclang):
2554         (WebCore::HTMLTrackElement::label):
2555         (WebCore::HTMLTrackElement::isDefault):
2556         (WebCore::HTMLTrackElement::ensureTrack):
2557         (WebCore::HTMLTrackElement::mediaElementCrossOriginAttribute):
2558         * html/HTMLVideoElement.cpp:
2559         (WebCore::HTMLVideoElement::parseAttribute):
2560         (WebCore::HTMLVideoElement::imageSourceURL):
2561         * html/ImageInputType.cpp:
2562         (WebCore::ImageInputType::height):
2563         (WebCore::ImageInputType::width):
2564         * html/InputType.cpp:
2565         (WebCore::InputType::applyStep):
2566         * html/MediaElementSession.cpp:
2567         (WebCore::MediaElementSession::wirelessVideoPlaybackDisabled):
2568         * html/MonthInputType.cpp:
2569         (WebCore::MonthInputType::createStepRange):
2570         * html/NumberInputType.cpp:
2571         (WebCore::NumberInputType::createStepRange):
2572         (WebCore::NumberInputType::sizeShouldIncludeDecoration):
2573         * html/RangeInputType.cpp:
2574         (WebCore::RangeInputType::createStepRange):
2575         (WebCore::RangeInputType::handleKeydownEvent):
2576         * html/TextFieldInputType.cpp:
2577         (WebCore::TextFieldInputType::appendFormData):
2578         (WebCore::TextFieldInputType::updateAutoFillButton):
2579         * html/TimeInputType.cpp:
2580         (WebCore::TimeInputType::createStepRange):
2581         * html/ValidationMessage.cpp:
2582         (WebCore::ValidationMessage::updateValidationMessage):
2583         * html/WeekInputType.cpp:
2584         (WebCore::WeekInputType::createStepRange):
2585         * html/track/WebVTTElement.cpp:
2586         (WebCore::WebVTTElement::createEquivalentHTMLElement):
2587         * inspector/InspectorPageAgent.cpp:
2588         (WebCore::InspectorPageAgent::buildObjectForFrame):
2589         * loader/FormSubmission.cpp:
2590         (WebCore::FormSubmission::create):
2591         * loader/FrameLoader.cpp:
2592         (WebCore::FrameLoader::defaultSubstituteDataForURL):
2593         * loader/ImageLoader.cpp:
2594         (WebCore::ImageLoader::updateFromElement):
2595         * loader/SubframeLoader.cpp:
2596         (WebCore::SubframeLoader::isPluginContentAllowedByContentSecurityPolicy):
2597         * mathml/MathMLElement.cpp:
2598         (WebCore::MathMLElement::colSpan):
2599         (WebCore::MathMLElement::rowSpan):
2600         (WebCore::MathMLElement::childShouldCreateRenderer):
2601         (WebCore::MathMLElement::defaultEventHandler):
2602         (WebCore::MathMLElement::cachedMathMLLength):
2603         * mathml/MathMLFractionElement.cpp:
2604         (WebCore::MathMLFractionElement::lineThickness):
2605         (WebCore::MathMLFractionElement::cachedFractionAlignment):
2606         * mathml/MathMLSelectElement.cpp:
2607         (WebCore::MathMLSelectElement::getSelectedActionChildAndIndex):
2608         (WebCore::MathMLSelectElement::getSelectedActionChild):
2609         (WebCore::MathMLSelectElement::getSelectedSemanticsChild):
2610         (WebCore::MathMLSelectElement::defaultEventHandler):
2611         (WebCore::MathMLSelectElement::willRespondToMouseClickEvents):
2612         (WebCore::MathMLSelectElement::toggle):
2613         * page/EventHandler.cpp:
2614         (WebCore::findDropZone):
2615         * page/Frame.cpp:
2616         (WebCore::Frame::matchLabelsAgainstElement):
2617         * page/PageSerializer.cpp:
2618         (WebCore::PageSerializer::serializeFrame):
2619         * platform/win/PasteboardWin.cpp:
2620         (WebCore::Pasteboard::writeImageToDataObject):
2621         * rendering/HitTestResult.cpp:
2622         (WebCore::HitTestResult::altDisplayString):
2623         * rendering/RenderDetailsMarker.cpp:
2624         (WebCore::RenderDetailsMarker::isOpen):
2625         * rendering/RenderImage.cpp:
2626         (WebCore::RenderImage::imageMap):
2627         (WebCore::RenderImage::nodeAtPoint):
2628         * rendering/RenderMenuList.cpp:
2629         (RenderMenuList::itemAccessibilityText):
2630         (RenderMenuList::itemToolTip):
2631         * rendering/RenderSearchField.cpp:
2632         (WebCore::RenderSearchField::autosaveName):
2633         * rendering/RenderThemeIOS.mm:
2634         (WebCore::getAttachmentProgress):
2635         (WebCore::AttachmentInfo::AttachmentInfo):
2636         * rendering/RenderThemeMac.mm:
2637         (WebCore::AttachmentLayout::layOutSubtitle):
2638         (WebCore::RenderThemeMac::paintAttachment):
2639         * rendering/mathml/MathMLStyle.cpp:
2640         (WebCore::MathMLStyle::resolveMathMLStyle):
2641         * rendering/mathml/RenderMathMLFenced.cpp:
2642         (WebCore::RenderMathMLFenced::updateFromElement):
2643         * rendering/mathml/RenderMathMLOperator.cpp:
2644         (WebCore::RenderMathMLOperator::setOperatorFlagFromAttribute):
2645         (WebCore::RenderMathMLOperator::setOperatorFlagFromAttributeValue):
2646         (WebCore::RenderMathMLOperator::setOperatorProperties):
2647         * rendering/mathml/RenderMathMLScripts.cpp:
2648         (WebCore::RenderMathMLScripts::getScriptMetricsAndLayoutIfNeeded):
2649         * rendering/mathml/RenderMathMLUnderOver.cpp:
2650         (WebCore::RenderMathMLUnderOver::hasAccent):
2651         * style/StyleSharingResolver.cpp:
2652         (WebCore::Style::SharingResolver::canShareStyleWithElement):
2653         (WebCore::Style::SharingResolver::sharingCandidateHasIdenticalStyleAffectingAttributes):
2654         * svg/SVGAElement.cpp:
2655         (WebCore::SVGAElement::title):
2656         (WebCore::SVGAElement::defaultEventHandler):
2657         * svg/SVGAltGlyphElement.cpp:
2658         (WebCore::SVGAltGlyphElement::glyphRef):
2659         (WebCore::SVGAltGlyphElement::setFormat):
2660         (WebCore::SVGAltGlyphElement::format):
2661         (WebCore::SVGAltGlyphElement::childShouldCreateRenderer):
2662         * svg/SVGAnimationElement.cpp:
2663         (WebCore::SVGAnimationElement::toValue):
2664         (WebCore::SVGAnimationElement::byValue):
2665         (WebCore::SVGAnimationElement::fromValue):
2666         (WebCore::SVGAnimationElement::isAdditive):
2667         (WebCore::SVGAnimationElement::isAccumulated):
2668         * svg/SVGElement.cpp:
2669         (WebCore::SVGElement::xmlbase):
2670         (WebCore::SVGElement::setXmlbase):
2671         * svg/SVGFontFaceElement.cpp:
2672         (WebCore::SVGFontFaceElement::unitsPerEm):
2673         (WebCore::SVGFontFaceElement::xHeight):
2674         (WebCore::SVGFontFaceElement::capHeight):
2675         (WebCore::SVGFontFaceElement::horizontalOriginX):
2676         (WebCore::SVGFontFaceElement::horizontalOriginY):
2677         (WebCore::SVGFontFaceElement::horizontalAdvanceX):
2678         (WebCore::SVGFontFaceElement::verticalOriginX):
2679         (WebCore::SVGFontFaceElement::verticalOriginY):
2680         (WebCore::SVGFontFaceElement::verticalAdvanceY):
2681         (WebCore::SVGFontFaceElement::ascent):
2682         (WebCore::SVGFontFaceElement::descent):
2683         * svg/SVGFontFaceNameElement.cpp:
2684         (WebCore::SVGFontFaceNameElement::srcValue):
2685         * svg/SVGFontFaceUriElement.cpp:
2686         (WebCore::SVGFontFaceUriElement::srcValue):
2687         * svg/SVGGlyphRefElement.cpp:
2688         (WebCore::SVGGlyphRefElement::glyphRef):
2689         (WebCore::SVGGlyphRefElement::setGlyphRef):
2690         * svg/SVGHKernElement.cpp:
2691         (WebCore::SVGHKernElement::buildHorizontalKerningPair):
2692         * svg/SVGSVGElement.cpp:
2693         (WebCore::SVGSVGElement::contentScriptType):
2694         (WebCore::SVGSVGElement::contentStyleType):
2695         * svg/SVGStyleElement.cpp:
2696         (WebCore::SVGStyleElement::media):
2697         (WebCore::SVGStyleElement::title):
2698         (WebCore::SVGStyleElement::setTitle):
2699         * svg/SVGToOTFFontConversion.cpp:
2700         (WebCore::SVGToOTFFontConverter::appendOS2Table):
2701         (WebCore::SVGToOTFFontConverter::appendCFFTable):
2702         (WebCore::SVGToOTFFontConverter::appendArabicReplacementSubtable):
2703         (WebCore::SVGToOTFFontConverter::appendVORGTable):
2704         (WebCore::SVGToOTFFontConverter::transcodeGlyphPaths):
2705         (WebCore::SVGToOTFFontConverter::processGlyphElement):
2706         (WebCore::SVGToOTFFontConverter::compareCodepointsLexicographically):
2707         (WebCore::SVGToOTFFontConverter::SVGToOTFFontConverter):
2708         * svg/SVGVKernElement.cpp:
2709         (WebCore::SVGVKernElement::buildVerticalKerningPair):
2710         * svg/animation/SVGSMILElement.cpp:
2711         (WebCore::SVGSMILElement::insertedInto):
2712         (WebCore::SVGSMILElement::parseAttribute):
2713         (WebCore::SVGSMILElement::svgAttributeChanged):
2714         (WebCore::SVGSMILElement::restart):
2715         (WebCore::SVGSMILElement::fill):
2716         (WebCore::SVGSMILElement::dur):
2717         (WebCore::SVGSMILElement::repeatDur):
2718         (WebCore::SVGSMILElement::repeatCount):
2719         (WebCore::SVGSMILElement::maxValue):
2720         (WebCore::SVGSMILElement::minValue):
2721
2722 2016-07-16  Carlos Garcia Campos  <cgarcia@igalia.com>
2723
2724         ASSERTION FAILED: isMainThread() in ~UniqueIDBDatabase() since r201997
2725         https://bugs.webkit.org/show_bug.cgi?id=159809
2726
2727         Reviewed by Brady Eidson.
2728
2729         In r201997 the UniqueIDBDatabase was protected in executeNextDatabaseTask() because the last reference could be
2730         removed while the task is performed. However UniqueIDBDatabase is expected to be deleted in the main thread, and
2731         the destructor asserts when not called in the main thread, but executeNextDatabaseTask() is always called on a
2732         secondary thread. So, if the protector contains the last reference, the object is deleted in the secondary thread.
2733
2734         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
2735         (WebCore::IDBServer::UniqueIDBDatabase::executeNextDatabaseTask): Use callOnMainThread to ensure the object is
2736         deleted in the main thread in case the protector contains the last reference.
2737
2738 2016-07-15  Chris Dumez  <cdumez@apple.com>
2739
2740         Use emptyString() / nullAtom when possible
2741         https://bugs.webkit.org/show_bug.cgi?id=159850
2742
2743         Reviewed by Ryosuke Niwa.
2744
2745         Use emptyString() / nullAtom when possible, for performance.
2746
2747         * Modules/webaudio/AudioNode.cpp:
2748         (WebCore::AudioNode::channelCountMode):
2749         (WebCore::AudioNode::channelInterpretation):
2750         * Modules/webdatabase/DatabaseTracker.cpp:
2751         (WebCore::DatabaseTracker::tracker):
2752         * Modules/websockets/WebSocket.cpp:
2753         (WebCore::WebSocket::WebSocket):
2754         (WebCore::WebSocket::didConnect):
2755         * Modules/websockets/WebSocketChannel.cpp:
2756         (WebCore::WebSocketChannel::subprotocol):
2757         (WebCore::WebSocketChannel::extensions):
2758         * accessibility/AccessibilityObject.cpp:
2759         (WebCore::AccessibilityObject::supportsPressAction):
2760         * accessibility/mac/AXObjectCacheMac.mm:
2761         (WebCore::AXObjectCache::postTextStateChangePlatformNotification):
2762         * css/CSSPropertySourceData.cpp:
2763         (WebCore::CSSPropertySourceData::CSSPropertySourceData):
2764         * css/PageRuleCollector.cpp:
2765         (WebCore::PageRuleCollector::pageName):
2766         * css/PropertySetCSSStyleDeclaration.cpp:
2767         (WebCore::PropertySetCSSStyleDeclaration::getPropertyPriority):
2768         * dom/DocumentMarkerController.cpp:
2769         (WebCore::DocumentMarkerController::addDictationPhraseWithAlternativesMarker):
2770         * dom/Element.cpp:
2771         (WebCore::Element::setPrefix):
2772         * editing/AlternativeTextController.cpp:
2773         (WebCore::AlternativeTextController::respondToMarkerAtEndOfWord):
2774         (WebCore::AlternativeTextController::markerDescriptionForAppliedAlternativeText):
2775         * editing/CompositeEditCommand.cpp:
2776         (WebCore::CompositeEditCommand::removeNodeAttribute):
2777         (WebCore::CompositeEditCommand::moveParagraphs):
2778         * editing/InsertTextCommand.cpp:
2779         (WebCore::InsertTextCommand::positionInsideTextNode):
2780         * editing/TextCheckingHelper.cpp:
2781         (WebCore::TextCheckingHelper::findFirstMisspellingOrBadGrammar):
2782         * editing/TypingCommand.cpp:
2783         (WebCore::TypingCommand::deleteSelection):
2784         (WebCore::TypingCommand::deleteKeyPressed):
2785         (WebCore::TypingCommand::forwardDeleteKeyPressed):
2786         (WebCore::TypingCommand::insertLineBreak):
2787         (WebCore::TypingCommand::insertParagraphSeparator):
2788         * editing/cocoa/EditorCocoa.mm:
2789         (WebCore::Editor::styleForSelectionStart):
2790         * editing/mac/EditorMac.mm:
2791         (WebCore::Editor::stringSelectionForPasteboard):
2792         (WebCore::Editor::stringSelectionForPasteboardWithImageAltText):
2793         * fileapi/FileReaderLoader.cpp:
2794         (WebCore::FileReaderLoader::FileReaderLoader):
2795         * html/FileInputType.cpp:
2796         (WebCore::FileInputType::appendFormData):
2797         * html/HTMLMediaElement.cpp:
2798         (WebCore::HTMLMediaElement::getCurrentMediaControlsStatus):
2799         * html/HTMLOutputElement.cpp:
2800         (WebCore::HTMLOutputElement::HTMLOutputElement):
2801         * html/SearchInputType.cpp:
2802         (WebCore::SearchInputType::handleKeydownEvent):
2803         * html/TextFieldInputType.cpp:
2804         (WebCore::autoFillButtonTypeToAccessibilityLabel):
2805         * html/canvas/WebGLDebugShaders.cpp:
2806         (WebCore::WebGLDebugShaders::getTranslatedShaderSource):
2807         * html/canvas/WebGLRenderingContextBase.cpp:
2808         (WebCore::WebGLRenderingContextBase::dispatchContextLostEvent):
2809         (WebCore::WebGLRenderingContextBase::maybeRestoreContext):
2810         * html/canvas/WebGLShader.cpp:
2811         (WebCore::WebGLShader::WebGLShader):
2812         * html/shadow/MediaControlElements.cpp:
2813         (WebCore::MediaControlStatusDisplayElement::update):
2814         * html/track/TextTrack.cpp:
2815         (WebCore::TextTrack::captionMenuOffItem):
2816         (WebCore::TextTrack::captionMenuAutomaticItem):
2817         * html/track/VTTRegion.cpp:
2818         (WebCore::VTTRegion::scroll):
2819         * html/track/VTTRegion.h:
2820         * inspector/InspectorDOMAgent.cpp:
2821         (WebCore::InspectorDOMAgent::toErrorString):
2822         (WebCore::InspectorDOMAgent::resolveNode):
2823         (WebCore::InspectorDOMAgent::documentURLString):
2824         (WebCore::documentBaseURLString):
2825         * inspector/InspectorDOMDebuggerAgent.cpp:
2826         (WebCore::domTypeName):
2827         * inspector/InspectorFrontendHost.cpp:
2828         (WebCore::InspectorFrontendHost::localizedStringsURL):
2829         * inspector/InspectorHistory.cpp:
2830         (WebCore::InspectorHistory::Action::mergeId):
2831         * inspector/InspectorPageAgent.cpp:
2832         (WebCore::InspectorPageAgent::reload):
2833         (WebCore::InspectorPageAgent::frameId):
2834         (WebCore::InspectorPageAgent::loaderId):
2835         * inspector/InspectorStyleSheet.cpp:
2836         (WebCore::InspectorStyleSheet::ruleSelector):
2837         * loader/EmptyClients.h:
2838         * loader/FrameLoader.cpp:
2839         (WebCore::FrameLoader::referrer):
2840         * loader/ImageLoader.cpp:
2841         (WebCore::ImageLoader::clearFailedLoadURL):
2842         * loader/ResourceLoader.cpp:
2843         (WebCore::ResourceLoader::didReceiveResponse):
2844         * page/ContextMenuController.cpp:
2845         (WebCore::ContextMenuController::contextMenuItemSelected):
2846         * page/FrameTree.cpp:
2847         (WebCore::FrameTree::setName):
2848         (WebCore::FrameTree::clearName):
2849         * page/Location.cpp:
2850         (WebCore::Location::port):
2851         * platform/network/ProtectionSpaceBase.cpp:
2852         (WebCore::ProtectionSpaceBase::ProtectionSpaceBase):
2853         * xml/parser/XMLDocumentParserLibxml2.cpp:
2854         (WebCore::handleElementAttributes):
2855
2856 2016-07-15  Simon Fraser  <simon.fraser@apple.com>
2857
2858         Repaints rects drawn incorrectly when inspecting a WebView on a Retina display
2859         https://bugs.webkit.org/show_bug.cgi?id=159824
2860         rdar://problem/27376305
2861
2862         Reviewed by Brian Burg.
2863
2864         InspectorOverlayPage.js set up the canvases with a deviceScaleFactor passed into
2865         reset(), which comes from the overlay's m_page.deviceScaleFactor(). However, updatePaintRects()
2866         used window.devicePixelRatio which was always 1.
2867
2868         Fix by setting the deviceScaleFactor on the m_overlayPage.
2869
2870         * inspector/InspectorOverlay.cpp:
2871         (WebCore::InspectorOverlay::overlayPage):
2872
2873 2016-07-15  Myles C. Maxfield  <mmaxfield@apple.com>
2874
2875         [macOS] Work around crash in [NSAttributedString nextWordFromIndex:forward:]
2876         https://bugs.webkit.org/show_bug.cgi?id=159842
2877
2878         Reviewed by Jon Lee.
2879
2880         <rdar://problem/27380532> describes a crash inside [NSAttributedString nextWordFromIndex:forward:].
2881         This must be worked around for https://bugs.webkit.org/show_bug.cgi?id=159755 and
2882         <rdar://problem/27325521>.
2883
2884         * platform/text/mac/TextBoundaries.mm:
2885         (WebCore::findNextWordFromIndex):
2886
2887 2016-07-15  Brady Eidson  <beidson@apple.com>
2888
2889         Update XPathException to use the description in toString().
2890         https://bugs.webkit.org/show_bug.cgi?id=159848
2891
2892         Reviewed by Alex Christensen.
2893
2894         No new tests (Covered by changes to existing tests).
2895
2896         * bindings/js/JSDOMBinding.cpp:
2897         (WebCore::createDOMException):
2898         * xml/XPathException.h:
2899         (WebCore::XPathException::XPathException):
2900
2901 2016-07-15  Brady Eidson  <beidson@apple.com>
2902
2903         Change toString() behavior for exceptions constructed with "createWithDescriptionAsMessage".
2904         https://bugs.webkit.org/show_bug.cgi?id=159839
2905
2906         Reviewed by Alex Christensen.
2907
2908         No new tests (Covered by changes to existing tests).
2909
2910         This is the first step towards extended exception messages for all exception types.
2911
2912         * dom/ExceptionBase.cpp:
2913         (WebCore::ExceptionBase::ExceptionBase):
2914         (WebCore::ExceptionBase::toString):
2915         * dom/ExceptionBase.h:
2916
2917 2016-07-15  Geoffrey Garen  <ggaren@apple.com>
2918
2919         Added a makeRef<T> helper
2920         https://bugs.webkit.org/show_bug.cgi?id=159835
2921
2922         Reviewed by Andreas Kling.
2923
2924         Anders told me to!
2925
2926         * Modules/indexeddb/IDBTransaction.cpp:
2927         (WebCore::IDBTransaction::putOrAddOnServer):
2928         * Modules/indexeddb/shared/InProcessIDBServer.cpp:
2929         (WebCore::InProcessIDBServer::deleteDatabase):
2930         (WebCore::InProcessIDBServer::didDeleteDatabase):
2931         (WebCore::InProcessIDBServer::openDatabase):
2932         (WebCore::InProcessIDBServer::didOpenDatabase):
2933         (WebCore::InProcessIDBServer::didAbortTransaction):
2934         (WebCore::InProcessIDBServer::didCommitTransaction):
2935         (WebCore::InProcessIDBServer::didCreateObjectStore):
2936         (WebCore::InProcessIDBServer::didDeleteObjectStore):
2937         (WebCore::InProcessIDBServer::didClearObjectStore):
2938         (WebCore::InProcessIDBServer::didCreateIndex):
2939         (WebCore::InProcessIDBServer::didDeleteIndex):
2940         (WebCore::InProcessIDBServer::didPutOrAdd):
2941         (WebCore::InProcessIDBServer::didGetRecord):
2942         (WebCore::InProcessIDBServer::didGetCount):
2943         (WebCore::InProcessIDBServer::didDeleteRecord):
2944         (WebCore::InProcessIDBServer::didOpenCursor):
2945         (WebCore::InProcessIDBServer::didIterateCursor):
2946         (WebCore::InProcessIDBServer::abortTransaction):
2947         (WebCore::InProcessIDBServer::commitTransaction):
2948         (WebCore::InProcessIDBServer::didFinishHandlingVersionChangeTransaction):
2949         (WebCore::InProcessIDBServer::createObjectStore):
2950         (WebCore::InProcessIDBServer::deleteObjectStore):
2951         (WebCore::InProcessIDBServer::clearObjectStore):
2952         (WebCore::InProcessIDBServer::createIndex):
2953         (WebCore::InProcessIDBServer::deleteIndex):
2954         (WebCore::InProcessIDBServer::putOrAdd):
2955         (WebCore::InProcessIDBServer::getRecord):
2956         (WebCore::InProcessIDBServer::getCount):
2957         (WebCore::InProcessIDBServer::deleteRecord):
2958         (WebCore::InProcessIDBServer::openCursor):
2959         (WebCore::InProcessIDBServer::iterateCursor):
2960         (WebCore::InProcessIDBServer::establishTransaction):
2961         (WebCore::InProcessIDBServer::fireVersionChangeEvent):
2962         (WebCore::InProcessIDBServer::didStartTransaction):
2963         (WebCore::InProcessIDBServer::didCloseFromServer):
2964         (WebCore::InProcessIDBServer::notifyOpenDBRequestBlocked):
2965         (WebCore::InProcessIDBServer::databaseConnectionClosed):
2966         (WebCore::InProcessIDBServer::abortOpenAndUpgradeNeeded):
2967         (WebCore::InProcessIDBServer::didFireVersionChangeEvent):
2968         (WebCore::InProcessIDBServer::openDBRequestCancelled):
2969         (WebCore::InProcessIDBServer::confirmDidCloseFromServer):
2970         (WebCore::InProcessIDBServer::getAllDatabaseNames):
2971         (WebCore::InProcessIDBServer::didGetAllDatabaseNames):
2972         * Modules/mediastream/MediaDevicesRequest.cpp:
2973         (WebCore::MediaDevicesRequest::didCompleteTrackSourceInfoRequest):
2974         * Modules/mediastream/UserMediaRequest.cpp:
2975         (WebCore::UserMediaRequest::constraintsValidated):
2976         (WebCore::UserMediaRequest::userMediaAccessGranted):
2977         * Modules/webaudio/AudioContext.cpp:
2978         (WebCore::AudioContext::scheduleNodeDeletion):
2979         (WebCore::AudioContext::isPlayingAudioDidChange):
2980         (WebCore::AudioContext::suspend):
2981         (WebCore::AudioContext::resume):
2982         (WebCore::AudioContext::close):
2983         (WebCore::AudioContext::suspendPlayback):
2984         (WebCore::AudioContext::mayResumePlayback):
2985         * Modules/websockets/ThreadableWebSocketChannelClientWrapper.cpp:
2986         (WebCore::ThreadableWebSocketChannelClientWrapper::didConnect):
2987         (WebCore::ThreadableWebSocketChannelClientWrapper::didReceiveMessage):
2988         (WebCore::ThreadableWebSocketChannelClientWrapper::didReceiveBinaryData):
2989         (WebCore::ThreadableWebSocketChannelClientWrapper::didUpdateBufferedAmount):
2990         (WebCore::ThreadableWebSocketChannelClientWrapper::didStartClosingHandshake):
2991         (WebCore::ThreadableWebSocketChannelClientWrapper::didClose):
2992         (WebCore::ThreadableWebSocketChannelClientWrapper::didReceiveMessageError):
2993         (WebCore::ThreadableWebSocketChannelClientWrapper::processPendingTasks):
2994         * Modules/websockets/WebSocket.cpp:
2995         (WebCore::WebSocket::connect):
2996         * bindings/js/JSEventListener.h:
2997         (WebCore::JSEventListener::jsFunction):
2998         * dom/Node.cpp:
2999         (WebCore::Node::setTextContent):
3000         * html/HTMLMediaElement.cpp:
3001         (WebCore::HTMLMediaElement::layoutSizeChanged):
3002         * inspector/CommandLineAPIHost.cpp:
3003         (WebCore::CommandLineAPIHost::wrapper):
3004         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
3005         (WebCore::AudioSourceProviderAVFObjC::prepare):
3006         * platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp:
3007         (WebCore::WebCoreAVCFResourceLoader::invalidate):
3008         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
3009         (WebCore::WebCoreAVFResourceLoader::invalidate):
3010         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
3011         (WebVideoFullscreenControllerContext::setExternalPlayback):
3012         * platform/network/BlobResourceHandle.cpp:
3013         (WebCore::BlobResourceHandle::start):
3014         (WebCore::BlobResourceHandle::notifyFinish):
3015         * platform/network/SocketStreamHandleBase.cpp:
3016         (WebCore::SocketStreamHandleBase::disconnect):
3017         * platform/network/curl/CurlDownload.cpp:
3018         (WebCore::CurlDownload::didReceiveHeader):
3019
3020 2016-07-15  Chris Dumez  <cdumez@apple.com>
3021
3022         Use fastGetAttribute() / setAttributeWithoutSynchronization() when possible
3023         https://bugs.webkit.org/show_bug.cgi?id=159793
3024
3025         Reviewed by Ryosuke Niwa.
3026
3027         Use fastGetAttribute() / setAttributeWithoutSynchronization() when possible, for performance.
3028
3029         * Modules/plugins/YouTubePluginReplacement.cpp:
3030         (WebCore::YouTubePluginReplacement::installReplacement):
3031         * dom/Element.h:
3032         (WebCore::Element::setIdAttribute):
3033         * editing/ApplyStyleCommand.cpp:
3034         (WebCore::hasNoAttributeOrOnlyStyleAttribute):
3035         (WebCore::createFontElement):
3036         (WebCore::ApplyStyleCommand::applyInlineStyleChange):
3037         * editing/EditingStyle.cpp:
3038         (WebCore::EditingStyle::elementIsStyledSpanOrHTMLEquivalent):
3039         * editing/Editor.cpp:
3040         (WebCore::Editor::setBaseWritingDirection):
3041         * editing/ReplaceSelectionCommand.cpp:
3042         (WebCore::isMailPasteAsQuotationNode):
3043         (WebCore::isInlineNodeWithStyle):
3044         * editing/cocoa/DataDetection.mm:
3045         (WebCore::DataDetection::detectContentInRange):
3046         * editing/htmlediting.cpp:
3047         (WebCore::createTabSpanElement):
3048         * editing/ios/EditorIOS.mm:
3049         (WebCore::Editor::setTextAlignmentForChangedBaseWritingDirection):
3050         (WebCore::Editor::WebContentReader::readURL):
3051         * editing/mac/EditorMac.mm:
3052         (WebCore::Editor::WebContentReader::readURL):
3053         * editing/markup.cpp:
3054         (WebCore::createFragmentFromText):
3055         * html/BaseButtonInputType.cpp:
3056         (WebCore::BaseButtonInputType::setValue):
3057         * html/BaseCheckableInputType.cpp:
3058         (WebCore::BaseCheckableInputType::setValue):
3059         * html/FTPDirectoryDocument.cpp:
3060         (WebCore::FTPDirectoryDocumentParser::appendEntry):
3061         (WebCore::FTPDirectoryDocumentParser::createTDForFilename):
3062         (WebCore::FTPDirectoryDocumentParser::loadDocumentTemplate):
3063         (WebCore::FTPDirectoryDocumentParser::createBasicDocument):
3064         * html/HTMLAnchorElement.cpp:
3065         (WebCore::HTMLAnchorElement::href):
3066         (WebCore::HTMLAnchorElement::setHref):
3067         (WebCore::HTMLAnchorElement::target):
3068         * html/HTMLAreaElement.cpp:
3069         (WebCore::HTMLAreaElement::target):
3070         * html/HTMLBaseElement.cpp:
3071         (WebCore::HTMLBaseElement::setHref):
3072         * html/HTMLButtonElement.cpp:
3073         (WebCore::HTMLButtonElement::setType):
3074         * html/HTMLDetailsElement.cpp:
3075         (WebCore::HTMLDetailsElement::didAddUserAgentShadowRoot):
3076         (WebCore::HTMLDetailsElement::toggleOpen):
3077         * html/HTMLDocument.cpp:
3078         (WebCore::HTMLDocument::setBgColor):
3079         (WebCore::HTMLDocument::setFgColor):
3080         (WebCore::HTMLDocument::setAlinkColor):
3081         (WebCore::HTMLDocument::setLinkColor):
3082         (WebCore::HTMLDocument::setVlinkColor):
3083         * html/HTMLElement.cpp:
3084         (WebCore::HTMLElement::setDir):
3085         (WebCore::HTMLElement::setContentEditable):
3086         (WebCore::HTMLElement::setDraggable):
3087         (WebCore::HTMLElement::setSpellcheck):
3088         (WebCore::HTMLElement::setTranslate):
3089         * html/HTMLFormControlElement.cpp:
3090         (WebCore::HTMLFormControlElement::setFormEnctype):
3091         (WebCore::HTMLFormControlElement::setFormMethod):
3092         (WebCore::HTMLFormControlElement::setAutocorrect):
3093         (WebCore::HTMLFormControlElement::setAutocapitalize):
3094         (WebCore::HTMLFormControlElement::setAutocomplete):
3095         * html/HTMLFormElement.cpp:
3096         (WebCore::HTMLFormElement::setAutocorrect):
3097         (WebCore::HTMLFormElement::setAutocapitalize):
3098         (WebCore::HTMLFormElement::setAction):
3099         (WebCore::HTMLFormElement::setEnctype):
3100         (WebCore::HTMLFormElement::setMethod):
3101         (WebCore::HTMLFormElement::target):
3102         * html/HTMLImageElement.cpp:
3103         (WebCore::HTMLImageElement::width):
3104         (WebCore::HTMLImageElement::height):
3105         (WebCore::HTMLImageElement::setSrc):
3106         * html/HTMLInputElement.cpp:
3107         (WebCore::HTMLInputElement::setType):
3108         (WebCore::HTMLInputElement::updateType):
3109         (WebCore::HTMLInputElement::altText):
3110         (WebCore::HTMLInputElement::setDefaultValue):
3111         * html/HTMLLinkElement.cpp:
3112         (WebCore::HTMLLinkElement::href):
3113         (WebCore::HTMLLinkElement::target):
3114         (WebCore::HTMLLinkElement::type):
3115         * html/HTMLMediaElement.cpp:
3116         (WebCore::HTMLMediaElement::setSrc):
3117         (WebCore::HTMLMediaElement::setPreload):
3118         * html/HTMLMeterElement.cpp:
3119         (WebCore::HTMLMeterElement::min):
3120         (WebCore::HTMLMeterElement::setMin):
3121         (WebCore::HTMLMeterElement::max):
3122         (WebCore::HTMLMeterElement::setMax):
3123         (WebCore::HTMLMeterElement::value):
3124         (WebCore::HTMLMeterElement::setValue):
3125         (WebCore::HTMLMeterElement::low):
3126         (WebCore::HTMLMeterElement::setLow):
3127         (WebCore::HTMLMeterElement::high):
3128         (WebCore::HTMLMeterElement::setHigh):
3129         (WebCore::HTMLMeterElement::optimum):
3130         (WebCore::HTMLMeterElement::setOptimum):
3131         * html/HTMLObjectElement.cpp:
3132         (WebCore::HTMLObjectElement::containsJavaApplet):
3133         * html/HTMLOptionElement.cpp:
3134         (WebCore::HTMLOptionElement::createForJSConstructor):
3135         (WebCore::HTMLOptionElement::setValue):
3136         (WebCore::HTMLOptionElement::setLabel):
3137         * html/HTMLProgressElement.cpp:
3138         (WebCore::HTMLProgressElement::setValue):
3139         (WebCore::HTMLProgressElement::setMax):
3140         * html/HTMLScriptElement.cpp:
3141         (WebCore::HTMLScriptElement::typeAttributeValue):
3142         * html/HTMLSelectElement.cpp:
3143         (WebCore::HTMLSelectElement::setMultiple):
3144         * html/HTMLSourceElement.cpp:
3145         (WebCore::HTMLSourceElement::setSrc):
3146         (WebCore::HTMLSourceElement::media):
3147         (WebCore::HTMLSourceElement::setMedia):
3148         (WebCore::HTMLSourceElement::type):
3149         (WebCore::HTMLSourceElement::setType):
3150         * html/HTMLTableSectionElement.cpp:
3151         (WebCore::HTMLTableSectionElement::setAlign):
3152         (WebCore::HTMLTableSectionElement::setCh):
3153         (WebCore::HTMLTableSectionElement::chOff):
3154         (WebCore::HTMLTableSectionElement::setChOff):
3155         (WebCore::HTMLTableSectionElement::setVAlign):
3156         * html/HTMLTextFormControlElement.cpp:
3157         (WebCore::HTMLTextFormControlElement::updateInnerTextElementEditability):
3158         * html/HTMLVideoElement.cpp:
3159         (WebCore::HTMLVideoElement::imageSourceURL):
3160         * html/HiddenInputType.cpp:
3161         (WebCore::HiddenInputType::restoreFormControlState):
3162         (WebCore::HiddenInputType::setValue):
3163         * html/MediaDocument.cpp:
3164         (WebCore::MediaDocumentParser::createDocumentStructure):
3165         (WebCore::MediaDocument::replaceMediaElementTimerFired):
3166         * html/PluginDocument.cpp:
3167         (WebCore::PluginDocumentParser::createDocumentStructure):
3168         * html/TextFieldInputType.cpp:
3169         (WebCore::TextFieldInputType::createAutoFillButton):
3170         (WebCore::TextFieldInputType::updateAutoFillButton):
3171         * html/parser/HTMLTreeBuilder.cpp:
3172         (WebCore::HTMLTreeBuilder::processIsindexStartTagForInBody):
3173         * html/shadow/MediaControlElements.cpp:
3174         (WebCore::MediaControlClosedCaptionsContainerElement::create):
3175         (WebCore::MediaControlTimelineElement::create):
3176         (WebCore::MediaControlPanelVolumeSliderElement::create):
3177         (WebCore::MediaControlFullscreenVolumeSliderElement::create):
3178         * html/shadow/TextControlInnerElements.cpp:
3179         (WebCore::SearchFieldCancelButtonElement::SearchFieldCancelButtonElement):
3180         * html/shadow/mac/ImageControlsButtonElementMac.cpp:
3181         (WebCore::ImageControlsButtonElementMac::tryCreate):
3182         * html/shadow/mac/ImageControlsRootElementMac.cpp:
3183         (WebCore::ImageControlsRootElement::tryCreate):
3184         * html/track/WebVTTElement.cpp:
3185         (WebCore::WebVTTElement::createEquivalentHTMLElement):
3186         * html/track/WebVTTParser.cpp:
3187         (WebCore::WebVTTTreeBuilder::constructTreeFromToken):
3188         * inspector/InspectorCSSAgent.cpp:
3189         (WebCore::InspectorCSSAgent::createInspectorStyleSheetForDocument):
3190         * inspector/InspectorPageAgent.cpp:
3191         (WebCore::InspectorPageAgent::buildObjectForFrame):
3192         * mathml/MathMLSelectElement.cpp:
3193         (WebCore::MathMLSelectElement::toggle):
3194         * page/PageSerializer.cpp:
3195         (WebCore::PageSerializer::serializeFrame):
3196         * rendering/RenderDetailsMarker.cpp:
3197         (WebCore::RenderDetailsMarker::isOpen):
3198         * rendering/mathml/RenderMathMLFraction.cpp:
3199         (WebCore::RenderMathMLFraction::updateFromElement):
3200         * svg/SVGElement.cpp:
3201         (WebCore::SVGElement::setXmlbase):
3202         * svg/SVGSVGElement.cpp:
3203         (WebCore::SVGSVGElement::setContentScriptType):
3204         (WebCore::SVGSVGElement::setContentStyleType):
3205         * svg/SVGStyleElement.cpp:
3206         (WebCore::SVGStyleElement::setMedia):
3207         (WebCore::SVGStyleElement::setTitle):
3208
3209 2016-07-15  Chris Dumez  <cdumez@apple.com>
3210
3211         Modernize StaticNodeList / StaticElementList
3212         https://bugs.webkit.org/show_bug.cgi?id=159831
3213
3214         Reviewed by Ryosuke Niwa.
3215
3216         Modernize StaticNodeList / StaticElementList. Pass vector to adopt
3217         as an rvalue reference instead of a non-const reference.
3218
3219         * bindings/js/JSHTMLAllCollectionCustom.cpp:
3220         (WebCore::namedItems):
3221         * dom/ChildListMutationScope.cpp:
3222         (WebCore::ChildListMutationAccumulator::enqueueMutationRecord):
3223         * dom/MutationRecord.cpp:
3224         * dom/SelectorQuery.cpp:
3225         (WebCore::SelectorDataList::queryAll):
3226         * dom/StaticNodeList.h:
3227         * dom/WebKitNamedFlow.cpp:
3228         (WebCore::WebKitNamedFlow::getRegionsByContent):
3229         (WebCore::WebKitNamedFlow::getRegions):
3230         (WebCore::WebKitNamedFlow::getContent):
3231         * svg/SVGSVGElement.cpp:
3232         (WebCore::SVGSVGElement::collectIntersectionOrEnclosureList):
3233         * testing/Internals.cpp:
3234         (WebCore::Internals::nodesFromRect):
3235
3236 2016-07-15  Brent Fulgham  <bfulgham@apple.com>
3237
3238         Block insecure script running in a data: frame when the top-level page is HTTPS
3239         https://bugs.webkit.org/show_bug.cgi?id=125806
3240         <rdar://problem/27331825>
3241
3242         Reviewed by Brady Eidson.
3243
3244         Fix based on a Blink change (patch by <tsepez@chromium.org>):
3245         <https://chromium.googlesource.com/chromium/blink/+/33e553bd96e040151c1472289a0d80803bfca3a5>
3246
3247         Test: http/tests/security/mixedContent/insecure-script-in-data-iframe-in-main-frame-blocked.html
3248
3249         * loader/cache/CachedResourceLoader.cpp:
3250         (WebCore::CachedResourceLoader::checkInsecureContent): Check the top-level frame's security state
3251         before allowing insecure scripts to be used.        
3252
3253 2016-07-15  Chris Dumez  <cdumez@apple.com>
3254
3255         Let the compiler generate QualifiedName copy constructor and assignment operator
3256         https://bugs.webkit.org/show_bug.cgi?id=159826
3257
3258         Reviewed by Alex Christensen.
3259
3260         Let the compiler generate QualifiedName copy constructor and assignment operator
3261         as our custom implementation does nothing special. This also makes QualifiedName
3262         movable as the compiler is now able to generate the move constructor / assignment
3263         operator as well.
3264
3265         * dom/QualifiedName.h:
3266         (WebCore::QualifiedName::QualifiedName): Deleted.
3267         (WebCore::QualifiedName::operator=): Deleted.
3268
3269 2016-07-15  Antonio Gomes  <tonikitoo@igalia.com>
3270
3271         ScrollView::setHasHorizontalScrollbar / setHasVerticalScrollbar duplicate their logic
3272         https://bugs.webkit.org/show_bug.cgi?id=159825
3273
3274         Patch introduces a (private) method to ScrollView
3275         to share the code/logic of setHas{Horizontal,Vertical}Scrollbar.
3276
3277         Reviewed by Simon Fraser.
3278
3279         No new tests needed.
3280
3281         * platform/ScrollView.cpp:
3282         (WebCore::ScrollView::setHasScrollbarInternal):
3283         (WebCore::ScrollView::setHasHorizontalScrollbar):
3284         (WebCore::ScrollView::setHasVerticalScrollbar):
3285         * platform/ScrollView.h:
3286
3287 2016-07-15  Frederic Wang  <fwang@igalia.com>
3288
3289         MathOperator: Improve alignment for vertical size variant
3290         https://bugs.webkit.org/show_bug.cgi?id=158866
3291
3292         Reviewed by Brent Fulgham.
3293
3294         The MathOperator class may stretch operators with either a large glyph or a glyph assembly.
3295         In the latter case, the assembly is adjusted to match the stretch ascent and descent
3296         requested by the callers. But in the former case the glyph ascent and descent are used
3297         instead. We solve this by making MathOperator::stretchTo only take a targetSize and let
3298         callers do the vertical alignment they want. This improves the rendering of fences with some
3299         math fonts (e.g. XITS) and allows to pass the two cases of mo-axis-height-1.html.
3300
3301         Test: imported/mathml-in-html5/mathml/presentation-markup/operators/mo-axis-height-1.html
3302
3303         * rendering/mathml/MathOperator.cpp:
3304         (WebCore::MathOperator::stretchTo): Merge vertical and horizontal stretching into the same
3305         function with only the targetSize as a parameter.
3306         * rendering/mathml/RenderMathMLOperator.cpp:
3307         (WebCore::RenderMathMLOperator::stretchTo): Updated to use the new signature.
3308         (WebCore::RenderMathMLOperator::verticalStretchedOperatorShift): Helper function to calculate
3309         the shift necessary to align the baseline of the MathOperator instance with the one of the
3310         RenderMathMLOperator.
3311         (WebCore::RenderMathMLOperator::firstLineBaseline): Adjust the baseline.
3312         * rendering/mathml/RenderMathMLOperator.h: Declare verticalStretchedOperatorShift.
3313         * rendering/mathml/RenderMathMLRoot.cpp:
3314         (WebCore::RenderMathMLRoot::layoutBlock): Use the new signature. This function aligns the top
3315         of the radical with the overbar so we do not need to adjust baseline alignment here.
3316
3317 2016-07-15  Brady Eidson  <beidson@apple.com>
3318
3319         WebKit should prevent push/replace state with username in URL.
3320         <rdar://problem/27361737> and https://bugs.webkit.org/show_bug.cgi?id=159818
3321
3322         Reviewed by Brent Fulgham.
3323
3324         Test: http/tests/security/history-username-password.html
3325
3326         * page/History.cpp:
3327         (WebCore::History::stateObjectAdded): Don't allow URLs with usernames/passwords.
3328
3329 2016-07-15  Ryan Haddad  <ryanhaddad@apple.com>
3330
3331         Unreviewed, rolling out r203266.
3332
3333         This change caused editing/deleting/delete-emoji.html to time
3334         out on El Capitan, crash under GuardMalloc
3335
3336         Reverted changeset:
3337
3338         "Support new emoji group candidates"
3339         https://bugs.webkit.org/show_bug.cgi?id=159755
3340         http://trac.webkit.org/changeset/203266
3341
3342 2016-07-15  Frederic Wang  <fwang@igalia.com>
3343
3344         Move parsing of mfrac attributes into a MathMLFractionElement class
3345         https://bugs.webkit.org/show_bug.cgi?id=159624
3346
3347         Reviewed by Brent Fulgham.
3348
3349         We move the parsing of mfrac attributes to a MathMLFractionElement class. This allows to
3350         minimize the updates in RenderMathMLFraction and to remove the alignment members. Many of
3351         the members in updateLayoutParameters are actually only used in layoutBlock and could be
3352         removed in a follow-up patch. We also improve the resolution of negative line thickness value
3353         since the MathML recommendation says it should be rounded up to the nearest valid
3354         value (which is zero) instead of ignoring the attribute and using the line thickness.
3355
3356         No new tests, already covered by existing tests.
3357
3358         * CMakeLists.txt: Add MathMLFractionElement.
3359         * WebCore.xcodeproj/project.pbxproj: Ditto.
3360         * mathml/MathMLAllInOne.cpp: Ditto.
3361         * mathml/MathMLFractionElement.cpp: Added.
3362         (WebCore::MathMLFractionElement::MathMLFractionElement):
3363         (WebCore::MathMLFractionElement::create):
3364         (WebCore::MathMLFractionElement::lineThickness): Return the cached linethickness length,
3365         parsing it again if it is dirty. This handles the special values "thin", "medium" and "thick"
3366         or fallback to the general parseMathMLLength for MathML lengths.
3367         (WebCore::MathMLFractionElement::cachedFractionAlignment): Return the cached alignment value,
3368         parsing it again if it is dirty.
3369         (WebCore::MathMLFractionElement::numeratorAlignment): Return the cached alignment.
3370         (WebCore::MathMLFractionElement::denominatorAlignment): Ditto.
3371         (WebCore::MathMLFractionElement::parseAttribute): Make attributes dirty.
3372         (WebCore::MathMLFractionElement::createElementRenderer): Create a RenderMathMLFraction.
3373         * mathml/MathMLFractionElement.h: Added.
3374         * mathml/MathMLInlineContainerElement.cpp: We no longer need to handle fraction here.
3375         (WebCore::MathMLInlineContainerElement::createElementRenderer):
3376         * mathml/mathtags.in: Use MathMLFractionElement for mfrac.
3377         * rendering/mathml/RenderMathMLFraction.cpp:
3378         (WebCore::RenderMathMLFraction::updateLayoutParameters): New helper function to set the
3379         layout parameters, replacing updateFromElement. We no longer parse and store the alignment
3380         values here. We also change the resolution of negative values.
3381         (WebCore::RenderMathMLFraction::horizontalOffset): Use the enum from MathMLFractionElement.
3382         (WebCore::RenderMathMLFraction::layoutBlock): We call updateLayoutParameters instead of
3383         updateFromElement. The numerator and denominator alignments are resolved here.
3384         (WebCore::RenderMathMLFraction::parseAlignmentAttribute): Deleted. Parsing of alignment
3385         attribute is now handled in MathMLFractionElement.
3386         (WebCore::RenderMathMLFraction::updateFromElement): Deleted. Attribute changes are now
3387         handled in MathMLFractionElement.
3388         (WebCore::RenderMathMLFraction::styleDidChange): Deleted. Font changes are properly handled.
3389         * rendering/mathml/RenderMathMLFraction.h: Update declarations.
3390
3391 2016-07-15  Frederic Wang  <fwang@igalia.com>
3392
3393         Check whether font is nonnull for GlyphData instead of calling GlyphData::isValid()
3394         https://bugs.webkit.org/show_bug.cgi?id=159783
3395
3396         Reviewed by Brent Fulgham.
3397
3398         GlyphData::isValid() returns true for GlyphData with null 'font' pointer when the 'glyph'
3399         index is nonzero. This behavior is not expected by the MathML code and we have had crashes
3400         in our test suite in the past on Windows (e.g. bug 140653). We thus replace the call to
3401         GlyphData::isValid() with a stronger verification: Whether the 'font' pointer is nonzero.
3402
3403         No new tests, this only makes null pointer checks stronger.
3404
3405         * rendering/mathml/MathOperator.cpp:
3406         (WebCore::boundsForGlyph):
3407         (WebCore::advanceWidthForGlyph):
3408         (WebCore::MathOperator::getBaseGlyph):
3409         (WebCore::MathOperator::setSizeVariant):
3410         (WebCore::MathOperator::fillWithVerticalExtensionGlyph):
3411         (WebCore::MathOperator::fillWithHorizontalExtensionGlyph):
3412         (WebCore::MathOperator::paintVerticalGlyphAssembly):
3413         (WebCore::MathOperator::paintHorizontalGlyphAssembly):
3414         (WebCore::MathOperator::paint):
3415         * rendering/mathml/RenderMathMLOperator.cpp:
3416         (WebCore::RenderMathMLOperator::computePreferredLogicalWidths):
3417         * rendering/mathml/RenderMathMLToken.cpp:
3418         (WebCore::RenderMathMLToken::computePreferredLogicalWidths):
3419         (WebCore::RenderMathMLToken::firstLineBaseline):
3420         (WebCore::RenderMathMLToken::layoutBlock):
3421         (WebCore::RenderMathMLToken::paint):
3422         (WebCore::RenderMathMLToken::paintChildren):
3423
3424 2016-07-15  Frederic Wang  <fwang@igalia.com>
3425
3426         Add DejaVu Math TeX Gyre to the list of math fonts.
3427         https://bugs.webkit.org/show_bug.cgi?id=159805
3428
3429         Reviewed by Brent Fulgham.
3430
3431         DejaVu 2.36 has a new math font that can be used for MathML rendering. Because this font is
3432         likely to be installed on many systems (Linux, LibreOffice, etc) we include it in the default
3433         list of font-families in mathml.css in order to increase the chance to find a math font.
3434
3435         No new tests, it only affects rendering when DejaVu Math TeX Gyre is installed on the system.
3436
3437         * css/mathml.css:
3438         (math):
3439
3440 2016-07-15  Eric Carlson  <eric.carlson@apple.com>
3441
3442         [MSE] Increase the SourceBuffer "fudge factor"
3443         https://bugs.webkit.org/show_bug.cgi?id=159813
3444         <rdar://problem/27372033>
3445
3446         Reviewed by Jon Lee.
3447         
3448         Some media encoding/conversion pipelines are sloppy when doing sample time/timescale
3449         math, and the error accumulation results in small gaps in the media timeline. r202641
3450         increased the maximum allowable gap from 0.01 second to one 24fps frame, but it turns
3451         out that at least one large provider has a significant amount of content encoded with
3452         up to two 24fps frames.
3453
3454         No new tests, updated media/media-source/media-source-small-gap.html.
3455
3456         * Modules/mediasource/SourceBuffer.cpp:
3457         (WebCore::currentTimeFudgeFactor): Increase maximum gap to 2002 / 24000 frames.
3458
3459 2016-07-15  Rawinder Singh  <rawinder.singh-webkit@cisra.canon.com.au>
3460
3461         Add final keyword to WebCore/svg classes
3462         https://bugs.webkit.org/show_bug.cgi?id=159802
3463
3464         Reviewed by Youenn Fablet.
3465
3466         Updated classes in the WebCore/svg directory to be marked as final where appropriate.
3467
3468         * svg/SVGException.h:
3469         * svg/SVGLengthList.h:
3470         * svg/SVGMatrix.h:
3471         * svg/SVGNumberList.h:
3472         * svg/SVGPaint.h:
3473         * svg/SVGPathBuilder.h:
3474         * svg/SVGPathByteStreamBuilder.h:
3475         * svg/SVGPathByteStreamSource.h:
3476         * svg/SVGPathSegArcAbs.h:
3477         * svg/SVGPathSegArcRel.h:
3478         * svg/SVGPathSegClosePath.h:
3479         * svg/SVGPathSegCurvetoCubicAbs.h:
3480         * svg/SVGPathSegCurvetoCubicRel.h:
3481         * svg/SVGPathSegCurvetoCubicSmoothAbs.h:
3482         * svg/SVGPathSegCurvetoCubicSmoothRel.h:
3483         * svg/SVGPathSegCurvetoQuadraticAbs.h:
3484         * svg/SVGPathSegCurvetoQuadraticRel.h:
3485         * svg/SVGPathSegCurvetoQuadraticSmoothAbs.h:
3486         * svg/SVGPathSegCurvetoQuadraticSmoothRel.h:
3487         * svg/SVGPathSegLinetoAbs.h:
3488         * svg/SVGPathSegLinetoHorizontalAbs.h:
3489         * svg/SVGPathSegLinetoHorizontalRel.h:
3490         * svg/SVGPathSegLinetoRel.h:
3491         * svg/SVGPathSegLinetoVerticalAbs.h:
3492         * svg/SVGPathSegLinetoVerticalRel.h:
3493         * svg/SVGPathSegListBuilder.h:
3494         * svg/SVGPathSegListSource.h:
3495         * svg/SVGPathSegMovetoAbs.h:
3496         * svg/SVGPathSegMovetoRel.h:
3497         * svg/SVGPathStringSource.h:
3498         * svg/SVGPathTraversalStateBuilder.h:
3499         * svg/SVGPointList.h:
3500         * svg/SVGRenderingIntent.h:
3501         * svg/SVGStringList.h:
3502         * svg/SVGTRefElement.cpp:
3503         * svg/SVGToOTFFontConversion.cpp:
3504         * svg/SVGTransformList.h:
3505         * svg/SVGUnitTypes.h:
3506         * svg/SVGViewSpec.h:
3507         * svg/SVGZoomEvent.h:
3508         * svg/animation/SMILTimeContainer.h:
3509         * svg/animation/SVGSMILElement.cpp:
3510         * svg/graphics/filters/SVGFEImage.h:
3511         * svg/graphics/filters/SVGFilter.h:
3512         * svg/properties/SVGAnimatedPathSegListPropertyTearOff.h:
3513         * svg/properties/SVGAnimatedPropertyTearOff.h:
3514         * svg/properties/SVGAnimatedTransformListPropertyTearOff.h:
3515         * svg/properties/SVGMatrixTearOff.h:
3516         * svg/properties/SVGPathSegListPropertyTearOff.h:
3517         * svg/properties/SVGStaticListPropertyTearOff.h:
3518         * svg/properties/SVGStaticPropertyTearOff.h:
3519         * svg/properties/SVGTransformListPropertyTearOff.h:
3520
3521 2016-07-15  Per Arne Vollan  <pvollan@apple.com>
3522
3523         Uninitialized variable in DIBPixelData can cause a dangerous memory write
3524         https://bugs.webkit.org/show_bug.cgi?id=159414
3525
3526         Reviewed by Brent Fulgham.
3527
3528         Initialize local BITMAP variable, in case the ::GetObject function that should initialize it
3529         fails to do so, because the bitmap handle is invalid.
3530
3531         Tests: Tools/TestWebKitAPI/Tests/WebCore/win/DIBPixelData.cpp
3532
3533         * platform/graphics/win/DIBPixelData.cpp:
3534         (WebCore::DIBPixelData::initialize): Initialize local variable.
3535         (WebCore::DIBPixelData::setRGBABitmapAlpha): Return early if we have no bitmap.
3536         * platform/graphics/win/DIBPixelData.h: Link fix.
3537
3538 2016-07-14  Yoav Weiss  <yoav@yoav.ws>
3539
3540         Change CSSParser::sourceSize returning Optional<CSSParser::SourceSize>
3541         https://bugs.webkit.org/show_bug.cgi?id=159666
3542
3543         Reviewed by Michael Catanzaro.
3544
3545         Tests:
3546             fast/dom/HTMLImageElement/sizes/image-sizes-invalids.html
3547
3548         * css/CSSGrammar.y.in: Avoid adding SourceSize to source_size_list when the value is a Nullopt.
3549         * css/CSSParser.cpp:
3550         (WebCore::CSSParser::sourceSize): Return a Nullopt when an invalid value is encountered.
3551         * css/CSSParser.h:
3552
3553 2016-07-14  Antonio Gomes  <tonikitoo@igalia.com>
3554
3555         [RTL Scrollbars] Frame scrollbars don't move to the right when text direction changes to RTL
3556         https://bugs.webkit.org/show_bug.cgi?id=158252
3557
3558         Reviewed by Myles C. Maxfield.
3559
3560         When the 'dir' attribute changes either on body or on the document
3561         element level, the associated FrameView does not trigger an update on
3562         the frame level vertical scrollbar.
3563
3564         Patch adds a 'hook' so that RenderBox::styleDidChange can call in
3565         order to get the document level scrollbar placed properly in the next
3566         layout.
3567
3568         Test: fast/scrolling/rtl-scrollbars-alternate-body-dir-attr-does-not-update-scrollbar-placement.html
3569               fast/scrolling/rtl-scrollbars-alternate-body-dir-attr-does-not-update-scrollbar-placement-2.html
3570               fast/scrolling/rtl-scrollbars-alternate-iframe-body-dir-attr-does-not-update-scrollbar-placement.html
3571
3572         * page/FrameView.cpp:
3573         (WebCore::FrameView::topContentDirectionDidChange):
3574         * page/FrameView.h:
3575         * rendering/RenderBox.cpp:
3576         (WebCore::RenderBox::styleDidChange):
3577
3578 2016-07-14  Myles C. Maxfield  <mmaxfield@apple.com>
3579
3580         Support new emoji group candidates
3581         https://bugs.webkit.org/show_bug.cgi?id=159755
3582         <rdar://problem/27325521>
3583
3584         Reviewed by Dean Jackson.
3585
3586         There are a few code points which should be able to be joined (with ZWJ) to
3587         either U+2640 or U+2642 to change the gender of the emoji. These patterns
3588         should also work with an additional 0xFE0F variation selector. This patch
3589         adds these new patterns to our existing emoji group candidate infrastructure.
3590
3591         Tests: fast/text/emoji-gender-2-3.html
3592                fast/text/emoji-gender-2-4.html
3593                fast/text/emoji-gender-2-5.html
3594                fast/text/emoji-gender-2-6.html
3595                fast/text/emoji-gender-2-7.html
3596                fast/text/emoji-gender-2-8.html
3597                fast/text/emoji-gender-2-9.html
3598                fast/text/emoji-gender-2.html
3599                fast/text/emoji-gender-3.html
3600                fast/text/emoji-gender-4.html
3601                fast/text/emoji-gender-5.html
3602                fast/text/emoji-gender-6.html
3603                fast/text/emoji-gender-7.html
3604                fast/text/emoji-gender-8.html
3605                fast/text/emoji-gender-9.html
3606                fast/text/emoji-gender-fe0f-3.html
3607                fast/text/emoji-gender-fe0f-4.html
3608                fast/text/emoji-gender-fe0f-5.html
3609                fast/text/emoji-gender-fe0f-6.html
3610                fast/text/emoji-gender-fe0f-7.html
3611                fast/text/emoji-gender-fe0f-8.html
3612                fast/text/emoji-gender-fe0f-9.html
3613                fast/text/emoji-gender.html
3614                fast/text/emoji-num-glyphs.html
3615                fast/text/emoji-single-parent-family-2.html
3616                fast/text/emoji-single-parent-family.html
3617
3618         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
3619         (WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun): Removed incorrect ASSERT()s.
3620         * platform/graphics/FontCascade.cpp:
3621         (WebCore::FontCascade::characterRangeCodePath):
3622         * platform/text/CharacterProperties.h:
3623         (WebCore::isEmojiGroupCandidate):
3624
3625 2016-07-14  Dean Jackson  <dino@apple.com>
3626
3627         CrashTracer: com.apple.WebKit.WebContent at WebCore: WebCore::MediaQueryEvaluator::evaluate const
3628         https://bugs.webkit.org/show_bug.cgi?id=159799
3629         <rdar://problem/27346959>
3630
3631         Reviewed by Myles Maxfield.
3632
3633         Speculative fix for this crash, which seems to happen when asking for the Node's
3634         renderer(). From the incoming crash logs, it is triggered by mutations on
3635         a <picture> or <img> element, which would require choosing a new source,
3636         and causing some media queries to evaluate.
3637
3638         The only place in MediaQueryEvaluator that has anything to do with
3639         renderers is when gathering up some style information to pass to the
3640         actual evaluation function. I put a guard against a missing documentElement
3641         in there.
3642
3643         * css/MediaQueryEvaluator.cpp:
3644         (WebCore::MediaQueryEvaluator::evaluate): Make sure documentElement is not
3645         null.
3646
3647 2016-07-14  Rawinder Singh  <rawinder.singh-webkit@cisra.canon.com.au>
3648
3649         Update HTML*Element class override methods in final classes
3650         https://bugs.webkit.org/show_bug.cgi?id=159456
3651
3652         Reviewed by Youenn Fablet.
3653
3654         Update HTML*Element classes so that overriden methods in final classes are marked final.
3655         Also marked HTMLDivElement overriden methods as final since they are not overridden by derived classes.
3656
3657         * html/HTMLAppletElement.h:
3658         * html/HTMLAreaElement.h:
3659         * html/HTMLAttachmentElement.h:
3660         * html/HTMLAudioElement.h:
3661         * html/HTMLBRElement.h:
3662         * html/HTMLBaseElement.h:
3663         * html/HTMLBodyElement.h:
3664         * html/HTMLButtonElement.h:
3665         * html/HTMLCanvasElement.h:
3666         * html/HTMLDataElement.h:
3667         * html/HTMLDetailsElement.h:
3668         * html/HTMLDivElement.h:
3669         * html/HTMLEmbedElement.h:
3670         * html/HTMLFieldSetElement.h:
3671         * html/HTMLFontElement.h:
3672         * html/HTMLFormElement.h:
3673         * html/HTMLFrameSetElement.h:
3674         * html/HTMLHRElement.h:
3675         * html/HTMLHtmlElement.h:
3676         * html/HTMLKeygenElement.h:
3677         * html/HTMLLIElement.h:
3678         * html/HTMLLabelElement.h:
3679         * html/HTMLLegendElement.h:
3680         * html/HTMLLinkElement.h:
3681         * html/HTMLMapElement.h:
3682         * html/HTMLMarqueeElement.h:
3683         * html/HTMLMetaElement.h:
3684         * html/HTMLMeterElement.h:
3685         * html/HTMLModElement.h:
3686         * html/HTMLOListElement.h:
3687         * html/HTMLObjectElement.h:
3688         * html/HTMLOptGroupElement.h:
3689         * html/HTMLOptionElement.h:
3690         * html/HTMLOutputElement.h:
3691         * html/HTMLParagraphElement.h:
3692         * html/HTMLParamElement.h:
3693         * html/HTMLPreElement.h:
3694         * html/HTMLProgressElement.h:
3695         * html/HTMLQuoteElement.h:
3696         * html/HTMLScriptElement.h:
3697         * html/HTMLSourceElement.h:
3698         * html/HTMLStyleElement.h:
3699         * html/HTMLSummaryElement.h:
3700         * html/HTMLTableCaptionElement.h:
3701         * html/HTMLTableColElement.h:
3702         * html/HTMLTableElement.h:
3703         * html/HTMLTableSectionElement.h:
3704         * html/HTMLTemplateElement.h:
3705         * html/HTMLTextAreaElement.h:
3706         * html/HTMLTitleElement.h:
3707         * html/HTMLUListElement.h:
3708         * html/HTMLUnknownElement.h:
3709         * html/HTMLVideoElement.h:
3710         * html/HTMLWBRElement.h:
3711
3712 2016-07-14  Chris Dumez  <cdumez@apple.com>
3713
3714         Modernize GlyphMetricsMap
3715         https://bugs.webkit.org/show_bug.cgi?id=159788
3716
3717         Reviewed by Darin Adler.
3718
3719         Modernize GlyphMetricsMap a bit.
3720
3721         * platform/graphics/GlyphMetricsMap.h:
3722         - Drop WTF_MAKE_NONCOPYABLE as the class is already non-copyable due to having
3723           to having a std::unique_ptr data member.
3724         - Drop GlyphMetricsMap default constructor and let the compiler generate it
3725           instead. This required using inline initialization for m_filledPrimaryPage.
3726
3727         (WebCore::GlyphMetricsMap::GlyphMetricsPage::GlyphMetricsPage):
3728         - Make m_metrics data member private as it does not need to be public.
3729         - Make setMetricsForIndex(unsigned index, const T& metrics) setter private
3730           as it does not need to be public.
3731         - Make GlyphMetricsPage(const T& initialValue) constructor explicit as it
3732           takes only 1 parameter.
3733
3734         (WebCore::GlyphMetricsMap<T>::locatePageSlowCase):
3735         - Use HashMap::ensure() to make the code a bit nicer.
3736
3737 2016-07-14  Simon Fraser  <simon.fraser@apple.com>
3738
3739         [iOS WK2] When scrolling apple.com/music on iPad Pro in landscape, left-hand tiles appear first
3740         https://bugs.webkit.org/show_bug.cgi?id=159798
3741         rdar://problem/27362717
3742
3743         Reviewed by Tim Horton.
3744
3745         In out-of-visible tiled layers, we always allocated the top-left tile, wasting
3746         memory and causing ugliness when scrolling that layer into view. This happened
3747         because getTileIndexRangeForRect() had no way to express the fact that no tiles
3748         should be created.
3749
3750         Fix getTileIndexRangeForRect() to return a bool, and fix callers to respect the
3751         return value.
3752
3753         Test: compositing/tiling/offscreen-tiled-layer.html
3754
3755         * platform/graphics/ca/GraphicsLayerCA.cpp:
3756         (WebCore::GraphicsLayerCA::dumpAdditionalProperties):
3757         * platform/graphics/ca/TileGrid.cpp:
3758         (WebCore::TileGrid::setNeedsDisplayInRect):
3759         (WebCore::TileGrid::tilesWouldChangeForCoverageRect):
3760         (WebCore::TileGrid::getTileIndexRangeForRect):
3761         (WebCore::TileGrid::revalidateTiles):
3762         (WebCore::TileGrid::ensureTilesForRect):
3763         (WebCore::TileGrid::extent):
3764         * platform/graphics/ca/TileGrid.h:
3765
3766 2016-07-14  John Wilander  <wilander@apple.com>
3767
3768         Remove credentials in URL when accessed through location.href
3769         https://bugs.webkit.org/show_bug.cgi?id=139562
3770         <rdar://problem/27331164>
3771
3772         Reviewed by Brent Fulgham.
3773
3774         Test: http/tests/security/location-href-clears-username-password.html
3775
3776         The reason for this change is to not allow scripts on the page to
3777         exfiltrate username and password from the URL.
3778
3779         * page/Location.cpp:
3780         (WebCore::Location::href):
3781             Now checks if there is a username or password in the URL. If so,
3782             it copies the URL and removes the username and password.
3783
3784 2016-07-14  Javier Fernandez  <jfernandez@igalia.com>
3785
3786         [css-grid] Handle min-content/max-content with orthogonal flows
3787         https://bugs.webkit.org/show_bug.cgi?id=159294
3788
3789         Reviewed by Darin Adler.
3790
3791         Currently there is no support for orthogonal flows in many aspects of the
3792         Grid Layout logic.
3793
3794         The Grid sizing algorithm should be adapted to this scenario, hence this
3795         patch focus on the min-content and max-content functions, used to resolve
3796         content based track sizes.
3797
3798         There are still issues related to alignment and sizes using percentages,
3799         but they will be addressed in different patches.
3800
3801         Tests: fast/css-grid-layout/grid-item-positioning-with-orthogonal-flows.html
3802                fast/css-grid-layout/grid-item-sizing-with-orthogonal-flows.html
3803                fast/css-grid-layout/grid-item-spanning-and-orthogonal-flows.html
3804                fast/css-grid-layout/grid-track-sizing-with-orthogonal-flows.html
3805                fast/css-grid-layout/grid-track-sizing-with-percentages-and-orthogonal-flows.html
3806
3807         * rendering/RenderBox.cpp:
3808         (WebCore::RenderBox::computeLogicalWidthInRegion):
3809         * rendering/RenderGrid.cpp:
3810         (WebCore::RenderGrid::GridSizingData::advanceNextState):
3811         (WebCore::RenderGrid::GridSizingData::isValidTransitionForDirection):
3812         (WebCore::RenderGrid::computeTrackSizesForDirection):
3813         (WebCore::RenderGrid::repeatTracksSizingIfNeeded): Added.
3814         (WebCore::RenderGrid::layoutBlock):
3815         (WebCore::RenderGrid::computeIntrinsicLogicalWidths):
3816         (WebCore::RenderGrid::computeIntrinsicLogicalHeight):
3817         (WebCore::hasOverrideContainingBlockContentSizeForChild):
3818         (WebCore::overrideContainingBlockContentSizeForChild):
3819         (WebCore::setOverrideContainingBlockContentSizeForChild):
3820         (WebCore::shouldClearOverrideContainingBlockContentSizeForChild):
3821         (WebCore::RenderGrid::gridTrackSize):
3822         (WebCore::RenderGrid::isOrthogonalChild): Added.
3823         (WebCore::RenderGrid::logicalHeightForChild):
3824         (WebCore::RenderGrid::flowAwareDirectionForChild): Added.
3825         (WebCore::RenderGrid::minSizeForChild):
3826         (WebCore::RenderGrid::updateOverrideContainingBlockContentSizeForChild):
3827         (WebCore::RenderGrid::minContentForChild):
3828         (WebCore::RenderGrid::maxContentForChild):
3829         (WebCore::RenderGrid::placeItemsOnGrid):
3830         (WebCore::RenderGrid::layoutPositionedObject):
3831         (WebCore::RenderGrid::offsetAndBreadthForPositionedChild):
3832         (WebCore::RenderGrid::assumedRowsSizeForOrthogonalChild): Added.
3833         (WebCore::RenderGrid::gridAreaBreadthForChild):
3834         (WebCore::RenderGrid::columnAxisPositionForChild):
3835         (WebCore::RenderGrid::rowAxisPositionForChild):
3836         (WebCore::RenderGrid::findChildLogicalPosition):
3837         * rendering/RenderGrid.h:
3838         (WebCore::RenderGrid::SizingOperation): This enum has been moved to the header file.
3839         (WebCore::RenderGrid::m_hasAnyOrthogonalChild): New class attribute to know if there are any orthogonal grid items.
3840         (WebCore::RenderGrid::updateOverrideContainingBlockContentSizeForChild):
3841         (WebCore::RenderGrid::logicalHeightForChild):
3842         (WebCore::RenderGrid::gridAreaBreadthForChild):
3843         (WebCore::RenderGrid::assumedRowsSizeForOrthogonalChild):
3844
3845
3846
3847 2016-07-14  Chris Dumez  <cdumez@apple.com>
3848
3849         Use emptyString() instead of "" when possible
3850         https://bugs.webkit.org/show_bug.cgi?id=159789
3851
3852         Reviewed by Alex Christensen.
3853
3854         Use emptyString() instead of "" when possible to reduce String allocations.
3855
3856         * Modules/webdatabase/Database.cpp:
3857         (WebCore::Database::performOpenAndVerify):
3858         * css/CSSSelector.h:
3859         * css/StyleProperties.cpp:
3860         (WebCore::MutableStyleProperties::removeProperty):
3861         (WebCore::MutableStyleProperties::removeCustomProperty):
3862         * editing/TextCheckingHelper.cpp:
3863         (WebCore::TextCheckingHelper::findFirstMisspellingOrBadGrammar):
3864         (WebCore::TextCheckingHelper::findFirstBadGrammar):
3865         * editing/TypingCommand.h:
3866         (WebCore::TypingCommand::create):
3867         * fileapi/FileReaderLoader.cpp:
3868         (WebCore::FileReaderLoader::cleanup):
3869         * inspector/InspectorStyleSheet.cpp:
3870         (WebCore::fillMediaListChain):
3871         * page/UserContentURLPattern.cpp:
3872         (WebCore::UserContentURLPattern::parse):
3873         * platform/graphics/MediaPlayer.cpp:
3874         (WebCore::MediaPlayer::load):
3875         * platform/gtk/DataObjectGtk.h:
3876         (WebCore::DataObjectGtk::clearURIList):
3877         * platform/network/curl/ResourceHandleCurl.cpp:
3878         (WebCore::ResourceHandle::receivedRequestToContinueWithoutCredential):
3879         * platform/network/curl/ResourceHandleManager.h:
3880         * rendering/RenderLayerCompositor.cpp:
3881         (WebCore::RenderLayerCompositor::layerTreeAsText):
3882         * rendering/RenderListMarker.cpp:
3883         (WebCore::RenderListMarker::updateContent):
3884         * rendering/style/RenderStyle.cpp:
3885         (WebCore::RenderStyle::noneDashboardRegions):
3886         * rendering/svg/SVGTextMetrics.cpp:
3887         (WebCore::SVGTextMetrics::SVGTextMetrics):
3888         * xml/XPathParser.cpp:
3889         (WebCore::XPath::Parser::lexString):
3890
3891 2016-07-14  Brent Fulgham  <bfulgham@apple.com>
3892
3893         editing/spelling/spellcheck-async.html sometimes crashes with GuardMalloc 
3894         https://bugs.webkit.org/show_bug.cgi?id=142969
3895         <rdar://problem/27331095>
3896
3897         Reviewed by Alex Christensen.
3898
3899         Fix based on a Blink change (patch by <rouslan@chromium.org>):
3900         <https://chromium.googlesource.com/chromium/blink/+/c713736b122c2224804b2db72f1f711cb47ee260%5E%21/#F1>
3901
3902         Test: editing/spelling/copy-paste-crash.html
3903               editing/spelling/spellcheck-async.html
3904
3905         * editing/SpellChecker.cpp:
3906         (WebCore::SpellCheckRequest::didSucceed):
3907         (WebCore::SpellCheckRequest::didCancel):
3908
3909 2016-07-14  Zalan Bujtas  <zalan@apple.com>
3910
3911         ImageBuffer's succes flag should be set to false at the very beginning of the c'tor.
3912         https://bugs.webkit.org/show_bug.cgi?id=159784
3913
3914         Reviewed by Simon Fraser.
3915
3916         No change in functionality.
3917
3918         * platform/graphics/cg/ImageBufferCG.cpp:
3919         (WebCore::ImageBuffer::ImageBuffer):
3920
3921 2016-07-14  Alex Christensen  <achristensen@webkit.org>
3922
3923         Use SocketProvider to create SocketStreamHandles
3924         https://bugs.webkit.org/show_bug.cgi?id=159774
3925
3926         Reviewed by Brady Eidson.
3927
3928         No new tests.  No change in behaviour.
3929         
3930         In r202930 I introduced the SocketProvider, but I used it to make a WebSocketChannel
3931         instead of a SocketStreamHandle, which is the class I want to make into an interface
3932         and proxy the web traffic over to the NetworkProcess.
3933
3934         * CMakeLists.txt:
3935         * Modules/websockets/ThreadableWebSocketChannel.cpp: Added.
3936         (WebCore::ThreadableWebSocketChannel::create):
3937         I removed this in 202930, so this is restoring it from that patch, hence the old copyright.
3938         * Modules/websockets/ThreadableWebSocketChannel.h:
3939         (WebCore::ThreadableWebSocketChannel::ThreadableWebSocketChannel):
3940         * Modules/websockets/WebSocket.cpp:
3941         (WebCore::WebSocket::connect):
3942         * Modules/websockets/WebSocketChannel.cpp:
3943         (WebCore::WebSocketChannel::WebSocketChannel):
3944         (WebCore::WebSocketChannel::connect):
3945         * Modules/websockets/WebSocketChannel.h:
3946         (WebCore::WebSocketChannel::create):
3947         * Modules/websockets/WorkerThreadableWebSocketChannel.cpp:
3948         (WebCore::WorkerThreadableWebSocketChannel::WorkerThreadableWebSocketChannel):
3949         (WebCore::WorkerThreadableWebSocketChannel::resume):
3950         (WebCore::WorkerThreadableWebSocketChannel::Peer::Peer):
3951         (WebCore::WorkerThreadableWebSocketChannel::Peer::didReceiveMessageError):
3952         (WebCore::WorkerThreadableWebSocketChannel::Bridge::Bridge):
3953         (WebCore::WorkerThreadableWebSocketChannel::Bridge::~Bridge):
3954         (WebCore::WorkerThreadableWebSocketChannel::Bridge::mainThreadInitialize):
3955         (WebCore::WorkerThreadableWebSocketChannel::Bridge::initialize):
3956         * Modules/websockets/WorkerThreadableWebSocketChannel.h:
3957         (WebCore::WorkerThreadableWebSocketChannel::create):
3958         (WebCore::WorkerThreadableWebSocketChannel::Bridge::create):
3959         * WebCore.xcodeproj/project.pbxproj:
3960         * inspector/InspectorOverlay.cpp:
3961         (WebCore::InspectorOverlay::overlayPage):
3962         * loader/EmptyClients.cpp:
3963         (WebCore::EmptyEditorClient::registerRedoStep):
3964         (WebCore::EmptySocketProvider::createWebSocketChannel): Deleted.
3965         * loader/EmptyClients.h:
3966         * page/SocketProvider.cpp: Added.
3967         (WebCore::SocketProvider::createSocketStreamHandle):
3968         * page/SocketProvider.h:
3969         (WebCore::SocketProvider::~SocketProvider): Deleted.
3970         * platform/network/cf/SocketStreamHandle.h:
3971         * svg/graphics/SVGImage.cpp:
3972         (WebCore::SVGImage::dataChanged):
3973
3974 2016-07-14  Brady Eidson  <beidson@apple.com>
3975
3976         "User delete" tests are flakey timeouts (and/or DatabaseProcess crashes).
3977         https://bugs.webkit.org/show_bug.cgi?id=158741
3978
3979         Reviewed by Alex Christensen.
3980
3981         No new tests (Covered by existing tests in some configurations)
3982
3983         - Check if a database hard delete is complete in more places.
3984     &