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