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