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