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