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