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