Unreviewed, rolling out r185906.
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2015-06-24  Commit Queue  <commit-queue@webkit.org>
2
3         Unreviewed, rolling out r185906.
4         https://bugs.webkit.org/show_bug.cgi?id=146276
5
6         MSVC doesn't yet provide a const-qualified std::array<T,
7         N>::size(), failing to compile the static_assert (Requested by
8         zdobersek on #webkit).
9
10         Reverted changeset:
11
12         "Improve the source code generated by make_names.pl"
13         https://bugs.webkit.org/show_bug.cgi?id=146208
14         http://trac.webkit.org/changeset/185906
15
16 2015-06-24  Zan Dobersek  <zdobersek@igalia.com>
17
18         Improve the source code generated by make_names.pl
19         https://bugs.webkit.org/show_bug.cgi?id=146208
20
21         Reviewed by Darin Adler.
22
23         Clean up and optimize the output that's generated by the make_names.pl script
24         when generating large sets of DOM names for attributes and tags.
25
26         The GenerateStrings() function in the StaticString.pm module is split into
27         GenerateStringData() and GenerateASCIILiteral() so that the two new functions
28         can be used independently, with the original function still being called when
29         generating font names.
30
31         Tags and attributes have the corresponding static QualifiedName globals defined
32         as before. After that, two static const std::array<> objects are defined for
33         both types -- the first is an ordered array of addresses of the QualifiedName
34         objects (corresponding to the C array that was defined in getHTMLTags(),
35         getSVGAttrs() etc.), and the second is an ordered array of StringImpl::StaticASCIILiteral
36         objects that replaces separately defined StringImpl::StaticASCIILiteral objects
37         and the additional tables that contained pairs of QualifiedName object addresses
38         and the corresponding StaticASCIILiteral object references in the init() function.
39         This is all generated by the printStaticData() function in make_names.pl.
40
41         The printQualifiedNameCreation() function generates a static_assert() that ensures
42         that the corresponding std::array<QualifiedName*> and std::array<StaticASCIILiteral>
43         objects have the same amount of items, and then sets up a loop that walks through
44         the two arrays and properly constructs the QualifiedName objects from the static
45         literal data.
46
47         On the GTK port, this shaves off ~54kB from the final stripped shared library
48         on a 64-bit build, and ~21kB on a 32-bit build.
49
50         * bindings/scripts/StaticString.pm:
51         (GenerateStringData):
52         (GenerateASCIILiteral):
53         (GenerateStrings):
54         * dom/make_names.pl:
55         (printCppHead):
56         (printNamesCppFile):
57         (printStaticData):
58         (printQualifiedNameCreation):
59         (printInit): Deleted.
60         (printDefinitions): Deleted.
61
62 2015-06-24  Youenn Fablet  <youenn.fablet@crf.canon.fr>
63
64         Refactor UserMediaRequest to share more codes between MediaDevices.getUserMedia and legacy webkitGetUserMedia
65         https://bugs.webkit.org/show_bug.cgi?id=146237
66
67         Reviewed by Darin Adler.
68
69         Covered by existing tests, no change in behavior.
70
71         * Modules/mediastream/MediaConstraintsImpl.cpp:
72         (WebCore::MediaConstraintsImpl::create): Simplified error handling by removing exception code parameter.
73         * Modules/mediastream/MediaConstraintsImpl.h: Ditto.
74         * Modules/mediastream/MediaDevices.cpp:
75         (WebCore::MediaDevices::getUserMedia): Removed code now in UserMediaRequest::start.
76         * Modules/mediastream/NavigatorUserMedia.cpp:
77         (WebCore::NavigatorUserMedia::webkitGetUserMedia): Ditto.
78         * Modules/mediastream/UserMediaRequest.cpp:
79         (WebCore::parseOptions): Simplified error handling by removing exception code parameter.
80         (WebCore::UserMediaRequest::start): Renamed create in start and added common code.
81         * Modules/mediastream/UserMediaRequest.h:
82
83 2015-06-23  Andreas Kling  <akling@apple.com>
84
85         Should reduce tile coverage for the first paint after a tab switch.
86         <https://webkit.org/b/146252>
87         <rdar://problem/19821583>
88
89         Reviewed by Darin Adler.
90
91         Reduce the number of tiles we need to paint after switching tabs,
92         to shorten the time it takes before we can flush pixels to screen.
93
94         We accomplish this by piggybacking on the "speculative tiling enabled"
95         mode of FrameView, which was previously only used to throttle painting
96         and layer flushes during page load.
97
98         When a FrameView becomes visible, which is what happens when you
99         switch to its tab, we revert the speculative tiling optimization to
100         its initial state, and reset the "scrolled by user" flag.
101
102         In practice this means that after switching tabs, we only generate
103         enough tiles to fill the viewport. Then, after 500ms has passed
104         or the user scrolls the page, we go back to the usual speculative
105         tiling mode.
106
107         * page/FrameView.cpp:
108         (WebCore::FrameView::show):
109
110 2015-06-23  Anders Carlsson  <andersca@apple.com>
111
112         Remove windowResizerRect code, nobody is using it anymore
113         https://bugs.webkit.org/show_bug.cgi?id=146265
114
115         Reviewed by Beth Dakin.
116
117         * loader/EmptyClients.h:
118         * page/Chrome.cpp:
119         (WebCore::Chrome::windowResizerRect): Deleted.
120         * page/Chrome.h:
121         * page/ChromeClient.h:
122         * page/FrameView.cpp:
123         (WebCore::FrameView::windowResizerRect): Deleted.
124         * page/FrameView.h:
125         * platform/ScrollView.cpp:
126         (WebCore::ScrollView::ScrollView): Deleted.
127         (WebCore::ScrollView::windowResizerRectChanged): Deleted.
128         (WebCore::ScrollView::containsScrollbarsAvoidingResizer): Deleted.
129         (WebCore::ScrollView::adjustScrollbarsAvoidingResizerCount): Deleted.
130         (WebCore::ScrollView::setParent): Deleted.
131         * platform/ScrollView.h:
132         (WebCore::ScrollView::windowResizerRect): Deleted.
133         * platform/Scrollbar.cpp:
134         (WebCore::Scrollbar::Scrollbar): Deleted.
135         (WebCore::Scrollbar::setFrameRect): Deleted.
136         (WebCore::Scrollbar::setParent): Deleted.
137         * platform/Scrollbar.h:
138
139 2015-06-23  Dean Jackson  <dino@apple.com>
140
141         Media controls are missing the white backdrop in UIWebViews
142         https://bugs.webkit.org/show_bug.cgi?id=146251
143         <rdar://problem/20181345>
144
145         Reviewed by Simon Fraser.
146
147         Implement two new CALayer subclasses that explicitly set
148         something that resembles the system appearance for
149         media-controls-dark-bar-background and media-controls-light-bar-background.
150         This way, WebKit1 clients get a visible result.
151
152         Creating the actual system recipes is tracked by:
153         https://bugs.webkit.org/show_bug.cgi?id=146250
154
155         * WebCore.xcodeproj/project.pbxproj: Add new files.
156         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
157         (PlatformCALayerCocoa::PlatformCALayerCocoa): Use the new CALayer subclasses for
158         the appropriate layer types.
159         * platform/graphics/ca/cocoa/WebSystemBackdropLayer.h: Added.
160         * platform/graphics/ca/cocoa/WebSystemBackdropLayer.mm: Added.
161         (-[WebLightSystemBackdropLayer init]):
162         (-[WebLightSystemBackdropLayer setBackgroundColor:]): Only set to a light grey.
163         (-[WebDarkSystemBackdropLayer init]):
164         (-[WebDarkSystemBackdropLayer setBackgroundColor:]): Only set to a dark grey.
165
166 2015-06-18  Matt Rajca  <mrajca@apple.com>
167
168         Support releasing media sessions
169         https://bugs.webkit.org/show_bug.cgi?id=146132
170
171         Reviewed by Darin Adler.
172
173         * Modules/mediasession/MediaSession.cpp: Implemented as described in the Media Session spec.
174         (WebCore::MediaSession::releaseSession):
175         (WebCore::MediaSession::releaseInternal):
176         * Modules/mediasession/MediaSession.h:
177
178 2015-06-23  Chris Fleizach  <cfleizach@apple.com>
179
180         AX: iOS: VoiceOver and ARIA: has popup property not announced
181         https://bugs.webkit.org/show_bug.cgi?id=146188
182
183         Reviewed by Darin Adler.
184
185         Expose the existing "has popup" property to the iOS Accessibility API.
186
187         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
188         (-[WebAccessibilityObjectWrapper accessibilityHasPopup]):
189
190 2015-06-23  Javier Fernandez  <jfernandez@igalia.com>
191
192         [CSS Grid Layout] Performance optimization: avoid computing overflow alignment if not needed
193         https://bugs.webkit.org/show_bug.cgi?id=146231
194
195         Reviewed by Sergio Villar Senin.
196
197         We don't need to apply any overflow handling if alignment value don't have a potential
198         risk of data loss, as it's the case of 'start' value.
199
200         This patch avoid computing the overflow in all the cases, since it adds an unneeded
201         overhead which affects performance.
202
203         New code improves performance around 3%-8%, depending on the grid tests.
204
205         No new tests, no new funcitonality.
206
207         * rendering/RenderGrid.cpp:
208         (WebCore::RenderGrid::rowPositionForChild):
209         (WebCore::RenderGrid::columnPositionForChild):
210
211 2015-06-23  Youenn Fablet  <youenn.fablet@crf.canon.fr>
212
213         MediaDevices.getUserMedia should migrate from callbacks to DOMPromise
214         https://bugs.webkit.org/show_bug.cgi?id=146200
215
216         Reviewed by Darin Adler.
217
218         Introduced DOMPromiseWithCallback to resolve/reject promises while allowing promise clients to use a typed callback approach.
219         Migrated MediaDevices.getUserMedia from callbacks to DOMPromiseWithCallback.
220         Removed MediaDevices.getUserMedia custom binding.
221
222         Covered by existing tests.
223
224         * CMakeLists.txt: Removing custom binding.
225         * Modules/mediastream/MediaDevices.cpp:
226         (WebCore::MediaDevices::getUserMedia): Moving from callback to promise.
227         * Modules/mediastream/MediaDevices.h: Ditto.
228         * Modules/mediastream/MediaDevices.idl: Removing custom binding.
229         * Modules/mediastream/NavigatorUserMedia.cpp:
230         (WebCore::NavigatorUserMedia::webkitGetUserMedia): Converting from promise callback to API callbacks.
231         * Modules/mediastream/UserMediaRequest.cpp:
232         (WebCore::UserMediaRequest::create): Moving from callback to promise.
233         (WebCore::UserMediaRequest::UserMediaRequest): Ditto.
234         (WebCore::UserMediaRequest::didCreateStream): Ditto.
235         (WebCore::UserMediaRequest::failedToCreateStreamWithConstraintsError): Ditto.
236         (WebCore::UserMediaRequest::failedToCreateStreamWithPermissionError): Ditto.
237         * Modules/mediastream/UserMediaRequest.h: Ditto.
238         * bindings/js/JSDOMPromise.h: Introducing DOMPromiseWithCallback and removing crypto specific header.
239         (WebCore::DOMPromiseWithCallback::DOMPromiseWithCallback):
240         (WebCore::Error>::resolve):
241         (WebCore::Error>::reject):
242         * bindings/js/JSMediaDevicesCustom.cpp: Removed.
243         * bindings/js/JSSubtleCryptoCustom.cpp: Updating headers.
244
245 2015-06-23  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet  <youenn.fablet@crf.canon.fr>
246
247         [Streams API] Implement ReadableStream js source "'cancel" callback
248         https://bugs.webkit.org/show_bug.cgi?id=146204
249
250         Reviewed by Darin Adler.
251
252         Calling "cancel" JS function when web app is cancelling a JS readable stream.
253         Handling of promise returned value in case of async cancel.
254
255         Covered by rebased tests.
256
257         * bindings/js/ReadableJSStream.cpp:
258         (WebCore::ReadableJSStream::invoke): Refactoring to pass cancel reason or controller to the JS function.
259         (WebCore::ReadableJSStream::doStart): Ditto.
260         (WebCore::startReadableStreamAsync): Renaming readableStream as protectedStream.
261         (WebCore::createPullResultFulfilledFunction): Ditto.
262         (WebCore::ReadableJSStream::doPull): Refactoring to pass cancel reason or controller to the JS function.
263         (WebCore::createCancelResultFulfilledFunction): Cancel promise fullfil callback.
264         (WebCore::createCancelResultRejectedFunction): Cancel promise reject callback.
265         (WebCore::ReadableJSStream::doCancel): Calling cancel JS callback and handling promise returned value.
266         * bindings/js/ReadableJSStream.h: Refactoring to pass cancel reason or controller to the JS function.
267
268 2015-06-22  Ryuan Choi  <ryuan.choi@navercorp.com>
269
270         [EFL] Hyphenation is not supported
271         https://bugs.webkit.org/show_bug.cgi?id=89830
272
273         Reviewed by Gyuyoung Kim.
274
275         Share libHyphen backend of GTK port.
276
277         Rebased fast/text/hyphenate-*.html
278
279         * PlatformEfl.cmake:
280         * PlatformGTK.cmake:
281         * platform/efl/FileSystemEfl.cpp:
282         (WebCore::listDirectory): Deleted because of lack of functionality.
283         eina_file_ls returns full directory path so fnmatch fails to check dict file.
284         This patch reuse Posix implementation instead of EFL port specific function.
285         * platform/posix/FileSystemPOSIX.cpp: Ditto.
286         * platform/text/gtk/HyphenationLibHyphen.cpp: Moved to platform/text/hyphen
287         * platform/text/hyphen/HyphenationLibHyphen.cpp:
288         Renamed from Source/WebCore/platform/text/gtk/HyphenationLibHyphen.cpp.
289         (WebCore::scanTestDictionariesDirectoryIfNecessary):
290         Added PLATFORM guard and EFL implementation for the test directory
291
292 2015-06-22  Chris Dumez  <cdumez@apple.com>
293
294         [WK1] WebAllowDenyPolicyListener.denyOnlyThisRequest() should not start a new permission request
295         https://bugs.webkit.org/show_bug.cgi?id=146228
296         <rdar://problem/15179262>
297
298         Reviewed by Daniel Bates.
299
300         Add Geolocation::resetIsAllowed() API that merely resets
301         m_allowGeolocation to Unknown, so that we will request the permission
302         again the next time a position is requested.
303
304         * Modules/geolocation/Geolocation.h:
305         (WebCore::Geolocation::resetIsAllowed):
306
307 2015-06-22  Simon Fraser  <simon.fraser@apple.com>
308
309         ASSERT(!m_zOrderListsDirty) when mousing over web view with incremental rendering suppressed
310         https://bugs.webkit.org/show_bug.cgi?id=146225
311
312         Reviewed by Zalan Bujtas.
313
314         Update RenderLayer's z-order lists when hit testing. There's no guarantee that they've
315         been updated; this happens to work most of the time because painting updates them,
316         but if incremental rendering is suppressed, we may not have painted yet.
317         
318         Easy to hit on webkit.org in MiniBrowser, but I wasn't able to make a reduced testcase.
319
320         * rendering/RenderLayer.cpp:
321         (WebCore::RenderLayer::hitTest):
322         (WebCore::RenderLayer::updateLayerListsIfNeeded): Flip the order of the tests, since checking
323         dirty bits is cheaper than calling isStackingContext().
324
325 2015-06-22  Dean Jackson  <dino@apple.com>
326
327         Rename PlatformCA*Mac to PlatformCA*Cocoa
328         https://bugs.webkit.org/show_bug.cgi?id=146224
329         <rdar://problem/21497182>
330
331         Reviewed by Simon Fraser.
332
333         Rename PlatformCALayerMac and related files in platform/graphics/ca/mac
334         to the more accurate Cocoa suffix.
335
336         * WebCore.xcodeproj/project.pbxproj:
337         * page/mac/ServicesOverlayController.mm:
338         * platform/graphics/ca/GraphicsLayerCA.cpp:
339         * platform/graphics/ca/PlatformCAAnimation.h:
340         * platform/graphics/ca/PlatformCALayer.h:
341         * platform/graphics/ca/cocoa/LayerFlushSchedulerMac.cpp: Renamed from Source/WebCore/platform/graphics/ca/mac/LayerFlushSchedulerMac.cpp.
342         * platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.h: Renamed from Source/WebCore/platform/graphics/ca/mac/PlatformCAAnimationMac.h.
343         * platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.mm: Renamed from Source/WebCore/platform/graphics/ca/mac/PlatformCAAnimationMac.mm.
344         * platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm: Renamed from Source/WebCore/platform/graphics/ca/mac/PlatformCAFiltersMac.mm.
345         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h: Renamed from Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.h.
346         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm: Renamed from Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm.
347         * platform/graphics/ca/cocoa/WebTiledBackingLayer.h: Renamed from Source/WebCore/platform/graphics/ca/mac/WebTiledBackingLayer.h.
348         * platform/graphics/ca/cocoa/WebTiledBackingLayer.mm: Renamed from Source/WebCore/platform/graphics/ca/mac/WebTiledBackingLayer.mm.
349         * platform/graphics/ca/mac/LayerFlushSchedulerMac.cpp:
350         * platform/graphics/ca/mac/PlatformCAAnimationMac.mm:
351         * platform/graphics/ca/mac/PlatformCAFiltersMac.mm:
352         * platform/graphics/ca/mac/PlatformCALayerMac.mm:
353         * platform/graphics/ca/mac/WebTiledBackingLayer.mm:
354
355 2015-06-22  Alex Christensen  <achristensen@webkit.org>
356
357         [cssjit] Disable compiling scrollbar pseudoclass selectors
358         https://bugs.webkit.org/show_bug.cgi?id=146220
359
360         Reviewed by Benjamin Poulain.
361
362         * cssjit/SelectorCompiler.cpp:
363         (WebCore::SelectorCompiler::addScrollbarPseudoClassType):
364         Don't compile selectors with scrollbar pseudoclasses.
365
366 2015-06-22  Simon Fraser  <simon.fraser@apple.com>
367
368         -webkit-clip-path clips incorrectly if the element bounds go beyond the top edge of the page
369         https://bugs.webkit.org/show_bug.cgi?id=146218
370         rdar://problem/21127840
371
372         Reviewed by Zalan Bujtas.
373
374         The clip path is computed using the RenderLayer's bounding box, so needs to be offset
375         by the offsetFromRenderer when set on the mask layer.
376
377         Test: compositing/masks/compositing-clip-path-origin.html
378
379         * rendering/RenderLayerBacking.cpp:
380         (WebCore::RenderLayerBacking::updateMaskingLayerGeometry):
381
382 2015-06-22  Michael Catanzaro  <mcatanzaro@igalia.com>
383
384         Web sockets should be treated as active mixed content
385         https://bugs.webkit.org/show_bug.cgi?id=140624
386
387         Reviewed by Sam Weinig.
388
389         Tests: http/tests/security/mixedContent/websocket/insecure-websocket-in-iframe.html
390                http/tests/security/mixedContent/websocket/insecure-websocket-in-main-frame.html
391
392         * Modules/websockets/WebSocket.cpp:
393         (WebCore::WebSocket::connect): Block ws:// WebSocket connections from https:// pages, and
394         emit the onerror event after doing so.
395         * platform/SchemeRegistry.cpp:
396         (WebCore::secureSchemes): Add wss:// to the list of secure schemes.
397
398 2015-06-22  Dean Jackson  <dino@apple.com>
399
400         Element with blur backdrop-filter shows edge duplication and dark edges
401         https://bugs.webkit.org/show_bug.cgi?id=146215
402         <rdar://problem/20367695>
403
404         Reviewed by Tim Horton.
405
406         The input images to backdrop filters should duplicate their edge pixels
407         outwards, rather than using transparent pixels. This is a flag we
408         set on the Gaussian blur, but means we have to remember if the
409         FilterOperations list came from a regular filter or a backdrop filter.
410
411         Test: css3/filters/backdrop/blur-input-bounds.html
412
413         * css/CSSPropertyNames.in: New custom convertor for backdrop-filter.
414         * css/StyleBuilderConverter.h:
415         (WebCore::StyleBuilderConverter::convertBackdropFilterOperations): New convertor
416         that sets the backdrop flag, but is otherwise the same as a normal filter
417         convertor.
418         * page/animation/CSSPropertyAnimation.cpp:
419         (WebCore::blendFilterOperations): Inherit the backdrop flag if either of our
420         inputs has it.
421         * platform/graphics/ca/mac/PlatformCAFiltersMac.mm: Set the inputNormalizeEdges
422         key on the CAFilter if necessary.
423         * platform/graphics/filters/FilterOperations.cpp: Add a new flag indicating if
424         these operations are intended for backdrops.
425         (WebCore::FilterOperations::operator=):
426         (WebCore::FilterOperations::operator==):
427         * platform/graphics/filters/FilterOperations.h:
428         (WebCore::FilterOperations::isUsedForBackdropFilters):
429         (WebCore::FilterOperations::setUsedForBackdropFilters):
430
431 2015-06-22  Tim Horton  <timothy_horton@apple.com>
432
433         [TextIndicator] Text shifts one pixel to the left when I force click to bring up Lookup in Mail messages
434         https://bugs.webkit.org/show_bug.cgi?id=146214
435         <rdar://problem/20782970>
436
437         Reviewed by Dean Jackson.
438
439         * page/mac/TextIndicatorWindow.mm:
440         (-[WebTextIndicatorView initWithFrame:textIndicator:margin:offset:]):
441         (WebCore::TextIndicatorWindow::setTextIndicator):
442         (-[WebTextIndicatorView initWithFrame:textIndicator:margin:]): Deleted.
443         When the WebView is at a nonintegral position, we can end up needing a TextIndicator
444         with a nonintegral position. We need to round the window position, so we need to apply
445         the fractional part to the indicator layers inside, not to the window.
446
447 2015-06-22  Myles C. Maxfield  <mmaxfield@apple.com>
448
449         [iOS] Arabic text styled with Georgia is rendered as boxes
450         https://bugs.webkit.org/show_bug.cgi?id=145681
451         <rdar://problem/21169844>
452
453         Reviewed by Darin Adler.
454
455         Georgia doesn't support Arabic, so we ask CoreText what font does support Arabic. It returns
456         TimesNewRomanPSMT. However, WebKit explicitly disallows this font on iOS. Therefore, instead
457         of using TimesNewRomanPSMT, we will simply just use GeezaPro.
458
459         Test: fast/text/arabic-times-new-roman.html
460
461         * platform/graphics/ios/FontCacheIOS.mm:
462         (WebCore::FontCache::systemFallbackForCharacters):
463         * platform/graphics/Font.h: Let FontCacheIOS call fontFamilyShouldNotBeUsedForArabic()
464         * platform/graphics/cocoa/FontCocoa.mm:
465         (WebCore::fontFamilyShouldNotBeUsedForArabic):
466
467 2015-06-22  Alex Christensen  <achristensen@webkit.org>
468
469         Unreviewed non-mac debug build fix after r185840.
470
471         * loader/ResourceLoader.cpp:
472         (WebCore::ResourceLoader::willSendRequest):
473         Added enable flag around assertion.
474
475 2015-06-20  Alex Christensen  <achristensen@webkit.org>
476
477         [Content Extensions] Add SPI to reload without content blocking.
478         https://bugs.webkit.org/show_bug.cgi?id=146128
479         rdar://problem/20351903
480
481         Reviewed by Sam Weinig.
482
483         * html/HTMLMediaElement.cpp:
484         (WebCore::HTMLMediaElement::loadResource):
485         * loader/ResourceLoader.cpp:
486         (WebCore::ResourceLoader::willSendRequest):
487         * loader/cache/CachedResourceLoader.cpp:
488         (WebCore::CachedResourceLoader::requestResource):
489         * page/DOMWindow.cpp:
490         (WebCore::DOMWindow::open):
491         * page/Page.h:
492         (WebCore::Page::userContentController):
493         (WebCore::Page::userContentExtensionsEnabled):
494         (WebCore::Page::setUserContentExtensionsEnabled):
495         (WebCore::Page::group):
496         * page/UserContentController.cpp:
497         (WebCore::UserContentController::removeAllUserContentExtensions):
498         (WebCore::UserContentController::processContentExtensionRulesForLoad):
499         (WebCore::UserContentController::actionsForResourceLoad):
500         * page/UserContentController.h:
501
502 2015-06-22  Zalan Bujtas  <zalan@apple.com>
503
504         REGRESSION(r169105) Dangling renderer pointer in SelectionSubtreeRoot::SelectionSubtreeData.
505         https://bugs.webkit.org/show_bug.cgi?id=146116
506         rdar://problem/20959369
507
508         Reviewed by Brent Fulgham.
509
510         This patch ensures that we don't adjust the selection unless the visual selection still matches this subtree root.
511
512         When multiple selection roots are present we need to ensure that a RenderObject
513         only shows up in one of them.
514         RenderView::splitSelectionBetweenSubtrees(), as the name implies, splits the
515         selection and sets the selection range (start/end) on each selection root.
516         However, SelectionSubtreeRoot::adjustForVisibleSelection() later recomputes the range
517         based on visible selection and that could end up collecting renderers as selection start/end
518         from another selection subtree.
519         RenderObject's holds the last selection state (RenderObject::setSelectionState).
520         If we set a renderer first as "on selection border" and later "inside" using multiple selection roots,
521         we can't clean up selections properly when this object gets destroyed.
522         One of the roots ends up with a dangling RenderObject pointer.
523
524         Test: fast/regions/crash-when-renderer-is-in-multiple-selection-subtrees.html
525
526         * rendering/SelectionSubtreeRoot.cpp:
527         (WebCore::SelectionSubtreeRoot::adjustForVisibleSelection):
528
529 2015-06-22  Jeremy Jones  <jeremyj@apple.com>
530
531         Do not exit fullscreen when starting PiP since this is done automatically.
532         https://bugs.webkit.org/show_bug.cgi?id=144871
533
534         Reviewed by Darin Adler.
535
536         Since we don't explicitly exit fullscreen, update state in shouldExitFullscreenWithReason()
537
538         * platform/ios/WebVideoFullscreenInterfaceAVKit.h: Declare shouldExitFullscreenWithReason().
539         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
540         (-[WebAVPlayerController playerViewController:shouldExitFullScreenWithReason:]): Forward to WebVideoFullscreenInterfaceAVKit.
541         (WebVideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason): Added.
542         (WebVideoFullscreenInterfaceAVKit::willStartPictureInPicture): Remove enter fullscreen code.
543         * platform/spi/cocoa/AVKitSPI.h: Add missing enums.
544
545 2015-06-22  Daniel Bates  <dabates@apple.com>
546
547         AX: UI Automation cannot find AutoFill or search cancel buttons
548         https://bugs.webkit.org/show_bug.cgi?id=145241
549         <rdar://problem/21051411>
550
551         Reviewed by Chris Fleizach.
552
553         Add support for hit testing the search cancel button and AutoFill button so that
554         they can be accessed by UI Automation.
555
556         Currently the accessibility hit test machinery ignores nodes in a shadow tree.
557         So, it neither finds the <input type="search"> cancel button nor the AutoFill button
558         when it performs a hit test. Therefore these buttons cannot be accessed using
559         UI Automation.
560
561         Tests: accessibility/hit-test-input-auto-fill-button.html
562                accessibility/hit-test-input-search-cancel-button.html
563                accessibility/input-search-cancel-button.html
564
565         * accessibility/AccessibilityRenderObject.cpp:
566         (WebCore::AccessibilityRenderObject::accessibilityTextFieldDecorationHitTest): Added; returns
567         the AccessibilityObject for the search cancel button or AutoFill text field decoration as applicable.
568         (WebCore::AccessibilityRenderObject::accessibilityHitTest): Check whether the hit node
569         is a text field decoration.
570
571 2015-06-22  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet  <youenn.fablet@crf.canon.fr>
572
573         [Streams API] Implement ReadableStream cancel (abstract part)
574         https://bugs.webkit.org/show_bug.cgi?id=146111
575
576         Reviewed by Darin Adler.
577
578         This patch implements ReadableStream and ReadableStreamReader cancel.
579         The reader delegates cancellation to its stream.
580
581         This patch also ensures that controller.close() will not throw in case cancellation is on-going.
582
583         A follow-up patch will implement the calling of 'cancel' JS callback for JS sources.
584
585         Covered by rebased tests.
586
587         * Modules/streams/ReadableStream.cpp:
588         (WebCore::ReadableStream::cancel): Checks whether locked or not before cancelling.
589         (WebCore::ReadableStream::cancelNoCheck): Cancel without lock check.
590         (WebCore::ReadableStream::notifyCancelSucceeded): Async cancel callback.
591         (WebCore::ReadableStream::notifyCancelFailed): Ditto.
592         * Modules/streams/ReadableStream.h:
593         * Modules/streams/ReadableStream.idl: Cleaned up IDL.
594         * Modules/streams/ReadableStreamReader.cpp:
595         (WebCore::ReadableStreamReader::cancel):
596         * Modules/streams/ReadableStreamReader.h:
597         * Modules/streams/ReadableStreamReader.idl: Cleaned up IDL
598         * bindings/js/JSReadableStreamControllerCustom.cpp:
599         (WebCore::JSReadableStreamController::close):
600         * bindings/js/JSReadableStreamCustom.cpp:
601         (WebCore::JSReadableStream::cancel):
602         * bindings/js/JSReadableStreamReaderCustom.cpp:
603         (WebCore::JSReadableStreamReader::cancel):
604         * bindings/js/ReadableJSStream.cpp:
605         (WebCore::ReadableJSStream::doCancel):
606         * bindings/js/ReadableJSStream.h:
607
608 2015-06-22  Adam Bergkvist  <adam.bergkvist@ericsson.com>
609
610         WebRTC: Navigator.webkitGetUserMedia() requires three arguments
611         https://bugs.webkit.org/show_bug.cgi?id=146022
612
613         Reviewed by Eric Carlson.
614
615         Updated custom binding to make the third error callback argument
616         mandatory. Updated and unskipped three tests (for the GTK+ port).
617
618         * bindings/js/JSNavigatorCustom.cpp:
619         (WebCore::JSNavigator::webkitGetUserMedia):
620
621 2015-06-22  Carlos Garcia Campos  <cgarcia@igalia.com>
622
623         Unreviewed. Fix GTK+ build after r185818.
624
625         Actually rollout r185320.
626
627         * platform/network/soup/DNSSoup.cpp:
628         (WebCore::DNSResolveQueue::platformProxyIsEnabledInSystemPreferences):
629         (WebCore::DNSResolveQueue::platformResolve):
630         (WebCore::gotProxySettingsCallback): Deleted.
631         (WebCore::DNSResolveQueue::platformMaybeResolveHost): Deleted.
632
633 2015-06-16  Gavin Barraclough  <barraclough@apple.com>
634
635         Page load performance regression due to bugs.webkit.org/show_bug.cgi?id=145542
636         https://bugs.webkit.org/show_bug.cgi?id=146198
637
638         Unreviewed rollout.
639
640         * platform/network/DNSResolveQueue.cpp:
641         (WebCore::DNSResolveQueue::DNSResolveQueue):
642         (WebCore::DNSResolveQueue::isUsingProxy):
643         (WebCore::DNSResolveQueue::add):
644         (WebCore::DNSResolveQueue::timerFired):
645         * platform/network/DNSResolveQueue.h:
646         * platform/network/cf/DNSCFNet.cpp:
647         (WebCore::DNSResolveQueue::platformProxyIsEnabledInSystemPreferences):
648         (WebCore::clientCallback):
649         (WebCore::DNSResolveQueue::platformResolve):
650         (WebCore::proxyIsEnabledInSystemPreferences): Deleted.
651         (WebCore::isUsingProxy): Deleted.
652         (WebCore::DNSResolveQueue::platformMaybeResolveHost): Deleted.
653         * platform/network/soup/DNSSoup.cpp:
654
655 2015-06-21  Alexey Proskuryakov  <ap@apple.com>
656
657         REGRESSION (r172975): navigator.language unable to tell region for Traditional Chinese users
658         https://bugs.webkit.org/show_bug.cgi?id=146121
659         rdar://problem/21395180
660
661         Reviewed by Darin Adler.
662
663         Revert to previous behavior, which is wrong in many ways, but not as wrong as the new one.
664
665         * platform/mac/Language.mm:
666         (WebCore::httpStyleLanguageCode):
667         (WebCore::platformUserPreferredLanguages):
668         * platform/spi/cf/CFBundleSPI.h:
669
670 2015-06-19  Andy Estes  <aestes@apple.com>
671
672         Give Node::didNotifySubtreeInsertions() a better name
673         https://bugs.webkit.org/show_bug.cgi?id=146170
674
675         Reviewed by Darin Adler.
676
677         didNotifySubtreeInsertions() is not a good name. It sounds like we are notifying the subtree insertions, which doesn't make sense.
678
679         This function is really about notifying the Node that the subtree it's a part of has finished being inserted into the DOM
680         (i.e. all nodes have received their call to insertedInto()). Change the name to finishedInsertingSubtree() to better reflect this.
681
682         * dom/ContainerNode.cpp:
683         (WebCore::ContainerNode::notifyChildInserted):
684         * dom/ContainerNodeAlgorithms.h:
685         (WebCore::ChildNodeInsertionNotifier::notifyNodeInsertedIntoDocument):
686         (WebCore::ChildNodeInsertionNotifier::notifyNodeInsertedIntoTree):
687         * dom/Element.cpp:
688         (WebCore::Element::addShadowRoot):
689         * dom/Node.h:
690         (WebCore::Node::finishedInsertingSubtree): Renamed from didNotifySubtreeInsertions.
691         (WebCore::Node::didNotifySubtreeInsertions): Renamed to finishedInsertingSubtree.
692         * dom/ScriptElement.cpp:
693         (WebCore::ScriptElement::finishedInsertingSubtree): Renamed from didNotifySubtreeInsertions.
694         (WebCore::ScriptElement::didNotifySubtreeInsertions): Renamed to finishedInsertingSubtree.
695         * dom/ScriptElement.h:
696         * html/HTMLFrameElementBase.cpp:
697         (WebCore::HTMLFrameElementBase::insertedInto):
698         (WebCore::HTMLFrameElementBase::finishedInsertingSubtree): Renamed from didNotifySubtreeInsertions.
699         (WebCore::HTMLFrameElementBase::didNotifySubtreeInsertions): Renamed to finishedInsertingSubtree.
700         * html/HTMLFrameElementBase.h:
701         * html/HTMLScriptElement.cpp:
702         (WebCore::HTMLScriptElement::insertedInto):
703         (WebCore::HTMLScriptElement::finishedInsertingSubtree): Renamed from didNotifySubtreeInsertions.
704         (WebCore::HTMLScriptElement::didNotifySubtreeInsertions): Renamed to finishedInsertingSubtree.
705         * html/HTMLScriptElement.h:
706         * svg/SVGFEImageElement.cpp:
707         (WebCore::SVGFEImageElement::insertedInto):
708         (WebCore::SVGFEImageElement::finishedInsertingSubtree): Renamed from didNotifySubtreeInsertions.
709         (WebCore::SVGFEImageElement::didNotifySubtreeInsertions): Renamed to finishedInsertingSubtree.
710         * svg/SVGFEImageElement.h:
711         * svg/SVGMPathElement.cpp:
712         (WebCore::SVGMPathElement::insertedInto):
713         (WebCore::SVGMPathElement::finishedInsertingSubtree): Renamed from didNotifySubtreeInsertions.
714         (WebCore::SVGMPathElement::didNotifySubtreeInsertions): Renamed to finishedInsertingSubtree.
715         * svg/SVGMPathElement.h:
716         * svg/SVGScriptElement.cpp:
717         (WebCore::SVGScriptElement::insertedInto):
718         (WebCore::SVGScriptElement::finishedInsertingSubtree): Renamed from didNotifySubtreeInsertions.
719         (WebCore::SVGScriptElement::didNotifySubtreeInsertions): Renamed to finishedInsertingSubtree.
720         * svg/SVGScriptElement.h:
721         * svg/SVGTRefElement.cpp:
722         (WebCore::SVGTRefElement::insertedInto):
723         (WebCore::SVGTRefElement::finishedInsertingSubtree): Renamed from didNotifySubtreeInsertions.
724         (WebCore::SVGTRefElement::didNotifySubtreeInsertions): Renamed to finishedInsertingSubtree.
725         * svg/SVGTRefElement.h:
726         * svg/SVGTextPathElement.cpp:
727         (WebCore::SVGTextPathElement::insertedInto):
728         (WebCore::SVGTextPathElement::finishedInsertingSubtree): Renamed from didNotifySubtreeInsertions.
729         (WebCore::SVGTextPathElement::didNotifySubtreeInsertions): Renamed to finishedInsertingSubtree.
730         * svg/SVGTextPathElement.h:
731         * svg/animation/SVGSMILElement.cpp:
732         (WebCore::SVGSMILElement::insertedInto):
733         (WebCore::SVGSMILElement::finishedInsertingSubtree): Renamed from didNotifySubtreeInsertions.
734         (WebCore::SVGSMILElement::didNotifySubtreeInsertions): Renamed to finishedInsertingSubtree.
735         * svg/animation/SVGSMILElement.h:
736
737 2015-06-21  Philip Chimento  <philip.chimento@gmail.com>
738
739         libwebkit2gtk fails to link without opengl
740         https://bugs.webkit.org/show_bug.cgi?id=138332
741
742         Reviewed by Carlos Garcia Campos.
743
744         * CMakeLists.txt: The third-party ANGLE directories need to be
745         included even if ENABLE(GRAPHICS_CONTEXT_3D) is false. They must
746         be included after the OpenGL headers as the comment says.
747         * platform/graphics/texmap/BitmapTexturePool.cpp: Remove
748         reference to no longer existent header file.
749
750 2015-06-20  Tim Horton  <timothy_horton@apple.com>
751
752         Deselection of text causes a noticeable jump on force touch machines
753         https://bugs.webkit.org/show_bug.cgi?id=146173
754         <rdar://problem/20992842>
755
756         Reviewed by Sam Weinig.
757
758         When we have a TextIndicator of type Crossfade, we end up putting
759         a layer with the blue highlight + text painted into it on top of the
760         content, and cross-fading that layer to the yellow-highlighted text.
761
762         This is necessary for BounceAndCrossfade TextIndicators, because the
763         blue highlight has to bounce, but is not necessary for Crossfade-only
764         ones; we can just fade in the yellow highlight on top of the
765         existing blue page highlight, and all is well.
766
767         So, get rid of the Crossfade TextIndicator type and use FadeIn, separately
768         keeping track of whether or not we can add a margin (we still can't
769         add a margin to TextIndicators that indicate the page's current selection,
770         because the blue highlight cannot have the margin applied to it, and we
771         want the bounds to match exactly).
772
773         * page/TextIndicator.cpp:
774         (WebCore::TextIndicator::createWithRange):
775         If the range is the same as the selection, turn off the margin.
776         We were previously doing this based on the presentation transition, but now
777         there's no difference in presentation transition in this case.
778
779         (WebCore::TextIndicator::createWithSelectionInFrame):
780         (WebCore::TextIndicator::wantsBounce):
781         (WebCore::TextIndicator::wantsContentCrossfade):
782         (WebCore::TextIndicator::wantsFadeIn):
783         (WebCore::TextIndicator::wantsManualAnimation):
784         * page/TextIndicator.h:
785         Get rid of TextIndicatorPresentationTransition::Crossfade.
786
787         (WebCore::TextIndicator::setWantsMargin):
788         (WebCore::TextIndicator::wantsMargin):
789         Keep track of whether we want a margin.
790
791         * page/mac/TextIndicatorWindow.mm:
792         (-[WebTextIndicatorView initWithFrame:textIndicator:margin:]):
793         Determine if we should use a margin based on wantsMargin instead of the
794         presentation transition.
795
796 2015-06-20  Ryuan Choi  <ryuan.choi@navercorp.com>
797
798         [EFL] Do not consider test directories when DEVELOPER_MODE is OFF
799         https://bugs.webkit.org/show_bug.cgi?id=146171
800
801         Reviewed by Gyuyoung Kim.
802
803         * platform/efl/EflInspectorUtilities.cpp:
804         (WebCore::inspectorResourcePath): Only used WEB_INSPECTOR_DIR which CMake decides properly.
805
806 2015-06-19  Michael Catanzaro  <mcatanzaro@igalia.com>
807
808         Fix absolute value warning in LocalizedStringsGtk.cpp
809         https://bugs.webkit.org/show_bug.cgi?id=145919
810
811         Reviewed by Martin Robinson.
812
813         Use abs(static_cast<int>(time)) rather than static_cast<int>(abs(time)) to avoid clang's
814         warnings about passing a float to abs() instead of std::abs(). Also, because casting an int
815         to an int is silly.
816
817         * platform/gtk/LocalizedStringsGtk.cpp:
818         (WebCore::localizedMediaTimeDescription):
819
820 2015-06-19  Devin Rousso  <drousso@apple.com>
821
822         Web Inspector: Highlight currently edited CSS selector
823         https://bugs.webkit.org/show_bug.cgi?id=145658
824
825         Reviewed by Joseph Pecoraro.
826
827         Test: inspector/dom/highlight-multiple-shapes.html
828
829         * inspector/InspectorController.cpp:
830         (WebCore::InspectorController::buildObjectForHighlightedNode):
831         * inspector/InspectorController.h:
832         * inspector/InspectorDOMAgent.cpp:
833         (WebCore::InspectorDOMAgent::highlightSelector): Gets a list of all nodes matching a given selector string and highlights each of them.
834         * inspector/InspectorDOMAgent.h:
835         * inspector/InspectorOverlay.cpp:
836         (WebCore::InspectorOverlay::hideHighlight):
837         (WebCore::InspectorOverlay::highlightNodeList): Loops through a given NodeList to create highlightObjects for each of them.
838         (WebCore::InspectorOverlay::shouldShowOverlay):
839         (WebCore::buildObjectForElementData): Don't show flow fragments when highlighting multiple nodes.
840         (WebCore::InspectorOverlay::buildHighlightObjectForNode):
841         (WebCore::InspectorOverlay::buildObjectForHighlightedNode): Now returns an array containing the highlightObject for each highligthed node.
842         (WebCore::InspectorOverlay::drawNodeHighlight): Now sends an array to the InspectorOverlayPage.js to provide support for highlighting multiple nodes.
843         * inspector/InspectorOverlay.h:
844         * inspector/InspectorOverlayPage.js: Now expects an array as its parameter and loops through it to highlight each node given.
845         If the parameter array contains more than one element, do not draw the textbox containing info on that node.
846         (drawNodeHighlight):
847
848 2015-06-19  Joseph Pecoraro  <pecoraro@apple.com>
849
850         Crash under WebCore::PageConsoleClient::addMessage attempting to log insecure content message in ImageDocument
851         https://bugs.webkit.org/show_bug.cgi?id=146096
852
853         Reviewed by Timothy Hatcher.
854
855         Was able to reproduce this using a user stylesheet with an http css font
856         on a pdf (ImageDocument) main document loaded over https. Was unable to
857         create a reliable test for this scenario.
858
859         * page/PageConsoleClient.cpp:
860         (WebCore::getParserLocationForConsoleMessage):
861         The scriptableDocumentParser could be null, such as in an ImageDocument.
862
863 2015-06-19  Dean Jackson  <dino@apple.com>
864
865         Extremely large canvas crashes on pre-El Capitan machines
866         https://bugs.webkit.org/show_bug.cgi?id=146169
867         <rdar://problem/21410046>
868
869         Reviewed by Tim Horton.
870
871         On machines before El Capitan, make the maximum canvas size
872         8k by 8k.
873
874         Covered by existing tests.
875
876         * html/HTMLCanvasElement.cpp:
877
878 2015-06-19  Tim Horton  <timothy_horton@apple.com>
879
880         Selection services cannot be invoked when force click is enabled
881         https://bugs.webkit.org/show_bug.cgi?id=146166
882         <rdar://problem/21468362>
883
884         Reviewed by Darin Adler.
885
886         * page/mac/ServicesOverlayController.h:
887         Turn Highlight::Type into something we can use for dirty flags.
888
889         * page/mac/ServicesOverlayController.mm:
890         (WebCore::ServicesOverlayController::Highlight::createForSelection):
891         (WebCore::ServicesOverlayController::Highlight::createForTelephoneNumber):
892         (WebCore::ServicesOverlayController::ServicesOverlayController):
893         (WebCore::ServicesOverlayController::selectionRectsDidChange):
894         (WebCore::ServicesOverlayController::selectedTelephoneNumberRangesChanged):
895         (WebCore::ServicesOverlayController::invalidateHighlightsOfType):
896         (WebCore::ServicesOverlayController::buildPotentialHighlightsIfNeeded):
897         (WebCore::ServicesOverlayController::remainingTimeUntilHighlightShouldBeShown):
898         (WebCore::ServicesOverlayController::buildPhoneNumberHighlights):
899         (WebCore::ServicesOverlayController::buildSelectionHighlight):
900         (WebCore::ServicesOverlayController::findTelephoneNumberHighlightContainingSelectionHighlight):
901         (WebCore::ServicesOverlayController::determineActiveHighlight):
902         (WebCore::ServicesOverlayController::didScrollFrame):
903         (WebCore::ServicesOverlayController::handleClick):
904         Coalesce highlight rebuilding so that things (like TextIndicator creation)
905         that change the selection and then reset it immediately don't cause us
906         to lose the active highlight.
907
908         This also means that if the selection changes multiple times in a runloop
909         (easily possible from script), we won't waste a lot of time rebuilding highlights.
910
911         (WebCore::ServicesOverlayController::didRebuildPotentialHighlights):
912         Merged into buildPotentialHighlightsIfNeeded.
913
914 2015-06-19  Matt Baker  <mattbaker@apple.com>
915
916         Web Inspector: TimelineAgent needs to handle nested runloops
917         https://bugs.webkit.org/show_bug.cgi?id=145090
918
919         Reviewed by Joseph Pecoraro.
920
921         Previously nested run loops caused InspectorTimelineAgent to prematurely pop the current run loop record. This
922         patch adds a counter to track the run loop nesting level, and rendering frame records are only pushed/popped
923         when the nesting level is zero. Run loop entry/exit notifications received while the debugger is paused do not
924         affect the nesting level.
925
926         * inspector/InspectorTimelineAgent.cpp:
927         (WebCore::InspectorTimelineAgent::internalStart):
928         (WebCore::InspectorTimelineAgent::internalStop):
929         (WebCore::InspectorTimelineAgent::InspectorTimelineAgent):
930         * inspector/InspectorTimelineAgent.h:
931
932 2015-06-19  Brent Fulgham  <bfulgham@apple.com>
933
934         Follow-up fix to r185766.
935         https://bugs.webkit.org/show_bug.cgi?id=22132
936
937         Reviewed by Zalan Bujtas.
938
939         Suggested by Darin Adler in the bug.
940
941         * platform/graphics/filters/FETile.cpp:
942         (WebCore::FETile::platformApplySoftware): Use WTF::move when passing
943         the new tileImageCopy RefPtr.
944
945 2015-06-19  Michael Catanzaro  <mcatanzaro@igalia.com>
946
947         [SOUP] Fix return-type-c-linkage warning after r185553
948         https://bugs.webkit.org/show_bug.cgi?id=146014
949
950         Reviewed by Martin Robinson.
951
952         * platform/network/soup/WebKitSoupRequestGeneric.cpp:
953         (webkitSoupRequestGenericGetRequest): Return a pointer rather than a reference.
954         * platform/network/soup/WebKitSoupRequestGeneric.h: webkitSoupRequestGenericGetRequest now
955         returns a pointer rather than a reference.
956
957 2015-06-19  Dean Jackson  <dino@apple.com>
958
959         Played <audio> looks invisible against the gray background
960         https://bugs.webkit.org/show_bug.cgi?id=146164
961         <rdar://problem/21014284>
962
963         Reviewed by Brent Fulgham.
964
965         The plus-darker blend mode was not allowing any white to
966         show through in the rendering. We don't need this for
967         audio controls, where we draw on an opaque grey background.
968
969         * Modules/mediacontrols/mediaControlsiOS.css:
970         (audio::-webkit-media-controls-panel): Darken the color of the controls a
971         little to make white stand out more.
972         (audio::-webkit-media-controls-timeline): Remove the plus-darker blending.
973         (video::-webkit-media-controls-timeline): Apply blending only to video.
974
975 2015-06-19  Andy Estes  <aestes@apple.com>
976
977         Various assertion failures occur when executing script in the midst of DOM insertion
978         https://bugs.webkit.org/show_bug.cgi?id=132482
979
980         Reviewed by Darin Adler.
981
982         Prior to this change, when an element containing a <script> child was inserted into a document, the script was
983         executed in ScriptElement::insertedInto(). That script can access nodes that follow it in the newly-inserted
984         hierarchy but are not yet fully inserted, leading to at least the following problems:
985
986             - The script could remove a node that is not yet marked as in the document.
987             - The script could remove a named <map> that has yet to be added to TreeScope::m_imageMapsByName.
988             - The script could remove a form control that has yet to be added to FormController::m_formElementsWithState.
989
990         These scenarios all result in assertion failures. This change ensures that each node in the newly-inserted
991         hierarchy is fully inserted before executing any scripts.
992
993         Tests: fast/dom/element-removed-while-inserting-parent-crash.html
994                fast/dom/named-map-removed-while-inserting-parent-crash.html
995                fast/forms/form-control-removed-while-inserting-parent-crash.html
996                svg/dom/element-removed-while-inserting-parent-crash.html
997
998         * dom/ScriptElement.cpp:
999         (WebCore::ScriptElement::shouldNotifySubtreeInsertions): Renamed from insertedInto().
1000         Returned true in the case where insertedInto() would've called prepareScript().
1001         (WebCore::ScriptElement::didNotifySubtreeInsertions): Called prepareScript().
1002         (WebCore::ScriptElement::insertedInto): Renamed to shouldNotifySubtreeInsertions().
1003         * dom/ScriptElement.h:
1004         * html/HTMLScriptElement.cpp:
1005         (WebCore::HTMLScriptElement::insertedInto): If shouldNotifySubtreeInsertions() is true, returned InsertionShouldCallDidNotifySubtreeInsertions.
1006         Otherwise, returned InsertionDone.
1007         (WebCore::HTMLScriptElement::didNotifySubtreeInsertions): Called ScriptElement::didNotifySubtreeInsertions().
1008         * html/HTMLScriptElement.h:
1009         * svg/SVGScriptElement.cpp:
1010         (WebCore::SVGScriptElement::insertedInto): Did the same as HTMLScriptElement::insertedInto().
1011         (WebCore::SVGScriptElement::didNotifySubtreeInsertions): Called ScriptElement::didNotifySubtreeInsertions().
1012         * svg/SVGScriptElement.h:
1013
1014 2015-06-19  Brent Fulgham  <bfulgham@apple.com>
1015
1016         All calls of ImageBuffer::create should null check the return value
1017         https://bugs.webkit.org/show_bug.cgi?id=22132
1018
1019         Reviewed by Zalan Bujtas.
1020
1021         ImageBuffer::create returns nullptr for a number of reasons, and should be
1022         expected to do so. We missed this check in a few places, resulting in
1023         crashes on some systems. Likewise, ImageBuffer::copyImage may return nullptr
1024         in normal use and should be checked.
1025
1026         * platform/graphics/BitmapImage.cpp:
1027         (WebCore::BitmapImage::drawPattern): Add nullptr check for create and copyImage. Remove
1028         extra call to 'setImageObserver'.
1029         * platform/graphics/cairo/ImageBufferCairo.cpp:
1030         (WebCore::ImageBuffer::drawPattern): Add nullptr check for copyImage.
1031         * platform/graphics/cg/ImageBufferCG.cpp:
1032         (WebCore::ImageBuffer::drawPattern): Add nullptr checks for copyImage.
1033         * platform/graphics/filters/FETile.cpp:
1034         (WebCore::FETile::platformApplySoftware): Add nullptr check for copyImage.
1035         * platform/graphics/filters/FilterEffect.cpp:
1036         (WebCore::FilterEffect::asImageBuffer): Add nullptr check for create.
1037         (WebCore::FilterEffect::openCLImageToImageBuffer): Ditto.
1038         * platform/graphics/texmap/BitmapTexture.cpp:
1039         (WebCore::BitmapTexture::updateContents): Add nullptr checks for create and copyImage.
1040         * svg/graphics/SVGImage.cpp:
1041         (WebCore::SVGImage::drawPatternForContainer): Add nullptr check for copyImage.
1042
1043 2015-06-19  Jeremy Jones  <jeremyj@apple.com>
1044
1045         Get CAContext directly for CALayer instead of walking the layer tree.
1046         https://bugs.webkit.org/show_bug.cgi?id=146138
1047         <rdar://problem/21455974>
1048
1049         Reviewed by Darin Adler.
1050
1051         This will get the context directly from the CALayer instead of getting all CAContexts, walking the layer tree 
1052         to the root and comparing that against each CAContext's root layer.
1053
1054         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1055         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenLayer):
1056
1057 2015-06-18  Brent Fulgham  <bfulgham@apple.com>
1058
1059         [iOS] scrollIntoViewIfNeeded is not working with scroll-snap points
1060         https://bugs.webkit.org/show_bug.cgi?id=145318
1061         <rdar://problem/21081501>
1062
1063         Reviewed by Simon Fraser.
1064
1065         Use the ScrollController in iOS to track the scroll snap point state.
1066         We do not need the animation implementation or timers since the actual
1067         animation is handled by UIKit.
1068
1069         This change lets us communicate the current offset into the scroll snap
1070         offset vector between the WebProcess and RemoteScrollingTree so that
1071         both sides stay in sync regardless of whether user gestures or style
1072         updates have caused us to shift to a different snap point.
1073
1074         * page/scrolling/AsyncScrollingCoordinator.cpp:
1075         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated): Set the
1076         current horizontal and vertical scroll snap offset indices.
1077         (WebCore::AsyncScrollingCoordinator::updateOverflowScrollingNode): Ditto.
1078         * page/scrolling/AsyncScrollingCoordinator.h: Mark the setActiveScrollSnapIndices
1079         for export so that it can be reached by the UIProcess.
1080         * page/scrolling/ScrollingCoordinator.h: Keep track of horizontal and
1081         vertical scroll snap offset indices.
1082         * page/scrolling/ScrollingStateScrollingNode.cpp:
1083         (WebCore::ScrollingStateScrollingNode::setCurrentHorizontalSnapPointIndex): Added.
1084         (WebCore::ScrollingStateScrollingNode::setCurrentVerticalSnapPointIndex): Added.
1085         * page/scrolling/ScrollingStateScrollingNode.h:
1086         (WebCore::ScrollingStateScrollingNode::currentHorizontalSnapPointIndex): Added.
1087         (WebCore::ScrollingStateScrollingNode::currentVerticalSnapPointIndex): Added.
1088         * page/scrolling/ScrollingTree.h:
1089         * page/scrolling/ScrollingTreeScrollingNode.cpp:
1090         (WebCore::ScrollingTreeScrollingNode::updateBeforeChildren): Update the scroll snap
1091         point offset indices if either has changed.
1092         * page/scrolling/ScrollingTreeScrollingNode.h:
1093         (WebCore::ScrollingTreeScrollingNode::currentHorizontalSnapPointIndex): Added.
1094         (WebCore::ScrollingTreeScrollingNode::currentVerticalSnapPointIndex): Added.
1095         (WebCore::ScrollingTreeScrollingNode::setCurrentHorizontalSnapPointIndex): Added.
1096         (WebCore::ScrollingTreeScrollingNode::setCurrentVerticalSnapPointIndex): Added.
1097         * page/scrolling/ThreadedScrollingTree.cpp:
1098         (WebCore::ThreadedScrollingTree::currentSnapPointIndicesDidChange): New method
1099         to handle notifications about scroll snap index changes from the UIProcess.
1100         * page/scrolling/ThreadedScrollingTree.h:
1101         * page/scrolling/ios/ScrollingTreeIOS.cpp:
1102         (WebCore::ScrollingTreeIOS::currentSnapPointIndicesDidChange): New method
1103         to handle notifications about scroll snap index changes from the UIProcess.
1104         * page/scrolling/ios/ScrollingTreeIOS.h:
1105         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
1106         (WebCore::ScrollingTreeFrameScrollingNodeMac::updateBeforeChildren): Update scroll
1107         snap point current offset indices if they have changed.
1108         (WebCore::ScrollingTreeFrameScrollingNodeMac::scrollOffsetOnAxis): Remove unneeded
1109         PLATFORM(MAC) macro.
1110         * platform/ScrollAnimator.cpp:
1111         (WebCore::ScrollAnimator::ScrollAnimator): We have a ScrollController if we are
1112         supporting scroll snap points or rubber banding.
1113         (WebCore::ScrollAnimator::processWheelEventForScrollSnap): This method is not needed
1114         for iOS builds.
1115         (WebCore::ScrollAnimator::updateActiveScrollSnapIndexForOffset): Enable this on iOS.
1116         (WebCore::ScrollAnimator::updateScrollSnapState): Renamed from 'updateScrollAnimatorsAndTimers'
1117         and enabled on iOS.
1118         (WebCore::ScrollAnimator::updateScrollAnimatorsAndTimers): Deleted.
1119         * platform/ScrollAnimator.h: Enable some scroll snap methods on iOS.
1120         * platform/ScrollableArea.cpp:
1121         (WebCore::ScrollableArea::handleWheelEvent): Enable scroll snap index bookkeeping on iOS, too.
1122         (WebCore::ScrollableArea::updateScrollSnapState): Revise to call 'updateScrollSnapState' instead
1123         of 'updateScrollAnimatorsAndTimers'.
1124         * platform/cocoa/ScrollController.h: Enable some methods on iOS. Reorder methods to
1125         reduce the number of macros needed to do so.
1126         * platform/cocoa/ScrollController.mm:
1127         (systemUptime): Only build for Mac.
1128         (WebCore::ScrollController::ScrollController): Disable rubber band-specific members on iOS.
1129         (WebCore::ScrollController::handleWheelEvent): Only build this on Mac.
1130         (WebCore::ScrollController::isRubberBandInProgress): Always return 'false' on iOS.
1131         (WebCore::ScrollController::startSnapRubberbandTimer): Only build this on Mac.
1132         (WebCore::ScrollController::shouldRubberBandInHorizontalDirection): Ditto.
1133         (WebCore::ScrollController::scrollSnapPointState): Enable on iOS.
1134         (WebCore::ScrollController::hasActiveScrollSnapTimerForAxis): Only build on Mac.
1135         (WebCore::ScrollController::updateScrollSnapState): renamed from 'updateScrollAnimatorsAndTimers'
1136         (WebCore::ScrollController::startScrollSnapTimer): Only build on Mac.
1137         (WebCore::ScrollController::initializeGlideParameters): Ditto.
1138         (WebCore::ScrollController::activeScrollSnapIndexForAxis): Enable on iOS.
1139         (WebCore::ScrollController::setActiveScrollSnapIndicesForOffset): Ditto.
1140         (WebCore::ScrollController::beginScrollSnapAnimation): Only build on Mac.
1141         (WebCore::ScrollController::computeGlideDelta): Ditto.
1142         (WebCore::ScrollController::updateScrollAnimatorsAndTimers): Deleted.
1143         * rendering/RenderLayerCompositor.cpp:
1144         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer): Capture any changes in scroll
1145         snap offset indices.
1146
1147 2015-06-19  Jeremy Jones  <jeremyj@apple.com>
1148
1149         Fullscreen view should not update bounds of video when in PiP.
1150         https://bugs.webkit.org/show_bug.cgi?id=146134
1151
1152         Reviewed by Darin Adler.
1153
1154         Don't update bounds on video layer when it is not a child.
1155
1156         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
1157         (-[WebAVVideoLayer setBounds:]):
1158
1159 2015-06-19  Zalan Bujtas  <zalan@apple.com>
1160
1161         RenderRubyText requires RenderRubyRun parent.
1162         https://bugs.webkit.org/show_bug.cgi?id=146148
1163         rdar://problem/21423319
1164
1165         Reviewed by Simon Fraser.
1166
1167         RenderRubyText expects its parent to be RenderRubyRun and since a
1168         a non-block <rt> requires anonymous wrapper, we should check whether
1169         the display type is actually block.
1170
1171         Test: fast/ruby/crash-when-ruby-rt-is-non-block.html
1172
1173         * html/RubyTextElement.cpp:
1174         (WebCore::RubyTextElement::createElementRenderer):
1175
1176 2015-06-19  Jeremy Jones  <jeremyj@apple.com>
1177
1178         cancelPreviousPerformRequestsWithTarget for -resolveBounds in wrong class.
1179         https://bugs.webkit.org/show_bug.cgi?id=146140
1180
1181         Reviewed by Eric Carlson.
1182
1183         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
1184         (-[WebCALayerHostWrapper dealloc]): Added.
1185         (-[WebAVVideoLayer dealloc]): Deleted.
1186
1187 2015-06-19  Per Arne Vollan  <peavo@outlook.com>
1188
1189         [WinCairo] Null pointer crash in BitmapTexture::updateContents.
1190         https://bugs.webkit.org/show_bug.cgi?id=146147
1191
1192         Reviewed by Brent Fulgham.
1193
1194         Added null pointer check.
1195
1196         * platform/graphics/texmap/BitmapTexture.cpp:
1197         (WebCore::BitmapTexture::updateContents):
1198
1199 2015-06-19  Anders Carlsson  <andersca@apple.com>
1200
1201         Spintracer treats the web process as hung when it's showing JavaScript dialogs in the UI process
1202         https://bugs.webkit.org/show_bug.cgi?id=146124
1203         rdar://problem/21449395
1204
1205         Reviewed by Geoffrey Garen.
1206
1207         * platform/spi/cg/CoreGraphicsSPI.h:
1208
1209 2015-06-19  Csaba Osztrogonác  <ossy@webkit.org>
1210
1211         Remove unnecessary svn:executable flags
1212         https://bugs.webkit.org/show_bug.cgi?id=146107
1213
1214         Reviewed by Alexey Proskuryakov.
1215
1216         * html/canvas/CanvasRenderingContext2D.cpp: Removed property svn:executable.
1217         * mathml/MathMLMencloseElement.cpp: Removed property svn:executable.
1218         * mathml/MathMLMencloseElement.h: Removed property svn:executable.
1219         * platform/efl/RenderThemeEfl.cpp: Removed property svn:executable.
1220         * rendering/mathml/RenderMathMLMenclose.cpp: Removed property svn:executable.
1221         * rendering/mathml/RenderMathMLMenclose.h: Removed property svn:executable.
1222
1223 2015-06-19  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1224
1225         Bindings generator should generate code to catch exception and reject promises for Promise-based APIs
1226         https://bugs.webkit.org/show_bug.cgi?id=146060
1227
1228         Reviewed by Darin Adler.
1229
1230         The binding generator splits the function that binds JS to the DOM class implementation in two for functions returning promise.
1231         The first function, called from JS, is responsible of casting this to the expected JSXXX class.
1232         If casting fails, an exception is raised. Otherwise, it calls the second function.
1233         After calling the second function, it checks whether an exception is raised, in which case it returns a rejected promise.
1234         The second function is responsible of argument conversion and calling the DOM class function.
1235
1236         Covered by expectations and AudioContext promise still working.
1237         A test case is added for a promise returning function taking a typed argument as input (if argument value cannot be typed, the promise is rejected).
1238         A second test case is a promise-returning function that can raise an exception. In that case the DOMException is used as rejection value.
1239
1240         As can be seen from generated code, this generalized code adds a mandatory check (is there an exception?) at the end of the function.
1241         This check is done even in cases we know there will be no exception.
1242         This may be covered by another patch if this optimization is thought useful enough.
1243
1244         * bindings/js/JSDOMPromise.cpp:
1245         (WebCore::rejectPromiseWithExceptionIfAny): Utility method for the binding code.
1246         (WebCore::callPromiseFunction): Ditto.
1247         * bindings/js/JSDOMPromise.h:
1248         * bindings/scripts/CodeGeneratorJS.pm:
1249         (GenerateImplementation):
1250         (GenerateFunctionCastedThis): Extracted from GenerateImplementationFunctionCall to reuse it in case of promise-returning functions.
1251         (GenerateImplementationFunctionCall):
1252         (GenerateCallbackImplementation): Deleted.
1253         * bindings/scripts/test/JS/JSTestObj.cpp:
1254         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunction):
1255         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionPromise):
1256         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithFloatArgument):
1257         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithFloatArgumentPromise):
1258         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithException):
1259         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithExceptionPromise):
1260         * bindings/scripts/test/TestObj.idl:
1261
1262 2015-06-18  Jeremy Jones  <jeremyj@apple.com>
1263
1264         Disable UIWindow for fullscreen video for selected clients.
1265         https://bugs.webkit.org/show_bug.cgi?id=145852
1266
1267         Reviewed by Simon Fraser.
1268
1269         Disable UIWindow for fullscreen video doesn't work everywhere (rdar://problem/21315993), so just disable it when creating a UIWindow won't work.
1270         Fix some interface hiding and layout problems that showed up in the non UIWindow code path.
1271
1272         * platform/RuntimeApplicationChecksIOS.h:
1273         * platform/RuntimeApplicationChecksIOS.mm: Remove iAD bundle identifier.
1274         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
1275         (WebVideoFullscreenInterfaceAVKit::setupFullscreen): Opt out of UIWindow when hosted in another process. And fix view parenting for non-window case.
1276         (WebVideoFullscreenInterfaceAVKit::exitFullscreen): Fix for AVKit exit fullscreen complaining about -needsLayout.
1277
1278         (WebVideoFullscreenInterfaceAVKit::requestHideAndExitFullscreen):
1279         (WebVideoFullscreenInterfaceAVKit::preparedToReturnToInline):
1280         (WebVideoFullscreenInterfaceAVKit::willStartOptimizedFullscreen):
1281         (WebVideoFullscreenInterfaceAVKit::didStartOptimizedFullscreen):
1282         (WebVideoFullscreenInterfaceAVKit::willStopOptimizedFullscreen):
1283         (WebVideoFullscreenInterfaceAVKit::didStopOptimizedFullscreen):
1284         These hide and show the view controller where we hide and show the window.
1285
1286 2015-06-18  Dean Jackson  <dino@apple.com>
1287
1288         Provide a way for web developers to draw a Theme-specific Wireless Playback icon
1289         https://bugs.webkit.org/show_bug.cgi?id=146123
1290         <rdar://problem/21119287>
1291
1292         Reviewed by Simon Fraser.
1293
1294         Implement a -webkit-named-image() CSS <image> generator that allows a site to
1295         request artwork by name and get the platform variant. At the moment
1296         we only support "wireless-playback" which returns a generic image everywhere
1297         but Cocoa platforms, where we render the AirPlay icon.
1298
1299         In order to do this I added a ThemeCocoa to share any Theme code between
1300         Mac and iOS.
1301
1302         Test: fast/css/named-icons.html
1303
1304         * WebCore.xcodeproj/project.pbxproj: Add new files CSSNamedImageValue, NamedImageGeneratedImage and ThemeCocoa.
1305
1306         * css/CSSImageGeneratorValue.cpp: Handle the new NamedImageClass in the switch statements for downcasting.
1307         (WebCore::CSSImageGeneratorValue::image):
1308         (WebCore::CSSImageGeneratorValue::isFixedSize):
1309         (WebCore::CSSImageGeneratorValue::isPending):
1310         (WebCore::CSSImageGeneratorValue::knownToBeOpaque):
1311
1312         * css/CSSNamedImageValue.cpp: New class. Just holds a name String.
1313         (WebCore::CSSNamedImageValue::customCSSText):
1314         (WebCore::CSSNamedImageValue::image):
1315         (WebCore::CSSNamedImageValue::equals):
1316         * css/CSSNamedImageValue.h:
1317         (WebCore::CSSNamedImageValue::create):
1318         (WebCore::CSSNamedImageValue::isFixedSize):
1319         (WebCore::CSSNamedImageValue::isPending):
1320         (WebCore::CSSNamedImageValue::CSSNamedImageValue):
1321
1322         * css/CSSParser.cpp:
1323         (WebCore::CSSParser::isGeneratedImageValue): Allow "-webkit-named-image(".
1324         (WebCore::CSSParser::parseGeneratedImage): Call parseNamedImage if we hit named-icon.
1325         (WebCore::CSSParser::parseNamedImage): Parse the function looking for a CSS ident.
1326         * css/CSSParser.h:
1327
1328         * css/CSSValue.cpp: Handle NamedImageClass in the various switch statements.
1329         (WebCore::CSSValue::equals):
1330         (WebCore::CSSValue::cssText):
1331         (WebCore::CSSValue::destroy):
1332         * css/CSSValue.h:
1333         (WebCore::CSSValue::isNamedImageValue): Helper to detect the correct CSSValue subclass.
1334
1335         * platform/Theme.cpp:
1336         (WebCore::Theme::drawNamedImage): Draw a generic wireless playback icon.
1337         * platform/Theme.h: Add drawNamedImage.
1338
1339         * platform/cocoa/ThemeCocoa.cpp: New shared base class for ThemeMac and ThemeIOS.
1340         (WebCore::fitContextToBox):
1341         (WebCore::ThemeCocoa::drawNamedImage): Draw an AirPlay icon for wireless playback.
1342         * platform/cocoa/ThemeCocoa.h:
1343
1344         * platform/graphics/CrossfadeGeneratedImage.h: Drive-by removal of unnecessary forward class definition.
1345
1346         * platform/graphics/ImageBuffer.h: Add NamedImageGeneratedImage as a friend class.
1347
1348         * platform/graphics/NamedImageGeneratedImage.cpp: New class. Calls into the Theme to render the artwork.
1349         (WebCore::NamedImageGeneratedImage::NamedImageGeneratedImage):
1350         (WebCore::NamedImageGeneratedImage::draw):
1351         (WebCore::NamedImageGeneratedImage::drawPattern):
1352         * platform/graphics/NamedImageGeneratedImage.h:
1353
1354         * platform/ios/ThemeIOS.h: Inherit from ThemeCocoa.
1355         * platform/mac/ThemeMac.h: Ditto.
1356
1357 2015-06-18  KyungTae Kim  <ktf.kim@samsung.com> and Myles C. Maxfield  <mmaxfield@apple.com>
1358
1359         [CSS3] Add support for the word-break:keep-all CSS property
1360         https://bugs.webkit.org/show_bug.cgi?id=123782
1361
1362         Reviewed by Darin Adler.
1363
1364         Add support for word-break:keep-all CSS property by CSS3 spec:
1365         http://www.w3.org/TR/2013/WD-css-text-3-20131010/#word-break-property
1366
1367         Test: fast/text/word-break-keep-all.html
1368
1369         * css/CSSParser.cpp:
1370         (WebCore::isValidKeywordPropertyAndValue):
1371         * css/CSSPrimitiveValueMappings.h:
1372         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
1373         (WebCore::CSSPrimitiveValue::operator EWordBreak):
1374         * css/CSSValueKeywords.in:
1375         * rendering/RenderText.cpp:
1376         (WebCore::RenderText::computePreferredLogicalWidths):
1377         * rendering/break_lines.h:
1378         (WebCore::nextBreakablePositionKeepingAllWords):
1379         (WebCore::nextBreakablePositionKeepingAllWordsIgnoringNBSP):
1380         (WebCore::isBreakable):
1381         * rendering/line/BreakingContext.h:
1382         (WebCore::BreakingContext::handleText):
1383         (WebCore::BreakingContext::optimalLineBreakLocationForTrailingWord):
1384         * rendering/style/RenderStyleConstants.h:
1385
1386 2015-06-18  Jon Lee  <jonlee@apple.com>
1387
1388         Update AVKit usage of pip
1389         https://bugs.webkit.org/show_bug.cgi?id=146095
1390         <rdar://problem/21386853>
1391
1392         Reviewed by Eric Carlson.
1393
1394         - Rename enum VideoFullscreenModeOptimized to VideoFullscreenModePictureInPicture
1395         - Rename MediaElementSession::allowsAlternateFullscreen to allowsPictureInPicture
1396         - Rename Settings::allowsAlternateFullscreen to allowsPictureInPictureMediaPlayback
1397         - Update AVKit calls and AVKitSPI.h
1398         - Rename WebVideoFullscreenInterfaceAVKit delegate functions and member variables
1399
1400         * html/HTMLMediaElement.cpp:
1401         * html/HTMLVideoElement.cpp:
1402         * html/MediaElementSession.cpp:
1403         (WebCore::MediaElementSession::allowsPictureInPicture): Renamed.
1404         (WebCore::MediaElementSession::allowsAlternateFullscreen): Deleted.
1405         * html/MediaElementSession.h:
1406         * page/Settings.cpp:
1407         * page/Settings.in:
1408         * platform/graphics/MediaPlayerEnums.h:
1409         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1410         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
1411         * platform/ios/WebVideoFullscreenInterfaceAVKit.h: Remove unused setIsOptimized.
1412         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
1413         * platform/spi/cocoa/AVKitSPI.h: Remove unused typedef.
1414         * platform/spi/mac/AVFoundationSPI.h:
1415
1416 2015-06-18  Jeremy Jones  <jeremyj@apple.com>
1417
1418         Fix crash when entering fullscreen during exit fullscreen animation.
1419         https://bugs.webkit.org/show_bug.cgi?id=146117
1420
1421         Reviewed by Simon Fraser.
1422
1423         Because enterFullscreen can be called during exitFullscreen animation, the exit fullscreen teardown
1424         should not imply a fullscreen state change on video element.
1425
1426         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
1427         (WebVideoFullscreenControllerContext::exitFullscreen): May be called from mainThread
1428         (-[WebVideoFullscreenController exitFullscreen]): May be called from mainThread
1429         * platform/ios/WebVideoFullscreenModelVideoElement.mm:
1430         (WebVideoFullscreenModelVideoElement::setVideoElement): 
1431         Changing associated video element does not imply fullscreen mode change.
1432
1433 2015-06-18  Brian J. Burg  <burg@cs.washington.edu>
1434
1435         Web Inspector: improve generated types for objects passed to backend commands
1436         https://bugs.webkit.org/show_bug.cgi?id=146091
1437
1438         Reviewed by Joseph Pecoraro.
1439
1440         Update type signatures for backend command implementations. In a few cases, clean
1441         up relevant helper function signatures and copy data out of parameter objects where
1442         the code previously held onto a reference.
1443
1444         No new tests, no behavior changed.
1445
1446         * inspector/InspectorCSSAgent.cpp:
1447         (WebCore::computePseudoClassMask):
1448         (WebCore::InspectorCSSAgent::setStyleText):
1449         (WebCore::InspectorCSSAgent::setRuleSelector):
1450         (WebCore::InspectorCSSAgent::forcePseudoState):
1451         * inspector/InspectorCSSAgent.h:
1452         * inspector/InspectorDOMAgent.cpp:
1453         (WebCore::parseColor):
1454         (WebCore::parseConfigColor):
1455         (WebCore::parseQuad):
1456         (WebCore::InspectorDOMAgent::performSearch):
1457         (WebCore::InspectorDOMAgent::setSearchingForNode):
1458         (WebCore::InspectorDOMAgent::highlightConfigFromInspectorObject):
1459         (WebCore::InspectorDOMAgent::setInspectModeEnabled):
1460         (WebCore::InspectorDOMAgent::highlightRect):
1461         (WebCore::InspectorDOMAgent::highlightQuad):
1462         (WebCore::InspectorDOMAgent::innerHighlightQuad):
1463         (WebCore::InspectorDOMAgent::highlightNode):
1464         (WebCore::InspectorDOMAgent::highlightFrame):
1465         * inspector/InspectorDOMAgent.h:
1466         * inspector/InspectorDOMStorageAgent.cpp:
1467         (WebCore::InspectorDOMStorageAgent::getDOMStorageItems):
1468         (WebCore::InspectorDOMStorageAgent::setDOMStorageItem):
1469         (WebCore::InspectorDOMStorageAgent::removeDOMStorageItem):
1470         (WebCore::InspectorDOMStorageAgent::findStorageArea):
1471         * inspector/InspectorDOMStorageAgent.h:
1472         * inspector/InspectorIndexedDBAgent.cpp:
1473         (WebCore::InspectorIndexedDBAgent::requestData):
1474         * inspector/InspectorIndexedDBAgent.h:
1475         * inspector/InspectorReplayAgent.cpp:
1476         (WebCore::InspectorReplayAgent::replayToPosition):
1477         * inspector/InspectorReplayAgent.h:
1478         * inspector/InspectorResourceAgent.cpp:
1479         (WebCore::InspectorResourceAgent::willSendRequest):
1480         (WebCore::InspectorResourceAgent::setExtraHTTPHeaders):
1481         Clean up extraHTTPHeaders to copy header key/values out of the InspectorObject, rather
1482         than retaining the protocol object indefinitely. This matches the ownership scheme used
1483         everywhere else.
1484
1485         * inspector/InspectorResourceAgent.h:
1486         * inspector/InspectorStyleSheet.h:
1487         (WebCore::InspectorCSSId::InspectorCSSId):
1488         * inspector/InspectorWorkerAgent.cpp:
1489         (WebCore::InspectorWorkerAgent::sendMessageToWorker):
1490         * inspector/InspectorWorkerAgent.h:
1491
1492 2015-06-18  Anders Carlsson  <andersca@apple.com>
1493
1494         Remove shouldInterruptJavaScript
1495         https://bugs.webkit.org/show_bug.cgi?id=146118
1496
1497         Reviewed by Antti Koivisto.
1498
1499         The WebKit SPI methods for deciding whether JavaScript execution should be interrupted hasn't been used
1500         for many releases. Furthermore, they don't make sense in the multi-process architecture since it's still possible
1501         to interrupt execution (by closing the browser tab or window) from the UI process.
1502
1503         * bindings/js/JSDOMWindowBase.cpp:
1504         (WebCore::JSDOMWindowBase::shouldInterruptScript):
1505         * loader/EmptyClients.h:
1506         * page/Chrome.cpp:
1507         (WebCore::Chrome::shouldInterruptJavaScript): Deleted.
1508         * page/Chrome.h:
1509         * page/ChromeClient.h:
1510
1511 2015-06-18  Benjamin Poulain  <bpoulain@apple.com>
1512
1513         [CSS JIT][ARMv7] The pseudo element early exit trashes r6
1514         https://bugs.webkit.org/show_bug.cgi?id=146078
1515
1516         Reviewed by Alex Christensen.
1517
1518         The pseudo element early failure runs before we generate the prologue.
1519         The reason is that we can often exit immediately on function entry, before
1520         we even touch any memory.
1521
1522         On ARMv7, we don't have many spare registers so the MacroAssembler
1523         uses r6 as a scratch register and the client code is expected to save
1524         it.
1525
1526         In the early failure case, we were not pushing r6 before using the MacroAssembler
1527         and its value could be trashed.
1528
1529         This patch push the macro assembler registers separately from the prologue.
1530
1531         For restoring the registers, a new function generateFunctionEnding() encapsulate
1532         the pop() and ret().
1533
1534         * cssjit/SelectorCompiler.cpp:
1535         (WebCore::SelectorCompiler::SelectorCodeGenerator::pushMacroAssemblerRegisters):
1536         (WebCore::SelectorCompiler::SelectorCodeGenerator::popMacroAssemblerRegisters):
1537         (WebCore::SelectorCompiler::SelectorCodeGenerator::generatePrologue):
1538         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateEpilogue):
1539         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateSelectorChecker):
1540
1541         * cssjit/StackAllocator.h:
1542         (WebCore::StackAllocator::operator=):
1543         We have a new case for the stack allocator: some stack changes are conditional
1544         at compile time instead of runtime. This is easy to deal with by overriding
1545         the stack if a path is not taken at compile time.
1546
1547 2015-06-17  Conrad Shultz  <conrad_shultz@apple.com>
1548
1549         REGRESSION: js/dom/navigator-plugins-crash.html asserts a lot
1550         https://bugs.webkit.org/show_bug.cgi?id=144399
1551
1552         Reviewed by Darin Adler.
1553
1554         Earlier work made the array of web-visible plug-ins dynamic, but allowed DOMPlugin (and, indirectly by extension,
1555         DOMMimeType) to continue keeping a reference to a plug-in in terms of an index into that array. This superficially
1556         appeared correct since DOMPlugin immutably holds onto a PluginData instance, which in turn immutably holds onto a
1557         Page instance. PluginStrategy::getWebVisiblePluginInfo() is passed this Page, which is used to determine the contents
1558         of the plugin array. The expectation was that keeping an index would still be safe since the Page is not changing,
1559         but this is not strictly correct since relevant attributes of the Page and/or the available plugins may still change.
1560
1561         It's not entirely clear why the test failures are intermittent and occur only on certain configurations, but address
1562         them by eliminating the incorrect storage of indexes in favor of keeping copies of the relevant plugin info itself.
1563
1564         * plugins/DOMMimeType.cpp:
1565         (WebCore::DOMMimeType::DOMMimeType):
1566         Instead of storing the MIME type index, retrieve and store the MIME class info and plugin info.
1567         (WebCore::DOMMimeType::type):
1568         Directly access the m_mimeClassInfo member.
1569         (WebCore::DOMMimeType::suffixes):
1570         Ditto.
1571         (WebCore::DOMMimeType::description):
1572         Ditto.
1573         (WebCore::DOMMimeType::enabledPlugin):
1574         Directly access the m_pluginInfo member.
1575         (WebCore::DOMMimeType::mimeClassInfo): Deleted.
1576
1577         * plugins/DOMMimeType.h:
1578         Update member variables.
1579
1580         * plugins/DOMPlugin.cpp:
1581         (WebCore::DOMPlugin::DOMPlugin):
1582         Instead of storing the plugin index, store the plugin info directly.
1583         (WebCore::DOMPlugin::name):
1584         Directly access m_pluginInfo.
1585         (WebCore::DOMPlugin::filename):
1586         Ditto.
1587         (WebCore::DOMPlugin::description):
1588         Ditto.
1589         (WebCore::DOMPlugin::length):
1590         Ditto.
1591         (WebCore::DOMPlugin::item):
1592         Access m_pluginInfo directly; find the matching plug-in based on matching PluginInfo (for which an overloaded
1593         comparator is supplied below).
1594         (WebCore::DOMPlugin::pluginInfo): Deleted.
1595
1596         * plugins/DOMPlugin.h:
1597         Update member variables.
1598         (WebCore::DOMPlugin::create):
1599         Accept a PluginInfo instead of a plugin index.
1600
1601         * plugins/DOMPluginArray.cpp:
1602         (WebCore::DOMPluginArray::item):
1603         (WebCore::DOMPluginArray::namedItem):
1604
1605         * plugins/PluginData.h:
1606         (WebCore::operator==):
1607         Added; compare PluginInfo structs on the basis of member equality.
1608
1609 2015-06-17  Alex Christensen  <achristensen@webkit.org>
1610
1611         [Content Extensions] Log blocked loads to the WebInspector console
1612         https://bugs.webkit.org/show_bug.cgi?id=146089
1613
1614         Reviewed by Joseph Pecoraro.
1615
1616         * contentextensions/ContentExtensionsBackend.cpp:
1617         (WebCore::ContentExtensions::ContentExtensionsBackend::processContentExtensionRulesForLoad):
1618         (WebCore::ContentExtensions::ContentExtensionsBackend::displayNoneCSSRule):
1619         Log which URLs are blocked and the URL of the page they are blocked from.
1620
1621 2015-06-18  Joseph Pecoraro  <pecoraro@apple.com>
1622
1623         Crash under WebCore::DOMWindow::dispatchMessageEventWithOriginCheck attempting to log console message
1624         https://bugs.webkit.org/show_bug.cgi?id=146093
1625
1626         Reviewed by Timothy Hatcher.
1627
1628         * page/DOMWindow.cpp:
1629         (WebCore::DOMWindow::dispatchMessageEventWithOriginCheck):
1630         The console could be null so null check its use.
1631
1632 2015-06-18  Csaba Osztrogonác  <ossy@webkit.org>
1633
1634         Suppress null-conversion warnings in ANGLE
1635         https://bugs.webkit.org/show_bug.cgi?id=145125
1636
1637         Reviewed by Alex Christensen.
1638
1639         * CMakeLists.txt:
1640
1641 2015-06-18  Youenn Fablet <youenn.fablet@crf.canon.fr> and Xabier Rodriguez Calvar  <calvaris@igalia.com>
1642
1643         [Streams API] Implement ReadableStreamReader.releaseLock
1644         https://bugs.webkit.org/show_bug.cgi?id=145299
1645
1646         Reviewed by Darin Adler.
1647
1648         Covered by rebased tests.
1649
1650         * Modules/streams/ReadableStream.cpp:
1651         (WebCore::ReadableStream::close): Moving some close code to newly added releaseReader.
1652         (WebCore::ReadableStream::releaseReader): Implements reader release and callbacks finalization.
1653         (WebCore::ReadableStream::changeStateToErrored): Calls releaseReader.
1654         * Modules/streams/ReadableStream.h:
1655         (WebCore::ReadableStream::hasReadPendingRequests): Added to enable reader.releaseLock throwing if read requests are pending.
1656         * Modules/streams/ReadableStreamReader.cpp:
1657         (WebCore::ReadableStreamReader::releaseLock): Implementation of releaseLock
1658         * Modules/streams/ReadableStreamReader.h:
1659         * Modules/streams/ReadableStreamReader.idl:
1660         (WebCore::releaseLock): Deleted.
1661
1662 2015-06-18  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1663
1664         GObject and ObjC bindings generator should not generate code for promise-based APIs
1665         https://bugs.webkit.org/show_bug.cgi?id=146059
1666
1667         Reviewed by Darin Adler.
1668
1669         Covered by rebased expectations.
1670
1671         * bindings/scripts/CodeGeneratorGObject.pm:
1672         (SkipFunction): Disabling GObject DOM binding for functions returning promises.
1673         * bindings/scripts/CodeGeneratorObjC.pm:
1674         (SkipFunction): Disabling ObjC DOM binding for functions returning promises.
1675         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp: Rebasing expectation.
1676         (webkit_dom_test_obj_get_read_only_long_attr): Deleted.
1677         (webkit_dom_test_obj_get_read_only_string_attr): Deleted.
1678         * bindings/scripts/test/GObject/WebKitDOMTestObj.h: Rebasing expectation.
1679         * bindings/scripts/test/ObjC/DOMTestObj.h: Ditto.
1680         * bindings/scripts/test/ObjC/DOMTestObj.mm: Ditto.
1681         (core): Deleted.
1682
1683 2015-06-17  Ryuan Choi  <ryuan.choi@navercorp.com>
1684
1685         [EFL] test_ewk2_context_url_scheme_register has been crashed since r185553
1686         https://bugs.webkit.org/show_bug.cgi?id=146075
1687
1688         Reviewed by Carlos Garcia Campos.
1689
1690         Since r185553, CustomProtocolManager sends StartLoading message to UIProcess
1691         with request of SoupGenericRequest instead of request itself.
1692         But, request of SoupGenericRequest is nullptr in EFL port because EFL port
1693         does not use m_initiatingPageID.
1694
1695         This patch updates request of SoupGenericRequest although m_initiatingPageID is null.
1696
1697         * platform/network/soup/ResourceRequestSoup.cpp: 
1698         (WebCore::ResourceRequest::updateSoupRequest):
1699
1700 2015-06-17  Daniel Bates  <dabates@apple.com>
1701
1702         Client may receive began editing callback for already focused text field
1703         https://bugs.webkit.org/show_bug.cgi?id=146074
1704         <rdar://problem/21293562>
1705
1706         Reviewed by Darin Adler.
1707
1708         Fixes an issue where the client would be notified that began editing in a text field
1709         for each programmatic DOM focus event dispatched at the text field regardless of
1710         whether the field was focused. The client should only be notified that began editing
1711         exactly once when a text field becomes focused (either programmatically or by user interaction).
1712
1713         * html/TextFieldInputType.cpp:
1714         (WebCore::TextFieldInputType::forwardEvent): Move logic to dispatch editing began callback from here...
1715         (WebCore::TextFieldInputType::handleFocusEvent): to here. This function is called when the
1716         text field becomes newly focused.
1717         * html/TextFieldInputType.h:
1718
1719 2015-06-17  Alex Christensen  <achristensen@webkit.org>
1720
1721         [Content Extensions] Fail to parse invalid arrays
1722         https://bugs.webkit.org/show_bug.cgi?id=146079
1723         rdar://problem/21422649
1724
1725         Reviewed by Benjamin Poulain.
1726
1727         Covered by new and corrected API tests.
1728
1729         * contentextensions/ContentExtensionParser.cpp:
1730         (WebCore::ContentExtensions::loadTrigger):
1731         Fail to parse invalid arrays for if-domain, unless-domain, resource-type, and load-type arrays.
1732
1733 2015-06-16  Jon Honeycutt  <jhoneycutt@apple.com>
1734
1735         Position::findParent() should take a reference
1736         https://bugs.webkit.org/show_bug.cgi?id=146038
1737
1738         Reviewed by Darin Adler.
1739
1740         * dom/Position.cpp:
1741         (WebCore::Position::containerNode):
1742         (WebCore::Position::parentAnchoredEquivalent):
1743         Pass a reference; there is already a null check.
1744         (WebCore::Position::previous):
1745         Add a missing null check. Code below this expects that node is non-null.
1746         (WebCore::Position::next):
1747         Ditto.
1748         (WebCore::Position::atStartOfTree):
1749         (WebCore::Position::atEndOfTree):
1750         Pass a reference.
1751         (WebCore::Position::findParent):
1752         Changed to take a reference.
1753
1754         * dom/Position.h:
1755         Ditto.
1756
1757 2015-06-17  Brent Fulgham  <bfulgham@apple.com>
1758
1759         Overflow regions with scroll snap points are not reliably rubber banding
1760         https://bugs.webkit.org/show_bug.cgi?id=142522
1761         <rdar://problem/20100726>
1762
1763         Reviewed by Darin Adler.
1764
1765         When computing the target scroll destination, update the nearest snap point index
1766         and other bookkeeping, but keep the original gesture target if it would have taken
1767         us beyond either limit of the scroll container.
1768
1769         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
1770         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
1771         (WebCore::ScrollingTreeFrameScrollingNodeMac::scrollExtents): Add new method
1772         to support client API.
1773         * platform/ScrollAnimator.cpp:
1774         (WebCore::ScrollAnimator::scrollExtents): Add new method to support client API.
1775         * platform/ScrollAnimator.h:
1776         * platform/cocoa/ScrollController.h:
1777         (WebCore::ScrollControllerClient::scrollExtents): Added new pure virtual method to API.
1778         * platform/cocoa/ScrollController.mm:
1779         (WebCore::ScrollController::beginScrollSnapAnimation): Hold onto original user gesture
1780         target, and use that instead of our nearest snap point if the gesture takes us past
1781         either extreme of the scroll container.
1782
1783 2015-06-17  Tim Horton  <timothy_horton@apple.com>
1784
1785         Swipe gesture can get stuck, preventing scrolling and other gestures
1786         https://bugs.webkit.org/show_bug.cgi?id=146088
1787         <rdar://problem/16056087>
1788
1789         Reviewed by Darin Adler.
1790
1791         * WebCore.xcodeproj/project.pbxproj:
1792         * platform/spi/mac/NSEventSPI.h: Added.
1793         Add an SPI header.
1794
1795 2015-06-16  Matt Rajca  <mrajca@apple.com>
1796
1797         MediaSession: handle MediaEventTrackNext and MediaEventTrackPrevious events
1798         https://bugs.webkit.org/show_bug.cgi?id=146028
1799
1800         Reviewed by Darin Adler.
1801
1802         * Modules/mediasession/MediaRemoteControls.idl: Added nexttrack/previoustrack event handlers.
1803         * Modules/mediasession/MediaSession.cpp: Dispatch the nexttrack/previoustrack events.
1804         (WebCore::MediaSession::skipToNextTrack):
1805         (WebCore::MediaSession::skipToPreviousTrack):
1806         * Modules/mediasession/MediaSession.h:
1807         * Modules/mediasession/MediaSessionManager.cpp: Skip to the next/previous track as described in the media session spec.
1808         (WebCore::MediaSessionManager::skipToNextTrack):
1809         (WebCore::MediaSessionManager::skipToPreviousTrack):
1810         * Modules/mediasession/MediaSessionManager.h:
1811         * dom/EventNames.h: Added the nexttrack/previoustrack event names.
1812         * page/Page.cpp: Tell MediaSessionManager to handle the new track-skipping events.
1813         (WebCore::Page::handleMediaEvent):
1814
1815 2015-06-17  Chris Fleizach  <cfleizach@apple.com>
1816
1817         AX: VoiceOver in iOS not announcing generic WAI-ARIA region, even if labelled properly
1818         https://bugs.webkit.org/show_bug.cgi?id=146066
1819
1820         Reviewed by Darin Adler.
1821
1822         Allow the region role to identify as a landmark type.
1823
1824         Updated test: platform/ios-simulator/accessibility/landmark-types.html
1825
1826         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1827         (-[WebAccessibilityObjectWrapper _accessibilityIsLandmarkRole:]):
1828
1829 2015-06-17  Simon Fraser  <simon.fraser@apple.com>
1830
1831         REGRESSION (r173283-r173296): Amazon.com front page has no caret in the search field
1832         https://bugs.webkit.org/show_bug.cgi?id=146073
1833         rdar://problem/21022203
1834
1835         Reviewed by Tim Horton.
1836
1837         Text controls (text inputs and textareas) need backing store even when empty, because
1838         they need to be able to paint a caret.
1839
1840         Test: compositing/backing/form-controls-backing.html
1841
1842         * rendering/RenderLayerBacking.cpp:
1843         (WebCore::RenderLayerBacking::isSimpleContainerCompositingLayer):
1844
1845 2015-06-17  Zalan Bujtas  <zalan@apple.com>
1846
1847         Selection cache produces invalid result when ancestor has float element.
1848         https://bugs.webkit.org/show_bug.cgi?id=146042
1849         rdar://problem/20604592
1850
1851         Reviewed by Ryosuke Niwa.
1852
1853         Selection cache already takes floats into account, however it's not enough to check current
1854         block against floats. Any of the ancestor's float starting from the selection root block
1855         can impact the selection offsets.
1856
1857         Test: fast/block/selection-cache-is-incorrect-when-non-direct-parent-has-float.html
1858
1859         * rendering/LogicalSelectionOffsetCaches.h:
1860         (WebCore::LogicalSelectionOffsetCaches::ContainingBlockInfo::ContainingBlockInfo):
1861         (WebCore::LogicalSelectionOffsetCaches::ContainingBlockInfo::setBlock):
1862         (WebCore::LogicalSelectionOffsetCaches::ContainingBlockInfo::block):
1863         (WebCore::LogicalSelectionOffsetCaches::ContainingBlockInfo::cache):
1864         (WebCore::LogicalSelectionOffsetCaches::ContainingBlockInfo::hasFloatsOrFlowThreads):
1865         (WebCore::LogicalSelectionOffsetCaches::LogicalSelectionOffsetCaches):
1866
1867 2015-06-17  Joanmarie Diggs  <jdiggs@igalia.com>
1868
1869         AX: [ATK] Expose element tag name as an object attribute
1870         https://bugs.webkit.org/show_bug.cgi?id=146062
1871
1872         Reviewed by Mario Sanchez Prada.
1873
1874         Expose the element tag name as an object attribute with name "tag" and
1875         value being the lowercase tag name, both being what Gecko does for ATK.
1876
1877         No new tests. We already have sufficient coverage for AtkObject attributes.
1878         These tests have been updated to reflect the addition of the new attribute.
1879
1880         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
1881         (webkitAccessibleGetAttributes):
1882
1883 2015-06-17  Antti Koivisto  <antti@apple.com>
1884
1885         iOS WebKit1: [LegacyTileLayer drawInContext:] should ensure it has web lock
1886         https://bugs.webkit.org/show_bug.cgi?id=146072
1887         rdar://problem/21149759
1888
1889         Reviewed by Simon Fraser
1890
1891         There are some scenarios where we end up drawing without web lock due to client or system issues.
1892         This can cause crashes.
1893
1894         * platform/ios/LegacyTileLayer.mm:
1895         (-[LegacyTileLayer setNeedsDisplayInRect:]):
1896         (-[LegacyTileLayer drawInContext:]):
1897
1898             Ensure we have the web lock when called in main thread (even though we should have it already).
1899
1900 2015-06-17  Brent Fulgham  <bfulgham@apple.com>
1901
1902         CSS scroll snap: defining snap points on axis that does not scroll does not work properly
1903         https://bugs.webkit.org/show_bug.cgi?id=146043
1904         <rdar://problem/20125511>
1905
1906         Reviewed by Simon Fraser.
1907
1908         Tested by css3/scroll-snap/scroll-snap-mismatch.html
1909
1910         We always seed the set of scroll snap points with the start and end of the scroll container. This is not
1911         the right behavior if there are no scroll points defined, because we end up creating a snap for the start
1912         and end of the container, and any scroll gesture just takes us across the entire element.
1913         
1914         Instead, when we do not find any scroll snap points, we should clear the snap point state for the container.
1915
1916         * page/scrolling/AxisScrollSnapOffsets.cpp:
1917         (WebCore::updateFromStyle): If we did not find any snap points (i.e., the snapOffsets container
1918         only holds '0', return an empty Vector. 
1919         (WebCore::updateSnapOffsetsForScrollableArea): If the set of snap points produced by 'updateFromStyle' is empty,
1920         clear the horizontal (or vertical) snap offsets for the scroll area.
1921         
1922
1923 2015-06-17  Chris Fleizach  <cfleizach@apple.com>
1924
1925         AX: input role="spinbutton" gets skipped in voiceover
1926         https://bugs.webkit.org/show_bug.cgi?id=145514
1927
1928         Reviewed by Mario Sanchez Prada.
1929
1930         SpinButton role was added, but left out of iOS.
1931         To prevent this from happening again, explicitly list every role in the switch statement that
1932         determines accessible visibility.
1933
1934         Test: platform/ios-simulator/accessibility/spinbutton.html
1935
1936         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1937         (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
1938         (-[WebAccessibilityObjectWrapper isAccessibilityElement]):
1939
1940 2015-06-17  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
1941
1942         [Streams API] ReadableJSStream should handle promises returned by JS source pull callback
1943         https://bugs.webkit.org/show_bug.cgi?id=145965
1944
1945         Reviewed by Darin Adler.
1946
1947         Implemented asynchronous pulling.
1948         In particular, ensuring that doPull is not called as long as previous call to doPull is finished.
1949         Storing whether to pull automatically when the current pull is finished. 
1950
1951         Covered by rebased tests.
1952
1953         * Modules/streams/ReadableStream.cpp:
1954         (WebCore::ReadableStream::pull): stores whether to pull again.
1955         (WebCore::ReadableStream::finishPulling): called when pulling finishes.
1956         * Modules/streams/ReadableStream.h:
1957         * bindings/js/ReadableJSStream.cpp:
1958         (WebCore::createPullResultFulfilledFunction): The promise resolve callback.
1959         (WebCore::ReadableJSStream::doPull): Handling of promise.
1960         * bindings/js/ReadableJSStream.h:
1961
1962 2015-06-16  Carlos Garcia Campos  <cgarcia@igalia.com>
1963
1964         WebProcess crashes after too many redirect error when there's an active NPAPI plugin
1965         https://bugs.webkit.org/show_bug.cgi?id=146019
1966
1967         Reviewed by Darin Adler.
1968
1969         This happens with the GTK+ port after a navigation action ends up
1970         in an infinite redirection and the ResourceHandle fails with too
1971         many redirections error. I should actually happen after any error
1972         is reported by the ResourceHnalder before the load is
1973         committed. But tt only happens if there's an active NPAPI
1974         plugin. The problem is that FrameLoader::receivedMainResourceError()
1975         is called recursively because DocumentLoader::stopLoading() ends up
1976         calling mainReceivedError() that calls FrameLoader::receivedMainResourceError()
1977         again. DocumentLoader::stopLoading() checks if the document is
1978         still loading, which can happen if the main resource is loading,
1979         if there's any subresource loading or if there's a plugin
1980         loading. So, in case of being loading, those cases are handled
1981         individually to cancel the main resource, or set an error in the
1982         document loader and cancel subresources and plugins, except for
1983         this case of plugins, that mainReceivedError is called instead of
1984         setting cancelled error on the document loader.
1985
1986         * loader/DocumentLoader.cpp:
1987         (WebCore::DocumentLoader::stopLoading): If the document is still
1988         loading because there are active plugins, set the cancelled error
1989         on the document instead of calling mainReceivedError again.
1990
1991 2015-06-16  Youenn Fablet <youenn.fablet@crf.canon.fr> and Xabier Rodriguez Calvar  <calvaris@igalia.com>
1992
1993         [Streams API] Implement ReadableStream locked property
1994         https://bugs.webkit.org/show_bug.cgi?id=146023
1995
1996         Reviewed by Darin Adler.
1997
1998         Covered by rebased tests.
1999
2000         * Modules/streams/ReadableStream.h:
2001         (WebCore::ReadableStream::locked): Renamed isLocked by locked.
2002         * Modules/streams/ReadableStream.idl: Adding locked.
2003         * bindings/js/JSReadableStreamCustom.cpp:
2004         (WebCore::JSReadableStream::getReader): Using isLocked.
2005         * bindings/js/JSReadableStreamReaderCustom.cpp:
2006         (WebCore::constructJSReadableStreamReader): Using isLocked.
2007
2008 2015-06-16  Myles C. Maxfield  <mmaxfield@apple.com>
2009
2010         REGRESSION(r184899): [Cocoa] font-variant: small-caps is not honored with web fonts
2011         https://bugs.webkit.org/show_bug.cgi?id=145873
2012         <rdar://problem/21314282>
2013
2014         Reviewed by Dean Jackson.
2015
2016         When font-variant: small-caps is applied, we create a smaller version of the original font
2017         and draw capital characters in that smaller font. CGFontRefs do not have an intrinsic size,
2018         and web fonts historically only had a CGFontRef, which means that there was no need to
2019         convert the CGFontRef to be smaller (as opposed to regular fonts, which had a CTFontRef and
2020         therefore needed the conversion). Instead, we just changed m_size, which represents
2021         the size that the text should be drawn in.
2022
2023         However, r184899 gave CTFontRefs to web fonts. This means that now the FontPlatformData's
2024         m_size variable disagreed with the CTFontRef member. The solution here is to unify the web
2025         font and regular font codepaths, and treat them the same throughout.
2026
2027         Note that this patch removes the last use of the m_isCustomFont variable. As soon as we
2028         entirely migrate to CORETEXT_WEB_FONTS, we should delete this variable.
2029
2030         Test: fast/text/small-caps-web-font.html
2031
2032         * platform/graphics/cocoa/FontCocoa.mm:
2033         (WebCore::Font::platformCreateScaledFont): Treat web fonts the same as regular fonts.
2034         * platform/text/TextFlags.h: Add a comment regarding teh deletion of m_isCustomFont.
2035
2036 2015-06-16  Alex Christensen  <achristensen@webkit.org>
2037
2038         [Content Extensions] Implement branch compaction for DFA bytecode.
2039         https://bugs.webkit.org/show_bug.cgi?id=145619
2040
2041         Reviewed by Benjamin Poulain.
2042
2043         This patch adds another pass to the DFABytecodeCompiler which finds where the bytecode from each node
2044         would be if it were compiled with no branch compaction, then uses that as a worst-case value to determine
2045         how many bytes are needed to store the relative jump distance.  Then when linking, it will fill in the 
2046         value as it already did, but with a variable size jump.  The jumps are also now signed distances relative to
2047         where the jump is stored.
2048
2049         This patch is covered by existing tests, which have many jumps that are near the -128/127 byte boundary,
2050         and the switch from 16-bit jumps to 32-bit jumps near the -65536/65535 byte boundary is analogous.
2051
2052         * contentextensions/ContentExtensionCompiler.cpp:
2053         (WebCore::ContentExtensions::compileRuleList):
2054         * contentextensions/DFABytecode.h:
2055         (WebCore::ContentExtensions::smallestPossibleJumpSize):
2056         (WebCore::ContentExtensions::instructionSizeWithArguments):
2057         * contentextensions/DFABytecodeCompiler.cpp:
2058         (WebCore::ContentExtensions::append):
2059         (WebCore::ContentExtensions::appendZeroes):
2060         (WebCore::ContentExtensions::setBits):
2061         (WebCore::ContentExtensions::appendActionBytecodeSize):
2062         (WebCore::ContentExtensions::DFABytecodeCompiler::emitAppendAction):
2063         (WebCore::ContentExtensions::DFABytecodeCompiler::longestPossibleJump):
2064         (WebCore::ContentExtensions::DFABytecodeCompiler::emitJump):
2065         (WebCore::ContentExtensions::DFABytecodeCompiler::emitCheckValue):
2066         (WebCore::ContentExtensions::DFABytecodeCompiler::emitCheckValueRange):
2067         (WebCore::ContentExtensions::DFABytecodeCompiler::emitTerminate):
2068         (WebCore::ContentExtensions::DFABytecodeCompiler::compileNode):
2069         (WebCore::ContentExtensions::DFABytecodeCompiler::compiledNodeMaxBytecodeSize):
2070         (WebCore::ContentExtensions::DFABytecodeCompiler::ranges):
2071         (WebCore::ContentExtensions::DFABytecodeCompiler::checkForRangeMaxBytecodeSize):
2072         (WebCore::ContentExtensions::DFABytecodeCompiler::compileCheckForRange):
2073         (WebCore::ContentExtensions::DFABytecodeCompiler::nodeTransitionsMaxBytecodeSize):
2074         (WebCore::ContentExtensions::DFABytecodeCompiler::compileNodeTransitions):
2075         (WebCore::ContentExtensions::DFABytecodeCompiler::compile):
2076         (WebCore::ContentExtensions::set32Bits): Deleted.
2077         * contentextensions/DFABytecodeCompiler.h:
2078         * contentextensions/DFABytecodeInterpreter.cpp:
2079         (WebCore::ContentExtensions::getBits):
2080         (WebCore::ContentExtensions::getInstruction):
2081         (WebCore::ContentExtensions::jumpSizeInBytes):
2082         (WebCore::ContentExtensions::getJumpSize):
2083         (WebCore::ContentExtensions::getJumpDistance):
2084         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpretAppendAction):
2085         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpretTestFlagsAndAppendAction):
2086         (WebCore::ContentExtensions::DFABytecodeInterpreter::actionsForDefaultStylesheetFromDFARoot):
2087         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
2088         * loader/ResourceLoadInfo.h:
2089
2090 2015-06-16  Carlos Alberto Lopez Perez  <clopez@igalia.com>
2091
2092         [GTK] [Wayland] Should be possible to build with support for both X11 and Wayland.
2093         https://bugs.webkit.org/show_bug.cgi?id=145701
2094
2095         Reviewed by Darin Adler.
2096
2097         No new tests, no behavior changes.
2098
2099         When building both targets, we have to include the wayland-egl
2100         headers in order to build the Wayland target. This causes that
2101         EGLNativePixmapType and EGLNativeWindowType get defined as
2102         different types than when building only the X11 target.
2103
2104         By type casting them to the ones that are expected, we are able
2105         to build both targets at the same time.
2106
2107         I have done tests (building each target alone as also both targets
2108         at the same time), and everything seems to works as expected.
2109
2110         Once built for both targets, if you try to launch the MiniBrowser
2111         from inside a Wayland compositor (Weston on top of X for example),
2112         it will trigger the X11 target if the DISPLAY environment variable
2113         is set and the environment variable GDK_BACKEND is not set to wayland,
2114         otherwise it will trigger the Wayland target.
2115
2116         * platform/graphics/GLContext.cpp:
2117         (WebCore::GLContext::createContextForWindow): Add type casts. We have
2118         to consider here two different type casts depending on the type of
2119         GLNativeWindowType to avoid a build failure on 32-bits platforms.
2120         The static_cast one was already beeing done as an implicit cast
2121         (from uint64_t to XID), the reinterpret_cast is the new one that
2122         we need to do only when building on both platforms.
2123         * platform/graphics/egl/GLContextEGL.cpp: Add missing include when
2124         building both targets that is required for defining DefaultRootWindow().
2125         (WebCore::GLContextEGL::createPixmapContext): Add type cast.
2126
2127 2015-06-15  Jon Honeycutt  <jhoneycutt@apple.com>
2128
2129         [iOS] Crash long pressing on <input type=file>
2130         https://bugs.webkit.org/show_bug.cgi?id=146009
2131         <rdar://problem/21234453>
2132
2133         Reviewed by Ryosuke Niwa.
2134
2135         * dom/Position.cpp:
2136         (WebCore::Position::atStartOfTree):
2137         (WebCore::Position::atEndOfTree):
2138         Null check the container node before passing it to findParent().
2139
2140 2015-06-15  Chris Fleizach  <cfleizach@apple.com>
2141
2142         AX:  iOS accessibility tests are not running because we need WKTR support
2143         https://bugs.webkit.org/show_bug.cgi?id=145991
2144
2145         Reviewed by Daniel Bates.
2146
2147         Make some minor modifications to support notification handling in WKTR.
2148
2149         * accessibility/ios/AXObjectCacheIOS.mm:
2150         (WebCore::AXObjectCache::postPlatformNotification):
2151         (WebCore::AXObjectCache::postTextStateChangePlatformNotification):
2152         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2153         (-[WebAccessibilityObjectWrapper accessibilityClickPoint]):
2154         (-[WebAccessibilityObjectWrapper description]):
2155         (-[WebAccessibilityObjectWrapper accessibilitySetPostedNotificationCallback:withContext:]): Deleted.
2156         (-[WebAccessibilityObjectWrapper accessibilityPostedNotification:]): Deleted.
2157
2158 2015-06-16  Mark Lam  <mark.lam@apple.com>
2159
2160         Use NakedPtr<Exception>& to return exception results.
2161         https://bugs.webkit.org/show_bug.cgi?id=145870
2162
2163         Reviewed by Anders Carlsson and Filip Pizlo.
2164
2165         No new WebCore tests because this functionality is already covered by existing tests.
2166         API tests added for WTF::NakedPtr.
2167
2168         * bindings/js/JSCallbackData.cpp:
2169         (WebCore::JSCallbackData::invokeCallback):
2170         * bindings/js/JSCustomXPathNSResolver.cpp:
2171         (WebCore::JSCustomXPathNSResolver::lookupNamespaceURI):
2172         * bindings/js/JSErrorHandler.cpp:
2173         (WebCore::JSErrorHandler::handleEvent):
2174         * bindings/js/JSEventListener.cpp:
2175         (WebCore::JSEventListener::handleEvent):
2176         * bindings/js/JSMainThreadExecState.cpp:
2177         (WebCore::JSMainThreadExecState::didLeaveScriptContext):
2178         (WebCore::functionCallHandlerFromAnyThread):
2179         (WebCore::evaluateHandlerFromAnyThread):
2180         * bindings/js/JSMainThreadExecState.h:
2181         (WebCore::JSMainThreadExecState::currentState):
2182         (WebCore::JSMainThreadExecState::call):
2183         (WebCore::JSMainThreadExecState::evaluate):
2184         * bindings/js/JSMutationCallback.cpp:
2185         (WebCore::JSMutationCallback::call):
2186         * bindings/js/ScheduledAction.cpp:
2187         (WebCore::ScheduledAction::executeFunctionInContext):
2188         * bindings/js/ScriptController.cpp:
2189         (WebCore::ScriptController::evaluateInWorld):
2190         * bindings/js/WorkerScriptController.cpp:
2191         (WebCore::WorkerScriptController::evaluate):
2192         (WebCore::WorkerScriptController::setException):
2193         * bindings/js/WorkerScriptController.h:
2194         (WebCore::WorkerScriptController::workerGlobalScopeWrapper):
2195         * bindings/objc/WebScriptObject.mm:
2196         (-[WebScriptObject callWebScriptMethod:withArguments:]):
2197         * workers/WorkerGlobalScope.cpp:
2198         (WebCore::WorkerGlobalScope::importScripts):
2199
2200 2015-06-16  Brent Fulgham  <bfulgham@apple.com>
2201
2202         CSS Scroll Snap - support snapping to nested elements
2203         https://bugs.webkit.org/show_bug.cgi?id=145843
2204         <rdar://problem/21339581>
2205
2206         Reviewed by Darin Adler.
2207
2208         Tested by css3/scroll-snap/nested-elements.html
2209
2210         The Scroll Snap Point implementation was not properly handling nested elements.
2211         This could be resolved by recursively calling 'appendChildSnapOffsets', but this
2212         seemed like an inefficient approach, especially considering how often this method
2213         is called during various scaling and other operations.
2214         
2215         Instead, do the following:
2216         (1) Add a new HashSet to RenderView that holds a collection of RenderElements that
2217             have scroll-snap-coordinates.
2218         (2) During RenderElement::styleWillChange, register all elements that have the
2219             scroll-snap-coordinates style with the RenderView.
2220         (3) When performing 'appendChildSnapOffsets', refer to the HashSet of elements, select the
2221             subset of these entries relevant to the current scrolling container, and build up the
2222             set of scroll-snap-coordinates needed for the current scrolling container.
2223
2224         * page/scrolling/AxisScrollSnapOffsets.cpp:
2225         (WebCore::appendChildSnapOffsets): Check the scroll-snap-coordinate RenderElement HashSet
2226         for the RenderView to find all elements that are children of the current scrolling container.
2227         Add the scroll-snap-coordinates for these RenderElements to the current set of snap points.
2228         * rendering/RenderElement.cpp:
2229         (WebCore::findEnclosingScrollableContainer): New helper function.
2230         (WebCore::RenderElement::styleWillChange): If the current element has scroll-snap-coordinate
2231         defined, remember it for later so we can use it with the relevant scrolling container
2232         after layout completes.
2233         (WebCore::RenderElement::willBeRemovedFromTree): Unregister the current element from the
2234         RenderView.
2235         (WebCore::RenderElement::findEnclosingScrollableContainer): Added. Locate the relevant
2236         scrolling container for the current object.
2237         * rendering/RenderElement.h:
2238         * rendering/RenderView.cpp:
2239         (WebCore::Document::registerRenderElementWithScrollSnapCoordinates): Added.
2240         (WebCore::Document::unregisterRenderElementWithScrollSnapCoordinates): Added.
2241         * rendering/RenderView.h:
2242
2243 2015-06-16  Brady Eidson  <beidson@apple.com>
2244
2245         [IndexedDB] array index keys are concatenated across cursor lifetime
2246         <rdar://problem/19684902> and https://bugs.webkit.org/show_bug.cgi?id=138504
2247
2248         Reviewed by Brady Eidson, patch by Mark Dixon <mark@lowla.io>
2249
2250         Tested by:
2251         storage/indexeddb/keypath-arrays.html
2252
2253         IDBKeyData and IDBKeyPath need to clear any existing array values before calling
2254         decodeObjects to update the value of an existing object.
2255         
2256         * Modules/indexeddb/IDBKeyData.cpp:
2257         (WebCore::IDBKeyData::decode):
2258         * Modules/indexeddb/IDBKeyPath.cpp:
2259         (WebCore::IDBKeyPath::decode):
2260
2261 2015-06-16  Said Abou-Hallawa  <sabouhallawa@apple.com>
2262
2263         Canvas dimensions should be limited to 4096x4096 pixels on iOS devices.
2264         https://bugs.webkit.org/show_bug.cgi?id=145998
2265
2266         Reviewed by Darin Adler.
2267
2268         The value of MaxCanvasArea should depend on the platform. If the platform
2269         is iOS, the limit should be 64M. Otherwise the limit should be 1G.
2270
2271         Test: fast/canvas/pattern-too-large-to-create-2.html
2272
2273         * html/HTMLCanvasElement.cpp: Change MaxCanvasArea value based on the platform. 
2274         
2275         * rendering/svg/RenderSVGShape.h:
2276         (WebCore::RenderSVGShape::graphicsElement): Remove un-implemented constructor.
2277
2278 2015-06-16  Chris Dumez  <cdumez@apple.com>
2279
2280         REGRESSION(r185012): chat frame in Gmail now says "Something's not right"
2281         https://bugs.webkit.org/show_bug.cgi?id=146025
2282         <rdar://problem/21391412>
2283
2284         Reviewed by Darin Adler.
2285
2286         Only throttle timers in non-visible iframes once they've reached the
2287         max nesting level to avoid throttling critical one-shot timers. This is
2288         consistent with the default DOMTimer throttling behavior that is
2289         defined in the specification.
2290
2291         Power-wise, we are mostly interested in DOMTimers that fire frequently
2292         and cause high CPU usage over an extended period of time anyway.
2293
2294         * dom/Document.cpp:
2295         (WebCore::Document::setTimerThrottlingEnabled):
2296         (WebCore::Document::timerAlignmentInterval):
2297         * dom/Document.h:
2298         * dom/ScriptExecutionContext.cpp:
2299         (WebCore::ScriptExecutionContext::timerAlignmentInterval):
2300         * dom/ScriptExecutionContext.h:
2301         * page/DOMTimer.cpp:
2302         (WebCore::DOMTimer::alignedFireTime):
2303
2304 2015-06-16  sylvain-galineau  <galineau@adobe.com>
2305
2306         Incorrect order of arguments in initial-letter property
2307         https://bugs.webkit.org/show_bug.cgi?id=139667
2308
2309         Reviewed by Sam Weinig.
2310
2311         The CSS specification swapped the order of the initial-letters numeric values.
2312         The drop cap's height now comes first, followed by its optional vertical position.
2313         See http://www.w3.org/TR/css-inline/#sizing-drop-initials.
2314          
2315         No new tests. Existing tests updated.
2316
2317         * css/CSSParser.cpp:
2318         (WebCore::CSSParser::parseValue): swap arguments to reflect new spec order.
2319
2320 2015-06-16  Alex Christensen  <achristensen@webkit.org>
2321
2322         Remove some unused values.
2323         https://bugs.webkit.org/show_bug.cgi?id=145997
2324
2325         Reviewed by Gyuyoung Kim.
2326
2327         This patch should have no change in behavior.
2328
2329         * accessibility/AccessibilityObject.cpp:
2330         (WebCore::computeBestScrollOffset):
2331         (WebCore::AccessibilityObject::scrollToMakeVisibleWithSubFocus):
2332         (WebCore::AccessibilityObject::scrollToGlobalPoint):
2333         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2334         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
2335         * html/canvas/WebGL2RenderingContext.cpp:
2336         (WebCore::WebGL2RenderingContext::validateTexFuncData):
2337         * html/canvas/WebGLRenderingContext.cpp:
2338         (WebCore::WebGLRenderingContext::validateTexFuncData):
2339         * platform/graphics/StringTruncator.cpp:
2340         (WebCore::leftTruncateToBuffer):
2341         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
2342         (WebCore::MediaPlayerPrivateQTKit::paintCurrentFrameInContext):
2343         * rendering/InlineTextBox.cpp:
2344         (WebCore::InlineTextBox::localSelectionRect):
2345         * rendering/RenderElement.cpp:
2346         (WebCore::RenderElement::anchorRect):
2347         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
2348         (WebCore::SimpleLineLayout::TextFragmentIterator::skipToNextPosition):
2349         * rendering/svg/SVGTextQuery.cpp:
2350         (WebCore::SVGTextQuery::modifyStartEndPositionsRespectingLigatures):
2351         Remove unused values.
2352
2353 2015-06-16  Youenn Fablet <youenn.fablet@crf.canon.fr> and Xabier Rodriguez Calvar  <calvaris@igalia.com>
2354
2355         [Streams API] Calling controller.error() should trigger storing an undefined error
2356         https://bugs.webkit.org/show_bug.cgi?id=145976
2357
2358         Reviewed by Darin Adler.
2359
2360         Covered by rebased test.
2361
2362         * bindings/js/JSReadableStreamControllerCustom.cpp:
2363         (WebCore::JSReadableStreamController::error): Storing undefined if no error value passed.
2364         * bindings/js/ReadableJSStream.cpp: Removed storeError(ExecState*).
2365         (WebCore::ReadableJSStream::ReadableJSStream):
2366
2367 2015-06-16  Chris Dumez  <cdumez@apple.com>
2368
2369         Purge StyledElement's presentation attribute cache on memory pressure
2370         https://bugs.webkit.org/show_bug.cgi?id=145999
2371         <rdar://problem/21359252>
2372
2373         Reviewed by Andreas Kling.
2374
2375         Purge StyledElement's presentation attribute cache on memory pressure.
2376
2377         * dom/StyledElement.cpp:
2378         (WebCore::presentationAttributeCache):
2379         (WebCore::presentationAttributeCacheCleaner):
2380         (WebCore::StyledElement::clearPresentationAttributeCache):
2381         * dom/StyledElement.h:
2382         * platform/MemoryPressureHandler.cpp:
2383         (WebCore::MemoryPressureHandler::releaseNoncriticalMemory):
2384
2385 2015-06-15  Brent Fulgham  <bfulgham@apple.com>
2386
2387         REGRESSION(r175251, Mavericks Only): Playback may stall
2388         https://bugs.webkit.org/show_bug.cgi?id=145989
2389         <rdar://problem/21271919>
2390
2391         Unreviewed post-review correction.
2392
2393         Dave Kilzer pointed out that the macro around the waitForVideoOutputMediaDataWillChange
2394         call was incorrect. This patch corrects this error.
2395
2396         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2397         (WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoOutput): Correct the
2398         macro definition.
2399
2400 2015-06-15  Chris Fleizach  <cfleizach@apple.com>
2401
2402         AX: Changing state of radio buttons causes VoiceOver to go busy for a short time.
2403         https://bugs.webkit.org/show_bug.cgi?id=145933
2404
2405         Reviewed by Dean Jackson.
2406
2407         When radio buttons animate the new focus selection state, the thread activity looks a lot like short burst of
2408         activity to draw, then wait on CoreAnimation to apply those changes.
2409
2410         Since those periods of activity during animation are so short, VoiceOver is not able to query for all the
2411         attributes it needs, and gets stuck in the queue behind rendering.
2412
2413         The fix here is to turn off button state animations while VoiceOver is running.
2414
2415         * platform/mac/ThemeMac.mm:
2416         (WebCore::updateStates):
2417
2418 2015-06-15  Zalan Bujtas  <zalan@apple.com>
2419
2420         RootInlineBox::m_lineBreakObj becomes invalid when a child renderer is removed and the line does not get marked dirty.
2421         https://bugs.webkit.org/show_bug.cgi?id=145988
2422         rdar://problem/20959137
2423
2424         Reviewed by David Hyatt.
2425
2426         This patch ensures that we find the right first inline box so that we can dirty the
2427         the appropriate line boxes.
2428         With marking the right line boxes dirty, now we can update RootInlineBox::m_lineBreakObj at the next layout.
2429
2430         Test: fast/inline/crash-when-child-renderer-is-removed-and-line-stays-clean.html
2431
2432         * rendering/RenderInline.cpp:
2433         (WebCore::RenderInline::culledInlineFirstLineBox):
2434         (WebCore::RenderInline::culledInlineLastLineBox):
2435         * rendering/RootInlineBox.cpp:
2436         (WebCore::RootInlineBox::setLineBreakInfo): Deleted. Remove misleading assert and comment.
2437
2438 2015-06-15  Matt Rajca  <mrajca@apple.com>
2439
2440         Media Session: Improve the safety of playback toggling
2441         https://bugs.webkit.org/show_bug.cgi?id=145986
2442
2443         Reviewed by Darin Adler.
2444
2445         * Modules/mediasession/MediaSession.cpp:
2446         (WebCore::MediaSession::togglePlayback): Improved the safety of the loop so that we don't re-visit elements that
2447           may have been deleted underneath us.
2448         * Modules/mediasession/MediaSession.h: Added a pointer to the set of iterated active participating elements so
2449           we can remove any elements that are deleted from the underlying "real" set.
2450
2451 2015-06-15  Brent Fulgham  <bfulgham@apple.com>
2452
2453         REGRESSION(r175251, Mavericks Only): Playback may stall
2454         https://bugs.webkit.org/show_bug.cgi?id=145989
2455         <rdar://problem/21271919>
2456
2457         Reviewed by Dean Jackson.
2458
2459         Revert r175251 for Mavericks build targets.
2460
2461         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2462         (WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoLayer):
2463         (WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoOutput):
2464         (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput):
2465
2466 2015-06-15  Darin Adler  <darin@apple.com>
2467
2468         REGRESSION (r182215): Reproducible crash at drawsvg.org due to reentrant layout
2469         https://bugs.webkit.org/show_bug.cgi?id=145964
2470
2471         Reviewed by Simon Fraser.
2472
2473         Test: svg/as-object/mutate-on-load.html
2474
2475         * page/FrameView.cpp:
2476         (WebCore::FrameView::forceLayoutParentViewIfNeeded): Don't do a synchronous layout here,
2477         because it can lead indirectly to unwanted layout reentrancy. Instead schedule a layout.
2478
2479 2015-06-15  Matt Rajca  <mrajca@apple.com>
2480
2481         Media Session: Active participating elements can change while being iterated 
2482         https://bugs.webkit.org/show_bug.cgi?id=145978
2483
2484         Reviewed by Alex Christensen.
2485
2486         * Modules/mediasession/MediaSession.cpp:
2487         (WebCore::MediaSession::togglePlayback): Iterate through a copy of m_activeParticipatingElements since its contents
2488           can be modified in the loop.
2489
2490 2015-06-15  Chris Fleizach  <cfleizach@apple.com>
2491
2492         AX: no accessibility support for details element
2493         https://bugs.webkit.org/show_bug.cgi?id=131111
2494
2495         Reviewed by Darin Adler.
2496
2497         Add accessibility support for Mac for details element by:
2498            1) Returning new subroles for <details> and <summary>
2499            2) Exposing isExpanded property for <details> element.
2500
2501         Test: platform/mac/accessibility/details-summary.html
2502
2503         * accessibility/AccessibilityObject.cpp:
2504         (WebCore::AccessibilityObject::supportsARIAPressed):
2505         (WebCore::AccessibilityObject::supportsExpanded):
2506         (WebCore::AccessibilityObject::isExpanded):
2507         (WebCore::AccessibilityObject::supportsARIAExpanded): Deleted.
2508         * accessibility/AccessibilityObject.h:
2509         (WebCore::AccessibilityObject::canvasHasFallbackContent):
2510         * accessibility/AccessibilityRenderObject.cpp:
2511         (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored):
2512         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
2513         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2514         (-[WebAccessibilityObjectWrapper accessibilitySupportsARIAExpanded]):
2515         (-[WebAccessibilityObjectWrapper accessibilityIsExpanded]):
2516         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2517         (-[WebAccessibilityObjectWrapper additionalAccessibilityAttributeNames]):
2518         (createAccessibilityRoleMap):
2519         (-[WebAccessibilityObjectWrapper subrole]):
2520         * html/HTMLDetailsElement.h:
2521         * inspector/InspectorDOMAgent.cpp:
2522         (WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
2523
2524 2015-06-15  Alex Christensen  <achristensen@webkit.org>
2525
2526         [Content Extensions] Limit number of rules.
2527         https://bugs.webkit.org/show_bug.cgi?id=145663
2528
2529         Reviewed by Benjamin Poulain.
2530
2531         Added an API test to make sure that parsing fails when there are too many rules.
2532
2533         * contentextensions/ContentExtensionError.cpp:
2534         (WebCore::ContentExtensions::contentExtensionErrorCategory):
2535         * contentextensions/ContentExtensionError.h:
2536         * contentextensions/ContentExtensionParser.cpp:
2537         (WebCore::ContentExtensions::loadEncodedRules):
2538         Fail to parse a content extension with more than 50000 rules.
2539
2540 2015-06-12  Alexey Proskuryakov  <ap@apple.com>
2541
2542         -[WKWebView evaluateJavaScript] provides a misleading error when the return cannot be serialized
2543         https://bugs.webkit.org/show_bug.cgi?id=145900
2544
2545         Reviewed by Sam Weinig.
2546
2547         * English.lproj/Localizable.strings:
2548
2549 2015-06-15  Carlos Garcia Campos  <cgarcia@igalia.com>
2550
2551         [SOUP] Custom URI schemes don't work for requests containing a fragment identifier
2552         https://bugs.webkit.org/show_bug.cgi?id=145969
2553
2554         Reviewed by Sergio Villar Senin.
2555
2556         For URIs like foo:bar#baz, what the custom protocol manager
2557         receives in the UI process is foo:bar, so the user can't handle fragments.
2558
2559         * platform/network/soup/ResourceRequestSoup.cpp:
2560         (WebCore::ResourceRequest::updateSoupRequest): If the SoupRequest
2561         is a WebKitSoupRequestGeneric, call
2562         webkitSoupRequestGenericSetRequest with the ResourceRequest.
2563         * platform/network/soup/WebKitSoupRequestGeneric.cpp:
2564         (webkitSoupRequestGenericSetRequest):
2565         (webkitSoupRequestGenericGetRequest):
2566         * platform/network/soup/WebKitSoupRequestGeneric.h:
2567
2568 2015-06-15  Carlos Garcia Campos  <cgarcia@igalia.com>
2569
2570         [SOUP] Move WebKitSoupRequestGeneric to platform layer
2571         https://bugs.webkit.org/show_bug.cgi?id=145968
2572
2573         Reviewed by Sergio Villar Senin.
2574
2575         * PlatformEfl.cmake:
2576         * PlatformGTK.cmake:
2577         * platform/network/soup/WebKitSoupRequestGeneric.cpp: Renamed from Source/WebKit2/WebProcess/soup/WebKitSoupRequestGeneric.cpp.
2578         (webkitSoupRequestGenericFinalize):
2579         (webkit_soup_request_generic_init):
2580         (webkitSoupRequestGenericSendAsync):
2581         (webkitSoupRequestGenericSendFinish):
2582         (webkitSoupRequestGenericGetContentLength):
2583         (webkitSoupRequestGenericGetContentType):
2584         (webkit_soup_request_generic_class_init):
2585         (webkitSoupRequestGenericSetContentLength):
2586         (webkitSoupRequestGenericSetContentType):
2587         * platform/network/soup/WebKitSoupRequestGeneric.h: Renamed from Source/WebKit2/WebProcess/soup/WebKitSoupRequestGeneric.h.
2588         * platform/network/soup/WebKitSoupRequestGenericClient.h: Renamed from Source/WebKit2/WebProcess/soup/WebKitSoupRequestGenericClient.h.
2589
2590 2015-06-13  Chris Dumez  <cdumez@apple.com>
2591
2592         [WK2] API::Navigation objects are leaked on history navigation to HistoryItems in PageCache
2593         https://bugs.webkit.org/show_bug.cgi?id=145948
2594
2595         Reviewed by Darin Adler.
2596
2597         API::Navigation objects were leaked on history navigation to
2598         HistoryItems in PageCache. In such case, we would create 2 Navigation
2599         objects instead of 1 and the first one would be leaked. The reason
2600         we create the second one is because we fail to pass along the
2601         navigationID from the UIProcess to the WebProcess and then back to the
2602         UIProcess. On the IPC back to the UIProcess, the navigationID ends up
2603         being 0 so the UIProcess creates a new Navigation object, thinking that
2604         the load was triggered by the WebContent process.
2605
2606         We now pass along the navigationID, even if the HistoryItem is in the
2607         PageCache and we end up reusing the cached DocumentLoader, instead of
2608         creating a new one. A new updateCachedDocumentLoader() delegate is
2609         added to the FrameLoaderClient, similarly to the pre-existing
2610         createDocumentLoader() but for the case where the DocumentLoader gets
2611         reused.
2612
2613         * loader/EmptyClients.h:
2614         * loader/FrameLoader.cpp:
2615         (WebCore::FrameLoader::loadDifferentDocumentItem):
2616         * loader/FrameLoaderClient.h:
2617
2618 2015-06-13  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
2619
2620         [Streams API] ReadableJSStream should handle promises returned by JS source start callback
2621         https://bugs.webkit.org/show_bug.cgi?id=145792
2622
2623         Reviewed by Darin Adler.
2624
2625         Covered by rebased tests.
2626
2627         When calling start callback, the returned value is checked.
2628         If it is not a promise, we do as if it is a resolved promise.
2629         If it is a promise, we call its then() method with two resolve/reject JS functions.
2630
2631         * Modules/streams/ReadableStream.cpp:
2632         * bindings/js/ReadableJSStream.cpp:
2633         (WebCore::ReadableJSStream::invoke): Returns a JSPromise* if any is returned by the JS source callback.
2634         (WebCore::thenPromise): Utility method to call the promise.
2635         (WebCore::createStartResultFulfilledFunction): The promise resolve callback.
2636         (WebCore::ReadableJSStream::doStart): Calls thenPromise if a JSPromise* is returned by invoke.
2637         (WebCore::ReadableJSStream::ReadableJSStream):
2638         * bindings/js/ReadableJSStream.h:
2639
2640 2015-06-13  Andres Gonzalez  <agonzalez334@nc.rr.com>
2641
2642         AX: WebKit exposes all Ruby Text as Unknown (Japanese EPUB accessibility blocker)
2643         https://bugs.webkit.org/show_bug.cgi?id=141303
2644
2645         Reviewed by Chris Fleizach.
2646
2647         Test: accessibility/ruby-hierarchy-roles.html
2648
2649         * accessibility/AccessibilityObject.h:
2650         * accessibility/AccessibilityRenderObject.cpp:
2651         (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored):
2652         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
2653         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2654         (createAccessibilityRoleMap):
2655         (-[WebAccessibilityObjectWrapper subrole]):
2656
2657 2015-06-12  Chris Fleizach  <cfleizach@apple.com>
2658
2659         AX: iOS: after updating control, VoiceOver speaks aria-expanded states reversed (says "collapsed" when "expanded")
2660         https://bugs.webkit.org/show_bug.cgi?id=145943
2661
2662         Reviewed by Darin Adler.
2663
2664         iOS Accessibility platform needs to be notified of when aria expanded changes.
2665
2666         * accessibility/ios/AXObjectCacheIOS.mm:
2667         (WebCore::AXObjectCache::postPlatformNotification):
2668         * accessibility/ios/WebAccessibilityObjectWrapperIOS.h:
2669         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2670         (-[WebAccessibilityObjectWrapper postValueChangedNotification]):
2671         (-[WebAccessibilityObjectWrapper postExpandedChangedNotification]):
2672         (-[WebAccessibilityObjectWrapper postScrollStatusChangeNotification]):
2673
2674 2015-06-12  Chris Fleizach  <cfleizach@apple.com>
2675
2676         AX:ARIA Toggle buttons aren't properly conveyed on iOS using VoiceOver
2677         https://bugs.webkit.org/show_bug.cgi?id=145949
2678
2679         Reviewed by Darin Adler.
2680
2681         Expose pressed state information to the iOS platform AX API.
2682
2683         Test: Updated inspector-protocol/dom/getAccessibilityPropertiesForNode.html 
2684               There was a FIXME for this issue in that test: https://bugs.webkit.org/show_bug.cgi?id=129830
2685
2686         * accessibility/AccessibilityNodeObject.cpp:
2687         (WebCore::AccessibilityNodeObject::isPressed):
2688         * accessibility/AccessibilityObject.cpp:
2689         (WebCore::AccessibilityObject::classList):
2690         (WebCore::AccessibilityObject::supportsARIAPressed):
2691         (WebCore::AccessibilityObject::supportsARIAExpanded):
2692         * accessibility/AccessibilityObject.h:
2693         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2694         (-[WebAccessibilityObjectWrapper accessibilityARIALiveRegionIsAtomic]):
2695         (-[WebAccessibilityObjectWrapper accessibilitySupportsARIAPressed]):
2696         (-[WebAccessibilityObjectWrapper accessibilityIsPressed]):
2697         (-[WebAccessibilityObjectWrapper accessibilitySupportsARIAExpanded]):
2698
2699 2015-06-12  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
2700
2701         Purge PassRefPtr in JavaScriptCore - 2
2702         https://bugs.webkit.org/show_bug.cgi?id=145834
2703
2704         Reviewed by Darin Adler.
2705
2706         Fix call sites depends on changing of JSC.
2707
2708         * html/canvas/WebGL2RenderingContext.cpp:
2709         (WebCore::WebGL2RenderingContext::getParameter):
2710         * html/canvas/WebGLRenderingContext.cpp:
2711         (WebCore::WebGLRenderingContext::getParameter):
2712         * html/canvas/WebGLRenderingContextBase.cpp:
2713         (WebCore::WebGLRenderingContextBase::getUniform):
2714         (WebCore::WebGLRenderingContextBase::getVertexAttrib):
2715         (WebCore::WebGLRenderingContextBase::getWebGLFloatArrayParameter):
2716         (WebCore::WebGLRenderingContextBase::getWebGLIntArrayParameter):
2717
2718 2015-06-12  Zalan Bujtas  <zalan@apple.com>
2719
2720         Be more defensive at renderer type checking when initializing flow segments.
2721         https://bugs.webkit.org/show_bug.cgi?id=145942
2722
2723         Reviewed by Simon Fraser.
2724
2725         FlowContents::initializeSegments should ignore unsupported renderers so that when we miss
2726         a simple line layout path invalidation, we don't downcast the unsupported renderer to RenderText.
2727
2728         I have not reproduced this issue (but related to rdar://problem/21312452)
2729
2730         * rendering/SimpleLineLayoutFlowContents.cpp:
2731         (WebCore::SimpleLineLayout::initializeSegments):
2732
2733 2015-06-12  Anders Carlsson  <andersca@apple.com>
2734
2735         deleteEmptyDirectory should delete .DS_Store files on OS X
2736         https://bugs.webkit.org/show_bug.cgi?id=145944
2737
2738         Reviewed by Dan Bernstein.
2739
2740         deleteEmptyDirectory is often used when clearing website data, so we should
2741         take extra care to delete empty directories so the user won't think that clearing
2742         website data didn't do anything because it would leave directories with .DS_Store 
2743         files behind.
2744
2745         * platform/mac/FileSystemMac.mm:
2746         (WebCore::deleteEmptyDirectory):
2747         * platform/posix/FileSystemPOSIX.cpp:
2748
2749 2015-06-12  Manuel Rego Casasnovas  <rego@igalia.com>
2750
2751         [CSS Grid Layout] Fix grid-template-areas parsing to avoid spaces
2752         https://bugs.webkit.org/show_bug.cgi?id=145860
2753
2754         Reviewed by Sergio Villar Senin.
2755
2756         The spec doesn't require to have spaces between unnamed and named areas
2757         in grid-template-areas syntax. But spaces are currently required in our
2758         code.
2759
2760         This was confirmed in the CSS WG mailing list:
2761         https://lists.w3.org/Archives/Public/www-style/2015May/0239.html
2762
2763         This patch updates grid-template-areas parsing to allow the possibility
2764         of removing spaces between unnamed and named areas.
2765
2766         Added new cases to fast/css-grid-layout/grid-template-areas-get-set.html.
2767
2768         * css/CSSParser.cpp:
2769         (WebCore::parseGridTemplateAreasColumnNames): New helper method to
2770         determine the column names split by white spaces or dots.
2771         (WebCore::CSSParser::parseGridTemplateAreasRow): Use the new helper
2772         method to get the column names.
2773         (WebCore::containsOnlyDots): Deleted. Not needed anymore as
2774         parseGridTemplateAreasColumnNames() is using a single dot for unnamed
2775         grid areas (despite of being defined with 1 or more dots).
2776
2777 2015-06-12  Eric Carlson  <eric.carlson@apple.com>
2778
2779         [Mac] AirPlay menu button doesn't always show on page load
2780         https://bugs.webkit.org/show_bug.cgi?id=145936
2781
2782         Reviewed by Brent Fulgham.
2783
2784         * Modules/mediasession/WebMediaSessionManager.cpp:
2785         (WebCore::mediaProducerStateString): New, return a string representing MediaStateFlags.
2786         (WebCore::WebMediaSessionManager::clientStateDidChange): Log the states as strings.
2787         (WebCore::WebMediaSessionManager::toString): New, return a string representing ConfigurationTasks.
2788         (WebCore::WebMediaSessionManager::scheduleDelayedTask): Add logging.
2789         (WebCore::WebMediaSessionManager::taskTimerFired): Add logging.
2790         * Modules/mediasession/WebMediaSessionManager.h:
2791
2792         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h: Override wirelessVideoPlaybackDisabled
2793           so it is possible to activate route monitoring for a movie loaded with this engine.
2794         * platform/graphics/mac/MediaPlayerPrivateQTKit.h: Ditto.
2795
2796 2015-06-12  Zan Dobersek  <zdobersek@igalia.com>
2797
2798         Add the remaining missing override specifiers under Source/WebCore/
2799         https://bugs.webkit.org/show_bug.cgi?id=145907
2800
2801         Reviewed by Darin Adler.
2802
2803         Fix the remaining compiler warnings about missing override specifiers
2804         for overriding method declarations in classes under Source/WebCore/.
2805
2806         Where the addition had to be performed on all virtual methods of the
2807         class, the virtual specifier was removed so now only the override
2808         specifier is in use.
2809
2810         * Modules/indexeddb/IDBOpenDBRequest.h:
2811         * Modules/indexeddb/IDBRequest.h:
2812         * Modules/webdatabase/DatabaseServer.h:
2813         * bindings/js/ReadableJSStream.h:
2814         * editing/InsertTextCommand.h:
2815         * mathml/MathMLInlineContainerElement.h:
2816         * platform/audio/EqualPowerPanner.h:
2817         (WebCore::EqualPowerPanner::reset):
2818         * platform/graphics/MediaPlayer.cpp:
2819         (WebCore::NullMediaPlayerPrivate::load):
2820         (WebCore::NullMediaPlayerPrivate::cancelLoad):
2821         (WebCore::NullMediaPlayerPrivate::prepareToPlay):
2822         (WebCore::NullMediaPlayerPrivate::play):
2823         (WebCore::NullMediaPlayerPrivate::pause):
2824         (WebCore::NullMediaPlayerPrivate::platformMedia):
2825         (WebCore::NullMediaPlayerPrivate::platformLayer):
2826         (WebCore::NullMediaPlayerPrivate::naturalSize):
2827         (WebCore::NullMediaPlayerPrivate::hasVideo):
2828         (WebCore::NullMediaPlayerPrivate::hasAudio):
2829         (WebCore::NullMediaPlayerPrivate::setVisible):
2830         (WebCore::NullMediaPlayerPrivate::durationDouble):
2831         (WebCore::NullMediaPlayerPrivate::currentTimeDouble):
2832         (WebCore::NullMediaPlayerPrivate::seekDouble):
2833         (WebCore::NullMediaPlayerPrivate::seeking):
2834         (WebCore::NullMediaPlayerPrivate::setRateDouble):
2835         (WebCore::NullMediaPlayerPrivate::setPreservesPitch):
2836         (WebCore::NullMediaPlayerPrivate::paused):
2837         (WebCore::NullMediaPlayerPrivate::setVolumeDouble):
2838         (WebCore::NullMediaPlayerPrivate::supportsMuting):
2839         (WebCore::NullMediaPlayerPrivate::setMuted):
2840         (WebCore::NullMediaPlayerPrivate::hasClosedCaptions):
2841         (WebCore::NullMediaPlayerPrivate::setClosedCaptionsVisible):
2842         (WebCore::NullMediaPlayerPrivate::networkState):
2843         (WebCore::NullMediaPlayerPrivate::readyState):
2844         (WebCore::NullMediaPlayerPrivate::maxTimeSeekableDouble):
2845         (WebCore::NullMediaPlayerPrivate::minTimeSeekable):
2846         (WebCore::NullMediaPlayerPrivate::buffered):
2847         (WebCore::NullMediaPlayerPrivate::totalBytes):
2848         (WebCore::NullMediaPlayerPrivate::didLoadingProgress):
2849         (WebCore::NullMediaPlayerPrivate::setSize):
2850         (WebCore::NullMediaPlayerPrivate::canLoadPoster):
2851         (WebCore::NullMediaPlayerPrivate::setPoster):
2852         (WebCore::NullMediaPlayerPrivate::hasSingleSecurityOrigin):
2853         * platform/graphics/filters/DistantLightSource.h:
2854         * platform/graphics/filters/FEComposite.h:
2855         * platform/graphics/filters/FEDisplacementMap.h:
2856         (WebCore::FEDisplacementMap::determineAbsolutePaintRect):
2857         * platform/graphics/filters/FEFlood.h:
2858         (WebCore::FEFlood::determineAbsolutePaintRect):
2859         * platform/graphics/filters/PointLightSource.h:
2860         * platform/graphics/filters/SpotLightSource.h:
2861         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
2862         (WebCore::MediaPlayerPrivateGStreamer::hasVideo):
2863         (WebCore::MediaPlayerPrivateGStreamer::hasAudio):
2864         (WebCore::MediaPlayerPrivateGStreamer::audioSourceProvider):
2865         (WebCore::MediaPlayerPrivateGStreamer::engineDescription):
2866         (WebCore::MediaPlayerPrivateGStreamer::isLiveStream):
2867         (WebCore::MediaPlayerPrivateGStreamer::totalVideoFrames):
2868         (WebCore::MediaPlayerPrivateGStreamer::droppedVideoFrames):
2869         (WebCore::MediaPlayerPrivateGStreamer::corruptedVideoFrames):
2870         (WebCore::MediaPlayerPrivateGStreamer::totalFrameDelay):
2871         * platform/graphics/texmap/BitmapTextureGL.h:
2872         (WebCore::BitmapTextureGL::isBackedByOpenGL):
2873         * platform/graphics/transforms/Matrix3DTransformOperation.h:
2874         * platform/graphics/transforms/MatrixTransformOperation.h:
2875         * platform/graphics/transforms/PerspectiveTransformOperation.h:
2876         * platform/graphics/transforms/RotateTransformOperation.h:
2877         * platform/graphics/transforms/ScaleTransformOperation.h:
2878         * platform/graphics/transforms/SkewTransformOperation.h:
2879         * platform/image-decoders/png/PNGImageDecoder.h:
2880         (WebCore::PNGImageDecoder::filenameExtension):
2881         * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.h:
2882         * platform/mock/MockRealtimeMediaSourceCenter.h:
2883
2884 2015-06-12  Commit Queue  <commit-queue@webkit.org>
2885
2886         Unreviewed, rolling out r185512.
2887         https://bugs.webkit.org/show_bug.cgi?id=145932
2888
2889         Many asserts on layout tests and on API tests (Requested by
2890         ap_ on #webkit).
2891
2892         Reverted changeset:
2893
2894         "Use modern for-loops in WebCore/rendering - 1"
2895         https://bugs.webkit.org/show_bug.cgi?id=145831
2896         http://trac.webkit.org/changeset/185512
2897
2898 2015-06-12  Simon Fraser  <simon.fraser@apple.com>
2899
2900         OpenGLESSPI.h doesn't need to include UIKit.h
2901         https://bugs.webkit.org/show_bug.cgi?id=145931
2902
2903         Reviewed by Darin Adler.
2904
2905         No need to suck in all of UIKit from OpenGLESSPI.h.
2906
2907         * platform/spi/ios/OpenGLESSPI.h:
2908
2909 2015-06-12  Matt Rajca  <mrajca@apple.com>
2910
2911         Add barebones implementation of media session invocation algorithm.
2912         https://bugs.webkit.org/show_bug.cgi?id=145847
2913
2914         Reviewed by Darin Adler.
2915
2916         * Modules/mediasession/MediaSession.cpp:
2917         (WebCore::MediaSession::invoke): Move the media session to an active state.
2918         * Modules/mediasession/MediaSession.h:
2919         * html/HTMLMediaElement.cpp:
2920         (WebCore::HTMLMediaElement::playInternal): Call the media session invocation algorithm as described in the
2921           Media Session spec.
2922
2923 2015-06-12  Hunseop Jeong  <hs85.jeong@samsung.com>
2924
2925         Use modern for-loops in WebCore/rendering - 1
2926         https://bugs.webkit.org/show_bug.cgi?id=145831
2927
2928         Reviewed by Darin Adler.
2929
2930         No new tests because there is no behavior change.
2931
2932         * rendering/AutoTableLayout.cpp:
2933         (WebCore::AutoTableLayout::computeIntrinsicLogicalWidths):
2934         (WebCore::AutoTableLayout::calcEffectiveLogicalWidth):
2935         * rendering/FilterEffectRenderer.cpp:
2936         (WebCore::FilterEffectRenderer::build):
2937         (WebCore::FilterEffectRenderer::clearIntermediateResults):
2938         * rendering/FilterEffectRenderer.h:
2939         * rendering/FloatingObjects.cpp:
2940         (WebCore::FloatingObjects::clearLineBoxTreePointers):
2941         (WebCore::FloatingObjects::moveAllToFloatInfoMap):
2942         (WebCore::FloatingObjects::computePlacedFloatsTree):
2943         * rendering/FlowThreadController.cpp:
2944         (WebCore::FlowThreadController::collectFixedPositionedLayers):
2945         * rendering/HitTestResult.cpp:
2946         (WebCore::HitTestResult::append):
2947         * rendering/ImageQualityController.cpp:
2948         (WebCore::ImageQualityController::highQualityRepaintTimerFired):
2949         * rendering/InlineTextBox.cpp:
2950         (WebCore::InlineTextBox::paint):
2951         * rendering/RenderBlock.cpp:
2952         (WebCore::removeBlockFromDescendantAndContainerMaps):
2953         (WebCore::RenderBlock::addOverflowFromPositionedObjects):
2954         (WebCore::RenderBlock::dirtyForLayoutFromPercentageHeightDescendants):
2955         (WebCore::RenderBlock::simplifiedNormalFlowLayout):
2956         (WebCore::RenderBlock::layoutPositionedObjects):
2957         (WebCore::RenderBlock::markPositionedObjectsForLayout):
2958         (WebCore::RenderBlock::paintContinuationOutlines):
2959         (WebCore::clipOutPositionedObjects):
2960         (WebCore::RenderBlock::removeFromTrackedRendererMaps):
2961         (WebCore::RenderBlock::removePositionedObjects):
2962         (WebCore::RenderBlock::checkPositionedObjectsNeedLayout):
2963         * rendering/RenderBlockFlow.cpp:
2964         (WebCore::RenderBlockFlow::rebuildFloatingObjectSetFromIntrudingFloats):
2965         (WebCore::RenderBlockFlow::styleDidChange):
2966         (WebCore::RenderBlockFlow::moveFloatsTo):
2967         (WebCore::RenderBlockFlow::addOverflowFromFloats):
2968         (WebCore::RenderBlockFlow::repaintOverhangingFloats):
2969         (WebCore::RenderBlockFlow::paintFloats):
2970         (WebCore::RenderBlockFlow::clipOutFloatingObjects):
2971         (WebCore::RenderBlockFlow::lowestFloatLogicalBottom):
2972         (WebCore::RenderBlockFlow::lowestInitialLetterLogicalBottom):
2973         (WebCore::RenderBlockFlow::addOverhangingFloats):
2974         (WebCore::RenderBlockFlow::addIntrudingFloats):
2975         (WebCore::RenderBlockFlow::markSiblingsWithFloatsForLayout):
2976         (WebCore::RenderBlockFlow::adjustForBorderFit):
2977         * rendering/RenderBlockLineLayout.cpp:
2978         (WebCore::setLogicalWidthForTextRun):
2979         (WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):
2980         (WebCore::RenderBlockFlow::linkToEndLineIfNeeded):
2981         (WebCore::RenderBlockFlow::repaintDirtyFloats):
2982         (WebCore::RenderBlockFlow::layoutLineBoxes):
2983         (WebCore::RenderBlockFlow::checkFloatsInCleanLine):
2984         (WebCore::RenderBlockFlow::determineStartPosition):
2985         (WebCore::RenderBlockFlow::checkPaginationAndFloatsAtEndLine):
2986         * rendering/RenderCounter.cpp:
2987         (WebCore::RenderCounter::destroyCounterNodes):
2988         (WebCore::updateCounters):
2989         (WebCore::RenderCounter::rendererStyleChanged):
2990         * rendering/RenderFlexibleBox.cpp:
2991         (WebCore::RenderFlexibleBox::autoMarginOffsetInMainAxis):
2992         (WebCore::RenderFlexibleBox::freezeViolations):
2993         (WebCore::RenderFlexibleBox::resolveFlexibleLengths):
2994         (WebCore::RenderFlexibleBox::numberOfInFlowPositionedChildren):
2995         (WebCore::RenderFlexibleBox::layoutColumnReverse):
2996         (WebCore::RenderFlexibleBox::alignFlexLines):
2997         (WebCore::RenderFlexibleBox::alignChildren):
2998         (WebCore::RenderFlexibleBox::flipForWrapReverse):
2999         * rendering/RenderFlowThread.cpp:
3000         (WebCore::RenderFlowThread::updateAllLayerToRegionMappings):
3001         * rendering/RenderInline.cpp:
3002         (WebCore::RenderInline::addAnnotatedRegions):
3003         * rendering/RenderLayer.cpp:
3004         (WebCore::RenderLayer::updateDescendantsAreContiguousInStackingOrder):
3005         (WebCore::RenderLayer::updateDescendantDependentFlags):
3006         * rendering/RenderLayerBacking.cpp:
3007         (WebCore::descendantLayerPaintsIntoAncestor):
3008         (WebCore::RenderLayerBacking::startAnimation):
3009         * rendering/RenderLineBoxList.cpp:
3010         (WebCore::RenderLineBoxList::paint):
3011         * rendering/RenderListBox.cpp:
3012         (WebCore::RenderListBox::updateFromElement):
3013         * rendering/RenderMenuList.cpp:
3014         (WebCore::selectedOptionCount):
3015         (RenderMenuList::updateOptionsWidth):
3016         * rendering/RenderMultiColumnSet.cpp:
3017         (WebCore::RenderMultiColumnSet::distributeImplicitBreaks):
3018
3019 2015-06-12  Csaba Osztrogonác  <ossy@webkit.org>
3020
3021         Fix unused private field warning in ResourceHandleSoup.cpp
3022         https://bugs.webkit.org/show_bug.cgi?id=145910
3023
3024         Reviewed by Darin Adler.
3025
3026         * platform/network/soup/ResourceHandleSoup.cpp:
3027
3028 2015-06-12  Joseph Pecoraro  <pecoraro@apple.com>
3029
3030         Web Inspector: CRASH trying to inspect text that was removed/replaced
3031         https://bugs.webkit.org/show_bug.cgi?id=145898
3032
3033         Reviewed by Darin Adler.
3034
3035         * inspector/InspectorDOMAgent.cpp:
3036         (WebCore::InspectorDOMAgent::inspect):
3037         (WebCore::InspectorDOMAgent::focusNode):
3038         Ensure we only cause focusNode with a node to focus. If the original
3039         node that was provided is no longer in the document, then we won't
3040         actually find a node to inspect.
3041
3042 2015-06-12  KwangHyuk Kim  <hyuki.kim@samsung.com>
3043
3044         [EFL] canvas/philip/tests/toDataURL.jpeg.foo tests have been failed since r185417.
3045         https://bugs.webkit.org/show_bug.cgi?id=145878
3046
3047         Reviewed by Gyuyoung Kim.
3048
3049         Fix input buffer alignment issue.
3050
3051         No new tests, canvas/philip/tests/toDataURL.jpeg.foo can be used.
3052
3053         * platform/graphics/efl/ImageBufferEfl.cpp:
3054         (WebCore::encodeImagePNG):
3055         (WebCore::encodeImageJPEG):
3056         (WebCore::ImageBuffer::toDataURL):
3057
3058 2015-06-12  Zan Dobersek  <zdobersek@igalia.com>
3059
3060         Add missing override specifiers under Source/WebCore/svg/
3061         https://bugs.webkit.org/show_bug.cgi?id=145841
3062
3063         Reviewed by Darin Adler.
3064
3065         Add missing override specifiers to virtual method overrides for classes
3066         under Source/WebCore/svg/, suppressing a bunch of warnings when compiling
3067         with Clang 3.6.
3068
3069         Add the BEGIN_DECLARE_ANIMATED_PROPERTIES_BASE() macro that doesn't
3070         override the localAttributeToPropertyMap() method declaration, and
3071         have the BEGIN_DECLARE_ANIMATED_PROPERTIES() macro add the override
3072         specifier. The new macro is used in SVGElement.
3073
3074         Change the DECLARE_ANIMATED_PROPERTY() to accept the optional override
3075         specifier as the fifth parameter. Current DECLARE_ANIMATED_*() macros
3076         are modified to just pass an empty argument, not adding any specifier.
3077         DECLARE_ANIMATED_BOOLEAN_OVERRIDE() and DECLARE_ANIMATED_STRING_OVERRIDE()
3078         macros are added to override the methods for the externalResourcesRequired
3079         and href animated properties, where required.
3080
3081         * svg/SVGAElement.h:
3082         * svg/SVGAltGlyphElement.h:
3083         * svg/SVGAnimatedAngle.h:
3084         * svg/SVGAnimatedBoolean.h:
3085         * svg/SVGAnimatedEnumeration.h:
3086         * svg/SVGAnimatedInteger.h:
3087         * svg/SVGAnimatedLength.h:
3088         * svg/SVGAnimatedNumber.h:
3089         * svg/SVGAnimatedPreserveAspectRatio.h:
3090         * svg/SVGAnimatedRect.h:
3091         * svg/SVGAnimatedString.h:
3092         * svg/SVGAnimationElement.h:
3093         * svg/SVGCircleElement.h:
3094         * svg/SVGClipPathElement.h:
3095         * svg/SVGCursorElement.h:
3096         * svg/SVGDefsElement.h:
3097         * svg/SVGElement.h:
3098         * svg/SVGEllipseElement.h:
3099         * svg/SVGFEImageElement.h:
3100         * svg/SVGFilterElement.h:
3101         * svg/SVGFontElement.h:
3102         * svg/SVGForeignObjectElement.h:
3103         * svg/SVGGElement.h:
3104         * svg/SVGGlyphRefElement.h:
3105         * svg/SVGGradientElement.h:
3106         * svg/SVGImageElement.h:
3107         * svg/SVGLineElement.h:
3108         * svg/SVGMPathElement.h:
3109         * svg/SVGMarkerElement.h:
3110         * svg/SVGMaskElement.h:
3111         * svg/SVGPathElement.h:
3112         * svg/SVGPatternElement.h:
3113         * svg/SVGPolyElement.h:
3114         * svg/SVGRectElement.h:
3115         * svg/SVGSVGElement.h:
3116         * svg/SVGScriptElement.h:
3117         * svg/SVGSwitchElement.h:
3118         * svg/SVGSymbolElement.h:
3119         * svg/SVGTRefElement.h:
3120         * svg/SVGTextContentElement.h:
3121         * svg/SVGTextPathElement.h:
3122         * svg/SVGURIReference.h: Add the hrefBaseValue() pure virtual method
3123         so it can be overridden by any class that also overrides the
3124         corresponding setHrefBaseValue() method.
3125         * svg/SVGUseElement.h:
3126         * svg/SVGViewElement.h:
3127         * svg/properties/SVGAnimatedPropertyMacros.h:
3128         * svg/properties/SVGMatrixTearOff.h:
3129         (WebCore::SVGMatrixTearOff::commitChange):
3130
3131 2015-06-12  Zan Dobersek  <zdobersek@igalia.com>
3132
3133         [GLib] Move files under Source/WTF/wtf/gobject to Source/WTF/wtf/glib
3134         https://bugs.webkit.org/show_bug.cgi?id=145799
3135
3136         Reviewed by Carlos Garcia Campos.
3137
3138         Update header inclusions for headers that have been moved
3139         to Source/WTF/wtf/glib/.
3140
3141         * accessibility/atk/AXObjectCacheAtk.cpp:
3142         * accessibility/atk/WebKitAccessibleInterfaceText.cpp:
3143         * bindings/gobject/DOMObjectCache.cpp:
3144         * bindings/gobject/GObjectEventListener.h:
3145         * bindings/gobject/GObjectNodeFilterCondition.h:
3146         * bindings/gobject/GObjectXPathNSResolver.h:
3147         * bindings/gobject/WebKitDOMEventTarget.cpp:
3148         * platform/Pasteboard.h:
3149         * platform/audio/gstreamer/AudioDestinationGStreamer.cpp:
3150         * platform/audio/gstreamer/AudioFileReaderGStreamer.cpp:
3151         * platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp:
3152         * platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp:
3153         * platform/audio/gtk/AudioBusGtk.cpp:
3154         * platform/geoclue/GeolocationProviderGeoclue.h:
3155         * platform/geoclue/GeolocationProviderGeoclue2.cpp:
3156         * platform/glib/BatteryProviderUPower.cpp:
3157         * platform/glib/BatteryProviderUPower.h:
3158         * platform/graphics/gstreamer/GRefPtrGStreamer.h:
3159         * platform/graphics/gstreamer/GStreamerUtilities.cpp:
3160         * platform/graphics/gstreamer/GUniquePtrGStreamer.h:
3161         * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.h:
3162         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
3163         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
3164         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
3165         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
3166         * platform/graphics/gstreamer/MediaSourceGStreamer.cpp:
3167         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
3168         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h:
3169         * platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
3170         * platform/graphics/gstreamer/WebKitMediaSourceGStreamer.cpp:
3171         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
3172         * platform/graphics/gtk/ImageBufferGtk.cpp:
3173         * platform/graphics/gtk/ImageGtk.cpp:
3174         * platform/gtk/ContextMenuGtk.cpp:
3175         * platform/gtk/ContextMenuItemGtk.cpp:
3176         * platform/gtk/DataObjectGtk.cpp:
3177         * platform/gtk/DataObjectGtk.h:
3178         * platform/gtk/FileSystemGtk.cpp:
3179         * platform/gtk/GRefPtrGtk.h:
3180         * platform/gtk/GUniquePtrGtk.h:
3181         * platform/gtk/GamepadsGtk.cpp:
3182         * platform/gtk/GtkUtilities.cpp:
3183         * platform/gtk/LanguageGtk.cpp:
3184         * platform/gtk/LocalizedStringsGtk.cpp:
3185         * platform/gtk/PasteboardHelper.cpp:
3186         * platform/gtk/ScrollbarThemeGtk.cpp:
3187         * platform/gtk/SharedBufferGtk.cpp:
3188         * platform/gtk/SharedTimerGtk.cpp:
3189         * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp:
3190         * platform/network/ResourceHandleInternal.h:
3191         * platform/network/gtk/CredentialBackingStore.cpp:
3192         * platform/network/soup/CertificateInfo.h:
3193         * platform/network/soup/CookieJarSoup.cpp:
3194         * platform/network/soup/DNSSoup.cpp:
3195         * platform/network/soup/GRefPtrSoup.h:
3196         * platform/network/soup/GUniquePtrSoup.h:
3197         * platform/network/soup/ResourceError.h:
3198         * platform/network/soup/ResourceErrorSoup.cpp:
3199         * platform/network/soup/ResourceHandleSoup.cpp:
3200         * platform/network/soup/ResourceResponse.h:
3201         * platform/network/soup/SocketStreamHandle.h:
3202         * platform/network/soup/SocketStreamHandleSoup.cpp:
3203         * platform/network/soup/SoupNetworkSession.h:
3204         * platform/text/gtk/HyphenationLibHyphen.cpp:
3205         * rendering/RenderThemeGtk.cpp:
3206
3207 2015-06-12  Yoav Weiss  <yoav@yoav.ws>
3208
3209         Fix the build when the PICTURE_SIZES flag is off
3210         https://bugs.webkit.org/show_bug.cgi?id=145926
3211
3212         Reviewed by Csaba Osztrogonác.
3213
3214         No new tests since there's no functionality change.
3215
3216         * html/parser/HTMLPreloadScanner.cpp: Remove the guard around the definition of m_sizesAttribute.
3217
3218 2015-06-12  Commit Queue  <commit-queue@webkit.org>
3219
3220         Unreviewed, rolling out r185492.
3221         https://bugs.webkit.org/show_bug.cgi?id=145927
3222
3223         Causes crashes on debug (Requested by rego on #webkit).
3224
3225         Reverted changeset:
3226
3227         "[CSS Grid Layout] Fix grid-template-areas parsing to avoid
3228         spaces"
3229         https://bugs.webkit.org/show_bug.cgi?id=145860
3230         http://trac.webkit.org/changeset/185492
3231
3232 2015-06-12  Youenn Fablet  <youenn.fablet@crf.canon.fr>
3233
3234         Bindings generator should generate code for Promise-based APIs
3235         https://bugs.webkit.org/show_bug.cgi?id=145833
3236
3237         Reviewed by Darin Adler.
3238
3239         Covered by existing tests.
3240
3241         * Modules/webaudio/AudioContext.idl: Removing custom binding for resume, suspend and close.
3242         * bindings/js/JSAudioContextCustom.cpp: Ditto.
3243         * bindings/scripts/CodeGeneratorJS.pm:
3244         (GenerateHeader): Refactoring to use IsReturningPromise.
3245         (GenerateImplementation): Disabling include for return type if it is a promise.
3246         (GenerateParametersCheck): Adding DeferredWrapper() as argument to the DOM method if JS method returns a promise.
3247         (GenerateImplementationFunctionCall): Added support for promise-returning API.
3248         (IsReturningPromise): Checking whether function is returning a promise.
3249         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
3250         (webkit_dom_test_obj_test_promise_function):
3251         * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
3252         * bindings/scripts/test/JS/JSTestObj.cpp:
3253         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunction):
3254         * bindings/scripts/test/ObjC/DOMTestObj.h:
3255         * bindings/scripts/test/ObjC/DOMTestObj.mm:
3256         (-[DOMTestObj testPromiseFunction]):
3257         * bindings/scripts/test/TestObj.idl: Adding promise returning function.
3258
3259
3260 2015-06-12  Manuel Rego Casasnovas  <rego@igalia.com>
3261
3262         [CSS Grid Layout] Fix grid-template-areas parsing to avoid spaces
3263         https://bugs.webkit.org/show_bug.cgi?id=145860
3264
3265         Reviewed by Sergio Villar Senin.
3266
3267         The spec doesn't require to have spaces between unnamed and named areas
3268         in grid-template-areas syntax. But spaces are currently required in our
3269         code.
3270
3271         This was confirmed in the CSS WG mailing list:
3272         https://lists.w3.org/Archives/Public/www-style/2015May/0239.html
3273
3274         This patch updates grid-template-areas parsing to allow the possibility
3275         of removing spaces between unnamed and named areas.
3276
3277         Added new cases to fast/css-grid-layout/grid-template-areas-get-set.html.
3278
3279         * css/CSSParser.cpp:
3280         (WebCore::parseGridTemplateAreasColumnNames): New helper method to
3281         determine the column names split by white spaces or dots.
3282         (WebCore::CSSParser::parseGridTemplateAreasRow): Use the new helper
3283         method to get the column names.
3284         (WebCore::containsOnlyDots): Deleted. Not needed anymore as
3285         parseGridTemplateAreasColumnNames() is using a single dot for unnamed
3286         grid areas (despite of being defined with 1 or more dots).
3287
3288 2015-06-11  Mark Lam  <mark.lam@apple.com>
3289
3290         WebCore::reportException() needs to be able to accept a raw thrown value in addition to Exception objects.
3291         https://bugs.webkit.org/show_bug.cgi?id=145872
3292
3293         Reviewed by Michael Saboff.
3294
3295         API test added: WebKit1.ReportExceptionTest.
3296
3297         * bindings/js/JSDOMBinding.cpp:
3298         (WebCore::reportException):
3299         - Added a version of reportException() that takes a JSValue instead of an Exception
3300           object.  This version will ensure that we have an Exception object before calling
3301           into the original reportException() as follows:
3302
3303           1. If the JSValue is already an Exception object, we're good to go.
3304
3305           2. Else, if VM::lastException() is available, use that as the exception.
3306              This is how the old code use to behave (in terms of where it gets the exception
3307              stack trace).  The assumption is that reportException() will be called in
3308              a timely manner before the exception stack trace has been purged.
3309
3310           3. Else, create an Exception object with no stack trace.  This is the fall back
3311              in case the client did not call reportException() in a timely manner.
3312
3313         - Also clear the last exception after we've reported it.  This is how the old code
3314           before r185259 behave (in terms of the lifecycle of the last exception stack
3315           trace).  We're restoring that behavior here.
3316
3317         * bindings/js/JSDOMBinding.h:
3318
3319 2015-06-11  Zalan Bujtas  <zalan@apple.com>
3320
3321         Do not crash when the descendant frame tree is destroyed during layout.
3322         https://bugs.webkit.org/show_bug.cgi?id=144540
3323         rdar://problem/20793184
3324
3325         Reviewed by Andreas Kling.
3326
3327         Widget::setFrameRect(), through WebHTMLView layout, could trigger a style recalc, which in turn
3328         could initiate an onBeforeLoad callback.
3329         If javascript happens to destroy the current iframe in the onBeforeLoad callback, we lose the descendant
3330         render tree, including the child FrameView (the iframe element's view). However the RenderIFrame
3331         object stays protected until after the layout is done. (see protectRenderWidgetUntilLayoutIsDone())
3332
3333         Climbing back on the callstack, we need to make sure that
3334         1. the root widget of the descendant render tree (FrameView) stays valid as long as it is needed.
3335         2. RenderFrameBase::layoutWithFlattening() can handle the case when the associated widget (child FrameView) is set to nullptr.
3336         (see RenderWidget::willBeDestroyed() -> setWidget(nullptr))
3337
3338         (and later, when layout is finished this (RenderIFrame) object gets destroyed too.)
3339
3340         Covered by fast/frames/flattening/crash-remove-iframe-during-object-beforeload.html.
3341
3342         * page/FrameView.cpp:
3343         (WebCore::FrameView::setFrameRect):
3344         (WebCore::FrameView::updateEmbeddedObject):
3345         (WebCore::FrameView::updateWidgetPositions):
3346         * platform/ScrollView.cpp:
3347         (WebCore::ScrollView::setFrameRect):
3348         * platform/mac/WidgetMac.mm:
3349         (WebCore::Widget::setFrameRect):
3350         * rendering/RenderFrameBase.cpp:
3351         (WebCore::RenderFrameBase::layoutWithFlattening):
3352         (WebCore::RenderFrameBase::childRenderView):
3353         (WebCore::RenderFrameBase::peformLayoutWithFlattening):
3354         * rendering/RenderFrameBase.h:
3355         * rendering/RenderWidget.cpp:
3356         (WebCore::RenderWidget::updateWidgetPosition):
3357         * rendering/RenderWidget.h:
3358
3359 2015-06-11  Commit Queue  <commit-queue@webkit.org>
3360
3361         Unreviewed, rolling out r185470.
3362         https://bugs.webkit.org/show_bug.cgi?id=145902
3363
3364         Caused ASan violations (Requested by ap on #webkit).
3365
3366         Reverted changeset:
3367
3368         "Add an appearance keyword for wireless playback / airplay
3369         icon"
3370         https://bugs.webkit.org/show_bug.cgi?id=145892
3371         http://trac.webkit.org/changeset/185470
3372
3373 2015-06-11  Brady Eidson  <beidson@apple.com>
3374
3375         IndexedDB onupgradeneeded event has incorrect value for oldVersion.
3376         <rdar://problem/18309792> and https://bugs.webkit.org/show_bug.cgi?id=136888
3377
3378         Reviewed by Sam Weinig.
3379
3380         Test: storage/indexeddb/version-change-event-basic.html
3381
3382         "NoIntVersion" is an internal bookkeeping concept that we never should've been passing to Javascript.
3383         
3384         This cleans up things by:
3385         - Adjusting an old version of "NoIntVersion" to "0" before making the version change callback.
3386         - Removing the VersionNullness parameter from almost everywhere.
3387         - Removing the nullability of the newVersion parameter from the IDL.
3388
3389         * Modules/indexeddb/IDBDatabase.cpp:
3390         (WebCore::IDBDatabase::onVersionChange):
3391         * Modules/indexeddb/IDBDatabase.h:
3392         
3393         * Modules/indexeddb/IDBDatabaseBackend.cpp:
3394         (WebCore::IDBDatabaseBackend::runIntVersionChangeTransaction):
3395         (WebCore::IDBDatabaseBackend::deleteDatabase):
3396         
3397         * Modules/indexeddb/IDBDatabaseCallbacks.h:
3398         * Modules/indexeddb/IDBDatabaseCallbacksImpl.cpp:
3399         (WebCore::IDBDatabaseCallbacksImpl::onVersionChange):
3400         * Modules/indexeddb/IDBDatabaseCallbacksImpl.h:
3401         
3402         * Modules/indexeddb/IDBOpenDBRequest.cpp:
3403         (WebCore::IDBOpenDBRequest::onBlocked):
3404         (WebCore::IDBOpenDBRequest::onUpgradeNeeded):
3405   &n