ad304489d4c6a3ca7dd473e3d23c6b9780bf68f6
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2015-07-15  Sam Weinig  <sam@webkit.org>
2
3         Color match plug-ins
4         <rdar://problem/21758722>
5         https://bugs.webkit.org/show_bug.cgi?id=146987
6
7         Reviewed by Dean Jackson.
8
9         * platform/spi/cocoa/QuartzCoreSPI.h:
10         Add colorMatchUntaggedContent property.
11
12 2015-07-15  Brent Fulgham  <bfulgham@apple.com>
13
14         [Win] Another build fix after r186858.
15
16         * html/canvas/DOMPath.h: Don't use WEBCORE_EXPORT on the
17         overall class and the destructor declaration.
18
19 2015-07-15  Dean Jackson  <dino@apple.com>
20
21         Tag WebGL layers with sRGB colorspace
22         https://bugs.webkit.org/show_bug.cgi?id=146986
23         <rdar://problem/21758704>
24
25         Reviewed by Simon Fraser.
26
27         Label a CAOpenGLLayer as using the sRGB colorspace,
28         like the rest of our page content.
29
30         Test: fast/canvas/webgl/match-page-color-space.html
31
32         * platform/graphics/mac/WebGLLayer.mm:
33         (-[WebGLLayer initWithGraphicsContext3D:]): Set the colorspace property on the layer.
34         (-[WebGLLayer copyCGLPixelFormatForDisplayMask:]):
35         (-[WebGLLayer drawInCGLContext:pixelFormat:forLayerTime:displayTime:]):
36         (-[WebGLLayer copyImageSnapshotWithColorSpace:]):
37
38 2015-07-15  Brent Fulgham  <bfulgham@apple.com>
39
40         [Win] Unreviewed build fix after r186858.
41
42         Add missing DOMPath and PathUtilities files to project.
43
44         * WebCore.vcxproj/WebCore.vcxproj:
45         * WebCore.vcxproj/WebCore.vcxproj.filters:
46
47 2015-07-15  Anders Carlsson  <andersca@apple.com>
48
49         Headers that look for NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES should import NSGeometry.h
50         https://bugs.webkit.org/show_bug.cgi?id=146982
51
52         Reviewed by Tim Horton.
53
54         * platform/graphics/FloatPoint.h:
55         * platform/graphics/IntPoint.h:
56         * platform/graphics/IntSize.h:
57
58 2015-07-15  Wenson Hsieh  <wenson_hsieh@apple.com>
59
60         Scroll snapping to elements is broken for main frame scrolling
61         https://bugs.webkit.org/show_bug.cgi?id=146957
62
63         Reviewed by Brent Fulgham.
64
65         Fixes the case of elements with scroll snap coordinates in a scroll snapping mainframe by changing
66         RenderBox::findEnclosingScrollableContainer to return the body's RenderBox when all enclosing elements
67         are not overflow scrollable but the mainframe can scroll.
68
69         Test: css3/scroll-snap/scroll-snap-coordinate-mainframe.html
70
71         * page/FrameView.h: Export isScrollable so that the Internals API can use it.
72         * rendering/RenderBox.cpp: Include MainFrame.h.
73         (WebCore::RenderBox::findEnclosingScrollableContainer): Changed to return the body's RenderBox if
74             none of its parent elements are overflow scrolling.
75         * testing/Internals.cpp:
76         (WebCore::Internals::scrollSnapOffsets): Updated to return snap offsets for the body element,
77             allowing us to call window.internals.scrollSnapOffsets(document.body).
78
79 2015-07-15  Brady Eidson  <beidson@apple.com>
80
81         WebKit document.cookie mis-parsing.
82         rdar://problem/21715050 and https://bugs.webkit.org/show_bug.cgi?id=146976
83
84         Reviewed by Sam Weinig.
85
86         * platform/network/mac/CookieJarMac.mm:
87         (WebCore::setCookiesFromDOM): Use new CFNetwork SPI when available.
88
89 2015-07-15  Jinyoung Hur  <hur.ims@navercorp.com>
90
91         [WinCairo] font fallback not working
92         https://bugs.webkit.org/show_bug.cgi?id=146595
93
94         Reviewed by Myles C. Maxfield.
95
96         A Win32 API, GetGlyphIndices(), is not used properly, so any glyphs are considered existing in a font and it prevents the font fall back mechanism from working.
97
98         I think a specific font should be newly installed on the test machine to test this case but I have no idea how can it be done.
99
100         * platform/graphics/win/GlyphPageTreeNodeCairoWin.cpp:
101         (WebCore::GlyphPage::fill):
102
103 2015-07-15  Tim Horton  <timothy_horton@apple.com>
104
105         Factor rect shrink-wrapping code out of RenderThemeMac for future reuse
106         https://bugs.webkit.org/show_bug.cgi?id=146973
107         <rdar://problem/21643094>
108
109         Reviewed by Anders Carlsson.
110
111         Test: fast/shrink-wrap/rect-shrink-wrap.html
112
113         * WebCore.xcodeproj/project.pbxproj:
114         Add DOMPath.cpp and PathUtilities.{h, cpp}.
115
116         * bindings/js/JSDOMBinding.h:
117         (WebCore::NativeValueTraits<double>::nativeValue):
118         Make it possible to use sequence<double> in IDL files.
119
120         * bindings/scripts/CodeGeneratorJS.pm:
121         Export JSDOMPath for use in Internals.
122
123         * html/canvas/DOMPath.cpp: Added.
124         (WebCore::DOMPath::~DOMPath):
125         * html/canvas/DOMPath.h:
126         Out-of-line the DOMPath destructor so as not to anger the bindings
127         integrity checker (otherwise, the address of the DOMPath destructor
128         is different in WebCoreTestSupport and WebCore, causing us to fail
129         the vtable equality test).
130
131         * platform/graphics/Path.h:
132         Forward declare FloatRect instead of including it unnecessarily.
133         Export ensurePlatformPath().
134
135         * platform/graphics/PathUtilities.cpp: Added.
136         (WebCore::addShrinkWrapRightCorner):
137         (WebCore::addShrinkWrapLeftCorner):
138         (WebCore::addShrinkWrappedPathForRects):
139         These parts are extracted from RenderThemeMac, with two changes:
140             + support for arbitrarily-aligned rects
141               (the other version assumed they were horizontally center-aligned)
142             + support for overlapping rects
143               (the other version assumed they touched but did not overlap)
144
145         There are still things missing:
146             + support for a fallback when the shape is too hard to shrink-wrap
147
148         And things broken:
149             + if the distance between two edges is smaller than the corner radius,
150               we'll end up with a sharp edge in the path
151
152         Both of these cases are covered in the layout test and can be improved.
153
154         (WebCore::rectsIntersectOrTouch):
155         Rect intersection with <= instead of <.
156
157         (WebCore::contiguousRectGroupsFromRects):
158         Given a set of rects, find all of the contiguous regions. We'll
159         shrink-wrap each region independently.
160
161         (WebCore::PathUtilities::pathWithShrinkWrappedRects):
162         * platform/graphics/PathUtilities.h: Added.
163         Add PathUtilities, where the shrink-wrapping code lives.
164
165         * rendering/RenderThemeMac.mm:
166         (WebCore::paintAttachmentTitleBackground):
167         (WebCore::addAttachmentTitleBackgroundRightCorner): Deleted.
168         (WebCore::addAttachmentTitleBackgroundLeftCorner): Deleted.
169         Remove shrink-wrapping implementation and make use of the one in PathUtilities.
170
171         * testing/Internals.cpp:
172         (WebCore::Internals::pathWithShrinkWrappedRects):
173         * testing/Internals.h:
174         * testing/Internals.idl:
175         Expose pathWithShrinkWrappedRects to tests via Internals.
176         It takes a sequence<double> where every four values are the x, y, w, h
177         of a rect, and returns a DOMPath which can be used with Canvas.
178
179 2015-07-15  Enrica Casucci  <enrica@apple.com>
180
181         [iOS] Should look for RTF and RTFD pasteboard types before plain text.
182         https://bugs.webkit.org/show_bug.cgi?id=146971
183         rdar://problem/21840845
184
185         Reviewed by Sam Weinig.
186
187         The list of pasteboard types returned by supportedPasteboardTypes
188         determines the order in which WebKit looks for data in the pasteboard
189         to create a fragment. The incorrect order could make plain text to
190         be preferred over rich format.
191
192         * platform/ios/PasteboardIOS.mm:
193         (WebCore::Pasteboard::supportedPasteboardTypes):
194
195 2015-07-15  Anders Carlsson  <andersca@apple.com>
196
197         Private headers that include project headers should also be project headers
198         https://bugs.webkit.org/show_bug.cgi?id=146974
199
200         Reviewed by Dan Bernstein.
201
202         Since these headers can't be included by WebKit anyway they shouldn't be installed.
203
204         * WebCore.xcodeproj/project.pbxproj:
205
206 2015-07-15  Eric Carlson  <eric.carlson@apple.com>
207
208         [Mac] AirPlay route is not always set automatically
209         https://bugs.webkit.org/show_bug.cgi?id=146969
210
211         Reviewed by Jer Noble.
212
213         * Modules/mediasession/WebMediaSessionManager.cpp:
214         (WebCore::WebMediaSessionManager::configurePlaybackTargetClients): Return early if there are
215           no clients. Make the first client in the vector automatically play to the target if there
216           is no other match and there is an active route.
217         (WebCore::WebMediaSessionManager::watchdogTimerFired): Call picker.invalidatePlaybackTargets,
218           not stopMonitoringPlaybackTargets.
219
220         * platform/graphics/MediaPlaybackTargetPicker.cpp:
221         (WebCore::MediaPlaybackTargetPicker::invalidatePlaybackTargets): New.
222         * platform/graphics/MediaPlaybackTargetPicker.h:
223
224         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.h:
225         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
226         (WebCore::MediaPlaybackTargetPickerMac::stopMonitoringPlaybackTargets): Do nothing, AirPlay
227           automatically stops monitoring when appropriate and release the picker also releases
228           the output context, which drops the route.
229         (WebCore::MediaPlaybackTargetPickerMac::invalidatePlaybackTargets): New.
230
231 2015-07-15  Anders Carlsson  <andersca@apple.com>
232
233         Remove forwarding headers that no longer point to valid headers
234         https://bugs.webkit.org/show_bug.cgi?id=146972
235
236         Reviewed by Tim Horton.
237
238         * ForwardingHeaders/heap/AllocationSpace.h: Removed.
239         * ForwardingHeaders/runtime/IntegralTypedArrayBase.h: Removed.
240         * ForwardingHeaders/runtime/PrototypeFunction.h: Removed.
241         * ForwardingHeaders/runtime/StorageBarrier.h: Removed.
242         * ForwardingHeaders/runtime/TypedArrayBase.h: Removed.
243
244 2015-07-15  Wenson Hsieh  <wenson_hsieh@apple.com>
245
246         Negative scroll snap repeat values cause web process to hang indefinitely
247         https://bugs.webkit.org/show_bug.cgi?id=146953
248         <rdar://problem/21823681>
249
250         Reviewed by Simon Fraser.
251
252         Fixed dangerous behavior caused by setting -scroll-snap-points-x or -y to negative or very small
253         positive values. In the case of negative or 0 repeats, the web process would hang indefinitely. In
254         the case of very small positive values, a massive amount of memory could potentially be allocated
255         just to store snap offsets.
256
257         Tests: css3/scroll-snap/scroll-snap-negative-repeat.html
258                css3/scroll-snap/scroll-snap-subpixel-repeat.html
259
260         * css/CSSParser.cpp:
261         (WebCore::CSSParser::parseNonElementSnapPoints): Changed to consider negative snap repeat values as invalid CSS.
262         * page/scrolling/AxisScrollSnapOffsets.cpp:
263         (WebCore::updateFromStyle): Changed to threshold non-negative snap repeat values to 1px.
264
265 2015-07-14  Dean Jackson  <dino@apple.com>
266
267         Placeholder colors should be system grays
268         https://bugs.webkit.org/show_bug.cgi?id=146955
269         <rdar://problem/21774358>
270
271         Reviewed by Sam Weinig.
272
273         Update the PiP and Airplay placards to use the correct shades
274         of gray.
275
276         * Modules/mediacontrols/mediaControlsApple.css: No need to specify the
277         font here, nor have rules for Picture in Picture, which isn't available
278         on OS X.
279         (audio::-webkit-media-controls-time-remaining-display): We should specify
280         font style here.
281         (video:-webkit-full-screen::-webkit-media-controls-panel): Drive-by cleanup.
282         (audio::-webkit-media-controls-wireless-playback-status): Use a gray background
283         and system gray for text and artwork.
284         (audio::-webkit-media-controls-wireless-playback-status.small): Ditto.
285         (audio::-webkit-media-controls-picture-in-picture-button): Deleted (not on OS X).
286         (audio::-webkit-media-controls-wireless-playback-text-top): Deleted use of background color.
287         (audio::-webkit-media-controls-wireless-playback-text-bottom): Ditto..
288
289         * Modules/mediacontrols/mediaControlsiOS.css: Use a gray background
290         and system gray for text and artwork.
291         (audio::-webkit-media-controls-wireless-playback-status):
292         (audio::-webkit-media-controls-wireless-playback-text-top):
293         (audio::-webkit-media-controls-wireless-playback-status.picture-in-picture):
294
295 2015-07-14  Hunseop Jeong  <hs85.jeong@samsung.com>
296
297         [EFL] Scrollbar is not drawn on MiniBrowser.
298         https://bugs.webkit.org/show_bug.cgi?id=143566
299
300         Reviewed by Gyuyoung Kim.
301
302         Implement the ScrollbarThemeEfl to draw the scrollbar on EFL port.
303
304         * PlatformEfl.cmake: Removed the ScrollbarEfl.cpp.
305
306         * platform/Scrollbar.cpp: Removed the !PLATFORM(EFL) guard to use the createNativeScrollbar().
307
308         * platform/efl/DefaultTheme/CMakeLists.txt: Replaced the image files with new ones.
309
310         * platform/efl/DefaultTheme/widget/scrollbar/scrollbar.edc:
311         * platform/efl/DefaultTheme/widget/scrollbar/scrollbar_bg_horizontal.png: Added.
312         * platform/efl/DefaultTheme/widget/scrollbar/scrollbar_bg_vertical.png: Added.
313         * platform/efl/DefaultTheme/widget/scrollbar/scrollbar_h.png: Removed.
314         * platform/efl/DefaultTheme/widget/scrollbar/scrollbar_knob_h.png: Removed.
315         * platform/efl/DefaultTheme/widget/scrollbar/scrollbar_knob_v.png: Removed.
316         * platform/efl/DefaultTheme/widget/scrollbar/scrollbar_thumb_horizontal.png: Added.
317         * platform/efl/DefaultTheme/widget/scrollbar/scrollbar_thumb_vertical.png: Added.
318         * platform/efl/DefaultTheme/widget/scrollbar/scrollbar_v.png: Removed.
319         * platform/efl/RenderThemeEfl.cpp:
320         (WebCore::toEdjeGroup):
321         (WebCore::RenderThemeEfl::paintThemePart): Added the new function to draw the scrollbar
322           using the RenderThemeEfl.
323
324         * platform/efl/RenderThemeEfl.h:
325         * platform/efl/ScrollbarEfl.cpp: Removed.
326         * platform/efl/ScrollbarEfl.h: Removed.
327         * platform/efl/ScrollbarThemeEfl.cpp: Implemented the default functions to draw the
328           scrollbar.
329         (WebCore::scrollbarMap):
330         (WebCore::ScrollbarThemeEfl::~ScrollbarThemeEfl):
331         (WebCore::ScrollbarThemeEfl::scrollbarThickness):
332         (WebCore::ScrollbarThemeEfl::hasThumb):
333         (WebCore::ScrollbarThemeEfl::backButtonRect):
334         (WebCore::ScrollbarThemeEfl::forwardButtonRect):
335         (WebCore::ScrollbarThemeEfl::trackRect):
336         (WebCore::ScrollbarThemeEfl::minimumThumbLength):
337         (WebCore::ScrollbarThemeEfl::paintTrackBackground):
338         (WebCore::ScrollbarThemeEfl::paintThumb):
339         (WebCore::ScrollbarThemeEfl::registerScrollbar):
340         (WebCore::ScrollbarThemeEfl::unregisterScrollbar):
341         (WebCore::ScrollbarThemeEfl::loadThemeIfNeeded):
342         * platform/efl/ScrollbarThemeEfl.h:
343         (WebCore::ScrollbarThemeEfl::usesOverlayScrollbars):
344
345 2015-07-14  Andreas Kling  <akling@apple.com>
346
347         Don't persist history item tree for subframes across reloads.
348         <https://webkit.org/b/146937>
349         <rdar://problem/19925709>
350
351         Reviewed by Brady Eidson.
352
353         Throw away the subframe history items when reloading a page. This ensures that we
354         don't accumulate outdated frame metadata when subframes change name across page loads.
355         Since the history item tree is encoded in the UA session state and gets serialized to
356         disk, it's important that we don't let it grow unbounded.
357
358         * loader/HistoryController.cpp:
359         (WebCore::HistoryController::updateForReload):
360
361 2015-07-14  Antti Koivisto  <antti@apple.com>
362
363         REGRESSION (r177876): store.apple.com profile and cart icons are missing
364         https://bugs.webkit.org/show_bug.cgi?id=146894
365
366         Reviewed by Myles C. Maxfield.
367
368         If we had several @font-face rules for the same face covering overlapping ranges we
369         would only try to get glyphs from the first one. If it didn't have the glyph we wouldn't
370         try the other ones.
371
372         Test: fast/css/font-face-multiple-missing-glyphs.html
373
374         * platform/graphics/FontCascadeFonts.cpp:
375         (WebCore::FontCascadeFonts::glyphDataForVariant):
376         (WebCore::FontCascadeFonts::glyphDataForNormalVariant):
377
378             Get GlyphData with one call.
379
380         * platform/graphics/FontRanges.cpp:
381         (WebCore::FontRanges::~FontRanges):
382         (WebCore::FontRanges::glyphDataForCharacter):
383
384             Check that we actually have a glyph in the font for the character before returning it.
385
386         (WebCore::FontRanges::fontForCharacter):
387         (WebCore::FontRanges::fontForFirstRange):
388         * platform/graphics/FontRanges.h:
389         (WebCore::FontRanges::size):
390         (WebCore::FontRanges::rangeAt):
391
392 2015-07-14  Wenson Hsieh  <wenson_hsieh@apple.com>
393
394         Fix the 32 bit build after r186817
395         https://bugs.webkit.org/show_bug.cgi?id=146947
396
397         Changed CGRect to NSRect.
398
399         Reviewed by Simon Fraser.
400
401         * platform/mac/ThemeMac.mm:
402         (WebCore::paintButton):
403
404 2015-07-14  Anders Carlsson  <andersca@apple.com>
405
406         Remove wkPopupMenu from WebCoreSystemInterface; it's not called from WebCore
407         https://bugs.webkit.org/show_bug.cgi?id=146945
408
409         Reviewed by Tim Horton.
410
411         * platform/mac/WebCoreSystemInterface.h:
412
413 2015-07-14  Wenson Hsieh  <wenson_hsieh@apple.com>
414
415         Input buttons rendered at the wrong size when pinching-to-zoom
416         https://bugs.webkit.org/show_bug.cgi?id=146916
417
418         Reviewed by Dean Jackson.
419
420         Scales buttons and their focus rects up when pinching to zoom by painting to an offscreen ImageBuffer which is
421         then scaled and painted onto the display.
422
423         * platform/Theme.h: Modified signature of Theme::paint.
424         (WebCore::Theme::paint): Added plumbing necessary to send the device and page scale factors to paintButton.
425         * platform/mac/ThemeMac.h: Modified signature of paintButton.
426         * platform/mac/ThemeMac.mm: Added ImageBuffer.h header.
427         (WebCore::buttonFocusRectOutlineWidth): Represents the width of the focus rect of a button. Used by paintButton
428             to determine the size of the ImageBuffer required to draw a focus rect.
429         (WebCore::paintButton): Changed to paint button cells and the focus rect, if applicable, to a temporary ImageBuffer
430             before painting the ImageBuffer onto the view. Refactored to receive a deviceScaleFactor and page scale factor,
431             used when painting to the ImageBuffer.
432         (WebCore::ThemeMac::paint): Added plumbing necessary to send the device and page scale factors to paintButton.
433         * rendering/RenderTheme.cpp: Modified signature of RenderTheme::paint.
434         (WebCore::RenderTheme::paint): Added plumbing necessary to send the device and page scale factors to paintButton.
435
436 2015-07-14  Commit Queue  <commit-queue@webkit.org>
437
438         Unreviewed, rolling out r186809.
439         https://bugs.webkit.org/show_bug.cgi?id=146943
440
441         Caused about 190 layout test failures. (Requested by mlam_ on
442         #webkit).
443
444         Reverted changeset:
445
446         "REGRESSION (r177876): store.apple.com profile and cart icons
447         are missing"
448         https://bugs.webkit.org/show_bug.cgi?id=146894
449         http://trac.webkit.org/changeset/186809
450
451 2015-07-14  Antti Koivisto  <antti@apple.com>
452
453         REGRESSION (r177876): store.apple.com profile and cart icons are missing
454         https://bugs.webkit.org/show_bug.cgi?id=146894
455
456         Reviewed by Myles C. Maxfield.
457
458         If we had several @font-face rules for the same face covering overlapping ranges we
459         would only try to get glyphs from the first one. If it didn't have the glyph we wouldn't
460         try the other ones.
461
462         Test: fast/css/font-face-multiple-missing-glyphs.html
463
464         * platform/graphics/FontCascadeFonts.cpp:
465         (WebCore::FontCascadeFonts::glyphDataForVariant):
466         (WebCore::FontCascadeFonts::glyphDataForNormalVariant):
467
468             Get GlyphData with one call.
469
470         * platform/graphics/FontRanges.cpp:
471         (WebCore::FontRanges::~FontRanges):
472         (WebCore::FontRanges::glyphDataForCharacter):
473
474             Check that we actually have a glyph in the font for the character before returning it.
475
476         (WebCore::FontRanges::fontForCharacter):
477         (WebCore::FontRanges::fontForFirstRange):
478         * platform/graphics/FontRanges.h:
479         (WebCore::FontRanges::size):
480         (WebCore::FontRanges::rangeAt):
481
482 2015-07-14  Alex Christensen  <achristensen@webkit.org>
483
484         [Content Extensions] Fix if-domain and unless-domain when loading main documents.
485         https://bugs.webkit.org/show_bug.cgi?id=146868
486
487         Reviewed by Benjamin Poulain.
488
489         Tests: http/tests/contentextensions/block-everything-if-domain.html
490                http/tests/contentextensions/block-everything-unless-domain-iframe.html
491                http/tests/contentextensions/block-everything-unless-domain-redirect.php
492                http/tests/contentextensions/block-everything-unless-domain.html
493
494         * contentextensions/ContentExtensionsBackend.cpp:
495         (WebCore::ContentExtensions::ContentExtensionsBackend::processContentExtensionRulesForLoad):
496         If we are loading a new main document, use that main document url as the main document url for domain comparison.
497
498 2015-07-05  Sam Weinig  <sam@webkit.org>
499
500         DOM4: prepend, append, before, after & replace
501         https://bugs.webkit.org/show_bug.cgi?id=74648
502
503         Reviewed by Darin Adler.
504
505         - Adds support for ChildNode.before/after/replaceWith and ParentNode.prepend/append
506           which are new functions in https://dom.spec.whatwg.org
507         - Uses custom bindings rather than implementing support for union types in the code
508           generator as their uses seems isolated to just this spec at the moment. If more
509           uses come along, we should implement proper support for them in the generator and
510           remove the custom bindings added here.
511
512         Tests: fast/dom/ChildNode-after.html
513                fast/dom/ChildNode-before.html
514                fast/dom/ChildNode-replaceWith.html
515                fast/dom/ParentNode-append.html
516                fast/dom/ParentNode-prepend.html
517
518         * CMakeLists.txt:
519         * WebCore.vcxproj/WebCore.vcxproj:
520         * WebCore.xcodeproj/project.pbxproj:
521         * bindings/js/JSBindingsAllInOne.cpp:
522         Add new files.
523
524         * bindings/js/JSCharacterDataCustom.cpp: Added.
525         (WebCore::JSCharacterData::before):
526         (WebCore::JSCharacterData::after):
527         (WebCore::JSCharacterData::replaceWith):
528         * bindings/js/JSDocumentCustom.cpp:
529         (WebCore::JSDocument::prepend):
530         (WebCore::JSDocument::append):
531         (WebCore::JSDocument::createTouchList):
532         * bindings/js/JSDocumentFragmentCustom.cpp: Added.
533         (WebCore::JSDocumentFragment::prepend):
534         (WebCore::JSDocumentFragment::append):
535         * bindings/js/JSDocumentTypeCustom.cpp: Added.
536         (WebCore::JSDocumentType::before):
537         (WebCore::JSDocumentType::after):
538         (WebCore::JSDocumentType::replaceWith):
539         * bindings/js/JSElementCustom.cpp:
540         (WebCore::toJSNewlyCreated):
541         (WebCore::JSElement::before):
542         (WebCore::JSElement::after):
543         (WebCore::JSElement::replaceWith):
544         (WebCore::JSElement::prepend):
545         (WebCore::JSElement::append):
546         Add custom bindings to implement the use of variadic union types.
547
548         * bindings/js/JSNodeOrString.cpp: Added.
549         (WebCore::toNodeOrStringVector):
550         * bindings/js/JSNodeOrString.h: Added.
551         Adds a help function for converting an JS argument list into a Vector
552         of NodeOrString objects.
553
554         * dom/ChildNode.idl:
555         Expose before/after/replaceWith to JavaScript.
556
557         * dom/ContainerNode.cpp:
558         (WebCore::ContainerNode::append):
559         (WebCore::ContainerNode::prepend):
560         * dom/ContainerNode.h:
561         Add implementations of append and prepend.
562
563         * dom/Node.h:
564         * dom/Node.cpp:
565         (WebCore::nodeSetPreTransformedFromNodeOrStringVector):
566         (WebCore::firstPrecedingSiblingNotInNodeSet):
567         (WebCore::firstFollowingSiblingNotInNodeSet):
568         Helper functions for before, after and removeWith.
569
570         (WebCore::Node::before):
571         (WebCore::Node::after):
572         (WebCore::Node::replaceWith):
573         Add implementations of before, after and removeWith.
574
575         * dom/NodeOrString.cpp: Added.
576         (WebCore::convertNodesOrStringsIntoNode):
577         * dom/NodeOrString.h: Added.
578         (WebCore::NodeOrString::NodeOrString):
579         (WebCore::NodeOrString::~NodeOrString):
580         (WebCore::NodeOrString::type):
581         (WebCore::NodeOrString::node):
582         (WebCore::NodeOrString::string):
583         Custom union type representing the (Node or DOMString) IDL type.
584
585         * dom/ParentNode.idl:
586         Expose append/prepend to JavaScript.
587
588 2015-07-13  Brent Fulgham  <bfulgham@apple.com>
589
590         [Win] Unreviewed build fix.
591
592         * platform/graphics/avfoundation/cf/InbandTextTrackPrivateAVCF.cpp:
593         (WebCore::InbandTextTrackPrivateAVCF::readNativeSampleBuffer): Don't try to build
594         the new Legible Output API features if they aren't available in the build
595         environment.
596
597 2015-07-13  Brent Fulgham  <bfulgham@apple.com>
598
599         [Win] Update Media Player logic for new Legible Output API
600         https://bugs.webkit.org/show_bug.cgi?id=146922
601         <rdar://problem/20542574>
602
603         Reviewed by Eric Carlson.
604
605         * AVFoundationSupport.py: Check for updated AVFCF feature.
606         * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
607         (WebCore::InbandTextTrackPrivateAVF::processNativeSamples): Update to call the
608         new 'readNativeSampleBuffer' method.
609         (WebCore::InbandTextTrackPrivateAVF::readNativeSampleBuffer): Added. This is a no-op
610         on Windows if it has the new AVCF API. Otherwise, it contains the same implementation
611         that has always been used in 'processNativeSamples'.
612         * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.h:
613         * platform/graphics/avfoundation/cf/InbandTextTrackPrivateAVCF.cpp:
614         (WebCore::InbandTextTrackPrivateAVCF::readNativeSampleBuffer): Added. Use the new
615         Legible Output API instead of the old CoreMedia solution if it is available.
616         * platform/graphics/avfoundation/cf/InbandTextTrackPrivateAVCF.h:
617         (WebCore::InbandTextTrackPrivateAVCF::mediaSelectionOption):
618         * platform/graphics/avfoundation/cf/InbandTextTrackPrivateLegacyAVCF.cpp:
619         (WebCore::InbandTextTrackPrivateLegacyAVCF::readNativeSampleBuffer): Add a stub implementation.
620         * platform/graphics/avfoundation/cf/InbandTextTrackPrivateLegacyAVCF.h:
621         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
622         (WebCore::AVFWrapper::createPlayerItem): Use the new Legible Output API if it is available.
623
624 2015-07-13  Matt Rajca  <mrajca@apple.com>
625
626         Media Session: add plumbing for delivering start/end-of-interruption events
627         https://bugs.webkit.org/show_bug.cgi?id=146837
628
629         Reviewed by Tim Horton.
630
631         * Modules/mediasession/MediaSessionEvents.h: Renamed from MediaEventTypes.h and added new constants for
632           interruption events.
633         * WebCore.xcodeproj/project.pbxproj: Renamed MediaEventTypes.h.
634         * page/Page.h: Added stub.
635         * page/Page.cpp: Added stub.
636
637 2015-07-13  Simon Fraser  <simon.fraser@apple.com>
638
639         [iOS WK2] When choosing an initial viewport scale, take overflow on the <body> into account
640         https://bugs.webkit.org/show_bug.cgi?id=146918
641         rdar://problem/9222837
642
643         Reviewed by Tim Horton.
644
645         Use as input to the viewport scaling algorithm a contents size from the FrameView
646         that takes overflow on the viewport renderer into account. This prevents unexpected
647         viewports scaling on pages that have content that overflows their expressed contents size,
648         but apply overflow to the <body>.
649
650         * page/FrameView.cpp:
651         (WebCore::FrameView::contentsSizeRespectingOverflow): Look for overflow:hidden on each axis of
652         the m_viewportRenderer, which is computed post-layout by calculateScrollbarModesForLayout()
653         and is used for scrollbar logic on OS X. Clip unscaledDocumentRect on each axis, and then
654         apply page scale.
655         * page/FrameView.h:
656
657 2015-07-13  Brent Fulgham  <bfulgham@apple.com>
658
659         Update WebCore Features.json
660         https://bugs.webkit.org/show_bug.cgi?id=146914
661
662         Reviewed by Benjamin Poulain.
663
664         * features.json: Update with notes for CSS Scroll Snap Points, Filter Effects,
665         backdrop-filters, and initial-letter.
666
667 2015-07-13  Matthew Daiter  <mdaiter@apple.com>
668
669         Change MediaPlayer Media Stream method signatures to use references
670         https://bugs.webkit.org/show_bug.cgi?id=146839
671         <rdar://problem/21769035>
672
673         Reviewed by Darin Adler.
674
675         * platform/graphics/MediaPlayer.cpp:
676         (WebCore::MediaPlayer::loadWithNextMediaEngine):
677         * platform/graphics/MediaPlayerPrivate.h: Changed to references
678         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
679         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
680         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
681         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::load): Ditto
682         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
683         (WebCore::MediaPlayerPrivateGStreamer::load): Ditto
684         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
685         * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
686         * platform/mock/mediasource/MockMediaPlayerMediaSource.h:
687
688 2015-07-13  Carlos Alberto Lopez Perez  <clopez@igalia.com>
689
690         GTK] Build race with -DENABLE_WAYLAND_TARGET=ON
691         https://bugs.webkit.org/show_bug.cgi?id=146740
692
693         Reviewed by Martin Robinson.
694
695         No new tests, no behavior changes.
696
697         * PlatformGTK.cmake: platform/graphics/wayland sources should be
698         included into WebCore source list instead of WebCorePlatformGTK.
699         Also move the add_custom_command() block into if(ENABLE_WAYLAND_TARGET),
700         this is not strictly needed to fix this bug, but it seems cleaner.
701
702 2015-07-13  Matthew Daiter  <mdaiter@apple.com>
703
704         Adding MediaStream Engine building blocks to the code repo
705         https://bugs.webkit.org/show_bug.cgi?id=146789
706         <rdar://problem/21747025>
707
708         Reviewed by Brent Fulgham.
709
710         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h: Added.
711         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setLoadingProgresssed):
712         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setHasAvailableVideoFrame):
713         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::createWeakPtr):
714         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm: Added.
715         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::MediaPlayerPrivateMediaStreamAVFObjC):
716         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::~MediaPlayerPrivateMediaStreamAVFObjC):
717         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::registerMediaEngine):
718         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::isAvailable):
719         (WebCore::mimeTypeCache):
720         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::getSupportedTypes):
721         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::supportsType):
722         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::load):
723         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::cancelLoad):
724         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::prepareToPlay):
725         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::platformMedia):
726         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::platformLayer):
727         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::play):
728         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::playInternal):
729         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::pause):
730         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::pauseInternal):
731         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::paused):
732         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setVolume):
733         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::supportsScanning):
734         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setMuted):
735         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::naturalSize):
736         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::hasVideo):
737         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::hasAudio):
738         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setVisible):
739         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::durationMediaTime):
740         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::seeking):
741         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setRateDouble):
742         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setPreservesPitch):
743         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::networkState):
744         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::readyState):
745         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::seekable):
746         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::maxMediaTimeSeekable):
747         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::minMediaTimeSeekable):
748         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::buffered):
749         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::didLoadingProgress):
750         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setSize):
751         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::hasAvailableVideoFrame):
752         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::supportsAcceleratedRendering):
753         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::movieLoadType):
754         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::prepareForRendering):
755         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::engineDescription):
756         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::languageOfPrimaryAudioTrack):
757         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::shouldBePlaying):
758         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::addDisplayLayer):
759         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::removeDisplayLayer):
760         * platform/graphics/avfoundation/objc/MediaStreamPrivateAVFObjC.h: Added.
761         * platform/graphics/avfoundation/objc/MediaStreamPrivateAVFObjC.mm: Added.
762         (WebCore::MediaStreamPrivateAVFObjC::create):
763         (WebCore::MediaStreamPrivateAVFObjC::MediaStreamPrivateAVFObjC):
764         (WebCore::MediaStreamPrivateAVFObjC::~MediaStreamPrivateAVFObjC):
765         (WebCore::MediaStreamPrivateAVFObjC::duration):
766         (WebCore::MediaStreamPrivateAVFObjC::buffered):
767         (WebCore::MediaStreamPrivateAVFObjC::readyState):
768         (WebCore::MediaStreamPrivateAVFObjC::hasAudio):
769         (WebCore::MediaStreamPrivateAVFObjC::hasVideo):
770         (WebCore::MediaStreamPrivateAVFObjC::naturalSize):
771         * platform/mediastream/MediaStreamPrivate.h: 
772         (WebCore::MediaStreamPrivate::MediaStreamPrivate): Added constructor.
773
774 2015-07-13  Eric Carlson  <eric.carlson@apple.com>
775
776         [iOS] Cancel AirPlay explicitly when exiting from full screen
777         https://bugs.webkit.org/show_bug.cgi?id=146902
778         <rdar://problem/20923632>
779
780         Reviewed by Brent Fulgham.
781
782         * platform/ios/WebVideoFullscreenInterfaceAVKit.h:
783         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
784         (WebVideoFullscreenInterfaceAVKit::~WebVideoFullscreenInterfaceAVKit): Call setExternalPlayback(false)
785           if playing to an external screen.
786
787 2015-07-12  Chris Fleizach  <cfleizach@apple.com>
788
789         AX: WEB: VoiceOver for iOS does not read <iframe> elements during linear (swipe) navigation.
790         https://bugs.webkit.org/show_bug.cgi?id=146861
791
792         Reviewed by Darin Adler.
793
794         AttachmentViews exist only on WK1 so we need account for both platforms.
795
796         Test: platform/ios-simulator/accessibility/iframe-access.html
797
798         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
799         (-[WebAccessibilityObjectWrapper accessibilityElementAtIndex:]):
800
801 2015-07-12  Youenn Fablet  <youenn.fablet@crf.canon.fr>
802
803         [Streams API] Templating ReadableJSStream
804         https://bugs.webkit.org/show_bug.cgi?id=146802
805
806         Reviewed by Darin Adler.
807
808         Introducing ReadableStream::clearValues to clear queued values when cancelling and going into error state.
809
810         Introducing ReadableEnqueuingStream to handle the stream queue, as a class template.
811         Specialized ReadableEnqueuingStream for the purpose of ReadableJSStream (storage of JSValue with variable size).
812
813         Updated some static functions to accept a ReadableStream in lieu of the more specialized ReadableJSStream.
814
815         Covered by existing tests.
816
817         * Modules/streams/ReadableStream.cpp:
818         (WebCore::ReadableStream::changeStateToErrored):
819         (WebCore::ReadableStream::cancelNoCheck):
820         * Modules/streams/ReadableStream.h:
821         (WebCore::ReadableEnqueuingStream::ReadableEnqueuingStream):
822         (WebCore::ReadableEnqueuingStream::enqueueChunk):
823         (WebCore::ReadableEnqueuingStream<ChunkType>::read):
824         * bindings/js/ReadableJSStream.cpp:
825         (WebCore::ReadableEnqueuingStream<ReadableJSStreamValue>::read):
826         (WebCore::ReadableEnqueuingStream<ReadableJSStreamValue>::enqueueChunk):
827         (WebCore::createPullResultFulfilledFunction):
828         (WebCore::createCancelResultFulfilledFunction):
829         (WebCore::ReadableJSStream::ReadableJSStream):
830         (WebCore::ReadableJSStream::enqueue):
831         * bindings/js/ReadableJSStream.h:
832         (WebCore::ReadableJSStreamValue::create):
833         (WebCore::ReadableEnqueuingStream<ReadableJSStreamValue>::desiredSize):
834         (WebCore::ReadableEnqueuingStream<ReadableJSStreamValue>::ReadableEnqueuingStream):
835
836 2015-07-11  Babak Shafiei  <bshafiei@apple.com>
837
838         Unreviewed build fix.
839
840         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
841         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::load):
842         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::cancelLoad):
843
844 2015-07-11  Nikita Vasilyev  <nvasilyev@apple.com>
845
846         Web Inspector: Inspector should be able to be docked to the bottom of a narrow window
847         https://bugs.webkit.org/show_bug.cgi?id=146871
848
849         Reviewed by Timothy Hatcher.
850
851         * inspector/InspectorFrontendClientLocal.cpp:
852
853 2015-07-11  Joseph Pecoraro  <pecoraro@apple.com>
854
855         Update default link action sheets for app links
856         https://bugs.webkit.org/show_bug.cgi?id=146658
857         <rdar://problem/21221902>
858
859         Reviewed by Dan Bernstein.
860
861         * English.lproj/Localizable.strings:
862         * platform/spi/ios/LaunchServicesSPI.h:
863
864 2015-07-11  Benjamin Poulain  <benjamin@webkit.org>
865
866         Fix CONTENT_EXTENSIONS_STATE_MACHINE_DEBUGGING
867         https://bugs.webkit.org/show_bug.cgi?id=146879
868
869         Reviewed by Andreas Kling.
870
871         Some of my recent changes broke CONTENT_EXTENSIONS_STATE_MACHINE_DEBUGGING :(
872
873         * contentextensions/CombinedURLFilters.cpp:
874         (WebCore::ContentExtensions::prefixTreeVertexToString):
875         (WebCore::ContentExtensions::recursivePrint):
876         (WebCore::ContentExtensions::CombinedURLFilters::print):
877         * contentextensions/ContentExtensionsDebugging.h:
878         * contentextensions/DFA.cpp:
879         (WebCore::ContentExtensions::DFA::debugPrintDot):
880
881 2015-07-10  Simon Fraser  <simon.fraser@apple.com>
882
883         [iOS WK2] Scrolling issues on horizontally scrollable RTL pages
884         https://bugs.webkit.org/show_bug.cgi?id=146872
885         rdar://problem/7569416
886
887         Reviewed by Sam Weinig.
888
889         Horizontally scrollable RTL pages in WebKit2 had a variety of issues: they had
890         a gap down the right edge, and unreachable content on the left side, focussing
891         form fields scrolled to the wrong location, and programmatic scrolls scrolled
892         to the wrong place.
893         
894         Fix by plumbing the WebCore notion of scrollOrigin through to the UI process,
895         and using it in various places. There are three main aspects to the patch:
896         
897         1. scroll origin is included in RemoteLayerTreeTransaction, and plumbed through
898            to -[WKWebView _scrollToContentOffset:] for correct programmatic scrolling,
899            including zooming to focussed form elements.
900         2. WebPageProxy::computeCustomFixedPositionRect() uses the actual documentRect()
901            rather than just conjuring up a rect with a zero origin, which makes position:fixed
902            work correctly.
903         3. _interactionViewsContainerView (which hosts tap highlights) is positioned to 
904            coincide with the origin of the documentRect (i.e. at the scroll origin, which
905            may not be top-left). This allows tap highlights to show in the correct location.
906         4. ScrollView::unobscuredContentRect() is fixed to take scroll origin into account;
907            if the returned rect is wrong, RenderLayer::hitTest() incorrectly clips the hit
908            testing area.
909
910         * platform/ios/ScrollViewIOS.mm:
911         (WebCore::ScrollView::unobscuredContentRect):
912
913 2015-07-10  Chris Dumez  <cdumez@apple.com>
914
915         [WK2] Diagnostic logging messages are causing too much IPC
916         https://bugs.webkit.org/show_bug.cgi?id=146873
917         <rdar://problem/21779205>
918
919         Reviewed by Ryosuke Niwa.
920
921         Move shouldLogAfterSampling() utility function to DiagnosticLoggingClient
922         so it can be easily reused.
923
924         * page/DiagnosticLoggingClient.h:
925         (WebCore::DiagnosticLoggingClient::shouldLogAfterSampling):
926
927 2015-07-10  Daniel Bates  <dabates@apple.com>
928
929         Cleanup: Remove default constructor for WebCore::Pair()
930         https://bugs.webkit.org/show_bug.cgi?id=146856
931         <rdar://problem/21773212>
932
933         Reviewed by Darin Adler.
934
935         Remove default constructor for WebCore::Pair() and the setters Pair::set{First, Second}()
936         since they are not used and it seems weird to keep the latter after the removal of the former.
937         Should it turn out that we find a use for having a default constructor and/or setters then
938         we can revert this change.
939
940         * css/Pair.h:
941         (WebCore::Pair::create): Deleted.
942         (WebCore::Pair::setFirst): Deleted.
943         (WebCore::Pair::setSecond): Deleted.
944         (WebCore::Pair::Pair): Deleted.
945
946 2015-07-10  Ryuan Choi  <ryuan.choi@navercorp.com>
947
948         [CoordinatedGraphics] Override primaryLayerID in CoordinatedGraphicsLayer
949         https://bugs.webkit.org/show_bug.cgi?id=146826
950
951         Reviewed by Gyuyoung Kim.
952
953         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
954         (WebCore::CoordinatedGraphicsLayer::id): Moved id as inline function.
955         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
956         (WebCore::CoordinatedGraphicsLayer::id):
957
958 2015-07-10  Matthew Daiter  <mdaiter@apple.com>
959
960         Exposing webkitMediaStream as MediaStream
961         https://bugs.webkit.org/show_bug.cgi?id=146813
962         <rdar://problem/21754383>
963
964         Reviewed by Eric Carlson.
965
966         * Modules/mediastream/MediaStream.idl: Changed interface
967         name from webkitMediaStream to MediaStream
968
969 2015-07-10  Nan Wang  <n_wang@apple.com>
970
971         Added ARIA 1.1 "cell" and "table" roles.
972         https://bugs.webkit.org/show_bug.cgi?id=146011
973         <rdar://problem/21398946>
974
975         Reviewed by Chris Fleizach.
976
977         Created a new role called GridCellRole to match the gridcell role, 
978         so the previous CellRole and TableRole will match to cell and table role.
979         Made the changes to make sure that both GridRole and TableRole have same
980         behavior, as well as the circumstance for GridCellRole and CellRole.
981
982         Test: accessibility/roles-table-and-cell.html
983
984         * accessibility/AXObjectCache.cpp:
985         (WebCore::createFromRenderer):
986         * accessibility/AccessibilityNodeObject.cpp:
987         (WebCore::AccessibilityNodeObject::supportsRequiredAttribute):
988         (WebCore::AccessibilityNodeObject::canSetSelectedAttribute):
989         * accessibility/AccessibilityObject.cpp:
990         (WebCore::initializeRoleMap):
991         * accessibility/AccessibilityObject.h:
992         * accessibility/AccessibilityRenderObject.cpp:
993         (WebCore::AccessibilityRenderObject::setSelectedRows):
994         (WebCore::AccessibilityRenderObject::inheritsPresentationalRole):
995         (WebCore::AccessibilityRenderObject::selectedChildren):
996         * accessibility/AccessibilityTable.cpp:
997         (WebCore::AccessibilityTable::roleValue):
998         * accessibility/AccessibilityTableCell.cpp:
999         (WebCore::AccessibilityTableCell::determineAccessibilityRole):
1000         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1001         (-[WebAccessibilityObjectWrapper _accessibilityTableAncestor]):
1002         (-[WebAccessibilityObjectWrapper _accessibilityTraitsFromAncestors]):
1003         (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
1004         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1005         (createAccessibilityRoleMap):
1006
1007 2015-07-10  Daniel Bates  <dabates@apple.com>
1008
1009         Serialized declaration for background-size/-webkit-mask-size should preserve identical
1010         values instead of coalescing them
1011         https://bugs.webkit.org/show_bug.cgi?id=143191
1012         <rdar://problem/21759393>
1013
1014         Reviewed by Darin Adler.
1015
1016         Inspired by Blink r157745:
1017         <http://src.chromium.org/viewvc/blink?view=revision&revision=157745>
1018         And Blink r172548:
1019         <http://src.chromium.org/viewvc/blink?view=revision&revision=172548>
1020
1021         Fixes an issue where identical values in a CSS declaration for properties background-size
1022         and -webkit-mask-size would be coalesced when serialized.
1023
1024         * css/CSSParser.cpp:
1025         (WebCore::CSSParser::parseFillSize): Modified to create a Pair object with the appropriate
1026         identical value encoding strategy. We only coalesce identical values when serializing the
1027         declaration of property -webkit-background-size.
1028         * css/Pair.h:
1029         (WebCore::Pair::create): Added variant that takes an encoding.
1030         (WebCore::Pair::cssText): Moved implementation of Pair::generateCSSString() to here and
1031         modified to conditionally coalesce identical values during serialization.
1032         (WebCore::Pair::Pair): Added variant that takes an encoding.
1033         (WebCore::Pair::generateCSSString): Deleted; moved implementation into Pair::cssText().
1034
1035 2015-07-10  Myles C. Maxfield  <mmaxfield@apple.com>
1036
1037         Bidi-Isolate inlines break layout with collapsed whitespace
1038         https://bugs.webkit.org/show_bug.cgi?id=109624
1039         <rdar://problem/21752834>
1040
1041         Reviewed by David Hyatt.
1042
1043         This patch changes the logic in constructBidiRunsForSegment() when it encounters an
1044         isolate. It already has logic to create a BidiResolver for the isolated text;
1045         however, that logic doesn't handle setting up the MidpointState at all.
1046         Specifically, we can set the MidpointState's cursor to point to the context which
1047         we can remember from addPlaceholderRunForIsolatedInline(). This information is
1048         remembered in a HashMap in BidiResolver.
1049
1050         This patch is a partial port of Blink patch
1051         https://src.chromium.org/viewvc/blink?view=rev&revision=159203
1052
1053         Here is some explanatory text regarding how we collapse spaces:
1054
1055         Collapsing whitespace happens in a series of phases. The first phase occurs when
1056         we perform line breaking. Here, we keep track of sequences of whitespace which
1057         should be collapsed, in the form of a vector of pairs of InlineIterators. We put
1058         this knowledge into a MidpointState object.
1059
1060         Then, once we have a line, we run the bidi algorithm on the line (including the
1061         whitespace). As output, the bidi algorithm calls the BidiResolver::appendRun()
1062         callback with two InlineIterators each time it wants to create a run. Because
1063         each renderer that we create has to be owned by exactly one DOM node,
1064         BidiResolver::appendRun() iterates between its two InlineIterator arguments,
1065         calling RenderBlockFlow::appendRunsForObject() on each interstitial DOM node.
1066
1067         This is the function where whitespace collapsing happens. The MidpointState object
1068         keeps a cursor into its remembered whitespace sequences. Here, we simply make a
1069         bidi run for each region in between adjacent whitespace pairs in the MidpointState
1070         object. These bidi runs eventually get turned into leaf InlineBoxes.
1071
1072         The problem is that the BidiResolver::appendRun() callbacks don't occur in
1073         string-order, but the Midpoint InlineIterator pairs are in string-order. In
1074         particular, within a particular isolate, appendRun() gets called in string
1075         order, but callbacks that occur for inner isolates are deferred. This means that
1076         RenderBlockFlow::appendRunsForObject() gets confused when it looks for relevant
1077         whitespace to skip.
1078
1079         Test: fast/text/bidi-isolate-whitespace-collapse.html
1080
1081         * platform/text/BidiResolver.h:
1082         (WebCore::MidpointState::numMidpoints): Returning a const unsigned& is silly.
1083         (WebCore::MidpointState::currentMidpoint): Ditto.
1084         (WebCore::MidpointState::setCurrentMidpoint): The isolated MidpointState object
1085         needs to be able to set its current midpoint to point to the first one inside
1086         the isolate.
1087         (WebCore::MidpointState::decrementNumMidpoints): Renamed from "decrease"
1088         (WebCore::MidpointState::betweenMidpoints): This function is true iff
1089         currentMidpoint() % 2. Instead of keeping a member variable, we can just compute
1090         that.
1091         (WebCore::MidpointState::reset): Deleted.
1092         (WebCore::MidpointState::decreaseNumMidpoints): Deleted.
1093         (WebCore::MidpointState::setBetweenMidpoints): Deleted.
1094         * rendering/InlineIterator.h:
1095         (WebCore::IsolateTracker::addFakeRunIfNecessary): Call
1096         RenderBlockFlow::appendRunsForObject() to keep our MidpointState object in sync
1097         when we pop out of the isolated object. However, we pass in a null run list,
1098         because we don't want to append just yet (that happens when we process the
1099         isolate).
1100         (WebCore::InlineBidiResolver::appendRun): Update for new signature of
1101         appendRunsForObject().
1102         * rendering/RenderBlock.h:
1103         (WebCore::RenderBlock::shouldSkipCreatingRunsForObject): Take a reference instead
1104         of a pointer.
1105         * rendering/RenderBlockFlow.h:
1106         * rendering/RenderBlockLineLayout.cpp:
1107         (WebCore::createRun): Ditto.
1108         (WebCore::RenderBlockFlow::appendRunsForObject): Allow someone passing us a null
1109         BidiRunList. In this case, we will keep the resolver's midpointState() up to date,
1110         but won't actually emit any runs.
1111         (WebCore::notifyResolverToResumeInIsolate): Renamed from setUp.
1112         (WebCore::isolatedResolversMidpointState): Calculate the midpoint state for the
1113         isolated resolver.
1114         (WebCore::setUpResolverToResumeInIsolate): Call isolatedResolversMidpointState().
1115         (WebCore::constructBidiRunsForSegment): Pass in the topResolver, which is
1116         necessary for isolatedResolversMidpointState().
1117         * rendering/line/BreakingContext.h:
1118         (WebCore::checkMidpoints):
1119
1120 2015-07-10  Daniel Bates  <dabates@apple.com>
1121
1122         Cleanup: WebCore::Pair class should use RefPtr&& instead of PassRefPtr
1123         https://bugs.webkit.org/show_bug.cgi?id=146852
1124
1125         Reviewed by Anders Carlsson.
1126
1127         * css/CSSParser.cpp:
1128         (WebCore::createPrimitiveValuePair): Write using a variadic template that forwards its
1129         arguments to the appropriate Pair::create constructor.
1130         (WebCore::CSSParser::parse4ValuesFillPosition): Use RefPtr&& instead of PassRefPtr. 
1131         (WebCore::CSSParser::parse3ValuesFillPosition): Ditto.
1132         (WebCore::CSSParser::parseFillPosition): Use WTF::move() instead of RefPtr::release()
1133         so that we pass a rvalue reference to RefPtr.
1134         (WebCore::CSSParser::parseFillSize): Ditto.
1135         (WebCore::CSSParser::parseBorderImageRepeat): Ditto.
1136         * css/CSSParser.h:
1137         * css/Pair.h:
1138         (WebCore::Pair::create): Use RefPtr&& instead of PassRefPtr. 
1139         (WebCore::Pair::setFirst): Ditto.
1140         (WebCore::Pair::setSecond): Ditto.
1141         (WebCore::Pair::Pair): Ditto. Also substitute nullptr for 0 in the member initialization
1142         list of the default constructor.
1143
1144 2015-07-10  Zalan Bujtas  <zalan@apple.com>
1145
1146         Crash at WebCore::WebPage::innerFrameQuad.
1147         https://bugs.webkit.org/show_bug.cgi?id=146843
1148         rdar://problem/21501819
1149
1150         Reviewed by Andreas Kling.
1151
1152         We may end up with a null rootEditableElement() after calling Document::updateLayout().
1153
1154         Speculative fix. Not reproducible.
1155
1156         * page/Frame.cpp: Some const cleanup.
1157         (WebCore::Frame::visiblePositionForPoint):
1158         * page/Frame.h:
1159
1160 2015-07-10  Brady Eidson  <beidson@apple.com>
1161
1162         Crash in HistoryController::updateForCommit dereferencing a null HistoryItem.
1163         <rdar://problem/21371589> and https://bugs.webkit.org/show_bug.cgi?id=146842
1164
1165         Reviewed by Chris Dumez.
1166
1167         No new tests (Unknown how to reproduce).
1168         
1169         This patch basically rolls back part of http://trac.webkit.org/changeset/179472.
1170         
1171         r179472 changed HistoryController::setCurrentItem() to take a reference instead of a pointer.
1172         Unfortunately, we sometimes call setCurrentItem(nullptr).
1173         
1174         We'd like to *not* do that, and there are assertions in place to try to catch when we do,
1175         but in the meantime it is not valid to dereference nullptr.
1176
1177         * loader/FrameLoader.cpp:
1178         (WebCore::FrameLoader::loadSameDocumentItem):
1179         
1180         * loader/HistoryController.cpp:
1181         (WebCore::HistoryController::updateForCommit):
1182         (WebCore::HistoryController::recursiveUpdateForCommit):
1183         (WebCore::HistoryController::recursiveUpdateForSameDocumentNavigation):
1184         (WebCore::HistoryController::setCurrentItem): Take a ptr instead of a ref.
1185         (WebCore::HistoryController::createItem):
1186         * loader/HistoryController.h:
1187
1188 2015-07-10  Javier Fernandez  <jfernandez@igalia.com>
1189
1190         [CSS Grid Layout] Grid item's auto-margins are not applied correctly
1191         https://bugs.webkit.org/show_bug.cgi?id=146581
1192
1193         Reviewed by Darin Adler.
1194
1195         Grid Layout specification states that auto-margins must prevent to apply
1196         any Box Alignment property in that dimension. Instead, auto-margin is
1197         applied as described in the spec.
1198
1199         http://dev.w3.org/csswg/css-grid/#auto-margins
1200
1201         Only Flexbox and Grid Layout implement vertical auto-margin alignment;
1202         for other layout modes, auto-margin should compute as 0.
1203
1204         Tests: fast/css-grid-layout/grid-item-auto-margins-alignment-vertical-lr.html
1205                fast/css-grid-layout/grid-item-auto-margins-alignment-vertical-rl.html
1206                fast/css-grid-layout/grid-item-auto-margins-alignment.html
1207
1208         * rendering/RenderBox.cpp:
1209         (WebCore::RenderBox::styleDidChange):
1210         (WebCore::RenderBox::updateGridAlignmentAfterStyleChange):
1211         * rendering/RenderBox.h:
1212         * rendering/RenderGrid.cpp:
1213         (WebCore::RenderGrid::layoutGridItems):
1214         (WebCore::RenderGrid::hasAutoMarginsInColumnAxis):
1215         (WebCore::RenderGrid::hasAutoMarginsInRowAxis):
1216         (WebCore::RenderGrid::updateAutoMarginsInColumnAxisIfNeeded):
1217         (WebCore::RenderGrid::rowPositionForChild):
1218         (WebCore::RenderGrid::columnPositionForChild):
1219         * rendering/RenderGrid.h:
1220
1221 2015-07-10  Csaba Osztrogonác  <ossy@webkit.org>
1222
1223         Fix overloaded virtual function warning in ScrollbarThemeGtk.h
1224         https://bugs.webkit.org/show_bug.cgi?id=145920
1225
1226         Reviewed by Darin Adler.
1227
1228         * platform/gtk/ScrollbarThemeGtk.h:
1229
1230 2015-07-10  Chris Fleizach  <cfleizach@apple.com>
1231
1232         AX: <details> element should allow expand/close through AX API
1233         https://bugs.webkit.org/show_bug.cgi?id=146549
1234
1235         Apply review comments from Daniel Bates.
1236
1237         * accessibility/AccessibilityNodeObject.cpp:
1238         (WebCore::AccessibilityNodeObject::setIsExpanded):
1239
1240 2015-07-10  Brady Eidson  <beidson@apple.com>
1241
1242         ASSERT restoring from page cache as DocumentLoader reattaches to its Frame.
1243         <rdar://problem/21766282> and https://bugs.webkit.org/show_bug.cgi?id=146786
1244
1245         Reviewed by NOBODY (Fixing obvious boneheaded mistake in r186642)
1246
1247         No new tests (Covered by existing)
1248
1249         * loader/DocumentLoader.cpp:
1250         (WebCore::DocumentLoader::attachToFrame): Bail if reattaching to the current Frame,
1251           which happens when restoring from the page cache.
1252
1253 2015-07-09  Zalan Bujtas  <zalan@apple.com>
1254
1255         Plugin create can end up destroying its renderer.
1256         https://bugs.webkit.org/show_bug.cgi?id=146824
1257         rdar://problem/18921429
1258
1259         Reviewed by Andreas Kling.
1260
1261         Plugins can run arbitrary code during initialization. If the plugin
1262         happens to destroy the associated node, its renderer becomes invalid.
1263         This patch checks whether the renderer survived the createPlugin() call.
1264         (This WeakPtr pattern is also used in RenderWidget to avoid dangling pointers.)
1265
1266         Speculative fix. Not reproducible.
1267
1268         * loader/SubframeLoader.cpp:
1269         (WebCore::SubframeLoader::loadPlugin):
1270
1271 2015-07-09  Dan Bernstein  <mitz@apple.com>
1272
1273         WebCore part of Track and expose policies for external URL schemes and App Links separately
1274         https://bugs.webkit.org/show_bug.cgi?id=146822
1275
1276         Reviewed by Anders Carlsson.
1277
1278         * loader/FrameLoaderTypes.h: Added ShouldOpenExternalURLsPolicy::ShouldAllowExternalSchemes,
1279         meaning external schemes are allowed but App Links are not. The opposite state doesn’t
1280         exist.
1281
1282         * page/ContextMenuController.cpp:
1283         (WebCore::ContextMenuController::contextMenuItemSelected): Opening a link in a new window
1284         or in the current window should never open it as an App Link.
1285
1286 2015-07-09  Daniel Bates  <dabates@apple.com>
1287
1288         Fetching Content Security Policy report URL should respect same origin policy
1289         https://bugs.webkit.org/show_bug.cgi?id=146754
1290         <rdar://problem/18860259>
1291
1292         Reviewed by Brady Eidson.
1293
1294         Inspired by Blink r149791 (by Mike West <mkwst@chromium.org>):
1295         <https://src.chromium.org/viewvc/blink?revision=149791&view=revision>
1296
1297         As per <http://www.w3.org/TR/2015/CR-CSP2-20150219/#send-violation-reports>, fetching the
1298         Content Security Policy report URL should include cookies if and only if the origin of
1299         the protected resource is equal to the origin of the report URL.
1300
1301         Tests: http/tests/security/contentSecurityPolicy/report-cross-origin-no-cookies-when-private-browsing-enabled.html
1302                http/tests/security/contentSecurityPolicy/report-cross-origin-no-cookies-when-private-browsing-toggled.html
1303                http/tests/security/contentSecurityPolicy/report-cross-origin-no-cookies.html
1304                http/tests/security/contentSecurityPolicy/report-same-origin-no-cookies-when-private-browsing-toggled.html
1305                http/tests/security/contentSecurityPolicy/report-same-origin-with-cookies-when-private-browsing-enabled.html
1306                http/tests/security/contentSecurityPolicy/report-same-origin-with-cookies.html
1307
1308         * loader/PingLoader.cpp:
1309         (WebCore::PingLoader::sendViolationReport):
1310
1311 2015-07-09  Timothy Horton  <timothy_horton@apple.com>
1312
1313         Use CoreAnimation fences instead of synchronous IPC to synchronize resize
1314         https://bugs.webkit.org/show_bug.cgi?id=146294
1315         <rdar://problem/21090193>
1316
1317         Reviewed by Anders Carlsson.
1318
1319         * platform/cocoa/MachSendRight.h:
1320         Export some constructors.
1321
1322         * platform/spi/cocoa/QuartzCoreSPI.h:
1323         Add some SPI.
1324
1325 2015-07-09  Brady Eidson  <beidson@apple.com>
1326
1327         Followup to r186647
1328
1329         Reviewed by NOBODY.
1330
1331         Thanks, EWS and commit-queue, for not catching this!
1332
1333         * loader/DocumentLoader.h: Add a semi-colon.
1334
1335 2015-07-09  Dean Jackson  <dino@apple.com>
1336
1337         REGRESSION: Inline media scrubbing always pauses the video
1338         https://bugs.webkit.org/show_bug.cgi?id=146819
1339         <rdar://problem/21572027>
1340
1341         Reviewed by Eric Carlson. Joseph Pecoraro also was really
1342         helpful in diagnosing the problem.
1343
1344         When we moved some code from a getter/setter in the child
1345         class to the base class, it was no longer being called due
1346         to the bad way we were implementing inheritance. The solution
1347         was to have the child class explicitly call into the base
1348         class.
1349
1350         The much better solution would have been to rewrite everything
1351         to use ES6 classes or, as a smaller change, assign the __proto__
1352         directly on the child prototype. But I felt that was a bit
1353         too risky at this point.
1354
1355         * Modules/mediacontrols/mediaControlsApple.js:
1356         (Controller.prototype.extend): Describe in a comment why the extend function
1357         is not suitable.
1358         * Modules/mediacontrols/mediaControlsiOS.js: Add a getter/setter for
1359         scrubbing that calls into the base Controller.
1360
1361 2015-07-09  Chris Fleizach  <cfleizach@apple.com>
1362
1363         AX: <details> element should allow expand/close through AX API
1364         https://bugs.webkit.org/show_bug.cgi?id=146549
1365
1366         Reviewed by Mario Sanchez Prada.
1367
1368         Forgot this file with the original commit.
1369
1370         * html/HTMLDetailsElement.cpp:
1371         (WebCore::HTMLDetailsElement::toggleOpen):
1372
1373 2015-07-09  Alex Christensen  <achristensen@webkit.org>
1374
1375         [Content Extensions] Add 3 byte jump size.
1376         https://bugs.webkit.org/show_bug.cgi?id=146425
1377
1378         Reviewed by Darin Adler.
1379
1380         * contentextensions/DFABytecode.h:
1381         (WebCore::ContentExtensions::smallestPossibleJumpSize):
1382         * contentextensions/DFABytecodeCompiler.cpp:
1383         (WebCore::ContentExtensions::appendZeroes):
1384         (WebCore::ContentExtensions::DFABytecodeCompiler::compile):
1385         * contentextensions/DFABytecodeInterpreter.cpp:
1386         (WebCore::ContentExtensions::jumpSizeInBytes):
1387         (WebCore::ContentExtensions::getJumpSize):
1388         (WebCore::ContentExtensions::getJumpDistance):
1389         Added DFABytecodeJumpSize::Int24.
1390
1391 2015-07-09  Brady Eidson  <beidson@apple.com>
1392
1393         Add better ASSERTs to learn more about what is going wrong in DocumentLoader::detachFromFrame()
1394         https://bugs.webkit.org/show_bug.cgi?id=146816
1395
1396         Reviewed by Alex Christensen.
1397
1398         * loader/DocumentLoader.cpp:
1399         (WebCore::DocumentLoader::attachToFrame): Set the "has ever been attached" flag to true.
1400         (WebCore::DocumentLoader::detachFromFrame): ASSERT m_frame is non-null, but with a message 
1401           depending on the value of the "has ever been attached" flag.
1402         * loader/DocumentLoader.h:
1403
1404 2015-07-09  Brent Fulgham  <bfulgham@apple.com>
1405
1406         [Mac, iOS] The mimeTypeCache should return a reference
1407         https://bugs.webkit.org/show_bug.cgi?id=146809
1408
1409         Reviewed by Eric Carlson.
1410
1411         No new tests: No change in functionality.
1412
1413         Don't copy the mime type cache every time someone asks it a question. Return
1414         by reference instead.
1415
1416         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
1417         (WebCore::mimeTypeCache):
1418         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1419         (WebCore::mimeTypeCache):
1420         * platform/mock/mediasource/MockMediaPlayerMediaSource.cpp:
1421         (WebCore::mimeTypeCache):
1422
1423 2015-07-09  Wenson Hsieh  <whsieh@berkeley.edu>
1424
1425         Rubber banding is broken when using a Mighty Mouse
1426         https://bugs.webkit.org/show_bug.cgi?id=146693
1427
1428         Reviewed by Tim Horton.
1429
1430         Sets the "constrain content edge scrolling" flag to true by default, causing scrolling
1431         with a Mighty Mouse to not extend beyond the container's edges.
1432
1433         Test: platform/mac-wk2/tiled-drawing/scrolling/stateless-scrolling-no-rubber-band.html
1434
1435         * rendering/RenderLayer.cpp: Remove code that defaulted the flag to false.
1436         (WebCore::RenderLayer::RenderLayer): Deleted.
1437         * rendering/RenderMarquee.cpp: Added special case for marquees that allows content to scroll.
1438         (WebCore::RenderMarquee::RenderMarquee): See above.
1439
1440 2015-07-09  Brady Eidson  <beidson@apple.com>
1441
1442         DocumentLoader::detachFromFrame() is being called with no current Frame set.
1443         <rdar://problem/21293082> and https://bugs.webkit.org/show_bug.cgi?id=146786 
1444
1445         Reviewed by Sam Weinig.
1446
1447         No new tests (Unknown how to reproduce).
1448
1449         * loader/DocumentLoader.cpp:
1450         (WebCore::DocumentLoader::attachToFrame):
1451         (WebCore::DocumentLoader::detachFromFrame): Null check m_frame before dereferencing it.
1452         (WebCore::DocumentLoader::setFrame): Deleted, renamed to attachToFrame(), and take's
1453           a Frame& instead of a Frame*.
1454         * loader/DocumentLoader.h:
1455         
1456         * loader/FrameLoader.cpp:
1457         (WebCore::FrameLoader::initForSynthesizedDocument): setFrame is now attachToFrame.
1458         (WebCore::FrameLoader::setPolicyDocumentLoader): Ditto.
1459         (WebCore::FrameLoader::transitionToCommitted): Ditto.
1460
1461 2015-07-09  Matthew Daiter  <mdaiter@apple.com>
1462
1463         Expose MediaStream methods to be used in the MediaStream Engine
1464         https://bugs.webkit.org/show_bug.cgi?id=146791
1465         <rdar://problem/21747589>
1466
1467         Reviewed by Brent Fulgham.
1468
1469         * Modules/mediastream/MediaStream.cpp: 
1470         (WebCore::MediaStream::getAudioTracks): Removed const
1471         (WebCore::MediaStream::getVideoTracks): Ditto
1472         * Modules/mediastream/MediaStream.h: Needed to change functions to
1473         override
1474         * platform/mediastream/MediaStreamPrivate.h: Added certain calls to
1475         PrivateClient that exposes methods to be used in the engine
1476
1477 2015-07-09  Devin Rousso  <drousso@apple.com>
1478
1479         Web Inspector: Fix shape-highlight layout tests
1480         https://bugs.webkit.org/show_bug.cgi?id=146080
1481
1482         Reviewed by Joseph Pecoraro.
1483
1484         * inspector/InspectorOverlay.cpp:
1485         (WebCore::buildObjectForShapeOutside): Now properly returns the shape margin.
1486
1487 2015-07-09  Eric Carlson  <eric.carlson@apple.com>
1488
1489         [Mac] AirPlay to password protected AppleTV fails
1490         https://bugs.webkit.org/show_bug.cgi?id=146812
1491
1492         Reviewed by Dean Jackson.
1493
1494         * Modules/mediasession/WebMediaSessionManager.cpp:
1495         (WebCore::WebMediaSessionManager::showPlaybackTargetPicker): Initialize previouslyRequestedPicker.
1496         (WebCore::WebMediaSessionManager::clientStateDidChange): Cleanup the logic and add a comment
1497           to make it slightly easier to follow. Don't begin playing to a device unless playback
1498           has just started (don't switch in mid-play).
1499         (WebCore::WebMediaSessionManager::configurePlaybackTargetClients): Use the last client to
1500           request the device picker as a fallback in case no other client is a canditate. Add more
1501           logging to make it possible to debug the selection logic.
1502         (WebCore::WebMediaSessionManager::scheduleDelayedTask): Fiddle with the logging.
1503
1504 2015-07-09  Matthew Daiter  <mdaiter@apple.com>
1505
1506         Implementing platform-specific section of enumerateDevices
1507         https://bugs.webkit.org/show_bug.cgi?id=146461
1508         <rdar://problem/21614466>
1509
1510         Reviewed by Darin Adler.
1511
1512         * Modules/mediastream/MediaDeviceInfo.cpp: Changed access methods
1513         (WebCore::MediaDeviceInfo::audioInputType): Added AtomicString
1514         permanent refs
1515         (WebCore::MediaDeviceInfo::audioOutputType): Ditto
1516         (WebCore::MediaDeviceInfo::videoInputType): Ditto
1517         * Modules/mediastream/MediaDeviceInfo.h: Changed String refs to values
1518         (WebCore::MediaDeviceInfo::label): Ditto
1519         (WebCore::MediaDeviceInfo::deviceId): Ditto
1520         (WebCore::MediaDeviceInfo::groupId): Ditto
1521         (WebCore::MediaDeviceInfo::kind): Ditto
1522         * platform/mediastream/MediaDevicesPrivate.cpp: Implemented query for
1523         available devices
1524         (WebCore::MediaDevicesPrivate::MediaDevicesPrivate):
1525         (WebCore::MediaDevicesPrivate::create):
1526         (WebCore::MediaDevicesPrivate::availableMediaDevices):
1527         * platform/mediastream/MediaDevicesPrivate.h:
1528         (WebCore::MediaDevicesPrivate::~MediaDevicesPrivate):
1529         * WebCore.xcodeproj/project.pbxproj:
1530         * platform/mediastream/MediaStreamTrackSourcesRequestClient.h: Needed
1531         to tack on extra fields to hold data
1532         (WebCore::TrackSourceInfo::create):
1533         (WebCore::TrackSourceInfo::groupId):
1534         (WebCore::TrackSourceInfo::deviceId):
1535         (WebCore::TrackSourceInfo::TrackSourceInfo):
1536         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
1537         (WebCore::AVCaptureDeviceManager::getSourcesInfo):
1538
1539 2015-07-09  Per Arne Vollan  <peavo@outlook.com>
1540
1541         [Win] Add memory pressure handler.
1542         https://bugs.webkit.org/show_bug.cgi?id=146685
1543
1544         Reviewed by Brent Fulgham.
1545
1546         Add memory pressure handler implementation on Windows.
1547         We check the memory usage at regular intervals with a timer.
1548
1549         * WebCore.vcxproj/WebCore.vcxproj:
1550         * WebCore.vcxproj/WebCore.vcxproj.filters:
1551         * platform/MemoryPressureHandler.cpp:
1552         (WebCore::MemoryPressureHandler::releaseMemory):
1553         (WebCore::MemoryPressureHandler::install):
1554         (WebCore::MemoryPressureHandler::uninstall):
1555         (WebCore::MemoryPressureHandler::holdOff):
1556         * platform/win/MemoryPressureHandlerWin.cpp: Added.
1557         (WebCore::CheckMemoryTimer::CheckMemoryTimer):
1558         (WebCore::CheckMemoryTimer::fired):
1559         (WebCore::CheckMemoryTimer::handleMemoryLow):
1560         (WebCore::MemoryPressureHandler::platformReleaseMemory):
1561         (WebCore::memCheckTimer):
1562         (WebCore::MemoryPressureHandler::install):
1563         (WebCore::MemoryPressureHandler::uninstall):
1564         (WebCore::MemoryPressureHandler::holdOff):
1565         (WebCore::MemoryPressureHandler::respondToMemoryPressure):
1566         (WebCore::MemoryPressureHandler::ReliefLogger::platformMemoryUsage):
1567         (WebCore::MemoryPressureHandler::ReliefLogger::platformLog):
1568         * platform/win/Win32Handle.h:
1569         (WebCore::Win32Handle::operator=):
1570
1571 2015-07-09  Matthew Daiter  <mdaiter@apple.com>
1572
1573         Exposed AVVideoCaptureSource's bounds
1574         https://bugs.webkit.org/show_bug.cgi?id=146760
1575         <rdar://problem/21736772>
1576
1577         Reviewed by Brent Fulgham.
1578
1579         * platform/mediastream/mac/AVVideoCaptureSource.h:
1580         (WebCore::AVVideoCaptureSource::width): Needed access to video width
1581         (WebCore::AVVideoCaptureSource::height): Needed access to video height
1582
1583 2015-07-09  Karlen Simonyan  <szkarlen@gmail.com>
1584
1585         [WinCairo] ClearType should be enabled on Cairo port
1586         https://bugs.webkit.org/show_bug.cgi?id=145492
1587
1588         Reviewed by Brent Fulgham.
1589
1590         * platform/graphics/win/FontPlatformDataCairoWin.cpp:
1591         (WebCore::FontPlatformData::FontPlatformData):
1592         Use CAIRO_ANTIALIAS_BEST instead of CAIRO_ANTIALIAS_GRAY.
1593
1594 2015-07-02  Chris Fleizach  <cfleizach@apple.com>
1595
1596         AX: <details> element should allow expand/close through AX API
1597         https://bugs.webkit.org/show_bug.cgi?id=146549
1598
1599         Reviewed by Mario Sanchez Prada.
1600
1601         Allow AXExpanded to be writeable for <details> element, which, when set
1602         will toggle the opening and closing of the element. 
1603         Post a notification when that happens as well.
1604
1605         Modified test: platform/mac/accessibility/details-summary.html
1606
1607         * accessibility/AccessibilityNodeObject.cpp:
1608         (WebCore::AccessibilityNodeObject::hierarchicalLevel):
1609         (WebCore::AccessibilityNodeObject::setIsExpanded):
1610         (WebCore::shouldUseAccessibilityObjectInnerText):
1611         * accessibility/AccessibilityNodeObject.h:
1612         * accessibility/AccessibilityObject.cpp:
1613         (WebCore::AccessibilityObject::supportsPressAction):
1614         * accessibility/AccessibilityRenderObject.cpp:
1615         (WebCore::AccessibilityRenderObject::canSetExpandedAttribute):
1616         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1617         (-[WebAccessibilityObjectWrapper accessibilityIsAttributeSettable:]):
1618         (-[WebAccessibilityObjectWrapper _accessibilitySetValue:forAttribute:]):
1619         * html/HTMLDetailsElement.cpp:
1620         (WebCore::HTMLDetailsElement::toggleOpen):
1621
1622 2015-07-09  Alex Christensen  <achristensen@webkit.org>
1623
1624         [Content Extensions] Prevent crashes with plugins.
1625         https://bugs.webkit.org/show_bug.cgi?id=146705
1626         rdar://problem/20855444
1627
1628         Reviewed by Brady Eidson.
1629
1630         * loader/NetscapePlugInStreamLoader.cpp:
1631         (WebCore::NetscapePlugInStreamLoader::create):
1632         Call addPlugInStreamLoader in ResourceLoader::willSendRequest to always add blocked loads.
1633         * loader/NetscapePlugInStreamLoader.h:
1634         * loader/ResourceLoader.cpp:
1635         (WebCore::ResourceLoader::willSendRequest):
1636         Removed unnecessary early returns.
1637         * loader/ResourceLoader.h:
1638         (WebCore::ResourceLoader::isPlugInStreamLoader):
1639
1640 2015-07-09  Brent Fulgham  <bfulgham@apple.com>
1641
1642         [Win] Honor CACFLayer content scale factor
1643         https://bugs.webkit.org/show_bug.cgi?id=146792
1644
1645         Reviewed by Dean Jackson.
1646
1647         * AVFoundationSupport.py: Check for the CACFLayerSet/GetContentsScale
1648         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
1649         (PlatformCALayerWin::PlatformCALayerWin): Use owner's scale factor (if
1650         present).
1651         (PlatformCALayerWin::contentsScale): Use CACFLayer API if present.
1652         (PlatformCALayerWin::setContentsScale): Ditto.
1653         * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
1654         (PlatformCALayerWinInternal::PlatformCALayerWinInternal): Use owner's scale
1655         factor (if present).
1656         (PlatformCALayerWinInternal::addTile): Use tile parent's scale factor.
1657
1658 2015-07-08  Matt Rajca  <mrajca@apple.com>
1659
1660         Media Session: report to chrome client 'hasActiveMediaElements' changes
1661         https://bugs.webkit.org/show_bug.cgi?id=146745
1662
1663         Reviewed by Eric Carlson.
1664
1665         * Modules/mediasession/MediaSession.cpp: All updates to active media elements are now funneled through a helper
1666           method that will invoke the 'hasMediaSessionWithActiveMediaElementsDidChange' callback when necessary.
1667         (WebCore::MediaSession::removeMediaElement):
1668         (WebCore::MediaSession::changeActiveMediaElements):
1669         (WebCore::MediaSession::addActiveMediaElement):
1670         (WebCore::MediaSession::releaseSession):
1671         * Modules/mediasession/MediaSession.h:
1672         * Modules/mediasession/MediaSessionManager.cpp:
1673         (WebCore::MediaSessionManager::hasActiveMediaElements):
1674         * Modules/mediasession/MediaSessionManager.h:
1675
1676 2015-07-09  Darin Adler  <darin@apple.com>
1677
1678         REGRESSION (r182866): repeated prompts for password on internal Apple website using workers
1679         https://bugs.webkit.org/show_bug.cgi?id=146769
1680
1681         Reviewed by Sam Weinig.
1682
1683         Not sure how to make a regression test for this. Sure would be nice to have one though.
1684
1685         * loader/ThreadableLoader.cpp:
1686         (WebCore::ThreadableLoaderOptions::ThreadableLoaderOptions): Added. Calls through to the
1687         base class copy constructor to copy data members of the base class (the lack of this was
1688         the bug). Also initializes all the data members of this class.
1689         (WebCore::ThreadableLoaderOptions::isolatedCopy): Changed to call the constructor above.
1690
1691         * loader/ThreadableLoader.h: Added new constructor.
1692
1693 2015-07-09  Chris Fleizach  <cfleizach@apple.com>
1694
1695         AX: VoiceOver cannot get to any content in Yahoo Mail messages table
1696         https://bugs.webkit.org/show_bug.cgi?id=146674
1697
1698         Reviewed by Darin Adler.
1699
1700         A table row could have any number of parent elements in the render tree, but for the purposes
1701         of accessibility we only want to report the AXTable as the parent so that it looks like a sane
1702         data table.
1703
1704         Test: accessibility/aria-table-with-presentational-elements.html
1705
1706         * accessibility/AccessibilityARIAGridRow.cpp:
1707         (WebCore::AccessibilityARIAGridRow::disclosedByRow):
1708         (WebCore::AccessibilityARIAGridRow::parentObjectUnignored):
1709         (WebCore::AccessibilityARIAGridRow::parentTable):
1710         * accessibility/AccessibilityARIAGridRow.h:
1711
1712 2015-07-08  Sungmann Cho  <sungmann.cho@navercorp.com>
1713
1714         [GTK] The "Missing Plug-in" buttons are not showing up on some flash contents.
1715         https://bugs.webkit.org/show_bug.cgi?id=146707
1716
1717         Reviewed by Martin Robinson.
1718
1719         Currently, WebKitGTK+ doesn't show the "Missing Plug-in" buttons if the plugin-related tags
1720         don't have a "type" attribute. In such a case, WebCore tries to guess the MIME type from
1721         the extensions by using MIMETypeRegistry::getMIMETypeForExtension(). For WebKitGTK+,
1722         MIMETypeRegistry::getMIMETypeForExtension() goes through |extensionMap|, which is a simple
1723         array of <extension, mime type>, looking for the mime type for the given extension.
1724         But |extensionMap| in MIMETypeRegistryGtk.cpp doesn't have the information for ".swf",
1725         so WebCore fails to guess the MIME type and regard the content type as ObjectContentFrame,
1726         not ObjectContentNetscapePlugin.
1727
1728         * platform/gtk/MIMETypeRegistryGtk.cpp:
1729
1730 2015-07-08  Brady Eidson  <beidson@apple.com>
1731
1732         Crash calling [WebView close] in didFinishLoadForFrame callback.
1733         <rdar://problem/21690765> and https://bugs.webkit.org/show_bug.cgi?id=146773
1734
1735         Reviewed by David Kilzer.
1736
1737         Added API Test "WebViewCloseInsideDidFinishLoadForFrame"
1738
1739         * loader/FrameLoader.cpp:
1740         (WebCore::FrameLoader::checkLoadCompleteForThisFrame): After the delegate callback,
1741           don't use the local Page* variable from earlier, but instead refetch it from m_frame.
1742
1743 2015-07-08  Daniel Bates  <dabates@apple.com>
1744
1745         Cleanup: Make ContentSecurityPolicy::ReportingStatus an enum class
1746         https://bugs.webkit.org/show_bug.cgi?id=146670
1747
1748         Reviewed by Darin Adler.
1749
1750         Make calling the ContentSecurityPolicy::allow* functions less error prone by making
1751         ContentSecurityPolicy::ReportingStatus an enum class. Among other benefits this will
1752         prevent a caller from inadvertently passing an enumerator of ContentSecurityPolicy::ReportingStatus
1753         as the boolean argument overridingContentSecurityPolicy, which is taken by the various
1754         ContentSecurityPolicy::allow* functions, by causing a compile-time error (since an enum class
1755         enumerator cannot be implicitly converted to an integral type).
1756
1757         * bindings/js/ScriptController.cpp:
1758         (WebCore::ScriptController::initScript):
1759         * page/ContentSecurityPolicy.cpp:
1760         (WebCore::CSPDirectiveList::allowJavaScriptURLs):
1761         (WebCore::CSPDirectiveList::allowInlineEventHandlers):
1762         (WebCore::CSPDirectiveList::allowInlineScript):
1763         (WebCore::CSPDirectiveList::allowInlineStyle):
1764         (WebCore::CSPDirectiveList::allowEval):
1765         (WebCore::CSPDirectiveList::allowPluginType):
1766         (WebCore::CSPDirectiveList::allowScriptFromSource):
1767         (WebCore::CSPDirectiveList::allowObjectFromSource):
1768         (WebCore::CSPDirectiveList::allowChildFrameFromSource):
1769         (WebCore::CSPDirectiveList::allowImageFromSource):
1770         (WebCore::CSPDirectiveList::allowStyleFromSource):
1771         (WebCore::CSPDirectiveList::allowFontFromSource):
1772         (WebCore::CSPDirectiveList::allowMediaFromSource):
1773         (WebCore::CSPDirectiveList::allowConnectToSource):
1774         (WebCore::CSPDirectiveList::allowFormAction):
1775         (WebCore::CSPDirectiveList::allowBaseURI):
1776         (WebCore::ContentSecurityPolicy::didReceiveHeader):
1777         (WebCore::ContentSecurityPolicy::evalDisabledErrorMessage):
1778         * page/ContentSecurityPolicy.h:
1779         * page/DOMSecurityPolicy.cpp:
1780         (WebCore::DOMSecurityPolicy::allowsEval):
1781
1782 2015-07-08  Matthew Daiter  <mdaiter@apple.com>
1783
1784         Activate DOMURLMediaStream
1785         https://bugs.webkit.org/show_bug.cgi?id=146764
1786         <rdar://problem/21738101>
1787
1788         Reviewed by Eric Carlson.
1789
1790         * DerivedSources.make: Added DOMURLMediaStream.idl to list
1791         * WebCore.xcodeproj/project.pbxproj: Added DOMURLMediaStream.cpp and
1792         DOMURLMediaStream.h to compile
1793
1794 2015-07-08  Matthew Daiter  <mdaiter@apple.com>
1795
1796         Make sure MediaStream uses blob protocol
1797         https://bugs.webkit.org/show_bug.cgi?id=146752
1798         <rdar://problem/21736057>
1799
1800         Reviewed by Eric Carlson.
1801
1802         * html/HTMLMediaElement.cpp:
1803         (WebCore::HTMLMediaElement::selectNextSourceChild): Added MediaStream
1804         blob protocol
1805
1806 2015-07-08  Andreas Kling  <akling@apple.com>
1807
1808         Videos on apple.com don't show up when restored from page cache.
1809         <https://webkit.org/b/146766>
1810         <rdar://problem/21712311>
1811
1812         Reviewed by Darin Adler.
1813
1814         Break out most of HTMLMediaElement::stop() (override of ActiveDOMObject::stop(), to be clear)
1815         into a stopWithoutDestroyingMediaPlayer() function that both stop() and suspend() can call.
1816
1817         Before this change, suspend() would call stop() when moving into the page cache, killing the
1818         internal MediaPlayer object which caused the video to disappear from the page.
1819
1820         Test: LayoutTests/media/restore-from-page-cache.html (amended)
1821
1822         * html/HTMLMediaElement.cpp:
1823         (WebCore::HTMLMediaElement::stopWithoutDestroyingMediaPlayer):
1824         (WebCore::HTMLMediaElement::stop):
1825         (WebCore::HTMLMediaElement::suspend):
1826         * html/HTMLMediaElement.h:
1827
1828 2015-07-08  Matthew Daiter  <mdaiter@apple.com>
1829
1830         Make MediaStream conform to its private client like MediaSource does
1831         https://bugs.webkit.org/show_bug.cgi?id=146756
1832         <rdar://problem/21736457>
1833
1834         Reviewed by Brent Fulgham.
1835
1836         MediaStream should be inheriting its PrivateClient's getters and
1837         setters for RefCounted, not inheriting its own.
1838
1839         * Modules/mediastream/MediaStream.h: Changed MediaStream's inherit
1840         statements
1841         * platform/mediastream/MediaStreamPrivate.h: Changed
1842         MediaStreamPrivateClient to inherit RefCounted<MediaStreamPrivateClient>
1843
1844 2015-07-08  Matthew Daiter  <mdaiter@apple.com>
1845
1846         Made AVMediaCaptureSource's session accessor public
1847         https://bugs.webkit.org/show_bug.cgi?id=146758
1848         <rdar://problem/21736651>
1849
1850         Reviewed by Brent Fulgham.
1851
1852         * platform/mediastream/mac/AVMediaCaptureSource.h:
1853         (WebCore::AVMediaCaptureSource::session): Changed to public
1854
1855 2015-07-08  Matthew Daiter  <mdaiter@apple.com>
1856
1857         Make sure MediaStream engine loaded for interpreting MediaStreams
1858         https://bugs.webkit.org/show_bug.cgi?id=146748
1859         <rdar://problem/21735416>
1860
1861         Reviewed by Brent Fulgham.
1862
1863         Prevent the MediaSource engine from being used to process
1864         MediaStreams, since they are not compatible
1865
1866         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: 
1867         (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsType):
1868         Changed MediaStream to never be loaded
1869         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
1870         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1871         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsType): 
1872         Changed MediaStream to never be loaded
1873
1874
1875 2015-07-08  Benjamin Poulain  <bpoulain@apple.com>
1876
1877         [Content Extensions] Fuse undistinguishable actions as much as possible
1878         https://bugs.webkit.org/show_bug.cgi?id=146762
1879
1880         Reviewed by Alex Christensen.
1881
1882         Our previous code that fused actions was based on test lists that were
1883         grouping similar actions in the input.
1884
1885         The input we get from developers is more distributed. It is very common to
1886         have trigger flags all over the place, and "css-display-none" mixed with "block".
1887
1888         This patch refines the merging code to merge those cases as much as possible.
1889
1890         The size taken by the actions is negligible, but having different actions make
1891         nodes unkillable by the Minimizer. By merging many more actions, the minimizer
1892         no longer see those subtrees as distinguishable and can do a better job.
1893
1894         On a large test list, this cuts the bytecode size by 2 megabytes.
1895
1896         Tests: http/tests/contentextensions/css-display-none-after-ignore-previous-rules.html
1897                http/tests/contentextensions/single-css-display-none.html
1898
1899         * contentextensions/ContentExtensionCompiler.cpp:
1900         (WebCore::ContentExtensions::resolvePendingDisplayNoneActions):
1901         (WebCore::ContentExtensions::serializeActions):
1902
1903 2015-07-08  Matthew Daiter  <mdaiter@apple.com>
1904
1905         Cleared contentMIMETypes for MediaStreams
1906         https://bugs.webkit.org/show_bug.cgi?id=146750
1907         <rdar://problem/21735678>
1908
1909         Reviewed by Brent Fulgham.
1910
1911         * platform/graphics/MediaPlayer.cpp:
1912         (WebCore::MediaPlayer::load): Needed to clear contentMIMETypes
1913
1914 2015-07-08  Dean Jackson  <dino@apple.com>
1915
1916         Audio elements with controls force their enclosing stacking context to composite
1917         https://bugs.webkit.org/show_bug.cgi?id=146751
1918         <rdar://problem/21466572>
1919
1920         Reviewed by Simon Fraser.
1921
1922         There were a number of issues with audio controls, on both iOS and OS X.
1923
1924         - they used a blurry background which was not the intended design
1925         - they cause the page to composite, which causes a degradation in
1926           text rendering quality
1927         - they inserted 20px of padding above every audio element, which
1928           could break existing page designs.
1929
1930         Removing the need for compositing and blending means that the
1931         colors used for control tints need to be adjusted for the non-blended
1932         case. Wherever I could, I kept as much as possible in a shared
1933         rule and made specific changes for audio or video.
1934
1935         The controls were also unintentionally relying on the compositing
1936         to create stacking contexts and control the rendering order. Without
1937         them, I needed to add some explicit stacking.
1938
1939         I also made some drive-by whitespace clean-ups.
1940
1941         * Modules/mediacontrols/mediaControlsApple.css: Remove as much compositing
1942         as possible in audio controls.
1943
1944         * Modules/mediacontrols/mediaControlsApple.js:
1945         (Controller.prototype.drawTimelineBackground): Use specific colors for audio.
1946
1947         * Modules/mediacontrols/mediaControlsiOS.css: Remove as much need for compositing
1948         as possible.
1949
1950 2015-07-08  Said Abou-Hallawa  <sabouhallawa@apple.com>
1951
1952         Crash when appending an SVG <use> element dynamically which has animated SVG <path> element
1953         https://bugs.webkit.org/show_bug.cgi?id=146690
1954         <rdar://problem/20790376>
1955
1956         Reviewed by Dean Jackson.
1957
1958         Test: svg/animations/insert-animate-use-path-while-animation.svg
1959
1960         The crashing call stack shows that
1961         SVGAnimatedListPropertyTearOff<SVGPathSegList>::m_animVal is null when
1962         trying to access it in synchronizeWrappersIfNeeded(). This happens because
1963         animationStarted() was not called for this animatedType.
1964         
1965         SVGAnimateElementBase::resetAnimatedType() calls
1966         SVGAnimatedPathAnimator::startAnimValAnimation() at the beginning of the
1967         animation. For the target element and all its instances, this function calls
1968         SVGAnimatedPathSegListPropertyTearOff::animationStarted() which calls
1969         SVGAnimatedListPropertyTearOff<SVGPathSegList>::animationStarted(). This
1970         last function allocates the member m_animVal when calling
1971         SVGAnimatedListPropertyTearOff<SVGPathSegList>::animVal(). 
1972         
1973         When adding a new instance of the same animating target element, 
1974         SVGAnimateElementBase::resetAnimatedType() just keeps calling
1975         SVGAnimatedPathAnimator::animValDidChange() for all the instances of the
1976         targetElement without ensuring that all of them have started their
1977         animations.
1978         
1979         The fix is to make SVGAnimatedPathAnimator::resetAnimValToBaseVal() ensure
1980         that animationStarted() is called for the targetElement and all its instances.
1981
1982         * svg/SVGAnimatedPath.cpp:
1983         (WebCore::SVGAnimatedPathAnimator::startAnimValAnimation): Move resetting
1984         the animation value and starting the animatedTypes code to a new overriding
1985         function which is named resetAnimValToBaseVal().
1986         
1987         (WebCore::SVGAnimatedPathAnimator::resetAnimValToBaseVal): Call the overriding
1988         function which calls buildSVGPathByteStreamFromSVGPathSegList() as before
1989         and ensure that all the animatedTypes have started their animations.
1990         
1991         * svg/SVGAnimatedPath.h:
1992
1993 2015-07-08  Brady Eidson  <beidson@apple.com>
1994
1995         Move PingLoaders to the NetworkingProcess.
1996         <rdar://problem/18860263> and https://bugs.webkit.org/show_bug.cgi?id=146710
1997
1998         Reviewed by Tim Horton.
1999
2000         No new tests.
2001         There's no current solution for communicating back to a page that a ping load has reached its target.
2002         Until we have such a solution, any attempt at a layout test will be fragile at best.
2003
2004         * WebCore.xcodeproj/project.pbxproj:
2005         
2006         * loader/LoaderStrategy.cpp:
2007         (WebCore::LoaderStrategy::createPingHandle): Default implementation is create the PingHandle directly.
2008         * loader/LoaderStrategy.h:
2009
2010         PingLoader becomes a static class for now that crafts the ResourceRequest then passes it off
2011         to the LoaderStrategy:        
2012         * loader/PingLoader.cpp:
2013         (WebCore::PingLoader::loadImage):
2014         (WebCore::PingLoader::sendPing):
2015         (WebCore::PingLoader::sendViolationReport):
2016         (WebCore::PingLoader::startPingLoad):
2017         (WebCore::PingLoader::createPingLoader): Deleted.
2018         (WebCore::PingLoader::PingLoader): Deleted.
2019         (WebCore::PingLoader::~PingLoader): Deleted.
2020         * loader/PingLoader.h:
2021         (WebCore::PingLoader::timeoutTimerFired): Deleted.
2022
2023         PingHandle does what PingLoader used to - It's a basic ResourceHandleClient that simply waits
2024         for any response/completion/failure and then deletes itself.
2025         * platform/network/PingHandle.h: Added.
2026         (WebCore::PingHandle::PingHandle):
2027         (WebCore::PingHandle::usesAsyncCallbacks):
2028         (WebCore::PingHandle::timeoutTimerFired):
2029         (WebCore::PingHandle::~PingHandle):
2030
2031 2015-07-08  Csaba Osztrogonác  <ossy@webkit.org>
2032
2033         Add new sources to StyleAllInOne.cpp
2034         https://bugs.webkit.org/show_bug.cgi?id=146584
2035
2036         Reviewed by Brent Fulgham.
2037
2038         * WebCore.vcxproj/WebCore.vcxproj:
2039         * rendering/style/StyleAllInOne.cpp:
2040
2041 2015-07-08  Csaba Osztrogonác  <ossy@webkit.org>
2042
2043         Add new sources to DOMAllInOne.cpp
2044         https://bugs.webkit.org/show_bug.cgi?id=146587
2045
2046         Reviewed by Brent Fulgham.
2047
2048         * WebCore.vcxproj/WebCore.vcxproj:
2049         * dom/DOMAllInOne.cpp:
2050
2051 2015-07-08  Csaba Osztrogonác  <ossy@webkit.org>
2052
2053         Add new sources to AccessibilityAllInOne.cpp
2054         https://bugs.webkit.org/show_bug.cgi?id=146582
2055
2056         Reviewed by Brent Fulgham.
2057
2058         * WebCore.vcxproj/WebCore.vcxproj:
2059         * accessibility/AccessibilityAllInOne.cpp:
2060
2061 2015-07-08  Eric Carlson  <eric.carlson@apple.com>
2062
2063         [Mac] Two clicks required to enable AirPlay at youtube.com
2064         https://bugs.webkit.org/show_bug.cgi?id=146733
2065         <rdar://problem/21556356>
2066
2067         Reviewed by Brent Fulgham.
2068
2069         * Modules/mediasession/WebMediaSessionManager.cpp:
2070         (WebCore::WebMediaSessionManager::clientStateDidChange): Only log when state has changed.
2071           Don't steal the route if another client is actively playing to the device.
2072         (WebCore::WebMediaSessionManager::setPlaybackTarget): Set m_targetChanged.
2073         (WebCore::WebMediaSessionManager::configurePlaybackTargetClients): Don't consider the
2074           requestedPicker flag until after a target change.
2075         * Modules/mediasession/WebMediaSessionManager.h:
2076
2077         * html/HTMLMediaElement.cpp:
2078         (WebCore::HTMLMediaElement::webkitShowPlaybackTargetPicker): Add logging.
2079         (WebCore::HTMLMediaElement::setShouldPlayToPlaybackTarget): Ditto.
2080
2081         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2082         (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldPlayToPlaybackTarget): Always log.
2083
2084 2015-07-08  Zalan Bujtas  <zalan@apple.com>
2085
2086         Do not waste window server memory for placeholder windows initiated by ThemeMac.
2087         https://bugs.webkit.org/show_bug.cgi?id=146730
2088         rdar://problem/20321222
2089
2090         Using defer:YES prevents us from wasting any window server resources for WebCoreThemeWindow(s).
2091
2092         Patch by Darin Adler.
2093         Reviewed by Zalan Bujtas.
2094
2095         Not testable.
2096
2097         * platform/mac/ThemeMac.mm:
2098         (-[WebCoreThemeView window]):
2099
2100 2015-07-08  Xabier Rodriguez Calvar  <calvaris@igalia.com>
2101
2102         [GTK] Deactivate GObject bindings for static methods
2103         https://bugs.webkit.org/show_bug.cgi?id=146717
2104
2105         Reviewed by Carlos Garcia Campos.
2106
2107         Static methods are currently not supported by GObject bindings so we deactivate them from the generation.
2108
2109         Current tests suffice. Expectations updated.
2110
2111         * bindings/scripts/CodeGeneratorGObject.pm:
2112         (SkipFunction): Skip isStatic functions.
2113         * bindings/scripts/test/GObject/WebKitDOMTestInterface.h:
2114         * bindings/scripts/test/GObject/WebKitDOMTestInterface.cpp:
2115         (webkit_dom_test_interface_implements_method4): Deleted.
2116         (webkit_dom_test_interface_supplemental_method4): Deleted.
2117         * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
2118         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
2119         (webkit_dom_test_obj_class_method): Deleted.
2120         (webkit_dom_test_obj_class_method_with_optional): Deleted.
2121         (webkit_dom_test_obj_overloaded_method1): Deleted.
2122
2123 2015-07-07  Benjamin Poulain  <bpoulain@apple.com>
2124
2125         Remove the overflow checks from the important vectors used by the content extensions machines
2126         https://bugs.webkit.org/show_bug.cgi?id=146703
2127
2128         Reviewed by Andreas Kling.
2129
2130         Most of the overflow checks cannot be eliminated by clang. Removing them
2131         explicitly removes 400 ms from the compile time of a very large test list.
2132
2133         * contentextensions/ContentExtensionsDebugging.h:
2134         * contentextensions/DFA.h:
2135         * contentextensions/DFACombiner.cpp:
2136         * contentextensions/DFAMinimizer.cpp:
2137         * contentextensions/ImmutableNFA.h:
2138         * contentextensions/MutableRangeList.h:
2139         * contentextensions/NFAToDFA.cpp:
2140         (WebCore::ContentExtensions::epsilonClosureExcludingSelf):
2141         (WebCore::ContentExtensions::resolveEpsilonClosures):
2142         (WebCore::ContentExtensions::extendSetWithClosure):
2143         (WebCore::ContentExtensions::DataConverterWithEpsilonClosure::convert):
2144         (WebCore::ContentExtensions::DataConverterWithEpsilonClosure::extend):
2145         (WebCore::ContentExtensions::createCombinedTransition):
2146         (WebCore::ContentExtensions::getOrCreateDFANode):
2147         (WebCore::ContentExtensions::NFAToDFA::convert):
2148
2149 2015-07-07  Dean Jackson  <dino@apple.com>
2150
2151         [iOS] MediaControls: Start Play and Can't Play buttons need to be cutout and blurred
2152         https://bugs.webkit.org/show_bug.cgi?id=146226
2153
2154         Reviewed by Simon Fraser.
2155
2156         This patch takes what Said Abou-Hallawa posted in an earlier revision and
2157         makes a few tweaks to workaround the bugs he's listed.
2158
2159         Replicate the iOS System blur backdrop in pure CSS, so that the large
2160         start button looks more correct. Also add artwork for a failure state.
2161
2162         * Modules/mediacontrols/mediaControlsiOS.css: New style rules for the start
2163         button, which now is a collection of elements rather than a <button>.
2164         (video::-webkit-media-controls-start-playback-button):
2165         (video::-webkit-media-controls-start-playback-background):
2166         (video::-webkit-media-controls-start-playback-tint):
2167
2168         * Modules/mediacontrols/mediaControlsiOS.js:
2169         (ControllerIOS.prototype.createBase): Replace the <button> with the hierarchy of
2170         elements to replicate the blur. Give some of them a class attribute, so they
2171         can match selectors (see the bugs Said filed in the original bugzilla).
2172         (ControllerIOS.prototype.handleStartPlaybackButtonTouchStart): Toggle classes on
2173         the hierarchy as needed.
2174         (ControllerIOS.prototype.handleStartPlaybackButtonTouchEnd): Ditto.
2175         (ControllerIOS.prototype.updateStatusDisplay): Ditto.
2176
2177 2015-07-07  Zalan Bujtas  <zalan@apple.com>
2178
2179         Crash when parent iframe is set to display none and the child frame is mutated the same time.
2180         https://bugs.webkit.org/show_bug.cgi?id=146699
2181         rdar://problem/16207881
2182
2183         Reviewed by Andreas Kling.
2184
2185         When the parent iframe is set to display: none, we destroy the associated renderer (RenderIFrame).
2186         However if the child frame is mutated the same time, during layout we try to access this RenderIFrame
2187         to check whether it needs frame flattening.
2188         This patch checks whether the parent render widget is still valid.
2189
2190         Test: fast/frames/crash-display-none-iframe-during-onbeforeload.html
2191
2192         * page/FrameView.cpp:
2193         (WebCore::FrameView::isInChildFrameWithFrameFlattening): rearrange early returns.
2194
2195 2015-07-06  Matt Rajca  <mrajca@apple.com>
2196
2197         Media Session: remove seek forward/backward attributes
2198         https://bugs.webkit.org/show_bug.cgi?id=146645
2199
2200         Reviewed by Eric Carlson.
2201
2202         * Modules/mediasession/MediaRemoteControls.h:
2203         * Modules/mediasession/MediaRemoteControls.idl:
2204
2205 2015-07-07  Brent Fulgham  <bfulgham@apple.com>
2206
2207         REGRESSION (r183133-r183138): Secondary clicking in whitespace selects preceding word
2208         https://bugs.webkit.org/show_bug.cgi?id=146695
2209         <rdar://problem/21441466>
2210
2211         Reviewed by Tim Horton.
2212
2213         When we would currently use dictionary lookup to decide on our text selection, first check if we
2214         are targeting an editable field. If we are, use the original selection behavior. Otherwise, use
2215         the new "dictionary lookup" selection.
2216
2217         * page/EventHandler.cpp:
2218         (WebCore::EventHandler::selectClosestContextualWordOrLinkFromMouseEvent): Only use dictionary lookup
2219         when our target node is not editable.
2220         
2221
2222 2015-07-07  Brady Eidson  <beidson@apple.com>
2223
2224         Another attempt to fix CURL/Soup builds after r186476
2225
2226         Reviewed by NOBODY.
2227
2228         * platform/network/curl/SocketStreamHandle.h:
2229
2230         * platform/network/soup/SocketStreamHandle.h:
2231
2232 2015-07-07  Brady Eidson  <beidson@apple.com>
2233
2234         Attempt to fix CURL/Soup builds after r186476
2235
2236         Reviewed by NOBODY.
2237
2238         * platform/network/curl/SocketStreamHandle.h:
2239         (WebCore::SocketStreamHandle::create):
2240
2241         * platform/network/soup/SocketStreamHandle.h:
2242         (WebCore::SocketStreamHandle::create):
2243
2244 2015-07-07  Brady Eidson  <beidson@apple.com>
2245
2246         HTTP Auth cached after disabling private browsing/reset.
2247         <rdar://problem/8293055> and https://bugs.webkit.org/show_bug.cgi?id=146654
2248
2249         Reviewed by Tim Horton.
2250
2251         Test: http/tests/security/private-browsing-http-auth.html
2252
2253         - Change most static CredentialStorage methods to be instance methods instead.
2254         - Make a CredentialStorage objects be per-NetworkStorageSession.
2255
2256         * Modules/websockets/WebSocketChannel.cpp:
2257         (WebCore::WebSocketChannel::WebSocketChannel):
2258         (WebCore::WebSocketChannel::connect): Only start the web socket load if a networking
2259           context is available.
2260
2261         * platform/network/CredentialStorage.cpp:
2262         (WebCore::CredentialStorage::defaultCredentialStorage): Returns the credential storage
2263           from the default NetworkStorageSession.
2264         (WebCore::CredentialStorage::set):
2265         (WebCore::CredentialStorage::get):
2266         (WebCore::CredentialStorage::remove):
2267         (WebCore::CredentialStorage::findDefaultProtectionSpaceForURL):
2268         (WebCore::CredentialStorage::clearCredentials):
2269         (WebCore::protectionSpaceToCredentialMap): Deleted.
2270         (WebCore::originsWithCredentials): Deleted.
2271         (WebCore::pathToDefaultProtectionSpaceMap): Deleted.
2272         (WebCore::findDefaultProtectionSpaceForURL): Deleted.
2273         (WebCore::CredentialStorage::setPrivateMode): Deleted. Was a no-op anyways.
2274         * platform/network/CredentialStorage.h:
2275         
2276         * platform/network/NetworkStorageSession.h:
2277         (WebCore::NetworkStorageSession::credentialStorage):
2278         
2279         * platform/network/cf/ResourceHandleCFNet.cpp:
2280         (WebCore::ResourceHandle::createCFURLConnection):
2281         (WebCore::ResourceHandle::willSendRequest):
2282         (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
2283         (WebCore::ResourceHandle::receivedCredential):
2284         
2285         * platform/network/cf/SocketStreamHandle.h:
2286         (WebCore::SocketStreamHandle::create):
2287         * platform/network/cf/SocketStreamHandleCFNet.cpp:
2288         (WebCore::SocketStreamHandle::SocketStreamHandle):
2289         (WebCore::SocketStreamHandle::getStoredCONNECTProxyCredentials):
2290         (WebCore::getStoredCONNECTProxyCredentials): Deleted.
2291         
2292         * platform/network/curl/ResourceHandleCurl.cpp:
2293         (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
2294         (WebCore::ResourceHandle::receivedCredential):
2295         * platform/network/curl/ResourceHandleManager.cpp:
2296         (WebCore::ResourceHandleManager::applyAuthenticationToRequest):
2297         
2298         * platform/network/mac/ResourceHandleMac.mm:
2299         (WebCore::ResourceHandle::createNSURLConnection):
2300         (WebCore::ResourceHandle::willSendRequest):
2301         (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
2302         (WebCore::ResourceHandle::receivedCredential):
2303         
2304         * platform/network/soup/ResourceHandleSoup.cpp:
2305         (WebCore::applyAuthenticationToRequest):
2306         (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
2307         (WebCore::ResourceHandle::receivedCredential):
2308         
2309 2015-07-07  Zalan Bujtas  <zalan@apple.com>
2310
2311         REGRESSION(169105): CSS Regions: renderer returns wrong selection root when it is inside a column flow.
2312         https://bugs.webkit.org/show_bug.cgi?id=146529
2313         rdar://problem/21613670
2314
2315         Reviewed by Mihnea Ovidenie and David Kilzer.
2316
2317         This patch ensures that RenderObject::selectionRoot() handles column flows properly while searching for the associated
2318         selection root.
2319         When the renderer is inside a column flow and the column flow is part of a named flow, we stop
2320         traversing the ancestor chain, searching for the selection root, when we reach the column flow.
2321         Since the column flow is not a selection root, we mistakenly fall back to the RenderView as selection root.
2322         Instead, we should check if the column is inside a named flow and return the selection root accordingly.
2323         Returning the wrong selection root confuses RenderView::splitSelectionBetweenSubtrees() logic and this particular
2324         RenderObject could end up in multiple selection trees.
2325
2326         Test: fast/regions/selection/crash-when-element-is-inside-column-and-the-containing-block-is-inside-flow.html
2327
2328         * rendering/RenderObject.cpp:
2329         (WebCore::RenderObject::selectionRoot):
2330
2331 2015-07-07  Brent Fulgham  <bfulgham@apple.com>
2332
2333         [Mac] REGRESSION (r184794): Play/Pause control doesn't update state in full screen
2334         https://bugs.webkit.org/show_bug.cgi?id=146689
2335         <rdar://problem/21393490>
2336
2337         Reviewed by Dean Jackson.
2338
2339         The changes in r184794 did not take full screen mode into account. This needed to be corrected.
2340
2341         * Modules/mediacontrols/mediaControlsApple.js:
2342         (Controller.prototype.handlePanelTransitionEnd):
2343         (Controller.prototype.setPlaying):
2344         (Controller.prototype.showControls):
2345
2346 2015-07-07  Wenson Hsieh  <whsieh@berkeley.edu>
2347         
2348         Snap point regions containing X and Y snap points should do a better job animating
2349         https://bugs.webkit.org/show_bug.cgi?id=142523
2350         <rdar://problem/20100753>
2351
2352         Reviewed by Brent Fulgham.
2353
2354         Reimplemented snap point animations to use a single timer for both horizontal and
2355         vertical axes to better support 2D snap scrolling. Instead of making velocity
2356         dependent on progress to the snap point and handling 2D snapping with different
2357         timer update functions, this implementation uses a fixed animation time to coordinate
2358         the snapping animation across both axes.
2359
2360         Test: platform/mac-wk2/tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-2d-overflow.html
2361
2362         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h: Refactored to use a single scroll snap timer.
2363         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm: See above.
2364         (WebCore::ScrollingTreeFrameScrollingNodeMac::startScrollSnapTimer): See above.
2365         (WebCore::ScrollingTreeFrameScrollingNodeMac::stopScrollSnapTimer): See above.
2366         * platform/cocoa/ScrollController.h: Refactored to use a single scroll snap timer and update function to handle
2367             snapping in both axes. This entails removing the ScrollEventAxis parameter from various functions below. Also
2368             removed methods that computed "snap" and "glide" offsets.
2369         (WebCore::ScrollControllerClient::startScrollSnapTimer): See above.
2370         (WebCore::ScrollControllerClient::stopScrollSnapTimer): See above.
2371         * platform/cocoa/ScrollController.mm: See above.
2372         (WebCore::ScrollController::ScrollController): Added new constants used to compute animation offsets.
2373         (WebCore::ScrollController::snapRubberBandTimerFired):  Added a check to prevent the rubber band timer from firing
2374             alongside the scroll snap timer. This results in scroll snapping taking precedence over rubber banding when
2375             scrolling against the edge of a container in the case of 2D scrolling. We didn't run into this issue before
2376             because snapping wasn't working properly at the edges of a 2D scrolling container. In the future, we may want
2377             to unify both snap scrolling and rubber banding timers to solve this issue.
2378         (WebCore::ScrollController::isScrollSnapInProgress): Refactored to use a single scroll snap timer.
2379         (WebCore::ScrollController::processWheelEventForScrollSnapOnAxis): Fixed an issue where wheel deltas were being pushed
2380             to the snap state incorrectly.
2381         (WebCore::ScrollController::processWheelEventForScrollSnap): Fixed an issue with 2D snapping where scrolling in 2 axes
2382             simultaneously would cause the vertical axis to override the horizontal axis. This is more like a sub-issue of fixing
2383             2D scrolling, and is required for 2D snap animations to work properly.
2384         (WebCore::ScrollController::startScrollSnapTimer): Refactored to use a single scroll snap timer.
2385         (WebCore::ScrollController::stopScrollSnapTimer): See above.
2386         (WebCore::ScrollController::scrollSnapTimerFired): This new method handles snap scroll updates on both axes.
2387         (WebCore::ScrollController::beginScrollSnapAnimation): Refactored to account for single scroll snap timer.
2388         (WebCore::ScrollController::endScrollSnapAnimation): See above.
2389         (WebCore::ScrollController::initializeScrollSnapAnimationParameters): New method that initializes parameters used to
2390             coordinate the animation state across horizontal and vertical axes.
2391         (WebCore::ScrollController::isSnappingOnAxis):  Checks whether or not a given axis is currently scroll snapping. This will
2392             return true in the case of active 2D scroll snapping.
2393         (WebCore::ScrollController::hasActiveScrollSnapTimerForAxis): Deleted.
2394         (WebCore::ScrollController::horizontalScrollSnapTimerFired): Deleted.
2395         (WebCore::ScrollController::verticalScrollSnapTimerFired): Deleted.
2396         (WebCore::ScrollController::scrollSnapAnimationUpdate): Deleted.
2397         (WebCore::ScrollController::initializeGlideParameters): Deleted.
2398         (WebCore::snapProgress): Deleted.
2399         (WebCore::clampedSnapMagnitude): Deleted.
2400         (WebCore::ScrollController::computeSnapDelta): Deleted.
2401         (WebCore::snapGlide): Deleted.
2402         (WebCore::ScrollController::computeGlideDelta): Deleted.
2403         * platform/cocoa/ScrollSnapAnimatorState.h:  Added a new datastructure, ScrollSnapAnimationCurveState, which tracks
2404             the scroll snap animation state across both axes.
2405         * platform/cocoa/ScrollSnapAnimatorState.mm: Removed fields relevant to the former "gliding" model and renamed the
2406             initial wheel delta variable to reflect this.
2407         (WebCore::ScrollSnapAnimatorState::averageInitialWheelDelta): Fixed an issue where wheel deltas were being pushed
2408             to the snap state incorrectly.
2409         (WebCore::ScrollSnapAnimatorState::clearInitialWheelDeltaWindow): Tiny for loop incrementor style fix.
2410         (WebCore::ScrollSnapAnimatorState::isSnapping): Checks whether this state is in either snapping or gliding mode.
2411         (WebCore::ScrollSnapAnimatorState::canReachTargetWithCurrentInitialScrollDelta): Checks whether the scroll velocity is
2412             consistent with the initial and target offsets.
2413         (WebCore::ScrollSnapAnimatorState::interpolatedOffsetAtProgress): Interpolates the offset for a given progress value.
2414         (WebCore::ScrollSnapAnimationCurveState::ScrollSnapAnimationCurveState): New constants.
2415         (WebCore::ScrollSnapAnimationCurveState::initializeSnapProgressCurve): Abstracts out part of the initialization process.
2416         (WebCore::ScrollSnapAnimationCurveState::initializeInterpolationCoefficientsIfNecessary): Abstracts out part of the
2417             initialization process.
2418         (WebCore::ScrollSnapAnimationCurveState::interpolatedPositionAtProgress): Abstracts out curve interpolation.
2419         (WebCore::ScrollSnapAnimationCurveState::shouldCompleteSnapAnimationImmediatelyAtTime): Added.
2420         (WebCore::ScrollSnapAnimationCurveState::animationProgressAtTime): Added.
2421         
2422 2015-07-07  Chris Dumez  <cdumez@apple.com>
2423
2424         Unreviewed, attempt to fix iOS build.
2425
2426         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
2427         (WebVideoFullscreenInterfaceAVKit::setupFullscreen):
2428
2429 2015-07-07  Andreas Kling  <akling@apple.com>
2430
2431         REGRESSION(r183706): HTMLImageElement sometimes fails to register as document named item.
2432         <https://webkit.org/b/146679>
2433         <rdar://problem/21613839>
2434
2435         Reviewed by Antti Koivisto.
2436
2437         After r183706, Element::hasName() no longer returns outdated information when called
2438         inside a parseAttribute() override. HTMLImageElement was relying on this to check
2439         if it *used* to have a name attribute before the currently parsing one was set.
2440
2441         Since parseAttribute() only shows subclasses the new attribute value, I'm adding a
2442         flag to HTMLImageElement that remembers whether we had a name attribute or not.
2443
2444         Test: fast/dom/HTMLImageElement/remove-img-with-name-from-document-crash.html
2445
2446         * html/HTMLImageElement.cpp:
2447         (WebCore::HTMLImageElement::parseAttribute):
2448         * html/HTMLImageElement.h:
2449
2450 2015-07-07  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2451
2452         [Streams API] Remove ReadableStreamReader.read() custom binding
2453         https://bugs.webkit.org/show_bug.cgi?id=146643
2454
2455         Reviewed by Darin Adler.
2456
2457         Moved ReadableStreamReader.read handling from callbacks to promises.
2458         Introduced DOMPromiseIteratorWithCallback for that purpose: it takes resolve() to resolve a promise with a not-ending iterator value,
2459         resolveEnd() to resolve a promise with a terminating iterator value and reject().
2460         Added template helper routine to convert typed values to JS iterator wrapping the value.
2461         Removed ReadableStreamReader.read custom binding.
2462
2463         Covered by rebased tests.
2464
2465         * Modules/streams/ReadableStream.cpp: Updated code to use DOMPromiseIteratorWithCallback API.
2466         (WebCore::ReadableStream::releaseReader):
2467         (WebCore::ReadableStream::changeStateToErrored):
2468         (WebCore::ReadableStream::read):
2469         (WebCore::ReadableStream::resolveReadCallback):
2470         * Modules/streams/ReadableStream.h:
2471         * Modules/streams/ReadableStreamReader.cpp:
2472         (WebCore::ReadableStreamReader::read):
2473         * Modules/streams/ReadableStreamReader.h:
2474         * Modules/streams/ReadableStreamReader.idl: Removed custom binding.
2475         * bindings/js/JSDOMBinding.h:
2476         (WebCore::toJSIterator): create JS iterator from typed value.
2477         (WebCore::toJSIteratorEnd): create JS end iterator.
2478         * bindings/js/JSDOMPromise.cpp:
2479         (WebCore::DeferredWrapper::globalObject): Added globaObject getter and removed promise getter.
2480         * bindings/js/JSDOMPromise.h:
2481         (WebCore::DOMPromiseIteratorWithCallback::DOMPromiseIteratorWithCallback):
2482         (WebCore::Error>::resolve):
2483         (WebCore::Error>::resolveEnd):
2484         (WebCore::Error>::reject):
2485         * bindings/js/JSReadableStreamReaderCustom.cpp: Removed custom binding.
2486
2487 2015-07-06  Zalan Bujtas  <zalan@apple.com>
2488
2489         REGRESSION: Slider thumb does not render properly (image tests with <input type="range">)
2490         https://bugs.webkit.org/show_bug.cgi?id=146669
2491         rdar://problem/21677831
2492
2493         Reviewed by Simon Fraser.
2494
2495         Draw NSSliderCell's knob only when slider's thumb paint is requested.
2496
2497         Covered by existing tests.
2498
2499         * rendering/RenderThemeMac.mm:
2500         (WebCore::RenderThemeMac::paintSliderThumb):
2501
2502 2015-07-06  Csaba Osztrogonác  <ossy@webkit.org>
2503
2504         Move shouldIgnoreAttributeCase inline function to Element.h
2505         https://bugs.webkit.org/show_bug.cgi?id=146588
2506
2507         Reviewed by Andreas Kling.
2508
2509         * dom/Element.cpp:
2510         (WebCore::shouldIgnoreAttributeCase): Deleted.
2511         * dom/Element.h:
2512         (WebCore::shouldIgnoreAttributeCase):
2513         * dom/NamedNodeMap.cpp:
2514         (WebCore::shouldIgnoreAttributeCase): Deleted.
2515
2516 2015-07-06  Brent Fulgham  <bfulgham@apple.com>
2517
2518         Ensure media playback is stopped during page close
2519         https://bugs.webkit.org/show_bug.cgi?id=146554
2520         <rdar://problem/18033944>
2521
2522         Reviewed by Brady Eidson.
2523
2524         * Modules/webaudio/AudioContext.cpp:
2525         (WebCore::WebAudio::hostingDocument): Added.
2526         * Modules/webaudio/AudioContext.h:
2527         * html/HTMLMediaElement.h:
2528         (WebCore::HTMLMediaElement::hostingDocument): Added.
2529         * dom/Document.cpp:
2530         (WebCore::Document::~Document): Call new 'stopAllMediaPlaybackForDocument' at destruction time.
2531         * platform/audio/PlatformMediaSession.h:
2532         Made PlatformMediaSessionManager a friend so it can access the protected 'client' accessor.
2533         Updated PlatformMediaSessionClient to require clients to have a "hostingDocument" member.
2534         * platform/audio/PlatformMediaSessionManager.cpp:
2535         (WebCore::PlatformMediaSessionManager::stopAllMediaPlaybackForDocument): Added. Only pauses
2536         playback on elements that match the provided document.
2537         (WebCore::PlatformMediaSessionManager::stopAllMediaPlaybackForProcess): Added. Pauses playback
2538         on all elements in the current process.
2539         * platform/audio/PlatformMediaSessionManager.h:
2540
2541 2015-07-06  Daniel Bates  <dabates@apple.com>
2542
2543         Isolated worlds should respect Content Security Policy; User Agent Shadow DOM
2544         should be exempt from Content Security Policy
2545         https://bugs.webkit.org/show_bug.cgi?id=144830
2546         <rdar://problem/18860261>
2547
2548         Inadvertently omitted argument overrideContentSecurityPolicy in calls to ContentSecurityPolicy::allowEval()
2549         that explicitly specified a report status. And the report status, which is an enum, was being implicitly
2550         converted to bool.
2551
2552         * bindings/js/ScriptController.cpp:
2553         (WebCore::ScriptController::initScript):
2554         * page/DOMSecurityPolicy.cpp:
2555         (WebCore::DOMSecurityPolicy::allowsEval):
2556
2557 2015-07-06  Commit Queue  <commit-queue@webkit.org>
2558
2559         Unreviewed, rolling out r186385.
2560         https://bugs.webkit.org/show_bug.cgi?id=146668
2561
2562         crashes 3 webaudio tests in debug builds (Requested by
2563         alexchristensen on #webkit).
2564
2565         Reverted changeset:
2566
2567         "Ensure media playback is stopped during page close"
2568         https://bugs.webkit.org/show_bug.cgi?id=146554
2569         http://trac.webkit.org/changeset/186385
2570
2571 2015-07-06  Andreas Kling  <akling@apple.com>
2572
2573         Crash when setting text direction via MakeTextWritingDirection* editing commands.
2574         <https://webkit.org/b/146665>
2575         <rdar://problem/20835477>
2576
2577         Reviewed by Ryosuke Niwa.
2578
2579         Fix two buggy clients of enclosingBlock(node) that would fail if the returned
2580         element is the same as the node passed in.
2581
2582         Test: editing/style/change-text-direction-crash.html
2583
2584         * editing/ApplyStyleCommand.cpp:
2585         (WebCore::ApplyStyleCommand::splitAncestorsWithUnicodeBidi):
2586         (WebCore::ApplyStyleCommand::removeEmbeddingUpToEnclosingBlock):
2587
2588 2015-07-06  Simon Fraser  <simon.fraser@apple.com>
2589
2590         Revert use of  SVG <mask> elements for -webkit-mask-image (r176798, r177494)
2591         https://bugs.webkit.org/show_bug.cgi?id=146653
2592
2593         Reviewed by Dean Jackson.
2594
2595         Fixes rdar://problem/21435233.
2596
2597         r177494 caused a number of regressions (bugs 141857, 146509, 146561), added new layering violations, and
2598         was not being maintained, so revert it.
2599
2600         This patch reverts r176798.
2601
2602         * CMakeLists.txt:
2603         * WebCore.vcxproj/WebCore.vcxproj:
2604         * WebCore.vcxproj/WebCore.vcxproj.filters:
2605         * WebCore.xcodeproj/project.pbxproj:
2606         * css/CSSValue.cpp:
2607         (WebCore::CSSValue::cssText): Deleted.
2608         (WebCore::CSSValue::destroy): Deleted.
2609         * css/CSSValue.h:
2610         (WebCore::CSSValue::isWebKitCSSResourceValue): Deleted.
2611         * css/StyleBuilderConverter.h:
2612         (WebCore::maskImageValueFromIterator): Deleted.
2613         * css/StyleResolver.cpp:
2614         (WebCore::StyleResolver::State::clear): Deleted.
2615         * css/StyleResolver.h:
2616         (WebCore::StyleResolver::State::maskImagesWithPendingSVGDocuments): Deleted.
2617         * css/WebKitCSSResourceValue.cpp: Removed.
2618         * css/WebKitCSSResourceValue.h: Removed.
2619         * loader/cache/CachedResourceLoader.cpp:
2620         (WebCore::CachedResourceLoader::addCachedResource): Deleted.
2621         * loader/cache/CachedResourceLoader.h:
2622         * loader/cache/CachedSVGDocument.cpp:
2623         (WebCore::CachedSVGDocument::finishLoading):
2624         (WebCore::CachedSVGDocument::CachedSVGDocument): Deleted.
2625         * loader/cache/CachedSVGDocument.h:
2626         * loader/cache/CachedSVGDocumentReference.cpp:
2627         (WebCore::CachedSVGDocumentReference::CachedSVGDocumentReference):
2628         (WebCore::CachedSVGDocumentReference::~CachedSVGDocumentReference):
2629         (WebCore::CachedSVGDocumentReference::load):
2630         * loader/cache/CachedSVGDocumentReference.h:
2631         * page/FrameView.cpp:
2632         (WebCore::FrameView::containsSVGDocument): Deleted.
2633         * page/FrameView.h:
2634         * page/Page.cpp:
2635         (WebCore::Page::createPageFromBuffer): Deleted.
2636         * page/Page.h:
2637         * platform/ScrollView.h:
2638         (WebCore::ScrollView::containsSVGDocument): Deleted.
2639         * platform/graphics/MaskImageOperation.cpp: Removed.
2640         * platform/graphics/MaskImageOperation.h: Removed.
2641         * rendering/RenderLayer.cpp:
2642         (WebCore::RenderLayer::RenderLayer): Deleted.
2643         * rendering/RenderLayer.h:
2644         * rendering/RenderLayerFilterInfo.cpp:
2645         * rendering/RenderLayerFilterInfo.h:
2646         * rendering/RenderLayerMaskImageInfo.h: Removed.
2647         * rendering/style/FillLayer.cpp:
2648         (WebCore::FillLayer::operator==):
2649         (WebCore::FillLayer::cullEmptyLayers):
2650         (WebCore::layerImagesIdentical):
2651         (WebCore::FillLayer::FillLayer): Deleted.
2652         (WebCore::FillLayer::operator=): Deleted.
2653         (WebCore::FillLayer::hasNonEmptyMaskImage): Deleted.
2654         (WebCore::FillLayer::imagesAreLoaded): Deleted.
2655         * rendering/style/FillLayer.h:
2656         (WebCore::FillLayer::maskImage): Deleted.
2657         (WebCore::FillLayer::imageOrMaskImage): Deleted.
2658         (WebCore::FillLayer::setMaskImage): Deleted.
2659         (WebCore::FillLayer::clearMaskImage): Deleted.
2660         (WebCore::FillLayer::hasMaskImage): Deleted.
2661         * rendering/svg/RenderSVGResourceMasker.cpp:
2662         (WebCore::RenderSVGResourceMasker::applyResource):
2663         (WebCore::RenderSVGResourceMasker::applySVGMask): Deleted.
2664         (WebCore::RenderSVGResourceMasker::drawMaskForRenderer): Deleted.
2665         * rendering/svg/RenderSVGResourceMasker.h:
2666         * svg/SVGMaskElement.cpp:
2667         (WebCore::SVGMaskElement::createElementRenderer):
2668         (WebCore::SVGMaskElement::addClientRenderLayer): Deleted.
2669         (WebCore::SVGMaskElement::removeClientRenderLayer): Deleted.
2670         * svg/SVGMaskElement.h:
2671         * svg/SVGUseElement.cpp:
2672         (WebCore::SVGUseElement::updateExternalDocument):
2673         * svg/graphics/SVGImage.cpp:
2674         (WebCore::SVGImage::dataChanged):
2675
2676 2015-07-06  Simon Fraser  <simon.fraser@apple.com>
2677
2678         Revert use of SVG <mask> elements for -webkit-mask-image (r176798, r177494, r186180)
2679         https://bugs.webkit.org/show_bug.cgi?id=146653
2680
2681         Reviewed by Dean Jackson.
2682
2683         Fixes rdar://problem/21435233.
2684
2685         r177494 caused a number of regressions (bugs 141857, 146509, 146561), added new layering violations, and
2686         was not being maintained, so revert it.
2687
2688         This patch reverts r177494.
2689
2690         * WebCore.xcodeproj/project.pbxproj:
2691         * css/CSSComputedStyleDeclaration.cpp:
2692         (WebCore::ComputedStyleExtractor::propertyValue):
2693         * css/CSSParser.cpp:
2694         (WebCore::CSSParser::parseFillProperty):
2695         (WebCore::CSSParser::parseMaskImage): Deleted.
2696         * css/CSSParser.h:
2697         * css/CSSPropertyNames.in:
2698         * css/CSSValue.h:
2699         * css/StyleBuilderConverter.h:
2700         (WebCore::StyleBuilderConverter::convertMaskImageOperations): Deleted.
2701         * css/StyleResolver.cpp:
2702         (WebCore::StyleResolver::loadPendingSVGDocuments):
2703         (WebCore::StyleResolver::loadPendingImages):
2704         (WebCore::StyleResolver::adjustStyleForMaskImages): Deleted.
2705         (WebCore::StyleResolver::applyMatchedProperties): Deleted.
2706         * css/StyleResolver.h:
2707         * page/FrameView.cpp:
2708         (WebCore::FrameView::containsSVGDocument):
2709         * page/FrameView.h:
2710         * page/animation/CSSPropertyAnimation.cpp:
2711         (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
2712         (WebCore::blendFunc): Deleted.
2713         (WebCore::MaskImagePropertyWrapper::MaskImagePropertyWrapper): Deleted.
2714         (WebCore::MaskImagePropertyWrapper::equals): Deleted.
2715         * platform/ScrollView.h:
2716         (WebCore::ScrollView::containsSVGDocument):
2717         * platform/graphics/MaskImageOperation.cpp:
2718         (WebCore::MaskImageOperation::~MaskImageOperation): Deleted.
2719         (WebCore::MaskImageOperation::operator==): Deleted.
2720         * platform/graphics/MaskImageOperation.h:
2721         * rendering/RenderBox.cpp:
2722         (WebCore::RenderBox::maskClipRect):
2723         * rendering/RenderBoxModelObject.cpp:
2724         (WebCore::RenderBoxModelObject::paintFillLayerExtended):
2725         * rendering/RenderElement.cpp:
2726         (WebCore::RenderElement::updateFillImages):
2727         (WebCore::RenderElement::~RenderElement): Deleted.
2728         * rendering/RenderLayer.cpp:
2729         (WebCore::RenderLayer::~RenderLayer): Deleted.
2730         (WebCore::RenderLayer::calculateClipRects): Deleted.
2731         * rendering/RenderLayer.h:
2732         * rendering/RenderLayerMaskImageInfo.cpp: Removed.
2733         * rendering/style/FillLayer.h:
2734         (WebCore::FillLayer::image):
2735         (WebCore::FillLayer::imageOrMaskImage):
2736         * rendering/style/RenderStyle.cpp:
2737         (WebCore::RenderStyle::setMaskImage): Deleted.
2738         * rendering/style/RenderStyle.h:
2739
2740 2015-07-06  Simon Fraser  <simon.fraser@apple.com>
2741
2742         Revert use of SVG <mask> elements for -webkit-mask-image (r176798, r177494, r186180)
2743         https://bugs.webkit.org/show_bug.cgi?id=146653
2744         
2745         Fixes rdar://problem/21435233.
2746
2747         This patch reverts r186180, but keeps the layout test.
2748
2749         This feature caused a number of regressions (bugs 141857, 146509, 146561), added new layering violations, and
2750         was not being maintained, so revert it.
2751         
2752         * loader/cache/CachedResourceLoader.cpp:
2753         (WebCore::CachedResourceLoader::requestResource): Deleted.
2754         * loader/cache/CachedResourceRequest.h:
2755         (WebCore::CachedResourceRequest::acceptOverride): Deleted.
2756         (WebCore::CachedResourceRequest::setAcceptOverride): Deleted.
2757         * loader/cache/CachedSVGDocumentReference.cpp:
2758         (WebCore::CachedSVGDocumentReference::load): Deleted.
2759         * loader/cache/CachedSVGDocumentReference.h:
2760         (WebCore::CachedSVGDocumentReference::setAcceptsAnyImageType): Deleted.
2761         * platform/graphics/MaskImageOperation.cpp:
2762         (WebCore::MaskImageOperation::ensureCachedSVGDocumentReference):
2763         (WebCore::MaskImageOperation::notifyFinished):
2764
2765 2015-07-06  Daniel Bates  <dabates@apple.com>
2766
2767         Fix the Windows build following <https://trac.webkit.org/changeset/186388>
2768         (https://bugs.webkit.org/show_bug.cgi?id=144830)
2769
2770         As we for for Mac in WebCoreAVFResourceLoader::startLoading(), instantiate ResourceLoaderOptions
2771         with ContentSecurityPolicyImposition::DoPolicyCheck.
2772
2773         * platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp:
2774         (WebCore::WebCoreAVCFResourceLoader::startLoading):
2775
2776 2015-07-06  Daniel Bates  <dabates@apple.com>
2777
2778         Isolated worlds should respect Content Security Policy; User Agent Shadow DOM
2779         should be exempt from Content Security Policy
2780         https://bugs.webkit.org/show_bug.cgi?id=144830
2781         <rdar://problem/18860261>
2782
2783         Reviewed by Geoffrey Garen.
2784
2785         Make scripts that run in an isolated world be subject to the Content Security Policy (CSP) of the page
2786         and exempt features implemented using a user agent shadow DOM. As a side effect of this change,
2787         Safari Content Extensions will respect the CSP policy of the page when loading subresources (e.g. an image).
2788
2789         Tests: http/tests/security/contentSecurityPolicy/userAgentShadowDOM/allow-audio.html
2790                http/tests/security/contentSecurityPolicy/userAgentShadowDOM/allow-css-background.html
2791                http/tests/security/contentSecurityPolicy/userAgentShadowDOM/allow-css-cursor.html
2792                http/tests/security/contentSecurityPolicy/userAgentShadowDOM/allow-css-filter-on-image.html
2793                http/tests/security/contentSecurityPolicy/userAgentShadowDOM/allow-css-webkit-image-set.html
2794                http/tests/security/contentSecurityPolicy/userAgentShadowDOM/allow-embed-plugin.html
2795                http/tests/security/contentSecurityPolicy/userAgentShadowDOM/allow-external-script.html
2796                http/tests/security/contentSecurityPolicy/userAgentShadowDOM/allow-iframe.html
2797                http/tests/security/contentSecurityPolicy/userAgentShadowDOM/allow-image-after-redirect.html
2798                http/tests/security/contentSecurityPolicy/userAgentShadowDOM/allow-image.html
2799                http/tests/security/contentSecurityPolicy/userAgentShadowDOM/allow-inline-script.html
2800                http/tests/security/contentSecurityPolicy/userAgentShadowDOM/allow-inline-style.html
2801                http/tests/security/contentSecurityPolicy/userAgentShadowDOM/allow-inline-stylesheet.html
2802                http/tests/security/contentSecurityPolicy/userAgentShadowDOM/allow-object-plugin.html
2803                http/tests/security/contentSecurityPolicy/userAgentShadowDOM/allow-object.html
2804                http/tests/security/contentSecurityPolicy/userAgentShadowDOM/allow-svg-feimage-element.html
2805                http/tests/security/contentSecurityPolicy/userAgentShadowDOM/allow-svg-font.html
2806                http/tests/security/contentSecurityPolicy/userAgentShadowDOM/allow-svg-use-element.html
2807                http/tests/security/contentSecurityPolicy/userAgentShadowDOM/allow-track.html
2808                http/tests/security/contentSecurityPolicy/userAgentShadowDOM/allow-video.html
2809                http/tests/security/contentSecurityPolicy/userAgentShadowDOM/block-loading-user-agent-image-from-non-user-agent-content.html
2810                http/tests/security/contentSecurityPolicy/userAgentShadowDOM/default-src-object-data-url-allowed.html
2811                http/tests/security/contentSecurityPolicy/userAgentShadowDOM/default-src-object-data-url-blocked.html
2812                http/tests/security/contentSecurityPolicy/userAgentShadowDOM/default-src-object-data-url-blocked2.html
2813                http/tests/security/contentSecurityPolicy/userAgentShadowDOM/default-src-object-data-url-blocked3.html
2814                http/tests/security/contentSecurityPolicy/userAgentShadowDOM/video-controls-allowed.html
2815                http/tests/security/isolatedWorld/image-load-should-not-bypass-main-world-csp.html
2816
2817         * Modules/websockets/WebSocket.cpp:
2818         (WebCore::WebSocket::connect): Pass shouldBypassMainWorldContentSecurityPolicy to ContentSecurityPolicy::allowConnectToSource().
2819         * css/CSSCanvasValue.h:
2820         (WebCore::CSSCanvasValue::loadSubimages): Modified to take argument ResourceLoaderOptions (unused).
2821         * css/CSSCrossfadeValue.cpp:
2822         (WebCore::CSSCrossfadeValue::fixedSize): Explicitly instantiate default ResourceLoaderOptions and pass
2823         pass it when requesting a cached image. Added FIXME comment to skip Content Security Policy check when
2824         the cross fade is applied to an element in a user agent shadow tree.
2825         (WebCore::CSSCrossfadeValue::loadSubimages): Take a ResourceLoaderOptions as an argument and passes it
2826         as appropriate.
2827         (WebCore::CSSCrossfadeValue::image): Explicitly instantiate default ResourceLoaderOptions and pass it
2828         when requesting a cached image. Added FIXME comment to skip Content Security Policy check when the cross
2829         fade is applied to an element in a user agent shadow tree.
2830         * css/CSSCrossfadeValue.h:
2831         * css/CSSCursorImageValue.cpp:
2832         (WebCore::CSSCursorImageValue::cachedImage): Take a ResourceLoaderOptions as an argument and passes it
2833         as appropriate.
2834         * css/CSSCursorImageValue.h:
2835         * css/CSSFilterImageValue.cpp:
2836         (WebCore::CSSFilterImageValue::fixedSize): Explicitly instantiate default ResourceLoaderOptions and pass
2837         pass it when requesting a cached image. Added FIXME comment to skip Content Security Policy check when
2838         the cross fade is applied to an element in a user agent shadow tree.
2839         (WebCore::CSSFilterImageValue::loadSubimages): Take a ResourceLoaderOptions as an argument and passes it
2840         as appropriate.
2841         (WebCore::CSSFilterImageValue::loadSubimages): Explicitly instantiate default ResourceLoaderOptions and pass
2842         pass it when requesting a cached image. Added FIXME comment to skip Content Security Policy check when
2843         the cross fade is applied to an element in a user agent shadow tree.
2844         (WebCore::CSSFilterImageValue::image):
2845         * css/CSSFilterImageValue.h:
2846         * css/CSSFontFaceSrcValue.cpp:
2847         (WebCore::CSSFontFaceSrcValue::cachedFont): Take a boolean, isInitiatingElementInUserAgentShadowTree,
2848         so as to determine the appropriate CSP imposition. In particular, we skip the CSP check when the initiating element
2849         (e.g. SVG font-face element) is in a user agent shadow tree.
2850         * css/CSSFontFaceSrcValue.h:
2851         * css/CSSFontSelector.cpp:
2852         (WebCore::CSSFontSelector::addFontFaceRule): Take a boolean, isInitiatingElementInUserAgentShadowTree, and passes
2853         it as appropriate.
2854         * css/CSSFontSelector.h:
2855         * css/CSSGradientValue.h:
2856         (WebCore::CSSGradientValue::loadSubimages): Take a ResourceLoaderOptions as an argument and passes it
2857         as appropriate.
2858         * css/CSSImageGeneratorValue.cpp:
2859         (WebCore::CSSImageGeneratorValue::loadSubimages): Ditto.
2860         (WebCore::CSSImageGeneratorValue::cachedImageForCSSValue): Ditto.
2861         * css/CSSImageGeneratorValue.h:
2862         * css/CSSImageSetValue.cpp:
2863         (WebCore::CSSImageSetValue::cachedImageSet): Deleted.
2864         * css/CSSImageSetValue.h:
2865         * css/CSSImageValue.cpp:
2866         (WebCore::CSSImageValue::cachedImage): Deleted.
2867         * css/CSSImageValue.h:
2868         * css/RuleSet.cpp:
2869         (WebCore::RuleSet::addChildRules): Take a boolean, isInitiatingElementInUserAgentShadowTree, and passes
2870         it as appropriate.
2871         (WebCore::RuleSet::addRulesFromSheet): Added FIXME comment to skip Content Security Policy check when
2872         when stylesheet is in a user agent shadow tree.
2873         * css/RuleSet.h:
2874         * css/StyleResolver.cpp:
2875         (WebCore::StyleResolver::StyleResolver): Determine whether the SVG font-face element is in a user agent shadow tree
2876         and pass the appropriate value when calling CSSFontSelector::addFontFaceRule(). Also, modernized code; used C++11 range
2877         -based for-loop instead of const_iterator idiom.
2878         (WebCore::StyleResolver::loadPendingSVGDocuments): Skip CSP check when requesting subresources as a byproduct of
2879         resolving style for an element in a user agent shadow tree.
2880         (WebCore::StyleResolver::loadPendingImage): Ditto.
2881         (WebCore::StyleResolver::loadPendingShapeImage): Ditto.
2882         * css/StyleRuleImport.cpp:
2883         (WebCore::StyleRuleImport::requestStyleSheet): Added FIXME comment to skip Content Security Policy check when
2884         when stylesheet is in a user agent shadow tree.
2885         * dom/Element.h:
2886         * dom/InlineStyleSheetOwner.cpp:
2887         (WebCore::InlineStyleSheetOwner::createSheet): Skip CSP check for an inline <style> that is in a user agent shadow tree.
2888         * dom/Node.cpp:
2889         (WebCore::Node::isInUserAgentShadowTree): Added.
2890         * dom/Node.h:
2891         * dom/ScriptElement.cpp:
2892         (WebCore::ScriptElement::requestScript): Skip CSP check for an external JavaScript script in a user agent shadow tree.
2893         (WebCore::ScriptElement::executeScript): Skip CSP check for an inline JavaScript script that is in a user agent shadow tree.
2894         * dom/StyledElement.cpp:
2895         (WebCore::StyledElement::styleAttributeChanged): Skip CSP check when modifying the inline style of an element in a user
2896         agent shadow tree.
2897         * html/HTMLMediaElement.cpp:
2898         (WebCore::HTMLMediaElement::isSafeToLoadURL): Skip CSP check for a <audio>, <video> in a user agent shadow tree.
2899         (WebCore::HTMLMediaElement::outOfBandTrackSources): Ditto.
2900         * html/HTMLTrackElement.cpp:
2901         (WebCore::HTMLTrackElement::canLoadURL): Ditto.
2902         * html/track/LoadableTextTrack.cpp:
2903         (WebCore::LoadableTextTrack::loadTimerFired): Determine whether the <track> is in a user agent shadow tree
2904         and pass the appropriate value when calling TextTrackLoader::load().
2905         * loader/DocumentLoader.cpp:
2906         (WebCore::DocumentLoader::startLoadingMainResource): Do CSP check when loading a resource by default.
2907         * loader/ImageLoader.cpp:
2908         (WebCore::ImageLoader::updateFromElement): Skip CSP check for an image that is in a user agent shadow tree.
2909         * loader/MediaResourceLoader.cpp:
2910         (WebCore::MediaResourceLoader::start): Instantiate ResourceLoaderOptions passing placeholder value ContentSecurityPolicyImposition::DoPolicyCheck.
2911         This value does not affect the request because we do not check the Content Security Policy for raw resource requests.
2912         * loader/NetscapePlugInStreamLoader.cpp:
2913         (WebCore::NetscapePlugInStreamLoader::NetscapePlugInStreamLoader): Added FIXME comment to skip Content Security Policy check
2914         when when associated plugin element is in a user agent shadow tree.
2915         * loader/PolicyChecker.cpp:
2916         (WebCore::PolicyChecker::checkNavigationPolicy): Skip CSP check for a <iframe> in a user agent shadow tree.
2917         * loader/ResourceLoaderOptions.h: Defined enum class ContentSecurityPolicyImposition with explicit type uint8_t so
2918         as to provide a hint to the compiler (for better packing) when it computes the memory layout for struct that
2919         contains an instance of this class.
2920         (WebCore::ResourceLoaderOptions::ResourceLoaderOptions): Added argument contentSecurityPolicyImposition.
2921         (WebCore::ResourceLoaderOptions::contentSecurityPolicyImposition): Added.
2922         (WebCore::ResourceLoaderOptions::setContentSecurityPolicyImposition): Added.
2923         * loader/SubframeLoader.cpp:
2924         (WebCore::SubframeLoader::pluginIsLoadable): Skip CSP check for a plugin element that is in a user agent shadow tree.
2925         (WebCore::SubframeLoader::createJavaAppletWidget): Skip CSP check for an applet element that is in a user agent shadow tree.
2926         * loader/TextTrackLoader.cpp:
2927         (WebCore::TextTrackLoader::load): Take a boolean, isInitiatingElementInUserAgentShadowTree, and sets the appropriate
2928         Content Security Policy imposition for the text track request.
2929         * loader/TextTrackLoader.h:
2930         * loader/cache/CachedResourceLoader.cpp:
2931         (WebCore::CachedResourceLoader::requestUserCSSStyleSheet): Skip CSP check for a user-specified stylesheet.
2932         (WebCore::CachedResourceLoader::canRequest): Only check the CSP of the page if specified in the resource loader options for the request.
2933         (WebCore::CachedResourceLoader::defaultCachedResourceOptions): Add ContentSecurityPolicyImposition::DoPolicyCheck to the default
2934         resource loader options so that do check the CSP policy of the page before performing a resource request by default.
2935         * loader/cache/CachedSVGDocumentReference.cpp:
2936         (WebCore::CachedSVGDocumentReference::load): Take a ResourceLoaderOptions as an argument and passes it as appropriate.
2937         * loader/cache/CachedSVGDocumentReference.h:
2938         * loader/icon/IconLoader.cpp:
2939         (WebCore::IconLoader::startLoading): Instantiate ResourceLoaderOptions passing placeholder value ContentSecurityPolicyImposition::DoPolicyCheck.
2940         This value does not affect the request because we do not check the Content Security Policy for raw resource requests.
2941         * page/ContentSecurityPolicy.cpp:
2942         (WebCore::ContentSecurityPolicy::allowJavaScriptURLs): Take an argument called overrideContentSecurityPolicy (defaults to false). When
2943         overrideContentSecurityPolicy := true, this function unconditionally returns true.
2944         (WebCore::ContentSecurityPolicy::allowInlineEventHandlers): Ditto.
2945         (WebCore::ContentSecurityPolicy::allowInlineScript): Ditto.
2946         (WebCore::ContentSecurityPolicy::allowInlineStyle): Ditto.
2947         (WebCore::ContentSecurityPolicy::allowEval): Ditto.
2948         (WebCore::ContentSecurityPolicy::allowPluginType): Ditto.
2949         (WebCore::ContentSecurityPolicy::allowScriptFromSource): Ditto.
2950         (WebCore::ContentSecurityPolicy::allowObjectFromSource): Ditto.
2951         (WebCore::ContentSecurityPolicy::allowChildFrameFromSource): Ditto.
2952         (WebCore::ContentSecurityPolicy::allowImageFromSource): Ditto.
2953         (WebCore::ContentSecurityPolicy::allowStyleFromSource): Ditto.
2954         (WebCore::ContentSecurityPolicy::allowFontFromSource): Ditto.
2955         (WebCore::ContentSecurityPolicy::allowMediaFromSource): Ditto.
2956         (WebCore::ContentSecurityPolicy::allowConnectToSource): Ditto.
2957         (WebCore::ContentSecurityPolicy::allowFormAction): Ditto.
2958         (WebCore::ContentSecurityPolicy::allowBaseURI): Ditto.
2959         * page/ContentSecurityPolicy.h:
2960         * page/DOMSecurityPolicy.cpp:
2961         * page/EventSource.cpp:
2962         (WebCore::EventSource::create): Pass shouldBypassMainWorldContentSecurityPolicy to ContentSecurityPolicy::allowConnectToSource().
2963         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
2964         (WebCore::WebCoreAVFResourceLoader::startLoading): Instantiate ResourceLoaderOptions passing placeholder value ContentSecurityPolicyImposition::DoPolicyCheck.
2965         This value does not affect the request because we do not check the Content Security Policy for raw resource requests.
2966         * svg/SVGFEImageElement.cpp:
2967         (WebCore::SVGFEImageElement::requestImageResource): Skip CSP check for a SVG FEImage element in a user agent shadow tree.
2968         * svg/SVGFontFaceUriElement.cpp:
2969         (WebCore::SVGFontFaceUriElement::loadFont): Skip CSP check for a SVG font-face-uri element in a user agent shadow tree.
2970         * svg/SVGUseElement.cpp:
2971         (WebCore::SVGUseElement::updateExternalDocument): Skip CSP check for a SVG use element in a user agent shadow tree.
2972         * testing/Internals.cpp:
2973         (WebCore::Internals::ensureUserAgentShadowRoot): Added.
2974         * testing/Internals.h:
2975         * testing/Internals.idl: Added declaration for ensureUserAgentShadowRoot().
2976         * xml/XMLHttpRequest.cpp:
2977         (WebCore::XMLHttpRequest::open): Pass shouldBypassMainWorldContentSecurityPolicy to ContentSecurityPolicy::allowConnectToSource().
2978
2979 2015-07-06  Brent Fulgham  <bfulgham@apple.com>
2980
2981         Ensure media playback is stopped during page close
2982         https://bugs.webkit.org/show_bug.cgi?id=146554
2983         <rdar://problem/18033944>
2984
2985         Reviewed by Brady Eidson.
2986
2987         * Modules/webaudio/AudioContext.h:
2988         (WebCore::WebAudio::hostingDocument): Added.
2989         * html/HTMLMediaElement.h:
2990         (WebCore::HTMLMediaElement::hostingDocument): Added.
2991         * dom/Document.cpp:
2992         (WebCore::Document::~Document): Call new 'stopAllMediaPlaybackForDocument' at destruction time.
2993         * platform/audio/PlatformMediaSession.h:
2994         Made PlatformMediaSessionManager a friend so it can access the protected 'client' accessor.
2995         Updated PlatformMediaSessionClient to require clients to have a "hostingDocument" member.
2996         * platform/audio/PlatformMediaSessionManager.cpp:
2997         (WebCore::PlatformMediaSessionManager::stopAllMediaPlaybackForDocument): Added. Only pauses
2998         playback on elements that match the provided document.
2999         (WebCore::PlatformMediaSessionManager::stopAllMediaPlaybackForProcess): Added. Pauses playback
3000         on all elements in the current process.
3001         * platform/audio/PlatformMediaSessionManager.h:
3002
3003 2015-07-06  Alex Christensen  <achristensen@webkit.org>
3004
3005         [Content Extensions] Remove memory page reporting
3006         https://bugs.webkit.org/show_bug.cgi?id=146659
3007
3008         Reviewed by Benjamin Poulain.
3009
3010         * contentextensions/CompiledContentExtension.cpp:
3011         (WebCore::ContentExtensions::CompiledContentExtension::~CompiledContentExtension):
3012         (WebCore::ContentExtensions::CompiledContentExtension::globalDisplayNoneSelectors):
3013         * contentextensions/CompiledContentExtension.h:
3014         * contentextensions/ContentExtension.cpp:
3015         (WebCore::ContentExtensions::ContentExtension::globalDisplayNoneStyleSheet):
3016         * contentextensions/ContentExtension.h:
3017         (WebCore::ContentExtensions::ContentExtension::compiledExtension):
3018         * contentextensions/ContentExtensionsBackend.cpp:
3019         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
3020         * contentextensions/DFABytecodeInterpreter.cpp:
3021         (WebCore::ContentExtensions::getBits):
3022         (WebCore::ContentExtensions::getInstruction):
3023         (WebCore::ContentExtensions::jumpSizeInBytes):
3024         (WebCore::ContentExtensions::getJumpSize):
3025         (WebCore::ContentExtensions::getJumpDistance):
3026         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpretAppendAction):
3027         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpretTestFlagsAndAppendAction):
3028         (WebCore::ContentExtensions::DFABytecodeInterpreter::actionsForDefaultStylesheetFromDFARoot):
3029         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
3030         * contentextensions/DFABytecodeInterpreter.h:
3031         Don't keep track of memory page usage.  It wasn't even correct anyways.
3032
3033 2015-07-06  Alex Christensen  <achristensen@webkit.org>
3034
3035         [Content Extensions] Increase maxNFASize
3036         https://bugs.webkit.org/show_bug.cgi?id=146656
3037
3038         Reviewed by Benjamin Poulain.
3039
3040         Because of memory improvements in r186375, r186374, and r186079,
3041         we can now increase the maximum number of NFA nodes in order to avoid
3042         long compile times of some large, complicated content blockers.
3043         This also improves the interpreting time of content blockers.
3044
3045         * contentextensions/ContentExtensionCompiler.cpp:
3046         (WebCore::ContentExtensions::compileRuleList):
3047         Increase maxNFASize to 75000 to avoid long compile times.
3048
3049 2015-07-06  Dean Jackson  <dino@apple.com>
3050
3051         Memory corruption in WebGLRenderingContext::simulateVertexAttrib0
3052         https://bugs.webkit.org/show_bug.cgi?id=146652
3053         <rdar://problem/21567767>
3054
3055         Follow-up fix.
3056
3057         * html/canvas/WebGLRenderingContextBase.cpp:
3058         (WebCore::WebGLRenderingContextBase::simulateVertexAttrib0):
3059
3060 2015-07-06  Dean Jackson  <dino@apple.com>
3061
3062         Memory corruption in WebGLRenderingContext::simulateVertexAttrib0
3063         https://bugs.webkit.org/show_bug.cgi?id=146652
3064         <rdar://problem/21567767>
3065
3066         Reviewed by Brent Fulgham.
3067
3068         The expression "(numVertex + 1) * 4 * sizeof(GC3Dfloat)" could potentially
3069         overflow. Make it use checked arithmetic.
3070
3071         I couldn't make a test case that reliably exercised this.
3072
3073         * html/canvas/WebGLRenderingContextBase.cpp:
3074         (WebCore::WebGLRenderingContextBase::simulateVertexAttrib0): Used Checked<GC3Dsizeiptr>
3075         for calculating the size of the buffer.
3076
3077 2015-07-06  Said Abou-Hallawa  <sabouhallawa@apple.com>
3078
3079         [Mac] REGRESSION: (r181403) Enter/Exit full screen on 1x secondary display plugged into 2x Mac displays WebView as 1/4 size during transition
3080         https://bugs.webkit.org/show_bug.cgi?id=146651
3081
3082         Reviewed by Simon Fraser.
3083
3084         * platform/mac/WebCoreFullScreenPlaceholderView.mm: set layerContentsPlacement
3085         to NSViewLayerContentsPlacementScaleProportionallyToFit so AppKit resizes the
3086         content CALayer to fit in the WebView.
3087
3088 2015-07-06  Benjamin Poulain  <benjamin@webkit.org>
3089
3090         Reduce the memory usage of the prefix tree
3091         https://bugs.webkit.org/show_bug.cgi?id=146615
3092
3093         Reviewed by Sam Weinig.
3094
3095         This patch introduces two little changes that reduces the size
3096         of the prefix tree by about 40%.
3097
3098         First, the Terms are interned. The new class CombinedFiltersAlphabet
3099         takes care of keeping a unique version of each term for use
3100         by the CombinedURLFilters.
3101
3102         Since each Term is fairly big but we have a small number of
3103         unique term, we significantly reduce the edge size.
3104
3105         Second, the actions are no longer stored on each Vertex.
3106         They are now stored on the side, in a HashMap indexed by
3107         their Vertex.
3108
3109         This works well because the Actions are sparse over the tree.
3110         Typically, only the leaves have actions. Internal vertices
3111         sometime get actions but that's uncommon.
3112
3113         ---
3114
3115         The next step to reduce the memory footprint would be to
3116         make PrefixTreeVertex into a custom packed structure instead
3117         of using a Vector.
3118
3119         Such change is very invasive and more error prone so I decided
3120         against it for this patch.
3121
3122         * WebCore.xcodeproj/project.pbxproj:
3123         * contentextensions/CombinedFiltersAlphabet.cpp: Copied from Source/WebCore/contentextensions/CombinedURLFilters.h.
3124         (WebCore::ContentExtensions::TermCreatorTranslator::hash):
3125         (WebCore::ContentExtensions::TermCreatorTranslator::equal):
3126         (WebCore::ContentExtensions::TermCreatorTranslator::translate):
3127         (WebCore::ContentExtensions::CombinedFiltersAlphabet::interned):
3128         (WebCore::ContentExtensions::CombinedFiltersAlphabet::memoryUsed):
3129         * contentextensions/CombinedFiltersAlphabet.h: Copied from Source/WebCore/contentextensions/CombinedURLFilters.h.
3130         (WebCore::ContentExtensions::CombinedFiltersAlphabet::TermPointerHash::hash):
3131         (WebCore::ContentExtensions::CombinedFiltersAlphabet::TermPointerHash::equal):
3132         * contentextensions/CombinedURLFilters.cpp:
3133         (WebCore::ContentExtensions::recursiveMemoryUsed):
3134         (WebCore::ContentExtensions::CombinedURLFilters::memoryUsed):
3135         (WebCore::ContentExtensions::prefixTreeVertexToString):
3136         (WebCore::ContentExtensions::recursivePrint):
3137         (WebCore::ContentExtensions::CombinedURLFilters::addPattern):
3138         (WebCore::ContentExtensions::generateNFAForSubtree):
3139         (WebCore::ContentExtensions::CombinedURLFilters::processNFAs):
3140         * contentextensions/CombinedURLFilters.h:
3141         * contentextensions/ContentExtensionsDebugging.h:
3142         * contentextensions/Term.h:
3143         (WebCore::ContentExtensions::Term::isValid):
3144         (WebCore::ContentExtensions::Term::destroy):
3145         (WebCore::ContentExtensions::Term::memoryUsed):
3146         (WebCore::ContentExtensions::Term::toString): Deleted.
3147         (WebCore::ContentExtensions::TermHash::hash): Deleted.
3148         (WebCore::ContentExtensions::TermHash::equal): Deleted.
3149         (WebCore::ContentExtensions::Term::Term): Deleted.
3150         (WebCore::ContentExtensions::Term::isKnownToMatchAnyString): Deleted.
3151         (WebCore::ContentExtensions::Term::hasFixedLength): Deleted.
3152         (WebCore::ContentExtensions::Term::operator==): Deleted.
3153         (WebCore::ContentExtensions::Term::hash): Deleted.
3154         (WebCore::ContentExtensions::Term::isDeletedValue): Deleted.
3155         (WebCore::ContentExtensions::Term::isUniversalTransition): Deleted.
3156         (WebCore::ContentExtensions::Term::generateSubgraphForAtom): Deleted.
3157
3158 2015-07-06  Benjamin Poulain  <benjamin@webkit.org>
3159
3160         [Content Extensions] Make the DFA transitions ranges instead of characters
3161         https://bugs.webkit.org/show_bug.cgi?id=146575
3162
3163         Reviewed by Alex Christensen.
3164
3165         This patch changes the DFA and code using the DFA to use ranges
3166         to represent the transitions between any two nodes.
3167
3168         This patch builds on top of the tools introduced in r186079.
3169
3170         The DFA structure is basically the same as ImmutableNFA but without
3171         any epsilon transitions.
3172
3173         This patch introduces a transition iterator to make the DFA
3174         compatible with the existing algorithms.
3175
3176         ---
3177
3178         The DFA combiner is rebuilt on top of MutableRangeList. Combining the transitions
3179         of two nodes is one by merging the range list of each not into a common
3180         MutableRangeList.
3181         The data converter takes care of creating the signature of the combination.
3182
3183         The code got simpler since MutableRangeList does most of the work now. It is also
3184         much faster.
3185
3186         ---
3187
3188         The minimizer is more intersting.
3189
3190         With the current algorithm, we cannot resolve overlaps between ranges. On the other
3191         hand, the minimizer does not care about the symbol of the transitions if we are careful
3192         to partition transitions of the same symbol together.
3193
3194         What I did was to turn the minimizer into a pure transition based one, BUT each
3195         "symbol" is actually an unbreakable range.
3196
3197         The first step is to go over all the transitions of all the nodes and find the largest
3198         ranges such that the alphabet of interest is covered but there is not a single intersection
3199         between any two nodes (what I called "singular transitions" in the code). 
3200
3201         This can be done efficiently with MutableRangeList.
3202         A little trick there is that I also used the converter to count how many real transition
3203         overlaps any singular transition.
3204
3205         Those singular transitions become the alphabet of our minimizer. The "symbol" of our alphabet
3206         is simply the position of the singular transition in the list.
3207
3208         The partition of transition is created by populating each set with all the transition that
3209         overlaps the symbols.
3210         Note that since the partition is created on the fly, the Transition structure used for
3211         repartitioning only contains the source of the transitions.
3212
3213         Once our transition parition has been carefuly created, we can completely forget about
3214         the symbols and only work with subsets.
3215
3216         Since the singular transitions have no overlap (unlike fallback transitions), this new minimizer
3217         will find the minimial solution for well formed input.
3218
3219         * WebCore.xcodeproj/project.pbxproj:
3220         * contentextensions/DFA.cpp:
3221         (WebCore::ContentExtensions::DFA::memoryUsed):
3222         (WebCore::ContentExtensions::printTransitions):
3223         (WebCore::ContentExtensions::DFANode::actions): Deleted.
3224         (WebCore::ContentExtensions::DFANode::transitions): Deleted.
3225         (WebCore::ContentExtensions::DFANode::fallbackTransitionDestination): Deleted.
3226         (WebCore::ContentExtensions::DFANode::changeFallbackTransition): Deleted.
3227         (WebCore::ContentExtensions::DFANode::addFallbackTransition): Deleted.
3228         (WebCore::ContentExtensions::DFANode::containsTransition): Deleted.
3229         (WebCore::ContentExtensions::DFANode::kill): Deleted.
3230         (WebCore::ContentExtensions::DFA::debugPrintDot): Deleted.
3231         * contentextensions/DFA.h:
3232         (WebCore::ContentExtensions::DFANode::ConstRangeIterator::range):
3233         (WebCore::ContentExtensions::DFANode::ConstRangeIterator::target):
3234         (WebCore::ContentExtensions::DFANode::RangeIterator::range):
3235         (WebCore::ContentExtensions::DFANode::RangeIterator::target):
3236         (WebCore::ContentExtensions::DFANode::RangeIterator::resetTarget):
3237         * contentextensions/DFABytecodeCompiler.cpp:
3238         (WebCore::ContentExtensions::DFABytecodeCompiler::ranges):
3239         (WebCore::ContentExtensions::DFABytecodeCompiler::nodeTransitionsMaxBytecodeSize):
3240         (WebCore::ContentExtensions::DFABytecodeCompiler::compileNodeTransitions):
3241         * contentextensions/DFACombiner.cpp:
3242         (WebCore::ContentExtensions::DFAMerger::TargetConverter::convert):
3243         (WebCore::ContentExtensions::DFAMerger::TargetConverter::extend):
3244         (WebCore::ContentExtensions::DFAMerger::TargetConverter::setHalfSignature):
3245         (WebCore::ContentExtensions::DFAMerger::merge):
3246         (WebCore::ContentExtensions::DFAMerger::getOrCreateCombinedNode):
3247         (WebCore::ContentExtensions::DFAMerger::setHalfSignature): Deleted.
3248         (WebCore::ContentExtensions::DFAMerger::populateTransitions): Deleted.
3249         (WebCore::ContentExtensions::DFAMerger::populateFromFallbackTransitions): Deleted.
3250         (WebCore::ContentExtensions::DFAMerger::createTransitions): Deleted.
3251         (WebCore::ContentExtensions::DFAMerger::createFallbackTransitionIfNeeded): Deleted.
3252         * contentextensions/DFAMinimizer.cpp:
3253         (WebCore::ContentExtensions::DFAMinimizer::minimize):
3254         * contentextensions/DFANode.cpp: Added.
3255         (WebCore::ContentExtensions::DFANode::actions):
3256         (WebCore::ContentExtensions::DFANode::containsTransition):
3257         (WebCore::ContentExtensions::DFANode::kill):
3258         (WebCore::ContentExtensions::DFANode::canUseFallbackTransition):
3259         (WebCore::ContentExtensions::DFANode::bestFallbackTarget):
3260         * contentextensions/DFANode.h:
3261         (WebCore::ContentExtensions::CharRange::size):
3262         (WebCore::ContentExtensions::DFANode::ConstRangeIterator::operator*):
3263         (WebCore::ContentExtensions::DFANode::ConstRangeIterator::operator==):
3264         (WebCore::ContentExtensions::DFANode::ConstRangeIterator::operator!=):
3265         (WebCore::ContentExtensions::DFANode::ConstRangeIterator::operator++):
3266         (WebCore::ContentExtensions::DFANode::ConstRangeIterator::first):
3267         (WebCore::ContentExtensions::DFANode::ConstRangeIterator::last):
3268         (WebCore::ContentExtensions::DFANode::ConstRangeIterator::data):
3269         (WebCore::ContentExtensions::DFANode::IterableConstRange::begin):
3270         (WebCore::ContentExtensions::DFANode::IterableConstRange::end):
3271         (WebCore::ContentExtensions::DFANode::transitions):
3272         (WebCore::ContentExtensions::DFANode::RangeIterator::operator*):
3273         (WebCore::ContentExtensions::DFANode::RangeIterator::operator==):
3274         (WebCore::ContentExtensions::DFANode::RangeIterator::operator!=):
3275         (WebCore::ContentExtensions::DFANode::RangeIterator::operator++):
3276         (WebCore::ContentExtensions::DFANode::RangeIterator::first):
3277         (WebCore::ContentExtensions::DFANode::RangeIterator::last):
3278         (WebCore::ContentExtensions::DFANode::RangeIterator::data):
3279         (WebCore::ContentExtensions::DFANode::IterableRange::begin):
3280         (WebCore::ContentExtensions::DFANode::IterableRange::end):
3281         (WebCore::ContentExtensions::DFANode::hasFallbackTransition): Deleted.
3282         (WebCore::ContentExtensions::DFANode::transitionsLength): Deleted.
3283         (WebCore::ContentExtensions::DFANode::transitionsStart): Deleted.
3284         (WebCore::ContentExtensions::DFANode::resetTransitions): Deleted.
3285         (WebCore::ContentExtensions::DFANode::setHasFallbackTransitionWithoutChangingDFA): Deleted.
3286         * contentextensions/ImmutableNFA.h:
3287         (WebCore::ContentExtensions::ImmutableNFA::ConstRangeIterator::first):
3288         (WebCore::ContentExtensions::ImmutableNFA::ConstRangeIterator::last):
3289         (WebCore::ContentExtensions::ImmutableNFA::ConstRangeIterator::data):
3290         (WebCore::ContentExtensions::ImmutableNFA::ConstRangeIterator::range):
3291         (WebCore::ContentExtensions::ImmutableNFA::ConstRangeIterator::operator*): Deleted.
3292         (WebCore::ContentExtensions::ImmutableNFA::ConstRangeIterator::operator->): Deleted.
3293         * contentextensions/ImmutableNFANodeBuilder.h:
3294         (WebCore::ContentExtensions::ImmutableNFANodeBuilder::FakeRangeIterator::first):
3295         (WebCore::ContentExtensions::ImmutableNFANodeBuilder::FakeRangeIterator::last):
3296         (WebCore::ContentExtensions::ImmutableNFANodeBuilder::FakeRangeIterator::operator*): Deleted.
3297         (WebCore::ContentExtensions::ImmutableNFANodeBuilder::FakeRangeIterator::operator->): Deleted.
3298         * contentextensions/MutableRange.h:
3299         (WebCore::ContentExtensions::MutableRange::size): Deleted.
3300         * contentextensions/MutableRangeList.h:
3301         (WebCore::ContentExtensions::MutableRangeList::ConstIterator::first):
3302         (WebCore::ContentExtensions::MutableRangeList::ConstIterator::last):
3303         (WebCore::ContentExtensions::MutableRangeList::ConstIterator::data):
3304         (WebCore::ContentExtensions::MutableRangeList::extend):
3305         (WebCore::ContentExtensions::MutableRangeList::size):
3306         (WebCore::ContentExtensions::MutableRangeList::initializeFrom):
3307         * contentextensions/NFAToDFA.cpp:
3308         (WebCore::ContentExtensions::NFAToDFA::convert):
3309         (WebCore::ContentExtensions::canUseFallbackTransition): Deleted.
3310         (WebCore::ContentExtensions::findBestFallbackTarget): Deleted.
3311
3312 2015-07-06  Timothy Hatcher  <timothy@apple.com>
3313
3314         Fix ASSERT causing crashes in Inspector tests on the bots.
3315
3316         * inspector/InspectorPageAgent.cpp:
3317         (WebCore::InspectorPageAgent::enable): Reset stopwatch before starting it.
3318
3319 2015-07-06  Brady Eidson  <beidson@apple.com>
3320
3321         Remove unused "m_isPrivate" flag on NetworkStorageSession.
3322         https://bugs.webkit.org/show_bug.cgi?id=146648
3323
3324         Reviewed by Alex Christensen.
3325
3326         No new tests (No behavior change).
3327
3328         * platform/network/NetworkStorageSession.h:
3329         (WebCore::NetworkStorageSession::isPrivateBrowsingSession): Deleted.
3330
3331         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
3332         (WebCore::NetworkStorageSession::NetworkStorageSession): Deleted.
3333         (WebCore::NetworkStorageSession::createPrivateBrowsingSession): Deleted.
3334
3335         * platform/network/soup/NetworkStorageSessionSoup.cpp:
3336         (WebCore::NetworkStorageSession::NetworkStorageSession): Deleted.
3337         (WebCore::NetworkStorageSession::createPrivateBrowsingSession): Deleted.
3338
3339 2015-07-04  Timothy Hatcher  <timothy@apple.com>
3340
3341         Web Inspector: Add a dedicated Network tab that is always live
3342         https://bugs.webkit.org/show_bug.cgi?id=146568
3343
3344         Make sure the executionStopwatch is always started and never stops so resource loads
3345         always get timestamps, even when Timeline is not recording.
3346
3347         Reviewed by Joseph Pecoraro.
3348
3349         * inspector/InspectorPageAgent.cpp:
3350         (WebCore::InspectorPageAgent::enable): Start executionStopwatch.
3351         (WebCore::InspectorPageAgent::frameStartedLoading): Reset and start executionStopwatch.
3352         * inspector/InspectorTimelineAgent.cpp:
3353         (WebCore::InspectorTimelineAgent::internalStart): Removed executionStopwatch code.
3354         (WebCore::InspectorTimelineAgent::internalStop): Ditto.
3355
3356 2015-07-02  Timothy Hatcher  <timothy@apple.com>
3357
3358         Update the localized strings file.
3359
3360         * English.lproj/Localizable.strings: Updated with the script.
3361
3362 2015-07-06  Zalan Bujtas  <zalan@apple.com>
3363
3364         Crash: LayoutState root's container is nullptr when the layout root is detached.
3365         https://bugs.webkit.org/show_bug.cgi?id=146646
3366         rdar://problem/21371544
3367
3368         Reviewed by Simon Fraser.
3369
3370         This is a speculative fix to ensure that when the root of the LayoutState is detached
3371         we don't try to access its container (nullptr).
3372         This is related to trac.webkit.org/r185484.
3373
3374         Not reproducible.
3375
3376         * rendering/LayoutState.cpp:
3377         (WebCore::LayoutState::LayoutState):
3378         * rendering/LayoutState.h:
3379         (WebCore::LayoutState::LayoutState): Deleted.
3380
3381 2015-07-06  Eric Carlson  <eric.carlson@apple.com>
3382
3383         [Mac] Inactive AirPlay route should automatically timeout
3384         https://bugs.webkit.org/show_bug.cgi?id=146642
3385         <rdar://problem/21602955>
3386
3387         Automatically clear a media element's AirPlay connection after it has been paused
3388         for 60 minutes, or after 8 minutes if it played to the end before pausing.
3389
3390         Reviewed by Brent Fulgham.
3391
3392         * Modules/mediasession/WebMediaSessionManager.cpp:
3393         (WebCore::WebMediaSessionManager::WebMediaSessionManager): Initialize m_watchdogTimer.
3394         (WebCore::WebMediaSessionManager::clientStateDidChange): Schedule watchdog timer configuration
3395           if the client started playing or paused.
3396         (WebCore::WebMediaSessionManager::configurePlaybackTargetClients): Schedule watchdog timer configuration.
3397         (WebCore::WebMediaSessionManager::toString): Print watchdog configuration flag.
3398         (WebCore::WebMediaSessionManager::taskTimerFired): Call configureWatchdogTimer.
3399         (WebCore::WebMediaSessionManager::configureWatchdogTimer): New, start or stop watchdog timer.
3400         (WebCore::WebMediaSessionManager::watchdogTimerFired): Stop monitoring for targets, which 
3401           clears the route.
3402         * Modules/mediasession/WebMediaSessionManager.h:
3403
3404         * html/HTMLMediaElement.cpp:
3405         (WebCore::HTMLMediaElement::mediaState): Set DidPlayToEnd when appropriate.
3406
3407         * page/MediaProducer.h: Add DidPlayToEnd.
3408
3409         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
3410         (WebCore::MediaPlaybackTargetPickerMac::~MediaPlaybackTargetPickerMac): Clear m_client, call
3411           stopMonitoringPlaybackTargets.
3412         (WebCore::MediaPlaybackTargetPickerMac::pendingActionTimerFired): Send a neutered 
3413           MediaPlaybackTarget when m_outputDeviceMenuController is NULL.
3414         (WebCore::MediaPlaybackTargetPickerMac::devicePicker): Add logging.
3415         (WebCore::MediaPlaybackTargetPickerMac::stopMonitoringPlaybackTargets): Clear the menu
3416           controller to cancel the route.
3417
3418 2015-07-06  Zan Dobersek  <zdobersek@igalia.com>
3419
3420         [GTK] Fix build errors with OpenGL ES
3421         https://bugs.webkit.org/show_bug.cgi?id=146626
3422
3423         Reviewed by Carlos Garcia Campos.
3424
3425         * platform/graphics/ANGLEWebKitBridge.h: Include <GLES2/gl2.h>
3426         when building with OpenGL ES 2 support enabled.
3427         (WebCore::ANGLEShaderSymbol::isSampler): Don't test for
3428         OpenGL-specific GL_SAMPLER_2D_RECT_ARB value when OpenGL ES 2
3429         support is enabled.
3430
3431 2015-07-06  Youenn Fablet  <youenn.fablet@crf.canon.fr>
3432
3433         [Streams API] Remove ReadableStream custom constructor
3434         https://bugs.webkit.org/show_bug.cgi?id=146547
3435
3436         Reviewed by Darin Adler.
3437
3438         Removed custom binding.
3439         Made use of Dictionary in lieu of JSObject to reduce readable stream constructor parameter parsing.
3440         Added support for passing ExecState to construtor within binding generator.
3441
3442         No change in behavior.
3443
3444         * Modules/streams/ReadableStream.cpp:
3445         (WebCore::ReadableStream::create):
3446         * Modules/streams/ReadableStream.h:
3447         (WebCore::ReadableStream::create):
3448         * Modules/streams/ReadableStream.idl:
3449         * bindings/js/JSDictionary.cpp:
3450         (WebCore::JSDictionary::convertValue):
3451         * bindings/js/JSDictionary.h:
3452         * bindings/js/JSReadableStreamCustom.cpp:
3453         * bindings/js/ReadableJSStream.cpp:
3454         (WebCore::ReadableJSStream::create):
3455         (WebCore::ReadableJSStream::ReadableJSStream):
3456         * bindings/js/ReadableJSStream.h:
3457         * bindings/scripts/CodeGeneratorJS.pm:
3458         (GenerateConstructorDefinition):
3459         * bindings/scripts/IDLAttributes.txt:
3460
3461 2015-07-06  Youenn Fablet  <youenn.fablet@crf.canon.fr>
3462
3463         Promise-returning functions should reject promises if the callee is not of the expected type
3464         https://bugs.webkit.org/show_bug.cgi?id=146585
3465
3466         Reviewed by Darin Adler.
3467
3468         Updated binding generator to reject promise in case the casting of the thisValue is not working properly
3469         (i.e. the callee is not wrapping a DOM object of the expected class.
3470
3471         Covered by rebased test and binding expectations.
3472
3473         * bindings/js/JSDOMPromise.h:
3474         (WebCore::callPromiseFunction): Removed wrapper class parameter.
3475         * bindings/scripts/CodeGeneratorJS.pm:
3476         (GenerateImplementation):
3477         * bindings/scripts/test/JS/JSTestObj.cpp: Updated binding expectations.
3478         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunction):
3479         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionPromise):
3480         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithFloatArgument):
3481         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithFloatArgumentPromise):
3482         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithException):
3483         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithExceptionPromise):
3484         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithOptionalIntArgument):
3485         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithOptionalIntArgumentPromise):
3486
3487 2015-07-05  Chris Dumez  <cdumez@apple.com>
3488
3489         [WK2] Current page's scroll position is lost when transferring sessionState from one view to another
3490         https://bugs.webkit.org/show_bug.cgi?id=146625
3491         <rdar://problem/21585268>
3492
3493         Reviewed by Gavin Barraclough.
3494
3495         Export HistoryController:saveScrollPositionAndViewStateToItem()
3496         so that it can be called from WebKit2.
3497
3498         * loader/HistoryController.h:
3499
3500 2015-07-05  Simon Fraser  <simon.fraser@apple.com>
3501
3502         REGRESSION (r180582): background-attachment: local; does not scroll the background image when scrolling the the element's contents
3503         https://bugs.webkit.org/show_bug.cgi?id=146623
3504
3505         Reviewed by Zalan Bujtas.
3506         
3507         r180582 erroneously asserted that m_destOrigin in BackgroundImageGeometry was unused.
3508         However, it is needed to compute the correct phase when the destination rect is
3509         altered by clipping.
3510
3511         Test: fast/backgrounds/background-attachment-local.html
3512
3513         * rendering/RenderBoxModelObject.cpp:
3514         (WebCore::RenderBoxModelObject::paintFillLayerExtended):
3515         (WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry):
3516         * rendering/RenderBoxModelObject.h:
3517         (WebCore::BackgroundImageGeometry::BackgroundImageGeometry):
3518         (WebCore::BackgroundImageGeometry::relativePhase):
3519         * rendering/svg/RenderSVGResourceMasker.cpp:
3520         (WebCore::RenderSVGResourceMasker::drawMaskForRenderer):
3521
3522 2015-07-05  Chris Dumez  <cdumez@apple.com>
3523
3524         [WK2] WebBackForwardListItems' pageState is not kept up-to-date
3525         https://bugs.webkit.org/show_bug.cgi?id=146614
3526         <rdar://problem/21585268>
3527
3528         Reviewed by Gavin Barraclough.
3529
3530         WebBackForwardListItems' pageState on UIProcess-side were not kept
3531         up-to-date when it was updated on WebContent process side. This meant
3532         that we were losing the scroll position (among other things) when
3533         transferring the session state over from one view to another.
3534
3535         We now call notifyHistoryItemChanged(item) after saving the scroll
3536         position and the view state on the HistoryItem. As a result, the
3537         WebBackForwardListProxy will send the updated pageState to the
3538         UIProcess.
3539
3540         * history/HistoryItem.cpp:
3541         (WebCore::HistoryItem::notifyChanged):
3542         * history/HistoryItem.h:
3543         * loader/HistoryController.cpp:
3544         (WebCore::HistoryController::saveScrollPositionAndViewStateToItem):
3545
3546 2015-07-04  Chris Dumez  <cdumez@apple.com>
3547
3548         Unreviewed Windows build fix after r186279.
3549
3550         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
3551         (WebCore::AVFWrapper::destroyVideoLayer):
3552         * platform/graphics/ca/win/CACFLayerTreeHost.cpp:
3553         (WebCore::CACFLayerTreeHost::destroyRenderer):
3554
3555 2015-07-04  Chris Dumez  <cdumez@apple.com>
3556
3557         Drop RefPtr::clear() method
3558         https://bugs.webkit.org/show_bug.cgi?id=146556
3559
3560         Reviewed by Brady Eidson.
3561
3562         Drop RefPtr::clear() method in favor of "= nullptr;" pattern.
3563
3564 2015-07-03  Dan Bernstein  <mitz@apple.com>
3565
3566         Fixed the iOS 8 build.
3567
3568         * editing/cocoa/HTMLConverter.mm:
3569
3570 2015-07-03  Chris Dumez  <cdumez@apple.com>
3571
3572         REGRESSION (r178097): HTMLSelectElement.add(option, undefined) prepends option to the list of options; should append to the end of the list of options
3573         https://bugs.webkit.org/show_bug.cgi?id=146566
3574         <rdar://problem/21663919>
3575
3576         Reviewed by Ryosuke Niwa.
3577
3578         HTMLSelectElement.add(X, undefined) is supposed to be equivalent to
3579         HTMLSelectElement.add(X) which should *append* X. The same is true
3580         for HTMLOptionsCollection.add(X, undefined).
3581
3582         However, due to a bug in our bindings generator for overloaded
3583         operations, the actual behavior was not the expected one. The
3584         second overload would be chosen: add(X, index) and undefined would
3585         be converted as 0-index, which would *prepend* X.
3586
3587         This patch fixes the bindings generator so that undefined is allowed
3588         for optional parameters of an overload operation, when doing the
3589         overload resolution.
3590
3591         Tests:
3592         - fast/dom/HTMLSelectElement/add.html
3593         - fast/dom/HTMLSelectElement/options-collection-add.html
3594         - http/tests/websocket/tests/hybi/undefined-protocol.html
3595
3596         * bindings/scripts/CodeGeneratorJS.pm:
3597         (GenerateParametersCheckExpression):
3598         Allow undefined value for optional parameters when doing the overload
3599         resolution.
3600
3601         * bindings/scripts/test/JS/JSTestObj.cpp:
3602         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod):
3603         (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter1):
3604         (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter2):
3605         (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter):
3606         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
3607         (WebCore::JSTestOverloadedConstructorsConstructor::constructJSTestOverloadedConstructors):
3608         * bindings/scripts/test/TestObj.idl:
3609         Add bindings tests coverage and rebaseline.
3610
3611 2015-07-03  Dan Bernstein  <mitz@apple.com>
3612
3613         Fixed the Mavericks build after r186236.
3614
3615         * loader/cache/CachedResource.h:
3616         (WebCore::CachedResource::url): Removed the export macro from this inline function.
3617
3618 2015-07-03  Dan Bernstein  <mitz@apple.com>
3619
3620         Tried to fix the iOS build.
3621
3622         * bridge/objc/objc_class.mm:
3623         (JSC::Bindings::ObjcClass::fieldNamed):
3624
3625 2015-07-03  Dan Bernstein  <mitz@apple.com>
3626
3627         Tried to fix the iOS build.
3628
3629         * editing/cocoa/HTMLConverter.mm:
3630
3631 2015-07-03  Dan Bernstein  <mitz@apple.com>
3632
3633         Tried to fix the iOS build.
3634
3635         * page/FrameView.cpp:
3636         (WebCore::FrameView::calculateExtendedBackgroundMode):
3637
3638 2015-07-03  Dan Bernstein  <mitz@apple.com>
3639
3640         [Xcode] Update some build settings as recommended by Xcode 7
3641         https://bugs.webkit.org/show_bug.cgi?id=146597
3642
3643         Reviewed by Sam Weinig.
3644
3645         * Configurations/Base.xcconfig: Enabled CLANG_WARN_UNREACHABLE_CODE,
3646         GCC_WARN_UNDECLARED_SELECTOR, and GCC_NO_COMMON_BLOCKS. Removed GCC_MODEL_TUNING.
3647
3648         * WebCore.xcodeproj/project.pbxproj: Updated LastUpgradeCheck. Disabled -Wunreachable-code
3649         for two bison-generated source files. Updated for rename of WebScriptObject.h.
3650
3651         * bindings/objc/WebScriptObject.mm:
3652         (-[WebUndefined dealloc]): Removed unreachable code and suppressed warning about not calling
3653         super.
3654         * bridge/objc/WebScriptObject.h: Renamed to WebScriptObjectProtocol.h to enabled inlcuding
3655         the other WebScriptObject.h.
3656         * bridge/objc/WebScriptObjectProtocol.h: Renamed from WebScriptObject.h.
3657
3658         * bridge/objc/objc_class.mm: Updated for rename and included WebScriptObject.h because we
3659         use selectors declared in that file.
3660
3661         * bridge/objc/objc_instance.mm: Ditto.
3662         (ObjCRuntimeMethod::create): Resolved ambiguity between JSC::JSValue and the Objective-C
3663         JSValue class.
3664         (ObjCRuntimeMethod::createStructure): Ditto.
3665         (ObjcInstance::invokeMethod): Ditto.
3666         (ObjcInstance::invokeObjcMethod): Ditto.
3667         (ObjcInstance::invokeDefaultMethod): Ditto.
3668         (ObjcInstance::setValueOfUndefinedField): Ditto.
3669         (ObjcInstance::getValueOfUndefinedField): Ditto.
3670         (ObjcInstance::defaultValue): Ditto.
3671         (ObjcInstance::stringValue): Ditto.
3672         (ObjcInstance::numberValue): Ditto.
3673         (ObjcInstance::booleanValue): Ditto.
3674         (ObjcInstance::valueOf): Ditto,
3675
3676         * bridge/objc/objc_runtime.h: Moved definition of isFallbackMethod() from here to the
3677         implementation.
3678         * bridge/objc/objc_runtime.mm: Updated for rename and included WebScriptObject.h because we
3679         use selectors declared in that file.
3680         (JSC::Bindings::ObjcMethod::isFallbackMethod): Moved definition from the header to here.
3681
3682         * bridge/objc/objc_utility.mm: Updated for rename.
3683
3684         * cssjit/SelectorCompiler.cpp:
3685         (WebCore::SelectorCompiler::addScrollbarPseudoClassType): Removed unreachable code.
3686
3687         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
3688         Added declarations to the WebCoreMovieObserver interface.
3689         (WebCore::MediaPlayerPrivateQTKit::disableUnsupportedTracks): Suppressed
3690         -Wundeclared-selector around invocation of a selector that is not declared anywhere.
3691
3692 2015-07-03  Kyounga Ra  <kyounga@alticast.com>
3693
3694         Memory leak for a protected Element having pending events in ImageLoader. 
3695         https://bugs.webkit.org/show_bug.cgi?id=146538
3696
3697         Reviewed by Brady Eidson.
3698
3699         If ImageLoader is destroyed before an active derefElementTimer is fired, protected element's refCount never be zero..
3700
3701         * loader/ImageLoader.cpp:
3702         (WebCore::ImageLoader::~ImageLoader):
3703         (WebCore::ImageLoader::updateFromElement):
3704         (WebCore::ImageLoader::updateRenderer):
3705         (WebCore::ImageLoader::updatedHasPendingEvent):
3706         (WebCore::ImageLoader::timerFired):
3707         * loader/ImageLoader.h:
3708
3709 2015-07-03  Daniel Bates  <dabates@apple.com>
3710
3711         REGRESSION (r178097): JavaScript TypeError after clicking on compose button in Yahoo Mail
3712         https://bugs.webkit.org/show_bug.cgi?id=146515
3713         <rdar://problem/21348421>
3714
3715         Reviewed by Chris Dumez.
3716
3717         Fixes an issue where extra arguments passed to a Web IDL overloaded function, whose implementation
3718         is generated by the bindings generator script, are not ignored as per the note in section "Interface object [[Call]] method"
3719         of the Web IDL spec, <http://www.w3.org/TR/2012/CR-WebIDL-20120419/> (19 April 2012).
3720
3721         Currently for an overloaded function the JavaScript bindings generator script emits code to
3722         throw a TypeError when it cannot find a candidate function that takes the same number of
3723         arguments as passed by a caller. Prior to the change made in bug #139179 (r178097), the
3724         bindings code for HTMLSelectElement.add() was written by hand and ignored extra arguments
3725         that were passed to it. Following this change, the bindings code for HTMLSelectElement.add()
3726         is generated by the bindings generator script. Therefore, we throw a TypeError when Yahoo Mail
3727         calls HTMLSelectElement.add() with extra arguments because the code emitted by the bindings
3728         generator script does not ignore them.
3729
3730         * bindings/scripts/CodeGeneratorJS.pm:
3731         (LengthOfLongestFunctionParameterList): Added. Computes the length of longest overload parameter list.
3732         (GenerateOverloadedFunction): Emit code that ignores more arguments than LengthOfLongestFunctionParameterList().
3733         (GenerateOverloadedConstructorDefinition): Ditto.
3734         * bindings/scripts/test/JS/JSTestObj.cpp:
3735         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod12): Added; expected result for an overloaded
3736         function that takes a variadic number of Blob elements.
3737         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod): Update expected result. The added
3738         if-conditional expression for the IDL declaration overloadedMethod(Blob... blobArgs) is empty
3739         because we do not support overloading of functions with variadic arguments.
3740         (WebCore::jsTestObjConstructorFunctionOverloadedMethod1):
3741         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
3742         (WebCore::JSTestOverloadedConstructorsConstructor::constructJSTestOverloadedConstructors5): Added; expected
3743         result for an overloaded constructors that takes a variadic number of long arguments.
3744         (WebCore::JSTestOverloadedConstructorsConstructor::constructJSTestOverloadedConstructors): Update expected
3745         result. The added if-conditional expression for the IDL declaration Constructor(long... longArgs) is empty
3746         because we do not support overloading of constructors with variadic arguments.
3747         * bindings/scripts/test/TestObj.idl: Added declaration overloadedMethod(Blob...). Also fixed
3748         typo in license block text.
3749         * bindings/scripts/test/TestOverloadedConstructors.idl: Added declaration Constructor(long... longArgs).
3750         Also fixed typo in license block text.
3751
3752 2015-07-03  Mario Sanchez Prada  <mario@endlessm.com>
3753
3754         Crash on xLarge memory allocation using bmalloc on 32bit systems
3755         https://bugs.webkit.org/show_bug.cgi?id=146440
3756
3757         Reviewed by Gustavo Noronha Silva.
3758
3759         Disable the gcc's -ftree-sra optimization (automatically enabled
3760         with -O1 and higher levels) for WebCore and 32bit Intel architectures,
3761         as that causes the crash in bmalloc when allocating large amounts of
3762         memory from the texture mapper's tiled backing store implementation.
3763
3764         * CMakeLists.txt: Pass -fno-free-sra to gcc on 32bit Intel architectures.
3765
3766 2015-07-03  Csaba Osztrogonác  <ossy@webkit.org>
3767
3768         Fix the !ENABLE(VIDEO) build after r186054
3769         https://bugs.webkit.org/show_bug.cgi?id=146592
3770
3771         Reviewed by Eric Carlson.
3772
3773         * platform/MemoryPressureHandler.cpp:
3774         (WebCore::MemoryPressureHandler::releaseCriticalMemory):
3775
3776 2015-07-03  Youenn Fablet  <youenn.fablet@crf.canon.fr>
3777
3778         [Streams API] Remove ReadableStream and Reader cancel() custom binding
3779         https://bugs.webkit.org/show_bug.cgi?id=146458
3780
3781         Reviewed by Darin Adler.
3782
3783         Removed stream and reader cancel custom binding.
3784         Updated binding generator to correctly handle promise-based APIs with optional parameters.
3785
3786         No behavior changes.
3787
3788         * Modules/streams/ReadableStream.idl: Removed custom
3789         * Modules/streams/ReadableStreamReader.idl: Ditto.
3790         * bindings/js/JSReadableStreamCustom.cpp:
3791         (WebCore::JSReadableStream::cancel): Deleted.
3792         * bindings/js/JSReadableStreamReaderCustom.cpp:
3793         (WebCore::JSReadableStreamReader::cancel): Deleted.
3794         * bindings/scripts/CodeGeneratorJS.pm: Handling of promise parameter in case of optional arguments.
3795         (GenerateParametersCheck):
3796         (GenerateReturnParameters): Utility function to generate return parameters (exception and promise).
3797         * bindings/scripts/test/JS/JSTestObj.cpp:
3798         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithOptionalIntArgument):
3799         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithOptionalIntArgumentPromise):
3800         * bindings/scripts/test/TestObj.idl:
3801
3802
3803 2015-07-02  Doug Russell  <d_russell@apple.com>
3804
3805         AX: Selection change as a result of focusing an element should include that 
3806         information in the intent
3807         https://bugs.webkit.org/show_bug.cgi?id=146533
3808
3809         Reviewed by Chris Fleizach.
3810
3811         Added focusChange flag to AXTextStateChangeIntent.
3812         Added intent support to selection logic called by Element::updateFocusAppearance().
3813         Added NSAccessibilityTextSelectionChangedFocus to mac notifications.
3814
3815         Test: platform/mac/accessibility/selection-notification-focus-change.html
3816
3817         * accessibility/AXObjectCache.cpp:
3818         (WebCore::AXObjectCache::postTextStateChangeNotification):
3819         * accessibility/AXTextStateChangeIntent.h:
3820         * accessibility/AccessibilityRenderObject.cpp:
3821         (WebCore::setTextSelectionIntent):
3822         (WebCore::AccessibilityRenderObject::setFocused):
3823         * accessibility/mac/AXObjectCacheMac.mm:
3824         (WebCore::AXObjectCache::postTextStateChangePlatformNotification):
3825         * dom/Element.cpp:
3826         (WebCore::Element::updateFocusAppearance):
3827         * dom/Element.h:
3828         (WebCore::Element::defaultFocusTextStateChangeIntent):
3829         * editing/FrameSelection.cpp:
3830         (WebCore::FrameSelection::moveWithoutValidationTo):
3831         (WebCore::FrameSelection::setSelectionByMouseIfDifferent):
3832         (WebCore::FrameSelection::selectAll):
3833         * editing/FrameSelection.h:
3834         * html/HTMLInputElement.cpp:
3835         (WebCore::HTMLInputElement::updateFocusAppearance):
3836         * html/HTMLTextAreaElement.cpp:
3837         (WebCore::HTMLTextAreaElement::updateFocusAppearance):
3838         * html/HTMLTextFormControlElement.cpp:
3839         (WebCore::HTMLTextFormControlElement::select):
3840         (WebCore::HTMLTextFormControlElement::setSelectionRange):
3841         (WebCore::HTMLTextFormControlElement::restoreCachedSelection):
3842         * html/HTMLTextFormControlElement.h:
3843         * page/EventHandler.cpp:
3844         (WebCore::setInitialKeyboardSelection):
3845         * page/FocusController.cpp:
3846         (WebCore::FocusController::advanceFocusInDocumentOrder):
3847
3848 2015-07-02  Przemek Piorkowski  <piorkowskiprzemyslaw@gmail.com>
3849
3850         [EFL] test_ewk2_application_cache_manager has been failed since r185527
3851         https://bugs.webkit.org/show_bug.cgi?id=146016
3852
3853         Reviewed by Gyuyoung Kim.
3854
3855         In order to handle properly WebApplicationCacheManagerProxy implementation which use
3856         WebsiteDataRecord it is necessary to enable PUBLIC_SUFFIX_LIST for EFL. 
3857         Implementation of PUBLIC_SUFFIX_LIST already exists for soup so EFL can use it as well.
3858
3859         * PlatformEfl.cmake: PublicSuffixSoup.cpp added to source files.
3860
3861 2015-07-02  Commit Queue  <commit-queue@webkit.org>
3862
3863         Unreviewed, rolling out r186251.
3864         https://bugs.webkit.org/show_bug.cgi?id=146573
3865
3866         caused crashes in webaudio tests (Requested by cdumez on
3867         #webkit).
3868
3869         Reverted changeset:
3870
3871         "Ensure media playback is stopped during page close"
3872         https://bugs.webkit.org/show_bug.cgi?id=146554
3873         http://trac.webkit.org/changeset/186251
3874
3875 2015-07-02  Brent Fulgham  <bfulgham@apple.com>
3876
3877         Ensure media playback is stopped during page close
3878         https://bugs.webkit.org/show_bug.cgi?id=146554
3879         <rdar://problem/18033944>
3880
3881         Reviewed by Zalan Bujtas.
3882
3883         Add new method to Page class to stop all media playback. It just uses the process
3884         MediaSessionManager singleton to inform all hosted in a particular document to stop.
3885
3886         * Modules/webaudio/AudioContext.h:
3887         (WebCore::WebAudio::hostingDocument): Added.
3888         * html/HTMLMediaElement.h:
3889         (WebCore::HTMLMediaElement::hostingDocument): Added.
3890         * dom/Document.cpp:
3891         (WebCore::Document::commonTeardown): Call the new PlatformMediaSessionManager::stopAllMediaPlaybackForDocument
3892         method on document cleanup.
3893         * platform/audio/PlatformMediaSession.h:
3894         Made PlatformMediaSessionManager a friend so it can access the protected 'client' accessor.
3895         Updated PlatformMediaSessionClient to require clients to have a "hostingDocument" member.
3896         * platform/audio/PlatformMediaSessionManager.cpp:
3897         (WebCore::PlatformMediaSessionManager::stopAllMediaPlaybackForDocument): Added. Only pauses
3898         playback on elements that match the provided document.
3899         * platform/audio/PlatformMediaSessionManager.h:
3900
3901 2015-07-02  Dean Jackson  <dino@apple.com>
3902
3903         Tapping a video in Safari causes the video to flash gray for a quick moment
3904         https://bugs.webkit.org/show_bug.cgi?id=146570
3905         <rdar://problem/21325181>
3906
3907         Reviewed by Brent Fulgham.
3908
3909         On iOS, video elements should not show the tap highlight.
3910
3911         * css/html.css:
3912         (video):
3913
3914 2015-07-02  Dean Jackson  <dino@apple.com>
3915
3916         WebKit should use 80% white background for PiP indicator
3917         https://bugs.webkit.org/show_bug.cgi?id=146444
3918         <rdar://problem/21555726>
3919
3920         Reviewed by Brent Fulgham.
3921
3922         The designers wanted 80% white, not 80% black (r186104).
3923         I've also reverted the AirPlay background back to black.
3924
3925         * Modules/mediacontrols/mediaControlsiOS.css:
3926         (audio::-webkit-media-controls-wireless-playback-status):
3927         (audio::-webkit-media-controls-wireless-playback-status.small):
3928         (audio::-webkit-media-controls-wireless-playback-status.picture-in-picture):
3929
3930 2015-07-02  Eric Carlson  <eric.carlson@apple.com>
3931
3932         [Mac] Clear current AirPlay source before setting another
3933         https://bugs.webkit.org/show_bug.cgi?id=145959
3934
3935         Reviewed by Brent Fulgham.
3936
3937         * Modules/mediasession/WebMediaSessionManager.cpp:
3938         (WebCore::WebMediaSessionManager::clientStateDidChange): Don't make a client begin playing 
3939           to the target just because it has paused.
3940         (WebCore::WebMediaSessionManager::configurePlaybackTargetClients): Always select a client that
3941           requrested the picker, and never consider paused clients when choosing a client to begin
3942           playing to the targer. Call setShouldPlayToPlaybackTarget(true) after all of the other 
3943           clients have been told to stop playing to the target.
3944
3945 2015-07-02  Beth Dakin  <bdakin@apple.com>
3946
3947         Allow the UIDelegate to customize an image preview
3948         https://bugs.webkit.org/show_bug.cgi?id=146557
3949         -and corresponding-
3950         rdar://problem/21657424
3951
3952         Reviewed by Tim Horton.
3953
3954         Add WEBCORE_EXPORT to use this in WK2.
3955         * loader/cache/CachedResource.h:
3956         (WebCore::CachedResource::url):
3957
3958 2015-07-02  Brady Eidson  <beidson@apple.com>
3959
3960         Add preference to disable all http-equiv.
3961         <rdar://problem/9091261> and https://bugs.webkit.org/show_bug.cgi?id=146553
3962
3963         Reviewed by Sam Weinig.
3964
3965         No new tests (Covered by existing test)
3966
3967         * dom/Document.cpp:
3968         (WebCore::Document::processHttpEquiv):
3969         * page/Settings.in:
3970