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