1f1e1f7d2e263cb618581e79e3b0852a7da25a16
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2015-07-06  Alex Christensen  <achristensen@webkit.org>
2
3         [Content Extensions] Increase maxNFASize
4         https://bugs.webkit.org/show_bug.cgi?id=146656
5
6         Reviewed by Benjamin Poulain.
7
8         Because of memory improvements in r186375, r186374, and r186079,
9         we can now increase the maximum number of NFA nodes in order to avoid
10         long compile times of some large, complicated content blockers.
11         This also improves the interpreting time of content blockers.
12
13         * contentextensions/ContentExtensionCompiler.cpp:
14         (WebCore::ContentExtensions::compileRuleList):
15         Increase maxNFASize to 75000 to avoid long compile times.
16
17 2015-07-06  Dean Jackson  <dino@apple.com>
18
19         Memory corruption in WebGLRenderingContext::simulateVertexAttrib0
20         https://bugs.webkit.org/show_bug.cgi?id=146652
21         <rdar://problem/21567767>
22
23         Reviewed by Brent Fulgham.
24
25         The expression "(numVertex + 1) * 4 * sizeof(GC3Dfloat)" could potentially
26         overflow. Make it use checked arithmetic.
27
28         I couldn't make a test case that reliably exercised this.
29
30         * html/canvas/WebGLRenderingContextBase.cpp:
31         (WebCore::WebGLRenderingContextBase::simulateVertexAttrib0): Used Checked<GC3Dsizeiptr>
32         for calculating the size of the buffer.
33
34 2015-07-06  Said Abou-Hallawa  <sabouhallawa@apple.com>
35
36         [Mac] REGRESSION: (r181403) Enter/Exit full screen on 1x secondary display plugged into 2x Mac displays WebView as 1/4 size during transition
37         https://bugs.webkit.org/show_bug.cgi?id=146651
38
39         Reviewed by Simon Fraser.
40
41         * platform/mac/WebCoreFullScreenPlaceholderView.mm: set layerContentsPlacement
42         to NSViewLayerContentsPlacementScaleProportionallyToFit so AppKit resizes the
43         content CALayer to fit in the WebView.
44
45 2015-07-06  Benjamin Poulain  <benjamin@webkit.org>
46
47         Reduce the memory usage of the prefix tree
48         https://bugs.webkit.org/show_bug.cgi?id=146615
49
50         Reviewed by Sam Weinig.
51
52         This patch introduces two little changes that reduces the size
53         of the prefix tree by about 40%.
54
55         First, the Terms are interned. The new class CombinedFiltersAlphabet
56         takes care of keeping a unique version of each term for use
57         by the CombinedURLFilters.
58
59         Since each Term is fairly big but we have a small number of
60         unique term, we significantly reduce the edge size.
61
62         Second, the actions are no longer stored on each Vertex.
63         They are now stored on the side, in a HashMap indexed by
64         their Vertex.
65
66         This works well because the Actions are sparse over the tree.
67         Typically, only the leaves have actions. Internal vertices
68         sometime get actions but that's uncommon.
69
70         ---
71
72         The next step to reduce the memory footprint would be to
73         make PrefixTreeVertex into a custom packed structure instead
74         of using a Vector.
75
76         Such change is very invasive and more error prone so I decided
77         against it for this patch.
78
79         * WebCore.xcodeproj/project.pbxproj:
80         * contentextensions/CombinedFiltersAlphabet.cpp: Copied from Source/WebCore/contentextensions/CombinedURLFilters.h.
81         (WebCore::ContentExtensions::TermCreatorTranslator::hash):
82         (WebCore::ContentExtensions::TermCreatorTranslator::equal):
83         (WebCore::ContentExtensions::TermCreatorTranslator::translate):
84         (WebCore::ContentExtensions::CombinedFiltersAlphabet::interned):
85         (WebCore::ContentExtensions::CombinedFiltersAlphabet::memoryUsed):
86         * contentextensions/CombinedFiltersAlphabet.h: Copied from Source/WebCore/contentextensions/CombinedURLFilters.h.
87         (WebCore::ContentExtensions::CombinedFiltersAlphabet::TermPointerHash::hash):
88         (WebCore::ContentExtensions::CombinedFiltersAlphabet::TermPointerHash::equal):
89         * contentextensions/CombinedURLFilters.cpp:
90         (WebCore::ContentExtensions::recursiveMemoryUsed):
91         (WebCore::ContentExtensions::CombinedURLFilters::memoryUsed):
92         (WebCore::ContentExtensions::prefixTreeVertexToString):
93         (WebCore::ContentExtensions::recursivePrint):
94         (WebCore::ContentExtensions::CombinedURLFilters::addPattern):
95         (WebCore::ContentExtensions::generateNFAForSubtree):
96         (WebCore::ContentExtensions::CombinedURLFilters::processNFAs):
97         * contentextensions/CombinedURLFilters.h:
98         * contentextensions/ContentExtensionsDebugging.h:
99         * contentextensions/Term.h:
100         (WebCore::ContentExtensions::Term::isValid):
101         (WebCore::ContentExtensions::Term::destroy):
102         (WebCore::ContentExtensions::Term::memoryUsed):
103         (WebCore::ContentExtensions::Term::toString): Deleted.
104         (WebCore::ContentExtensions::TermHash::hash): Deleted.
105         (WebCore::ContentExtensions::TermHash::equal): Deleted.
106         (WebCore::ContentExtensions::Term::Term): Deleted.
107         (WebCore::ContentExtensions::Term::isKnownToMatchAnyString): Deleted.
108         (WebCore::ContentExtensions::Term::hasFixedLength): Deleted.
109         (WebCore::ContentExtensions::Term::operator==): Deleted.
110         (WebCore::ContentExtensions::Term::hash): Deleted.
111         (WebCore::ContentExtensions::Term::isDeletedValue): Deleted.
112         (WebCore::ContentExtensions::Term::isUniversalTransition): Deleted.
113         (WebCore::ContentExtensions::Term::generateSubgraphForAtom): Deleted.
114
115 2015-07-06  Benjamin Poulain  <benjamin@webkit.org>
116
117         [Content Extensions] Make the DFA transitions ranges instead of characters
118         https://bugs.webkit.org/show_bug.cgi?id=146575
119
120         Reviewed by Alex Christensen.
121
122         This patch changes the DFA and code using the DFA to use ranges
123         to represent the transitions between any two nodes.
124
125         This patch builds on top of the tools introduced in r186079.
126
127         The DFA structure is basically the same as ImmutableNFA but without
128         any epsilon transitions.
129
130         This patch introduces a transition iterator to make the DFA
131         compatible with the existing algorithms.
132
133         ---
134
135         The DFA combiner is rebuilt on top of MutableRangeList. Combining the transitions
136         of two nodes is one by merging the range list of each not into a common
137         MutableRangeList.
138         The data converter takes care of creating the signature of the combination.
139
140         The code got simpler since MutableRangeList does most of the work now. It is also
141         much faster.
142
143         ---
144
145         The minimizer is more intersting.
146
147         With the current algorithm, we cannot resolve overlaps between ranges. On the other
148         hand, the minimizer does not care about the symbol of the transitions if we are careful
149         to partition transitions of the same symbol together.
150
151         What I did was to turn the minimizer into a pure transition based one, BUT each
152         "symbol" is actually an unbreakable range.
153
154         The first step is to go over all the transitions of all the nodes and find the largest
155         ranges such that the alphabet of interest is covered but there is not a single intersection
156         between any two nodes (what I called "singular transitions" in the code). 
157
158         This can be done efficiently with MutableRangeList.
159         A little trick there is that I also used the converter to count how many real transition
160         overlaps any singular transition.
161
162         Those singular transitions become the alphabet of our minimizer. The "symbol" of our alphabet
163         is simply the position of the singular transition in the list.
164
165         The partition of transition is created by populating each set with all the transition that
166         overlaps the symbols.
167         Note that since the partition is created on the fly, the Transition structure used for
168         repartitioning only contains the source of the transitions.
169
170         Once our transition parition has been carefuly created, we can completely forget about
171         the symbols and only work with subsets.
172
173         Since the singular transitions have no overlap (unlike fallback transitions), this new minimizer
174         will find the minimial solution for well formed input.
175
176         * WebCore.xcodeproj/project.pbxproj:
177         * contentextensions/DFA.cpp:
178         (WebCore::ContentExtensions::DFA::memoryUsed):
179         (WebCore::ContentExtensions::printTransitions):
180         (WebCore::ContentExtensions::DFANode::actions): Deleted.
181         (WebCore::ContentExtensions::DFANode::transitions): Deleted.
182         (WebCore::ContentExtensions::DFANode::fallbackTransitionDestination): Deleted.
183         (WebCore::ContentExtensions::DFANode::changeFallbackTransition): Deleted.
184         (WebCore::ContentExtensions::DFANode::addFallbackTransition): Deleted.
185         (WebCore::ContentExtensions::DFANode::containsTransition): Deleted.
186         (WebCore::ContentExtensions::DFANode::kill): Deleted.
187         (WebCore::ContentExtensions::DFA::debugPrintDot): Deleted.
188         * contentextensions/DFA.h:
189         (WebCore::ContentExtensions::DFANode::ConstRangeIterator::range):
190         (WebCore::ContentExtensions::DFANode::ConstRangeIterator::target):
191         (WebCore::ContentExtensions::DFANode::RangeIterator::range):
192         (WebCore::ContentExtensions::DFANode::RangeIterator::target):
193         (WebCore::ContentExtensions::DFANode::RangeIterator::resetTarget):
194         * contentextensions/DFABytecodeCompiler.cpp:
195         (WebCore::ContentExtensions::DFABytecodeCompiler::ranges):
196         (WebCore::ContentExtensions::DFABytecodeCompiler::nodeTransitionsMaxBytecodeSize):
197         (WebCore::ContentExtensions::DFABytecodeCompiler::compileNodeTransitions):
198         * contentextensions/DFACombiner.cpp:
199         (WebCore::ContentExtensions::DFAMerger::TargetConverter::convert):
200         (WebCore::ContentExtensions::DFAMerger::TargetConverter::extend):
201         (WebCore::ContentExtensions::DFAMerger::TargetConverter::setHalfSignature):
202         (WebCore::ContentExtensions::DFAMerger::merge):
203         (WebCore::ContentExtensions::DFAMerger::getOrCreateCombinedNode):
204         (WebCore::ContentExtensions::DFAMerger::setHalfSignature): Deleted.
205         (WebCore::ContentExtensions::DFAMerger::populateTransitions): Deleted.
206         (WebCore::ContentExtensions::DFAMerger::populateFromFallbackTransitions): Deleted.
207         (WebCore::ContentExtensions::DFAMerger::createTransitions): Deleted.
208         (WebCore::ContentExtensions::DFAMerger::createFallbackTransitionIfNeeded): Deleted.
209         * contentextensions/DFAMinimizer.cpp:
210         (WebCore::ContentExtensions::DFAMinimizer::minimize):
211         * contentextensions/DFANode.cpp: Added.
212         (WebCore::ContentExtensions::DFANode::actions):
213         (WebCore::ContentExtensions::DFANode::containsTransition):
214         (WebCore::ContentExtensions::DFANode::kill):
215         (WebCore::ContentExtensions::DFANode::canUseFallbackTransition):
216         (WebCore::ContentExtensions::DFANode::bestFallbackTarget):
217         * contentextensions/DFANode.h:
218         (WebCore::ContentExtensions::CharRange::size):
219         (WebCore::ContentExtensions::DFANode::ConstRangeIterator::operator*):
220         (WebCore::ContentExtensions::DFANode::ConstRangeIterator::operator==):
221         (WebCore::ContentExtensions::DFANode::ConstRangeIterator::operator!=):
222         (WebCore::ContentExtensions::DFANode::ConstRangeIterator::operator++):
223         (WebCore::ContentExtensions::DFANode::ConstRangeIterator::first):
224         (WebCore::ContentExtensions::DFANode::ConstRangeIterator::last):
225         (WebCore::ContentExtensions::DFANode::ConstRangeIterator::data):
226         (WebCore::ContentExtensions::DFANode::IterableConstRange::begin):
227         (WebCore::ContentExtensions::DFANode::IterableConstRange::end):
228         (WebCore::ContentExtensions::DFANode::transitions):
229         (WebCore::ContentExtensions::DFANode::RangeIterator::operator*):
230         (WebCore::ContentExtensions::DFANode::RangeIterator::operator==):
231         (WebCore::ContentExtensions::DFANode::RangeIterator::operator!=):
232         (WebCore::ContentExtensions::DFANode::RangeIterator::operator++):
233         (WebCore::ContentExtensions::DFANode::RangeIterator::first):
234         (WebCore::ContentExtensions::DFANode::RangeIterator::last):
235         (WebCore::ContentExtensions::DFANode::RangeIterator::data):
236         (WebCore::ContentExtensions::DFANode::IterableRange::begin):
237         (WebCore::ContentExtensions::DFANode::IterableRange::end):
238         (WebCore::ContentExtensions::DFANode::hasFallbackTransition): Deleted.
239         (WebCore::ContentExtensions::DFANode::transitionsLength): Deleted.
240         (WebCore::ContentExtensions::DFANode::transitionsStart): Deleted.
241         (WebCore::ContentExtensions::DFANode::resetTransitions): Deleted.
242         (WebCore::ContentExtensions::DFANode::setHasFallbackTransitionWithoutChangingDFA): Deleted.
243         * contentextensions/ImmutableNFA.h:
244         (WebCore::ContentExtensions::ImmutableNFA::ConstRangeIterator::first):
245         (WebCore::ContentExtensions::ImmutableNFA::ConstRangeIterator::last):
246         (WebCore::ContentExtensions::ImmutableNFA::ConstRangeIterator::data):
247         (WebCore::ContentExtensions::ImmutableNFA::ConstRangeIterator::range):
248         (WebCore::ContentExtensions::ImmutableNFA::ConstRangeIterator::operator*): Deleted.
249         (WebCore::ContentExtensions::ImmutableNFA::ConstRangeIterator::operator->): Deleted.
250         * contentextensions/ImmutableNFANodeBuilder.h:
251         (WebCore::ContentExtensions::ImmutableNFANodeBuilder::FakeRangeIterator::first):
252         (WebCore::ContentExtensions::ImmutableNFANodeBuilder::FakeRangeIterator::last):
253         (WebCore::ContentExtensions::ImmutableNFANodeBuilder::FakeRangeIterator::operator*): Deleted.
254         (WebCore::ContentExtensions::ImmutableNFANodeBuilder::FakeRangeIterator::operator->): Deleted.
255         * contentextensions/MutableRange.h:
256         (WebCore::ContentExtensions::MutableRange::size): Deleted.
257         * contentextensions/MutableRangeList.h:
258         (WebCore::ContentExtensions::MutableRangeList::ConstIterator::first):
259         (WebCore::ContentExtensions::MutableRangeList::ConstIterator::last):
260         (WebCore::ContentExtensions::MutableRangeList::ConstIterator::data):
261         (WebCore::ContentExtensions::MutableRangeList::extend):
262         (WebCore::ContentExtensions::MutableRangeList::size):
263         (WebCore::ContentExtensions::MutableRangeList::initializeFrom):
264         * contentextensions/NFAToDFA.cpp:
265         (WebCore::ContentExtensions::NFAToDFA::convert):
266         (WebCore::ContentExtensions::canUseFallbackTransition): Deleted.
267         (WebCore::ContentExtensions::findBestFallbackTarget): Deleted.
268
269 2015-07-06  Timothy Hatcher  <timothy@apple.com>
270
271         Fix ASSERT causing crashes in Inspector tests on the bots.
272
273         * inspector/InspectorPageAgent.cpp:
274         (WebCore::InspectorPageAgent::enable): Reset stopwatch before starting it.
275
276 2015-07-06  Brady Eidson  <beidson@apple.com>
277
278         Remove unused "m_isPrivate" flag on NetworkStorageSession.
279         https://bugs.webkit.org/show_bug.cgi?id=146648
280
281         Reviewed by Alex Christensen.
282
283         No new tests (No behavior change).
284
285         * platform/network/NetworkStorageSession.h:
286         (WebCore::NetworkStorageSession::isPrivateBrowsingSession): Deleted.
287
288         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
289         (WebCore::NetworkStorageSession::NetworkStorageSession): Deleted.
290         (WebCore::NetworkStorageSession::createPrivateBrowsingSession): Deleted.
291
292         * platform/network/soup/NetworkStorageSessionSoup.cpp:
293         (WebCore::NetworkStorageSession::NetworkStorageSession): Deleted.
294         (WebCore::NetworkStorageSession::createPrivateBrowsingSession): Deleted.
295
296 2015-07-04  Timothy Hatcher  <timothy@apple.com>
297
298         Web Inspector: Add a dedicated Network tab that is always live
299         https://bugs.webkit.org/show_bug.cgi?id=146568
300
301         Make sure the executionStopwatch is always started and never stops so resource loads
302         always get timestamps, even when Timeline is not recording.
303
304         Reviewed by Joseph Pecoraro.
305
306         * inspector/InspectorPageAgent.cpp:
307         (WebCore::InspectorPageAgent::enable): Start executionStopwatch.
308         (WebCore::InspectorPageAgent::frameStartedLoading): Reset and start executionStopwatch.
309         * inspector/InspectorTimelineAgent.cpp:
310         (WebCore::InspectorTimelineAgent::internalStart): Removed executionStopwatch code.
311         (WebCore::InspectorTimelineAgent::internalStop): Ditto.
312
313 2015-07-02  Timothy Hatcher  <timothy@apple.com>
314
315         Update the localized strings file.
316
317         * English.lproj/Localizable.strings: Updated with the script.
318
319 2015-07-06  Zalan Bujtas  <zalan@apple.com>
320
321         Crash: LayoutState root's container is nullptr when the layout root is detached.
322         https://bugs.webkit.org/show_bug.cgi?id=146646
323         rdar://problem/21371544
324
325         Reviewed by Simon Fraser.
326
327         This is a speculative fix to ensure that when the root of the LayoutState is detached
328         we don't try to access its container (nullptr).
329         This is related to trac.webkit.org/r185484.
330
331         Not reproducible.
332
333         * rendering/LayoutState.cpp:
334         (WebCore::LayoutState::LayoutState):
335         * rendering/LayoutState.h:
336         (WebCore::LayoutState::LayoutState): Deleted.
337
338 2015-07-06  Eric Carlson  <eric.carlson@apple.com>
339
340         [Mac] Inactive AirPlay route should automatically timeout
341         https://bugs.webkit.org/show_bug.cgi?id=146642
342         <rdar://problem/21602955>
343
344         Automatically clear a media element's AirPlay connection after it has been paused
345         for 60 minutes, or after 8 minutes if it played to the end before pausing.
346
347         Reviewed by Brent Fulgham.
348
349         * Modules/mediasession/WebMediaSessionManager.cpp:
350         (WebCore::WebMediaSessionManager::WebMediaSessionManager): Initialize m_watchdogTimer.
351         (WebCore::WebMediaSessionManager::clientStateDidChange): Schedule watchdog timer configuration
352           if the client started playing or paused.
353         (WebCore::WebMediaSessionManager::configurePlaybackTargetClients): Schedule watchdog timer configuration.
354         (WebCore::WebMediaSessionManager::toString): Print watchdog configuration flag.
355         (WebCore::WebMediaSessionManager::taskTimerFired): Call configureWatchdogTimer.
356         (WebCore::WebMediaSessionManager::configureWatchdogTimer): New, start or stop watchdog timer.
357         (WebCore::WebMediaSessionManager::watchdogTimerFired): Stop monitoring for targets, which 
358           clears the route.
359         * Modules/mediasession/WebMediaSessionManager.h:
360
361         * html/HTMLMediaElement.cpp:
362         (WebCore::HTMLMediaElement::mediaState): Set DidPlayToEnd when appropriate.
363
364         * page/MediaProducer.h: Add DidPlayToEnd.
365
366         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
367         (WebCore::MediaPlaybackTargetPickerMac::~MediaPlaybackTargetPickerMac): Clear m_client, call
368           stopMonitoringPlaybackTargets.
369         (WebCore::MediaPlaybackTargetPickerMac::pendingActionTimerFired): Send a neutered 
370           MediaPlaybackTarget when m_outputDeviceMenuController is NULL.
371         (WebCore::MediaPlaybackTargetPickerMac::devicePicker): Add logging.
372         (WebCore::MediaPlaybackTargetPickerMac::stopMonitoringPlaybackTargets): Clear the menu
373           controller to cancel the route.
374
375 2015-07-06  Zan Dobersek  <zdobersek@igalia.com>
376
377         [GTK] Fix build errors with OpenGL ES
378         https://bugs.webkit.org/show_bug.cgi?id=146626
379
380         Reviewed by Carlos Garcia Campos.
381
382         * platform/graphics/ANGLEWebKitBridge.h: Include <GLES2/gl2.h>
383         when building with OpenGL ES 2 support enabled.
384         (WebCore::ANGLEShaderSymbol::isSampler): Don't test for
385         OpenGL-specific GL_SAMPLER_2D_RECT_ARB value when OpenGL ES 2
386         support is enabled.
387
388 2015-07-06  Youenn Fablet  <youenn.fablet@crf.canon.fr>
389
390         [Streams API] Remove ReadableStream custom constructor
391         https://bugs.webkit.org/show_bug.cgi?id=146547
392
393         Reviewed by Darin Adler.
394
395         Removed custom binding.
396         Made use of Dictionary in lieu of JSObject to reduce readable stream constructor parameter parsing.
397         Added support for passing ExecState to construtor within binding generator.
398
399         No change in behavior.
400
401         * Modules/streams/ReadableStream.cpp:
402         (WebCore::ReadableStream::create):
403         * Modules/streams/ReadableStream.h:
404         (WebCore::ReadableStream::create):
405         * Modules/streams/ReadableStream.idl:
406         * bindings/js/JSDictionary.cpp:
407         (WebCore::JSDictionary::convertValue):
408         * bindings/js/JSDictionary.h:
409         * bindings/js/JSReadableStreamCustom.cpp:
410         * bindings/js/ReadableJSStream.cpp:
411         (WebCore::ReadableJSStream::create):
412         (WebCore::ReadableJSStream::ReadableJSStream):
413         * bindings/js/ReadableJSStream.h:
414         * bindings/scripts/CodeGeneratorJS.pm:
415         (GenerateConstructorDefinition):
416         * bindings/scripts/IDLAttributes.txt:
417
418 2015-07-06  Youenn Fablet  <youenn.fablet@crf.canon.fr>
419
420         Promise-returning functions should reject promises if the callee is not of the expected type
421         https://bugs.webkit.org/show_bug.cgi?id=146585
422
423         Reviewed by Darin Adler.
424
425         Updated binding generator to reject promise in case the casting of the thisValue is not working properly
426         (i.e. the callee is not wrapping a DOM object of the expected class.
427
428         Covered by rebased test and binding expectations.
429
430         * bindings/js/JSDOMPromise.h:
431         (WebCore::callPromiseFunction): Removed wrapper class parameter.
432         * bindings/scripts/CodeGeneratorJS.pm:
433         (GenerateImplementation):
434         * bindings/scripts/test/JS/JSTestObj.cpp: Updated binding expectations.
435         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunction):
436         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionPromise):
437         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithFloatArgument):
438         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithFloatArgumentPromise):
439         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithException):
440         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithExceptionPromise):
441         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithOptionalIntArgument):
442         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithOptionalIntArgumentPromise):
443
444 2015-07-05  Chris Dumez  <cdumez@apple.com>
445
446         [WK2] Current page's scroll position is lost when transferring sessionState from one view to another
447         https://bugs.webkit.org/show_bug.cgi?id=146625
448         <rdar://problem/21585268>
449
450         Reviewed by Gavin Barraclough.
451
452         Export HistoryController:saveScrollPositionAndViewStateToItem()
453         so that it can be called from WebKit2.
454
455         * loader/HistoryController.h:
456
457 2015-07-05  Simon Fraser  <simon.fraser@apple.com>
458
459         REGRESSION (r180582): background-attachment: local; does not scroll the background image when scrolling the the element's contents
460         https://bugs.webkit.org/show_bug.cgi?id=146623
461
462         Reviewed by Zalan Bujtas.
463         
464         r180582 erroneously asserted that m_destOrigin in BackgroundImageGeometry was unused.
465         However, it is needed to compute the correct phase when the destination rect is
466         altered by clipping.
467
468         Test: fast/backgrounds/background-attachment-local.html
469
470         * rendering/RenderBoxModelObject.cpp:
471         (WebCore::RenderBoxModelObject::paintFillLayerExtended):
472         (WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry):
473         * rendering/RenderBoxModelObject.h:
474         (WebCore::BackgroundImageGeometry::BackgroundImageGeometry):
475         (WebCore::BackgroundImageGeometry::relativePhase):
476         * rendering/svg/RenderSVGResourceMasker.cpp:
477         (WebCore::RenderSVGResourceMasker::drawMaskForRenderer):
478
479 2015-07-05  Chris Dumez  <cdumez@apple.com>
480
481         [WK2] WebBackForwardListItems' pageState is not kept up-to-date
482         https://bugs.webkit.org/show_bug.cgi?id=146614
483         <rdar://problem/21585268>
484
485         Reviewed by Gavin Barraclough.
486
487         WebBackForwardListItems' pageState on UIProcess-side were not kept
488         up-to-date when it was updated on WebContent process side. This meant
489         that we were losing the scroll position (among other things) when
490         transferring the session state over from one view to another.
491
492         We now call notifyHistoryItemChanged(item) after saving the scroll
493         position and the view state on the HistoryItem. As a result, the
494         WebBackForwardListProxy will send the updated pageState to the
495         UIProcess.
496
497         * history/HistoryItem.cpp:
498         (WebCore::HistoryItem::notifyChanged):
499         * history/HistoryItem.h:
500         * loader/HistoryController.cpp:
501         (WebCore::HistoryController::saveScrollPositionAndViewStateToItem):
502
503 2015-07-04  Chris Dumez  <cdumez@apple.com>
504
505         Unreviewed Windows build fix after r186279.
506
507         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
508         (WebCore::AVFWrapper::destroyVideoLayer):
509         * platform/graphics/ca/win/CACFLayerTreeHost.cpp:
510         (WebCore::CACFLayerTreeHost::destroyRenderer):
511
512 2015-07-04  Chris Dumez  <cdumez@apple.com>
513
514         Drop RefPtr::clear() method
515         https://bugs.webkit.org/show_bug.cgi?id=146556
516
517         Reviewed by Brady Eidson.
518
519         Drop RefPtr::clear() method in favor of "= nullptr;" pattern.
520
521 2015-07-03  Dan Bernstein  <mitz@apple.com>
522
523         Fixed the iOS 8 build.
524
525         * editing/cocoa/HTMLConverter.mm:
526
527 2015-07-03  Chris Dumez  <cdumez@apple.com>
528
529         REGRESSION (r178097): HTMLSelectElement.add(option, undefined) prepends option to the list of options; should append to the end of the list of options
530         https://bugs.webkit.org/show_bug.cgi?id=146566
531         <rdar://problem/21663919>
532
533         Reviewed by Ryosuke Niwa.
534
535         HTMLSelectElement.add(X, undefined) is supposed to be equivalent to
536         HTMLSelectElement.add(X) which should *append* X. The same is true
537         for HTMLOptionsCollection.add(X, undefined).
538
539         However, due to a bug in our bindings generator for overloaded
540         operations, the actual behavior was not the expected one. The
541         second overload would be chosen: add(X, index) and undefined would
542         be converted as 0-index, which would *prepend* X.
543
544         This patch fixes the bindings generator so that undefined is allowed
545         for optional parameters of an overload operation, when doing the
546         overload resolution.
547
548         Tests:
549         - fast/dom/HTMLSelectElement/add.html
550         - fast/dom/HTMLSelectElement/options-collection-add.html
551         - http/tests/websocket/tests/hybi/undefined-protocol.html
552
553         * bindings/scripts/CodeGeneratorJS.pm:
554         (GenerateParametersCheckExpression):
555         Allow undefined value for optional parameters when doing the overload
556         resolution.
557
558         * bindings/scripts/test/JS/JSTestObj.cpp:
559         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod):
560         (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter1):
561         (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter2):
562         (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter):
563         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
564         (WebCore::JSTestOverloadedConstructorsConstructor::constructJSTestOverloadedConstructors):
565         * bindings/scripts/test/TestObj.idl:
566         Add bindings tests coverage and rebaseline.
567
568 2015-07-03  Dan Bernstein  <mitz@apple.com>
569
570         Fixed the Mavericks build after r186236.
571
572         * loader/cache/CachedResource.h:
573         (WebCore::CachedResource::url): Removed the export macro from this inline function.
574
575 2015-07-03  Dan Bernstein  <mitz@apple.com>
576
577         Tried to fix the iOS build.
578
579         * bridge/objc/objc_class.mm:
580         (JSC::Bindings::ObjcClass::fieldNamed):
581
582 2015-07-03  Dan Bernstein  <mitz@apple.com>
583
584         Tried to fix the iOS build.
585
586         * editing/cocoa/HTMLConverter.mm:
587
588 2015-07-03  Dan Bernstein  <mitz@apple.com>
589
590         Tried to fix the iOS build.
591
592         * page/FrameView.cpp:
593         (WebCore::FrameView::calculateExtendedBackgroundMode):
594
595 2015-07-03  Dan Bernstein  <mitz@apple.com>
596
597         [Xcode] Update some build settings as recommended by Xcode 7
598         https://bugs.webkit.org/show_bug.cgi?id=146597
599
600         Reviewed by Sam Weinig.
601
602         * Configurations/Base.xcconfig: Enabled CLANG_WARN_UNREACHABLE_CODE,
603         GCC_WARN_UNDECLARED_SELECTOR, and GCC_NO_COMMON_BLOCKS. Removed GCC_MODEL_TUNING.
604
605         * WebCore.xcodeproj/project.pbxproj: Updated LastUpgradeCheck. Disabled -Wunreachable-code
606         for two bison-generated source files. Updated for rename of WebScriptObject.h.
607
608         * bindings/objc/WebScriptObject.mm:
609         (-[WebUndefined dealloc]): Removed unreachable code and suppressed warning about not calling
610         super.
611         * bridge/objc/WebScriptObject.h: Renamed to WebScriptObjectProtocol.h to enabled inlcuding
612         the other WebScriptObject.h.
613         * bridge/objc/WebScriptObjectProtocol.h: Renamed from WebScriptObject.h.
614
615         * bridge/objc/objc_class.mm: Updated for rename and included WebScriptObject.h because we
616         use selectors declared in that file.
617
618         * bridge/objc/objc_instance.mm: Ditto.
619         (ObjCRuntimeMethod::create): Resolved ambiguity between JSC::JSValue and the Objective-C
620         JSValue class.
621         (ObjCRuntimeMethod::createStructure): Ditto.
622         (ObjcInstance::invokeMethod): Ditto.
623         (ObjcInstance::invokeObjcMethod): Ditto.
624         (ObjcInstance::invokeDefaultMethod): Ditto.
625         (ObjcInstance::setValueOfUndefinedField): Ditto.
626         (ObjcInstance::getValueOfUndefinedField): Ditto.
627         (ObjcInstance::defaultValue): Ditto.
628         (ObjcInstance::stringValue): Ditto.
629         (ObjcInstance::numberValue): Ditto.
630         (ObjcInstance::booleanValue): Ditto.
631         (ObjcInstance::valueOf): Ditto,
632
633         * bridge/objc/objc_runtime.h: Moved definition of isFallbackMethod() from here to the
634         implementation.
635         * bridge/objc/objc_runtime.mm: Updated for rename and included WebScriptObject.h because we
636         use selectors declared in that file.
637         (JSC::Bindings::ObjcMethod::isFallbackMethod): Moved definition from the header to here.
638
639         * bridge/objc/objc_utility.mm: Updated for rename.
640
641         * cssjit/SelectorCompiler.cpp:
642         (WebCore::SelectorCompiler::addScrollbarPseudoClassType): Removed unreachable code.
643
644         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
645         Added declarations to the WebCoreMovieObserver interface.
646         (WebCore::MediaPlayerPrivateQTKit::disableUnsupportedTracks): Suppressed
647         -Wundeclared-selector around invocation of a selector that is not declared anywhere.
648
649 2015-07-03  Kyounga Ra  <kyounga@alticast.com>
650
651         Memory leak for a protected Element having pending events in ImageLoader. 
652         https://bugs.webkit.org/show_bug.cgi?id=146538
653
654         Reviewed by Brady Eidson.
655
656         If ImageLoader is destroyed before an active derefElementTimer is fired, protected element's refCount never be zero..
657
658         * loader/ImageLoader.cpp:
659         (WebCore::ImageLoader::~ImageLoader):
660         (WebCore::ImageLoader::updateFromElement):
661         (WebCore::ImageLoader::updateRenderer):
662         (WebCore::ImageLoader::updatedHasPendingEvent):
663         (WebCore::ImageLoader::timerFired):
664         * loader/ImageLoader.h:
665
666 2015-07-03  Daniel Bates  <dabates@apple.com>
667
668         REGRESSION (r178097): JavaScript TypeError after clicking on compose button in Yahoo Mail
669         https://bugs.webkit.org/show_bug.cgi?id=146515
670         <rdar://problem/21348421>
671
672         Reviewed by Chris Dumez.
673
674         Fixes an issue where extra arguments passed to a Web IDL overloaded function, whose implementation
675         is generated by the bindings generator script, are not ignored as per the note in section "Interface object [[Call]] method"
676         of the Web IDL spec, <http://www.w3.org/TR/2012/CR-WebIDL-20120419/> (19 April 2012).
677
678         Currently for an overloaded function the JavaScript bindings generator script emits code to
679         throw a TypeError when it cannot find a candidate function that takes the same number of
680         arguments as passed by a caller. Prior to the change made in bug #139179 (r178097), the
681         bindings code for HTMLSelectElement.add() was written by hand and ignored extra arguments
682         that were passed to it. Following this change, the bindings code for HTMLSelectElement.add()
683         is generated by the bindings generator script. Therefore, we throw a TypeError when Yahoo Mail
684         calls HTMLSelectElement.add() with extra arguments because the code emitted by the bindings
685         generator script does not ignore them.
686
687         * bindings/scripts/CodeGeneratorJS.pm:
688         (LengthOfLongestFunctionParameterList): Added. Computes the length of longest overload parameter list.
689         (GenerateOverloadedFunction): Emit code that ignores more arguments than LengthOfLongestFunctionParameterList().
690         (GenerateOverloadedConstructorDefinition): Ditto.
691         * bindings/scripts/test/JS/JSTestObj.cpp:
692         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod12): Added; expected result for an overloaded
693         function that takes a variadic number of Blob elements.
694         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod): Update expected result. The added
695         if-conditional expression for the IDL declaration overloadedMethod(Blob... blobArgs) is empty
696         because we do not support overloading of functions with variadic arguments.
697         (WebCore::jsTestObjConstructorFunctionOverloadedMethod1):
698         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
699         (WebCore::JSTestOverloadedConstructorsConstructor::constructJSTestOverloadedConstructors5): Added; expected
700         result for an overloaded constructors that takes a variadic number of long arguments.
701         (WebCore::JSTestOverloadedConstructorsConstructor::constructJSTestOverloadedConstructors): Update expected
702         result. The added if-conditional expression for the IDL declaration Constructor(long... longArgs) is empty
703         because we do not support overloading of constructors with variadic arguments.
704         * bindings/scripts/test/TestObj.idl: Added declaration overloadedMethod(Blob...). Also fixed
705         typo in license block text.
706         * bindings/scripts/test/TestOverloadedConstructors.idl: Added declaration Constructor(long... longArgs).
707         Also fixed typo in license block text.
708
709 2015-07-03  Mario Sanchez Prada  <mario@endlessm.com>
710
711         Crash on xLarge memory allocation using bmalloc on 32bit systems
712         https://bugs.webkit.org/show_bug.cgi?id=146440
713
714         Reviewed by Gustavo Noronha Silva.
715
716         Disable the gcc's -ftree-sra optimization (automatically enabled
717         with -O1 and higher levels) for WebCore and 32bit Intel architectures,
718         as that causes the crash in bmalloc when allocating large amounts of
719         memory from the texture mapper's tiled backing store implementation.
720
721         * CMakeLists.txt: Pass -fno-free-sra to gcc on 32bit Intel architectures.
722
723 2015-07-03  Csaba Osztrogonác  <ossy@webkit.org>
724
725         Fix the !ENABLE(VIDEO) build after r186054
726         https://bugs.webkit.org/show_bug.cgi?id=146592
727
728         Reviewed by Eric Carlson.
729
730         * platform/MemoryPressureHandler.cpp:
731         (WebCore::MemoryPressureHandler::releaseCriticalMemory):
732
733 2015-07-03  Youenn Fablet  <youenn.fablet@crf.canon.fr>
734
735         [Streams API] Remove ReadableStream and Reader cancel() custom binding
736         https://bugs.webkit.org/show_bug.cgi?id=146458
737
738         Reviewed by Darin Adler.
739
740         Removed stream and reader cancel custom binding.
741         Updated binding generator to correctly handle promise-based APIs with optional parameters.
742
743         No behavior changes.
744
745         * Modules/streams/ReadableStream.idl: Removed custom
746         * Modules/streams/ReadableStreamReader.idl: Ditto.
747         * bindings/js/JSReadableStreamCustom.cpp:
748         (WebCore::JSReadableStream::cancel): Deleted.
749         * bindings/js/JSReadableStreamReaderCustom.cpp:
750         (WebCore::JSReadableStreamReader::cancel): Deleted.
751         * bindings/scripts/CodeGeneratorJS.pm: Handling of promise parameter in case of optional arguments.
752         (GenerateParametersCheck):
753         (GenerateReturnParameters): Utility function to generate return parameters (exception and promise).
754         * bindings/scripts/test/JS/JSTestObj.cpp:
755         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithOptionalIntArgument):
756         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithOptionalIntArgumentPromise):
757         * bindings/scripts/test/TestObj.idl:
758
759
760 2015-07-02  Doug Russell  <d_russell@apple.com>
761
762         AX: Selection change as a result of focusing an element should include that 
763         information in the intent
764         https://bugs.webkit.org/show_bug.cgi?id=146533
765
766         Reviewed by Chris Fleizach.
767
768         Added focusChange flag to AXTextStateChangeIntent.
769         Added intent support to selection logic called by Element::updateFocusAppearance().
770         Added NSAccessibilityTextSelectionChangedFocus to mac notifications.
771
772         Test: platform/mac/accessibility/selection-notification-focus-change.html
773
774         * accessibility/AXObjectCache.cpp:
775         (WebCore::AXObjectCache::postTextStateChangeNotification):
776         * accessibility/AXTextStateChangeIntent.h:
777         * accessibility/AccessibilityRenderObject.cpp:
778         (WebCore::setTextSelectionIntent):
779         (WebCore::AccessibilityRenderObject::setFocused):
780         * accessibility/mac/AXObjectCacheMac.mm:
781         (WebCore::AXObjectCache::postTextStateChangePlatformNotification):
782         * dom/Element.cpp:
783         (WebCore::Element::updateFocusAppearance):
784         * dom/Element.h:
785         (WebCore::Element::defaultFocusTextStateChangeIntent):
786         * editing/FrameSelection.cpp:
787         (WebCore::FrameSelection::moveWithoutValidationTo):
788         (WebCore::FrameSelection::setSelectionByMouseIfDifferent):
789         (WebCore::FrameSelection::selectAll):
790         * editing/FrameSelection.h:
791         * html/HTMLInputElement.cpp:
792         (WebCore::HTMLInputElement::updateFocusAppearance):
793         * html/HTMLTextAreaElement.cpp:
794         (WebCore::HTMLTextAreaElement::updateFocusAppearance):
795         * html/HTMLTextFormControlElement.cpp:
796         (WebCore::HTMLTextFormControlElement::select):
797         (WebCore::HTMLTextFormControlElement::setSelectionRange):
798         (WebCore::HTMLTextFormControlElement::restoreCachedSelection):
799         * html/HTMLTextFormControlElement.h:
800         * page/EventHandler.cpp:
801         (WebCore::setInitialKeyboardSelection):
802         * page/FocusController.cpp:
803         (WebCore::FocusController::advanceFocusInDocumentOrder):
804
805 2015-07-02  Przemek Piorkowski  <piorkowskiprzemyslaw@gmail.com>
806
807         [EFL] test_ewk2_application_cache_manager has been failed since r185527
808         https://bugs.webkit.org/show_bug.cgi?id=146016
809
810         Reviewed by Gyuyoung Kim.
811
812         In order to handle properly WebApplicationCacheManagerProxy implementation which use
813         WebsiteDataRecord it is necessary to enable PUBLIC_SUFFIX_LIST for EFL. 
814         Implementation of PUBLIC_SUFFIX_LIST already exists for soup so EFL can use it as well.
815
816         * PlatformEfl.cmake: PublicSuffixSoup.cpp added to source files.
817
818 2015-07-02  Commit Queue  <commit-queue@webkit.org>
819
820         Unreviewed, rolling out r186251.
821         https://bugs.webkit.org/show_bug.cgi?id=146573
822
823         caused crashes in webaudio tests (Requested by cdumez on
824         #webkit).
825
826         Reverted changeset:
827
828         "Ensure media playback is stopped during page close"
829         https://bugs.webkit.org/show_bug.cgi?id=146554
830         http://trac.webkit.org/changeset/186251
831
832 2015-07-02  Brent Fulgham  <bfulgham@apple.com>
833
834         Ensure media playback is stopped during page close
835         https://bugs.webkit.org/show_bug.cgi?id=146554
836         <rdar://problem/18033944>
837
838         Reviewed by Zalan Bujtas.
839
840         Add new method to Page class to stop all media playback. It just uses the process
841         MediaSessionManager singleton to inform all hosted in a particular document to stop.
842
843         * Modules/webaudio/AudioContext.h:
844         (WebCore::WebAudio::hostingDocument): Added.
845         * html/HTMLMediaElement.h:
846         (WebCore::HTMLMediaElement::hostingDocument): Added.
847         * dom/Document.cpp:
848         (WebCore::Document::commonTeardown): Call the new PlatformMediaSessionManager::stopAllMediaPlaybackForDocument
849         method on document cleanup.
850         * platform/audio/PlatformMediaSession.h:
851         Made PlatformMediaSessionManager a friend so it can access the protected 'client' accessor.
852         Updated PlatformMediaSessionClient to require clients to have a "hostingDocument" member.
853         * platform/audio/PlatformMediaSessionManager.cpp:
854         (WebCore::PlatformMediaSessionManager::stopAllMediaPlaybackForDocument): Added. Only pauses
855         playback on elements that match the provided document.
856         * platform/audio/PlatformMediaSessionManager.h:
857
858 2015-07-02  Dean Jackson  <dino@apple.com>
859
860         Tapping a video in Safari causes the video to flash gray for a quick moment
861         https://bugs.webkit.org/show_bug.cgi?id=146570
862         <rdar://problem/21325181>
863
864         Reviewed by Brent Fulgham.
865
866         On iOS, video elements should not show the tap highlight.
867
868         * css/html.css:
869         (video):
870
871 2015-07-02  Dean Jackson  <dino@apple.com>
872
873         WebKit should use 80% white background for PiP indicator
874         https://bugs.webkit.org/show_bug.cgi?id=146444
875         <rdar://problem/21555726>
876
877         Reviewed by Brent Fulgham.
878
879         The designers wanted 80% white, not 80% black (r186104).
880         I've also reverted the AirPlay background back to black.
881
882         * Modules/mediacontrols/mediaControlsiOS.css:
883         (audio::-webkit-media-controls-wireless-playback-status):
884         (audio::-webkit-media-controls-wireless-playback-status.small):
885         (audio::-webkit-media-controls-wireless-playback-status.picture-in-picture):
886
887 2015-07-02  Eric Carlson  <eric.carlson@apple.com>
888
889         [Mac] Clear current AirPlay source before setting another
890         https://bugs.webkit.org/show_bug.cgi?id=145959
891
892         Reviewed by Brent Fulgham.
893
894         * Modules/mediasession/WebMediaSessionManager.cpp:
895         (WebCore::WebMediaSessionManager::clientStateDidChange): Don't make a client begin playing 
896           to the target just because it has paused.
897         (WebCore::WebMediaSessionManager::configurePlaybackTargetClients): Always select a client that
898           requrested the picker, and never consider paused clients when choosing a client to begin
899           playing to the targer. Call setShouldPlayToPlaybackTarget(true) after all of the other 
900           clients have been told to stop playing to the target.
901
902 2015-07-02  Beth Dakin  <bdakin@apple.com>
903
904         Allow the UIDelegate to customize an image preview
905         https://bugs.webkit.org/show_bug.cgi?id=146557
906         -and corresponding-
907         rdar://problem/21657424
908
909         Reviewed by Tim Horton.
910
911         Add WEBCORE_EXPORT to use this in WK2.
912         * loader/cache/CachedResource.h:
913         (WebCore::CachedResource::url):
914
915 2015-07-02  Brady Eidson  <beidson@apple.com>
916
917         Add preference to disable all http-equiv.
918         <rdar://problem/9091261> and https://bugs.webkit.org/show_bug.cgi?id=146553
919
920         Reviewed by Sam Weinig.
921
922         No new tests (Covered by existing test)
923
924         * dom/Document.cpp:
925         (WebCore::Document::processHttpEquiv):
926         * page/Settings.in:
927
928 2015-07-02  Youenn Fablet  <youenn.fablet@crf.canon.fr>
929
930         [Streams API] Remove ReadableStreamController.enqueue() custom binding
931         https://bugs.webkit.org/show_bug.cgi?id=146455
932
933         Reviewed by Darin Adler.
934
935         Made enqueue not custom. Updated error to use Default=Undefined in IDL.
936
937         No change in behavior.
938
939         * Modules/streams/ReadableStreamController.h:
940         (WebCore::ReadableStreamController::error): Removed unneeded variation of error.
941         (WebCore::ReadableStreamController::enqueue): Calling ReadableJSStream enqueue method.
942         * Modules/streams/ReadableStreamController.idl: Updated error with Default=Undefined and made enqueue not custom.
943         * bindings/js/JSDOMBinding.cpp:
944         (WebCore::createDOMException): Adding support for RangeError exceptions.
945         * bindings/js/JSReadableStreamControllerCustom.cpp:
946         (WebCore::constructJSReadableStreamController): Deleted.
947         * bindings/js/ReadableJSStream.cpp:
948         (WebCore::ReadableJSStream::error): Updated to pass error value as parameter.
949         (WebCore::ReadableJSStream::enqueue): Added exception throwing through ExceptionCode.
950         (WebCore::ReadableJSStream::retrieveChunkSize): Ditto.
951         * bindings/js/ReadableJSStream.h:
952         * dom/ExceptionCode.h: Adding RangeError.
953
954 2015-07-02  Brady Eidson  <beidson@apple.com>
955
956         [Content Extensions] Block synchronous XMLHTTPRequest.
957         <rdar://problem/21573006> and https://bugs.webkit.org/show_bug.cgi?id=146271
958
959         Reviewed by Alex Christensen.
960
961         Test: http/tests/contentextensions/sync-xhr-blocked.html
962
963         * loader/FrameLoader.cpp:
964         (WebCore::FrameLoader::loadResourceSynchronously): If content blocked, set up an error, clear
965           the response, and clear the response data.
966
967 2015-07-01  Joseph Pecoraro  <pecoraro@apple.com>
968
969         Web Inspector: Aggregate profile call information on the backend to drastically reduce profile sizes
970         https://bugs.webkit.org/show_bug.cgi?id=146536
971
972         Reviewed by Timothy Hatcher.
973
974         * inspector/TimelineRecordFactory.cpp:
975         (WebCore::buildAggregateCallInfoInspectorObject):
976         (WebCore::buildInspectorObject):
977         Replace the array of Call objects with a single aggregated call info object.
978
979 2015-07-01  Brent Fulgham  <bfulgham@apple.com>
980
981         [Win] REGRESSION (r185124) CACFLayer handling broken
982         https://bugs.webkit.org/show_bug.cgi?id=146530
983         <rdar://problem/21642241>
984
985         Reviewed by Tim Horton.
986
987         At some point in the past, the set of LayerChange flags
988         overflowed the default MSVC enum type of 'int'. This caused
989         Windows rendering code to not receive various update notifications.
990
991         Zalan's change moved the DebugIndicatorsChanged flag into that
992         overflow set, which made it obvious that something was wrong.
993
994         The fix is to tell the compiler to use a compatible base type
995         for the enum.
996
997         * platform/graphics/ca/GraphicsLayerCA.h: Prevent overflow.
998
999 2015-07-01  Alex Christensen  <achristensen@webkit.org>
1000
1001         Reduce resolution of performance.now.
1002         https://bugs.webkit.org/show_bug.cgi?id=146531
1003         rdar://problem/20116796
1004
1005         Reviewed by Simon Fraser.
1006
1007         Test: http/tests/misc/webtiming-resolution.html
1008
1009         * page/Performance.cpp:
1010         (WebCore::Performance::now):
1011         Floor the time returned by performance.now to the nearest 5 microseconds.
1012
1013 2015-07-01  Eric Carlson  <eric.carlson@apple.com>
1014
1015         [iOS] Build fix
1016
1017         Reviewed by Brent Fulgham.
1018
1019         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
1020         (-[WebAVVideoLayer enterPIPModeRedirectingVideoToLayer:]): Renamed from enterOptimizedFullScreenModeRedirectingVideoToLayer.
1021         (-[WebAVVideoLayer leavePIPMode]): Renamed from leaveOptimizedFullScreenMode.
1022         (-[WebAVVideoLayer enterOptimizedFullScreenModeRedirectingVideoToLayer:]): Deleted.
1023         (-[WebAVVideoLayer leaveOptimizedFullScreenMode]): Deleted.
1024
1025 2015-07-01  Myles C. Maxfield  <mmaxfield@apple.com>
1026
1027         [iOS] Support bold and thin italicized system fonts
1028         https://bugs.webkit.org/show_bug.cgi?id=146463
1029         <rdar://problem/20948885>
1030
1031         Reviewed by Darin Adler.
1032
1033         Add the italicized attribute to font descriptors.
1034
1035         Test: fast/text/weighted-italicized-system-font.html
1036
1037         * platform/graphics/ios/FontCacheIOS.mm:
1038         (WebCore::createCTFontWithFamilyNameAndWeight):
1039         * platform/graphics/mac/FontCacheMac.mm:
1040         (WebCore::fontWithFamilySpecialCase):
1041         (WebCore::fontWithFamily):
1042         * platform/spi/cocoa/CoreTextSPI.h:
1043
1044 2015-07-01  Alex Christensen  <achristensen@webkit.org>
1045
1046         Fix ANGLE Windows build after r186169.
1047         https://bugs.webkit.org/show_bug.cgi?id=146532
1048
1049         Reviewed by Brent Fulgham.
1050
1051         * WebCore.vcxproj/WebCore.vcxproj:
1052         * WebCore.vcxproj/WebCore.vcxproj.filters:
1053         Don't compile OpenGLShims.cpp or Extensions3DOpenGL.cpp on Windows 
1054         because Windows uses OpenGLES through ANGLE, not OpenGL.
1055         * platform/graphics/ANGLEWebKitBridge.h:
1056         Use OpenGLESShims.h on Windows instead of OpenGLShims.h.
1057         * platform/graphics/OpenGLESShims.h:
1058         Added needed definitions from OpenGL to compile successfully.
1059         * platform/graphics/win/GL/glext.h: Removed.
1060
1061 2015-07-01  Dean Jackson  <dino@apple.com>
1062
1063         Disable the experimental WebGL2 implementation
1064         https://bugs.webkit.org/show_bug.cgi?id=146526
1065         <rdar://problem/21641235>
1066
1067         Reviewed by Myles Maxfield.
1068
1069         Add (and disable) an ENABLE_WEBGL2 flag. Also protect
1070         anything that is specific to WebGL2.
1071
1072         Covered by running the WebGL 1.0.2 conformance suite
1073         and our LayoutTests.
1074
1075         * Configurations/FeatureDefines.xcconfig:
1076         * bindings/js/JSCanvasRenderingContextCustom.cpp:
1077         (WebCore::toJS):
1078         * bindings/js/JSWebGL2RenderingContextCustom.cpp:
1079         * bindings/js/JSWebGLRenderingContextBaseCustom.cpp:
1080         (WebCore::toJS):
1081         * html/HTMLCanvasElement.cpp:
1082         (WebCore::HTMLCanvasElement::is3dType):
1083         * html/canvas/WebGL2RenderingContext.cpp:
1084         * html/canvas/WebGL2RenderingContext.h:
1085         * html/canvas/WebGL2RenderingContext.idl:
1086         * html/canvas/WebGLFramebuffer.cpp:
1087         (WebCore::WebGLFramebuffer::drawBuffersIfNecessary):
1088         * html/canvas/WebGLGetInfo.cpp:
1089         * html/canvas/WebGLGetInfo.h:
1090         * html/canvas/WebGLRenderingContextBase.cpp:
1091         (WebCore::WebGLRenderingContextBase::create):
1092         * html/canvas/WebGLVertexArrayObject.cpp:
1093         * html/canvas/WebGLVertexArrayObject.h:
1094         * html/canvas/WebGLVertexArrayObject.idl:
1095
1096 2015-07-01  Chris Dumez  <cdumez@apple.com>
1097
1098         Regression(183998): Disqus comments take a very long time to load
1099         https://bugs.webkit.org/show_bug.cgi?id=146522
1100         <rdar://problem/21590601>
1101
1102         Reviewed by Simon Fraser.
1103
1104         Stop throttling requestAnimationFrame() in iframes that are not visible
1105         due to them being zero-sized or display:none. Those are usually utility
1106         iframes and throttling them is risky.
1107
1108         Se still throttle requestAnimationFrame() in iframes that would be
1109         visible in theory but are currently not noticeable because they are
1110         outside the viewport.
1111
1112         Test:
1113         - fast/animation/request-animation-frame-throttle-subframe.html
1114         - fast/animation/request-animation-frame-throttle-subframe-display-none.html
1115         - fast/animation/request-animation-frame-throttle-subframe-zero-size.html
1116
1117         * page/FrameView.cpp:
1118         (WebCore::FrameView::updateScriptedAnimationsAndTimersThrottlingState):
1119
1120 2015-06-30  Ryosuke Niwa  <rniwa@webkit.org>
1121
1122         REGRESSION (r179168): Characters overlap after resizing the font on the copy-pasted Japanese text
1123         https://bugs.webkit.org/show_bug.cgi?id=146492
1124
1125         Reviewed by Darin Adler.
1126
1127         The bug was caused by WebKit serializing the used line-height size (e.g. 18px) in the copied content
1128         instead of string "normal" and removeStyleFromRulesAndContext failing to strip it down when text with
1129         a font that influences the line height got pasted. This is because the used value of line-height
1130         property of the context and the pasted content doesn't match when the context doesn't use the same font.
1131
1132         Fixed the bug by not considering line-height as a list of editing properties we try to preserve. This is
1133         fine because we don't provide editing operations to directly manipulate line-height.
1134
1135         Test: editing/pasteboard/cjk-line-height.html
1136
1137         * editing/EditingStyle.cpp:
1138         (WebCore::editingProperties): Removed CSSPropertyLineHeight.
1139
1140 2015-06-30  Brent Fulgham  <bfulgham@apple.com>
1141
1142         REGRESSION (r184296): View keeps scrolling upward
1143         https://bugs.webkit.org/show_bug.cgi?id=146497
1144         <rdar://problem/21524942>
1145
1146         Reviewed by Darin Adler.
1147
1148         Avoid improperly triggering the ScrollController wheel event handling
1149         logic when the wheel event deltaX/deltaY are zero. On certain sites,
1150         this caused a programmatic JavaScript scroll to be triggered unexpectedly,
1151         scrolling the page back to some initial state.
1152
1153         This bug was introduced while trying to make sure scrollbars were notified
1154         when the wheel event had come to an end. Revise that change so that we still
1155         follow the right code path for non-stretchable regions. However, make sure
1156         that for zero-delta wheel events we make sure to properly handle the wheel
1157         event phase. 
1158
1159         * platform/mac/ScrollAnimatorMac.h:
1160         * platform/mac/ScrollAnimatorMac.mm:
1161         (WebCore::ScrollAnimatorMac::shouldForwardWheelEventsToParent): New helper function
1162         to reduce the complexity of the logic in handleWheelEvent.
1163         (WebCore::ScrollAnimatorMac::handleWheelEvent): When wheel events should be forwarded
1164         to the parent scroll view, if the event was handled or has no change in position
1165         trigger the 'handleWheelEventPhase' logic so that scrollbars are hidden, etc.
1166
1167 2015-06-30  Dean Jackson  <dino@apple.com>
1168
1169         Hide the inline controls when going into PiP
1170         https://bugs.webkit.org/show_bug.cgi?id=146487
1171         <rdar://problem/19881159>
1172
1173         Reviewed by Eric Carlson.
1174
1175         When the presentation mode is PiP, toggle a class
1176         on the container element so that we can completely
1177         hide the control toolbar. The placard should still
1178         remain visible.
1179
1180         * Modules/mediacontrols/mediaControlsiOS.css:
1181         (video::-webkit-media-controls-panel-container.picture-in-picture): Add
1182         a rule that hides the toolbar when PiP is active.
1183         * Modules/mediacontrols/mediaControlsiOS.js:
1184         (ControllerIOS.prototype.showControls):
1185         (ControllerIOS.prototype.handlePresentationModeChange): Toggle a
1186         class. Also fix a bug I noticed where exiting from PiP was
1187         not auto-hiding the controls until the user tapped.
1188
1189 2015-07-01  Matthew Daiter  <mdaiter@apple.com>
1190
1191         Enable MEDIA_STREAM flag
1192         https://bugs.webkit.org/show_bug.cgi?id=145947
1193         <rdar://problem/21365829>
1194
1195         Reviewed by Eric Carlson.
1196
1197         * Configurations/FeatureDefines.xcconfig: Added MEDIA_STREAM flag
1198         * Modules/mediastream/MediaStreamTrack.h:
1199         * WebCore.xcodeproj/project.pbxproj: Changed project headers to
1200         private headers
1201         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
1202         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
1203         * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
1204         * platform/mediastream/RealtimeMediaSource.h:
1205         * platform/mediastream/mac/AVAudioCaptureSource.mm:
1206         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
1207         (WebCore::refreshCaptureDeviceList): Deleted.
1208         * platform/mediastream/mac/AVMediaCaptureSource.mm:
1209         (WebCore::AVMediaCaptureSource::startProducingData):
1210         (WebCore::AVMediaCaptureSource::stopProducingData):
1211
1212 2015-07-01  Brent Fulgham  <bfulgham@apple.com>
1213
1214         REGRESSION (r185016): Intermittent crash in WebCore::TextTrackList::remove
1215         https://bugs.webkit.org/show_bug.cgi?id=146493
1216         <rdar://problem/21511122>
1217
1218         Reviewed by Eric Carlson.
1219
1220         The m_textTracks member is frequently null checked during other operations, but
1221         was not checked during track removal. This needs to be corrected.
1222
1223         * html/HTMLMediaElement.cpp:
1224         (WebCore::HTMLMediaElement::removeTextTrack): Check that m_textTracks is
1225         not null before using it during track removal.
1226
1227 2015-07-01  Antti Koivisto  <antti@apple.com>
1228
1229         PNG mask images are loaded with Accept:image/svg+xml
1230         https://bugs.webkit.org/show_bug.cgi?id=146509
1231         rdar://problem/21584740
1232
1233         Reviewed by Simon Fraser.
1234
1235         For some strange reason MaskImageOperation code loads all mask images, including non-SVG ones
1236         using CachedSVGDocument. Resulting bad accept header may cause server to reject the request.
1237
1238         This is far from ideal but as a quick fix we can override the accept header for mask images to
1239         allow any image type.
1240
1241         Test: http/tests/misc/mask-image-accept.html
1242
1243         * loader/cache/CachedResourceLoader.cpp:
1244         (WebCore::CachedResourceLoader::requestResource):
1245         * loader/cache/CachedResourceRequest.h:
1246         (WebCore::CachedResourceRequest::acceptOverride):
1247         (WebCore::CachedResourceRequest::setAcceptOverride):
1248         * loader/cache/CachedSVGDocumentReference.cpp:
1249         (WebCore::CachedSVGDocumentReference::load):
1250         * loader/cache/CachedSVGDocumentReference.h:
1251         (WebCore::CachedSVGDocumentReference::loadRequested):
1252         (WebCore::CachedSVGDocumentReference::setAcceptsAnyImageType):
1253         (WebCore::CachedSVGDocumentReference::document):
1254         * platform/graphics/MaskImageOperation.cpp:
1255         (WebCore::MaskImageOperation::ensureCachedSVGDocumentReference):
1256
1257 2015-07-01  Jer Noble  <jer.noble@apple.com>
1258
1259         [MSE] Failures on W3C media-source tests regarding MIME types
1260         https://bugs.webkit.org/show_bug.cgi?id=146499
1261
1262         Reviewed by Eric Carlson.
1263
1264         Tests: http/tests/media/media-source/SourceBuffer-abort-readyState.html
1265                http/tests/media/media-source/SourceBuffer-abort-removed.html
1266                http/tests/media/media-source/SourceBuffer-abort-updating.html
1267                http/tests/media/media-source/SourceBuffer-abort.html
1268
1269         Multiple failures in the W3C media-source test suite due to two failures in isTypeSupported MIME type handling:
1270         - MIME types without codec strings were being rejected.
1271         - MIME types with codec strings which are rejected by the system are being reported as supported.
1272
1273         For the first, stop rejecting MIME types with non-existent codec strings. For MIME types which do have non-empty
1274         codec strings, treat a "Maybe" response as unsupported.
1275
1276         * Modules/mediasource/MediaSource.cpp:
1277         (WebCore::MediaSource::isTypeSupported):
1278
1279 2015-06-30  Alex Christensen  <achristensen@webkit.org>
1280
1281         Update ANGLE to b11e2483742db884bd0af41f78f528240577356b.
1282         https://bugs.webkit.org/show_bug.cgi?id=145010
1283
1284         Reviewed by Dean Jackson.
1285
1286         * CMakeLists.txt:
1287         * platform/graphics/ANGLEWebKitBridge.cpp:
1288         (WebCore::appendSymbol):
1289         (WebCore::getStructInfo):
1290         (WebCore::getSymbolInfo):
1291         (WebCore::ANGLEWebKitBridge::cleanupCompilers):
1292         (WebCore::ANGLEWebKitBridge::compileShaderSource):
1293         (WebCore::getValidationResultValue): Deleted.
1294         * platform/graphics/ANGLEWebKitBridge.h:
1295         (WebCore::ANGLEShaderSymbol::isSampler):
1296         * platform/graphics/GraphicsContext3D.h:
1297         (WebCore::GraphicsContext3D::SymbolInfo::SymbolInfo):
1298         * platform/graphics/mac/GraphicsContext3DMac.mm:
1299         * platform/graphics/opengl/Extensions3DOpenGL.cpp:
1300         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
1301         (WebCore::GraphicsContext3D::checkVaryingsPacking):
1302         (WebCore::GraphicsContext3D::precisionsMatch):
1303         Update WebCore to reflect changes in ANGLE.
1304
1305 2015-06-30  Zalan Bujtas  <zalan@apple.com>
1306
1307         Frame flattening: Hit-testing an iframe could end up destroying the associated inline tree context.
1308         https://bugs.webkit.org/show_bug.cgi?id=146447
1309         rdar://problem/20613501
1310
1311         Reviewed by Simon Fraser.
1312
1313         This patch ensures that the render tree associated with the document on which
1314         the hit-test is initiated does not get laid out, unless it was directly mutated prior to the hittest.
1315
1316         Hit-test requirements:
1317         1. A clean the render tree before hit-testing gets propagated to the renderers.
1318         Document::updateLayout() ensures it by calling both updateStyleIfNeeded() and layout() not only on the current tree, but also
1319         on the ancestors if needed.
1320
1321         2. No render tree mutation while hit-testing the renderers.
1322
1323         When an iframe is being hit-tested, this hit-test could bubble down to the child frame's render view.
1324         In order to ensure #1, we call Document::updateLayout() on the current (subframe) document.
1325         If updateStyleIfNeeded() mutates the render tree, we mark it dirty for layout(). However frame flattening also
1326         marks the parent renderer (RenderIFrame) dirty.
1327         While calling layout() to clean the current render tree, we end up laying out the parent tree too.
1328         Laying out the parent tree could end up destroying the inline tree context from where the
1329         hittest just bubbled down. (InlineFlowBox -> RenderWidget -> RenderView).
1330
1331         This patch protects the render tree from such unintentional inline tree mutation during hittesting.
1332         After the initial layout we set a layout disallow flag on the frame view to defer subsequent layouts.
1333         This patch only changes behavior when frame flattening is enabled, but in future we may always want to enable this.
1334
1335         Test: fast/frames/flattening/hittest-iframe-while-style-changes-crash.html
1336
1337         * page/FrameView.cpp:
1338         (WebCore::FrameView::layout):
1339         (WebCore::FrameView::startLayoutAtMainFrameViewIfNeeded): Deleted. -> Assertion in no longer valid.
1340         * page/FrameView.h:
1341         * rendering/RenderView.cpp:
1342         (WebCore::FrameFlatteningLayoutDisallower::FrameFlatteningLayoutDisallower):
1343         (WebCore::FrameFlatteningLayoutDisallower::~FrameFlatteningLayoutDisallower):
1344         (WebCore::RenderView::hitTest): Protect the render tree from subsequent layouts.
1345
1346 2015-06-30  Andy VanWagoner  <thetalecrafter@gmail.com>
1347
1348         Implement ECMAScript Internationalization API
1349         https://bugs.webkit.org/show_bug.cgi?id=90906
1350
1351         Reviewed by Benjamin Poulain.
1352
1353         Test: js/intl.html
1354
1355         * Configurations/FeatureDefines.xcconfig: add ENABLE_INTL flag
1356
1357 2015-06-30  Wenson Hsieh  <whsieh@berkeley.edu>
1358
1359         scroll-snap-points do not work very well with mechanical scroll wheel events
1360         https://bugs.webkit.org/show_bug.cgi?id=142501
1361         <rdar://problem/20093511>
1362
1363         Reviewed by Brent Fulgham.
1364
1365         Stateless scroll events generated by scrolling with a mechanical mouse wheel now trigger scroll
1366         snapping after a fixed delay.
1367
1368         Test: platform/mac-wk2/tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-overflow-stateless.html
1369
1370         * platform/cocoa/ScrollController.h: Added member to track stateless scrolling.
1371         * platform/cocoa/ScrollController.mm: Added constant for delay for stateless scroll snapping.
1372         (WebCore::ScrollController::processWheelEventForScrollSnapOnAxis): Triggers timer upon stateless scroll events.
1373         (WebCore::ScrollController::horizontalScrollSnapTimerFired): Timer now handles stateless scrolling updates.
1374         (WebCore::ScrollController::verticalScrollSnapTimerFired): See above.
1375         (WebCore::ScrollController::beginScrollSnapAnimation): Handles stateless scroll snapping.
1376
1377 2015-06-30  Simon Fraser  <simon.fraser@apple.com>
1378
1379         Try to fix Gtk and EFL builds.
1380
1381         * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
1382         (WebCore::GraphicsLayerTextureMapper::flushCompositingStateForThisLayerOnly):
1383         (WebCore::GraphicsLayerTextureMapper::flushCompositingState):
1384         * platform/graphics/texmap/GraphicsLayerTextureMapper.h:
1385         * platform/graphics/texmap/coordinated/CompositingCoordinator.cpp:
1386         (WebCore::CompositingCoordinator::flushPendingLayerChanges):
1387         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
1388         (WebCore::CoordinatedGraphicsLayer::flushCompositingState):
1389         (WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly):
1390         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
1391
1392 2015-06-30  Simon Fraser  <simon.fraser@apple.com>
1393
1394         [iOS] Missing tiles inside position:fixed on scrolling
1395         https://bugs.webkit.org/show_bug.cgi?id=146485
1396         rdar://problem/21226861
1397
1398         Reviewed by Tim Horton.
1399
1400         Layer flushing adjusts the coverage rect for tiled layers, but does so at times
1401         when position:fixed layers are moved around by the scrolling tree. The computed
1402         coverage rect then doesn't reflect the layer's on-screen position, causing missing
1403         tiles.
1404
1405         Fix by pushing the notion of being in a "stable state" onto FrameView, and passing
1406         that state into the layer flush. When not in a stable state, flushing doesn't change
1407         the visible and coverage rects for layers that are viewport-constrained.
1408
1409         * page/FrameView.cpp:
1410         (WebCore::FrameView::reset):
1411         * page/FrameView.h: Remove some velocity-related data members that were unused.
1412         * platform/graphics/GraphicsLayer.h:
1413         (WebCore::GraphicsLayer::flushCompositingState):
1414         (WebCore::GraphicsLayer::flushCompositingStateForThisLayerOnly):
1415         * platform/graphics/ca/GraphicsLayerCA.cpp:
1416         (WebCore::GraphicsLayerCA::flushCompositingState):
1417         (WebCore::GraphicsLayerCA::flushCompositingStateForThisLayerOnly):
1418         (WebCore::GraphicsLayerCA::setVisibleAndCoverageRects): If this is a viewport-constrained
1419         layer, and the viewport is not stable, don't touch the rects.
1420         (WebCore::GraphicsLayerCA::recursiveCommitChanges):
1421         * platform/graphics/ca/GraphicsLayerCA.h:
1422         (WebCore::GraphicsLayerCA::CommitState::CommitState):
1423         * rendering/RenderLayerCompositor.cpp:
1424         (WebCore::RenderLayerCompositor::flushPendingLayerChanges):
1425
1426 2015-06-30  Simon Fraser  <simon.fraser@apple.com>
1427
1428         Rename GraphicsLayer's allowsBackingStoreDetachment to isViewportConstrained
1429         https://bugs.webkit.org/show_bug.cgi?id=146483
1430
1431         Reviewed by Tim Horton.
1432
1433         What GraphicsLayer really needs to know is whether some other thread/process
1434         is moving its platform layers around behind its back, and this is is better
1435         expressed as "isViewportConstrained" rather than "allowsBackingStoreDetachment".
1436         
1437         The sense of the flag is flipped, and boolean logic adjusted accordingly.
1438
1439         * platform/graphics/GraphicsLayer.h:
1440         (WebCore::GraphicsLayer::setIsViewportConstrained):
1441         (WebCore::GraphicsLayer::isViewportConstrained):
1442         (WebCore::GraphicsLayer::setAllowsBackingStoreDetachment): Deleted.
1443         (WebCore::GraphicsLayer::allowsBackingStoreDetachment): Deleted.
1444         * platform/graphics/ca/GraphicsLayerCA.cpp:
1445         (WebCore::GraphicsLayerCA::GraphicsLayerCA):
1446         (WebCore::GraphicsLayerCA::setVisibleAndCoverageRects):
1447         (WebCore::GraphicsLayerCA::recursiveCommitChanges):
1448         * platform/graphics/ca/GraphicsLayerCA.h:
1449         * rendering/RenderLayerBacking.cpp:
1450         (WebCore::RenderLayerBacking::setIsScrollCoordinatedWithViewportConstrainedRole):
1451
1452 2015-06-30  Dean Jackson  <dino@apple.com>
1453
1454         CABackdropFilter should set windowServerAware to false
1455         https://bugs.webkit.org/show_bug.cgi?id=146469
1456         <rdar://problem/21618614>
1457
1458         Reviewed by Simon Fraser.
1459
1460         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
1461         (PlatformCALayerCocoa::PlatformCALayerCocoa): Set windowServerAware
1462         to false on Mac (it's not available on iOS).
1463
1464 2015-06-30  Chris Dumez  <cdumez@apple.com>
1465
1466         Rolling out r175171
1467         https://bugs.webkit.org/show_bug.cgi?id=146470
1468         <rdar://problem/21349934>
1469
1470         Unreviewed, rolling out <http://trac.webkit.org/changeset/175171>. It
1471         wasn't a huge win and Brady says it caused crash at
1472         <rdar://problem/21349934>.
1473
1474         * platform/network/cf/ResourceRequest.h:
1475         * platform/network/cocoa/ResourceRequestCocoa.mm:
1476         (WebCore::ResourceRequest::doUpdatePlatformRequest):
1477         (WebCore::ResourceRequest::doUpdatePlatformHTTPBody):
1478
1479 2015-06-30  Matt Baker  <mattbaker@apple.com>
1480
1481         Web Inspector: Reduce rendering frames "Other" time by instrumenting compositing
1482         https://bugs.webkit.org/show_bug.cgi?id=146168
1483
1484         Reviewed by Brian Burg.
1485
1486         Added Inspector instrumentation for measuring CoreAnimation compositing time. We mark the start of a composite
1487         event when the LayerFlushScheduler triggers a scheduled layer flush. InspectorController now exports a function
1488         for marking the end of the composite event, which should be called during the CA transaction post-commit phase
1489         (based on platform support). Lacking platform support, the event is considered complete after CoreAnimation
1490         runloop observers have run.
1491
1492         * inspector/InspectorController.cpp:
1493         (WebCore::InspectorController::didComposite):
1494         * inspector/InspectorController.h:
1495         New export for instrumentation in WebKit2.
1496
1497         * inspector/InspectorInstrumentation.cpp:
1498         (WebCore::InspectorInstrumentation::willCompositeImpl):
1499         (WebCore::InspectorInstrumentation::didCompositeImpl):
1500         * inspector/InspectorInstrumentation.h:
1501         (WebCore::InspectorInstrumentation::willComposite):
1502         (WebCore::InspectorInstrumentation::didComposite):
1503         Plumbing for new instrumentation.
1504
1505         * inspector/InspectorTimelineAgent.cpp:
1506         (WebCore::InspectorTimelineAgent::internalStart):
1507         (WebCore::InspectorTimelineAgent::internalStop):
1508         (WebCore::InspectorTimelineAgent::willComposite):
1509         (WebCore::InspectorTimelineAgent::didComposite):
1510         (WebCore::toProtocol):
1511         * inspector/InspectorTimelineAgent.h:
1512         New Composite event type and instrumentation.
1513
1514         * page/FrameView.cpp:
1515         (WebCore::FrameView::flushCompositingStateIncludingSubframes):
1516         Hook for start of compositing.
1517
1518         * platform/spi/cocoa/QuartzCoreSPI.h:
1519         New header include and interface declaration.
1520
1521 2015-06-30  Beth Dakin  <bdakin@apple.com>
1522
1523         The bounds on InteractionInformationAtPosition should be more precise
1524         https://bugs.webkit.org/show_bug.cgi?id=146468
1525         -and corresponding-
1526         rdar://problem/20739834
1527
1528         Reviewed by Enrica Casucci and Simon Fraser.
1529
1530         Export absoluteContentQuad().
1531         * rendering/RenderBox.h:
1532
1533 2015-06-30  Zalan Bujtas  <zalan@apple.com>
1534
1535         Addressing post-review comments in r185756.
1536
1537         * html/RubyTextElement.cpp:
1538         (WebCore::RubyTextElement::createElementRenderer):
1539
1540 2015-06-30  Zalan Bujtas  <zalan@apple.com>
1541
1542         Addressing post-review comments in r185916
1543
1544         * platform/LayoutUnit.h:
1545         (WebCore::roundToDevicePixel):
1546
1547 2015-06-30  Matt Rajca  <mrajca@apple.com>
1548
1549         MediaSession: Use setSessionInternal to set the default media session in HTMLMediaElement's constructor
1550         https://bugs.webkit.org/show_bug.cgi?id=146465
1551
1552         Reviewed by Eric Carlson.
1553
1554         * html/HTMLMediaElement.cpp:
1555         (WebCore::HTMLMediaElement::HTMLMediaElement):
1556
1557 2015-06-30  Matt Rajca  <mrajca@apple.com>
1558
1559         Media Session: implement algorithm for updating a media element's session (6.1)
1560         https://bugs.webkit.org/show_bug.cgi?id=146460
1561
1562         Reviewed by Darin Adler.
1563
1564         In addition to storing a pointer to the new media session, we now:
1565
1566         - pause the media element if it is 'active' in the current media session
1567         - remove the media element from the current media session
1568         - release the current media session if there are no more active media elements
1569         - set the default media session if the new media session is null
1570         - update the 'kind' attribute to match the kind of the new media session
1571
1572         * Modules/mediasession/MediaSession.cpp:
1573         (WebCore::MediaSession::isMediaElementActive):
1574         (WebCore::MediaSession::hasActiveMediaElements):
1575         * Modules/mediasession/MediaSession.h:
1576         * html/HTMLMediaElement.cpp:
1577         (WebCore::HTMLMediaElement::setSession):
1578         (WebCore::HTMLMediaElement::setSessionInternal):
1579         * html/HTMLMediaElement.h:
1580
1581 2015-06-29  Anders Carlsson  <andersca@apple.com>
1582
1583         Get rid of unused WKSI functions
1584         https://bugs.webkit.org/show_bug.cgi?id=146443
1585
1586         Reviewed by Tim Horton.
1587
1588         * platform/graphics/cg/PathCG.cpp:
1589         (WebCore::Path::platformAddPathForRoundedRect):
1590         Just call CGPathAddRoundedRect directly.
1591
1592         * platform/ios/WebCoreSystemInterfaceIOS.mm:
1593         * platform/mac/WebCoreSystemInterface.h:
1594         * platform/mac/WebCoreSystemInterface.mm:
1595
1596 2015-06-30  Youenn Fablet  <youenn.fablet@crf.canon.fr> and Xabier Rodriguez Calvar  <calvaris@igalia.com>
1597
1598         [Streams API] Finish pulling must always be done asynchronously as it is the expected promise behavior (according to the spec)
1599         https://bugs.webkit.org/show_bug.cgi?id=146408
1600
1601         Reviewed by Darin Adler.
1602
1603         Current tests cover the case already.
1604
1605         * Modules/streams/ReadableStream.cpp:
1606         (WebCore::ReadableStream::pull): Call finishPull() in a postTask to delay it and simulate the promise
1607         resolution.
1608
1609 2015-06-30  Youenn Fablet  <youenn.fablet@crf.canon.fr> and Xabier Rodriguez Calvar  <calvaris@igalia.com>
1610
1611         [Streams API] Synced bad strategy test with reference implementation
1612         https://bugs.webkit.org/show_bug.cgi?id=146411
1613
1614         Reviewed by Darin Adler.
1615
1616         Current tests cover the case.
1617
1618         * bindings/js/ReadableJSStream.cpp:
1619         (WebCore::ReadableJSStream::retrieveChunkSize): Check for negative size then running the JavaScript function.
1620
1621 2015-06-30  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1622
1623         [Streams API] Remove ReadableStream.getReader() custom binding
1624         https://bugs.webkit.org/show_bug.cgi?id=146404
1625
1626         Reviewed by Darin Adler.
1627
1628         Covered by existing tests.
1629
1630         * Modules/streams/ReadableStream.cpp:
1631         (WebCore::ReadableStream::getReader): Updated to take an exception.
1632         * Modules/streams/ReadableStream.h:
1633         * Modules/streams/ReadableStream.idl: Updated to remove custom binding.
1634         * bindings/js/JSReadableStreamCustom.cpp:
1635         (WebCore::JSReadableStream::getReader): Deleted.
1636         * bindings/js/JSReadableStreamReaderCustom.cpp:
1637         (WebCore::constructJSReadableStreamReader): Updated to pass an exception to getReader.
1638
1639 2015-06-29  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1640
1641         [Streams API] ReadableStreamReader.closed should use DOMPromise
1642         https://bugs.webkit.org/show_bug.cgi?id=146406
1643
1644         Reviewed by Darin Adler.
1645
1646         Added storage of ClosedPromise as Optional of ReadableStream.
1647         Updated code accordingly.
1648
1649         Covered by existing tests.
1650
1651         * Modules/streams/ReadableStream.cpp:
1652         (WebCore::ReadableStream::clearCallbacks):
1653         (WebCore::ReadableStream::releaseReader):
1654         (WebCore::ReadableStream::changeStateToErrored):
1655         (WebCore::ReadableStream::closed):
1656         * Modules/streams/ReadableStream.h:
1657         * Modules/streams/ReadableStreamReader.cpp:
1658         (WebCore::ReadableStreamReader::closed):
1659         * Modules/streams/ReadableStreamReader.h:
1660         * bindings/js/JSReadableStreamReaderCustom.cpp:
1661         (WebCore::JSReadableStreamReader::closed):
1662
1663 2015-06-29  Simon Fraser  <simon.fraser@apple.com>
1664
1665         [iOS WK2] WKWebViews in Facebook app start off black
1666         https://bugs.webkit.org/show_bug.cgi?id=146445
1667         rdar://problem/21600433
1668
1669         Reviewed by Tim Horton.
1670
1671         If -isOpaque is toggled on a WKWebView, we failed to make the page tiles non-opaque
1672         for a while. After r183775, RenderLayerCompositor::rootBackgroundTransparencyChanged() was called,
1673         but only considered the computed document background color, and not the view transparency.
1674         
1675         Fix by having rootBackgroundTransparencyChanged() simply use viewHasTransparentBackground(),
1676         which checks the FrameView transparency. Now we just need to store a transparency bool rather
1677         than the old color (we only checked its alpha anyway).
1678
1679         * rendering/RenderLayerCompositor.cpp:
1680         (WebCore::RenderLayerCompositor::rootBackgroundTransparencyChanged):
1681
1682 2015-06-29  Dean Jackson  <dino@apple.com>
1683
1684         WebKit should use 80% black background for PiP indicator
1685         https://bugs.webkit.org/show_bug.cgi?id=146444
1686         <rdar://problem/21555726>
1687
1688         Reviewed by Sam Weinig.
1689
1690         Change the black background to a slightly less black background.
1691         This also involved making the placard artwork white, in order
1692         to keep it visible against the new grey.
1693
1694         * Modules/mediacontrols/mediaControlsiOS.css:
1695         (audio::-webkit-media-controls-wireless-playback-status):
1696         (audio::-webkit-media-controls-wireless-playback-status.small):
1697         (audio::-webkit-media-controls-wireless-playback-status.picture-in-picture):
1698
1699 2015-06-29  Brady Eidson  <beidson@apple.com>
1700
1701         Flag sync XHRs from the network process so they can be handled appropriately.
1702         <rdar://problem/21579162> and https://bugs.webkit.org/show_bug.cgi?id=146441
1703
1704         Reviewed by Darin Adler.
1705
1706         * platform/network/ResourceHandleClient.h:
1707         (WebCore::ResourceHandleClient::loadingSynchronousXHR): Added so clients of asynchronous
1708           loads can signal they should be treated like synchronous loads at the platform level.
1709
1710         * platform/network/cf/ResourceHandleCFNet.cpp:
1711         (WebCore::ResourceHandle::start): Adjust SchedulingBehavior based on the client.
1712
1713         * platform/network/mac/ResourceHandleMac.mm:
1714         (WebCore::ResourceHandle::start): Adjust SchedulingBehavior based on the client.
1715
1716 2015-06-29  Chris Fleizach  <cfleizach@apple.com>
1717
1718         AX: PlatformSpeechSynthesizer code doesn't catch Objective-C exceptions
1719         https://bugs.webkit.org/show_bug.cgi?id=146419
1720
1721         Reviewed by Simon Fraser.
1722
1723         Make sure ObjC exception resulting from calling into the platform cause problems in WebKit.
1724
1725         * platform/ios/PlatformSpeechSynthesizerIOS.mm:
1726         (-[WebSpeechSynthesisWrapper speakUtterance:]):
1727         (-[WebSpeechSynthesisWrapper pause]):
1728         (-[WebSpeechSynthesisWrapper resume]):
1729         (-[WebSpeechSynthesisWrapper cancel]):
1730         (-[WebSpeechSynthesisWrapper speechSynthesizer:didStartSpeechUtterance:]):
1731         (WebCore::PlatformSpeechSynthesizer::initializeVoiceList):
1732         (WebCore::PlatformSpeechSynthesizer::pause):
1733
1734 2015-06-29  Matt Rajca  <mrajca@apple.com>
1735
1736         Removing an element from a media session should also remove it from the sets of active participating elements
1737         https://bugs.webkit.org/show_bug.cgi?id=146420
1738
1739         Reviewed by Eric Carlson.
1740
1741         * Modules/mediasession/MediaSession.cpp:
1742         (WebCore::MediaSession::removeMediaElement):
1743
1744 2015-06-29  Dean Jackson  <dino@apple.com>
1745
1746         Temporarily disable PICTURE_SIZES
1747         https://bugs.webkit.org/show_bug.cgi?id=146435
1748         <rdar://problem/21087013>
1749
1750         Reviewed by Tim Horton.
1751
1752         Temporarily disable PICTURE_SIZES because it causes problems with out
1753         of date <picture> polyfills.
1754
1755         * Configurations/FeatureDefines.xcconfig:
1756
1757 2015-06-29  Tim Horton  <timothy_horton@apple.com>
1758
1759         Fix the build.
1760
1761         * editing/cocoa/HTMLConverter.mm:
1762         * platform/spi/cocoa/NSAttributedStringSPI.h:
1763
1764 2015-06-29  Tim Horton  <timothy_horton@apple.com>
1765
1766         Fix the build.
1767
1768         * platform/spi/cocoa/NSAttributedStringSPI.h:
1769
1770 2015-06-29  Tim Horton  <timothy_horton@apple.com>
1771
1772         Fix the build.
1773
1774         * platform/spi/cocoa/NSAttributedStringSPI.h:
1775
1776 2015-06-27  Ryosuke Niwa  <rniwa@webkit.org>
1777
1778         Font panel doesn't get updated when bolding text via cmd+b in Mail on OS X
1779         https://bugs.webkit.org/show_bug.cgi?id=146379
1780
1781         Reviewed by Darin Adler.
1782
1783         The bug was caused by WebKit not updating the font panel when the typing style changes.
1784         There was also a bug that WebKit never updated font attributes on OS X.
1785
1786         Fixed the bugs by always updating the font panel after applying style instead of only
1787         when the selection changes and setting the font attributes.
1788
1789         I tried really had to write a WebKit API test but I couldn't get it to work so there are
1790         no new tests :(
1791
1792         * WebCore.xcodeproj/project.pbxproj:
1793         * editing/Editor.cpp:
1794         (WebCore::Editor::applyStyle):
1795         (WebCore::Editor::shouldApplyStyle):
1796         (WebCore::Editor::applyParagraphStyle):
1797         (WebCore::Editor::applyStyleToSelection):
1798         (WebCore::Editor::applyParagraphStyleToSelection):
1799         (WebCore::Editor::selectionStartHasStyle):
1800         (WebCore::Editor::document):
1801         (WebCore::Editor::styleForSelectionStart): Deleted.
1802         * editing/Editor.h:
1803         * editing/cocoa/EditorCocoa.h: Added. Shares the declaration for NSUnderlineStyle in iOS.
1804         * editing/cocoa/EditorCocoa.mm: Added.
1805         (WebCore::Editor::styleForSelectionStart): Moved from Editor.cpp
1806         (WebCore::Editor::getTextDecorationAttributesRespectingTypingStyle): Extracted from iOS's
1807         fontAttributesForSelectionStart implementation.
1808         * editing/cocoa/HTMLConverter.mm:
1809         * editing/ios/EditorIOS.mm:
1810         (WebCore::Editor::fontAttributesForSelectionStart):
1811         * editing/mac/EditorMac.mm:
1812         (WebCore::Editor::fontAttributesForSelectionStart):
1813         * loader/EmptyClients.h:
1814         * page/EditorClient.h:
1815
1816 2015-06-29  Matt Rajca  <mrajca@apple.com>
1817
1818         MediaSession: use a HashSet for the collection of participating elements
1819         https://bugs.webkit.org/show_bug.cgi?id=146421
1820
1821         Reviewed by Eric Carlson.
1822
1823         * Modules/mediasession/MediaSession.cpp:
1824         (WebCore::MediaSession::addMediaElement):
1825         (WebCore::MediaSession::removeMediaElement):
1826         * Modules/mediasession/MediaSession.h:
1827
1828 2015-06-29  Dean Jackson  <dino@apple.com>
1829
1830         Setting to enable/disable media controls sizing on page zoom
1831         https://bugs.webkit.org/show_bug.cgi?id=146423
1832         <rdar://problem/18379634>
1833
1834         Reviewed by Eric Carlson.
1835
1836         Add a new setting "MediaControlsScaleWithPageZoom" that can disable
1837         the behaviour we currently implement on iOS, where the media controls
1838         attempt to remain at a fixed size independent of page zoom.
1839
1840         * html/HTMLMediaElement.cpp:
1841         (WebCore::HTMLMediaElement::setMediaControlsDependOnPageScaleFactor): Do not
1842         set this value to true if the new setting is disabled.
1843         * page/Settings.cpp:
1844         * page/Settings.in: Add the new setting.
1845
1846 2015-06-29  Adam Bergkvist  <adam.bergkvist@ericsson.com>
1847
1848         WebRTC: Update the MediaStream API
1849         https://bugs.webkit.org/show_bug.cgi?id=146313
1850
1851         Reviewed by Eric Carlson.
1852
1853         Update the MediaStream API (MediaStream, MediaStreamTrack and
1854         RealtimeMediaSource) to match the Media Capture and Stream
1855         specification [1]. Notable changes:
1856
1857         Updated event handling to synchronously update corresponding
1858         state/attributes as events are dispatched.
1859
1860         Removed 'new' state from MediaStreamTrack. A track is either 'live' or
1861         'ended'. As a consequence 'started' event is also removed.
1862
1863         MediaStreamTrack always has a source (disconnected source concept was
1864         removed from the spec). Therefore, more state can be kept at the source
1865         without going away.
1866
1867         Calculate MediaStream.active internally, from the track set, instead of
1868         setting it externally.
1869
1870         Updated RealtimeMediaSource Observer interface.
1871
1872         Replaced MediaStream's separate audio and video track lists with a
1873         single track set (more aligned with spec).
1874
1875         Updated MediaStream constructor to adopt instead of clone track
1876         arguments (or tracks from MediaStream argument).
1877
1878         Removed MediaStreamTrack.getSources() and corresponding test (removed
1879         from spec).
1880
1881         Test status: 3 added, 8 existing enabled (some updated) and 1 removed.
1882
1883         [1] http://w3c.github.io/mediacapture-main/archives/20150523/getusermedia.html
1884
1885         Tests: fast/mediastream/MediaStreamTrack-clone.html
1886                fast/mediastream/MediaStreamTrack-kind.html
1887                fast/mediastream/MediaStreamTrack-stop.html
1888
1889         * Modules/mediastream/MediaStream.cpp:
1890         (WebCore::MediaStream::create):
1891         (WebCore::MediaStream::MediaStream):
1892         (WebCore::MediaStream::clone):
1893         (WebCore::MediaStream::addTrack):
1894         (WebCore::MediaStream::removeTrack):
1895         (WebCore::MediaStream::getTrackById):
1896         (WebCore::MediaStream::getAudioTracks):
1897         (WebCore::MediaStream::getVideoTracks):
1898         (WebCore::MediaStream::getTracks):
1899         (WebCore::MediaStream::contextDestroyed):
1900         (WebCore::MediaStream::trackDidEnd):
1901         (WebCore::MediaStream::activeStatusChanged):
1902         (WebCore::MediaStream::didAddTrackToPrivate):
1903         (WebCore::MediaStream::didRemoveTrackFromPrivate):
1904         (WebCore::MediaStream::internalAddTrack):
1905         (WebCore::MediaStream::internalRemoveTrack):
1906         (WebCore::MediaStream::scheduleActiveStateChange):
1907         (WebCore::MediaStream::activityEventTimerFired):
1908         (WebCore::MediaStream::trackVectorForType):
1909         (WebCore::MediaStream::~MediaStream): Deleted.
1910         (WebCore::MediaStream::registry): Deleted.
1911         (WebCore::MediaStream::addObserver): Deleted.
1912         (WebCore::MediaStream::removeObserver): Deleted.
1913         * Modules/mediastream/MediaStream.h:
1914         * Modules/mediastream/MediaStream.idl:
1915         * Modules/mediastream/MediaStreamTrack.cpp:
1916         (WebCore::MediaStreamTrack::MediaStreamTrack):
1917         (WebCore::MediaStreamTrack::~MediaStreamTrack):
1918         (WebCore::MediaStreamTrack::kind):
1919         (WebCore::MediaStreamTrack::id):
1920         (WebCore::MediaStreamTrack::label):
1921         (WebCore::MediaStreamTrack::enabled):
1922         (WebCore::MediaStreamTrack::setEnabled):
1923         (WebCore::MediaStreamTrack::muted):
1924         (WebCore::MediaStreamTrack::readonly):
1925         (WebCore::MediaStreamTrack::remote):
1926         (WebCore::MediaStreamTrack::readyState):
1927         (WebCore::MediaStreamTrack::ended):
1928         (WebCore::MediaStreamTrack::clone):
1929         (WebCore::MediaStreamTrack::stopProducingData):
1930         (WebCore::MediaStreamTrack::states):
1931         (WebCore::MediaStreamTrack::getCapabilities):
1932         (WebCore::MediaStreamTrack::applyConstraints):
1933         (WebCore::MediaStreamTrack::trackEnded):
1934         (WebCore::MediaStreamTrack::trackMutedChanged):
1935         (WebCore::MediaStreamTrack::stop):
1936         (WebCore::MediaStreamTrack::getConstraints): Deleted.
1937         (WebCore::MediaStreamTrack::addObserver): Deleted.
1938         (WebCore::MediaStreamTrack::removeObserver): Deleted.
1939         (WebCore::MediaStreamTrack::configureTrackRendering): Deleted.
1940         (WebCore::MediaStreamTrack::activeDOMObjectName): Deleted.
1941         (WebCore::MediaStreamTrack::canSuspendForPageCache): Deleted.
1942         * Modules/mediastream/MediaStreamTrack.h:
1943         * Modules/mediastream/MediaStreamTrack.idl:
1944         * Modules/mediastream/RTCPeerConnection.cpp:
1945         (WebCore::RTCPeerConnection::didRemoveRemoteStream): Deleted.
1946         * Modules/mediastream/UserMediaRequest.cpp:
1947         (WebCore::UserMediaRequest::didCreateStream):
1948         * platform/mediastream/MediaStreamPrivate.cpp:
1949         (WebCore::MediaStreamPrivate::create):
1950         (WebCore::MediaStreamPrivate::MediaStreamPrivate):
1951         (WebCore::MediaStreamPrivate::tracks):
1952         (WebCore::MediaStreamPrivate::updateActiveState):
1953         (WebCore::MediaStreamPrivate::addTrack):
1954         (WebCore::MediaStreamPrivate::removeTrack):
1955         * platform/mediastream/MediaStreamPrivate.h:
1956         (WebCore::MediaStreamPrivate::active): Deleted.
1957         * platform/mediastream/MediaStreamTrackPrivate.cpp:
1958         (WebCore::MediaStreamTrackPrivate::create):
1959         (WebCore::MediaStreamTrackPrivate::MediaStreamTrackPrivate):
1960         (WebCore::MediaStreamTrackPrivate::~MediaStreamTrackPrivate):
1961         (WebCore::MediaStreamTrackPrivate::label):
1962         (WebCore::MediaStreamTrackPrivate::setEnabled):
1963         (WebCore::MediaStreamTrackPrivate::endTrack):
1964         (WebCore::MediaStreamTrackPrivate::clone):
1965         (WebCore::MediaStreamTrackPrivate::type):
1966         (WebCore::MediaStreamTrackPrivate::applyConstraints):
1967         (WebCore::MediaStreamTrackPrivate::sourceStopped):
1968         (WebCore::MediaStreamTrackPrivate::sourceMutedChanged):
1969         (WebCore::MediaStreamTrackPrivate::preventSourceFromStopping):
1970         (WebCore::MediaStreamTrackPrivate::muted): Deleted.
1971         (WebCore::MediaStreamTrackPrivate::readonly): Deleted.
1972         (WebCore::MediaStreamTrackPrivate::remote): Deleted.
1973         (WebCore::MediaStreamTrackPrivate::constraints): Deleted.
1974         (WebCore::MediaStreamTrackPrivate::states): Deleted.
1975         (WebCore::MediaStreamTrackPrivate::capabilities): Deleted.
1976         * platform/mediastream/MediaStreamTrackPrivate.h:
1977         (WebCore::MediaStreamTrackPrivate::id):
1978         (WebCore::MediaStreamTrackPrivate::ended):
1979         (WebCore::MediaStreamTrackPrivate::enabled):
1980         (WebCore::MediaStreamTrackPrivate::setClient):
1981         (WebCore::MediaStreamTrackPrivate::source): Deleted.
1982         (WebCore::MediaStreamTrackPrivate::client): Deleted.
1983         * platform/mediastream/RealtimeMediaSource.cpp:
1984         (WebCore::RealtimeMediaSource::RealtimeMediaSource):
1985         (WebCore::RealtimeMediaSource::reset):
1986         (WebCore::RealtimeMediaSource::setMuted):
1987         (WebCore::RealtimeMediaSource::readonly):
1988         (WebCore::RealtimeMediaSource::stop):
1989         (WebCore::RealtimeMediaSource::requestStop):
1990         (WebCore::RealtimeMediaSource::addObserver): Deleted.
1991         (WebCore::RealtimeMediaSource::removeObserver): Deleted.
1992         * platform/mediastream/RealtimeMediaSource.h:
1993         (WebCore::RealtimeMediaSource::stopped):
1994         (WebCore::RealtimeMediaSource::id): Deleted.
1995         (WebCore::RealtimeMediaSource::muted): Deleted.
1996         (WebCore::RealtimeMediaSource::setReadonly): Deleted.
1997         * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp:
1998         (WebCore::RealtimeMediaSourceCenterOwr::createMediaStream): Deleted.
1999         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
2000         (WebCore::MockRealtimeMediaSourceCenter::createMediaStream): Deleted.
2001
2002 2015-06-29  Benjamin Poulain  <benjamin@webkit.org>
2003
2004         Make the NFA transitions range-based
2005         https://bugs.webkit.org/show_bug.cgi?id=146338
2006
2007         Reviewed by Alex Christensen.
2008
2009         Change the NFA to use range based transition for any kind of transition.
2010         The fallback transition is also absorbed as ranges.
2011
2012         Previously, the NFA would only have single transitions and a fallback
2013         transition for all cases not covered by single transitions.
2014
2015         The problem with that design was that character ranges (e.g. [a-z]) were
2016         extended as individual transitions. Something like [^a] would cover
2017         most of the alphabet with transitions.
2018         When converting the NFA to DFA, the time is proportional to the number of states
2019         multiplied by the number of transitions. With many individual transitions,
2020         the run time was an order of magnitude higher than what we want.
2021
2022         This patch changes the NFA to only handle ranges of characters. A single transition
2023         becomes a range with the character as first and last character in the range
2024         ('a' becomes 'a' to 'a').
2025         Ranges of characters are handled direclty (e.g. [a-z] becomes a single 'a' to 'z' transition).
2026
2027         In the context of the state machines, ranges have identifies (the target of the transitions).
2028         When two ranges collide, they have to be split such that each part retain its target
2029         except the intersection that gets the union of the targets.
2030
2031         Handling the union of ranges efficiently is critical because we have to do
2032         it for every NFA node in any subset when building the DFA. The helper
2033         class that does that is MutableRange.
2034
2035         The union of ranges is done efficiently because of preconditions on our list of ranges:
2036         -The ranges must be sorted.
2037         -No range in a list can intersect any other range in the same list.
2038
2039         To merge two ranges, we can go over them in order and split them part by part.
2040         It is easy to find what goes where because they are both sorted and we can
2041         compare the characters of each to know how to move forward.
2042         The time to merge 2 range list is proportional to O(n+m) where 'n' and 'm' are
2043         the number of ranges in each list.
2044
2045         Since taking the union of two lists usually create new ranges, we have to allocate
2046         those somewhere efficiently. To do that, MutableRange support an inline capacity,
2047         which is used for the NFAToDFA Convertion.
2048
2049         ---
2050
2051         With ranges, the NFA-to-DFA conversion changes very little:
2052         -Each NFA nodes contains a list of ranges and each range has a list of targets.
2053         -The subset construction select any number of NFA nodes corresponding to
2054          a single deterministic state.
2055         -For the subset, we can use MutableRange to merge the ranges of every
2056          NFA node in the set. The resulting list has rangeis with targets corresponding
2057          to the union of all the transitions.
2058         -We go over all the ranges the same way we used to go over the transitions.
2059          Since the DFA does not support ranges, the ranges are spread as individual
2060          transitions + fallback transition.
2061
2062         ---
2063
2064         With the efficient merging solved, we still need the actual NFA to use ranges
2065         instead of individual transitions.
2066
2067         I could have used MutableRange for that but it is not the most compact
2068         way to represent ranges that do not need merging.
2069
2070         Instead, the NFA uses a custom structure: ImmutableNFA. It is basically
2071         the same thing, but in that one you cannot change a list of range
2072         after creating it.
2073
2074         Consequently, the sorted ranges in ImmutableNFA are also subsequent
2075         in memory, which is really nice to go over them efficiently
2076         when merging ranges in the NFA-to-DFA conversion. :)
2077
2078         When building the NFA, we don't know all the transitions when creating
2079         each node, BUT we know that we have very few node "unfinished" at any
2080         time. Since we build by going depth-first in the prefix-tree, we only
2081         have the max-depth of live nodes in the worst case.
2082
2083         To help building the NFA out of the prefix tree, we have
2084         ImmutableNFANodeBuilder. It keeps all the informations about a NFA node,
2085         but in a non-compact, mutable form. When a ImmutableNFANodeBuilder
2086         is destroyed, it serialize the information into the immutable NFA.
2087
2088         * WebCore.xcodeproj/project.pbxproj:
2089         * contentextensions/CombinedURLFilters.cpp:
2090         (WebCore::ContentExtensions::generateNFAForSubtree):
2091         (WebCore::ContentExtensions::CombinedURLFilters::processNFAs):
2092         * contentextensions/ContentExtensionCompiler.cpp:
2093         (WebCore::ContentExtensions::compileRuleList):
2094         * contentextensions/DFA.cpp:
2095         (WebCore::ContentExtensions::DFA::empty):
2096         * contentextensions/DFA.h:
2097         * contentextensions/ImmutableNFA.h: Added.
2098         (WebCore::ContentExtensions::ImmutableNFA::ConstTargetIterator::operator*):
2099         (WebCore::ContentExtensions::ImmutableNFA::ConstTargetIterator::operator->):
2100         (WebCore::ContentExtensions::ImmutableNFA::ConstTargetIterator::operator==):
2101         (WebCore::ContentExtensions::ImmutableNFA::ConstTargetIterator::operator!=):
2102         (WebCore::ContentExtensions::ImmutableNFA::ConstTargetIterator::operator++):
2103         (WebCore::ContentExtensions::ImmutableNFA::IterableConstTargets::begin):
2104         (WebCore::ContentExtensions::ImmutableNFA::IterableConstTargets::end):
2105         (WebCore::ContentExtensions::ImmutableNFA::ConstRangeIterator::operator*):
2106         (WebCore::ContentExtensions::ImmutableNFA::ConstRangeIterator::operator->):
2107         (WebCore::ContentExtensions::ImmutableNFA::ConstRangeIterator::operator==):
2108         (WebCore::ContentExtensions::ImmutableNFA::ConstRangeIterator::operator!=):
2109         (WebCore::ContentExtensions::ImmutableNFA::ConstRangeIterator::operator++):
2110         (WebCore::ContentExtensions::ImmutableNFA::ConstRangeIterator::data):
2111         (WebCore::ContentExtensions::ImmutableNFA::IterableConstRange::begin):
2112         (WebCore::ContentExtensions::ImmutableNFA::IterableConstRange::end):
2113         (WebCore::ContentExtensions::ImmutableNFA::IterableConstRange::debugPrint):
2114         (WebCore::ContentExtensions::ImmutableNFA::transitionsForNode):
2115         (WebCore::ContentExtensions::ImmutableNFA::root):
2116         (WebCore::ContentExtensions::ImmutableNFA::finalize):
2117         (WebCore::ContentExtensions::ImmutableNFA::memoryUsed):
2118         * contentextensions/ImmutableNFANodeBuilder.h: Added.
2119         (WebCore::ContentExtensions::ImmutableNFANodeBuilder::ImmutableNFANodeBuilder):
2120         (WebCore::ContentExtensions::ImmutableNFANodeBuilder::~ImmutableNFANodeBuilder):
2121         (WebCore::ContentExtensions::ImmutableNFANodeBuilder::addTransition):
2122         (WebCore::ContentExtensions::ImmutableNFANodeBuilder::addEpsilonTransition):
2123         (WebCore::ContentExtensions::ImmutableNFANodeBuilder::setActions):
2124         (WebCore::ContentExtensions::ImmutableNFANodeBuilder::operator=):
2125         (WebCore::ContentExtensions::ImmutableNFANodeBuilder::finalize):
2126         (WebCore::ContentExtensions::ImmutableNFANodeBuilder::sinkActions):
2127         (WebCore::ContentExtensions::ImmutableNFANodeBuilder::sinkTransitions):
2128         (WebCore::ContentExtensions::ImmutableNFANodeBuilder::sinkEpsilonTransitions):
2129         * contentextensions/MutableRange.h: Added.
2130         (WebCore::ContentExtensions::MutableRange::MutableRange):
2131         (WebCore::ContentExtensions::MutableRange::operator=):
2132         (WebCore::ContentExtensions::MutableRange::size):
2133         * contentextensions/MutableRangeList.h: Added.
2134         (WebCore::ContentExtensions::MutableRangeList::ConstIterator::operator*):
2135         (WebCore::ContentExtensions::MutableRangeList::ConstIterator::operator->):
2136         (WebCore::ContentExtensions::MutableRangeList::ConstIterator::operator==):
2137         (WebCore::ContentExtensions::MutableRangeList::ConstIterator::operator!=):
2138         (WebCore::ContentExtensions::MutableRangeList::ConstIterator::operator++):
2139         (WebCore::ContentExtensions::MutableRangeList::begin):
2140         (WebCore::ContentExtensions::MutableRangeList::end):
2141         (WebCore::ContentExtensions::MutableRangeList::appendRange):
2142         (WebCore::ContentExtensions::MutableRangeList::extend):
2143         (WebCore::ContentExtensions::MutableRangeList::isEmpty):
2144         (WebCore::ContentExtensions::MutableRangeList::clear):
2145         (WebCore::ContentExtensions::MutableRangeList::debugPrint):
2146         (WebCore::ContentExtensions::MutableRangeList::insertBetween):
2147         (WebCore::ContentExtensions::MutableRangeList::initializeFrom):
2148         * contentextensions/NFA.cpp:
2149         (WebCore::ContentExtensions::NFA::debugPrintDot):
2150         (WebCore::ContentExtensions::NFA::NFA): Deleted.
2151         (WebCore::ContentExtensions::NFA::createNode): Deleted.
2152         (WebCore::ContentExtensions::NFA::memoryUsed): Deleted.
2153         (WebCore::ContentExtensions::NFA::addTransition): Deleted.
2154         (WebCore::ContentExtensions::NFA::addEpsilonTransition): Deleted.
2155         (WebCore::ContentExtensions::NFA::addTransitionsOnAnyCharacter): Deleted.
2156         (WebCore::ContentExtensions::NFA::setActions): Deleted.
2157         (WebCore::ContentExtensions::NFA::graphSize): Deleted.
2158         (WebCore::ContentExtensions::NFA::restoreToGraphSize): Deleted.
2159         (WebCore::ContentExtensions::printRange): Deleted.
2160         (WebCore::ContentExtensions::printTransitions): Deleted.
2161         * contentextensions/NFA.h:
2162         (WebCore::ContentExtensions::NFA::root): Deleted.
2163         (WebCore::ContentExtensions::NFA::addRuleId): Deleted.
2164         * contentextensions/NFANode.h:
2165         * contentextensions/NFAToDFA.cpp:
2166         (WebCore::ContentExtensions::epsilonClosureExcludingSelf):
2167         (WebCore::ContentExtensions::resolveEpsilonClosures):
2168         (WebCore::ContentExtensions::NodeIdSetToUniqueNodeIdSetSource::NodeIdSetToUniqueNodeIdSetSource):
2169         (WebCore::ContentExtensions::NodeIdSetToUniqueNodeIdSetTranslator::translate):
2170         (WebCore::ContentExtensions::DataConverterWithEpsilonClosure::convert):
2171         (WebCore::ContentExtensions::DataConverterWithEpsilonClosure::extend):
2172         (WebCore::ContentExtensions::createCombinedTransition):
2173         (WebCore::ContentExtensions::canUseFallbackTransition):
2174         (WebCore::ContentExtensions::findBestFallbackTarget):
2175         (WebCore::ContentExtensions::getOrCreateDFANode):
2176         (WebCore::ContentExtensions::NFAToDFA::convert):
2177         (WebCore::ContentExtensions::populateTransitions): Deleted.
2178         * contentextensions/NFAToDFA.h:
2179         * contentextensions/Term.h:
2180         (WebCore::ContentExtensions::Term::Term):
2181         (WebCore::ContentExtensions::Term::generateGraph):
2182         (WebCore::ContentExtensions::Term::generateSubgraphForAtom):
2183         (WebCore::ContentExtensions::Term::Term::generateGraph): Deleted.
2184
2185 2015-06-29  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2186
2187         Binding generator should allow using JSC::Value for "any" parameter in lieu of ScriptValue
2188         https://bugs.webkit.org/show_bug.cgi?id=146403
2189
2190         Reviewed by Darin Adler.
2191
2192         Covered by existing tests.
2193
2194         Enabling new APIs to use JSC::JSValue by using implicit case from ScriptValue to JSC::JSValue.
2195         Updated binding generator to include ScruptValue header in the needed JSXX.cpp files.
2196         Applied approach to ReadableStreamController.error.
2197
2198         * Modules/streams/ReadableStreamController.h:
2199         (WebCore::ReadableStreamController::error):
2200         * Modules/streams/ReadableStreamController.idl:
2201         * bindings/js/JSReadableStreamControllerCustom.cpp:
2202         (WebCore::constructJSReadableStreamController): Deleted.
2203         * bindings/js/ReadableJSStream.cpp:
2204         (WebCore::ReadableJSStream::error):
2205         * bindings/js/ReadableJSStream.h:
2206         * bindings/scripts/CodeGeneratorJS.pm:
2207         (JSValueToNative):
2208         * bindings/scripts/test/JS/JSTestObj.cpp:
2209
2210 2015-06-29  Anders Carlsson  <andersca@apple.com>
2211
2212         Use DISPATCH_SOURCE_TYPE_MEMORYPRESSURE instead of DISPATCH_SOURCE_TYPE_MEMORYSTATUS
2213         https://bugs.webkit.org/show_bug.cgi?id=146413
2214         rdar://problem/21295036
2215
2216         Reviewed by Andreas Kling.
2217
2218         Replace SPI with API.
2219
2220         * WebCore.xcodeproj/project.pbxproj:
2221         * platform/cocoa/MemoryPressureHandlerCocoa.mm:
2222         (WebCore::MemoryPressureHandler::install):
2223         * platform/mac/WebCoreSystemInterface.h:
2224         * platform/spi/cocoa/DispatchSPI.h: Removed.
2225
2226 2015-06-29  Andreas Kling  <akling@apple.com>
2227
2228         [iOS] Pausing a media element should discard buffered data immediately if under memory pressure.
2229         <https://webkit.org/b/146410>
2230         <rdar://problem/20366883>
2231
2232         Reviewed by Darin Adler.
2233
2234         When moving a media element into paused state, call purgeBufferedDataIfPossible()
2235         right away if the system is under memory pressure.
2236
2237         This ensures that mediaserverd drops its forward-looking frame queue right
2238         away instead of waiting for a new pressure notification.
2239
2240         * html/HTMLMediaElement.cpp:
2241         (WebCore::HTMLMediaElement::pauseInternal):
2242
2243 2015-06-29  Matt Rajca  <mrajca@apple.com>
2244
2245         Media Session: Media elements should report a null session for Default sessions
2246         https://bugs.webkit.org/show_bug.cgi?id=146373
2247
2248         Reviewed by Eric Carlson.
2249
2250         If a media element's current session is a 'Default' media session, its session property should report null in
2251         the JavaScript API.
2252
2253         * Modules/mediasession/MediaSession.h:
2254         * html/HTMLMediaElement.cpp:
2255         (WebCore::HTMLMediaElement::session):
2256
2257 2015-06-29  Said Abou-Hallawa  <sabouhallawa@apple.com>
2258
2259         [Mac] Disable QTKit by default.
2260         https://bugs.webkit.org/show_bug.cgi?id=146352
2261
2262         Reviewed by Darin Adler.
2263         
2264         Fix the the requirement for enabling QTKit and AVFoundation.
2265
2266         * page/Settings.cpp:
2267         (WebCore::invalidateAfterGenericFamilyChange): Remove the requirement
2268         for enabling QTKit and AVFoundation. The initial state of QTKit should
2269         be disabled on all OS X ports. And the initial state of AVFoundation
2270         should be enabled  on all OS X ports.
2271
2272 2015-06-29  Hyungwook Lee  <hyungwook.lee@navercorp.com>
2273
2274         [EFL] Purge unused favicons from IconDatabase after 30 days.
2275         https://bugs.webkit.org/show_bug.cgi?id=146334
2276
2277         Reviewed by Gyuyoung Kim.
2278
2279         We need purge unused favicons from IconDatabase for database size control.
2280
2281         * loader/icon/IconDatabase.cpp:
2282         (WebCore::IconDatabase::performURLImport):
2283
2284 2015-06-26  Matt Rajca  <mrajca@apple.com>
2285
2286         Add support for 'Default' media session types
2287         https://bugs.webkit.org/show_bug.cgi?id=146355
2288
2289         Reviewed by Darin Adler.
2290
2291         * Modules/mediasession/MediaSession.cpp:
2292         (WebCore::MediaSession::MediaSession): Added a new constructor for creating 'Default' media sessions.
2293         (WebCore::MediaSession::kind): 'Default' media sessions are represented by an empty string.
2294         * Modules/mediasession/MediaSession.h:
2295         * dom/Document.cpp:
2296         (WebCore::Document::defaultMediaSession): Lazily construct the default media session.
2297         * dom/Document.h:
2298         * html/HTMLMediaElement.cpp:
2299         (WebCore::HTMLMediaElement::HTMLMediaElement): New media elements are assigned to the 'Default' media session.
2300
2301 2015-06-28  Andreas Kling  <akling@apple.com>
2302
2303         [iOS] Drop buffered data in paused media elements on memory pressure.
2304         <https://webkit.org/b/146369>
2305         <rdar://problem/20366883>
2306
2307         Reviewed by Eric Carlson.
2308
2309         To avoid getting crushed under mediaserverd memory growth when viewing
2310         a page with multiple media elements, add a step to the memory pressure
2311         handler that drops buffered data from all media elements that are
2312         not currently playing.
2313
2314         On a test page with a bunch of embedded YouTube videos, this pass frees
2315         up ~4MB per paused video when the system memory pressure hits.
2316
2317         * html/HTMLMediaElement.cpp:
2318         (WebCore::HTMLMediaElement::allMediaElements):
2319         (WebCore::HTMLMediaElement::HTMLMediaElement):
2320         (WebCore::HTMLMediaElement::~HTMLMediaElement):
2321         (WebCore::HTMLMediaElement::purgeBufferedDataIfPossible):
2322         * html/HTMLMediaElement.h:
2323         * platform/MemoryPressureHandler.cpp:
2324         (WebCore::MemoryPressureHandler::releaseCriticalMemory):
2325
2326 2015-06-28  Chris Dumez  <cdumez@apple.com>
2327
2328         Crash: com.apple.WebKit.WebContent at com.apple.WebCore: WebCore::CachedFrameBase::restore + 333
2329         https://bugs.webkit.org/show_bug.cgi?id=146388
2330         <rdar://problem/21567343>
2331
2332         Reviewed by Darin Adler.
2333
2334         Pages that are currently loading are not supposed to go into the
2335         PageCache. However, PageCache::canCache() only checks if the
2336         FrameLoader's documentLoader is loading. If the subframe is in
2337         provisional load stage, we would fail to detect that the frame is
2338         actually loading because the FrameLoader active documentLoader would
2339         be the provisional documentLoader, not the regular documentLoader.
2340         Therefore, the page would get added to the PageCache and the frame
2341         would keep loading while in the PageCache.
2342
2343         On http://www.audiusa.com/models, this is what was happening. It was
2344         crashing because the subframe would finish loading while in the
2345         PageCache, in which case we would fire the 'load' event and the
2346         content 'load' event handler would then proceed to remove the iframe.
2347         Upon restoring the PageCache entry, we would run into trouble as we
2348         would have a CachedFrame whose Frame has been removed.
2349
2350         The solution proposed is to prevent page-caching if a subframe is in
2351         provisional load stage.
2352
2353         Test: http/tests/navigation/page-cache-iframe-provisional-load.html
2354
2355         * history/PageCache.cpp:
2356         (WebCore::logCanCacheFrameDecision):
2357         (WebCore::PageCache::canCachePageContainingThisFrame):
2358         * page/DiagnosticLoggingKeys.cpp:
2359         (WebCore::DiagnosticLoggingKeys::provisionalLoadKey):
2360         * page/DiagnosticLoggingKeys.h:
2361
2362 2015-06-28  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet  <youenn.fablet@crf.canon.fr>
2363
2364         [Streams API] Add support for chunks with customized sizes
2365         https://bugs.webkit.org/show_bug.cgi?id=146312
2366
2367         Reviewed by Darin Adler.
2368
2369         Covered by rebased tests.
2370
2371         * bindings/js/ReadableJSStream.cpp:
2372         (WebCore::ReadableJSStream::read): Decrement totalQueueSize with the chunk specific size.
2373         (WebCore::ReadableJSStream::enqueue): Calls retrieveSize, enqueue chunk with its size and increment totalQueueSize.
2374         (WebCore::ReadableJSStream::retrieveChunkSize): Calls size JS callback and convert it to double.
2375         * bindings/js/ReadableJSStream.h:
2376
2377 2015-06-28  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2378
2379         [Streams API]Remove ReadableStreamController.close custom binding
2380         https://bugs.webkit.org/show_bug.cgi?id=146380
2381
2382         Reviewed by Darin Adler.
2383
2384         No change in behavior.
2385
2386         * Modules/streams/ReadableStreamController.h:
2387         (WebCore::ReadableStreamController::close): Calling ReadableJSStream close method.
2388         * Modules/streams/ReadableStreamController.idl: Removed Custom.
2389         * bindings/js/JSReadableStreamControllerCustom.cpp:
2390         (WebCore::JSReadableStreamController::close): Deleted.
2391         * bindings/js/ReadableJSStream.cpp:
2392         (WebCore::ReadableJSStream::close): Moved custom binding code here.
2393         * bindings/js/ReadableJSStream.h:
2394
2395 2015-06-27  Chris Fleizach  <cfleizach@apple.com>
2396
2397         AX: implement @aria-roledescription
2398         https://bugs.webkit.org/show_bug.cgi?id=146274
2399
2400         Reviewed by Darin Adler.
2401
2402         Add support for aria-roledescription.
2403
2404         Test: accessibility/aria-roledescription.html
2405
2406         * accessibility/AccessibilityObject.cpp:
2407         (WebCore::AccessibilityObject::hasHighlighting):
2408         (WebCore::AccessibilityObject::roleDescription):
2409         (WebCore::nodeHasPresentationRole):
2410         * accessibility/AccessibilityObject.h:
2411         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2412         (-[WebAccessibilityObjectWrapper _accessibilityMaxValue]):
2413         (-[WebAccessibilityObjectWrapper accessibilityRoleDescription]):
2414         (-[WebAccessibilityObjectWrapper accessibilityLabel]):
2415         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2416         (-[WebAccessibilityObjectWrapper roleDescription]):
2417
2418 2015-06-27  Darin Adler  <darin@apple.com>
2419
2420         Fix the build.
2421
2422         * platform/network/cf/ResourceErrorCF.cpp:
2423         (WebCore::ResourceError::cfError): Take out log statement. Add FIXME comment
2424         that explains part of the reason we may get null here.
2425         * platform/network/mac/ResourceErrorMac.mm:
2426         (WebCore::createNSErrorFromResourceErrorBase): Ditto.
2427
2428 2015-06-27  David Kilzer  <ddkilzer@apple.com>
2429
2430         Crash in WebCore::ResourceError::cfError() after provisional load failed
2431         <http://webkit.org/b/146384>
2432
2433         Reviewed by Darin Adler.
2434
2435         This is a speculative fix based on the crashing stack.
2436
2437         * platform/network/cf/ResourceErrorCF.cpp:
2438         (WebCore::ResourceError::cfError): Add NULL check.
2439         * platform/network/mac/ResourceErrorMac.mm:
2440         (WebCore::createNSErrorFromResourceErrorBase): Add nil check in
2441         case we ever turn off USE(CFNETWORK) for iOS.
2442
2443 2015-06-27  Eric Carlson  <eric.carlson@apple.com>
2444
2445         [Mac] Only flag a video element as eligible for auto-play to AppleTV one time
2446         https://bugs.webkit.org/show_bug.cgi?id=146386
2447
2448         Reviewed by Brent Fulgham.
2449
2450         * Modules/mediasession/WebMediaSessionManager.cpp:
2451         (WebCore::WebMediaSessionManager::removeAllPlaybackTargetPickerClients): Drive-by fix - early 
2452           return when there are no clients.
2453
2454         * html/HTMLMediaElement.cpp:
2455         (WebCore::HTMLMediaElement::pendingActionTimerFired): Set m_failedToPlayToWirelessTarget if the
2456           media engine is still unable to play to the wireless target.
2457         (WebCore::HTMLMediaElement::prepareForLoad): Clear m_failedToPlayToWirelessTarget.
2458         (WebCore::HTMLMediaElement::mediaState): Don't set the ExternalDeviceAutoPlayCandidate flag
2459           if m_failedToPlayToWirelessTarget is true.
2460         * html/HTMLMediaElement.h:
2461
2462 2015-06-27  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet  <youenn.fablet@crf.canon.fr>
2463
2464         [Streams API] Implement ReadableStreamController.desiredSize property
2465         https://bugs.webkit.org/show_bug.cgi?id=146311
2466
2467         Reviewed by Darin Adler.
2468
2469         Covered by rebased tests.
2470
2471         * Modules/streams/ReadableStreamController.h: Adding desiredSize getter.
2472         (WebCore::ReadableStreamController::desiredSize): Ditto.
2473         * Modules/streams/ReadableStreamController.idl: Added desiredSize attribute.
2474
2475 2015-06-27  Carlos Garcia Campos  <cgarcia@igalia.com>
2476
2477         [GTK][SOUP] Implement WebCore::PublicSuffix for soup and enable PUBLIC_SUFFIX_LIST for GTK+
2478         https://bugs.webkit.org/show_bug.cgi?id=146318
2479
2480         Reviewed by Sergio Villar Senin.
2481
2482         This is covered by unit tests.
2483
2484         * PlatformGTK.cmake:
2485         * platform/soup/PublicSuffixSoup.cpp: Added.
2486         (WebCore::isPublicSuffix):
2487         (WebCore::topPrivatelyControlledDomain):
2488
2489 2015-06-26  Myles C. Maxfield  <mmaxfield@apple.com>
2490
2491         [iOS] AppleGothic has been superseded by Apple SD Gothic Neo
2492         https://bugs.webkit.org/show_bug.cgi?id=146372
2493         <rdar://problem/21574004>
2494
2495         Reviewed by Dean Jackson.
2496
2497         Test: fast/text/hangul-generic-font-families.html
2498
2499         * page/mac/SettingsMac.mm:
2500         (WebCore::Settings::initializeDefaultFontFamilies):
2501
2502 2015-06-26  Matt Daiter  <mdaiter@apple.com>
2503
2504         Supporting getStartDate and added tests
2505         https://bugs.webkit.org/show_bug.cgi?id=145676
2506         <rdar://problem/20876076>
2507
2508         Reviewed by Brent Fulgham.
2509
2510         Test: http/tests/media/hls/video-controller-getStartDate.html
2511
2512         * bindings/js/JSDOMBinding.cpp:
2513         (WebCore::jsDateOrNaN):
2514         * bindings/js/JSDOMBinding.h:
2515         * bindings/scripts/CodeGeneratorJS.pm: Added features to return 
2516         NaN for Date
2517         * bindings/scripts/CodeGeneratorGObject.pm: Needed to add
2518         type checking code for GObject (no date)
2519         (NativeToJSValue):
2520         * bindings/scripts/IDLAttributes.txt: 
2521         * html/HTMLMediaElement.cpp: Added getStartDate function
2522         (WebCore::HTMLMediaElement::getStartDate):
2523         * html/HTMLMediaElement.h: Needed to add declarations
2524         * html/HTMLMediaElement.idl: Needed to modify for returning NaN
2525         * platform/graphics/MediaPlayer.cpp:
2526         (WebCore::MediaPlayer::getStartDate):
2527         * platform/graphics/MediaPlayer.h:
2528         * platform/graphics/MediaPlayerPrivate.h: Added in Mac-specific platform
2529         (WebCore::MediaPlayerPrivateInterface::getStartDate):
2530         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
2531         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2532         (WebCore::MediaPlayerPrivateAVFoundationObjC::getStartDate):
2533
2534 2015-06-26  Beth Dakin  <bdakin@apple.com>
2535
2536         WebPage::getPositionInformation() should not copy an image that is larger than the  
2537         screen
2538         https://bugs.webkit.org/show_bug.cgi?id=146367
2539
2540         Reviewed by Tim Horton.
2541
2542         Export the rect version of this function too.
2543         * platform/graphics/GraphicsContext.h:
2544
2545 2015-06-26  Eric Carlson  <eric.carlson@apple.com>
2546
2547         [Mac] Muted videos should not automatically play to AppleTV
2548         https://bugs.webkit.org/show_bug.cgi?id=146366
2549
2550         Reviewed by Dean Jackson.
2551
2552         * html/HTMLMediaElement.cpp:
2553         (WebCore::HTMLMediaElement::HTMLMediaElement): Initialize m_initiallyMuted.
2554         (WebCore::HTMLMediaElement::scheduleDelayedAction): Support CheckMediaState.
2555         (WebCore::HTMLMediaElement::setReadyState): Set m_initiallyMuted to true if the element is
2556           muted or the volume is less than 5%.
2557         (WebCore::HTMLMediaElement::setMuted): Update media state asynchronously so multiple state
2558           changes can be coalesced.
2559         (WebCore::HTMLMediaElement::mediaPlayerEngineUpdated): Ditto.
2560         (WebCore::HTMLMediaElement::setPlaying): Ditto.
2561         (WebCore::HTMLMediaElement::mediaPlayerCurrentPlaybackTargetIsWirelessChanged): Ditto.
2562         (WebCore::HTMLMediaElement::removeEventListener): Ditto.
2563         (WebCore::HTMLMediaElement::enqueuePlaybackTargetAvailabilityChangedEvent): Ditto.
2564         (WebCore::HTMLMediaElement::updateMediaState): Update after a timer when passed UpdateMediaState::Asynchronously.
2565         (WebCore::HTMLMediaElement::mediaState): Don't set the ExternalDeviceAutoPlayCandidate flag if
2566           m_initiallyMuted is true.
2567         * html/HTMLMediaElement.h:
2568         * html/HTMLMediaElementEnums.h:
2569
2570 2015-06-26  Daniel Bates  <dabates@apple.com>
2571
2572         Rolling out r184660
2573         https://bugs.webkit.org/show_bug.cgi?id=145200
2574
2575         Reverting r184660 because it caused a regression.
2576
2577         * English.lproj/Localizable.strings:
2578         * html/TextFieldInputType.cpp:
2579         (WebCore::TextFieldInputType::createAutoFillButton): Deleted.
2580         * platform/LocalizedStrings.cpp:
2581         (WebCore::AXAutoFillButtonText): Deleted.
2582         * platform/LocalizedStrings.h:
2583         * platform/efl/LocalizedStringsEfl.cpp:
2584         (WebCore::AXAutoFillButtonText): Deleted.
2585         * platform/gtk/LocalizedStringsGtk.cpp:
2586         (WebCore::AXAutoFillButtonText): Deleted.
2587
2588 2015-06-26  Daniel Bates  <dabates@apple.com>
2589
2590         Rolling out r185881
2591         https://bugs.webkit.org/show_bug.cgi?id=146243
2592         And
2593         r185828
2594         https://bugs.webkit.org/show_bug.cgi?id=145241
2595
2596         Reverting r185881 and r185828 because the latter caused a regression.
2597
2598         * accessibility/AccessibilityRenderObject.cpp:
2599         (WebCore::AccessibilityRenderObject::accessibilityTextFieldDecorationHitTest): Deleted.
2600         (WebCore::AccessibilityRenderObject::accessibilityHitTest): Deleted.
2601         * accessibility/AccessibilityRenderObject.h:
2602
2603 2015-06-26  Dean Jackson  <dino@apple.com>
2604
2605         No audio on animated page with the attached fixed layout epub
2606         https://bugs.webkit.org/show_bug.cgi?id=146365
2607
2608         Reviewed by Eric Carlson.
2609
2610         The new restriction RequireUserGestureForAudioRateChange conflicted
2611         with existing clients who expected RequireUserGestureForRateChange
2612         to allow autoplaying audio. Update the logic to ensure that
2613         RequireUserGestureForRateChange covers all media when set to
2614         false.
2615
2616         This may require a revisit once we're using RequireUserGestureForAudioRateChange
2617         in production, because the global setting will trump that, and
2618         most clients have the global setting to false. We'll need to come
2619         up with a way to allow legacy clients to preserve their behaviour.
2620
2621         * html/HTMLMediaElement.cpp:
2622         (WebCore::HTMLMediaElement::HTMLMediaElement): Only restrict audio
2623         if RequireUserGestureForRateChange is also false.
2624
2625 2015-06-25  Anders Carlsson  <andersca@apple.com>
2626
2627         Get rid of ScrollbarThemeClient now that it's unused
2628         https://bugs.webkit.org/show_bug.cgi?id=146327
2629
2630         Reviewed by Beth Dakin.
2631
2632         * WebCore.vcxproj/WebCore.vcxproj:
2633         * WebCore.vcxproj/WebCore.vcxproj.filters:
2634         * WebCore.xcodeproj/project.pbxproj:
2635         * platform/Scrollbar.cpp:
2636         (WebCore::Scrollbar::scrollbarOverlayStyle): Deleted.
2637         (WebCore::Scrollbar::isScrollableAreaActive): Deleted.
2638         (WebCore::Scrollbar::isScrollViewScrollbar): Deleted.
2639         (WebCore::Scrollbar::root): Deleted.
2640         * platform/Scrollbar.h:
2641         (WebCore::Scrollbar::isCustomScrollbar):
2642         (WebCore::Scrollbar::orientation):
2643         (WebCore::Scrollbar::value):
2644         (WebCore::Scrollbar::currentPos):
2645         (WebCore::Scrollbar::visibleSize):
2646         (WebCore::Scrollbar::totalSize):
2647         (WebCore::Scrollbar::maximum):
2648         (WebCore::Scrollbar::controlSize):
2649         (WebCore::Scrollbar::lineStep):
2650         (WebCore::Scrollbar::pageStep):
2651         (WebCore::Scrollbar::pressedPart):
2652         (WebCore::Scrollbar::hoveredPart):
2653         (WebCore::Scrollbar::enabled):
2654         (WebCore::Scrollbar::styleChanged):
2655         (WebCore::Scrollbar::isAlphaLocked):
2656         (WebCore::Scrollbar::setIsAlphaLocked):
2657         * platform/ScrollbarTheme.h:
2658         * platform/ScrollbarThemeClient.h: Removed.
2659         (WebCore::ScrollbarThemeClient::~ScrollbarThemeClient): Deleted.
2660         * platform/mac/ScrollbarThemeMac.mm:
2661         (WebCore::ScrollbarThemeMac::updateScrollbarOverlayStyle):
2662         * rendering/RenderScrollbarTheme.cpp:
2663
2664 2015-06-26  Chris Dumez  <cdumez@apple.com>
2665
2666         Prevent new loads while in PageCache (or being added to PageCache)
2667         https://bugs.webkit.org/show_bug.cgi?id=146299
2668         <rdar://problem/21523788>
2669
2670         Reviewed by Darin Adler.
2671
2672         Generalize the change in r185337 to prevent new loads while in the
2673         PageCache (or being added to the PageCache), instead of merely
2674         preventing new loads in pagehide event handlers. We should never
2675         have any pages that are still loading inside the PageCache.
2676
2677         The fix in r185337 was apparently insufficient to address the
2678         problem so generalizing the check / policy will hopefully catch
2679         more cases where content is able to start loads while being added
2680         to the PageCache. This patch also removes some of the complexity
2681         added in r185337 as it is no longer needed.
2682
2683         No new tests, already covered by:
2684         http/tests/navigation/image-load-in-pagehide-handler.html
2685         http/tests/navigation/subframe-pagehide-handler-starts-load.html
2686         http/tests/navigation/subframe-pagehide-handler-starts-load2.html
2687
2688         * loader/FrameLoader.cpp:
2689         (WebCore::FrameLoader::stopLoading):
2690         (WebCore::FrameLoader::loadURL):
2691         (WebCore::FrameLoader::loadWithDocumentLoader):
2692         (WebCore::FrameLoader::stopAllLoaders):
2693         (WebCore::FrameLoader::handleBeforeUnloadEvent):
2694         (WebCore::FrameLoader::FrameLoader): Deleted.
2695         * loader/FrameLoader.h:
2696         (WebCore::FrameLoader::pageDismissalEventBeingDispatched):
2697         * loader/ImageLoader.cpp:
2698         (WebCore::pageIsBeingDismissed):
2699         * loader/cache/CachedResource.cpp:
2700         (WebCore::CachedResource::load):
2701         * loader/cache/CachedResourceLoader.cpp:
2702         (WebCore::CachedResourceLoader::requestImage):
2703         * page/Page.cpp:
2704         (WebCore::Page::inPageCache):
2705         * page/Page.h:
2706         (WebCore::Page::group): Deleted.
2707
2708 2015-06-26  Simon Fraser  <simon.fraser@apple.com>
2709
2710         [OS X] Change the layer tiling threshold from 2000 to 2048 pixels
2711         https://bugs.webkit.org/show_bug.cgi?id=146353
2712
2713         Reviewed by Tim Horton.
2714
2715         Programmers love powers of two.
2716
2717         * platform/graphics/ca/GraphicsLayerCA.cpp:
2718
2719 2015-06-26  Myles C. Maxfield  <mmaxfield@apple.com>
2720
2721         [Cocoa] Sans-serif generic font family should map to PingFang
2722         https://bugs.webkit.org/show_bug.cgi?id=146333
2723         <rdar://problem/21521217>
2724
2725         Reviewed by Alexey Proskuryakov.
2726
2727         Also performs a little bit of cleanup.
2728
2729         Test: fast/text/han-generic-font-families.html
2730
2731         * page/mac/SettingsMac.mm:
2732         (WebCore::sansSerifTraditionalHanFontFamily):
2733         (WebCore::sansSerifSimplifiedHanFontFamily):
2734         (WebCore::Settings::initializeDefaultFontFamilies):
2735
2736 2015-06-26  Per Arne Vollan  <peavo@outlook.com>
2737
2738         [Curl] Compile errors; ResourceResponseBase::resourceLoadTiming() has changed return type.
2739         https://bugs.webkit.org/show_bug.cgi?id=146343
2740
2741         Reviewed by Brent Fulgham.
2742
2743         * platform/network/curl/ResourceHandleManager.cpp:
2744         (WebCore::calculateWebTimingInformations):
2745         (WebCore::headerCallback):
2746         (WebCore::ResourceHandleManager::initializeHandle):
2747         (WebCore::ResourceHandleManager::initCookieSession):
2748         (WebCore::sockoptfunction): Deleted.
2749
2750 2015-06-26  Chris Fleizach  <cfleizach@apple.com>
2751
2752         iOS speech synthesizer should expose names
2753         https://bugs.webkit.org/show_bug.cgi?id=146319
2754
2755         Reviewed by Mario Sanchez Prada.
2756
2757         Use newer API to get the name and identifier of each voice asset.
2758
2759         * platform/ios/PlatformSpeechSynthesizerIOS.mm:
2760         (WebCore::PlatformSpeechSynthesizer::initializeVoiceList):
2761
2762 2015-06-26  Csaba Osztrogonác  <ossy@webkit.org>
2763
2764         [EFL] Remove unnecessary overriden methods from ScrollBarEfl
2765         https://bugs.webkit.org/show_bug.cgi?id=146342
2766
2767         Reviewed by Gyuyoung Kim.
2768
2769         * platform/efl/ScrollbarEfl.cpp:
2770         (WebCore::ScrollbarEfl::setParent): Deleted.
2771         (WebCore::ScrollbarEfl::setFrameRect): Deleted.
2772         (WebCore::ScrollbarEfl::frameRectsChanged): Deleted.
2773         (WebCore::ScrollbarEfl::invalidate): Deleted.
2774         * platform/efl/ScrollbarEfl.h:
2775
2776 2015-06-26  Csaba Osztrogonác  <ossy@webkit.org>
2777
2778         Convert some of WebCore/dom over to range-for loops
2779         https://bugs.webkit.org/show_bug.cgi?id=126250
2780
2781         Reviewed by Darin Adler.
2782
2783         Based on the original patch of Sam Weinig <sam@webkit.org>.
2784
2785         * dom/ContainerNode.cpp:
2786         (WebCore::ContainerNode::replaceChild):
2787         (WebCore::willRemoveChildren):
2788         (WebCore::ContainerNode::appendChild):
2789         * dom/MutationObserver.cpp:
2790         (WebCore::MutationObserver::disconnect):
2791         (WebCore::MutationObserver::getObservedNodes):
2792         (WebCore::MutationObserver::deliver):
2793         * dom/MutationObserverInterestGroup.cpp:
2794         (WebCore::MutationObserverInterestGroup::isOldValueRequested):
2795         (WebCore::MutationObserverInterestGroup::enqueueMutationRecord):
2796         * dom/MutationObserverRegistration.cpp:
2797         (WebCore::MutationObserverRegistration::clearTransientRegistrations):
2798         (WebCore::MutationObserverRegistration::addRegistrationNodesToSet):
2799         * dom/Node.cpp:
2800         (WebCore::Node::dumpStatistics):
2801         (WebCore::collectMatchingObserversForMutation):
2802         (WebCore::Node::notifyMutationObserversNodeWillDetach):
2803
2804 2015-06-25  Lucas Forschler  <lforschler@apple.com>
2805
2806         Unreviewed build fix.
2807         
2808         * platform/audio/VectorMath.cpp:
2809         (WebCore::VectorMath::vsmul):
2810         (WebCore::VectorMath::vadd):
2811         (WebCore::VectorMath::vmul):
2812         (WebCore::VectorMath::zvmul):
2813
2814 2015-06-25  Stephanie Lewis  <slewis@apple.com>
2815
2816         Build fix.
2817
2818         Unreviewed.
2819
2820         * platform/audio/DirectConvolver.cpp:
2821         (WebCore::DirectConvolver::process):
2822
2823 2015-06-25  Chris Fleizach  <cfleizach@apple.com>
2824
2825         AX: improve list heuristics (presentational use versus actual lists)
2826         https://bugs.webkit.org/show_bug.cgi?id=134187
2827
2828         Rolling this change back in. 
2829         It was taken out to allow clients to have time to update their expectations of what is a list vs. a group
2830
2831         Test: accessibility/list-detection2.html
2832
2833         * accessibility/AccessibilityList.cpp:
2834         (WebCore::AccessibilityList::isDescriptionList):
2835         (WebCore::AccessibilityList::childHasPseudoVisibleListItemMarkers):
2836         (WebCore::AccessibilityList::determineAccessibilityRole):
2837         * accessibility/AccessibilityList.h:
2838
2839 2015-06-25  Brent Fulgham  <bfulgham@apple.com>
2840
2841         Unreviewed build fix after r185964.
2842
2843         Correct a few pointers-that-should-be-references-now errors.
2844
2845         * platform/win/PopupMenuWin.cpp:
2846         (WebCore::AccessiblePopupMenu::accLocation):
2847         (WebCore::AccessiblePopupMenu::accHitTest):
2848
2849 2015-06-25  Doug Russell  <d_russell@apple.com>
2850
2851         Bug 146300 AX: AccessibilityObject focus events that don't cause a selection 
2852         change can leave m_isSynchronizingSelection set to true
2853         https://bugs.webkit.org/show_bug.cgi?id=146300
2854
2855         Reviewed by Chris Fleizach.
2856
2857         Added a clearTextSelectionIntent() convenience function to be used after any
2858         event that can, but isn't guaranteed to result in a selection change. Matches
2859         calls to setTextSelectionIntent() convenience function.
2860         Added support for tests listening for focus change notifications.
2861
2862         Test: platform/mac/accessibility/focus-setting-selection-syncronizing-not-clearing.html
2863
2864         * accessibility/AccessibilityRenderObject.cpp:
2865         (WebCore::clearTextSelectionIntent):
2866         (WebCore::AccessibilityRenderObject::setSelectedTextRange):
2867         (WebCore::AccessibilityRenderObject::setFocused):
2868         (WebCore::AccessibilityRenderObject::setSelectedVisiblePositionRange):
2869         * accessibility/mac/AXObjectCacheMac.mm:
2870         (WebCore::AXObjectCache::platformHandleFocusedUIElementChanged):
2871
2872 2015-06-25  Alex Christensen  <achristensen@webkit.org>
2873
2874         [Content Extensions] Add a way to match a domain but not subdomains
2875         https://bugs.webkit.org/show_bug.cgi?id=146241
2876         rdar://problem/21557754
2877
2878         Reviewed by Darin Adler.
2879
2880         This patch makes it possible to have a trigger with an if-domain apply to sub2.sub1.webkit.org
2881         but not sub1.webkit.org by making the domains default to only applying to the domain and not subdomains.
2882         To make a domain apply to a domain and any subdomains, the domain must begin with a '*'.
2883
2884         * contentextensions/CombinedURLFilters.cpp:
2885         (WebCore::ContentExtensions::CombinedURLFilters::addDomain):
2886         (WebCore::ContentExtensions::CombinedURLFilters::addPattern):
2887         Make domains apply only to the exact domain unless there is a * at the beginning,
2888         in which case they apply to the domain and any subdomains.
2889
2890 2015-06-25  Simon Fraser  <simon.fraser@apple.com>
2891
2892         [iOS WK2] Swiping back just after scrolling can cause some tiles to disappear
2893         https://bugs.webkit.org/show_bug.cgi?id=146329
2894         rdar://problem/21233010
2895
2896         Reviewed by Tim Horton.
2897
2898         Have the Compositing log channel dump the visible rect used for layer flushing.
2899
2900         * rendering/RenderLayerCompositor.cpp:
2901         (WebCore::RenderLayerCompositor::flushPendingLayerChanges):
2902
2903 2015-06-25  Brent Fulgham  <bfulgham@apple.com>
2904
2905         [WIN] Enable WEB_TIMING API
2906         https://bugs.webkit.org/show_bug.cgi?id=146330
2907         <rdar://problem/21530765>
2908
2909         Reviewed by Dean Jackson.
2910
2911         Tested by internal HLS tests.
2912
2913         Enable WEB_TIMING features on Windows by activating the feature flag,
2914         and correcting some build errors.
2915
2916         * platform/network/cf/ResourceHandleCFNet.cpp:
2917         (WebCore::ResourceHandle::start): "setCollectionTimingData" is only
2918         defined for PLATFORM(COCOA).
2919         * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:
2920         (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveResponse):
2921         The 'ResourceHandle::getConnectionTimingData' method is only defined
2922         for PLATFORM(COCOA).
2923
2924 2015-06-25  Dean Jackson  <dino@apple.com>
2925
2926         Inline media controls disappear when returning a video to inline
2927         https://bugs.webkit.org/show_bug.cgi?id=146328
2928         <rdar://problem/21142862>
2929
2930         Reviewed by Tim Horton.
2931
2932         We were getting into a state where the controls were being
2933         hidden via a timer while we were in fullscreen or on
2934         another tab. Meanwhile, we could exit from such
2935         a condition to a point where the controls were
2936         not visible, but not completely removed from the DOM, confusing
2937         the logic that decided whether to show them on tap.
2938
2939         * Modules/mediacontrols/mediaControlsApple.js:
2940         (Controller.prototype.hideControls): If we are in the act of hiding
2941         controls, we can clear any existing timers that are going to try
2942         to hide them again.
2943         (Controller.prototype.resetHideControlsTimer): Make sure we null
2944         out the hideTimer object, since we look at its value often to
2945         decide whether or not a timer exists.
2946         * Modules/mediacontrols/mediaControlsiOS.js:
2947         (ControllerIOS.prototype.handlePlayButtonTouchEnd): If the user
2948         taps play, then we should call showControls, which resets the hide
2949         timers amongst other things. We need to do this due to the next change,
2950         so that a timer started before we pressed play doesn't cause the
2951         controls to instantly disappear as soon as we start playing.
2952         (ControllerIOS.prototype.handleWrapperTouchStart): We can get into
2953         the state where controls are invisible but still in the tree. Since the
2954         controlsAreHidden() logic only looks for the latter, we need to also
2955         look for invisible when the user taps for the controls. Yes, this
2956         naming doesn't make much sense :(
2957
2958 2015-06-25  Joseph Pecoraro  <pecoraro@apple.com>
2959
2960         [Mac] Web Inspector: Window dragging on toolbar should behave more like native window dragging
2961         https://bugs.webkit.org/show_bug.cgi?id=146324
2962
2963         Reviewed by Timothy Hatcher.
2964
2965         * inspector/InspectorFrontendClient.h:
2966         * inspector/InspectorFrontendClientLocal.h:
2967         Do nothing or pass it up to the the frontend client.
2968
2969         * inspector/InspectorFrontendHost.h:
2970         * inspector/InspectorFrontendHost.idl:
2971         * inspector/InspectorFrontendHost.cpp:
2972         (WebCore::InspectorFrontendHost::startWindowDrag):
2973         Add a new host function to get native window dragging behavior.
2974
2975 2015-06-25  Tim Horton  <timothy_horton@apple.com>
2976
2977         Viewport units are wrong when scaled in 2-up mode, cause content to hop around on apple.com/music
2978         https://bugs.webkit.org/show_bug.cgi?id=146322
2979         <rdar://problem/21413884>
2980
2981         Reviewed by Simon Fraser.
2982
2983         * page/FrameView.cpp:
2984         (WebCore::FrameView::viewportSizeForCSSViewportUnits):
2985         Use the fixed layout size, if enabled, instead of the visibleContentRect,
2986         for the viewport unit size. This ensures that viewport units take up the whole
2987         fixed-layout viewport, not just the size of the view scaled by the page scale
2988         (which visibleContentRect provides).
2989
2990 2015-06-25  Eric Carlson  <eric.carlson@apple.com>
2991
2992         [Mac] AirPlay menu button still doesn't always show on page load
2993         https://bugs.webkit.org/show_bug.cgi?id=146325
2994
2995         Reviewed by Dean Jackson.
2996
2997         * html/HTMLMediaElement.cpp:
2998         (WebCore::HTMLMediaElement::mediaState): A player that can't currently play to a wireless 
2999           target does require target monitoring if an availability event listner has been registered,
3000           otherwise we may not register for availability change notifications.
3001
3002 2015-06-25  Anders Carlsson  <andersca@apple.com>
3003
3004         Stop using ScrollbarThemeClient and just use Scrollbar directly
3005         https://bugs.webkit.org/show_bug.cgi?id=146320
3006
3007         Reviewed by Tim Horton.
3008
3009         * page/scrolling/mac/ScrollingStateFrameScrollingNodeMac.mm:
3010         (WebCore::ScrollingStateFrameScrollingNode::setScrollbarPaintersFromScrollbars):
3011         * platform/ScrollableArea.cpp:
3012         (WebCore::ScrollableArea::setScrollbarOverlayStyle):
3013         * platform/Scrollbar.cpp:
3014         (WebCore::Scrollbar::Scrollbar):
3015         (WebCore::Scrollbar::~Scrollbar):
3016         (WebCore::Scrollbar::offsetDidChange):
3017         (WebCore::Scrollbar::updateThumb):
3018         (WebCore::Scrollbar::paint):
3019         (WebCore::thumbUnderMouse):
3020         (WebCore::Scrollbar::autoscrollPressedPart):
3021         (WebCore::Scrollbar::startTimerIfNeeded):
3022         (WebCore::Scrollbar::moveThumb):
3023         (WebCore::Scrollbar::setHoveredPart):
3024         (WebCore::Scrollbar::setPressedPart):
3025         (WebCore::Scrollbar::mouseMoved):
3026         (WebCore::Scrollbar::mouseUp):
3027         (WebCore::Scrollbar::mouseDown):
3028         (WebCore::Scrollbar::setEnabled):
3029         * platform/ScrollbarTheme.h:
3030         (WebCore::ScrollbarTheme::updateEnabledState):
3031         (WebCore::ScrollbarTheme::paint):
3032         (WebCore::ScrollbarTheme::hitTest):
3033         (WebCore::ScrollbarTheme::updateScrollbarOverlayStyle):
3034         (WebCore::ScrollbarTheme::invalidateParts):
3035         (WebCore::ScrollbarTheme::invalidatePart):
3036         (WebCore::ScrollbarTheme::paintTickmarks):
3037         (WebCore::ScrollbarTheme::shouldCenterOnThumb):
3038         (WebCore::ScrollbarTheme::shouldSnapBackToDragOrigin):
3039         (WebCore::ScrollbarTheme::shouldDragDocumentInsteadOfThumb):
3040         (WebCore::ScrollbarTheme::thumbPosition):
3041         (WebCore::ScrollbarTheme::thumbLength):
3042         (WebCore::ScrollbarTheme::trackPosition):
3043         (WebCore::ScrollbarTheme::trackLength):
3044         (WebCore::ScrollbarTheme::registerScrollbar):
3045         (WebCore::ScrollbarTheme::unregisterScrollbar):
3046         * platform/ScrollbarThemeComposite.cpp:
3047         (WebCore::ScrollbarThemeComposite::paint):
3048         (WebCore::ScrollbarThemeComposite::hitTest):
3049         (WebCore::ScrollbarThemeComposite::invalidatePart):
3050         (WebCore::ScrollbarThemeComposite::splitTrack):
3051         (WebCore::usedTotalSize):
3052         (WebCore::ScrollbarThemeComposite::thumbPosition):
3053         (WebCore::ScrollbarThemeComposite::thumbLength):
3054         (WebCore::ScrollbarThemeComposite::minimumThumbLength):
3055         (WebCore::ScrollbarThemeComposite::trackPosition):
3056         (WebCore::ScrollbarThemeComposite::trackLength):
3057         (WebCore::ScrollbarThemeComposite::thumbRect):
3058         * platform/ScrollbarThemeComposite.h:
3059         (WebCore::ScrollbarThemeComposite::willPaintScrollbar):
3060         (WebCore::ScrollbarThemeComposite::didPaintScrollbar):
3061         (WebCore::ScrollbarThemeComposite::paintScrollbarBackground):
3062         (WebCore::ScrollbarThemeComposite::paintTrackBackground):
3063         (WebCore::ScrollbarThemeComposite::paintTrackPiece):
3064         (WebCore::ScrollbarThemeComposite::paintButton):
3065         (WebCore::ScrollbarThemeComposite::paintThumb):
3066         (WebCore::ScrollbarThemeComposite::constrainTrackRectToTrackPieces):
3067         * platform/efl/ScrollbarThemeEfl.h:
3068         * platform/gtk/ScrollbarThemeGtk.cpp:
3069         (WebCore::ScrollbarThemeGtk::hasThumb):
3070         (WebCore::ScrollbarThemeGtk::backButtonRect):
3071         (WebCore::ScrollbarThemeGtk::forwardButtonRect):
3072         (WebCore::ScrollbarThemeGtk::trackRect):
3073         (WebCore::ScrollbarThemeGtk::registerScrollbar):
3074         (WebCore::ScrollbarThemeGtk::unregisterScrollbar):
3075         (WebCore::ScrollbarThemeGtk::updateScrollbarsFrameThickness):
3076         (WebCore::ScrollbarThemeGtk::thumbRect):
3077         (WebCore::ScrollbarThemeGtk::paintTrackBackground):
3078         (WebCore::ScrollbarThemeGtk::paintScrollbarBackground):
3079         (WebCore::ScrollbarThemeGtk::paintThumb):
3080         (WebCore::ScrollbarThemeGtk::paintButton):
3081         (WebCore::ScrollbarThemeGtk::paint):
3082         (WebCore::ScrollbarThemeGtk::shouldCenterOnThumb):
3083         (WebCore::ScrollbarThemeGtk::buttonSize):
3084         (WebCore::ScrollbarThemeGtk::minimumThumbLength):
3085         * platform/gtk/ScrollbarThemeGtk.h:
3086         (WebCore::ScrollbarThemeGtk::hasButtons):
3087         * platform/ios/ScrollbarThemeIOS.h:
3088         * platform/ios/ScrollbarThemeIOS.mm:
3089         (WebCore::ScrollbarThemeIOS::registerScrollbar):
3090         (WebCore::ScrollbarThemeIOS::unregisterScrollbar):
3091         (WebCore::ScrollbarThemeIOS::hasButtons):
3092         (WebCore::ScrollbarThemeIOS::hasThumb):
3093         (WebCore::ScrollbarThemeIOS::backButtonRect):
3094         (WebCore::ScrollbarThemeIOS::forwardButtonRect):
3095         (WebCore::ScrollbarThemeIOS::trackRect):
3096         (WebCore::ScrollbarThemeIOS::minimumThumbLength):
3097         (WebCore::ScrollbarThemeIOS::shouldCenterOnThumb):
3098         (WebCore::ScrollbarThemeIOS::paint):
3099         * platform/mac/ScrollAnimatorMac.mm:
3100         (scrollbarPainterForScrollbar):
3101         (-[WebScrollbarPainterControllerDelegate scrollerImpPair:convertContentPoint:toScrollerImp:]):
3102         (-[WebScrollbarPartAnimation startAnimation]):
3103         (-[WebScrollbarPainterDelegate mouseLocationInScrollerForScrollerImp:]):
3104         (-[WebScrollbarPainterDelegate setUpAlphaAnimation:scrollerPainter:part:animateAlphaTo:duration:]):
3105         (-[WebScrollbarPainterDelegate scrollerImp:animateKnobAlphaTo:duration:]):
3106         (-[WebScrollbarPainterDelegate scrollerImp:animateTrackAlphaTo:duration:]):
3107         (-[WebScrollbarPainterDelegate scrollerImp:animateUIStateTransitionWithDuration:]):
3108         (-[WebScrollbarPainterDelegate scrollerImp:animateExpansionTransitionWithDuration:]):
3109         (WebCore::ScrollAnimatorMac::mouseEnteredScrollbar):
3110         (WebCore::ScrollAnimatorMac::mouseExitedScrollbar):
3111         (WebCore::ScrollAnimatorMac::didAddVerticalScrollbar):
3112         (WebCore::ScrollAnimatorMac::willRemoveVerticalScrollbar):
3113         (WebCore::ScrollAnimatorMac::didAddHorizontalScrollbar):
3114         (WebCore::ScrollAnimatorMac::willRemoveHorizontalScrollbar):
3115         (WebCore::ScrollAnimatorMac::invalidateScrollbarPartLayers):
3116         (WebCore::ScrollAnimatorMac::verticalScrollbarLayerDidChange):
3117         (WebCore::ScrollAnimatorMac::horizontalScrollbarLayerDidChange):
3118         (WebCore::ScrollAnimatorMac::shouldScrollbarParticipateInHitTesting):
3119         (WebCore::ScrollAnimatorMac::updateScrollerStyle):
3120         * platform/mac/ScrollbarThemeMac.h:
3121         * platform/mac/ScrollbarThemeMac.mm:
3122         (WebCore::ScrollbarThemeMac::registerScrollbar):
3123         (WebCore::ScrollbarThemeMac::unregisterScrollbar):
3124         (WebCore::ScrollbarThemeMac::setNewPainterForScrollbar):
3125         (WebCore::ScrollbarThemeMac::painterForScrollbar):
3126         (WebCore::ScrollbarThemeMac::updateScrollbarOverlayStyle):
3127         (WebCore::ScrollbarThemeMac::hasButtons):
3128         (WebCore::ScrollbarThemeMac::hasThumb):
3129         (WebCore::ScrollbarThemeMac::backButtonRect):
3130         (WebCore::ScrollbarThemeMac::forwardButtonRect):
3131         (WebCore::ScrollbarThemeMac::trackRect):
3132         (WebCore::ScrollbarThemeMac::minimumThumbLength):
3133         (WebCore::ScrollbarThemeMac::shouldCenterOnThumb):
3134         (WebCore::ScrollbarThemeMac::shouldDragDocumentInsteadOfThumb):
3135         (WebCore::ScrollbarThemeMac::updateEnabledState):
3136         (WebCore::ScrollbarThemeMac::setPaintCharacteristicsForScrollbar):
3137         (WebCore::ScrollbarThemeMac::paint):
3138         * platform/mock/ScrollbarThemeMock.cpp:
3139         (WebCore::ScrollbarThemeMock::trackRect):
3140         (WebCore::ScrollbarThemeMock::paintTrackBackground):
3141         (WebCore::ScrollbarThemeMock::paintThumb):
3142         * platform/mock/ScrollbarThemeMock.h:
3143         (WebCore::ScrollbarThemeMock::hasButtons): Deleted.
3144         (WebCore::ScrollbarThemeMock::hasThumb): Deleted.
3145         (WebCore::ScrollbarThemeMock::backButtonRect): Deleted.
3146         (WebCore::ScrollbarThemeMock::forwardButtonRect): Deleted.
3147         (WebCore::ScrollbarThemeMock::maxOverlapBetweenPages): Deleted.
3148         (WebCore::ScrollbarThemeMock::isMockTheme): Deleted.
3149         * platform/win/ScrollbarThemeSafari.cpp:
3150         (WebCore::ScrollbarThemeSafari::hasButtons):
3151         (WebCore::ScrollbarThemeSafari::hasThumb):
3152         (WebCore::ScrollbarThemeSafari::backButtonRect):
3153         (WebCore::ScrollbarThemeSafari::forwardButtonRect):
3154         (WebCore::ScrollbarThemeSafari::trackRect):
3155         (WebCore::ScrollbarThemeSafari::minimumThumbLength):
3156         (WebCore::ScrollbarThemeSafari::shouldCenterOnThumb):
3157         (WebCore::ScrollbarThemeSafari::paintTrackBackground):
3158         (WebCore::ScrollbarThemeSafari::paintButton):
3159         (WebCore::ScrollbarThemeSafari::paintThumb):
3160         * platform/win/ScrollbarThemeSafari.h:
3161         * platform/win/ScrollbarThemeWin.cpp:
3162         (WebCore::ScrollbarThemeWin::hasThumb):
3163         (WebCore::ScrollbarThemeWin::backButtonRect):
3164         (WebCore::ScrollbarThemeWin::forwardButtonRect):
3165         (WebCore::ScrollbarThemeWin::trackRect):
3166         (WebCore::ScrollbarThemeWin::shouldCenterOnThumb):
3167         (WebCore::ScrollbarThemeWin::shouldSnapBackToDragOrigin):
3168         (WebCore::ScrollbarThemeWin::paintTrackBackground):
3169         (WebCore::ScrollbarThemeWin::paintTrackPiece):
3170         (WebCore::ScrollbarThemeWin::paintButton):
3171         (WebCore::paintGripper):
3172         (WebCore::ScrollbarThemeWin::paintThumb):
3173         * platform/win/ScrollbarThemeWin.h:
3174         * rendering/RenderScrollbar.h:
3175         (isType):
3176         * rendering/RenderScrollbarPart.cpp:
3177         (WebCore::RenderScrollbarPart::styleDidChange):
3178         (WebCore::RenderScrollbarPart::imageChanged):
3179         * rendering/RenderScrollbarTheme.cpp:
3180         (WebCore::RenderScrollbarTheme::buttonSizesAlongTrackAxis):
3181         (WebCore::RenderScrollbarTheme::hasButtons):
3182         (WebCore::RenderScrollbarTheme::hasThumb):
3183         (WebCore::RenderScrollbarTheme::minimumThumbLength):
3184         (WebCore::RenderScrollbarTheme::backButtonRect):
3185         (WebCore::RenderScrollbarTheme::forwardButtonRect):
3186         (WebCore::RenderScrollbarTheme::trackRect):
3187         (WebCore::RenderScrollbarTheme::constrainTrackRectToTrackPieces):
3188         (WebCore::RenderScrollbarTheme::willPaintScrollbar):
3189         (WebCore::RenderScrollbarTheme::didPaintScrollbar):
3190         (WebCore::RenderScrollbarTheme::paintScrollbarBackground):
3191         (WebCore::RenderScrollbarTheme::paintTrackBackground):
3192         (WebCore::RenderScrollbarTheme::paintTrackPiece):
3193         (WebCore::RenderScrollbarTheme::paintButton):
3194         (WebCore::RenderScrollbarTheme::paintThumb):
3195         (WebCore::RenderScrollbarTheme::paintTickmarks):
3196         * rendering/RenderScrollbarTheme.h:
3197
3198 2015-06-24  Matt Rajca  <mrajca@apple.com>
3199
3200         MediaSession: fall back to "content" kind when an unsupported media session kind is passed in
3201         https://bugs.webkit.org/show_bug.cgi?id=146293
3202
3203         Reviewed by Eric Carlson.
3204
3205         * Modules/mediasession/MediaSession.cpp:
3206         (WebCore::MediaSession::parseKind): Parse the media session kind to one of the four supported types.
3207         (WebCore::MediaSession::MediaSession):
3208         (WebCore::MediaSession::kind): Format the value as a string (which the JS bindings expect).
3209         * Modules/mediasession/MediaSession.h: The media session kind is now stored as an enum rather than a string
3210           since we only support a small, fixed number of values.
3211
3212 2015-06-25  Eric Carlson  <eric.carlson@apple.com>
3213
3214         [Mac] Crash in WebCore::MediaPlayer::canPlayToWirelessPlaybackTarget
3215         https://bugs.webkit.org/show_bug.cgi?id=146317
3216
3217         Reviewed by Brent Fulgham.
3218
3219         * html/HTMLMediaElement.cpp:
3220         (WebCore::HTMLMediaElement::mediaState): NULL-check m_player before using it.
3221
3222 2015-06-25  Commit Queue  <commit-queue@webkit.org>
3223
3224         Unreviewed, rolling out r185956.
3225         https://bugs.webkit.org/show_bug.cgi?id=146321
3226
3227         Causes massive crashes on test bots (Requested by bfulgham on
3228         #webkit).
3229
3230         Reverted changeset:
3231
3232         "Enabling MEDIA_STREAM"
3233         https://bugs.webkit.org/show_bug.cgi?id=145947
3234         http://trac.webkit.org/changeset/185956
3235
3236 2015-06-25  Brent Fulgham  <bfulgham@apple.com>
3237
3238         [Win] Update MediaPlayerPrivateAVFoundationCF::supportsType
3239         https://bugs.webkit.org/show_bug.cgi?id=146302
3240         <rdar://problem/19726553>
3241
3242         Reviewed by Eric Carlson.
3243
3244         Tested by existing media tests.
3245
3246         Update the AVFoundationCF version of 'supportsType' to more closely match the AVFoundation
3247         version. Use this new code when the necessary AVFoundationCF functions are present.
3248
3249         * AVFoundationSupport.py: Check for presence of AVCFURLAssetIsPlayableExtendedMIMEType.
3250         (fileContains): Added helper function.
3251         * WebCore.vcxproj/WebCoreGenerated.vcxproj: Add AVFoundationSupport.py to project file to make
3252         maintenance easier.
3253         * WebCore.vcxproj/WebCoreGenerated.vcxproj.filters: Ditto.
3254         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
3255         (WebCore::MediaPlayerPrivateAVFoundation::isUnsupportedMIMEType): Moved from ObjC version.
3256         (WebCore::MediaPlayerPrivateAVFoundation::staticMIMETypeList): Ditto.
3257         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
3258         * platform/graphics/avfoundation/cf/AVFoundationCFSoftLinking.h: Add missing declaration.
3259         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
3260         (WebCore::avfMIMETypes): Added CF version of AVFoundation code.
3261         (WebCore::MediaPlayerPrivateAVFoundationCF::supportsType): Update to use new AVCF
3262         method if it is available.
3263         (WebCore::MediaPlayerPrivateAVFoundationCF::languageOfPrimaryAudioTrack): Handle case of a
3264         null language locale. This is a drive-by fix of a bug found during testing.
3265         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3266         (WebCore::isUnsupportedMIMEType): Deleted.
3267         (WebCore::staticMIMETypeList): Deleted.
3268
3269 2015-06-25  Matthew Daiter  <mdaiter@apple.com>
3270
3271         Enabling MEDIA_STREAM
3272         https://bugs.webkit.org/show_bug.cgi?id=145947
3273         <rdar://problem/21365829>
3274
3275         Reviewed by Brent Fulgham.
3276
3277         * Configurations/FeatureDefines.xcconfig:
3278         * Modules/mediastream/UserMediaClient.h:
3279         * WebCore.xcodeproj/project.pbxproj:
3280         * platform/mediastream/mac/AVAudioCaptureSource.mm:
3281         * platform/mock/UserMediaClientMock.h:
3282
3283 2015-06-25  Zalan Bujtas  <zalan@apple.com>
3284
3285         Do not send touch events to the slider's thumb when it does not have a renderer.
3286         https://bugs.webkit.org/show_bug.cgi?id=146307
3287         rdar://problem/21539399
3288
3289         Reviewed by Simon Fraser.
3290
3291         Bail out early if either the touch target or the renderer() is null.
3292
3293         Test: fast/events/touch/input-range-with-thumb-display-none-crash.html
3294
3295         * html/shadow/SliderThumbElement.cpp:
3296         (WebCore::findTouchWithIdentifier):
3297         (WebCore::SliderThumbElement::handleTouchStart):
3298         (WebCore::SliderThumbElement::handleTouchMove):
3299         (WebCore::SliderThumbElement::handleTouchEndAndCancel):
3300
3301 2015-06-25  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet  <youenn.fablet@crf.canon.fr>
3302
3303         [Streams API] Implement HighWaterMark
3304         https://bugs.webkit.org/show_bug.cgi?id=146235
3305
3306         Reviewed by Darin Adler.
3307
3308         Retrieval of HighWaterMark parameter from arguments passed to the ReadableStream JS constructor.
3309         Retrieval of size function callback from arguments passed to the ReadableStream JS constructor.
3310         Calling doPull() if buffer size is below HighWaterMark.
3311
3312         Covered by rebased tests.
3313
3314         * Modules/streams/ReadableStream.cpp:
3315         (WebCore::ReadableStream::pull): Adding precise check for HWM.
3316         * Modules/streams/ReadableStream.h: Introducing hasEnoughValues.
3317         * bindings/js/ReadableJSStream.cpp:
3318         (WebCore::getHighWaterMark): Utility routine to get properly HWM value.
3319         (WebCore::ReadableJSStream::create): Retrieval of HWM and size function.
3320         (WebCore::ReadableJSStream::ReadableJSStream):
3321         * bindings/js/ReadableJSStream.h: Adding hasEnoughValues and desiredSize prototypes.
3322
3323 2015-06-25  Tim Horton  <timothy_horton@apple.com>
3324
3325         Try to fix the iOS EWS build.
3326
3327         * platform/spi/cocoa/SecuritySPI.h:
3328
3329 2015-06-25  Carlos Garcia Campos  <cgarcia@igalia.com>
3330
3331         [GTK] Empty gtk-font-name setting causes WebProcess crash rendering pages
3332         https://bugs.webkit.org/show_bug.cgi?id=146246
3333
3334         Reviewed by Sergio Villar Senin.
3335
3336         Return early if system font is empty.
3337
3338         * rendering/RenderThemeGtk.cpp:
3339         (WebCore::RenderThemeGtk::updateCachedSystemFontDescription):
3340
3341 2015-06-24  Chris Dumez  <cdumez@apple.com>
3342
3343         Unreviewed, EFL build fix after r185940.
3344
3345         Members were initialized in wrong order.
3346
3347         * Modules/mediastream/MediaDeviceInfo.cpp:
3348         (WebCore::MediaDeviceInfo::MediaDeviceInfo):
3349
3350 2015-06-24  Chris Dumez  <cdumez@apple.com>
3351
3352         Unreviewed, Build fix after r185940.
3353
3354         Move implementation inside WebCore namespace.
3355
3356         * Modules/mediastream/MediaDeviceInfo.cpp:
3357
3358 2015-06-24  Chris Dumez  <cdumez@apple.com>
3359
3360         Unreviewed, speculative GTK build fix after 185940.
3361
3362         Add new cpp file to CMakeLists.txt.
3363
3364         * CMakeLists.txt:
3365
3366 2015-06-24  Matt Daiter  <mdaiter@apple.com>
3367
3368         Building MediaDeviceInfo for enumerateDevices
3369         https://bugs.webkit.org/show_bug.cgi?id=146257
3370         <rdar://problem/21513462>
3371
3372         Reviewed by Eric Carlson.
3373
3374         MediaDeviceInfo necessary for enumerateDevices
3375
3376         * CMakeLists.txt: Added MediaDevicesInfo.idl
3377         * DerivedSources.make: Added MediaDevicesInfo.idl
3378         * Modules/mediastream/MediaDeviceInfo.h: Created class for MediaDevicesInfo
3379         (WebCore::MediaDeviceInfo::create): Allocates class
3380         (WebCore::MediaDeviceInfo::MediaDeviceInfo): Creates class for public
3381         (WebCore::MediaDeviceInfo::~MediaDeviceInfo): 
3382         (WebCore::MediaDeviceInfo::label):
3383         (WebCore::MediaDeviceInfo::deviceId):
3384         (WebCore::MediaDeviceInfo::groupId):
3385         (WebCore::MediaDeviceInfo::kind):
3386         * Modules/mediastream/MediaDeviceInfo.idl:
3387         * WebCore.xcodeproj/project.pbxproj:
3388
3389 2015-06-24  Anders Carlsson  <andersca@apple.com>
3390
3391         Detect view services by using the "com.apple.UIKit.vends-view-services" entitlement
3392         https://bugs.webkit.org/show_bug.cgi?id=146301
3393
3394         Reviewed by Tim Horton.
3395
3396         * WebCore.xcodeproj/project.pbxproj:
3397         * platform/spi/cocoa/SecuritySPI.h:
3398
3399 2015-06-24  Said Abou-Hallawa  <sabouhallawa@apple.com>
3400
3401         Add a new color -apple-wireless-playback-target-active
3402         https://bugs.webkit.org/show_bug.cgi?id=146269
3403         <rdar://problem/21465189>
3404
3405         Reviewed by Dean Jackson.
3406
3407         At the moment we use -apple-system-blue to indicate an Airplay route is
3408         active. This might not always be blue, so we need to add another system
3409         color with a name that will allow us to change the underlying color.
3410         Initially -apple-wireless-playback-target-active will be an alias to
3411         -apple-system-blue.
3412
3413         Existing tests are modified to include the new color value.
3414
3415         * Modules/mediacontrols/mediaControlsApple.js:
3416         (Controller.prototype.updateWirelessTargetPickerButton):
3417         * Modules/mediacontrols/mediaControlsiOS.css:
3418         (video::-webkit-media-controls-wireless-playback-picker-button.playing):
3419         Use the new color value in the media controls.
3420         
3421         * css/CSSParser.cpp:
3422         (WebCore::isAppleLegacyCssValueKeyword): Returns true if the value keyword
3423         has an '-apple' prefix which has to be replaced by '-webkit'
3424         
3425         (WebCore::cssValueKeywordID): Call a new function which handles all the
3426         '-apple' legacy keywords.
3427         
3428         * css/CSSValueKeywords.in: Define the new color keyword.
3429         
3430         * rendering/RenderThemeIOS.mm:
3431         (WebCore::RenderThemeIOS::systemColor):
3432         * rendering/RenderThemeMac.mm:
3433         (WebCore::RenderThemeMac::systemColor):
3434         Define the value of the new color keyword to be an alias of systemBlueColor.
3435
3436 2015-06-24  Matt Rajca  <mrajca@apple.com>
3437
3438         MediaSession: propagate MediaSessionMetadata to WebPageProxy
3439         https://bugs.webkit.org/show_bug.cgi?id=146282
3440
3441         Reviewed by Darin Adler and Tim Horton.
3442
3443         * Modules/mediasession/MediaSession.cpp:
3444         (WebCore::MediaSession::setMetadata):
3445
3446 2015-06-24  Chris Dumez  <cdumez@apple.com>
3447
3448         Null dereference in DocumentLoader::areAllLoadersPageCacheAcceptable()
3449         https://bugs.webkit.org/show_bug.cgi?id=146286
3450         <rdar://problem/21523788>
3451
3452         Reviewed by Sam Weinig.
3453
3454         Add null check for the Page in areAllLoadersPageCacheAcceptable()
3455         to fix this top crasher until I can investigate how this can happen.
3456
3457         * loader/DocumentLoader.cpp:
3458         (WebCore::areAllLoadersPageCacheAcceptable):
3459
3460 2015-06-24  Anders Carlsson  <andersca@apple.com>
3461
3462         Move PluginMainThreadScheduler to WebKit/win
3463         https://bugs.webkit.org/show_bug.cgi?id=146289
3464
3465         Reviewed by Tim Horton.
3466
3467         * CMakeLists.txt:
3468         * Configurations/WebCore.xcconfig:
3469         * WebCore.vcxproj/WebCore.vcxproj:
3470         * WebCore.vcxproj/WebCore.vcxproj.filters:
3471         * WebCore.xcodeproj/project.pbxproj:
3472         * plugins/PluginMainThreadScheduler.cpp:
3473         (WebCore::PluginMainThreadScheduler::scheduler): Deleted.
3474         (WebCore::PluginMainThreadScheduler::PluginMainThreadScheduler): Deleted.
3475         (WebCore::PluginMainThreadScheduler::scheduleCall): Deleted.
3476         (WebCore::PluginMainThreadScheduler::registerPlugin): Deleted.
3477         (WebCore::PluginMainThreadScheduler::unregisterPlugin): Deleted.
3478         (WebCore::PluginMainThreadScheduler::dispatchCallsForPlugin): Deleted.
3479         (WebCore::PluginMainThreadScheduler::dispatchCalls): Deleted.
3480         (WebCore::PluginMainThreadScheduler::mainThreadCallback): Deleted.
3481         * plugins/PluginMainThreadScheduler.h:
3482         (WebCore::PluginMainThreadScheduler::Call::Call): Deleted.
3483         (WebCore::PluginMainThreadScheduler::Call::performCall): Deleted.
3484
3485 2015-06-24  Dean Jackson  <dino@apple.com>
3486
3487         Better fix for Element with blur backdrop-filter shows edge duplication and dark edges
3488         https://bugs.webkit.org/show_bug.cgi?id=146287
3489         <rdar://problem/21530437>
3490
3491         Reviewed by Simon Fraser.
3492
3493         There is no need to carry around a bit in FilterOperations indicating what
3494         type of source property the object came from. Whether or not to clip to the
3495         bounds of the filter region is purely a property of the type of CALayer
3496         we are applying the filter to.
3497
3498         This basically reverts r185846.
3499
3500         Covered by the test for the previous commit.
3501
3502         * css/CSSPropertyNames.in:
3503         * css/StyleBuilderConverter.h:
3504         (WebCore::StyleBuilderConverter::convertBackdropFilterOperations): Deleted.
3505         * page/animation/CSSPropertyAnimation.cpp:
3506         (WebCore::blendFilterOperations): Deleted.
3507         * platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm: Set the normalized
3508         edges property if we are a CABackdropLayer.
3509         * platform/graphics/filters/FilterOperations.cpp:
3510         (WebCore::FilterOperations::operator==):
3511         (WebCore::FilterOperations::operationsMatch):
3512         (WebCore::FilterOperations::operator=): Deleted.
3513         * platform/graphics/filters/FilterOperations.h:
3514         (WebCore::FilterOperations::isUsedForBackdropFilters): Deleted.
3515         (WebCore::FilterOperations::setUsedForBackdropFilters): Deleted.
3516
3517 2015-06-24  Doug Russell  <d_russell@apple.com>
3518
3519         Bug 146177 - AX: AXObjectCache should try to use an unignored accessibilityObject 
3520         when posting a selection notification when on the border between two accessibilityObjects
3521         https://bugs.webkit.org/show_bug.cgi?id=146177
3522
3523         Reviewed by Darin Adler.
3524
3525         Add support for position to be passed for selection changes to allow checking.
3526         for boundaries in the case of ignored elements.
3527         Add support for searching for unignored siblings of AccessibilityObjects.
3528         Include AccessibilityObject wrappers in notifications for tests.
3529
3530         Test: platform/mac/accessibility/selection-element-tabbing-to-link.html
3531
3532         * accessibility/AXObjectCache.cpp:
3533         (WebCore::AXObjectCache::postTextStateChangeNotification):
3534         * accessibility/AXObjectCache.h:
3535         * accessibility/AccessibilityObject.cpp:
3536         (WebCore::AccessibilityObject::previousSiblingUnignored):
3537         (WebCore::AccessibilityObject::nextSiblingUnignored):
3538         * accessibility/AccessibilityObject.h:
3539         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
3540         (isValueTypeSupported):
3541         (arrayRemovingNonSupportedTypes):
3542         (dictionaryRemovingNonSupportedTypes):
3543         (-[WebAccessibilityObjectWrapperBase accessibilityPostedNotification:userInfo:]):
3544         * editing/mac/FrameSelectionMac.mm:
3545         (WebCore::FrameSelection::notifyAccessibilityForSelectionChange):
3546
3547 2015-06-24  Anders Carlsson  <andersca@apple.com>
3548
3549         Enable -Winconsistent-missing-override when building with Xcode
3550         https://bugs.webkit.org/show_bug.cgi?id=146288
3551
3552         Reviewed by Sam Weinig.
3553
3554         * Configurations/Base.xcconfig:
3555         * Modules/encryptedmedia/MediaKeySession.h:
3556         * Modules/webdatabase/DatabaseTask.h:
3557         * html/DateTimeLocalInputType.h:
3558         * page/scrolling/ios/ScrollingCoordinatorIOS.h:
3559         * page/scrolling/mac/ScrollingCoordinatorMac.h:
3560         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
3561         (WebCore::MediaPlayerPrivateAVFoundation::platformLayer): Deleted.
3562         (WebCore::MediaPlayerPrivateAVFoundation::supportsScanning): Deleted.
3563         (WebCore::MediaPlayerPrivateAVFoundation::fileSize): Deleted.
3564         (WebCore::MediaPlayerPrivateAVFoundation::engineDescription): Deleted.
3565         (WebCore::MediaPlayerPrivateAVFoundation::platformErrorCode): Deleted.
3566         (WebCore::MediaPlayerPrivateAVFoundation::notifyTrackModeChanged): Deleted.
3567         * platform/graphics/avfoundation/VideoTrackPrivateAVF.h:
3568         (WebCore::VideoTrackPrivateAVF::trackIndex): Deleted.
3569         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h:
3570         (WebCore::CDMSessionAVFoundationObjC::type): Deleted.
3571         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h:
3572         (WebCore::CDMSessionMediaSourceAVFObjC::type): Deleted.
3573         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
3574         (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsAcceleratedRendering): Deleted.
3575         (WebCore::MediaPlayerPrivateAVFoundationObjC::canPlayToWirelessPlaybackTarget): Deleted.
3576         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3577         (WebCore::WebCoreNSURLAuthenticationChallengeClient::receivedCredential): Deleted.
3578         (WebCore::WebCoreNSURLAuthenticationChallengeClient::receivedRequestToContinueWithoutCredential): Deleted.
3579         (WebCore::WebCoreNSURLAuthenticationChallengeClient::receivedCancellation): Deleted.
3580         (WebCore::WebCoreNSURLAuthenticationChallengeClient::receivedRequestToPerformDefaultHandling): Deleted.
3581         (WebCore::WebCoreNSURLAuthenticationChallengeClient::receivedChallengeRejection): Deleted.
3582         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
3583         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsFullscreen): Deleted.
3584         * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
3585         (WebCore::MediaPlayerPrivateQTKit::supportsScanning): Deleted.
3586         (WebCore::MediaPlayerPrivateQTKit::networkState): Deleted.
3587         (WebCore::MediaPlayerPrivateQTKit::readyState): Deleted.
3588         (WebCore::MediaPlayerPrivateQTKit::maximumDurationToCacheMediaTime): Deleted.
3589         (WebCore::MediaPlayerPrivateQTKit::engineDescription): Deleted.
3590         * platform/mac/ScrollAnimatorMac.h:
3591         * platform/mac/SerializedPlatformRepresentationMac.h:
3592         (WebCore::SerializedPlatformRepresentationMac::platformType): Deleted.
3593         * platform/mac/ThemeMac.h:
3594         (WebCore::ThemeMac::controlRequiresPreWhiteSpace): Deleted.
3595         * testing/MockCDM.cpp:
3596         (WebCore::MockCDMSession::setClient): Deleted.
3597
3598 2015-06-24  Youenn Fablet  <youenn.fablet@crf.canon.fr>
3599
3600         Improve JSDOMPromise callPromiseFunction naming
3601         https://bugs.webkit.org/show_bug.cgi?id=146280
3602
3603         Unreviewed.
3604
3605         No change in behavior.
3606
3607         * bindings/js/JSDOMPromise.h:
3608         (WebCore::callPromiseFunction):
3609
3610 2015-06-24  Tim Horton  <timothy_horton@apple.com>
3611
3612         REGRESSION (r185804): Crash selecting time in the form on https://backup.brighthorizons.com/BackupCareRequest.aspx
3613         <rdar://problem/21525376>
3614
3615         Reviewed by Sam Weinig.
3616
3617         * page/TextIndicator.cpp:
3618         (WebCore::TextIndicator::createWithRange):
3619         Null check.
3620
3621 2015-06-24  Zalan Bujtas  <zalan@apple.com>
3622
3623         Subpixel rendering: roundToDevicePixel() snaps to wrong value.
3624         https://bugs.webkit.org/show_bug.cgi?id=146273
3625         rdar://problem/18509840
3626
3627         Reviewed by Simon Fraser.
3628
3629         Due to the floating point approximate representation, we can't always produce
3630         the correct snap value. This patch addresses the issue by removing redundant kFixedPointDenominator multiplication
3631         and by changing the rounding in roundToDevicePixel() from float to double.
3632
3633         API test is added.
3634
3635         * platform/LayoutUnit.h:
3636         (WebCore::roundToDevicePixel):
3637
3638 2015-06-23  Matt Rajca  <mrajca@apple.com>
3639
3640         MediaSession: Support setting of metadata
3641         https://bugs.webkit.org/show_bug.cgi?id=146253
3642
3643         Reviewed by Eric Carlson.
3644
3645         * Modules/mediasession/MediaSession.cpp:
3646         (WebCore::MediaSession::MediaSession): Store a reference to the document so we can use it in setMetadata.
3647         (WebCore::MediaSession::setMetadata): Implemented as described in the Media Session spec.
3648         * Modules/mediasession/MediaSession.h:
3649         * Modules/mediasession/MediaSession.idl: Added the setMetadata method.
3650         * Modules/mediasession/MediaSessionMetadata.h:
3651         (WebCore::MediaSessionMetadata::MediaSessionMetadata): Added to keep track of media session metadata.
3652         (WebCore::MediaSessionMetadata::title):
3653         (WebCore::MediaSessionMetadata::artist):
3654         (WebCore::MediaSessionMetadata::album):
3655         (WebCore::MediaSessionMetadata::artworkURL):
3656         * WebCore.xcodeproj/project.pbxproj: Added MediaSessionMetadata.h.
3657
3658 2015-06-24  Daniel Bates  <dabates@apple.com>
3659
3660         Content Security Policy error message when frame load is blocked does not read well
3661         https://bugs.webkit.org/show_bug.cgi?id=146279
3662
3663         Reviewed by Csaba Osztrogonác.
3664
3665         Substitute "Refused to load frame" for "Refused to frame" as the prefix of the error message
3666         emitted when the Content Security Policy of the page blocks a frame load.
3667
3668         * page/ContentSecurityPolicy.cpp:
3669         (WebCore::CSPDirectiveList::checkSourceAndReportViolation):
3670
3671 2015-06-11  Sergio Villar Senin  <svillar@igalia.com>
3672
3673         intrinsic size keywords don't work for heights
3674         https://bugs.webkit.org/show_bug.cgi?id=113610
3675
3676         Reviewed by Darin Adler.
3677
3678         Based on Blink's r148314 & r150355 by <cbiesinger@chromium.org>.
3679
3680         Adds intrinsic values support to heigh & min/max-height. This involves the
3681         following changes:
3682         - RenderBox needs to pass the content height through to computeLogicalHeight and
3683         related functions, which needs it to resolve max-content, et. al.
3684         - Make the callers pass the content height to this function. Some callers pass
3685         logicalHeight() (adjusted for border/padding) which works because if
3686         logicalHeight is not the content height, then it is the height we ended up using,
3687         so the constrain* functions will just constrain to that value again.
3688         - Parsing code needs to be adjusted to support intrinsic values for heights.
3689
3690         Tests: fast/css-intrinsic-dimensions/height-css-tables-collapsed.html
3691                fast/css-intrinsic-dimensions/height-css-tables.html
3692                fast/css-intrinsic-dimensions/height-flexbox.html
3693                fast/css-intrinsic-dimensions/height-positioned-replaced.html
3694                fast/css-intrinsic-dimensions/height-positioned.html
3695                fast/css-intrinsic-dimensions/height-replaced.html
3696                fast/css-intrinsic-dimensions/height-tables-collapsed.html
3697                fast/css-intrinsic-dimensions/height-tables.html
3698                fast/css-intrinsic-dimensions/height.html
3699
3700         * css/CSSParser.cpp:
3701         (WebCore::CSSParser::isValidSize): Refactored from validateWidth and
3702         validateHeight.
3703         (WebCore::CSSParser::parseValue):
3704         (WebCore::CSSParser::validateWidth): Deleted.
3705         (WebCore::CSSParser::validateHeight): Deleted.
3706         * css/CSSParser.h:
3707         * platform/Length.h:
3708         (WebCore::Length::isFillAvailable):
3709         (WebCore::Length::isFitContent):
3710         * rendering/RenderBox.cpp:
3711         (WebCore::RenderBox::constrainLogicalHeightByMinMax):
3712         (WebCore::RenderBox::constrainContentBoxLogicalHeightByMinMax):
3713         (WebCore::RenderBox::computeLogicalHeight):
3714         (WebCore::RenderBox::computeLogicalHeightUsing):
3715         (WebCore::RenderBox::computeContentLogicalHeight):
3716         (WebCore::RenderBox::computeIntrinsicLogicalContentHeightUsing):
3717         (WebCore::RenderBox::computeContentAndScrollbarLogicalHeightUsing):
3718         (WebCore::RenderBox::computePercentageLogicalHeight):
3719         (WebCore::RenderBox::computeReplacedLogicalHeightUsing):
3720         (WebCore::RenderBox::availableLogicalHeight):
3721         (WebCore::RenderBox::availableLogicalHeightUsing):
3722         (WebCore::RenderBox::computePositionedLogicalHeight):
3723         (WebCore::RenderBox::computePositionedLogicalHeightUsing):
3724         * rendering/RenderBox.h:
3725         * rendering/RenderFlexibleBox.cpp:
3726         (WebCore::RenderFlexibleBox::computeMainAxisExtentForChild):
3727         (WebCore::RenderFlexibleBox::applyStretchAlignmentToChild):
3728         * rendering/RenderFlowThread.cpp:
3729         (WebCore::RenderFlowThread::addForcedRegionBreak):
3730         * rendering/RenderGrid.cpp:
3731         (WebCore::RenderGrid::computeUsedBreadthOfSpecifiedLength):
3732         (WebCore::RenderGrid::applyStretchAlignmentToChildIfNeeded):
3733         * rendering/RenderMultiColumnSet.cpp:
3734         (WebCore::RenderMultiColumnSet::calculateMaxColumnHeight):
3735         * rendering/RenderReplaced.cpp:
3736         (WebCore::RenderReplaced::hasReplacedLogicalHeight):
3737         * rendering/RenderTable.cpp:
3738         (WebCore::RenderTable::convertStyleLogicalHeightToComputedHeight):
3739         (WebCore::RenderTable::layout):
3740
3741 2015-06-24  Commit Queue  <commit-queue@webkit.org>
3742
3743         Unreviewed, rolling out r185906.
3744         https://bugs.webkit.org/show_bug.cgi?id=146276
3745
3746         MSVC doesn't yet provide a const-qualified std::array<T,
3747         N>::size(), failing to compile the static_assert (Requested by
3748         zdobersek on #webkit).
3749
3750         Reverted changeset:
3751
3752         "Improve the source code generated by make_names.pl"
3753         https://bugs.webkit.org/show_bug.cgi?id=146208
3754         http://trac.webkit.org/changeset/185906
3755
3756 2015-06-24  Zan Dobersek  <zdobersek@igalia.com>
3757
3758         Improve the source code generated by make_names.pl
3759         https://bugs.webkit.org/show_bug.cgi?id=146208
3760
3761         Reviewed by Darin Adler.
3762
3763         Clean up and optimize the output that's generated by the make_names.pl script
3764         when generating large sets of DOM names for attributes and tags.
3765
3766         The GenerateStrings() function in the StaticString.pm module is split into
3767         GenerateStringData() and GenerateASCIILiteral() so that the two new functions
3768         can be used independently, with the original function still being called when
3769         generating font names.
3770
3771         Tags and attributes have the corresponding static QualifiedName globals defined
3772         as before. After that, two static const std::array<> objects are defined for
3773         both types -- the first is an ordered array of addresses of the QualifiedName
3774         objects (corresponding to the C array that was defined in getHTMLTags(),
3775         getSVGAttrs() etc.), and the second is an ordered array of StringImpl::StaticASCIILiteral
3776         objects that replaces separately defined StringImpl::StaticASCIILiteral objects
3777         and the additional tables that contained pairs of QualifiedName object addresses
3778         and the corresponding StaticASCIILiteral object references in the init() function.
3779         This is all generated by the printStaticData() function in make_names.pl.
3780
3781         The printQualifiedNameCreation() function generates a static_assert() that ensures
3782         that the corresponding std::array<QualifiedName*> and std::array<StaticASCIILiteral>
3783         objects have the same amount of items, and then sets up a loop that walks through
3784         the two arrays and properly constructs the QualifiedName objects from the static
3785         literal data.
3786
3787         On the GTK port, this shaves off ~54kB from the final stripped shared library
3788         on a 64-bit build, and ~21kB on a 32-bit build.
3789
3790         * bindings/scripts/StaticString.pm:
3791         (GenerateStringData):
3792         (GenerateASCIILiteral):
3793         (GenerateStrings):
3794         * dom/make_names.pl:
3795         (printCppHead):
3796         (printNamesCppFile):
3797         (printStaticData):
3798         (printQualifiedNameCreation):
3799         (printInit): Deleted.
3800         (printDefinitions): Deleted.
3801
3802 2015-06-24  Youenn Fablet  <youenn.fablet@crf.canon.fr>
3803
3804         Refactor UserMediaRequest to share more codes between MediaDevices.getUserMedia and legacy webkitGetUserMedia
3805         https://bugs.webkit.org/show_bug.cgi?id=146237
3806
3807         Reviewed by Darin Adler.
3808
3809         Covered by existing tests, no change in behavior.
3810
3811         * Modules/mediastream/MediaConstraintsImpl.cpp:
3812         (WebCore::MediaConstraintsImpl::create): Simplified error handling by removing exception code parameter.
3813         * Modules/mediastream/MediaConstraintsImpl.h: Ditto.
3814         * Modules/mediastream/MediaDevices.cpp:
3815         (WebCore::MediaDevices::getUserMedia): Removed code now in UserMediaRequest::start.
3816         * Modules/mediastream/NavigatorUserMedia.cpp:
3817         (WebCore::NavigatorUserMedia::webkitGetUserMedia): Ditto.
3818         * Modules/mediastream/UserMediaRequest.cpp:
3819         (WebCore::parseOptions): Simplified error handling by removing exception code parameter.
3820         (WebCore::UserMediaRequest::start): Renamed create in start and added common code.
3821         * Modules/mediastream/UserMediaRequest.h:
3822
3823 2015-06-23  Andreas Kling  <akling@apple.com>
3824
3825         Should reduce tile coverage for the first paint after a tab switch.
3826         <https://webkit.org/b/146252>
3827         <rdar://problem/19821583>
3828
3829         Reviewed by Darin Adler.
3830
3831         Reduce the number of tiles we need to paint after switching tabs,
3832         to shorten the time it takes before we can flush pixels to screen.
3833
3834         We accomplish this by piggybacking on the "speculative tiling enabled"
3835         mode of FrameView, which was previously only used to throttle painting
3836         and layer flushes during page load.
3837
3838         When a FrameView becomes visible, which is what happens when you
3839         switch to its tab, we revert the speculative tiling optimization to
3840         its initial state, and reset the "scrolled by user" flag.
3841
3842         In practice this means that after switching tabs, we only generate
3843         enough tiles to fill the viewport. Then, after 500ms has passed
3844         or the user scrolls the page, we go back to the usual speculative
3845         tiling mode.
3846
3847         * page/FrameView.cpp:
3848         (WebCore::FrameView::show):
3849
3850 2015-06-23  Anders Carlsson  <andersca@apple.com>
3851
3852         Remove windowResizerRect code, nobody is using it anymore
3853         https://bugs.webkit.org/show_bug.cgi?id=146265
3854
3855         Reviewed by Beth Dakin.
3856
3857         * loader/EmptyClients.h:
3858         * page/Chrome.cpp:
3859         (WebCore::Chrome::windowResizerRect): Deleted.
3860         * page/Chrome.h:
3861         * page/ChromeClient.h:
3862         * page/FrameView.cpp:
3863         (WebCore::FrameView::windowResizerRect): Deleted.
3864         * page/FrameView.h:
3865         * platform/ScrollView.cpp:
3866         (WebCore::ScrollView::ScrollView): Deleted.
3867         (WebCore::ScrollView::windowResizerRectChanged): Deleted.
3868         (WebCore::ScrollView::containsScrollbarsAvoidingResizer): Deleted.
3869         (WebCore::ScrollView::adjustScrollbarsAvoidingResizerCount): Deleted.
3870         (WebCore::ScrollView::setParent): Deleted.
3871         * platform/ScrollView.h:
3872         (WebCore::ScrollView::windowResizerRect): Deleted.
3873         * platform/Scrollbar.cpp:
3874         (WebCore::Scrollbar::Scrollbar): Deleted.
3875         (WebCore::Scrollbar::setFrameRect): Deleted.
3876         (WebCore::Scrollbar::setParent): Deleted.
3877         * platform/Scrollbar.h:
3878
3879 2015-06-23  Dean Jackson  <dino@apple.com>
3880
3881         Media controls are missing the white backdrop in UIWebViews
3882         https://bugs.webkit.org/show_bug.cgi?id=146251
3883         <rdar://problem/20181345>
3884
3885         Reviewed by Simon Fraser.
3886
3887         Implement two new CALayer subclasses that explicitly set
3888         something that resembles the system appearance for
3889         media-controls-dark-bar-background and media-controls-light-bar-background.
3890         This way, WebKit1 clients get a visible result.
3891
3892         Creating the actual system recipes is tracked by:
3893         https://bugs.webkit.org/show_bug.cgi?id=146250
3894
3895         * WebCore.xcodeproj/project.pbxproj: Add new files.
3896         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
3897         (PlatformCALayerCocoa::PlatformCALayerCocoa): Use the new CALayer subclasses for
3898         the appropriate layer types.
3899         * platform/graphics/ca/cocoa/WebSystemBackdropLayer.h: Added.
3900         * platform/graphics/ca/cocoa/WebSystemBackdropLayer.mm: Added.
3901         (-[WebLightSystemBackdropLayer init]):
3902         (-[WebLightSystemBackdropLayer setBackgroundColor:]): Only set to a light grey.
3903         (-[WebDarkSystemBackdropLayer init]):
3904         (-[WebDarkSystemBackdropLayer setBackgroundColor:]): Only set to a dark grey.
3905
3906 2015-06-18  Matt Rajca  <mrajca@apple.com>
3907
3908         Support releasing media sessions
3909         https://bugs.webkit.org/show_bug.cgi?id=146132
3910
3911         Reviewed by Darin Adler.
3912
3913         * Modules/mediasession/MediaSession.cpp: Implemented as described in the Media Session spec.
3914         (WebCore::MediaSession::releaseSession):
3915         (WebCore::MediaSession::releaseInternal):
3916         * Modules/mediasession/MediaSession.h:
3917
3918 2015-06-23  Chris Fleizach  <cfleizach@apple.com>
3919
3920         AX: iOS: VoiceOver and ARIA: has popup property not announced
3921         https://bugs.webkit.org/show_bug.cgi?id=146188
3922
3923         Reviewed by Darin Adler.
3924
3925         Expose the existing "has popup" property to the iOS Accessibility API.
3926
3927         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
3928         (-[WebAccessibilityObjectWrapper accessibilityHasPopup]):
3929
3930 2015-06-23  Javier Fernandez  <jfernandez@igalia.com>
3931
3932         [CSS Grid Layout] Performance optimization: avoid computing overflow alignment if not needed
3933         https://bugs.webkit.org/show_bug.cgi?id=146231
3934
3935         Reviewed by Sergio Villar Senin.
3936
3937         We don't need to apply any overflow handling if alignment value don't have a potential
3938         risk of data loss, as it's the case of 'start' value.
3939
3940         This patch avoid computing the overflow in all the cases, since it adds an unneeded
3941         overhead which affects performance.
3942
3943         New code improves performance around 3%-8%, depending on the grid tests.
3944
3945         No new tests, no new funcitonality.
3946
3947         * rendering/RenderGrid.cpp:
3948         (WebCore::RenderGrid::rowPositionForChild):
3949         (WebCore::RenderGrid::columnPositionForChild):
3950
3951 2015-06-23  Youenn Fablet  <youenn.fablet@crf.canon.fr>
3952
3953         MediaDevices.getUserMedia should migrate from callbacks to DOMPromise
3954         https://bugs.webkit.org/show_bug.cgi?id=146200
3955
3956         Reviewed by Darin Adler.
3957
3958         Introduced DOMPromiseWithCallback to resolve/reject promises while allowing promise clients to use a typed callback approach.
3959         Migrated MediaDevices.getUserMedia from callbacks to DOMPromiseWithCallback.
3960         Removed MediaDevices.getUserMedia custom binding.
3961
3962         Covered by existing tests.
3963
3964         * CMakeLists.txt: Removing custom binding.
3965         * Modules/mediastream/MediaDevices.cpp:
3966         (WebCore::MediaDevices::getUserMedia): Moving from callback to promise.
3967         * Modules/mediastream/MediaDevices.h: Ditto.
3968         * Modules/mediastream/MediaDevices.idl: Removing custom binding.
3969         * Modules/mediastream/NavigatorUserMedia.cpp:
3970         (WebCore::NavigatorUserMedia::webkitGetUserMedia): Converting from promise callback to API callbacks.
3971         * Modules/mediastream/UserMediaRequest.cpp:
3972         (WebCore::UserMediaRequest::create): Moving from callback to promise.
3973         (WebCore::UserMediaRequest::UserMediaRequest): Ditto.
3974         (WebCore::UserMediaRequest::didCreateStream): Ditto.
3975         (WebCore::UserMediaRequest::failedToCreateStreamWithConstraintsError): Ditto.
3976         (WebCore::UserMediaRequest::failedToCreateStreamWithPermissionError): Ditto.
3977         * Modules/mediastream/UserMediaRequest.h: Ditto.
3978         * bindings/js/JSDOMPromise.h: Introducing DOMPromiseWithCallback and removing crypto specific header.
3979         (WebCore::DOMPromiseWithCallback::DOMPromiseWithCallback):
3980         (WebCore::Error>::resolve):
3981         (WebCore::Error>::reject):
3982         * bindings/js/JSMediaDevicesCustom.cpp: Removed.
3983         * bindings/js/JSSubtleCryptoCustom.cpp: Updating headers.
3984
3985 2015-06-23  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet  <youenn.fablet@crf.canon.fr>
3986
3987         [Streams API] Implement ReadableStream js source "'cancel" callback
3988         https://bugs.webkit.org/show_bug.cgi?id=146204
3989
3990         Reviewed by Darin Adler.
3991
3992         Calling "cancel" JS function when web app is cancelling a JS readable stream.
3993         Handling of promise returned value in case of async cancel.
3994
3995         Covered by rebased tests.
3996
3997         * bindings/js/ReadableJSStream.cpp:
3998         (WebCore::ReadableJSStream::invoke): Refactoring to pass cancel reason or controller to the JS function.
3999         (WebCore::ReadableJSStream::doStart): Ditto.
4000         (WebCore::startReadableStreamAsync): Renaming readableStream as protectedStream.
4001         (WebCore::createPullResultFulfilledFunction): Ditto.
4002         (WebCore::ReadableJSStream::doPull): Refactoring to pass cancel reason or controller to the JS function.
4003         (WebCore::createCancelResultFulfilledFunction): Cancel promise fullfil callback.
4004         (WebCore::createCancelResultRejectedFunction): Cancel promise reject callback.
4005         (WebCore::ReadableJSStream::doCancel): Calling cancel JS callback and handling promise returned value.
4006         * bindings/js/ReadableJSStream.h: Refactoring to pass cancel reason or controller to the JS function.
4007
4008 2015-06-22  Ryuan Choi  <ryuan.choi@navercorp.com>
4009
4010         [EFL] Hyphenation is not supported
4011         https://bugs.webkit.org/show_bug.cgi?id=89830
4012
4013         Reviewed by Gyuyoung Kim.
4014
4015         Share libHyphen backend of GTK port.
4016
4017         Rebased fast/text/hyphenate-*.html
4018
4019         * PlatformEfl.cmake:
4020         * PlatformGTK.cmake:
4021         * platform/efl/FileSystemEfl.cpp:
4022         (WebCore::listDirectory): Deleted because of lack of functionality.
4023         eina_file_ls returns full directory path so fnmatch fails to check dict file.
4024         This patch reuse Posix implementation instead of EFL port specific function.
4025         * platform/posix/FileSystemPOSIX.cpp: Ditto.
4026         * platform/text/gtk/HyphenationLibHyphen.cpp: Moved to platform/text/hyphen
4027         * platform/text/hyphen/HyphenationLibHyphen.cpp:
4028         Renamed from Source/WebCore/platform/text/gtk/HyphenationLibHyphen.cpp.
4029         (WebCore::scanTes