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