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