Avoid putting empty-sized surfaces into IOSurfacePool
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2014-07-21  Tim Horton  <timothy_horton@apple.com>
2
3         Avoid putting empty-sized surfaces into IOSurfacePool
4         https://bugs.webkit.org/show_bug.cgi?id=135136
5
6         Reviewed by Simon Fraser.
7
8         * platform/graphics/cg/IOSurfacePool.cpp:
9         (WebCore::IOSurfacePool::addSurface):
10         Avoid adding 0x0 surfaces to the pool, because they will wreak havoc
11         when their size is used as the key in the CachedSurfaceMap.
12         Additionally, avoid any empty sizes, because they're just pointless.
13
14 2014-07-21  Beth Dakin  <bdakin@apple.com>
15
16         WK1 should always setAcceleratedCompositingForFixedPositionEnabled(true) on 
17         Yosemite
18         https://bugs.webkit.org/show_bug.cgi?id=135135
19
20         Reviewed by Darin Adler.
21
22         This patch gets rid of the ChromeClient function that was introduced with 
23         http://trac.webkit.org/changeset/171308 We’ll just enable the Setting instead.
24         * css/StyleResolver.cpp:
25         (WebCore::StyleResolver::adjustRenderStyle):
26         (WebCore::fixedPositionCreatesStackingContext): Deleted.
27         * page/ChromeClient.h:
28         (WebCore::ChromeClient::requiresAcceleratedCompositingForViewportConstrainedPosition): Deleted.
29         * rendering/RenderLayerCompositor.cpp:
30         (WebCore::RenderLayerCompositor::requiresCompositingForPosition):
31
32 2014-07-21  Simon Fraser  <simon.fraser@apple.com>
33
34         [iOS WK2] Turn off position:fixed behavior when the keyboard is up
35         https://bugs.webkit.org/show_bug.cgi?id=132537
36
37         Reviewed by Benjamin Poulain.
38
39         Export RenderObject::localToContainerPoint().
40
41         * WebCore.exp.in:
42
43 2014-07-21  Jer Noble  <jer.noble@apple.com>
44
45         [MSE] YouTube video decode error when variant-switching
46         https://bugs.webkit.org/show_bug.cgi?id=135128
47
48         Reviewed by Brent Fulgham.
49
50         Test: media/media-source/media-source-overlapping-decodetime.html
51
52         When variant-switching, the situation can arise where an existing sample with a presentation
53         timestamp of N and a decode timestamp of M, and a new sample with a presentation timestamp > N
54         and the same decode timestamp of M, will keep the new sample from being added to the SampleMap.
55         This can result in a decode error when samples depending on that new, missing sample are enqueued.
56
57         The MSE spec is silent on the issue of overlapping decode timestamps. However, it guarantees that
58         presentation timestamps are non-overlapping. So instead of using just the decode timestamp as a key
59         for storing the samples in decode order, use both the decode timestamp and the presentation timestamp.
60         That ensures that samples with different presentation times but equal decode times are both inserted
61         into the decode queue, and in the correct order.
62
63         * Modules/mediasource/SampleMap.cpp:
64         (WebCore::SampleIsRandomAccess::operator()): Update the parameter type to match the new KeyType.
65         (WebCore::SampleMap::addSample): Pass both decodeTime and presentationTime as the key to decodeOrder.
66         (WebCore::SampleMap::removeSample): Ditto.
67         (WebCore::DecodeOrderSampleMap::findSampleWithDecodeKey): Renamed from findSampleWithDecodeTime.
68         (WebCore::DecodeOrderSampleMap::reverseFindSampleWithDecodeKey): renamed from reverseFindSampleWithDecodeTime.
69         (WebCore::DecodeOrderSampleMap::findSyncSamplePriorToPresentationTime): Use renamed version of above.
70         (WebCore::DecodeOrderSampleMap::findSyncSampleAfterPresentationTime): Ditto.
71         (WebCore::DecodeOrderSampleMap::findDependentSamples): Ditto.
72         (WebCore::DecodeOrderSampleMap::findSampleWithDecodeTime): Deleted.
73         (WebCore::DecodeOrderSampleMap::reverseFindSampleWithDecodeTime): Deleted.
74         * Modules/mediasource/SampleMap.h:
75         * Modules/mediasource/SourceBuffer.cpp:
76         (WebCore::SourceBuffer::removeCodedFrames): Ditto.
77         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample): Ditto.
78         (WebCore::SourceBuffer::reenqueueMediaForTime): Ditto.
79
80 2014-07-21  Andy Estes  <aestes@apple.com>
81
82         [iOS] Handle QuickLook ResourceLoaders in the web process
83         https://bugs.webkit.org/show_bug.cgi?id=135113
84
85         Reviewed by David Kilzer.
86
87         No new tests. QuickLook is not testable from WebKit.
88
89         * WebCore.exp.in:
90         * loader/ResourceLoadScheduler.cpp:
91         (WebCore::ResourceLoadScheduler::maybeLoadQuickLookResource): Start loading the ResourceLoader if it is for a QuickLook resource.
92         * loader/ResourceLoadScheduler.h:
93
94 2014-07-21  Alexey Proskuryakov  <ap@apple.com>
95
96         Case sensitive file system build fix.
97
98         * page/scrolling/ScrollingStateTree.cpp:
99
100 2014-07-21  Beth Dakin  <bdakin@apple.com>
101
102         Put position:fixed elements into layers when a WK1 view is layer-backed
103         https://bugs.webkit.org/show_bug.cgi?id=135075
104
105         Reviewed by Darin Adler.
106
107         This patch adds a new ChromeClient function called 
108         requiresAcceleratedCompositingForViewportConstrainedPosition(). Since a view can 
109         go in and out of layer backing, we need a ChromeClient method that can be 
110         dynamically re-evaluated rather than using the existing settings for enabling 
111         accelerated fixed and fixed that creates a stacking context.
112
113         Ensure that fixed elements create a stacking context when 
114         requiresAcceleratedCompositingForViewportConstrainedPosition is true.
115         * css/StyleResolver.cpp:
116         (WebCore::StyleResolver::adjustRenderStyle):
117
118         New ChromeClient function.
119         * page/ChromeClient.h:
120
121 2014-07-21  Simon Fraser  <simon.fraser@apple.com>
122
123         Add helper functions to dump the scrolling state tree from the debugger
124         https://bugs.webkit.org/show_bug.cgi?id=135101
125
126         Reviewed by Darin Adler.
127
128         Add debug-only showScrollingStateTree() functions that take a ScrollingStateTree* and ScrollingStateNode*
129         for use while debugging.
130
131         * page/scrolling/ScrollingStateTree.cpp:
132         (showScrollingStateTree):
133         * page/scrolling/ScrollingStateTree.h:
134
135 2014-07-20  Simon Fraser  <simon.fraser@apple.com>
136
137         [iOS WK1] Single touch div scrolling doesn't work in framesets (breaks Word previews)
138         https://bugs.webkit.org/show_bug.cgi?id=135103
139         <rdar://problem/11830219>
140
141         Reviewed by Darin Adler.
142
143         After r166117 all layer flushing starts on the root frame; we no longer flush layers
144         for each frame during painting. However, flushing GraphicsLayers can set some state
145         on a subframe RenderLayerCompositor that is now never processed, which breaks scroll
146         layer registration.
147         
148         Fix by doing a walk of the Frame tree, and calling didFlushLayers() on subframe RenderLayerCompositors
149         before calling didFlushLayers() on self.
150
151         * rendering/RenderLayerCompositor.cpp:
152         (WebCore::RenderLayerCompositor::flushPendingLayerChanges):
153         (WebCore::RenderLayerCompositor::didFlushLayers):
154         (WebCore::RenderLayerCompositor::notifySubframesAfterLayerFlush):
155         (WebCore::RenderLayerCompositor::enclosingCompositorFlushingLayers): Drive-by nullptr.
156         * rendering/RenderLayerCompositor.h:
157
158 2014-07-21  Eric Carlson  <eric.carlson@apple.com>
159
160         [iOS] a Paused media session is not active
161         https://bugs.webkit.org/show_bug.cgi?id=135108
162
163         Reviewed by Darin Adler.
164
165         Activating the shared AudioSession will pause audio playing in another application,
166         so only report a Playing media sessions as active.
167
168         * platform/audio/MediaSessionManager.cpp:
169         * platform/audio/MediaSessionManager.h:
170         (WebCore::MediaSessionManager::activeAudioSessionRequired): Renamed from hasActive to make
171         clear what it does. Only return true for a session that is Playing.
172
173         * platform/audio/mac/MediaSessionManagerMac.cpp:
174         (MediaSessionManager::updateSessionState): hasActive renamed to activeAudioSessionRequired.
175
176 2014-07-21  Carlos Garcia Campos  <cgarcia@igalia.com>
177
178         Unreviewed. Update GObject DOM bindings test results after r171285.
179
180         * bindings/scripts/test/GObject/WebKitDOMTestActiveDOMObject.cpp:
181         * bindings/scripts/test/GObject/WebKitDOMTestCallback.cpp:
182         * bindings/scripts/test/GObject/WebKitDOMTestCustomNamedGetter.cpp:
183         * bindings/scripts/test/GObject/WebKitDOMTestEventConstructor.cpp:
184         * bindings/scripts/test/GObject/WebKitDOMTestEventTarget.cpp:
185         * bindings/scripts/test/GObject/WebKitDOMTestException.cpp:
186         * bindings/scripts/test/GObject/WebKitDOMTestGenerateIsReachable.cpp:
187         * bindings/scripts/test/GObject/WebKitDOMTestInterface.cpp:
188         * bindings/scripts/test/GObject/WebKitDOMTestMediaQueryListListener.cpp:
189         * bindings/scripts/test/GObject/WebKitDOMTestNamedConstructor.cpp:
190         * bindings/scripts/test/GObject/WebKitDOMTestNode.cpp:
191         * bindings/scripts/test/GObject/WebKitDOMTestNondeterministic.cpp:
192         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
193         * bindings/scripts/test/GObject/WebKitDOMTestOverloadedConstructors.cpp:
194         * bindings/scripts/test/GObject/WebKitDOMTestSerializedScriptValueInterface.cpp:
195         * bindings/scripts/test/GObject/WebKitDOMTestTypedefs.cpp:
196         * bindings/scripts/test/GObject/WebKitDOMattribute.cpp:
197         * bindings/scripts/test/GObject/WebKitDOMreadonly.cpp:
198
199 2014-07-20  Pratik Solanki  <psolanki@apple.com>
200
201         Reduce the chances of a race condition when sharing SharedBuffer
202         https://bugs.webkit.org/show_bug.cgi?id=135060
203         <rdar://problem/17729444>
204
205         Reviewed by Darin Adler.
206
207         We currently pass a SharedBuffer wrapped in WebCoreSharedBufferData to ImageIO for image
208         decoding. This is not thread safe since ImageIO will access this buffer on a separate
209         thread. We access SharedBuffer::buffer() on the other thread which resizes the Vector
210         m_buffer if m_size is greater than the vector size. Since the code in SharedBuffer::append()
211         sets m_size before appending the data to the buffer, m_size is out of sync with the m_buffer
212         size for the entire duration of the Vector append which could be doing a lot of copying if
213         the resource is large. While this change does not fix the race condition, we can at least
214         reduce the chances of SharedBuffer::buffer() calling resize() by setting m_size after the
215         cector has finished appending.
216
217         No new tests because no functional changes.
218
219         * platform/SharedBuffer.cpp:
220         (WebCore::SharedBuffer::append):
221
222 2014-07-20  Jeremy Jones  <jeremyj@apple.com>
223
224         Fix test crashes when cloning video layer since r171286
225         https://bugs.webkit.org/show_bug.cgi?id=135112
226
227         Unreviewed. Fix crashing tests by conditionalizing inline video layer change.
228         compositing/video/video-reflection.html [ Crash ]
229         media/video-layer-crash.html [ Crash ]
230
231         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h: add conditional
232         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: ditto
233         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer): ditto
234         (WebCore::MediaPlayerPrivateAVFoundationObjC::destroyVideoLayer): ditto
235         (WebCore::MediaPlayerPrivateAVFoundationObjC::platformLayer): ditto
236
237 2014-07-20  Jeremy Jones  <jeremyj@apple.com>
238
239         Disable ff/rw based on canPlayFastForward and canPlayFastRewind.
240         https://bugs.webkit.org/show_bug.cgi?id=134894
241
242         Reviewed by Darin Adler.
243
244         * WebCore.exp.in: add symbol for canPlayFastReverse
245         * html/HTMLMediaElement.cpp: Add two new accessors
246         (WebCore::HTMLMediaElement::nextScanRate): possibly limit scanRate
247         (WebCore::HTMLMediaElement::canPlayFastForward): added
248         (WebCore::HTMLMediaElement::canPlayFastReverse): added
249         * html/HTMLMediaElement.h: declare two new methods
250         * platform/graphics/MediaPlayer.cpp: Plumb through two new accessors
251         (WebCore::MediaPlayer::maxFastForwardRate): added
252         (WebCore::MediaPlayer::minFastReverseRate): added
253         * platform/graphics/MediaPlayer.h: Declare new methods
254         * platform/graphics/MediaPlayerPrivate.h: Added two new methods.
255         (WebCore::MediaPlayerPrivateInterface::maxFastForwardRate): added
256         (WebCore::MediaPlayerPrivateInterface::minFastReverseRate): added
257         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h: member to cache ff/rw enabled state
258         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
259         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer): observe on item canPlayFastForward canPlayFastReverse
260         (WebCore::MediaPlayerPrivateAVFoundationObjC::canPlayFastForwardDidChange): added
261         (WebCore::MediaPlayerPrivateAVFoundationObjC::canPlayFastReverseDidChange): added
262         (WebCore::itemKVOProperties): observe canPlayFastForward canPlayFastRewind
263         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]): ditto
264         * platform/ios/WebVideoFullscreenInterface.h: add new method
265         * platform/ios/WebVideoFullscreenInterfaceAVKit.h: ditto
266         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm: ditto
267         (WebVideoFullscreenInterfaceAVKit::setCanPlayFastReverse): Set value on WebAVPlayerController.
268         (-[WebAVPlayerController canScanBackward]): Deleted.
269         (+[WebAVPlayerController keyPathsForValuesAffectingCanScanBackward]): Deleted.
270         * platform/ios/WebVideoFullscreenModelMediaElement.mm:
271         (WebVideoFullscreenModelMediaElement::updateForEventName): update canPlayFastReverse.
272
273 2014-07-18  Gavin Barraclough  <baraclough@apple.com>
274
275         HTMLMediaElement should registerWithDocument on iOS
276         https://bugs.webkit.org/show_bug.cgi?id=135084
277         <rdar://problem/17702531>
278
279         Reviewed by Andreas Kling.
280
281         Otherwise it won't know when the visibility changes!
282
283         * html/HTMLMediaElement.cpp:
284         (WebCore::HTMLMediaElement::registerWithDocument):
285         (WebCore::HTMLMediaElement::unregisterWithDocument):
286
287 2014-07-20  Jeremy Jones  <jeremyj@apple.com>
288
289         Decrease flicker when enter and exit fullscreen.
290         https://bugs.webkit.org/show_bug.cgi?id=134919
291
292         Reviewed by Simon Fraser.
293
294         Put AVPlayerLayer in a container layer so moving it between inline and fullscreen
295         is as easy as adding and removing it from a containter layer; no need to do a layout.
296
297         Make sure fullscreen layers are transparent before moving moving the AVPlayerLayer
298         between inline and fullscreen so you don't briefly see the empty fullscreen layers.
299
300         * html/HTMLMediaElement.cpp:
301         (WebCore::HTMLMediaElement::platformLayer): remove fullscreen special case.
302         (WebCore::HTMLMediaElement::setVideoFullscreenLayer): no need to recalc style
303         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h: add inline container layer
304         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: 
305         add WebVideoContainerLayer to contain AVPlayerLayer and keep layout correct.
306         (-[WebVideoContainerLayer setBounds:]): forward setbounds to set child frame.
307         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer): create the video container layer
308         (WebCore::MediaPlayerPrivateAVFoundationObjC::destroyVideoLayer): destroy the video container layer
309         (WebCore::MediaPlayerPrivateAVFoundationObjC::platformLayer): use container layer instead of video layer
310         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenLayer): use transactions to prevent unwanted animation.
311         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenFrame): ditto
312         * platform/graphics/ca/mac/PlatformCALayerMac.mm:
313         (PlatformCALayerMac::layerTypeForPlatformLayer): WebVideoContainerLayer is a kind of AVPlayerLayer
314         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
315         (-[WebVideoFullscreenController didCleanupFullscreen]): remove video fullscreen layer first
316         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
317         (WebVideoFullscreenInterfaceAVKit::setupFullscreen): make background transparent during transition.
318            dispatch_async to allow CATransaction to complete before calling didSetupFullscreen()
319
320 2014-07-20  Ryuan Choi  <ryuan.choi@samsung.com>
321
322         Move ExceptionCodeDescription.h into the files that actually need it
323         https://bugs.webkit.org/show_bug.cgi?id=134968
324
325         Reviewed by Darin Adler.
326
327         No new tests because no functional changes.
328
329         * Modules/indexeddb/IDBDatabaseException.cpp:
330         * Modules/webdatabase/SQLException.cpp:
331         * bindings/js/JSDOMBinding.cpp:
332         * bindings/objc/ExceptionHandlers.mm:
333         * bindings/scripts/CodeGeneratorGObject.pm:
334         (Generate):
335         * dom/DOMCoreException.cpp:
336         * dom/EventException.cpp:
337         * dom/ExceptionBase.cpp:
338         * dom/ExceptionCode.h:
339         * dom/RangeException.cpp:
340         * fileapi/FileException.cpp:
341         * inspector/DOMEditor.cpp:
342         * inspector/InspectorDOMAgent.cpp:
343         * svg/SVGException.cpp:
344         * xml/XMLHttpRequestException.cpp:
345         * xml/XPathException.cpp:
346
347 2014-07-20  Dan Bernstein  <mitz@apple.com>
348
349         <rdar://problems/17742611> -[_WKActivatedElementInfo image] is often empty
350         https://bugs.webkit.org/show_bug.cgi?id=135107
351
352         Reviewed by Sam Weinig.
353
354         Test: TestWebKitAPI/Tests/mac/RenderedImageFromDOMNode.mm
355
356         * page/FrameView.cpp:
357         (WebCore::FrameView::paintContents): To work around http://webkit.org/b/135106, replace the
358         paint root with its nearest ancestor that isn’t an inline with culled line boxes, if needed.
359
360 2014-07-20  Darin Adler  <darin@apple.com>
361
362         Crashes seen in wheel event handling
363         https://bugs.webkit.org/show_bug.cgi?id=135102
364
365         Reviewed by Beth Dakin.
366
367         Speculative fix based on guesses about what could be crashing.
368         The crash seems to be calling ref on an event target, and my guess is that this
369         has something to do with latching.
370
371         * page/EventHandler.cpp:
372         (WebCore::EventHandler::platformPrepareForWheelEvents): Updated argument types.
373         (WebCore::EventHandler::handleWheelEvent): Refactored a little and made some local
374         variables use RefPtr instead of raw pointers. Also added some comments.
375
376         * page/EventHandler.h: Changed argument types to RefPtr.
377
378         * page/mac/EventHandlerMac.mm:
379         (WebCore::EventHandler::platformPrepareForWheelEvents): Updated argument types.
380         Also added a FIXME.
381
382 2014-07-20  Simon Fraser  <simon.fraser@apple.com>
383
384         Print layerIDs in GraphicsLayer dumps
385         https://bugs.webkit.org/show_bug.cgi?id=135100
386
387         Reviewed by Darin Adler.
388
389         When calling showGraphicsLayerTree() from the debugger, it's useful to show
390         layerIDs so they can be correlated with remote layer tree transactions. So
391         when dumping with debug info, dump the primary layer ID.
392
393         * platform/graphics/GraphicsLayer.cpp:
394         (WebCore::GraphicsLayer::dumpProperties):
395
396 2014-07-20  Eric Carlson  <eric.carlson@apple.com>
397
398         [iOS] ignore requests to set volume
399         https://bugs.webkit.org/show_bug.cgi?id=135081
400
401         Applied post-review comments from Darin Adler.
402
403         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
404         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVolume): Don't include unreachable
405             code on iOS.
406
407 2014-07-19  Mark Rowe  <mrowe@apple.com>
408
409         <https://webkit.org/b/135085> Ensure that make_names.pl generates the same result when run multiple times.
410
411         Perl 5.18 introduced hash randomization. This results in the iteration order of hashes being different
412         from one run to the next. To ensure identical output we can iterate over the hash keys in sorted order.
413
414         Reviewed by Alexey Proskuryakov.
415
416         * bindings/scripts/StaticString.pm:
417         (GenerateStrings):
418         (GenerateStringAsserts):
419         * dom/make_names.pl:
420
421 2014-07-19  Zan Dobersek  <zdobersek@igalia.com>
422
423         Document::unregisterNodeListforInvalidation() and Document::unregisterCollection() have incorrect assertions
424         https://bugs.webkit.org/show_bug.cgi?id=134869
425
426         Reviewed by Darin Adler.
427
428         Both methods should assert that the relevant HashMap is either empty if invalidation originates
429         from Document::invalidateNodeListAndCollectionCaches() or acutally contains the element that is
430         being invalidated. In the first case the HashMap is empty because its entries were moved out in
431         the Document::invalidateNodeListAndCollectionCaches().
432
433         This was exposed by r170995 (later rolled out in r170999) which introduced move constructor and
434         move assignment operators for HashTable. The assertions in the titular methods won't be passing
435         until r170995 relands.
436
437         * dom/Document.cpp:
438         (WebCore::Document::unregisterNodeListForInvalidation):
439
440 2014-07-18  Eric Carlson  <eric.carlson@apple.com>
441
442         [iOS] ignore requests to set volume
443         https://bugs.webkit.org/show_bug.cgi?id=135081
444
445         Reviewed by Jer Noble.
446
447         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
448         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVolume): Do nothing on iOS.
449
450 2014-07-18  Andy Estes  <aestes@apple.com>
451
452         [iOS] Tapping "Allow Website" on a restricted page does not bring up the keypad
453         https://bugs.webkit.org/show_bug.cgi?id=135072
454         <rdar://problem/17528188>
455
456         Reviewed by David Kilzer.
457
458         No new tests. Content filtering is not testable from WebKit.
459
460         * WebCore.exp.in: Exported necessary ContentFilter symbols.
461         * loader/DocumentLoader.cpp:
462         (WebCore::DocumentLoader::finishedLoading): Called FrameLoaderClient::contentFilterDidBlockLoad().
463         (WebCore::DocumentLoader::responseReceived): Created a new ContentFilter.
464         (WebCore::DocumentLoader::dataReceived): Called FrameLoaderClient::contentFilterDidBlockLoad().
465         (WebCore::DocumentLoader::setContentFilterForBlockedLoad): Deleted.
466         (WebCore::DocumentLoader::handleContentFilterRequest): Deleted.
467         * loader/DocumentLoader.h:
468         * loader/FrameLoaderClient.h:
469         (WebCore::FrameLoaderClient::contentFilterDidBlockLoad):
470         * loader/PolicyChecker.cpp:
471         (WebCore::PolicyChecker::checkNavigationPolicy): Removed the check for unblock navigations, as this is now
472         handled at the WebKit layer.
473         * platform/ContentFilter.h: ContentFilter no longer needs to be RefCounted, so made various changes in order to
474         make it compatible with unique_ptr.
475         * platform/ios/ContentFilterIOS.mm:
476         (WebCore::scheme): Changed from a public member function to a static inline free function.
477         (WebCore::ContentFilter::handleUnblockRequestAndDispatchIfSuccessful): Renamed from requestUnblockAndDispatchIfSuccessful.
478         * platform/mac/ContentFilterMac.mm:
479         (WebCore::ContentFilter::ContentFilter): Added a default constructor for use during message decoding.
480         (WebCore::ContentFilter::addData): Removed calls to ref() and deref(). These were never actually needed since
481         we were dispatching the block synchronously.
482         (WebCore::ContentFilter::finishedAddingData): Ditto.
483         (WebCore::ContentFilter::encode): Encoded m_platformContentFilter to the NSKeyedArchiver if it conforms to NSSecureCoding.
484         (WebCore::ContentFilter::decode): Decoded m_platformContentFilter from the NSKeyedUnarchiver if it conforms to NSSecureCoding.
485         (WebCore::ContentFilter::create): Deleted.
486
487 2014-07-18  Simon Fraser  <simon.fraser@apple.com>
488
489         [iOS WK2] position:fixed in iframes with programmatic scroll could end up in the wrong place
490         https://bugs.webkit.org/show_bug.cgi?id=135078
491         <rdar://problem/17401823>
492
493         Reviewed by Tim Horton.
494         
495         When the UI-side scrolling tree receives a requested scroll position update, it scrolls
496         the node (e.g. a frame) then traverses child nodes to update them, e.g. for fixed position.
497         However, we would always use a viewport rect for the main document (from the scrolling tree),
498         which is not appropriate for subframes. Subframes should just use their own visible
499         rect to position fixed children.
500
501         Test: platform/mac-wk2/tiled-drawing/scrolling/frames/fixed-inside-frame.html
502
503         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm:
504         (WebCore::ScrollingTreeFrameScrollingNodeIOS::updateChildNodesAfterScroll):
505
506 2014-07-18  Beth Dakin  <bdakin@apple.com>
507
508         Fixed position elements are misplaced when a WK1 view has contentInsets set
509         https://bugs.webkit.org/show_bug.cgi?id=135031
510         -and corresponding-
511         <rdar://problem/17682335>
512
513         Reviewed by Tim Horton.
514
515         [NSScrollView documentVisibleRect] includes content that is within the inset-area 
516         of a view, but WebCore is interested in the content that is fully visible, so we 
517         need to factor the inset sizes out of this rect.
518
519         Implement contract() to avoid the awkwardness of calling expand() with negative 
520         values.
521         * platform/graphics/IntSize.h:
522         (WebCore::IntSize::contract):
523
524         Factor out insets
525         * platform/mac/ScrollViewMac.mm:
526         (WebCore::ScrollView::platformVisibleContentRect):
527         (WebCore::ScrollView::platformVisibleContentSize):
528
529 2014-07-18  Tim Horton  <timothy_horton@apple.com>
530
531         Take navigation snapshots whenever the current back-forward item is going to change
532         https://bugs.webkit.org/show_bug.cgi?id=135058
533         <rdar://problem/17464515>
534
535         Reviewed by Dan Bernstein.
536
537         * loader/HistoryController.cpp:
538         (WebCore::HistoryController::updateForCommit):
539         (WebCore::HistoryController::recursiveUpdateForCommit):
540         (WebCore::HistoryController::recursiveUpdateForSameDocumentNavigation):
541         (WebCore::HistoryController::createItem):
542         Use setCurrentItem instead of duplicating the contents of it inside each of these functions.
543
544         (WebCore::HistoryController::setCurrentItem):
545         (WebCore::HistoryController::replaceCurrentItem):
546         When setting or replacing the current item, let the FrameLoaderClient know that we're going
547         to change which history item is "current".
548
549         * loader/FrameLoaderClient.h:
550         (WebCore::FrameLoaderClient::willChangeCurrentHistoryItem): Added.
551
552 2014-07-18  Commit Queue  <commit-queue@webkit.org>
553
554         Unreviewed, rolling out r171207.
555         https://bugs.webkit.org/show_bug.cgi?id=135056
556
557         Broke multiple tests on Yosemite (Requested by ap on #webkit).
558
559         Reverted changeset:
560
561         "Fixed position elements are misplaced when a WK1 view has
562         contentInsets set"
563         https://bugs.webkit.org/show_bug.cgi?id=135031
564         http://trac.webkit.org/changeset/171207
565
566 2014-07-18  Commit Queue  <commit-queue@webkit.org>
567
568         Unreviewed, rolling out r171218.
569         https://bugs.webkit.org/show_bug.cgi?id=135055
570
571         Made fast/dom/HTMLObjectElement/beforeload-set-text-
572         crash.xhtml crash (Requested by ap on #webkit).
573
574         Reverted changeset:
575
576         "REGRESSION (r169105): Crash in selection"
577         https://bugs.webkit.org/show_bug.cgi?id=134303
578         http://trac.webkit.org/changeset/171218
579
580 2014-07-18  Radu Stavila  <stavila@adobe.com>
581
582         REGRESSION (r169105): Crash in selection
583         https://bugs.webkit.org/show_bug.cgi?id=134303
584
585         Reviewed by Ryosuke Niwa.
586
587         When splitting the selection between different subtrees, all subtrees must have their selection cleared before
588         starting to apply the new selection. Otherwise, when selecting objects in a named flow thread and going up
589         its containing block chain, we can end up in the view's selection root, which has not yet been updated and so
590         we get inconsistent data.
591
592         To achieve this goal, the selection update was split into a "clear" and an "apply" method. The updateSelectionForSubtrees
593         method first iterates through all subtrees and performs the "clear" method and then starts all over again
594         and performs the "apply" method.
595
596         Also, the selectionStart/End members in RenderView have been renamed to fix problems caused by the fact that
597         RenderView inherits SelectionSubtreeRoot, which also has the same selectionStart/End members.
598
599         Test: fast/regions/selection/crash-deselect.html
600
601         * WebCore.xcodeproj/project.pbxproj:
602         * rendering/RenderBlock.cpp:
603         (WebCore::RenderBlock::isSelectionRoot):
604         * rendering/RenderSelectionInfo.h:
605         * rendering/RenderView.cpp:
606         (WebCore::RenderView::RenderView):
607         (WebCore::RenderView::setSelection): Renamed m_selectionStart/End to m_unsplitSelectionStart/End
608         (WebCore::RenderView::splitSelectionBetweenSubtrees):
609         (WebCore::RenderView::updateSelectionForSubtrees): Added, clears and re-applies selection for all selection subtrees.
610         (WebCore::RenderView::clearSubtreeSelection): Added, clears selection and returns previously selected information.
611         (WebCore::RenderView::applySubtreeSelection): Added, updates the selection status of all objects inside the selection tree, compares old and new data and repaints accordingly.
612         (WebCore::RenderView::getSelection): Renamed m_selectionStart/End to m_unsplitSelectionStart/End
613         (WebCore::RenderView::setSubtreeSelection): Deleted.
614         * rendering/RenderView.h:
615         * rendering/SelectionSubtreeRoot.cpp:
616         (WebCore::SelectionSubtreeRoot::SelectionSubtreeRoot):
617         * rendering/SelectionSubtreeRoot.h:
618         (WebCore::SelectionSubtreeRoot::OldSelectionData::OldSelectionData):
619
620 2014-07-17  Jer Noble  <jer.noble@apple.com>
621
622         [MSE] Re-enqueue after a removeCodedFrames() only if the removed frames overlap what may have possibly been enqueued but undisplayed.
623         https://bugs.webkit.org/show_bug.cgi?id=135039
624
625         Reviewed by Eric Carlson.
626
627         When a client calls removeCodedFrames(), we must re-enqueue those ranges if the removed samples overlap with
628         enqueued but possibly un-displayed samples. Otherwise, replacement samples may lead to decode errors as those
629         new samples dependencies are not met. But if we re-enqueue too frequently, this may cause subtle but noticible
630         display timing glitches, so only re-enqueue when removeCodedFrames have a possiblity of removing enqueued, but
631         not yet displayed samples.
632
633         * Modules/mediasource/SourceBuffer.cpp:
634         (WebCore::SourceBuffer::removeCodedFrames):
635
636 2014-07-17  David Kilzer  <ddkilzer@apple.com>
637
638         SECTORDER_FLAGS should be defined in target's xcconfig file, not Base.xcconfig
639         <http://webkit.org/b/135006>
640
641         Reviewed by Darin Adler.
642
643         * Configurations/Base.xcconfig: Move SECTORDER_FLAGS to
644         WebCore.xcconfig.
645         * Configurations/DebugRelease.xcconfig: Remove empty
646         SECTORDER_FLAGS definition.
647         * Configurations/WebCoreTestShim.xcconfig: Ditto.
648         * Configurations/WebCoreTestSupport.xcconfig: Ditto.
649         * Configurations/WebCore.xcconfig: Use $(CONFIGURATION) so
650         SECTORDER_FLAGS is only set on Production builds.
651
652 2014-07-17  Zalan Bujtas  <zalan@apple.com>
653
654         Subpixel rendering: Embedded non-compositing rotate transform paints to wrong position.
655         https://bugs.webkit.org/show_bug.cgi?id=135028
656
657         Reviewed by Simon Fraser.
658
659         CTM always translates to where the layer's renderer() is going to paint.
660         It ensures that the pixel snapped renderer() always end up painting to (0, 0) which is
661         required to be able to position properly on transformed context.
662
663         Test: fast/layers/hidpi-transform-on-child-content-is-mispositioned.html
664
665         * rendering/RenderLayer.cpp:
666         (WebCore::RenderLayer::beginTransparencyLayers):
667         (WebCore::RenderLayer::clipToRect):
668         (WebCore::RenderLayer::paintLayerByApplyingTransform):
669         (WebCore::RenderLayer::paintBackgroundForFragments):
670         (WebCore::RenderLayer::paintForegroundForFragmentsWithPhase):
671         (WebCore::RenderLayer::paintOutlineForFragments):
672         (WebCore::RenderLayer::paintMaskForFragments):
673         (WebCore::RenderLayer::paintOverflowControlsForFragments):
674         (WebCore::RenderLayer::calculateClipRects):
675         * rendering/RenderLayer.h:
676
677 2014-07-17  Beth Dakin  <bdakin@apple.com>
678
679         Fixed position elements are misplaced when a WK1 view has contentInsets set
680         https://bugs.webkit.org/show_bug.cgi?id=135031
681         -and corresponding-
682         <rdar://problem/17682335>
683
684         Reviewed by Tim Horton.
685
686         [NSScrollView documentVisibleRect] is not the rect that we are looking for when 
687         this function is called. WebCore is interested in the rect that does not include 
688         content that is within the inset region.
689
690         Implement contract() to avoid the awkwardness of calling expand() with negative 
691         values.
692         * platform/graphics/IntSize.h:
693         (WebCore::IntSize::contract):
694
695         Use _insetBounds instead of documentVisibleRect, and when it’s necessary to use 
696         the frame’s dimensions, extract the inset from that size.
697         * platform/mac/ScrollViewMac.mm:
698         (WebCore::ScrollView::platformVisibleContentRect):
699         (WebCore::ScrollView::platformVisibleContentSize):
700
701 2014-07-17  Enrica Casucci  <enrica@apple.com>
702
703         [REGRESSION WK2]The menu bar does not show up when tapping on the caret.
704         https://bugs.webkit.org/show_bug.cgi?id=135023
705         <rdar://problem/17617282>
706
707         Reviewed by Benjamin Poulain.
708
709         Adding some exports.
710         
711         * WebCore.exp.in:
712
713 2014-07-17  Timothy Hatcher  <timothy@apple.com>
714
715         Make console.profile record to the Timeline.
716
717         https://bugs.webkit.org/show_bug.cgi?id=134643
718
719         Reviewed by Joseph Pecoraro.
720
721         Passes existing profiler tests in fast/profiler.
722
723         * bindings/js/ScriptState.cpp:
724         (WebCore::domWindowFromExecState):
725         (WebCore::frameFromExecState):
726         (WebCore::scriptExecutionContextFromExecState):
727         (WebCore::mainWorldExecState):
728         (WebCore::execStateFromNode):
729         * bindings/js/ScriptState.h:
730         * inspector/InspectorController.cpp:
731         (WebCore::InspectorController::InspectorController):
732         (WebCore::InspectorController::profilerEnabled):
733         (WebCore::InspectorController::setProfilerEnabled):
734         * inspector/InspectorController.h:
735         * inspector/InspectorInstrumentation.cpp:
736         (WebCore::InspectorInstrumentation::startProfilingImpl):
737         (WebCore::InspectorInstrumentation::stopProfilingImpl):
738         * inspector/InspectorTimelineAgent.cpp:
739         (WebCore::InspectorTimelineAgent::didCreateFrontendAndBackend):
740         (WebCore::InspectorTimelineAgent::willDestroyFrontendAndBackend):
741         (WebCore::InspectorTimelineAgent::start):
742         (WebCore::InspectorTimelineAgent::stop):
743         (WebCore::startProfiling):
744         (WebCore::stopProfiling):
745         (WebCore::InspectorTimelineAgent::startFromConsole):
746         (WebCore::InspectorTimelineAgent::stopFromConsole):
747         (WebCore::InspectorTimelineAgent::didWriteHTML):
748         (WebCore::InspectorTimelineAgent::breakpointActionProbe):
749         (WebCore::toProtocol):
750         (WebCore::InspectorTimelineAgent::addRecordToTimeline):
751         (WebCore::InspectorTimelineAgent::didCompleteRecordEntry):
752         (WebCore::InspectorTimelineAgent::didCompleteCurrentRecord):
753         (WebCore::InspectorTimelineAgent::InspectorTimelineAgent):
754         (WebCore::InspectorTimelineAgent::sendEvent):
755         (WebCore::InspectorTimelineAgent::createRecordEntry):
756         (WebCore::InspectorTimelineAgent::pushCurrentRecord):
757         * inspector/InspectorTimelineAgent.h:
758         (WebCore::InspectorTimelineAgent::TimelineRecordEntry::TimelineRecordEntry):
759         (WebCore::InspectorTimelineAgent::pushCurrentRecord):
760         * inspector/InstrumentingAgents.cpp:
761         (WebCore::InstrumentingAgents::InstrumentingAgents):
762         (WebCore::InstrumentingAgents::reset):
763         * inspector/InstrumentingAgents.h:
764         (WebCore::InstrumentingAgents::persistentInspectorTimelineAgent):
765         (WebCore::InstrumentingAgents::setPersistentInspectorTimelineAgent):
766         * inspector/TimelineRecordFactory.cpp:
767         (WebCore::TimelineRecordFactory::createConsoleProfileData):
768         * inspector/TimelineRecordFactory.h:
769         * inspector/protocol/Timeline.json:
770         * page/PageConsole.cpp:
771         (WebCore::PageConsole::profileEnd):
772
773 2014-07-16  Sam Weinig  <sam@webkit.org>
774
775         Don't send geolocation permission requests when the page is not visible
776         <rdar://problem/17208715>
777         https://bugs.webkit.org/show_bug.cgi?id=134989
778
779         Reviewed by Darin Adler.
780
781         Instead of eagerly requesting geolocation permission for pages that aren't visible,
782         store a set of pending requests, and send them only once the page has become visible.
783
784         * Modules/geolocation/GeolocationController.cpp:
785         (WebCore::GeolocationController::GeolocationController):
786         (WebCore::GeolocationController::~GeolocationController):
787         (WebCore::GeolocationController::requestPermission):
788         (WebCore::GeolocationController::cancelPermissionRequest):
789         (WebCore::GeolocationController::viewStateDidChange):
790         (WebCore::provideGeolocationTo):
791         * Modules/geolocation/GeolocationController.h:
792         Store pending requests to be fired once the page is visible.
793
794         * WebCore.xcodeproj/project.pbxproj:
795         Add ViewStateChangeObserver.h
796
797         * page/Page.cpp:
798         (WebCore::Page::addViewStateChangeObserver):
799         (WebCore::Page::removeViewStateChangeObserver):
800         (WebCore::Page::setViewState):
801         * page/Page.h:
802         Add a set of registered view state observers, and notify them when the
803         view state changes.
804
805         * page/ViewStateChangeObserver.h: Added.
806         (WebCore::ViewStateChangeObserver::~ViewStateChangeObserver):
807         Add an observer that can register with the page for view state changes.
808
809 2014-07-17  Jer Noble  <jer.noble@apple.com>
810
811         Enable legacy fullscreen API in media controls
812         https://bugs.webkit.org/show_bug.cgi?id=134985
813
814         Reviewed by Eric Carlson.
815
816         Allow clients who have not enabled HTML5 Fullscreen APIs to still use fullscreen mode
817         with <video> elements by using the legacy, video-element-specific fullscreen APIs in
818         the <video> media controls.
819
820         * Modules/mediacontrols/mediaControlsApple.js:
821         (Controller):
822         (Controller.prototype.handleReadyStateChange):
823         (Controller.prototype.isFullScreen):
824         (Controller.prototype.handlePlayButtonClicked):
825         (Controller.prototype.updateFullscreenButton):
826         (Controller.prototype.handleFullscreenButtonClicked):
827
828 2014-07-17  Vineet Chaudhary  <code.vineet@gmail.com>
829
830         [GObject] StrictTypeChecking extended attribute fails for methods with sequence<T>.
831         https://bugs.webkit.org/show_bug.cgi?id=121698
832
833         Reviewed by Antonio Gomes.
834
835         GodeGenerator was including wrong heeaders as WebKitDOMlong[] for methods with
836         array parameters and StrictTypeChecking extended attribute.
837         No new tests. TestObj.idl covers the tests.
838
839         * bindings/scripts/CodeGenerator.pm:
840         (GetArrayOrSequenceType):
841         * bindings/scripts/CodeGeneratorGObject.pm:
842         (GenerateFunction):
843         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
844         (webkit_dom_test_obj_strict_function_with_array):
845         * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
846         * bindings/scripts/test/GObject/WebKitDOMTestTypedefs.cpp:
847         (webkit_dom_test_typedefs_func):
848         (webkit_dom_test_typedefs_nullable_array_arg):
849         * bindings/scripts/test/GObject/WebKitDOMTestTypedefs.h:
850         * bindings/scripts/test/TestObj.idl:
851
852 2014-07-17  Yusuke Suzuki  <utatane.tea@gmail.com>
853
854         CSS JIT: Clean up return path
855         https://bugs.webkit.org/show_bug.cgi?id=135011
856
857         Reviewed by Benjamin Poulain.
858
859         Clean up the existing CSS JIT return path before adding new early return path
860         for pseudo elements.
861
862         * cssjit/SelectorCompiler.cpp:
863         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateSelectorChecker):
864         * cssjit/StackAllocator.h:
865         (WebCore::StackAllocator::StackReference::StackReference):
866         (WebCore::StackAllocator::StackReference::isValid):
867         (WebCore::StackAllocator::popAndDiscard): Deleted.
868
869 2014-07-16  Zalan Bujtas  <zalan@apple.com>
870
871         Subpixel rendering: Adjust cliprect with devicePixelFractionFromRenderer() before painting.
872         https://bugs.webkit.org/show_bug.cgi?id=134950
873         <rdar://problem/17617994>
874
875         Reviewed by Simon Fraser.
876
877         The cliprect coming from the graphics layer needs to be adjusted with the subpixel gap
878         from renderer. This is symmetric with the offsetting we do, when the dirty rect is sent off to the GraphicsLayer.
879         It puts us back to the correct coordinating system for intersecting with renderers.
880
881         Test: compositing/hidpi-compositing-layer-with-tile-layers-on-subpixel-position.html
882
883         * rendering/RenderLayer.cpp:
884         (WebCore::RenderLayer::beginTransparencyLayers):
885         (WebCore::RenderLayer::clipToRect):
886
887 2014-07-16  Simon Fraser  <simon.fraser@apple.com>
888
889         Fix a typo noticed by Darin.
890         
891         * rendering/RenderBox.cpp:
892         (WebCore::shouldApplyContainersClipAndOffset):
893         (WebCore::RenderBox::computeRectForRepaint):
894         (WebCore::shouldAppyContainersClipAndOffset): Deleted.
895
896 2014-07-16  Simon Fraser  <simon.fraser@apple.com>
897
898         Improve showTree() logging
899         https://bugs.webkit.org/show_bug.cgi?id=134997
900
901         Reviewed by Tim Horton.
902
903         Have the debug showTree(), which dumps the Node/Element tree, show which nodes need
904         style recalc, and print element renderers.
905
906         * dom/Node.cpp:
907         (WebCore::Node::showNode):
908
909 2014-07-16  Simon Fraser  <simon.fraser@apple.com>
910
911         [iOS] Expose the points on WebEventRegion
912         https://bugs.webkit.org/show_bug.cgi?id=134978
913
914         Reviewed by Tim Horton.
915
916         Expose WebEventRegion's points so that UIKit can get at them.
917
918         * page/ios/WebEventRegion.h:
919         * page/ios/WebEventRegion.mm:
920         (-[WebEventRegion p1]):
921         (-[WebEventRegion p2]):
922         (-[WebEventRegion p3]):
923         (-[WebEventRegion p4]):
924
925 2014-07-16  Brady Eidson  <beidson@apple.com>
926
927         Add WebSecurityOrigin "webSecurityOriginFromDatabaseIdentifier" SPI and change _websiteDataURLForContainerWithURL: SPI
928         <rdar://problem/17454712> and https://bugs.webkit.org/show_bug.cgi?id=134984
929
930         Reviewed by Dan Bernstein.
931
932         Change _websiteDataURLForContainerWithURL: SPI to include an optional bundle identifier argument:
933         * UIProcess/API/Cocoa/WKProcessPool.mm:
934         (+[WKProcessPool _websiteDataURLForContainerWithURL:bundleIdentifierIfNotInContainer:]):
935         (+[WKProcessPool _websiteDataURLForContainerWithURL:]): Deleted.
936         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
937
938         Add a big shiny comment in a few key places:
939         * DatabaseProcess/DatabaseProcess.cpp:
940         (WebKit::DatabaseProcess::initializeDatabaseProcess):
941         * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
942         (WebKit::UniqueIDBDatabase::UniqueIDBDatabase):
943         * UIProcess/WebContext.cpp:
944         (WebKit::WebContext::applyPlatformSpecificConfigurationDefaults):
945         (WebKit::WebContext::ensureDatabaseProcess):
946
947 2014-07-16  Roger Fong  <roger_fong@apple.com>
948
949         Captions container should not clip content.
950         https://bugs.webkit.org/show_bug.cgi?id=134840.
951         <rdar://problem/14553608>.
952
953         Reviewed by Simon Fraser.
954
955         Tests: media/track/track-in-band-subtitles-too-large.html
956                media/track/track-long-word-container-sizing.html
957
958         * Modules/mediacontrols/mediaControlsApple.css:
959         (video::-webkit-media-text-track-container):
960         Set word break property of WebCTT cues to normal to make it consistent with in-band cues.
961         * html/track/TextTrackCueGeneric.cpp:
962         (WebCore::TextTrackCueGenericBoxElement::applyCSSProperties):
963         Set -webkit-min-content on min-width/min-height property of the text track display.
964         * html/track/VTTCue.cpp:
965         (WebCore::VTTCueBox::applyCSSProperties):
966         Do the same for WebVTT cues.
967
968 2014-07-16  Eric Carlson  <eric.carlson@apple.com>
969
970         [Mac] replace AVPlayerItem on the main thread
971         https://bugs.webkit.org/show_bug.cgi?id=134983
972
973         Reviewed by Jer Noble.
974
975         No new tests, this fixes a problem with a thread configuration not present in the
976         test environment.
977
978         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
979         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
980         (WebCore::MediaPlayerPrivateAVFoundationObjC::setAVPlayerItem): New, when called off of 
981             the main thread, dispatch to the main thread before setting AVPlayerItem.
982         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer): Call setAVPlayerItem.
983         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerItem): Ditto.
984         (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldBufferData): Ditto.
985
986 2014-07-16  Jer Noble  <jer.noble@apple.com>
987
988         [MSE] http/tests/media/media-source/mediasource-buffered.html is flakey
989         https://bugs.webkit.org/show_bug.cgi?id=134949
990
991         Reviewed by Eric Carlson.
992
993         Depending on which SourceBuffer is successfully parsed first, the order of activeSourceBuffers
994         may change from run to run, breaking the http/tests/media/media-source/mediasource-buffered.html
995         test. Make the order of activeSourceBuffers the same as (a subset of) sourceBuffers, by replacing
996         calls to activeSourceBuffers->add() and with a new call to regenerateActiveSourceBuffers(), which
997         swaps the contents of the SourceBufferList with a new, ordered Vector.
998
999         * Modules/mediasource/MediaSource.cpp:
1000         (WebCore::MediaSource::addSourceBuffer):
1001         (WebCore::MediaSource::sourceBufferDidChangeAcitveState):
1002         (WebCore::MediaSource::regenerateActiveSourceBuffers):
1003         * Modules/mediasource/MediaSource.h:
1004         * Modules/mediasource/SourceBufferList.cpp:
1005         (WebCore::SourceBufferList::swap):
1006         * Modules/mediasource/SourceBufferList.h:
1007
1008 2014-07-16  Mike West  <mkwst@chromium.org>
1009
1010         CSP: Drop 'script-nonce' directive.
1011         https://bugs.webkit.org/show_bug.cgi?id=134926
1012
1013         Reviewed by Darin Adler.
1014
1015         This patch drops the outdated 'script-nonce' Content Security
1016         Policy directive. It was removed from the spec, and replaced in
1017         CSP2 with a new 'script-src' syntax. We should implement that
1018         instead.
1019
1020         Until then, removing the outdated syntax will ensure that no one
1021         ends up relying on it in WebKit's implementation.
1022
1023         This should have limited web-visible impact, as the feature is
1024         behind the CSP_NEXT flag, which is not enabled by default.
1025
1026         * dom/ScriptElement.cpp:
1027         (WebCore::ScriptElement::requestScript):
1028         (WebCore::ScriptElement::executeScript):
1029         * page/ContentSecurityPolicy.cpp:
1030         (WebCore::CSPDirectiveList::allowJavaScriptURLs):
1031         (WebCore::CSPDirectiveList::allowInlineEventHandlers):
1032         (WebCore::CSPDirectiveList::addDirective):
1033         (WebCore::NonceDirective::NonceDirective): Deleted.
1034         (WebCore::NonceDirective::allows): Deleted.
1035         (WebCore::NonceDirective::parse): Deleted.
1036         (WebCore::CSPDirectiveList::checkNonce): Deleted.
1037         (WebCore::CSPDirectiveList::checkNonceAndReportViolation): Deleted.
1038         (WebCore::CSPDirectiveList::allowScriptNonce): Deleted.
1039         (WebCore::isAllowedByAllWithNonce): Deleted.
1040         (WebCore::ContentSecurityPolicy::allowScriptNonce): Deleted.
1041         (WebCore::ContentSecurityPolicy::reportInvalidNonce): Deleted.
1042         * page/ContentSecurityPolicy.h:
1043
1044 2014-07-16  Jer Noble  <jer.noble@apple.com>
1045
1046         REGRESSION(r171069) 75% repro crash in WebCore::AudioHardwareListenerMac::processIsRunningChanged()
1047         https://bugs.webkit.org/show_bug.cgi?id=134986
1048
1049         Reviewed by Eric Carlson.
1050
1051         Add a WeakPtrFactory to AudioHardwareListenerMac, so that if CoreAudio calls our block after
1052         being unregistered, we can bail early instead of calling into a deleted object.
1053
1054         * platform/audio/mac/AudioHardwareListenerMac.cpp:
1055         (WebCore::AudioHardwareListenerMac::AudioHardwareListenerMac):
1056         * platform/audio/mac/AudioHardwareListenerMac.h:
1057
1058 2014-07-16  Jer Noble  <jer.noble@apple.com>
1059
1060         [MSE] REGRESSION(r171033): ASSERT in WebCore::MediaSource::onReadyStateChange()
1061         https://bugs.webkit.org/show_bug.cgi?id=134941
1062
1063         Reviewed by Eric Carlson.
1064
1065         Only do our modified-order change of the readyState if the error parameter is empty,
1066         as that's the only case where a duration change will cause an inadvertant readyState
1067         change.
1068
1069         * Modules/mediasource/MediaSource.cpp:
1070         (WebCore::MediaSource::streamEndedWithError):
1071
1072 2014-07-16  Alexey Proskuryakov  <ap@apple.com>
1073
1074         Remove svn:executable property erroneously added in <http://trac.webkit.org/changeset/171144> somehow.
1075
1076         * ChangeLog: Removed property svn:executable.
1077         * svg/SVGSVGElement.h: Removed property svn:executable.
1078         * svg/animation/SVGSMILElement.h: Removed property svn:executable.
1079
1080 2014-07-16  Daniel Bates  <dabates@apple.com>
1081
1082         Substitute CGRectZero for NSZeroRect in -[DOMNode hrefFrame].
1083
1084         Rubber-stamped by Zalan Bujtas.
1085
1086         The method -[DOMNode hrefFrame] returns a CGRect. So, when we don't have a renderer
1087         we should return CGRectZero instead of a NSZeroRect.
1088
1089         * bindings/objc/DOM.mm:
1090         (-[DOMNode hrefFrame]): Also, fix up some code style issues.
1091
1092 2014-07-16  Jeongeun Kim  <je_julie.kim@samsung.com>
1093
1094         mutable pointers from const methods, timeContainer().
1095         https://bugs.webkit.org/show_bug.cgi?id=134757
1096
1097         Reviewed by Alexey Proskuryakov.
1098
1099         Avoid return mutable pointers from const methods.
1100         No new tests, no behavior change.
1101
1102         * svg/SVGSVGElement.h:
1103         * svg/animation/SVGSMILElement.h:
1104         (WebCore::SVGSMILElement::timeContainer):
1105
1106 2014-07-15  Yusuke Suzuki  <utatane.tea@gmail.com>
1107
1108         CSS: Generalize CSS First Letter treatment
1109         https://bugs.webkit.org/show_bug.cgi?id=134936
1110
1111         Reviewed by Benjamin Poulain.
1112
1113         first-letter pseudo element rule is handled differently from the other rules
1114         such as first-line. This patch removes this special handling in SelectorChecker
1115         and handles it in RulesFeatureSet.
1116
1117         * css/RuleFeature.cpp:
1118         (WebCore::RuleFeatureSet::collectFeaturesFromSelector):
1119         (WebCore::RuleFeatureSet::add):
1120         (WebCore::RuleFeatureSet::clear):
1121         * css/RuleFeature.h:
1122         (WebCore::RuleFeatureSet::RuleFeatureSet):
1123         * css/SelectorChecker.cpp:
1124         (WebCore::SelectorChecker::matchRecursively):
1125         * css/StyleResolver.h:
1126         (WebCore::StyleResolver::usesFirstLetterRules):
1127         * dom/DocumentStyleSheetCollection.cpp:
1128         (WebCore::DocumentStyleSheetCollection::combineCSSFeatureFlags):
1129         (WebCore::DocumentStyleSheetCollection::resetCSSFeatureFlags):
1130         * dom/DocumentStyleSheetCollection.h:
1131         (WebCore::DocumentStyleSheetCollection::setUsesFirstLetterRules): Deleted.
1132
1133 2014-07-15  Simon Fraser  <simon.fraser@apple.com>
1134
1135         Fix non-iOS builds.
1136
1137         * rendering/RenderBox.cpp:
1138         (WebCore::shouldAppyContainersClipAndOffset):
1139
1140 2014-07-15  Simon Fraser  <simon.fraser@apple.com>
1141
1142         [iOS] Fix touches inside accelerated overflow:scroll
1143         https://bugs.webkit.org/show_bug.cgi?id=134961
1144         <rdar://problem/16088789>
1145
1146         Reviewed by Benjamin Poulain.
1147
1148         When individual elements inside an overflow:scroll with -webkit-overflow-scrolling: touch
1149         had touch event listeners, we would fail to take the scroll offset into account when
1150         building the touch event region, causing touches on those elements to fail after scrolling.
1151         
1152         Touch event region building uses RenderObject::absoluteClippedOverflowRect(), and that
1153         code path tries to fix up repaint rects to work correctly in composited overflow:scroll.
1154         However, that broke the touch region computation.
1155         
1156         Fix by only ignoring the scroll offset for calls to computeRectForRepaint() which
1157         have a non-null repaintContainer (which indicates that we're doing a repaint in the
1158         compositing layer), and for which the repaintContainer is the containing block
1159         which is using composited scrolling. This restores correct behavior to the event region
1160         code which always calls this with a null repaintContainer.
1161
1162         * rendering/RenderBox.cpp:
1163         (WebCore::shouldAppyContainersClipAndOffset):
1164         (WebCore::RenderBox::computeRectForRepaint):
1165
1166 2014-07-15  Simon Fraser  <simon.fraser@apple.com>
1167
1168         [iOS] Fix issues drawing subsampled image elements and CSS images
1169         https://bugs.webkit.org/show_bug.cgi?id=134944
1170         <rdar://problem/17634095>
1171
1172         Reviewed by Dean Jackson.
1173
1174         After r170675 it is important for BitmapImage::draw() to be given a srcRect computed
1175         using the original size of the image, not the subsampled size.
1176         
1177         So fix various code paths that end up in image drawing to use the originalSize(),
1178         which requires giving Image a virtual function that just returns size(), and hence has
1179         a FloatSize return value.
1180         
1181         Tested by setting a very low subsampling threshold and browsing various sites.
1182         
1183         A better longterm fix will happen via bug 134916.
1184
1185         * platform/graphics/BitmapImage.cpp:
1186         (WebCore::BitmapImage::originalSize):
1187         * platform/graphics/BitmapImage.h:
1188         * platform/graphics/GraphicsContext.cpp:
1189         (WebCore::GraphicsContext::drawImage):
1190         * platform/graphics/Image.cpp:
1191         (WebCore::Image::drawTiled):
1192         (WebCore::Image::computeIntrinsicDimensions):
1193         * platform/graphics/Image.h:
1194         (WebCore::Image::originalSize):
1195         * platform/graphics/cg/BitmapImageCG.cpp:
1196         (WebCore::BitmapImage::BitmapImage): Just use m_size for initializing the other members.
1197         (WebCore::BitmapImage::draw):
1198         * platform/graphics/cg/GraphicsContext3DCG.cpp:
1199         (WebCore::GraphicsContext3D::ImageExtractor::extractImage):
1200         * platform/graphics/cg/ImageCG.cpp:
1201         (WebCore::Image::drawPattern):
1202
1203 2014-07-15  Brent Fulgham  <bfulgham@apple.com>
1204
1205         [Win] Unreviewed build fix after r171069.
1206
1207         Add missing AudioHardwareListener implementation on Windows.
1208
1209         * WebCore.vcxproj/WebCore.vcxproj:
1210         * WebCore.vcxproj/WebCore.vcxproj.filters:
1211
1212 2014-07-15  Antti Koivisto  <antti@apple.com>
1213
1214         REGRESSION (r155957): Invalid cast in WebCore::RenderNamedFlowThread::getRanges
1215         https://bugs.webkit.org/show_bug.cgi?id=134888
1216
1217         Reviewed by Mihnea Ovidenie.
1218
1219         Test: fast/regions/flowthread-getranges-box-cast.html
1220
1221         * rendering/RenderNamedFlowThread.cpp:
1222         (WebCore::RenderNamedFlowThread::getRanges): Test the type before casting.
1223
1224 2014-07-15  Carlos Alberto Lopez Perez  <clopez@igalia.com>
1225
1226         [GTK] Update GObject DOM bindings symbols file after r171014.
1227         https://bugs.webkit.org/show_bug.cgi?id=134907
1228
1229         Reviewed by Philippe Normand.
1230
1231         * bindings/gobject/webkitdom.symbols: Update to the current API.
1232
1233 2014-07-15  Manuel Rego Casasnovas  <rego@igalia.com>
1234
1235         Unreviwed fix wrong indentation from r171082.
1236
1237         * rendering/RenderGrid.cpp:
1238         (WebCore::RenderGrid::placeAutoMajorAxisItemOnGrid):
1239
1240 2014-07-14  Zalan Bujtas  <zalan@apple.com>
1241
1242         Subpixel rendering: Zero sized compositing container's content positioned off by one device pixel.
1243         https://bugs.webkit.org/show_bug.cgi?id=134903
1244
1245         Reviewed by Simon Fraser.
1246
1247         The compositing layer boundaries are calculated using its renderer()'s and the renderer()'s
1248         descendants' bounds. However when the renderer() is zero sized, its bounds are omitted.
1249         In such cases, when the child content has offset from the renderer(), the subpixel adjustment
1250         of the compositing layer becomes negative (-meaning that the compositing layer is to the right/bottom
1251         direction from its renderer()). Remove fabs() to be able to express such direction.
1252
1253         Test: compositing/hidpi-compositing-layer-with-zero-sized-container.html
1254
1255         * rendering/RenderLayerBacking.cpp:
1256         (WebCore::RenderLayerBacking::updateGeometry):
1257
1258 2014-07-14  Jeremy Jones  <jeremyj@apple.com>
1259
1260         Fix crash on WebVideoFullscreenManagerProxy construction.
1261         https://bugs.webkit.org/show_bug.cgi?id=134909
1262
1263         Unreviewed fix crash from r171089
1264
1265         Remove unnecessary dispatch to main queue since it can happen during construction.
1266
1267         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
1268         (WebVideoFullscreenInterfaceAVKit::setWebVideoFullscreenModel): remove dispatch_async
1269
1270 2014-07-14  Jeremy Jones  <jeremyj@apple.com>
1271
1272         WebVideoFullscreenInterfaceAVKit should only call the UI from main thread.
1273         https://bugs.webkit.org/show_bug.cgi?id=134890
1274
1275         Reviewed by Eric Carlson.
1276
1277         dispatch_async to the main thread before setting properties that would affect the UI.
1278
1279         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
1280         (WebVideoFullscreenInterfaceAVKit::setWebVideoFullscreenModel): wrap in call to dispatch_async
1281         (WebVideoFullscreenInterfaceAVKit::setDuration): ditto
1282         (WebVideoFullscreenInterfaceAVKit::setCurrentTime): ditto
1283         (WebVideoFullscreenInterfaceAVKit::setRate): ditto
1284         (WebVideoFullscreenInterfaceAVKit::setVideoDimensions): ditto
1285         (WebVideoFullscreenInterfaceAVKit::setSeekableRanges): ditto
1286         (WebVideoFullscreenInterfaceAVKit::setAudioMediaSelectionOptions): ditto
1287         (WebVideoFullscreenInterfaceAVKit::setLegibleMediaSelectionOptions): ditto
1288         (WebVideoFullscreenInterfaceAVKit::setExternalPlayback): ditto
1289
1290 2014-07-14  Tibor Meszaros  <tmeszaros.u-szeged@partner.samsung.com>
1291
1292         Fix the !ENABLE(FILTERS) && !ENABLE(CSS_FILTERS) build after r167497
1293         https://bugs.webkit.org/show_bug.cgi?id=134679
1294
1295         Reviewed by Darin Adler.
1296
1297         * html/ImageData.cpp:
1298         * platform/graphics/cairo/ImageBufferCairo.cpp:
1299
1300 2014-07-14  Manuel Rego Casasnovas  <rego@igalia.com>
1301
1302         [CSS Grid Layout] Support sparse in auto-placement algorithm
1303         https://bugs.webkit.org/show_bug.cgi?id=134544
1304
1305         Reviewed by Sergio Villar Senin.
1306
1307         This patch implements sparse mode for auto-placement algorithm, which is
1308         the default mode in the new grid-auto-flow syntax. It keeps track of the
1309         auto-placement cursor in
1310         RenderGrid::placeAutoMajorAxisItemsOnGrid() and updates it accordingly
1311         when auto-positioned items are placed.
1312         If we're in dense mode it resets the cursor after each item (which keeps
1313         the old behavior that was using dense mode by default).
1314
1315         GridIterator has been adapted to look for empty areas from a given
1316         position in both directions.
1317
1318         Test: fast/css-grid-layout/grid-auto-flow-sparse.html
1319
1320         * rendering/RenderGrid.cpp:
1321         (WebCore::RenderGrid::GridIterator::GridIterator): Modify constructor to
1322         add an optional argument for the varying index. This allows to look for
1323         empty areas in both axis.
1324         (WebCore::RenderGrid::placeAutoMajorAxisItemsOnGrid): Defined the
1325         auto-placement cursor and rested after each item if we're in dense mode.
1326         (WebCore::RenderGrid::placeAutoMajorAxisItemOnGrid): Use auto-placement
1327         cursor to look for empty areas from the last auto-positioned item
1328         placed.
1329         * rendering/RenderGrid.h: Modify placeAutoMajorAxisItemOnGrid() header
1330         to receive the auto-placement cursor.
1331
1332 2014-07-14  Brent Fulgham  <bfulgham@apple.com>
1333
1334         [iOS] Some videos play as inline audio-only content
1335         https://bugs.webkit.org/show_bug.cgi?id=134898.
1336         <rdar://problem/17629379>
1337
1338         Reviewed by Eric Carlson.
1339
1340         Add a new 'presentationType' accessor that indicates if the media
1341         element is playing in 'audio' mode. This can happen if a video
1342         element plays an HLS stream that starts off in audio-only mode.
1343
1344         * html/HTMLMediaElement.cpp:
1345         (WebCore::HTMLMediaElement::presentationType): Added.
1346         * html/HTMLMediaElement.h:
1347         * platform/audio/MediaSession.cpp:
1348         (WebCore::MediaSession::presentationType): Added.
1349         * platform/audio/MediaSession.h:
1350         * platform/audio/MediaSessionManager.cpp: 
1351         (WebCore::MediaSessionManager::sessionRestrictsInlineVideoPlayback):
1352         Use the presentationType, rather than the mediaType to control
1353         inline playback behavior.
1354         * platform/audio/ios/AudioDestinationIOS.h:
1355         (WebCore::AudioDestinationMac::presentationType): Add presentationType.
1356         * platform/audio/mac/AudioDestinationMac.h:
1357         (WebCore::AudioDestinationMac::presentationType): Ditto.
1358
1359 2014-07-14  Bear Travis  <betravis@adobe.com>
1360
1361         [Feature Queries] Enable Feature Queries on Mac
1362         https://bugs.webkit.org/show_bug.cgi?id=134404
1363
1364         Reviewed by Antti Koivisto.
1365
1366         Enable Feature Queries on Mac and resume running the
1367         feature tests.
1368
1369         * Configurations/FeatureDefines.xcconfig: Turn on
1370         ENABLE_CSS3_CONDITIONAL_RULES.
1371
1372 2014-07-11  David Hyatt  <hyatt@apple.com>
1373
1374         <rdar://problem/17305458> Cannot interact with video controls in ePubs
1375         Bug 134836 - [New Multicolumn] Crawl to check for compositing between us and the enclosingPaginationLayer
1376         https://bugs.webkit.org/show_bug.cgi?id=134836
1377
1378         Reviewed by Dean Jackson.
1379
1380         The paginatedAndComposited bit being set in updateLayerPositions just didn't work, since compositing states
1381         can change without triggering that function. This patch just gets rid of the bit and does a crawl every time
1382         to check. This ensures that changes in compositing states don't necessitate any changes in pagination,
1383         since the lookup will always check the current compositing state.
1384         
1385         The new function that does this check is hasCompositedLayerInEnclosingPaginationChain.
1386         
1387         I have been unable to reproduce this issue, and this is therefore a purely speculative fix. I have no test
1388         case to provide because of this.
1389
1390         * rendering/RenderLayer.cpp:
1391         (WebCore::RenderLayer::RenderLayer):
1392         (WebCore::RenderLayer::updateLayerPositions):
1393         (WebCore::RenderLayer::hasCompositedLayerInEnclosingPaginationChain):
1394         (WebCore::RenderLayer::updatePagination):
1395         * rendering/RenderLayer.h:
1396
1397 2014-07-14  Zalan Bujtas  <zalan@apple.com>
1398
1399         Move composite bounds calculation to RenderLayerBacking.
1400         https://bugs.webkit.org/show_bug.cgi?id=134864
1401
1402         Reviewed by Darin Adler.
1403
1404         No change in functionality.
1405
1406         * rendering/RenderLayerBacking.cpp:
1407         (WebCore::RenderLayerBacking::updateCompositedBounds):
1408         * rendering/RenderLayerCompositor.cpp: it was just proxying the calculateLayerBounds()
1409         to the RenderLayer.
1410         (WebCore::RenderLayerCompositor::calculateCompositedBounds): Deleted.
1411         * rendering/RenderLayerCompositor.h:
1412
1413 2014-07-14  Tim Horton  <timothy_horton@apple.com>
1414
1415         Fix the build.
1416
1417         * platform/audio/MediaSessionManager.h:
1418
1419 2014-07-14  Eric Carlson  <eric.carlson@apple.com>
1420
1421         [Mac] don't enable low power audio mode on external output devices
1422         https://bugs.webkit.org/show_bug.cgi?id=134877
1423
1424         Reviewed by Sam Weinig.
1425
1426         No new tests, this deals with changes to the audio hardware at runtime.
1427
1428         * WebCore.xcodeproj/project.pbxproj: Remove AudioSessionListener.h.
1429         * WebCore.vcxproj/WebCore.vcxproj: Ditto.
1430
1431         * platform/audio/AudioHardwareListener.cpp:
1432         (WebCore::AudioHardwareListener::AudioHardwareListener): Initialize m_outputDeviceSupportsLowPowerMode
1433             to true on iOS.
1434         * platform/audio/AudioHardwareListener.h:
1435         (WebCore::AudioHardwareListener::outputDeviceSupportsLowPowerMode): New accessor.
1436         (WebCore::AudioHardwareListener::setHardwareActivity): New setter for derived classes.
1437         (WebCore::AudioHardwareListener::setOutputDeviceSupportsLowPowerMode): Ditto.
1438
1439         Remove AudioSessionListener interface, it wasn't being used.
1440         * platform/audio/AudioSession.cpp:
1441         (WebCore::AudioSession::addListener): Deleted.
1442         (WebCore::AudioSession::removeListener): Deleted.
1443         (WebCore::AudioSession::beganAudioInterruption): Deleted.
1444         (WebCore::AudioSession::endedAudioInterruption): Deleted.
1445         * platform/audio/AudioSession.h:
1446         * platform/audio/AudioSessionListener.h: Removed.
1447
1448         * platform/audio/MediaSessionManager.cpp:
1449         (WebCore::MediaSessionManager::addSession): Allocate the AudioHardwareListener if necessary.
1450         (WebCore::MediaSessionManager::removeSession): Free the AudioHardwareListener if necessary.
1451         (WebCore::MediaSessionManager::audioOutputDeviceChanged): AudioHardwareListener client interface
1452             called when the output device changes, call updateSessionState to make sure we are using
1453             the correct buffer size.
1454         * platform/audio/MediaSessionManager.h:
1455
1456         * platform/audio/ios/AudioDestinationIOS.h:
1457         * platform/audio/ios/AudioSessionIOS.mm:
1458         (WebCore::AudioSessionPrivate::AudioSessionPrivate): Drive-by cleanup, remove ObjC helper object
1459             that was used to listen for OS notifications, it is no longer used.
1460         (SOFT_LINK_POINTER): Deleted.
1461         (-[WebAudioSessionHelper initWithCallback:]): Deleted.
1462         (-[WebAudioSessionHelper dealloc]): Deleted.
1463         (-[WebAudioSessionHelper interruption:]): Deleted.
1464
1465         * platform/audio/mac/AudioHardwareListenerMac.cpp:
1466         (WebCore::currentDeviceSupportsLowPowerBufferSize): New, return true only if using build-in 
1467             transport device.
1468         (WebCore::processIsRunningPropertyDescriptor): Return reference to static AudioObjectPropertyAddress
1469             for kAudioHardwarePropertyProcessIsRunning instead of declaring one in every method
1470             that needs one.
1471         (WebCore::outputDevicePropertyDescriptor): Return reference to static AudioObjectPropertyAddress
1472             for kAudioHardwarePropertyDefaultOutputDevice.
1473         (WebCore::AudioHardwareListenerMac::AudioHardwareListenerMac): Restructure and add audio object
1474             listener for default output device.
1475         (WebCore::AudioHardwareListenerMac::~AudioHardwareListenerMac): *Remove* listener audio object
1476             property listener instead of *Adding* a new one. Remove new listener.
1477         (WebCore::AudioHardwareListenerMac::propertyChanged): Enumerate the properties that changed,
1478             call appropriate method.
1479         (WebCore::AudioHardwareListenerMac::processIsRunningChanged): Renamed from setHardwareActive, 
1480             cleanup.
1481         (WebCore::AudioHardwareListenerMac::outputDeviceChanged): New, call client.audioHardwareOutputDeviceChanged.
1482         (WebCore::AudioHardwareListenerMac::setHardwareActive): Deleted, renamed processIsRunningChanged.
1483         * platform/audio/mac/AudioHardwareListenerMac.h:
1484
1485         * platform/audio/mac/MediaSessionManagerMac.cpp:
1486         (MediaSessionManager::updateSessionState): Only set the output buffer size to 4K when hardware
1487             supports it.
1488
1489 2014-07-13  Benjamin Poulain  <benjamin@webkit.org>
1490
1491         Remove SelectorCheckerFastPath from the style resolution algorithm
1492         https://bugs.webkit.org/show_bug.cgi?id=134866
1493
1494         Reviewed by Antti Koivisto.
1495
1496         SelectorCheckerFastPath is now pure overhead because it can almost never match
1497         if the CSS JIT was unable to compile.
1498
1499         * css/ElementRuleCollector.cpp:
1500         (WebCore::ElementRuleCollector::ruleMatches):
1501         The "pre-filter" behind fastCheckableSelector had two parts:
1502         1) Filtering the pseudoID.
1503         2) Filtering on the rule hash.
1504
1505         The first part has been generalized (RuleDatacanMatchPseudoElement())
1506         and moved to collectMatchingRulesForList(). 
1507
1508         (WebCore::ElementRuleCollector::collectMatchingRulesForList):
1509         * css/RuleSet.cpp:
1510         (WebCore::selectorCanMatchPseudoElement):
1511         (WebCore::RuleData::RuleData):
1512         (WebCore::RuleSet::addRegionRule):
1513         (WebCore::RuleSet::addRulesFromSheet):
1514         * css/RuleSet.h:
1515         (WebCore::RuleData::canMatchPseudoElement):
1516         (WebCore::RuleData::hasFastCheckableSelector): Deleted.
1517         * css/StyleResolver.cpp:
1518
1519 2014-07-13  Benjamin Poulain  <benjamin@webkit.org>
1520
1521         Remove an useless check from SelectorChecker
1522         https://bugs.webkit.org/show_bug.cgi?id=134868
1523
1524         Reviewed by Darin Adler.
1525
1526         * css/SelectorChecker.cpp:
1527         (WebCore::SelectorChecker::matchRecursively):
1528         The condition of this if() branch can never be met for the mode "QueryingRules".
1529
1530         The next condition in that if() is "dynamicPseudo != NOPSEUDO", which implies
1531         a pseudo element was matched prior to the current context/simple selector.
1532         This cannot happen with QueryingRules, since we never match pseudo elements for
1533         SelectorQuery.
1534
1535 2014-07-12  Nikos Andronikos  <nikos.andronikos-webkit@cisra.canon.com.au>
1536
1537         Elements with rendering disabled due to dimensions should not contribute to parent bounding box
1538         https://bugs.webkit.org/show_bug.cgi?id=134184
1539
1540         Reviewed by Dirk Schulze.
1541
1542         SVG elements that have rendering disabled should not contribute to any ancestor elements bounding box.
1543         Examples of elements with rendering disabled:
1544         - basic shape with width <= 0 or height <= 0
1545         - path with no path data (d attribute missing or empty)
1546         - polyline or polygon element with no point data (points attribute missing or empty)
1547
1548         To achieve this a method (isRenderingDisabled) was added to RenderSVGShape and it's derived classes.
1549         This is used to determine if an element is included when creating the union of child bounding boxes
1550         in a container element.
1551
1552         Tests: svg/custom/GetBBox-path-nodata.html
1553                svg/custom/GetBBox-polygon-nodata.html
1554                svg/custom/GetBBox-polyline-nodata.html
1555                svg/custom/getBBox-container-hiddenchild.html
1556
1557         * rendering/svg/RenderSVGEllipse.cpp:
1558         (WebCore::RenderSVGEllipse::isRenderingDisabled):
1559         New method added. Checks bounding box to determine if rendering is disabled.
1560         * rendering/svg/RenderSVGEllipse.h:
1561         * rendering/svg/RenderSVGPath.cpp:
1562         (WebCore::RenderSVGPath::isRenderingDisabled):
1563         New method added. Checks bounding box to determine if rendering is disabled.
1564         * rendering/svg/RenderSVGPath.h:
1565         * rendering/svg/RenderSVGRect.cpp:
1566         (WebCore::RenderSVGRect::isRenderingDisabled):
1567         New method added. Checks bounding box to determine if rendering is disabled.
1568         * rendering/svg/RenderSVGRect.h:
1569         * rendering/svg/RenderSVGShape.h:
1570         (WebCore::RenderSVGShape::isRenderingDisabled):
1571         New method added. Always returns false so that derived classes that do not
1572         implement this method retain the existing behaviour.
1573         * rendering/svg/SVGRenderSupport.cpp:
1574         (WebCore::SVGRenderSupport::computeContainerBoundingBoxes):
1575         For each element potentially being included in the unioned bounding box of
1576         a container, check isRenderingDisabled and skip that element if true.
1577
1578         * rendering/svg/RenderSVGEllipse.cpp:
1579         (WebCore::RenderSVGEllipse::isRenderingDisabled):
1580         * rendering/svg/RenderSVGEllipse.h:
1581         * rendering/svg/RenderSVGPath.cpp:
1582         (WebCore::RenderSVGPath::isRenderingDisabled):
1583         * rendering/svg/RenderSVGPath.h:
1584         * rendering/svg/RenderSVGRect.cpp:
1585         (WebCore::RenderSVGRect::isRenderingDisabled):
1586         * rendering/svg/RenderSVGRect.h:
1587         * rendering/svg/RenderSVGShape.h:
1588         * rendering/svg/SVGRenderSupport.cpp:
1589         (WebCore::SVGRenderSupport::computeContainerBoundingBoxes):
1590
1591 2014-07-12  Benjamin Poulain  <benjamin@webkit.org>
1592
1593         Rename selectorListContainsUncommonAttributeSelector() to selectorListContainsAttributeSelector()
1594         https://bugs.webkit.org/show_bug.cgi?id=134862
1595
1596         Reviewed by Sam Weinig.
1597
1598         Unlike containsUncommonAttributeSelector(), selectorListContainsUncommonAttributeSelector() does not
1599         evaluate the attribute for "uncommon" types.
1600
1601         It would be possible to change the function instead to evaluate common attributes based
1602         on the match type and the pseudo class type. Such change would be more risky
1603         and we would get very little benefit from it, I leave that for later if that ever becomes useful.
1604
1605         * css/RuleSet.cpp:
1606         (WebCore::selectorListContainsAttributeSelector):
1607         (WebCore::containsUncommonAttributeSelector):
1608         (WebCore::selectorListContainsUncommonAttributeSelector): Deleted.
1609
1610 2014-07-12  Zan Dobersek  <zdobersek@igalia.com>
1611
1612         Use braced-init-list to create one-item Vector object in insertPerformanceEntry
1613         https://bugs.webkit.org/show_bug.cgi?id=133675
1614
1615         Reviewed by Darin Adler.
1616
1617         * page/PerformanceUserTiming.cpp:
1618         (WebCore::insertPerformanceEntry): Avoid wasting three lines for creating a
1619         Vector object with just one item that in the end gets copied. Use the
1620         braced-init-list syntax instead, leveraging Vector's std::initializer_list
1621         constructor.
1622
1623 2014-07-12  Allan Sandfeld Jensen  <allan.jensen@digia.com>
1624
1625         Memory leaks with autoLoadImages off
1626         https://bugs.webkit.org/show_bug.cgi?id=124411
1627
1628         Reviewed by Darin Adler.
1629
1630         Do not emit notifyFinished for images with deferred load,
1631         and allow deferred loads to be cancelled.
1632
1633         * loader/cache/CachedResource.cpp:
1634         (WebCore::CachedResource::checkNotify):
1635         (WebCore::CachedResource::cancelLoad):
1636
1637 2014-07-11  Jer Noble  <jer.noble@apple.com>
1638
1639         [MSE] http/tests/media/media-source/mediasource-duration.html is failing.
1640         https://bugs.webkit.org/show_bug.cgi?id=134852
1641
1642         Reviewed by Eric Carlson.
1643
1644         Fixes the following tests:
1645         http/tests/media/media-source/mediasource-config-change-mp4-a-bitrate.html
1646         http/tests/media/media-source/mediasource-config-change-mp4-av-audio-bitrate.html
1647         http/tests/media/media-source/mediasource-config-change-mp4-av-video-bitrate.html
1648         http/tests/media/media-source/mediasource-config-change-mp4-v-bitrate.html
1649         http/tests/media/media-source/mediasource-config-change-mp4-v-framerate.html
1650         http/tests/media/media-source/mediasource-duration.html
1651         http/tests/media/media-source/mediasource-play.html
1652
1653         The primary change necessary to fix the mediasource-duration.html test was to add support
1654         for delaying the completion of a seek operation until the HTMLMediaElement's readyState
1655         rises to > HAVE_CURRENT_DATA. This is accomplished by modifying MediaSourcePrivate to have
1656         waitForSeekCompleted() and seekCompleted() virtual methods. These are called by MediaSource
1657         when a seek operation results in the current time moving outside the currently buffered time
1658         ranges, and when an append operation results in the readyState changing, respectively.
1659
1660         A number of other drive-by fixes were necessary to get this test fully passing, as noted
1661         below.
1662
1663         Make the MediaSource the primary owner of the media's duration, rather than the MediaSourcePrivate.
1664         Move the MediaSourcePrivateClient pointer to the MediaSourcePrivate from the MediaPlayerPrivate, so
1665         the MediaSource's duration can be retrieved.  While we're at it, do the same thing for buffered.
1666
1667         * Modules/mediasource/MediaSource.cpp:
1668         (WebCore::MediaSource::MediaSource): Initialize m_duration.
1669         (WebCore::MediaSource::duration): Simple accessor.
1670         (WebCore::MediaSource::setDurationInternal): Bring 'duration change algorithm' up to spec.
1671         (WebCore::MediaSource::setReadyState): Reset m_duration on close.
1672         * Modules/mediasource/MediaSource.h:
1673         * platform/graphics/MediaSourcePrivate.h:
1674         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1675         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::load): Do not call setPrivateAndOpen().
1676         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::durationDouble): Pass through to MediaSourcePrivateAVFObjC.
1677         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::buffered): Ditto.
1678         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h:
1679         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
1680         (WebCore::MediaSourcePrivateAVFObjC::create): Call setPrivateAndOpen().
1681         (WebCore::MediaSourcePrivateAVFObjC::MediaSourcePrivateAVFObjC): Set m_client.
1682         (WebCore::MediaSourcePrivateAVFObjC::duration): Pass through to MediaSourcePrivateClient.
1683         (WebCore::MediaSourcePrivateAVFObjC::buffered): Ditto.
1684         (WebCore::MediaSourcePrivateAVFObjC::durationChanged): Pass through to MediaPlayerPrivateMediaSourceAVFObjC.
1685         (WebCore::MediaSourcePrivateAVFObjC::setDuration): Deleted.
1686         * platform/graphics/gstreamer/MediaSourceGStreamer.cpp:
1687         (WebCore::MediaSourceGStreamer::open): Pass in MediaSourcePrivateClient.
1688         (WebCore::MediaSourceGStreamer::MediaSourceGStreamer): Initialize m_mediaSource.
1689         (WebCore::MediaSourceGStreamer::durationChanged): Retrieve the duration from MediaSourcePrivateClient.
1690         (WebCore::MediaSourceGStreamer::markEndOfStream): Remove unnecssary ASSERT.
1691         (WebCore::MediaSourceGStreamer::unmarkEndOfStream): Ditto.
1692         (WebCore::MediaSourceGStreamer::setDuration): Deleted.
1693         * platform/graphics/gstreamer/MediaSourceGStreamer.h:
1694         * platform/mock/mediasource/MockMediaPlayerMediaSource.cpp:
1695         (WebCore::MockMediaPlayerMediaSource::load): Do not call setPrivateAndOpen().
1696         (WebCore::MockMediaPlayerMediaSource::buffered): Pass through to MockMediaSourcePrivate.
1697         (WebCore::MockMediaPlayerMediaSource::durationDouble): Ditto.
1698         (WebCore::MockMediaPlayerMediaSource::advanceCurrentTime): Ditto.
1699         * platform/mock/mediasource/MockMediaSourcePrivate.cpp:
1700         (WebCore::MockMediaSourcePrivate::create): Call setPrivateAndOpen().
1701         (WebCore::MockMediaSourcePrivate::MockMediaSourcePrivate): Set m_client.
1702         (WebCore::MockMediaSourcePrivate::duration): Pass through to MediaSourcePrivateClient.
1703         (WebCore::MockMediaSourcePrivate::buffered): Ditto.
1704         (WebCore::MockMediaSourcePrivate::durationChanged): Pass thorugh to MockMediaPlayerMediaSource.
1705         (WebCore::MockMediaSourcePrivate::setDuration): Deleted.
1706
1707         Route seekToTime through MediaSource, rather than through MediaSourcePrivate, so that
1708         the time can be compared against the buffered ranges, and trigger the delay of the seek
1709         operation if necessary. Add a seekTimer to MediaPlayerPrivateMediaSourceAVFObjC, as this
1710         guarantees the order of asynchronous operations, rather than callOnMainThread, which can
1711         cause async operations to occur out of order.
1712
1713         * Modules/mediasource/MediaSource.cpp:
1714         (WebCore::MediaSource::seekToTime): Bring up to spec.
1715         (WebCore::MediaSource::completeSeek): Ditto.
1716         (WebCore::MediaSource::monitorSourceBuffers): Call completeSeek() when appropriate.
1717         * Modules/mediasource/SourceBuffer.cpp:
1718         (WebCore::SourceBuffer::sourceBufferPrivateSeekToTime): Deleted.
1719         (WebCore::SourceBuffer::seekToTime): Renamed from sourceBufferPrivateSeekToTime().
1720         * platform/graphics/MediaSourcePrivate.h:
1721         * platform/graphics/MediaSourcePrivateClient.h:
1722         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
1723         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1724         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC): Add seekTimer. Only
1725             call timeChanged() if no longer seeking, thereby triggering a 'seeked' event.
1726         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::~MediaPlayerPrivateMediaSourceAVFObjC): Clear m_seekTimer.
1727         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekWithTolerance): Use m_seekTimer.
1728         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekTimerFired): Call seekInternal.
1729         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekInternal): Add logging.
1730         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::waitForSeekCompleted): Added.
1731         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekCompleted): Added; trigger 'seeked'.
1732         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setReadyState): No longer attempt to finish seek when
1733             readyState changes here; this has been moved up to MediaSource.cpp.
1734         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h:
1735         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
1736         (WebCore::MediaSourcePrivateAVFObjC::waitForSeekCompleted): Pass through to MediaPlayerPrivateMediaSourceAVFObjC.
1737         (WebCore::MediaSourcePrivateAVFObjC::seekCompleted): Ditto.
1738         (WebCore::MediaSourcePrivateAVFObjC::seekToTime): Pass through to MediaSourcePrivateClient.
1739         (WebCore::MediaSourcePrivateAVFObjC::fastSeekTimeForMediaTime): Ditto.
1740         * platform/mock/mediasource/MockMediaPlayerMediaSource.cpp:
1741         (WebCore::MockMediaPlayerMediaSource::MockMediaPlayerMediaSource): Initialize m_seekCompleted.
1742         (WebCore::MockMediaPlayerMediaSource::seeking): Check for an uncompleted seek operation. 
1743         (WebCore::MockMediaPlayerMediaSource::seekWithTolerance): Ditto.
1744         (WebCore::MockMediaPlayerMediaSource::waitForSeekCompleted): Added.
1745         (WebCore::MockMediaPlayerMediaSource::seekCompleted): Added; trigger 'seeked'.
1746         * platform/mock/mediasource/MockMediaPlayerMediaSource.h:
1747         * platform/mock/mediasource/MockMediaSourcePrivate.cpp:
1748         (WebCore::MockMediaSourcePrivate::waitForSeekCompleted): Pass through to MockMediaPlayerMediaSource.
1749         (WebCore::MockMediaSourcePrivate::seekCompleted): Ditto.
1750         * platform/mock/mediasource/MockMediaSourcePrivate.h:
1751
1752         Drive-by fixes.
1753
1754         * Modules/mediasource/MediaSource.cpp:
1755         (WebCore::MediaSource::streamEndedWithError): Re-order the steps in streamEndedWithError()
1756             to avoid the MediaSource being closed and re-opened by the resulting duration change
1757             operation.
1758         * Modules/mediasource/MediaSource.h:
1759         * Modules/mediasource/SourceBuffer.cpp:
1760         (WebCore::SourceBuffer::remove): Added logging.
1761         (WebCore::SourceBuffer::removeCodedFrames): Ditto.
1762         (WebCore::SourceBuffer::hasFutureTime): Swap an ASSERT for an early-return; it's possible
1763             for currentTime() to be outside of a buffered area.
1764         * Modules/mediasource/SourceBuffer.h:
1765         * html/HTMLMediaElement.cpp:
1766         (WebCore::HTMLMediaElement::parseAttribute): Do not issue an additional 'timeupdate' event
1767             after finishSeek() issues one of its own.
1768         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1769         (WebCore::globalDataParserQueue): Allow parsing operations to happen concurrently on
1770             background queues.
1771
1772 2014-07-12  Eric Carlson  <eric.carlson@apple.com>
1773
1774         [iOS] update control type when playback state changes
1775         https://bugs.webkit.org/show_bug.cgi?id=134856
1776
1777         Reviewed by Dean Jackson.
1778
1779         Check to make sure the correct type of media controls are showing when playback state
1780         changes so we don't end up with the wrong type of controls during playback.
1781
1782         * Modules/mediacontrols/mediaControlsApple.js: 
1783         (Controller.prototype.HandledVideoEvents): Drive-by fix, call handlePlay on 'playing' instead
1784             of 'play' so controls don't hide too early.
1785         * Modules/mediacontrols/mediaControlsiOS.js:
1786         (ControllerIOS.prototype.setPlaying): New, call updateControls to make sure inline
1787             controls are shown when appropriate.
1788
1789 2014-07-12  Dean Jackson  <dino@apple.com>
1790
1791         [iOS Media] Start playback button should indicate when it can't play
1792         https://bugs.webkit.org/show_bug.cgi?id=134851
1793
1794         Post-commit review with Eric Carlson on IRC.
1795
1796         * Modules/mediacontrols/mediaControlsiOS.js:
1797         (ControllerIOS.prototype.updateStatusDisplay): Remove the line that sets the
1798         class on the inline play button.
1799
1800 2014-07-11  Dean Jackson  <dino@apple.com>
1801
1802         [iOS Media] Start playback button should indicate when it can't play
1803         https://bugs.webkit.org/show_bug.cgi?id=134851
1804
1805         Reviewed by Sam Weinig.
1806
1807         If a video element has errors and cannot play, then the start
1808         playback button should use the "broken" icon.
1809
1810         * Modules/mediacontrols/mediaControlsApple.js: Add a new "failed" class.
1811         * Modules/mediacontrols/mediaControlsiOS.js:
1812         (ControllerIOS.prototype.shouldHaveStartPlaybackButton): We need a playback button
1813         even when there is an error.
1814         (ControllerIOS.prototype.handleWirelessPickerButtonTouchStart): Don't offer Airplay
1815         if we're in an error state.
1816         (ControllerIOS.prototype.updateStatusDisplay): Set the "failed" class on
1817         the playback buttons if we are in an error state.
1818
1819 2014-07-11  Benjamin Poulain  <benjamin@webkit.org>
1820
1821         Partition the CSS rules based on the most specific filter of the rightmost fragment
1822         https://bugs.webkit.org/show_bug.cgi?id=134828
1823
1824         Reviewed by Andreas Kling.
1825
1826         Previously, RuleSet was partitioning each rule based on the rightmost filter.
1827         While fast, this had the side effect of putting many selectors with ID match in the class
1828         bucket (because the selectors are generally written starting with the ID).
1829
1830         This patch replace the code of findBestRuleSetAndAdd() by a simple loop going over all
1831         the simple selectors in the rightmost fragment to find the best bucket.
1832
1833         * css/ElementRuleCollector.cpp:
1834         (WebCore::ElementRuleCollector::ruleMatches):
1835         * css/RuleSet.cpp:
1836         (WebCore::isSelectorMatchingHTMLBasedOnRuleHash):
1837         I unified ruleData.hasRightmostSelectorMatchingHTMLBasedOnRuleHash() and hasMultipartSelector().
1838
1839         (WebCore::RuleData::RuleData):
1840         (WebCore::rulesCountForName):
1841         (WebCore::RuleSet::addRule):
1842         I removed the recursive part of findBestRuleSetAndAdd() (which was wrong anyway). The function
1843         was useless so I just moved the algorithm to addRule() directly.
1844
1845         We first loop over all the CSSSelectors related by SubSelector, this correspond to the rightmost fragment.
1846         If a filter with high specificity is found, we add the rule immediately and end there.
1847         If a filter that is not very specific is found, we keep a pointer to the selector to use it later.
1848
1849         (WebCore::RuleSet::findBestRuleSetAndAdd): Deleted.
1850         * css/RuleSet.h:
1851         (WebCore::RuleData::hasMultipartSelector): Deleted.
1852
1853 2014-07-11  Alex Christensen  <achristensen@webkit.org>
1854
1855         [WinCairo] Unreviewed build fix after r170937.
1856
1857         * WebCore.vcxproj/WebCoreGeneratedWinCairo.make:
1858         Update and apply changes applied to WebCoreGenerated.make in r170937.
1859
1860 2014-07-11  Joseph Pecoraro  <pecoraro@apple.com>
1861
1862         Web Inspector: Crash when using a stale InspectableNode Node
1863         https://bugs.webkit.org/show_bug.cgi?id=134849
1864
1865         Reviewed by Timothy Hatcher.
1866
1867         * inspector/PageConsoleAgent.cpp:
1868
1869 2014-07-11  Jer Noble  <jer.noble@apple.com>
1870
1871         [MSE] Separate MediaSource logging into its own log channel
1872         https://bugs.webkit.org/show_bug.cgi?id=134809
1873
1874         Reviewed by Eric Carlson.
1875
1876         Separate out MediaSource logging (which can be quite verbose) into its own log channel,
1877         distinct from the Media log channel. Add some per-sample logging and further sequester that
1878         logging into its own MediaSourceSamples log channel.
1879
1880         Add the MediaSource and MediaSourceSamples channels:
1881         * platform/Logging.h:
1882
1883         Move LOG(Media) -> LOG(MediaSource):
1884         * Modules/mediasource/MediaSource.cpp:
1885         (WebCore::MediaSource::MediaSource):
1886         (WebCore::MediaSource::~MediaSource):
1887         (WebCore::MediaSource::setReadyState):
1888         (WebCore::MediaSource::addSourceBuffer):
1889         (WebCore::MediaSource::removeSourceBuffer):
1890         (WebCore::MediaSource::isTypeSupported):
1891         * Modules/mediasource/SourceBuffer.cpp:
1892         (WebCore::SourceBuffer::sourceBufferPrivateSeekToTime):
1893         (WebCore::SourceBuffer::sourceBufferPrivateAppendComplete):
1894         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
1895         (WebCore::SourceBuffer::sourceBufferPrivateDidBecomeReadyForMoreSamples):
1896         (WebCore::SourceBuffer::provideMediaData):
1897         (WebCore::SourceBuffer::monitorBufferingRate):
1898         (WebCore::SourceBuffer::textTrackAddCues):
1899         (WebCore::SourceBuffer::hasFutureTime):
1900         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1901         (WebCore::SourceBufferPrivateAVFObjC::didParseStreamDataAsAsset):
1902         (WebCore::SourceBufferPrivateAVFObjC::didFailToParseStreamDataWithError):
1903         (WebCore::SourceBufferPrivateAVFObjC::processCodedFrame):
1904         (WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID):
1905         (WebCore::SourceBufferPrivateAVFObjC::append):
1906         (WebCore::SourceBufferPrivateAVFObjC::layerDidReceiveError):
1907         (WebCore::SourceBufferPrivateAVFObjC::rendererDidReceiveError):
1908         (WebCore::SourceBufferPrivateAVFObjC::flushAndEnqueueNonDisplayingSamples):
1909         (WebCore::SourceBufferPrivateAVFObjC::enqueueSample):
1910
1911 2014-07-11  Brady Eidson  <beidson@apple.com>
1912
1913         Phone numbers that span two lines are not detected.
1914         <rdar://problem/17601146> and https://bugs.webkit.org/show_bug.cgi?id=134808
1915
1916         Reviewed by Tim Horton.
1917
1918         * editing/Editor.cpp:
1919         (WebCore::Editor::scanSelectionForTelephoneNumbers): After scanning a range from the TextIterator,
1920             create an "edge range" window around the end of the TextIterator range, and scan it.
1921             Also make sure to not accumulate duplicate ranges that might have showed up in both the
1922             TextIterator range and the edge window range.
1923
1924 2014-07-11  Enrica Casucci  <enrica@apple.com>
1925
1926         Implement textStylingAtPosition in WK2.
1927         https://bugs.webkit.org/show_bug.cgi?id=134843
1928         <rdar://problem/17614981>
1929         
1930         Reviewed by Benjamin Poulain.
1931
1932         Adding some exports and making styleForSelectionStart public.
1933
1934         * WebCore.exp.in:
1935         * editing/Editor.h:
1936
1937 2014-07-11  Zalan Bujtas  <zalan@apple.com>
1938
1939         REGRESSION (r168868): eBay 'see all' links fail due to different JS bindings conversion behavior.
1940         https://bugs.webkit.org/show_bug.cgi?id=134841
1941         <rdar://problem/17577563>
1942
1943         Reviewed by Simon Fraser.
1944
1945         Revert back to type int for Element.scroll* APIs in order to preserve exception handling
1946         behavior.
1947
1948         Test: cssom/non-subpixel-scroll-top-left-values.html
1949
1950         * dom/Element.cpp:
1951         (WebCore::Element::scrollLeft):
1952         (WebCore::Element::scrollTop):
1953         (WebCore::Element::setScrollLeft):
1954         (WebCore::Element::setScrollTop):
1955         (WebCore::Element::scrollWidth):
1956         (WebCore::Element::scrollHeight):
1957         * dom/Element.h:
1958         * dom/Element.idl:
1959         * html/HTMLBodyElement.cpp:
1960         (WebCore::adjustForZoom):
1961         (WebCore::HTMLBodyElement::scrollLeft):
1962         (WebCore::HTMLBodyElement::setScrollLeft):
1963         (WebCore::HTMLBodyElement::scrollTop):
1964         (WebCore::HTMLBodyElement::setScrollTop):
1965         (WebCore::HTMLBodyElement::scrollHeight):
1966         (WebCore::HTMLBodyElement::scrollWidth):
1967         * html/HTMLBodyElement.h:
1968
1969 2014-07-11  Joseph Pecoraro  <pecoraro@apple.com>
1970
1971         Web Inspector: Debugger Pause button does not work
1972         https://bugs.webkit.org/show_bug.cgi?id=134785
1973
1974         Reviewed by Timothy Hatcher.
1975
1976         * CMakeLists.txt:
1977         * DerivedSources.make:
1978         * inspector/CommandLineAPIModuleSource.js:
1979         Minification strips the sourceURL command. Add it back with minification.
1980
1981 2014-07-11  Andreas Kling  <akling@apple.com>
1982
1983         Use the bare minimum tile coverage rect when under memory pressure.
1984         <https://webkit.org/b/134837>
1985
1986         When the browser is under critical memory pressure, don't generate any
1987         more tiles than are needed to cover the exposed viewport rect.
1988
1989         Reviewed by Pratik Solanki.
1990
1991         * page/FrameView.cpp:
1992         (WebCore::FrameView::computeCoverageRect):
1993
1994 2014-07-11  Javier Fernandez  <jfernandez@igalia.com>
1995
1996         [CSS Grid Layout] Implement justify-self css property
1997         https://bugs.webkit.org/show_bug.cgi?id=134419
1998
1999         Reviewed by Dean Jackson.
2000
2001         This change adds the justify-self property from CSS 3 Box Alignment
2002         and implements the parsing.
2003
2004         From Blink r164685 by <jchaffraix@chromium.org>
2005
2006         Test: fast/css/parse-justify-self.html
2007
2008         * css/CSSComputedStyleDeclaration.cpp:
2009         (WebCore::ComputedStyleExtractor::propertyValue):
2010         * css/CSSParser.cpp:
2011         (WebCore::isValidKeywordPropertyAndValue):
2012         (WebCore::CSSParser::parseValue):
2013         (WebCore::isItemPositionKeyword):
2014         (WebCore::CSSParser::parseJustifySelf):
2015         * css/CSSParser.h:
2016         * css/CSSPrimitiveValueMappings.h:
2017         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
2018         (WebCore::CSSPrimitiveValue::operator EJustifySelf):
2019         (WebCore::CSSPrimitiveValue::operator EJustifySelfOverflowAlignment):
2020         * css/CSSPropertyNames.in:
2021         * css/CSSValueKeywords.in:
2022         * css/DeprecatedStyleBuilder.cpp:
2023         (WebCore::DeprecatedStyleBuilder::DeprecatedStyleBuilder):
2024         * css/StyleResolver.cpp:
2025         (WebCore::StyleResolver::applyProperty):
2026         * rendering/style/RenderStyle.h:
2027         * rendering/style/RenderStyleConstants.h:
2028         * rendering/style/StyleRareNonInheritedData.cpp:
2029         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
2030         (WebCore::StyleRareNonInheritedData::operator==):
2031         * rendering/style/StyleRareNonInheritedData.h:
2032
2033 2014-07-11  Bear Travis  <betravis@adobe.com>
2034
2035         [Feature Queries] Feature Query CSS Grammar Productions Should Return a Value
2036         https://bugs.webkit.org/show_bug.cgi?id=134810
2037
2038         Reviewed by Antti Koivisto.
2039
2040         The parsing return values are used to determine if a feature query is valid. Two
2041         grammar productions have been updated to correctly return a value.
2042
2043         Tests exist for this feature but will not be run until the feature is turned on.
2044         See https://bugs.webkit.org/show_bug.cgi?id=134404.
2045
2046         * css/CSSGrammar.y.in: Adding return values for two valid feature query productions.
2047
2048 2014-07-10  Brent Fulgham  <bfulgham@apple.com>
2049
2050         Use a separate backdrop element to allow cues to have highlight and background color
2051         https://bugs.webkit.org/show_bug.cgi?id=134821
2052         <rdar://problem/15999721>
2053
2054         Reviewed by Eric Carlson.
2055
2056         Add a new <div> element wrapping the existing cue <span>. This allows
2057         us to have a highlight on the cue (in the <span> background), as well
2058         as an overall background color.
2059
2060         * Modules/mediacontrols/mediaControlsApple.css:
2061         (video::-webkit-media-text-track-display-backdrop): New markup for
2062         the backdrop element of the caption.
2063         * html/track/VTTCue.cpp:
2064         (WebCore::VTTCue::cueBackdropShadowPseudoId): Added to
2065         allow user customization of the cue backdrop.
2066         (WebCore::VTTCue::initialize): Rename the old "m_cueBackgroundBox" to
2067         "m_cueHighlightBox" and add a new "m_cueBackdropBox" member.
2068         (WebCore::VTTCue::updateDisplayTree): Update for m_cueHighlightBox.
2069         (WebCore::VTTCue::getDisplayTree): Make m_cueHighlightBox a child
2070         of the new m_cueBackdropBox element, and add m_cueBackdropBox to
2071         the display tree.
2072         * html/track/VTTCue.h:
2073         (WebCore::VTTCue::element):
2074         * page/CaptionUserPreferencesMediaAF.cpp:
2075         (WebCore::CaptionUserPreferencesMediaAF::setInterestedInCaptionPreferenceChanges):
2076         Fix for missing caption style updates. Even if we are already
2077         listening for caption changes, we still want to update the new
2078         instance's style sheet to match.
2079         (WebCore::CaptionUserPreferencesMediaAF::captionsStyleSheetOverride):
2080         * rendering/RenderVTTCue.cpp:
2081         (WebCore::RenderVTTCue::initializeLayoutParameters): Take the new
2082         <div> into consideration when looking for the Cue text element.
2083
2084 2014-07-11  Zalan Bujtas  <zalan@apple.com>
2085
2086         Subpixel layout: return integral results for offset*, client*, scroll* by default.
2087         https://bugs.webkit.org/show_bug.cgi?id=134651
2088
2089         Reviewed by Simon Fraser.
2090
2091         Revert to returning integral values for Element.offset* client* scroll* by default.
2092         Fractional values break number of sites(tight design) and JS frameworks(fail to handle fractional values).
2093
2094         Since snapped dimension depends on both the original point and the width/height of the box,
2095         we need to call RenderBoxModelObject::pixelSnapped*() helpers, instead of round().
2096
2097         Covered by existing tests
2098  
2099         * dom/Element.cpp:
2100         (WebCore::subpixelMetricsEnabled):
2101         (WebCore::convertToNonSubpixelValueIfNeeded):
2102         (WebCore::Element::offsetLeft):
2103         (WebCore::Element::offsetTop):
2104         (WebCore::Element::offsetWidth):
2105         (WebCore::Element::offsetHeight):
2106         (WebCore::Element::clientLeft):
2107         (WebCore::Element::clientTop):
2108         (WebCore::Element::clientWidth):
2109         (WebCore::Element::clientHeight):
2110         * page/Settings.in:
2111
2112 2014-07-11  Zalan Bujtas  <zalan@apple.com>
2113
2114         Subpixel rendering: icloud.com password arrow has clipped circle at some window sizes.
2115         https://bugs.webkit.org/show_bug.cgi?id=134824
2116         <rdar://problem/17612729>
2117
2118         Reviewed by Simon Fraser.
2119
2120         Transparent layer clipping needs device pixel offset adjusting.
2121
2122         Test: fast/layers/wrong-clipping-semi-transparent-compositing-layer-on-subpixel-position.html
2123
2124         * rendering/RenderLayer.cpp:
2125         (WebCore::RenderLayer::beginTransparencyLayers):
2126         (WebCore::RenderLayer::paintLayer):
2127         (WebCore::RenderLayer::paintLayerContents):
2128         (WebCore::RenderLayer::paintBackgroundForFragments):
2129         (WebCore::RenderLayer::paintForegroundForFragments):
2130         * rendering/RenderLayer.h:
2131
2132 2014-07-11  Carlos Garcia Campos  <cgarcia@igalia.com>
2133
2134         Unreviewed. Remove unused file.
2135
2136         * html/shadow/MediaControlsGtk.h: Removed.
2137
2138 2014-07-11  Manuel Rego Casasnovas  <rego@igalia.com>
2139
2140         [CSS Grid Layout] Update grid-auto-flow to the new syntax
2141         https://bugs.webkit.org/show_bug.cgi?id=134057
2142
2143         Reviewed by Sergio Villar Senin.
2144
2145         In last versions of the spec grid-auto-flow syntax has changed. New
2146         syntax is:
2147         [ row | column ] && dense? | stack && [ row | column ]?
2148
2149         Implemented parsing for new syntax and added/modified test cases in
2150         current layout tests.
2151
2152         For the moment, the implementation keeps working in the same way, but
2153         using "stack" value for grid-auto-flow property instead of "none". This
2154         should be fixed in a follow-up patch once "stack" is properly
2155         implemented.
2156
2157         Also "dense" needs to be reviewed. Right now auto-placement algorithm is
2158         always "dense" and never "sparse".
2159
2160         No new tests, update current tests to add new cases.
2161
2162         * css/CSSComputedStyleDeclaration.cpp:
2163         (WebCore::ComputedStyleExtractor::propertyValue): Adapt to new syntax.
2164         * css/CSSParser.cpp:
2165         (WebCore::isValidKeywordPropertyAndValue): Removed grid-auto-flow as it
2166         is not a keyword anymore.
2167         (WebCore::isKeywordPropertyID): Ditto.
2168         (WebCore::CSSParser::parseValue): Add specific method for parsing
2169         grid-auto-flow.
2170         (WebCore::CSSParser::parseGridShorthand): Adapt parsing for
2171         grid-auto-flow property inside the shorthand.
2172         (WebCore::isValidGridAutoFlowId): Helper method to check if the CSSValue
2173         id is a valid keyword for grid-auto-flow property.
2174         (WebCore::CSSParser::parseGridAutoFlow): Implement new parsing for
2175         grid-auto-flow.
2176         * css/CSSParser.h: Method header for grid-auto-flow parsing.
2177         * css/CSSPrimitiveValueMappings.h:
2178         (WebCore::CSSPrimitiveValue::operator GridAutoFlow): Deleted.
2179         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Deleted.
2180         * css/CSSValueKeywords.in: Add new keywords required by grid-auto-flow:
2181         "dense" and "stack".
2182         * css/DeprecatedStyleBuilder.cpp:
2183         (WebCore::DeprecatedStyleBuilder::DeprecatedStyleBuilder): Remove
2184         default handler as grid-auto-flow is not a keyword now.
2185         * css/StyleResolver.cpp:
2186         (WebCore::StyleResolver::applyProperty): Implement particular handler
2187         for new grid-auto-flow syntax.
2188         * rendering/RenderGrid.cpp:
2189         (WebCore::RenderGrid::placeItemsOnGrid): Keep old "none" behavior as
2190         "stack" behavior for the moment.
2191         (WebCore::RenderGrid::autoPlacementMajorAxisDirection): Use the new
2192         helper methods in RenderStyle.
2193         (WebCore::RenderGrid::autoPlacementMinorAxisDirection): Ditto.
2194         * rendering/style/GridResolvedPosition.cpp:
2195         (WebCore::GridResolvedPosition::resolveGridPositionsFromStyle): Again
2196         keep old "none" behavior for "stack".
2197         * rendering/style/RenderStyle.h: Add new helper methods to know the
2198         direction and algorithm of grid-auto-flow property.
2199         * rendering/style/RenderStyleConstants.h: Redefine GridAutoFlow enum
2200         using flags for algorithm and direction.
2201         * rendering/style/StyleGridData.h: Change m_gridAutoFlow type to
2202         unsigned.
2203
2204 2014-07-10  Myles C. Maxfield  <mmaxfield@apple.com>
2205
2206         [iOS] Pasting rich content does not perform a two-step paste
2207         https://bugs.webkit.org/show_bug.cgi?id=134795
2208
2209         Reviewed by Benjamin Poulain.
2210
2211         UIKit requires writing something (anything!) to a particular pasteboard
2212         during copy in order to flag the content as rich. When a paste occurs,
2213         UIKit will read this flag and perform a two-step paste.
2214
2215         Test: platform/ios-sim/editing/pasteboard/two-step-paste.html
2216
2217         * platform/ios/PlatformPasteboardIOS.mm:
2218         (WebCore::PlatformPasteboard::write):
2219
2220 2014-07-09  Andy Estes  <aestes@apple.com>
2221
2222         [iOS] Some QuickLook documents are not displayed as previews
2223         https://bugs.webkit.org/show_bug.cgi?id=134788
2224         <rdar://problem/17278194>
2225
2226         Reviewed by Pratik Solanki.
2227
2228         ResourceRequest::isMainResourceRequest() is not reliable (e.g. ResourceRequests reconstituted from an
2229         NSURLRequest have no way to set this bit properly) and should probably be removed. Instead of using
2230         isMainResourceRequest() to check if a QuickLookHandle should be created when the Network Process is in use,
2231         just check if the current ResourceLoader is the same as the DocumentLoader's ResourceLoader.
2232
2233         No new tests. QuickLook is not testable from WebKit.
2234
2235         * platform/network/ios/QuickLook.mm:
2236         (WebCore::QuickLookHandle::create):
2237
2238 2014-07-10  Andreas Kling  <akling@apple.com>
2239
2240         [iOS WebKit2] Don't uninstall the memory pressure listener after first signal.
2241         <https://webkit.org/b/134814>
2242
2243         The call to uninstall() should not be made on iOS since iOS doesn't use the
2244         hold-off mechanism in MemoryPressureHandler.
2245
2246         Reviewed by Benjamin Poulain.
2247
2248         * platform/cocoa/MemoryPressureHandlerCocoa.mm:
2249         (WebCore::MemoryPressureHandler::respondToMemoryPressure):
2250
2251 2014-07-10  Jer Noble  <jer.noble@apple.com>
2252
2253         [MSE] Overlapping appended ranges must cause the decoder to flush and re-enqueue.
2254         https://bugs.webkit.org/show_bug.cgi?id=134805
2255
2256         Reviewed by Eric Carlson.
2257
2258         When appending a range of media data which overlaps with an existing range, SourceBuffer
2259         must cause the decoder to flush and re-enqueue samples. Those samples removed by appending
2260         the overlapping range may have already been enqueued for display, and unless the decode
2261         queue is flushed, corruption or decode errors may occur as the new samples are enqueued for
2262         display.
2263
2264         Add a boolean flag onto TrackBuffer to indicate whether the decoder needs to be flushed and
2265         re-enqueued the next time an append operation completes. Set this flag whenever samples are
2266         removed due to overlapping or an explicit call to removeCodedFrames(). Move the contents of
2267         sourceBufferPrivateSeekToTime() (which previously did flushing and re-enqueueing) into a new
2268         function, reenqueueMediaForTime(), which can be called from sourceBufferPrivateAppendComplete().
2269
2270         Drive-by fix: findSyncSampleAfterDecodeIterator() would return the passed in iterator if that
2271         sample is a sync-sample. Fix this to correctly return the next sync sample.
2272
2273         Drive-by fix: Use a SampleMap, rather than a DecodeOrderSampleMap, to track erased samples
2274         so that the erasedSamples are correctly accounted for in both presentation and decode orders.
2275
2276         * Modules/mediasource/SampleMap.cpp:
2277         (WebCore::SampleMap::empty): Add convenience method.
2278         (WebCore::DecodeOrderSampleMap::findSyncSampleAfterDecodeIterator): Drive-by fix.
2279         * Modules/mediasource/SampleMap.h:
2280         (WebCore::SampleMap::decodeOrder): Added const accessor.
2281         (WebCore::SampleMap::presentationOrder): Ditto.
2282         (WebCore::SampleMap::addRange): Added.
2283         * Modules/mediasource/SourceBuffer.cpp:
2284         (WebCore::SourceBuffer::TrackBuffer::TrackBuffer): Add needsReenqueeing flag.
2285         (WebCore::SourceBuffer::sourceBufferPrivateSeekToTime): Move contents into reenqueueMediaForTime().
2286         (WebCore::SourceBuffer::sourceBufferPrivateAppendComplete): Call reenqueMediaForTime() if necessary.
2287         (WebCore::SourceBuffer::removeCodedFrames): Set needsReenqueing.
2288         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample): Ditto.
2289         (WebCore::SourceBuffer::provideMediaData): Drive-by fix.
2290         (WebCore::SourceBuffer::reenqueueMediaForTime): Moved from sourceBufferPrivateSeekToTime().
2291         * Modules/mediasource/SourceBuffer.h:
2292
2293 2014-07-10  Pratik Solanki  <psolanki@apple.com>
2294
2295         ASSERT in SharedBuffer::maybeAppendDataArray() on MobileSafari launch
2296         https://bugs.webkit.org/show_bug.cgi?id=134812
2297         <rdar://problem/17628434>
2298
2299         Reviewed by Joseph Pecoraro.
2300
2301         Fix bug in my fix in r170930. Initialize the badly named m_shouldUsePurgeableMemory field to
2302         false. This field indicates when it is okay to use purgeable memory and is set to true once
2303         the resource is finished loading. By setting it to true in the constructor we were creating
2304         purgeable memory while the resource was still being loaded and this triggered the assert.
2305
2306         No new tests. Should be covered by existing tests.
2307
2308         * platform/cf/SharedBufferCF.cpp:
2309         (WebCore::SharedBuffer::SharedBuffer):
2310
2311 2014-07-10  Andreas Kling  <akling@apple.com>
2312
2313         [iOS WebKit2] Some memory pressure relief tweaks.
2314         <https://webkit.org/b/134811>
2315
2316         Split memory pressure relief into critical and non-critical sections.
2317         Non-critical relief is for clearing out things that are really not
2318         essential, e.g unused font data, text measurement caches, etc.
2319
2320         On iOS, only flip the "WebKit is under memory pressure" flag when we
2321         are under *critical* memroy pressure, rather than doing it early on
2322         and gimping ourselves because other processes are too big.
2323
2324         Also added logging for when we transition in/out of system pressure.
2325
2326         Reviewed by Geoffrey Garen.
2327
2328         * platform/MemoryPressureHandler.cpp:
2329         (WebCore::MemoryPressureHandler::releaseNoncriticalMemory):
2330         (WebCore::MemoryPressureHandler::releaseCriticalMemory):
2331         (WebCore::MemoryPressureHandler::releaseMemory):
2332         * platform/MemoryPressureHandler.h:
2333         (WebCore::MemoryPressureHandler::ReliefLogger::loggingEnabled):
2334         * platform/cocoa/MemoryPressureHandlerCocoa.mm:
2335         (WebCore::MemoryPressureHandler::install):
2336
2337 2014-07-10  Beth Dakin  <bdakin@apple.com>
2338
2339         Need Setting/WKPreference that allows clients to prevent scrollbars from drawing 
2340         on a secondary thread
2341         https://bugs.webkit.org/show_bug.cgi?id=134778
2342         -and corresponding-
2343         <rdar://problem/17595333>
2344
2345         Reviewed by Tim Horton.
2346
2347         This is a requirement for some types of performance tests. The patch adds a new 
2348         virtual function to ScrollableArea that forces subclasses to indicate the value of 
2349         the Setting. This is required because Scrollbar and ScrollableArea can’t get to 
2350         Settings on their own.
2351
2352         * page/FrameView.cpp:
2353         (WebCore::FrameView::forceUpdateScrollbarsOnMainThreadForPerformanceTesting):
2354         * page/FrameView.h:
2355         * page/Settings.in:
2356         * platform/ScrollableArea.h:
2357         * platform/Scrollbar.cpp:
2358         (WebCore::Scrollbar::supportsUpdateOnSecondaryThread):
2359         * platform/win/PopupMenuWin.h:
2360         * rendering/RenderLayer.cpp:
2361         (WebCore::RenderLayer::forceUpdateScrollbarsOnMainThreadForPerformanceTesting):
2362         * rendering/RenderLayer.h:
2363         * rendering/RenderListBox.cpp:
2364         (WebCore::RenderListBox::forceUpdateScrollbarsOnMainThreadForPerformanceTesting):
2365         * rendering/RenderListBox.h:
2366
2367 2014-07-10  Brady Eidson  <beidson@apple.com>
2368
2369         Phone number highlights should always be visible if the mouse hovers over.
2370         <rdar://problem/17527476> and https://bugs.webkit.org/show_bug.cgi?id=134784
2371
2372         Reviewed by Tim Horton.
2373
2374         * WebCore.exp.in:
2375
2376 2014-07-10  Timothy Horton  <timothy_horton@apple.com>
2377
2378         Assertions or crashes under _takeViewSnapshot when restoring windows
2379         https://bugs.webkit.org/show_bug.cgi?id=134792
2380
2381         Reviewed by Simon Fraser.
2382
2383         * platform/graphics/cocoa/IOSurface.mm:
2384         (IOSurface::createFromImage):
2385
2386 2014-07-10  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2387
2388         [XHR] overrideMimeType() should be able to change encoding in HEADERS RECEIVED state
2389         https://bugs.webkit.org/show_bug.cgi?id=128968
2390
2391         Reviewed by Alexey Proskuryakov.
2392
2393         Moved response encoding computation from didReceiveResponse to didReceiveData, just before the decoder is instantiated.
2394         This allows overrideMimeType to be changed within readystatechange event callback and have an impact on selected encoding.
2395
2396         Test: http/tests/xmlhttprequest/overridemimetype-headers-received-state-force-shiftjis.html
2397
2398         * xml/XMLHttpRequest.cpp:
2399         (WebCore::XMLHttpRequest::didReceiveResponse): Removed m_responseEncoding computation from response and mimeTypeOverride.
2400         (WebCore::XMLHttpRequest::didReceiveData): Added m_responseEncoding computation from response and mimeTypeOverride.
2401
2402 2014-07-09  Brady Eidson  <beidson@apple.com>
2403
2404         Fire connected/disconnected events for Gamepads.
2405         https://bugs.webkit.org/show_bug.cgi?id=134386
2406
2407         Reviewed by Dean Jackson.
2408
2409         No new tests (No effect in a currently tested config)
2410
2411         * Modules/gamepad/GamepadManager.cpp:
2412         (WebCore::navigatorGamepadFromDOMWindow): Handling converting a possibly-null Navigator into
2413             a possibly null NavigatorGamepad.
2414         (WebCore::GamepadManager::platformGamepadConnected): Notify blind Navigator/DOMWindows of all
2415             previously attached Gamepads, then notify everybody of this new gamepad.
2416         (WebCore::GamepadManager::platformGamepadDisconnected): Handle dispatching the disconnected
2417             event to all registered DOMWindows.
2418         (WebCore::GamepadManager::platformGamepadInputActivity): Notify blind Navigator/DOMWindows of all
2419             attached Gamepads.
2420         (WebCore::GamepadManager::makeGamepadVisible): Handles notifying setting up a new gamepads
2421             with all NavigatorGamepads as well as dispatching the connected even to DOMWindows.
2422         (WebCore::GamepadManager::registerDOMWindow):
2423         (WebCore::GamepadManager::unregisterDOMWindow):
2424         (WebCore::GamepadManager::makeGamepadsVisibileToBlindNavigators): Deleted.
2425         * Modules/gamepad/GamepadManager.h:
2426
2427         * Modules/gamepad/NavigatorGamepad.cpp:
2428         (WebCore::NavigatorGamepad::gamepadAtIndex):
2429         * Modules/gamepad/NavigatorGamepad.h:
2430
2431 2014-07-09  Benjamin Poulain  <bpoulain@apple.com>
2432
2433         [iOS][WK2] Disable text quantization while actively changing the page's scale factor
2434         https://bugs.webkit.org/show_bug.cgi?id=134781
2435
2436         Reviewed by Tim Horton and Myles C. Maxfield.
2437
2438         Query the chrome client to setup quantization on each layers.
2439
2440         * page/ChromeClient.h:
2441         (WebCore::ChromeClient::hasStablePageScaleFactor):
2442         * platform/graphics/mac/FontMac.mm:
2443         (WebCore::Font::drawGlyphs):
2444         * rendering/RenderLayer.cpp:
2445         (WebCore::RenderLayer::setupFontSubpixelQuantization):
2446
2447 2014-07-09  peavo@outlook.com  <peavo@outlook.com>
2448
2449         [Curl] Cache entry invalidated too early.
2450         https://bugs.webkit.org/show_bug.cgi?id=134681
2451
2452         Reviewed by Alex Christensen.
2453
2454         When a cache entry has expired, it is invalidated when a request for the corresponding url is started.
2455         This is too early, since the resource is possibly not modified (even though it has expired),
2456         and the server might respond with a 304 (not modified) response.
2457         When we then receive a 304 response, the cache entry is deleted, and we have no cached response/data to provide.
2458         This can be solved by not invalidating the entry when a request for that url is started,
2459         but instead invalidate when a 200 OK response is received (which means the resource has been modified).
2460
2461         * platform/network/curl/CurlCacheManager.cpp:
2462         (WebCore::CurlCacheManager::isCached): Avoid invalidating cache entry when it has expired, wait until we know the server response.
2463         * platform/network/curl/CurlCacheManager.h: Added const modifier.
2464
2465 2014-07-09  Myles C. Maxfield  <mmaxfield@apple.com>
2466
2467         Revert r170413 and r170390
2468         https://bugs.webkit.org/show_bug.cgi?id=134741
2469
2470         Reviewed by Benjamin Poulain.
2471
2472         These patches caused a variety of failures. I'm going to break them up into
2473         smaller chunks and commit them separately at some point in the future.
2474
2475         Requesting a review from Ben Poulain because there were some conflicts with
2476         r170561 in InlineTextBox.cpp and InlineTextBox.h.
2477
2478         * WebCore.exp.in:
2479         * platform/graphics/Font.cpp:
2480         (WebCore::Font::drawText):
2481         (WebCore::Font::drawEmphasisMarks):
2482         (WebCore::Font::adjustSelectionRectForText):
2483         (WebCore::computeUnderlineType):
2484         * platform/graphics/Font.h:
2485         * platform/graphics/FontFastPath.cpp:
2486         (WebCore::Font::getGlyphsAndAdvancesForSimpleText):
2487         (WebCore::Font::drawSimpleText):
2488         (WebCore::Font::drawEmphasisMarksForSimpleText):
2489         (WebCore::Font::drawGlyphBuffer):
2490         (WebCore::Font::drawEmphasisMarks):
2491         (WebCore::Font::adjustSelectionRectForSimpleText):
2492         * platform/graphics/GlyphBuffer.h:
2493         (WebCore::GlyphBuffer::size):
2494         (WebCore::GlyphBuffer::glyphs):
2495         (WebCore::GlyphBuffer::advances):
2496         (WebCore::GlyphBuffer::fontDataAt):
2497         (WebCore::GlyphBuffer::advanceAt):
2498         (WebCore::GlyphBuffer::offsetAt):
2499         (WebCore::GlyphBuffer::reverse):
2500         (WebCore::GlyphBuffer::offsetInString):
2501         (WebCore::GlyphBuffer::swap):
2502         * platform/graphics/GraphicsContext.cpp:
2503         * platform/graphics/Latin1TextIterator.h:
2504         (WebCore::Latin1TextIterator::Latin1TextIterator):
2505         (WebCore::Latin1TextIterator::currentCharacter):
2506         * platform/graphics/SimpleFontData.h:
2507         * platform/graphics/SurrogatePairAwareTextIterator.cpp:
2508         (WebCore::SurrogatePairAwareTextIterator::SurrogatePairAwareTextIterator):
2509         * platform/graphics/SurrogatePairAwareTextIterator.h:
2510         (WebCore::SurrogatePairAwareTextIterator::currentCharacter):
2511         * platform/graphics/TextRun.h:
2512         (WebCore::TextRun::length):
2513         (WebCore::TextRun::charactersLength):
2514         * platform/graphics/WidthIterator.cpp:
2515         (WebCore::WidthIterator::glyphDataForCharacter):
2516         (WebCore::applyFontTransforms):
2517         (WebCore::WidthIterator::advanceInternal):
2518         (WebCore::WidthIterator::advance):
2519         (WebCore::WidthIterator::advanceOneCharacter):
2520         * platform/graphics/WidthIterator.h:
2521         * platform/graphics/cairo/FontCairo.cpp:
2522         (WebCore::Font::drawGlyphs):
2523         * platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
2524         (WebCore::Font::drawComplexText):
2525         (WebCore::Font::drawEmphasisMarksForComplexText):
2526         (WebCore::Font::adjustSelectionRectForComplexText):
2527         * platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
2528         (WebCore::HarfBuzzShaper::setNormalizedBuffer):
2529         * platform/graphics/mac/FontComplexTextMac.cpp:
2530         (WebCore::Font::adjustSelectionRectForComplexText):
2531         (WebCore::Font::getGlyphsAndAdvancesForComplexText):
2532         (WebCore::Font::drawComplexText):
2533         (WebCore::Font::drawEmphasisMarksForComplexText):
2534         * platform/graphics/mac/FontMac.mm:
2535         (WebCore::Font::drawGlyphs):
2536         * platform/graphics/win/FontCGWin.cpp:
2537         (WebCore::Font::drawGlyphs):
2538         * platform/graphics/win/FontWin.cpp:
2539         (WebCore::Font::adjustSelectionRectForComplexText):
2540         (WebCore::Font::getGlyphsAndAdvancesForComplexText):
2541         (WebCore::Font::drawComplexText):
2542         (WebCore::Font::drawEmphasisMarksForComplexText):
2543         * platform/graphics/wince/FontWinCE.cpp:
2544         (WebCore::Font::drawGlyphs):
2545         (WebCore::Font::drawComplexText):
2546         (WebCore::Font::drawEmphasisMarksForComplexText):
2547         (WebCore::Font::selectionRectForComplexText):
2548         * rendering/InlineTextBox.cpp:
2549         (WebCore::InlineTextBox::isSelected):
2550         (WebCore::InlineTextBox::selectionState):
2551         (WebCore::InlineTextBox::localSelectionRect):
2552         (WebCore::InlineTextBox::paint):
2553         (WebCore::InlineTextBox::selectionStartEnd):
2554         (WebCore::InlineTextBox::paintSelection):
2555         (WebCore::InlineTextBox::paintCompositionBackground):
2556         (WebCore::InlineTextBox::paintDocumentMarker):
2557         (WebCore::InlineTextBox::paintTextMatchMarker):
2558         (WebCore::InlineTextBox::computeRectForReplacementMarker):
2559         (WebCore::InlineTextBox::paintCompositionUnderline):
2560         (WebCore::InlineTextBox::positionForOffset):
2561         (WebCore::InlineTextBox::constructTextRun):
2562         * rendering/InlineTextBox.h:
2563         (WebCore::InlineTextBox::truncation):
2564         * rendering/RenderCombineText.cpp:
2565         (WebCore::RenderCombineText::getStringToRender):
2566         * rendering/RenderCombineText.h:
2567         * rendering/RenderTextLineBoxes.cpp:
2568         (WebCore::ellipsisRectForBox):
2569         * rendering/svg/SVGInlineFlowBox.cpp:
2570         (WebCore::SVGInlineFlowBox::computeTextMatchMarkerRectForRenderer):
2571         * rendering/svg/SVGInlineTextBox.cpp:
2572         (WebCore::SVGInlineTextBox::positionForOffset):
2573         (WebCore::SVGInlineTextBox::localSelectionRect):
2574         (WebCore::SVGInlineTextBox::paintSelectionBackground):
2575         (WebCore::SVGInlineTextBox::mapStartEndPositionsIntoFragmentCoordinates):
2576         (WebCore::SVGInlineTextBox::paintText):
2577         * rendering/svg/SVGInlineTextBox.h:
2578         * rendering/svg/SVGTextMetricsBuilder.cpp:
2579         (WebCore::SVGTextMetricsBuilder::currentCharacterStartsSurrogatePair):
2580         (WebCore::SVGTextMetricsBuilder::advance):
2581         * rendering/svg/SVGTextQuery.cpp:
2582         (WebCore::SVGTextQuery::mapStartEndPositionsIntoFragmentCoordinates):
2583         (WebCore::SVGTextQuery::modifyStartEndPositionsRespectingLigatures):
2584         (WebCore::SVGTextQuery::subStringLengthCallback):
2585         (WebCore::SVGTextQuery::startPositionOfCharacterCallback):
2586         (WebCore::SVGTextQuery::endPositionOfCharacterCallback):
2587         (WebCore::SVGTextQuery::rotationOfCharacterCallback):
2588         (WebCore::SVGTextQuery::extentOfCharacterCallback):
2589         (WebCore::SVGTextQuery::characterNumberAtPositionCallback):
2590         * rendering/svg/SVGTextQuery.h:
2591         * rendering/svg/SVGTextRunRenderingContext.cpp:
2592         (WebCore::SVGGlyphToPathTranslator::SVGGlyphToPathTranslator):
2593         (WebCore::SVGTextRunRenderingContext::glyphDataForCharacter):
2594         * rendering/svg/SVGTextRunRenderingContext.h:
2595         * svg/SVGFontData.cpp:
2596         (WebCore::SVGFontData::applySVGGlyphSelection):
2597         * svg/SVGFontData.h:
2598
2599 2014-07-08  Jeffrey Pfau  <jpfau@apple.com>
2600
2601         Fix flaky loading tests
2602         https://bugs.webkit.org/show_bug.cgi?id=133696
2603
2604         Reviewed by Ryosuke Niwa.
2605
2606         In some cases, the Frame may be destroyed while the loader is
2607         initializing. Make sure we don't delete it too early.
2608
2609         * loader/FrameLoader.cpp:
2610         (WebCore::FrameLoader::init):
2611
2612 2014-07-09  Simon Fraser  <simon.fraser@apple.com>
2613
2614         Make IndirectCompositingReason an enum class
2615         https://bugs.webkit.org/show_bug.cgi?id=134789
2616
2617         Reviewed by Tim Horton.
2618
2619         Make RenderLayer::IndirectCompositingReason an enum class, and change some code
2620         in RenderLayerCompositor::reasonsForCompositing() to use a switch.
2621
2622         * rendering/RenderLayer.cpp:
2623         (WebCore::RenderLayer::RenderLayer):
2624         * rendering/RenderLayer.h:
2625         * rendering/RenderLayerCompositor.cpp:
2626         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
2627         (WebCore::RenderLayerCompositor::requiresOwnBackingStore):
2628         (WebCore::RenderLayerCompositor::reasonsForCompositing):
2629         (WebCore::RenderLayerCompositor::requiresCompositingForIndirectReason):
2630
2631 2014-07-09  Pratik Solanki  <psolanki@apple.com>
2632
2633         Make SharedBuffer::append(SharedBuffer*) be smarter about CFData and data arrays
2634         https://bugs.webkit.org/show_bug.cgi?id=134731
2635
2636         Reviewed by Antti Koivisto.
2637
2638         If the target SharedBuffer has a CFDataRef or a data array then we can simply retain that
2639         CFDataRef or data array elements in the SharedBuffer being appended to. This avoids
2640         unnecessary copying.
2641
2642         No new tests because no functional changes.
2643
2644         * platform/SharedBuffer.cpp:
2645         (WebCore::SharedBuffer::append):
2646         (WebCore::SharedBuffer::maybeAppendPlatformData):
2647         * platform/SharedBuffer.h:
2648         * platform/cf/SharedBufferCF.cpp:
2649         (WebCore::SharedBuffer::maybeAppendPlatformData):
2650         (WebCore::SharedBuffer::maybeAppendDataArray):
2651         * platform/soup/SharedBufferSoup.cpp:
2652         (WebCore::SharedBuffer::maybeAppendPlatformData):
2653
2654 2014-07-09  Brent Fulgham  <bfulgham@apple.com>
2655
2656         [Win] Remove uses of 'bash' in build system
2657         https://bugs.webkit.org/show_bug.cgi?id=134782
2658         <rdar://problem/17615533>
2659
2660         Reviewed by Dean Jackson.
2661
2662         Remove uses of 'bash' by replacing Windows-specific bash scripts
2663         with Perl equivalents.
2664
2665         * WebCore.vcxproj/WebCoreGenerated.make:
2666         * WebCore.vcxproj/WebCoreGenerated.vcxproj:
2667         * WebCore.vcxproj/WebCoreGenerated.vcxproj.filters:
2668         * WebCore.vcxproj/WebCorePreBuild.cmd:
2669         * WebCore.vcxproj/build-generated-files.pl: Copied from Source/WebCore/WebCore.vcxproj/build-generated-files.sh.
2670         * WebCore.vcxproj/build-generated-files.sh: Removed.
2671         * WebCore.vcxproj/migrate-scripts.pl: Copied from Source/WebCore/WebCore.vcxproj/migrate-scripts.sh.
2672         * WebCore.vcxproj/migrate-scripts.sh: Removed.
2673
2674 2014-07-09  Anders Carlsson  <andersca@apple.com>
2675
2676         Support transparent WKWebViews
2677         https://bugs.webkit.org/show_bug.cgi?id=134779
2678         <rdar://problem/17351058>
2679
2680         Reviewed by Tim Horton.
2681
2682         Schedule rebuilding the compositing layers if a FrameView's transparency changes.
2683
2684         * page/FrameView.cpp:
2685         (WebCore::FrameView::setTransparent):
2686
2687 2014-07-09  Javier Fernandez  <jfernandez@igalia.com>
2688         CSS canvas color parsing accepts invalid color identifiers
2689         https://bugs.webkit.org/show_bug.cgi?id=134661
2690
2691         Reviewed by Benjamin Poulain.
2692
2693         Current implementation of the CSSParser::parseSystemColor assumes
2694         that if a valid cssValueKeywordID is got then it has to be a valid
2695         color. Such assumption is wrong and lead to many bugs and layout
2696         test failures.
2697
2698         The parseSystemFunction determines now whether the parsed color is
2699         valid or not.
2700
2701         Addtionally, a new method has been added to share the logic of
2702         determining whether a CSSValueID is a valid primitive values for
2703         colors or not. Generally, we should avoid passing invalid color
2704         identifiers to the theming API.
2705
2706         No new tests, but added additional cases to the
2707         canvas-color-serialization.html, test-setting-canvas-color and
2708         rgb-color-parse test.
2709
2710         * css/CSSParser.cpp:
2711         (WebCore::validPrimitiveValueColor): Added.
2712         (WebCore::parseColorValue):
2713         (WebCore::CSSParser::parseSystemColor):
2714
2715 2014-06-28  Jer Noble  <jer.noble@apple.com>
2716
2717         [MSE] http/tests/media/media-source/mediasource-remove.html is failing
2718         https://bugs.webkit.org/show_bug.cgi?id=134768
2719
2720         Reviewed by Eric Carlson.
2721
2722         Fix multiple bugs causing mediasource-remove.html to fail:
2723
2724         Separate out setDuration() into setDurationInternal() so that steps which require
2725         us to run the "duration change algorithm" don't bail out if the SoureBuffer is
2726         inside updating().
2727
2728         * Modules/mediasource/MediaSource.cpp:
2729         (WebCore::MediaSource::setDuration):
2730         (WebCore::MediaSource::setDurationInternal):
2731         * Modules/mediasource/MediaSource.h:
2732         * Modules/mediasource/SourceBuffer.cpp:
2733         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment):
2734         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
2735
2736         When removing coded frames, do so starting from the first sample in the range in
2737         decode order, so that frames dependant on removed frames are themselves removed. Add
2738         a convenience method in SampleMap findSampleWithPresentationTime(), and rename
2739         findSampleAfterPresentationTime() to findSampleOnOrAfterPresentationTime() to correctly
2740         reflect what the method does, and simplify its implementation by searching the map's keys
2741         directly.
2742
2743         * Modules/mediasource/SampleMap.cpp:
2744         (WebCore::PresentationOrderSampleMap::findSampleWithPresentationTime):
2745         (WebCore::PresentationOrderSampleMap::findSampleOnOrAfterPresentationTime):
2746         (WebCore::DecodeOrderSampleMap::findSyncSampleAfterPresentationTime):
2747         (WebCore::PresentationOrderSampleMap::findSampleAfterPresentationTime): Deleted.
2748         * Modules/mediasource/SampleMap.h:
2749         * Modules/mediasource/SourceBuffer.cpp:
2750         (WebCore::decodeTimeComparator):
2751         (WebCore::SourceBuffer::removeCodedFrames):
2752
2753         Throw the correct exception (INVALID_STATE_ERR) from SourceBuffer::remove().
2754
2755         * Modules/mediasource/SourceBuffer.cpp:
2756         (WebCore::SourceBuffer::remove):
2757
2758 2014-07-09  Pratik Solanki  <psolanki@apple.com>
2759
2760         Add SharedBuffer::wrapCFDataArray() and use it
2761         https://bugs.webkit.org/show_bug.cgi?id=134733
2762
2763         Reviewed by Antti Koivisto.
2764
2765         No new tests. Should be covered by existing tests.
2766
2767         * platform/SharedBuffer.h:
2768         * platform/cf/SharedBufferCF.cpp:
2769         (WebCore::SharedBuffer::wrapCFDataArray):
2770         (WebCore::SharedBuffer::SharedBuffer):
2771         * platform/network/ResourceHandle.h:
2772         * platform/network/cf/ResourceHandleCFNet.cpp:
2773         (WebCore::ResourceHandle::handleDataArray): Deleted.
2774         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
2775         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveDataArray):
2776         * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:
2777         (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveDataArray):
2778         * platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
2779         (-[WebCoreResourceHandleAsDelegate connection:didReceiveDataArray:]):
2780         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
2781         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveDataArray:]):
2782
2783 2014-07-09  Pratik Solanki  <psolanki@apple.com>
2784
2785         Move resource buffering from SynchronousNetworkLoaderClient to NetworkResourceLoader
2786         https://bugs.webkit.org/show_bug.cgi?id=134732
2787
2788         Reviewed by Darin Adler.
2789
2790         No new tests because no functional changes.
2791
2792         * WebCore.exp.in:
2793
2794 2014-07-09  Tim Horton  <timothy_horton@apple.com>
2795
2796         Fix the !USE(IOSURFACE) build.
2797
2798         * WebCore.exp.in:
2799
2800 2014-07-09  Tim Horton  <timothy_horton@apple.com>
2801
2802         Use IOSurface ViewSnapshots everywhere on Mac, remove JPEG encoding path
2803         https://bugs.webkit.org/show_bug.cgi?id=134773
2804
2805         Reviewed by Anders Carlsson.
2806
2807         * WebCore.exp.in:
2808         * platform/graphics/cocoa/IOSurface.h:
2809         * platform/graphics/cocoa/IOSurface.mm:
2810         (IOSurface::createFromImage):
2811         Move make-an-IOSurface-from-a-CGImageRef into WebCore::IOSurface.
2812
2813 2014-07-09  Enrica Casucci  <enrica@apple.com>
2814
2815         Implement Editor::fontAttributesForSelectionStart() or iOS.
2816         https://bugs.webkit.org/show_bug.cgi?id=134771
2817         <rdar://problem/16167838>
2818
2819         Reviewed by Ryosuke Niwa.
2820
2821         Implement for iOS the equivalent function we have for OS X.
2822
2823         * editing/ios/EditorIOS.mm:
2824         (WebCore::Editor::fontAttributesForSelectionStart):
2825
2826 2014-07-09  Brent Fulgham  <bfulgham@apple.com>
2827
2828         [Win] Remove use of 'grep' in build steps
2829         https://bugs.webkit.org/show_bug.cgi?id=134770
2830         <rdar://problem/17608783>
2831
2832         Reviewed by Tim Horton.
2833
2834         Replace uses of the grep command in Windows builds with the equivalent
2835         Perl program.
2836
2837         * WebCore.vcxproj/WebCoreGenerated.make:
2838         * WebCore.vcxproj/WebCorePreBuild.cmd:
2839         * platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp:
2840         (WebCore::WebCoreAVCFResourceLoader::notifyFinished):
2841
2842 2014-07-09  Alex Christensen  <achristensen@webkit.org>
2843
2844         Added css jit profiler, disabled by default.
2845         https://bugs.webkit.org/show_bug.cgi?id=134695
2846
2847         Reviewed by Benjamin Poulain.
2848
2849         * css/ElementRuleCollector.cpp:
2850         (WebCore::ElementRuleCollector::ruleMatches):
2851         Tell the RuleData when its compiled selector is used.
2852         * css/RuleSet.cpp:
2853         (WebCore::RuleData::RuleData):
2854         Initialize the compiled selector use count to 0.
2855         * css/RuleSet.h:
2856         (WebCore::RuleData::~RuleData):
2857         (WebCore::RuleData::compiledSelectorUsed):
2858         Count and log the number of times a compiled selector is used.
2859         * cssjit/SelectorCompiler.h:
2860         Added option for CSS_SELECTOR_JIT_PROFILING set to 0 by default.
2861         * dom/SelectorQuery.cpp:
2862         (WebCore::SelectorDataList::executeCompiledSimpleSelectorChecker):
2863         (WebCore::SelectorDataList::execute):
2864         Tell the SelectorData when its compiled selector is used.
2865         * dom/SelectorQuery.h:
2866         (WebCore::SelectorDataList::SelectorData::SelectorData):
2867         (WebCore::SelectorDataList::SelectorData::~SelectorData):
2868         (WebCore::SelectorDataList::SelectorData::compiledSelectorUsed):
2869         Count and log the number of times a compiled selector is used.
2870
2871 2014-07-09  Eric Carlson  <eric.carlson@apple.com>
2872
2873         [iOS] caption size is sometimes incorrect in fullscreen
2874         https://bugs.webkit.org/show_bug.cgi?id=134740
2875
2876         Reviewed by Jer Noble.
2877
2878         Captions on iOS are displayed in fullscreen with a TextTrackRepresentation object. Because
2879         the fullscreen video presentation is controlled by code in the UI process running on the
2880         UI thread, WebCore is notified of changes to fullscreen state asynchronously. This resulted
2881         in the TextTrackRepresentation object being created and/or destroyed too late some of the 
2882         time, which caused us to sometimes display captions incorrectly. Fix this by setting up and
2883         tearing down the TextTrackRepresentation object when WebCore's 'webkitfullscreenchange'
2884         event fires.
2885
2886         * Modules/mediacontrols/MediaControlsHost.cpp:
2887         (WebCore::MediaControlsHost::enteredFullscreen): Notify text track container.
2888         (WebCore::MediaControlsHost::exitedFullscreen): Ditto.
2889         * Modules/mediacontrols/MediaControlsHost.h:
2890         * Modules/mediacontrols/MediaControlsHost.idl:
2891
2892         * Modules/mediacontrols/mediaControlsApple.js:
2893         (Controller.prototype.handleFullscreenChange): Notify host of fullscreen change.
2894
2895         * html/HTMLMediaElement.cpp:
2896         (WebCore::HTMLMediaElement::requiresTextTrackRepresentation): Only return true when in
2897             fullscreen.
2898         (WebCore::HTMLMediaElement::setVideoFullscreenLayer): Call updateTextTrackDisplay.
2899
2900         * html/shadow/MediaControlElements.cpp:
2901         (WebCore::MediaControlTextTrackContainerElement::MediaControlTextTrackContainerElement): Initialize
2902             m_updateTextTrackRepresentationStyle to false.
2903         (WebCore::MediaControlTextTrackContainerElement::updateDisplay): Move logic for creating
2904             TextTrackRepresentation to updateTextTrackRepresentation.
2905         (WebCore::MediaControlTextTrackContainerElement::updateActiveCuesFontSize): New, split out of updateTimerFired.
2906         (WebCore::MediaControlTextTrackContainerElement::updateTimerFired): Move code to force immediate
2907             font size change to updateActiveCuesFontSize.
2908         (WebCore::MediaControlTextTrackContainerElement::updateTextTrackRepresentation): New, update
2909             text track representation, creating first if necessary.
2910         (WebCore::MediaControlTextTrackContainerElement::clearTextTrackRepresentation): Add an early
2911             return if we don't have a text track representation.
2912         (WebCore::MediaControlTextTrackContainerElement::updateStyleForTextTrackRepresentation): Early
2913             return if there is nothing to be done.
2914         (WebCore::MediaControlTextTrackContainerElement::enteredFullscreen): Force a caption update
2915             if there are visible captions.
2916         (WebCore::MediaControlTextTrackContainerElement::updateSizes): Set m_updateTextTrackRepresentationStyle
2917             to true.
2918         (WebCore::MediaControlTextTrackContainerElement::textTrackRepresentationBoundsChanged):  Force a 
2919             caption update if there are visible captions.
2920         * html/shadow/MediaControlElements.h:
2921
2922 2014-07-09  Jer Noble  <jer.noble@apple.com>
2923
2924         [MSE] http/tests/media/media-source/mediasource-endofstream-invaliderror.html is failing.
2925         https://bugs.webkit.org/show_bug.cgi?id=134413
2926
2927         Reviewed by Eric Carlson.
2928
2929         Update MediaSource.endOfStream() to take an optional enum instead of an optional String.
2930
2931         * Modules/mediasource/MediaSource.cpp:
2932         (WebCore::MediaSource::endOfStream):
2933         * Modules/mediasource/MediaSource.h:
2934         * Modules/mediasource/MediaSource.idl:
2935
2936 2014-07-08  Brady Eidson  <beidson@apple.com>
2937
2938         DOMWindows should register themselves with the GamepadManager when they have event listeners
2939         https://bugs.webkit.org/show_bug.cgi?id=134669
2940
2941         Reviewed by Dean Jackson.
2942
2943         No new tests (No effect in a currently tested config)
2944
2945         By having DOMWindows register with the GamepadManager when they have/don’t have gamepad event
2946         listeners, we accomplish two things:
2947         1 - It’s simple for GamepadManager to dispatch gamepad events directly to the DOMWindows interested.
2948         2 - We know when to start monitoring for gamepad connections.
2949
2950         * Modules/gamepad/GamepadManager.cpp:
2951         (WebCore::GamepadManager::GamepadManager):
2952         (WebCore::GamepadManager::registerNavigator):
2953         (WebCore::GamepadManager::unregisterNavigator):
2954         (WebCore::GamepadManager::registerDOMWindow):
2955         (WebCore::GamepadManager::unregisterDOMWindow):
2956         (WebCore::GamepadManager::maybeStartMonitoringGamepads): Start monitoring gamepads if there are any
2957           registered DOMWindows or NavigatorGamepads, and we aren’t already monitoring them.
2958         (WebCore::GamepadManager::maybeStopMonitoringGamepads): Stop monitoring gamepads if there aren’t any
2959           registered DOMWindows or NavigatorGameads, and we have been monitoring them before now.
2960         * Modules/gamepad/GamepadManager.h:
2961
2962         * dom/EventNames.h:
2963         (WebCore::EventNames::isGamepadEventType):
2964
2965         * page/DOMWindow.cpp:
2966         (WebCore::DOMWindow::DOMWindow):
2967         (WebCore::DOMWindow::~DOMWindow): If registered for gamepad events, unregister now.
2968         (WebCore::DOMWindow::incrementGamepadEventListenerCount): If this is the first gamepad event
2969           listener, register with the GamepadManager now.
2970         (WebCore::DOMWindow::decrementGamepadEventListenerCount): If this was the last gamepad event
2971           listener, unregister from the GamepadManager now.
2972         (WebCore::DOMWindow::addEventListener):
2973         (WebCore::DOMWindow::removeEventListener):
2974         * page/DOMWindow.h:
2975
2976 2014-07-08  Sun-woo Nam  <sunny.nam@samsung.com>
2977
2978         [EFL] Fix the build break when ENABLE_ENCRYPTED_MEDIA_V2 is turned on.
2979         https://bugs.webkit.org/show_bug.cgi?id=134750
2980
2981         Reviewed by Gyuyoung Kim.
2982
2983         When turning ENABLE_ENCRYPTED_MEDIA_V2 on, build break occurs.
2984         Some source files need to be included in CMakeLists.txt file for build.
2985         And wrap the included header file which is built only on mac and wince.
2986
2987         * CMakeLists.txt:
2988         * Modules/encryptedmedia/CDMPrivateMediaPlayer.cpp:
2989
2990 2014-07-08  Eric Carlson  <eric.carlson@apple.com>
2991
2992         [iOS] user caption preferences not applied
2993         https://bugs.webkit.org/show_bug.cgi?id=134599
2994
2995         Reviewed by Sam Weinig.
2996
2997         * page/CaptionUserPreferences.cpp:
2998         (WebCore::CaptionUserPreferences::updateCaptionStyleSheetOveride): All Pages in a PageGroup
2999         do not necessarily use the same PageUserContentController, so apply and remove caption user
3000         the style sheet directly to each page rather than to the page group.
3001
3002 2014-07-08  Commit Queue  <commit-queue@webkit.org>
3003
3004         Unreviewed, rolling out r170894.
3005         https://bugs.webkit.org/show_bug.cgi?id=134749
3006
3007         "It broke the build on mountainlion release 32bit" (Requested
3008         by mmirman on #webkit).
3009
3010         Reverted changeset:
3011
3012         "Added css jit profiler, disabled by default."
3013         https://bugs.webkit.org/show_bug.cgi?id=134695
3014         http://trac.webkit.org/changeset/170894
3015
3016 2014-07-08  Jeremy Jones  <jeremyj@apple.com>
3017
3018         WebVideoFullscreenInterfaceAVKit should lazily create m_playerController.
3019         https://bugs.webkit.org/show_bug.cgi?id=134706
3020
3021         Reviewed by Simon Fraser.
3022
3023         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
3024         (WebVideoFullscreenInterfaceAVKit::setWebVideoFullscreenModel):
3025         Don't set the delegate if m_playerController isn't created.
3026
3027 2014-07-08  Bem Jones-Bey  <bjonesbe@adobe.com>
3028
3029         Ensure we compute the height of replaced elements to 'auto' when appropriate.
3030         https://bugs.webkit.org/show_bug.cgi?id=134700
3031
3032         Reviewed by David Hyatt.
3033
3034         This fixes two issues:
3035
3036         1) If a replaced element has a percentage height specified then its
3037         height should compute to 'auto' when its containing block does not
3038         have a height 'specified explicitly'. We were taking this to mean when
3039         its containing block's specified height value is 'auto' - in fact it
3040         means when the containing block's computed height is auto.
3041
3042         2) Top and bottom on the containing block should only affect the
3043         height of the block if that block has absolute or fixed position.
3044
3045         This brings us into line with IE, Firefox, and Chrome.
3046
3047         This is a port of Blink patches by Rob Hogan and David Vest.
3048
3049         Tests: css2.1/20110323/height-percentage-005.htm
3050                fast/css/replaced-element-ignore-top-bottom.html
3051
3052         * rendering/RenderBoxModelObject.cpp:
3053         (WebCore::RenderBoxModelObject::hasAutoHeightOrContainingBlockWithAutoHeight):
3054
3055 2014-07-08  Alex Christensen  <achristensen@webkit.org>
3056
3057         Added css jit profiler, disabled by default.
3058         https://bugs.webkit.org/show_bug.cgi?id=134695
3059
3060         Reviewed by Benjamin Poulain.
3061
3062         * css/ElementRuleCollector.cpp:
3063         (WebCore::ElementRuleCollector::ruleMatches):
3064         Tell the RuleData when its compiled selector is used.
3065         * css/RuleSet.cpp:
3066         (WebCore::RuleData::RuleData):
3067         Initialize the compiled selector use count to 0.
3068         * css/RuleSet.h:
3069         (WebCore::RuleData::~RuleData):
3070         (WebCore::RuleData::compiledSelectorUsed):
3071         Count and log the number of times a compiled selector is used.
3072         * cssjit/SelectorCompiler.h:
3073         Added option for CSS_SELECTOR_JIT_PROFILING set to 0 by default.
3074         * dom/SelectorQuery.cpp:
3075         (WebCore::SelectorDataList::executeCompiledSimpleSelectorChecker):
3076         (WebCore::SelectorDataList::execute):
3077         Tell the SelectorData when its compiled selector is used.
3078         * dom/SelectorQuery.h:
3079         (WebCore::SelectorDataList::SelectorData::SelectorData):
3080         (WebCore::SelectorDataList::SelectorData::~SelectorData):
3081         (WebCore::SelectorDataList::SelectorData::compiledSelectorUsed):
3082         Count and log the number of times a compiled selector is used.
3083
3084 2014-07-08  Carlos Garcia Campos  <cgarcia@igalia.com>
3085
3086         Unreviewed. Fix GObject DOM bindings API breaks test after r170700.
3087
3088         Add missing WebKitDOMXPathNSResolver.symbols that I forgot to add
3089         in r170700.
3090
3091         * bindings/gobject/WebKitDOMXPathNSResolver.symbols: Added.
3092
3093 2014-07-07  Pratik Solanki  <psolanki@apple.com>
3094
3095         Unreviewed. iOS build fix after r170871.
3096
3097         * rendering/RenderThemeIOS.mm:
3098         (WebCore::adjustInputElementButtonStyle):
3099
3100 2014-07-07  Zalan Bujtas  <zalan@apple.com>
3101
3102         Subpixel rendering: icloud.com password arrow has clipped circle at some window sizes.
3103         https://bugs.webkit.org/show_bug.cgi?id=134710
3104         <rdar://problem/17545291>
3105
3106         Reviewed by Simon Fraser.
3107
3108         Transparent layer clipping needs device pixel snapping.
3109
3110         Test: fast/layers/wrong-clipping-semi-transparent-layer-on-subpixel-position.html
3111
3112         * rendering/RenderLayer.cpp:
3113         (WebCore::RenderLayer::beginTransparencyLayers):
3114
3115 2014-07-07  Benjamin Poulain  <benjamin@webkit.org>
3116
3117         LinkBuffer should not keep a reference to the MacroAssembler
3118         https://bugs.webkit.org/show_bug.cgi?id=134668
3119
3120         Reviewed by Geoffrey Garen.
3121
3122         * cssjit/SelectorCompiler.cpp:
3123         (WebCore::SelectorCompiler::SelectorCodeGenerator::compile):
3124
3125 2014-07-07  Zalan Bujtas  <zalan@apple.com>
3126
3127         Subpixel rendering: Inline box decoration rounds to integral.
3128         https://bugs.webkit.org/show_bug.cgi?id=134523
3129         <rdar://problem/17530298>
3130
3131         Reviewed by Darin Adler.
3132
3133         This patch removes 2 integral roundings from InlineFlowBox:
3134         1. Border and padding sizes are implicitly integral truncated by the 'int' return type
3135            of borderLogicalLeft/Right()/paddingLogicalLeft/Right(). It results in losing
3136            fractional border/padding values.
3137         2. Painting rectangle is explicitly rounded which pushes border and
3138            other decoration elements to odd device pixel positions on retina displays.
3139         These values get pixel snapped right before calling in to GraphicsContext::*.
3140
3141         Test: fast/inline/hidpi-inline-text-decoration-with-subpixel-value.html
3142
3143         * rendering/InlineBox.h:
3144         (WebCore::InlineBox::frameRect):
3145         * rendering/InlineFlowBox.cpp:
3146         (WebCore::InlineFlowBox::nodeAtPoint):
3147         (WebCore::InlineFlowBox::paintBoxDecorations):
3148         (WebCore::InlineFlowBox::paintMask):
3149         (WebCore::InlineFlowBox::roundedFrameRect): Deleted.
3150         * rendering/InlineFlowBox.h:
3151         (WebCore::InlineFlowBox::borderLogicalLeft):
3152         (WebCore::InlineFlowBox::borderLogicalRight):
3153         (WebCore::InlineFlowBox::paddingLogicalLeft):
3154         (WebCore::InlineFlowBox::paddingLogicalRight):
3155
3156 2014-07-07  Zalan Bujtas  <zalan@apple.com>
3157
3158         Pass RenderLayer reference instead of pointer to RenderLayer::paintingExtent().
3159         https://bugs.webkit.org/show_bug.cgi?id=134714
3160
3161         Reviewed by Simon Fraser.
3162
3163         No change in functionality. 
3164
3165         * rendering/RenderLayer.cpp: * -> &
3166         (WebCore::expandClipRectForRegionAndReflection):
3167         (WebCore::expandClipRectForDescendantsAndReflection):
3168         (WebCore::transparencyClipBox):
3169         (WebCore::paintingExtent):
3170         (WebCore::RenderLayer::beginTransparencyLayers):
3171         (WebCore::RenderLayer::paintTransformedLayerIntoFragments):
3172         (WebCore::RenderLayer::hitTestTransformedLayerInFragments):
3173         (WebCore::RenderLayer::paintingExtent): Deleted.
3174         * rendering/RenderLayer.h:
3175
3176 2014-07-07  Myles C. Maxfield  <mmaxfield@apple.com>
3177
3178         Remove misleadingly-named Font::isSVGFont()
3179         https://bugs.webkit.org/show_bug.cgi?id=134697
3180
3181         Reviewed by Dean Jackson.
3182
3183         Being a SVG font is a property of the FontData object, not
3184         the Font object. Providing an isSVGFont() function on the
3185         Font class will likely lead to incorrect code and non-obvious
3186         bugs.
3187
3188         No new tests because there is no behavior change.
3189
3190         * platform/graphics/Font.h:
3191         (WebCore::Font::isSVGFont): Deleted.
3192         * platform/graphics/mac/FontMac.mm:
3193         (WebCore::Font::primaryFontDataIsSystemFont):
3194         * rendering/InlineTextBox.cpp:
3195         (WebCore::InlineTextBox::constructTextRun):
3196         * rendering/RenderBlock.cpp:
3197         (WebCore::constructTextRunInternal):
3198         * rendering/SimpleLineLayout.cpp:
3199         (WebCore::SimpleLineLayout::canUseFor):
3200         * rendering/svg/SVGInlineTextBox.cpp:
3201         (WebCore::SVGInlineTextBox::constructTextRun):
3202         * rendering/svg/SVGTextMetrics.cpp:
3203         (WebCore::SVGTextMetrics::constructTextRun):
3204         (WebCore::SVGTextMetrics::SVGTextMetrics):
3205
3206 2014-07-07  Brady Eidson  <beidson@apple.com>
3207
3208         Move Gamepad index down into PlatformGamepad.
3209         https://bugs.webkit.org/show_bug.cgi?id=134670
3210
3211         Reviewed by Darin Adler.
3212
3213         PlatformGamepads always have an inherent index anyways.
3214         This will make things easier in all upcoming work.
3215
3216         * Modules/gamepad/Gamepad.cpp:
3217         (WebCore::Gamepad::Gamepad):
3218         * Modules/gamepad/Gamepad.h:
3219
3220         * Modules/gamepad/GamepadManager.cpp:
3221         (WebCore::GamepadManager::platformGamepadConnected):
3222         (WebCore::GamepadManager::platformGamepadDisconnected):
3223         (WebCore::GamepadManager::makeGamepadsVisibileToBlindNavigators):
3224         * Modules/gamepad/GamepadManager.h:
3225
3226         * Modules/gamepad/NavigatorGamepad.cpp:
3227         (WebCore::NavigatorGamepad::gamepadsBecameVisible):
3228         (WebCore::NavigatorGamepad::gamepadConnected):
3229         (WebCore::NavigatorGamepad::gamepadDisconnected):
3230         * Modules/gamepad/NavigatorGamepad.h:
3231
3232         * platform/GamepadProviderClient.h:
3233
3234         * platform/PlatformGamepad.h:
3235         (WebCore::PlatformGamepad::index):
3236         (WebCore::PlatformGamepad::PlatformGamepad):
3237
3238         * platform/mac/HIDGamepad.cpp:
3239         (WebCore::HIDGamepad::HIDGamepad):
3240         * platform/mac/HIDGamepad.h:
3241
3242         * platform/mac/HIDGamepadProvider.cpp:
3243         (WebCore::HIDGamepadProvider::deviceAdded):
3244         (WebCore::HIDGamepadProvider::deviceRemoved):
3245         (WebCore::HIDGamepadProvider::removeGamepadForDevice):
3246         * platform/mac/HIDGamepadProvider.h:
3247
3248 2014-07-07  Simon Fraser  <simon.fraser@apple.com>
3249
3250         [UI-side compositing] Support reflections on custom layers like video
3251         https://bugs.webkit.org/show_bug.cgi?id=134701
3252
3253         Reviewed by Tim Horton.
3254
3255         Add a LayerTypeWebGLLayer layer type, and support casting to PlatformCALayerRemoteCustom.
3256
3257         * WebCore.exp.in: Export PlatformCALayerMac::layerTypeForPlatformLayer(CALayer*), and sort.
3258         * platform/graphics/ca/PlatformCALayer.h:
3259         (WebCore::PlatformCALayer::isPlatformCALayerRemoteCustom):
3260         * platform/graphics/ca/mac/PlatformCALayerMac.h:
3261         * platform/graphics/ca/mac/PlatformCALayerMac.mm:
3262         (PlatformCALayerMac::layerTypeForPlatformLayer):
3263         (PlatformCALayerMac::PlatformCALayerMac):
3264         (PlatformCALayerMac::commonInit):
3265
3266 2014-07-07  Simon Fraser  <simon.fraser@apple.com>
3267
3268         [UI-side compositing] Crash when starting a filter transition on a reflected layer
3269         https://bugs.webkit.org/show_bug.cgi?id=134694
3270
3271         Reviewed by Tim Horton.
3272
3273         Don't call the owner if we failed to find the animation key (which actually
3274         isn't used by PlatformCALayerMac anyway).
3275
3276         * platform/graphics/ca/mac/PlatformCALayerMac.mm:
3277         (-[WebAnimationDelegate animationDidStart:]):
3278
3279 2014-07-07  Alex Christensen  <achristensen@webkit.org>
3280
3281         [iOS WebGL] Fix crash with too many nested glsl functions.
3282         https://bugs.webkit.org/show_bug.cgi?id=134683
3283         <rdar://problem/17541529>
3284
3285         Reviewed by Geoffrey Garen.
3286
3287         This fixes the Khronos WebGL 1.0.3 test nested-functions-should-not-crash.html.
3288
3289         * platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
3290         (WebCore::Extensions3DOpenGLCommon::getTranslatedShaderSourceANGLE):
3291         Add SH_LIMIT_CALL_STACK_DEPTH to extraCompileOptions.
3292
3293 2014-07-07  Ion Rosca  <rosca@adobe.com>
3294
3295         [CSS Blending]The background images set on the root element will blend on an initial white backdrop.
3296         https://bugs.webkit.org/show_bug.cgi?id=134342
3297
3298         Reviewed by Dean Jackson.
3299
3300         Tests: css3/blending/background-blend-mode-body-image.html
3301                css3/blending/background-blend-mode-body-transparent-color-and-image.html
3302                css3/blending/background-blend-mode-body-transparent-image.html
3303
3304         * rendering/RenderBox.cpp:
3305         (WebCore::RenderBox::paintFillLayers):
3306         If the background layers have blend modes, we paint the base background color first,
3307         before starting a new transparency layer. After creating the transparency layer,
3308         the base background will be skipped, and the background layers will blend on top of
3309         a transparent backdrop.
3310         (WebCore::RenderBox::paintFillLayer):
3311         * rendering/RenderBox.h:
3312         * rendering/RenderBoxModelObject.cpp:
3313         (WebCore::RenderBoxModelObject::paintFillLayerExtended):
3314         This method is able to paint only the base background color (BaseBackgroundColorOnly), 
3315         skipping the background-color and background-images. This option is available only
3316         on bottom layer of the root renderer and only if the background color is not opaque,
3317         otherwise the method will return early.
3318         Another option is to paint the root background without using the base background color
3319         (BaseBackgroundColorSkip).
3320         * rendering/RenderBoxModelObject.h:
3321         Adding the BaseBackgroundColorUsage enum.
3322
3323 2014-07-06  Yoav Weiss  <yoav@yoav.ws>
3324
3325         Turn on img@sizes compile flag
3326         https://bugs.webkit.org/show_bug.cgi?id=134634
3327
3328         Reviewed by Benjamin Poulain.
3329
3330         * Configurations/FeatureDefines.xcconfig: Moved compile flag to alphabetical order.
3331
3332 2014-07-06  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
3333
3334         Generate isMathMLFoo() toMathMLFoo() by using NODE_TYPE_CASTS macro and generateTypeHelpers
3335         https://bugs.webkit.org/show_bug.cgi?id=134647
3336
3337         Reviewed by Andreas Kling.
3338
3339         Use type cast macro and generation tag for isFoo() and toFoo() in some MathML classes.
3340
3341         No new tests, no behavior change.
3342
3343         * mathml/MathMLElement.h: Place MathMLElementTypeHelpers.h to the bottom of the
3344         file so that functions from that file can use the Element|Node classes and other things defined in this file.
3345         * mathml/MathMLMencloseElement.h:
3346         (WebCore::toMathMLMencloseElement): Deleted.
3347         * mathml/mathtags.in:
3348
3349 2014-07-06  Yusuke Suzuki  <utatane.tea@gmail.com>
3350
3351         CSS JIT: Ensure resolvingMode size is 1 byte
3352         https://bugs.webkit.org/show_bug.cgi?id=134662
3353
3354         Reviewed by Benjamin Poulain.
3355
3356         Since selector compiler uses MacroAssembler::branch8 for SelectorChecker::Mode,
3357         we should ensure sizeof(SelectorChecker::Mode) == 1.
3358         Old implementation works only in little endianness environments.
3359
3360         * css/ElementRuleCollector.cpp:
3361         (WebCore::ElementRuleCollector::matchedResult):
3362         (WebCore::ElementRuleCollector::matchedRuleList):
3363         (WebCore::ElementRuleCollector::collectMatchingRules):
3364         (WebCore::ElementRuleCollector::sortAndTransferMatchedRules):
3365         (WebCore::ElementRuleCollector::hasAnyMatchingRules):
3366         * css/ElementRuleCollector.h:
3367         (WebCore::ElementRuleCollector::ElementRuleCollector):
3368         * css/SelectorChecker.cpp:
3369         (WebCore::SelectorChecker::match):
3370         (WebCore::SelectorChecker::matchRecursively):
3371         (WebCore::SelectorChecker::checkOne):
3372         * css/SelectorChecker.h:
3373         * css/StyleInvalidationAnalysis.cpp:
3374         (WebCore::invalidateStyleRecursively):
3375         * css/StyleResolver.cpp:
3376         (WebCore::StyleResolver::pseudoStyleRulesForElement):
3377         * css/StyleResolver.h:
3378         (WebCore::checkRegionSelector):
3379         * cssjit/SelectorCompiler.cpp:
3380         (WebCore::SelectorCompiler::SelectorCodeGenerator::jumpIfNotResolvingStyle):
3381         (WebCore::SelectorCompiler::elementIsActiveForStyleResolution):
3382         (WebCore::SelectorCompiler::elementIsHoveredForStyleResolution):
3383         * dom/SelectorQuery.cpp:
3384         (WebCore::SelectorDataList::selectorMatches):
3385
3386 2014-07-06  Antti Koivisto  <antti@apple.com>
3387
3388         Don't throttle layer flushes when the main resource is a GIF
3389         https://bugs.webkit.org/show_bug.cgi?id=134650
3390         <rdar://problem/17490712>
3391
3392         Reviewed by Simon Fraser.
3393         
3394         Avoid throttling big image animations.
3395
3396         * page/FrameView.cpp:
3397         (WebCore::determineLayerFlushThrottleState):
3398         
3399             Disable for image documents.
3400
3401         (WebCore::FrameView::disableLayerFlushThrottlingTemporarilyForInteraction):
3402         (WebCore::FrameView::updateLayerFlushThrottling):
3403         
3404             Refactor a bit.
3405
3406         * page/LayerFlushThrottleState.h:
3407         
3408             Rename the flag.
3409
3410 2014-07-06  Andreas Kling  <akling@apple.com>
3411
3412         Inline NodeListsNodeData helpers more aggressively.
3413         <https://webkit.org/b/134654>
3414
3415         Get rid of call overhead costs when retrieving NodeLists and
3416         HTMLCollections from Document. These functions have very few clients,
3417         so there's no real reason to keep them out of line.
3418
3419         Reviewed by Antti Koivisto.
3420
3421         * dom/NodeRareData.h:
3422         (WebCore::NodeListsNodeData::addCacheWithAtomicName):
3423         (WebCore::NodeListsNodeData::addCacheWithName):
3424
3425 2014-07-06  Andreas Kling  <akling@apple.com>
3426
3427         Inline Node's rare data getters.
3428         <https://webkit.org/b/134652>
3429
3430         There was a fair bit