HTMLCollection caches incorrect length if item(0) is called before length on an empty...
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2015-03-29  Darin Adler  <darin@apple.com>
2
3         HTMLCollection caches incorrect length if item(0) is called before length on an empty collection
4         https://bugs.webkit.org/show_bug.cgi?id=143203
5         rdar://problem/18460462
6
7         Reviewed by Antti Koivisto.
8
9         Test: fast/dom/htmlcollection-length-after-item-2.html
10
11         * dom/CollectionIndexCache.h:
12         (CollectionIndexCache::nodeAt): If we hit the end looking for index 0, cache a length
13         of 0, not a length of 1.
14
15 2015-03-29  Darin Adler  <darin@apple.com>
16
17         Remove unneeded SVG code, including most isSupportedAttribute functions
18         https://bugs.webkit.org/show_bug.cgi?id=143194
19
20         Reviewed by Antti Koivisto.
21
22         - Removed most implementations of isSupportedAttribute. Others can be removed in
23           future patches. The ones left behind are now all private static member functions.
24           It's dangerous for them to be public because they tend to indicate which attributes
25           are supported at a particular level in the class hierarchy and they are not virtual
26           functions; might want to rethink the function name if we keep any of these long term.
27
28         - Removed unneeded includes, especially of Attr.h and Attribute.h.
29
30         - Changed most parseAttribute and svgAttributeChanged functions so they no longer
31           rely on checking attribute names against a set. Also removed lots of unneeded calls
32           to SVGLangSpace::parseAttribute, which is called by SVGElement::parseAttribute and
33           need not be called by derived classes.
34
35         - Removed return values from parseAttribute functions. Skipping other parseAttribute
36           logic is not an important optimization and makes functions needlessly complex.
37
38         - Moved use of InstanceInvalidationGuard closer to where they are needed. Eventually
39           we may be able to remove many of these.
40
41         - Used auto in a few places where the same type is repeated twice on the same line of
42           code, and auto makes it a bit smaller.
43
44         - Got rid of protected sections in some final classes; doesn't make sense to combine
45           these two. Also moved a few functions from protected to private in other classes.
46
47         - Made a number of functions into static member functions in the base classes such
48           as SVGLangSpace; they were not making any use of the object, and so it was wasteful
49           to compile them as non-static member functions.
50
51         * rendering/svg/RenderSVGImage.cpp: Removed unneeded includes.
52         * svg/SVGAElement.cpp: Removed unneeded includes.
53         (WebCore::SVGAElement::isSupportedAttribute): Deleted.
54         (WebCore::SVGAElement::parseAttribute): Don't use isSupportedAttribute.
55         (WebCore::SVGAElement::svgAttributeChanged): Don't use isSupportedAttribute.
56         * svg/SVGAElement.h: Removed isSupportedAttribute.
57         * svg/SVGAnimateMotionElement.cpp: Removed unneeded includes.
58         (WebCore::SVGAnimateMotionElement::isSupportedAttribute): Deleted.
59         (WebCore::SVGAnimateMotionElement::parseAttribute): Don't use isSupportedAttribute.
60         * svg/SVGAnimateMotionElement.h: Removed isSupportedAttribute.
61         * svg/SVGAnimateTransformElement.cpp:
62         (WebCore::SVGAnimateTransformElement::isSupportedAttribute): Deleted.
63         (WebCore::SVGAnimateTransformElement::parseAttribute): Don't use isSupportedAttribute.
64         * svg/SVGAnimateTransformElement.h: Removed isSupportedAttribute.
65         * svg/SVGAnimationElement.cpp:
66         (WebCore::SVGAnimationElement::parseAttribute): Don't use isSupportedAttribute.
67         * svg/SVGCircleElement.cpp:
68         (WebCore::SVGCircleElement::isSupportedAttribute): Deleted.
69         (WebCore::SVGCircleElement::parseAttribute): Don't use isSupportedAttribute.
70         (WebCore::SVGCircleElement::svgAttributeChanged): Don't use isSupportedAttribute.
71         * svg/SVGCircleElement.h: Removed isSupportedAttribute.
72         * svg/SVGClipPathElement.cpp: Removed unneeded includes.
73         (WebCore::SVGClipPathElement::parseAttribute): Don't use isSupportedAttribute.
74         * svg/SVGComponentTransferFunctionElement.cpp:
75         (WebCore::SVGComponentTransferFunctionElement::parseAttribute): Don't use isSupportedAttribute.
76         * svg/SVGCursorElement.cpp: Removed unneeded includes.
77         (WebCore::SVGCursorElement::parseAttribute): Don't use isSupportedAttribute.
78         (WebCore::SVGCursorElement::svgAttributeChanged): Don't use isSupportedAttribute.
79         * svg/SVGElement.cpp: Removed unneeded includes.
80         * svg/SVGEllipseElement.cpp: Removed unneeded includes.
81         (WebCore::SVGEllipseElement::isSupportedAttribute): Deleted.
82         (WebCore::SVGEllipseElement::parseAttribute): Don't use isSupportedAttribute.
83         (WebCore::SVGEllipseElement::svgAttributeChanged): Don't use isSupportedAttribute.
84         * svg/SVGEllipseElement.h: Removed isSupportedAttribute.
85         * svg/SVGExternalResourcesRequired.cpp: Removed unneeded includes.
86         (WebCore::SVGExternalResourcesRequired::parseAttribute): Don't return a boolean.
87         * svg/SVGExternalResourcesRequired.h: Don't return a boolean.
88         * svg/SVGFEBlendElement.cpp: Removed unneeded includes.
89         (WebCore::SVGFEBlendElement::isSupportedAttribute): Deleted.
90         (WebCore::SVGFEBlendElement::parseAttribute): Don't use isSupportedAttribute.
91         (WebCore::SVGFEBlendElement::svgAttributeChanged): Don't use isSupportedAttribute.
92         * svg/SVGFEBlendElement.h: Removed isSupportedAttribute.
93         * svg/SVGFEColorMatrixElement.cpp: Removed unneeded includes.
94         (WebCore::SVGFEColorMatrixElement::isSupportedAttribute): Deleted.
95         (WebCore::SVGFEColorMatrixElement::parseAttribute): Don't use isSupportedAttribute.
96         (WebCore::SVGFEColorMatrixElement::svgAttributeChanged): Don't use isSupportedAttribute.
97         * svg/SVGFEColorMatrixElement.h: Removed isSupportedAttribute.
98         * svg/SVGFEComponentTransferElement.cpp: Removed unneeded includes.
99         (WebCore::SVGFEComponentTransferElement::isSupportedAttribute): Deleted.
100         (WebCore::SVGFEComponentTransferElement::parseAttribute): Don't use isSupportedAttribute.
101         * svg/SVGFEComponentTransferElement.h: Removed unneeded includes.
102         * svg/SVGFECompositeElement.cpp: Removed unneeded includes.
103         (WebCore::SVGFECompositeElement::isSupportedAttribute): Deleted.
104         (WebCore::SVGFECompositeElement::parseAttribute): Don't use isSupportedAttribute.
105         (WebCore::SVGFECompositeElement::svgAttributeChanged): Don't use isSupportedAttribute.
106         * svg/SVGFECompositeElement.h:
107         * svg/SVGFEConvolveMatrixElement.cpp: Removed unneeded includes.
108         (WebCore::SVGFEConvolveMatrixElement::isSupportedAttribute): Deleted.
109         (WebCore::SVGFEConvolveMatrixElement::parseAttribute): Don't use isSupportedAttribute.
110         (WebCore::SVGFEConvolveMatrixElement::svgAttributeChanged): Don't use isSupportedAttribute.
111         * svg/SVGFEConvolveMatrixElement.h:
112         * svg/SVGFEDiffuseLightingElement.cpp: Removed unneeded includes.
113         (WebCore::SVGFEDiffuseLightingElement::isSupportedAttribute): Deleted.
114         (WebCore::SVGFEDiffuseLightingElement::parseAttribute): Don't use isSupportedAttribute.
115         (WebCore::SVGFEDiffuseLightingElement::svgAttributeChanged): Don't use isSupportedAttribute.
116         * svg/SVGFEDiffuseLightingElement.h:
117         * svg/SVGFEDisplacementMapElement.cpp: Removed unneeded includes.
118         (WebCore::SVGFEDisplacementMapElement::isSupportedAttribute): Deleted.
119         (WebCore::SVGFEDisplacementMapElement::parseAttribute): Don't use isSupportedAttribute.
120         (WebCore::SVGFEDisplacementMapElement::svgAttributeChanged): Don't use isSupportedAttribute.
121         * svg/SVGFEDisplacementMapElement.h:
122         * svg/SVGFEDropShadowElement.cpp: Removed unneeded includes.
123         (WebCore::SVGFEDropShadowElement::isSupportedAttribute): Deleted.
124         (WebCore::SVGFEDropShadowElement::parseAttribute): Don't use isSupportedAttribute.
125         (WebCore::SVGFEDropShadowElement::svgAttributeChanged): Don't use isSupportedAttribute.
126         * svg/SVGFEDropShadowElement.h:
127         * svg/SVGFEFloodElement.cpp: Removed unneeded includes.
128         * svg/SVGFEGaussianBlurElement.cpp: Removed unneeded includes.
129         (WebCore::SVGFEGaussianBlurElement::isSupportedAttribute): Deleted.
130         (WebCore::SVGFEGaussianBlurElement::parseAttribute): Don't use isSupportedAttribute.
131         (WebCore::SVGFEGaussianBlurElement::svgAttributeChanged): Don't use isSupportedAttribute.
132         * svg/SVGFEGaussianBlurElement.h:
133         * svg/SVGFEImageElement.cpp: Removed unneeded includes.
134         (WebCore::SVGFEImageElement::isSupportedAttribute): Deleted.
135         (WebCore::SVGFEImageElement::parseAttribute): Don't use isSupportedAttribute.
136         (WebCore::SVGFEImageElement::svgAttributeChanged): Don't use isSupportedAttribute.
137         * svg/SVGFEImageElement.h:
138         * svg/SVGFELightElement.cpp: Removed unneeded includes.
139         (WebCore::SVGFELightElement::isSupportedAttribute): Deleted.
140         (WebCore::SVGFELightElement::parseAttribute): Don't use isSupportedAttribute.
141         (WebCore::SVGFELightElement::svgAttributeChanged): Don't use isSupportedAttribute.
142         * svg/SVGFELightElement.h:
143         * svg/SVGFEMergeNodeElement.cpp: Removed unneeded includes.
144         (WebCore::SVGFEMergeNodeElement::isSupportedAttribute): Deleted.
145         (WebCore::SVGFEMergeNodeElement::parseAttribute): Don't use isSupportedAttribute.
146         (WebCore::SVGFEMergeNodeElement::svgAttributeChanged): Don't use isSupportedAttribute.
147         * svg/SVGFEMergeNodeElement.h:
148         * svg/SVGFEMorphologyElement.cpp: Removed unneeded includes.
149         (WebCore::SVGFEMorphologyElement::isSupportedAttribute): Deleted.
150         (WebCore::SVGFEMorphologyElement::parseAttribute): Don't use isSupportedAttribute.
151         (WebCore::SVGFEMorphologyElement::svgAttributeChanged): Don't use isSupportedAttribute.
152         * svg/SVGFEMorphologyElement.h:
153         * svg/SVGFEOffsetElement.cpp: Removed unneeded includes.
154         (WebCore::SVGFEOffsetElement::isSupportedAttribute): Deleted.
155         (WebCore::SVGFEOffsetElement::parseAttribute): Don't use isSupportedAttribute.
156         (WebCore::SVGFEOffsetElement::svgAttributeChanged): Don't use isSupportedAttribute.
157         * svg/SVGFEOffsetElement.h:
158         * svg/SVGFESpecularLightingElement.cpp: Removed unneeded includes.
159         (WebCore::SVGFESpecularLightingElement::isSupportedAttribute): Deleted.
160         (WebCore::SVGFESpecularLightingElement::parseAttribute): Don't use isSupportedAttribute.
161         (WebCore::SVGFESpecularLightingElement::svgAttributeChanged): Don't use isSupportedAttribute.
162         * svg/SVGFESpecularLightingElement.h:
163         * svg/SVGFETileElement.cpp: Removed unneeded includes.
164         (WebCore::SVGFETileElement::isSupportedAttribute): Deleted.
165         (WebCore::SVGFETileElement::parseAttribute): Don't use isSupportedAttribute.
166         (WebCore::SVGFETileElement::svgAttributeChanged): Don't use isSupportedAttribute.
167         * svg/SVGFETileElement.h:
168         * svg/SVGFETurbulenceElement.cpp: Removed unneeded includes.
169         (WebCore::SVGFETurbulenceElement::isSupportedAttribute): Deleted.
170         (WebCore::SVGFETurbulenceElement::parseAttribute): Don't use isSupportedAttribute.
171         (WebCore::SVGFETurbulenceElement::svgAttributeChanged): Don't use isSupportedAttribute.
172         * svg/SVGFETurbulenceElement.h:
173         * svg/SVGFilterElement.cpp: Removed unneeded includes.
174         (WebCore::SVGFilterElement::parseAttribute): Don't use isSupportedAttribute.
175         * svg/SVGFilterPrimitiveStandardAttributes.cpp: Removed unneeded includes.
176         (WebCore::SVGFilterPrimitiveStandardAttributes::parseAttribute): Don't use isSupportedAttribute.
177         * svg/SVGFilterPrimitiveStandardAttributes.h: Removed isSupportedAttribute and also moved a
178         couple functions out of the class definition.
179         * svg/SVGFitToViewBox.cpp: Removed unneeded includes.
180         * svg/SVGFontFaceElement.cpp: Removed unneeded includes.
181         * svg/SVGFontFaceUriElement.cpp: Removed unneeded includes.
182         * svg/SVGForeignObjectElement.cpp: Removed unneeded includes.
183         (WebCore::SVGForeignObjectElement::parseAttribute): Don't use isSupportedAttribute.
184         * svg/SVGGElement.cpp: Removed unneeded includes.
185         (WebCore::SVGGElement::parseAttribute): Don't use isSupportedAttribute.
186         * svg/SVGGlyphElement.cpp: Removed unneeded includes.
187         * svg/SVGGlyphRefElement.cpp: Removed unneeded includes.
188         (WebCore::SVGGlyphRefElement::hasValidGlyphElement): Rewrote to use is<> instead of hasTagName.
189         (WebCore::SVGGlyphRefElement::parseAttribute): Don't use return value from SVGURIReference::parseAttribute.
190         * svg/SVGGradientElement.cpp: Removed unneeded includes.
191         (WebCore::SVGGradientElement::parseAttribute): Don't use isSupportedAttribute.
192         * svg/SVGGraphicsElement.cpp: Removed unneeded includes.
193         (WebCore::SVGGraphicsElement::parseAttribute): Don't use isSupportedAttribute.
194         * svg/SVGImageElement.cpp: Removed unneeded includes.
195         (WebCore::SVGImageElement::parseAttribute): Don't use isSupportedAttribute.
196         * svg/SVGLangSpace.cpp: Removed unneeded includes.
197         (WebCore::SVGLangSpace::parseAttribute): Removed the return value.
198         * svg/SVGLangSpace.h: Converted functions to static member functions and removed the
199         return value from parseAttribute.
200         * svg/SVGLineElement.cpp: Removed unneeded includes.
201         (WebCore::SVGLineElement::parseAttribute): Don't use isSupportedAttribute.
202         * svg/SVGLinearGradientElement.cpp: Removed unneeded includes.
203         (WebCore::SVGLinearGradientElement::parseAttribute): Don't use isSupportedAttribute.
204         * svg/SVGMPathElement.cpp: Removed unneeded includes.
205         (WebCore::SVGMPathElement::isSupportedAttribute): Deleted.
206         (WebCore::SVGMPathElement::parseAttribute): Don't use isSupportedAttribute.
207         (WebCore::SVGMPathElement::svgAttributeChanged): Don't use isSupportedAttribute.
208         * svg/SVGMPathElement.h: Removed isSupportedAttribute and made didNotifySubtreeInsertions
209         private instead of protected.
210         * svg/SVGMarkerElement.cpp: Removed unneeded includes.
211         (WebCore::SVGMarkerElement::parseAttribute): Don't use isSupportedAttribute.
212         * svg/SVGMaskElement.cpp: Removed unneeded includes.
213         (WebCore::SVGMaskElement::parseAttribute): Don't use isSupportedAttribute.
214         * svg/SVGPathElement.cpp: Removed unneeded includes.
215         (WebCore::SVGPathElement::parseAttribute): Don't use isSupportedAttribute.
216         * svg/SVGPatternElement.cpp: Removed unneeded includes.
217         (WebCore::SVGPatternElement::parseAttribute): Don't use isSupportedAttribute.
218         * svg/SVGPolyElement.cpp: Removed unneeded includes.
219         (WebCore::SVGPolyElement::isSupportedAttribute): Deleted.
220         (WebCore::SVGPolyElement::parseAttribute): Don't use isSupportedAttribute.
221         (WebCore::SVGPolyElement::svgAttributeChanged): Don't use isSupportedAttribute.
222         * svg/SVGPolyElement.h:
223         * svg/SVGRadialGradientElement.cpp: Removed unneeded includes.
224         (WebCore::SVGRadialGradientElement::parseAttribute): Don't use isSupportedAttribute.
225         * svg/SVGRectElement.cpp: Removed unneeded includes.
226         (WebCore::SVGRectElement::isSupportedAttribute): Deleted.
227         (WebCore::SVGRectElement::parseAttribute): Don't use isSupportedAttribute.
228         (WebCore::SVGRectElement::svgAttributeChanged): Don't use isSupportedAttribute.
229         * svg/SVGRectElement.h:
230         * svg/SVGSVGElement.cpp: Removed unneeded includes.
231         (WebCore::SVGSVGElement::parseAttribute): Don't use isSupportedAttribute.
232         * svg/SVGScriptElement.cpp: Removed unneeded includes.
233         * svg/SVGStopElement.cpp: Removed unneeded includes.
234         (WebCore::SVGStopElement::isSupportedAttribute): Deleted.
235         (WebCore::SVGStopElement::parseAttribute): Don't use isSupportedAttribute.
236         (WebCore::SVGStopElement::svgAttributeChanged): Don't use isSupportedAttribute.
237         * svg/SVGStopElement.h: Removed isSupportedAttribute.
238         * svg/SVGStyleElement.cpp: Removed unneeded includes.
239         (WebCore::SVGStyleElement::isSupportedAttribute): Deleted.
240         (WebCore::SVGStyleElement::parseAttribute): Don't use isSupportedAttribute.
241         * svg/SVGStyleElement.h: Removed isSupportedAttribute.
242         * svg/SVGSymbolElement.cpp: Removed unneeded includes.
243         (WebCore::SVGSymbolElement::isSupportedAttribute): Deleted.
244         (WebCore::SVGSymbolElement::parseAttribute): Don't use isSupportedAttribute.
245         (WebCore::SVGSymbolElement::svgAttributeChanged): Don't use isSupportedAttribute.
246         * svg/SVGSymbolElement.h: Removed isSupportedAttribute.
247         * svg/SVGTRefElement.cpp: Removed unneeded includes.
248         (WebCore::SVGTRefElement::isSupportedAttribute): Deleted.
249         (WebCore::SVGTRefElement::parseAttribute): Don't use isSupportedAttribute.
250         (WebCore::SVGTRefElement::svgAttributeChanged): Don't use isSupportedAttribute.
251         * svg/SVGTRefElement.h: Removed isSupportedAttribute and made didNotifySubtreeInsertions
252         private instead of protected.
253         * svg/SVGTests.cpp: Removed unneeded includes.
254         (WebCore::SVGTests::parseAttribute): Removed return value.
255         * svg/SVGTests.h: Removed return value of parseAttribute.
256         * svg/SVGTextContentElement.cpp: Removed unneeded includes.
257         (WebCore::SVGTextContentElement::collectStyleForPresentationAttribute): Don't use
258         isSupportedAttribute. Also removed global to optimize comparing attribute value against
259         the string "preserve".
260         (WebCore::SVGTextContentElement::parseAttribute): Don't use isSupportedAttribute.
261         (WebCore::SVGTextContentElement::svgAttributeChanged): Don't use isSupportedAttribute.
262         * svg/SVGTextContentElement.h: Made isSupportedAttribute private instead of protected.
263         * svg/SVGTextElement.cpp: Removed unneeded includes.
264         * svg/SVGTextPathElement.cpp: Removed unneeded includes.
265         (WebCore::SVGTextPathElement::parseAttribute): Don't use isSupportedAttribute.
266         * svg/SVGTextPositioningElement.cpp: Removed unneeded includes.
267         (WebCore::SVGTextPositioningElement::isSupportedAttribute): Deleted.
268         (WebCore::SVGTextPositioningElement::parseAttribute): Don't use isSupportedAttribute.
269         (WebCore::SVGTextPositioningElement::svgAttributeChanged): Don't use isSupportedAttribute.
270         * svg/SVGTextPositioningElement.h: Removed isSupportedAttribute and made some functions
271         private insetad of protected.
272         * svg/SVGURIReference.cpp: Removed unneeded includes.
273         (WebCore::SVGURIReference::parseAttribute): Don't use isSupportedAttribute.
274         * svg/SVGURIReference.h:
275         (WebCore::SVGURIReference::isExternalURIReference):
276         * svg/SVGUseElement.cpp: Removed unneeded includes.
277         (WebCore::SVGUseElement::parseAttribute): Don't use isSupportedAttribute.
278         * svg/SVGViewElement.h: Removed isSupportedAttribute.
279         * svg/animation/SVGSMILElement.cpp: Removed unneeded includes.
280
281 2015-03-29  Darin Adler  <darin@apple.com>
282
283         Remove unneeded includes of "Attribute.h"
284         https://bugs.webkit.org/show_bug.cgi?id=143195
285
286         Reviewed by Antti Koivisto.
287
288         * css/StyleResolver.cpp:
289         * html/HTMLAnchorElement.cpp:
290         * html/HTMLAreaElement.cpp:
291         * html/HTMLBRElement.cpp:
292         * html/HTMLBaseElement.cpp:
293         * html/HTMLBodyElement.cpp:
294         * html/HTMLButtonElement.cpp:
295         * html/HTMLCanvasElement.cpp:
296         * html/HTMLDivElement.cpp:
297         * html/HTMLElement.cpp:
298         * html/HTMLEmbedElement.cpp:
299         * html/HTMLFontElement.cpp:
300         * html/HTMLFormControlElement.cpp:
301         * html/HTMLFormElement.cpp:
302         * html/HTMLFrameElement.cpp:
303         * html/HTMLFrameElementBase.cpp:
304         * html/HTMLFrameSetElement.cpp:
305         * html/HTMLHRElement.cpp:
306         * html/HTMLIFrameElement.cpp:
307         * html/HTMLImageElement.cpp:
308         * html/HTMLOListElement.cpp:
309         * html/HTMLOptionElement.cpp:
310         * html/HTMLParagraphElement.cpp:
311         * html/HTMLParamElement.cpp:
312         * html/HTMLPlugInElement.cpp:
313         * html/HTMLPreElement.cpp:
314         * html/HTMLProgressElement.cpp:
315         * html/HTMLScriptElement.cpp:
316         * html/HTMLSelectElement.cpp:
317         * html/HTMLStyleElement.cpp:
318         * html/HTMLTableCaptionElement.cpp:
319         * html/HTMLTableCellElement.cpp:
320         * html/HTMLTableColElement.cpp:
321         * html/HTMLTableElement.cpp:
322         * html/HTMLTablePartElement.cpp:
323         * html/HTMLTextAreaElement.cpp:
324         * html/HTMLTextFormControlElement.cpp:
325         * html/HTMLUListElement.cpp:
326         * html/HTMLVideoElement.cpp:
327         * html/parser/HTMLScriptRunner.cpp:
328         * inspector/InspectorNodeFinder.cpp:
329         Removed includes of "Attribute.h".
330
331 2015-03-28  Eric Carlson  <eric.carlson@apple.com>
332
333         [Mac] Update for output device API change
334         https://bugs.webkit.org/show_bug.cgi?id=143187
335
336         Reviewed by Zalan Bujtas.
337
338         The API used for output device is being deprecated, update to the replacement.
339
340         * WebCore.xcodeproj/project.pbxproj: Add SPI headers.
341
342         * platform/graphics/MediaPlaybackTarget.h:
343         (WebCore::MediaPlaybackTarget::MediaPlaybackTarget): Update for API change.
344         (WebCore::MediaPlaybackTarget::setDevicePickerContext):
345         (WebCore::MediaPlaybackTarget::devicePickerContext):
346
347         * platform/graphics/avfoundation/MediaPlaybackTargetMac.mm:
348         (WebCore::MediaPlaybackTarget::encode):
349         (WebCore::MediaPlaybackTarget::decode):
350
351         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.h:
352         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
353         (WebCore::MediaPlaybackTargetPickerMac::MediaPlaybackTargetPickerMac):
354         (WebCore::MediaPlaybackTargetPickerMac::~MediaPlaybackTargetPickerMac):
355         (WebCore::MediaPlaybackTargetPickerMac::outputeDeviceAvailabilityChangedTimerFired):
356         (WebCore::MediaPlaybackTargetPickerMac::devicePicker):
357         (WebCore::MediaPlaybackTargetPickerMac::currentDeviceDidChange):
358         (WebCore::MediaPlaybackTargetPickerMac::stopMonitoringPlaybackTargets):
359         (-[WebAVOutputDeviceMenuControllerHelper observeValueForKeyPath:ofObject:change:context:]):
360         (-[WebAVOutputDevicePickerMenuControllerHelper observeValueForKeyPath:ofObject:change:context:]): Deleted.
361
362         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
363         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
364         (WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad):
365         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer):
366         (WebCore::MediaPlayerPrivateAVFoundationObjC::setWirelessPlaybackTarget):
367         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
368
369         * platform/spi/cocoa/AVKitSPI.h: Copied from Source/WebCore/platform/spi/ios/AVKitSPI.h. Moved
370             from ios directory, added Mac includes and prototypes.
371         * platform/spi/ios/AVKitSPI.h: Removed.
372
373         * platform/spi/mac/AVFoundationSPI.h: Added.
374
375 2015-03-28  Simon Fraser  <simon.fraser@apple.com>
376
377         Optimize RenderLayer::intersectsDamageRect() slightly
378         https://bugs.webkit.org/show_bug.cgi?id=143186
379
380         Reviewed by Zalan Bujtas.
381
382         We can early return from RenderLayer::intersectsDamageRect() if the
383         damageRect is empty, since nothing will intersect with the empty rect.
384         
385         Slight performance gain when scrolling overflow-scroll with lots of nested,
386         clipping layers.
387
388         * rendering/RenderLayer.cpp:
389         (WebCore::RenderLayer::calculateClipRects):
390
391 2015-03-28  Anders Carlsson  <andersca@apple.com>
392
393         Remove an unused SPI method from WebKitLegacy
394         https://bugs.webkit.org/show_bug.cgi?id=143185
395
396         Reviewed by Sam Weinig.
397
398         * loader/appcache/ApplicationCacheStorage.cpp:
399         (WebCore::ApplicationCacheStorage::storeCopyOfCache): Deleted.
400         * loader/appcache/ApplicationCacheStorage.h:
401
402 2015-03-28  Joonghun Park  <jh718.park@samsung.com>
403
404         nullptr cleanup in InlineFooBox classes
405         https://bugs.webkit.org/show_bug.cgi?id=143178
406
407         Reviewed by Csaba Osztrogonác.
408
409         No new tests, no behavior changes
410
411         Replace 0 with nullptr in InlineFooBox classes.
412
413         * rendering/InlineBox.cpp:
414         (WebCore::InlineBox::prevLeafChildIgnoringLineBreak):
415         * rendering/InlineFlowBox.cpp:
416         (WebCore::InlineFlowBox::removeChild):
417         (WebCore::InlineFlowBox::deleteLine):
418         (WebCore::InlineFlowBox::placeBoxesInInlineDirection):
419         (WebCore::InlineFlowBox::addTextBoxVisualOverflow):
420         * rendering/InlineFlowBox.h:
421         (WebCore::InlineFlowBox::InlineFlowBox):
422         * rendering/InlineTextBox.h:
423         (WebCore::InlineTextBox::InlineTextBox):
424         * rendering/RootInlineBox.cpp:
425         (WebCore::RootInlineBox::getLogicalStartBoxWithNode):
426         (WebCore::RootInlineBox::getLogicalEndBoxWithNode):
427         * rendering/RootInlineBox.h:
428         * rendering/svg/SVGInlineTextBox.cpp:
429         (WebCore::SVGInlineTextBox::SVGInlineTextBox):
430         (WebCore::SVGInlineTextBox::releasePaintingResource):
431         (WebCore::SVGInlineTextBox::restoreGraphicsContextAfterTextPainting):
432         * rendering/svg/SVGRootInlineBox.cpp:
433         (WebCore::SVGRootInlineBox::closestLeafChildForPosition):
434         (WebCore::findFirstAndLastAttributesInVector):
435         * rendering/svg/SVGRootInlineBox.h:
436
437 2015-03-27  Simon Fraser  <simon.fraser@apple.com>
438
439         More modern loops in RenderLayer.cpp
440         https://bugs.webkit.org/show_bug.cgi?id=143175
441
442         Reviewed by Ryosuke Niwa.
443
444         Use modern loops in more places in RenderLayer.app.
445
446         * rendering/RenderLayer.cpp:
447         (WebCore::RenderLayer::update3DTransformedDescendantStatus):
448         (WebCore::RenderLayer::paint):
449         (WebCore::performOverlapTests):
450         (WebCore::RenderLayer::paintFixedLayersInNamedFlows):
451         (WebCore::RenderLayer::paintList):
452         (WebCore::RenderLayer::collectFragments):
453         (WebCore::RenderLayer::updatePaintingInfoForFragments):
454         (WebCore::RenderLayer::paintTransformedLayerIntoFragments):
455         (WebCore::RenderLayer::calculateClipRects):
456
457 2015-03-27  Simon Fraser  <simon.fraser@apple.com>
458
459         nullptr cleanup in RenderLayer
460         https://bugs.webkit.org/show_bug.cgi?id=143174
461
462         Reviewed by Ryosuke Niwa.
463
464         Replace 0 with nullptr in RenderLayer.cpp.
465
466         * rendering/RenderLayer.cpp:
467         (WebCore::RenderLayer::filterRenderer):
468         (WebCore::RenderLayer::updateLayerPositionsAfterLayout):
469         (WebCore::RenderLayer::updateLayerPositionsAfterOverflowScroll):
470         (WebCore::RenderLayer::positionNewlyCreatedOverflowControls):
471         (WebCore::RenderLayer::enclosingOverflowClipLayer):
472         (WebCore::RenderLayer::enclosingCompositingLayer):
473         (WebCore::RenderLayer::enclosingCompositingLayerForRepaint):
474         (WebCore::RenderLayer::enclosingFilterLayer):
475         (WebCore::RenderLayer::enclosingFilterRepaintLayer):
476         (WebCore::RenderLayer::clippingRootForPainting):
477         (WebCore::RenderLayer::transparentPaintingAncestor):
478         (WebCore::transparencyClipBox):
479         (WebCore::RenderLayer::removeChild):
480         (WebCore::RenderLayer::removeOnlyThisLayer):
481         (WebCore::RenderLayer::insertOnlyThisLayer):
482         (WebCore::accumulateOffsetTowardsAncestor):
483         (WebCore::RenderLayer::enclosingScrollableArea):
484         (WebCore::RenderLayer::enclosingPaginationLayerInSubtree):
485         (WebCore::RenderLayer::enclosingElement):
486         (WebCore::RenderLayer::enclosingFlowThreadAncestor):
487         (WebCore::RenderLayer::hitTestFixedLayersInNamedFlows):
488         (WebCore::RenderLayer::hitTestLayer):
489         (WebCore::RenderLayer::hitTestTransformedLayerInFragments):
490         (WebCore::RenderLayer::hitTestLayerByApplyingTransform):
491         (WebCore::RenderLayer::hitTestList):
492         (WebCore::RenderLayer::updateClipRects):
493         (WebCore::RenderLayer::clipRects):
494         (WebCore::RenderLayer::calculateClipRects):
495
496 2015-03-27  Gwang Yoon Hwang  <yoon@igalia.com>
497
498         [TexMap] Seperate BitmapTexture related classes implementations from TextureMapper
499         https://bugs.webkit.org/show_bug.cgi?id=142386
500
501         Reviewed by Žan Doberšek.
502
503         TextureMapper and TextureMapperGL are bloated and tightly coupled with
504         BitmapTexture. We should move these classes to seperated file of their own.
505         Also, this patch removes friend relationship from TextureMapperGL and  its
506         subsidiary classes.
507
508         The main purpose of this refactoring is to expose BitmapTexturePool to
509         renderers of platformlayers like Video and Canvas. By doing this, each
510         renderer can acquire textures from the global texture pool to paint
511         their contents directly.
512
513         No new tests needed.
514
515         * PlatformEfl.cmake:
516         * PlatformGTK.cmake:
517         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
518         Include BitmapTextureGL and BitmapTexturePool explicitly
519
520         * platform/graphics/texmap/BitmapTexture.cpp: Added.
521         * platform/graphics/texmap/BitmapTexture.h: Added.
522         (WebCore::BitmapTexture::updateContents):
523         Exclude BitmapTexture class from TextureMapper
524
525         * platform/graphics/texmap/BitmapTextureGL.cpp: Added.
526         * platform/graphics/texmap/BitmapTextureGL.h: Added.
527         Exclude BitmapTextureGL class from TextureMapperGL
528         (WebCore::BitmapTextureGL::clipStack): Added.
529         Add the getter for clipStack for TextureMapperGL
530         (WebCore::BitmapTextureGL::Bind): Deleted.
531         (WebCore::BitmapTextureGL::BindAsSurface): Added.
532         Bind used TextureMapperGL's internal data directly to compute projection matrix as a friend class,
533         However, TextureMapperGL can compute projection matrix itself after binding job, so this
534         friend ship is not needed. Also, this patch renames Bind to BindAsSurface to remove ambiguity.
535
536         * platform/graphics/texmap/BitmapTextureImageBuffer.cpp: Added.
537         * platform/graphics/texmap/BitmapTextureImageBuffer.h: Added.
538         Exclude BitmapTextureImageBuffer class from TextureMapperImageBuffer
539
540         * platform/graphics/texmap/BitmapTexturePool.cpp: Added.
541         * platform/graphics/texmap/BitmapTexturePool.h: Added.
542         Exclude BitmapTexturePool class from TextureMapperGL
543         (WebCore::BitmapTexturePool::acquireTexture):
544         Modified to use passed GraphicsContext3D instead of TextureMapperGL to remove redundant coupling
545
546         * platform/graphics/texmap/TextureMapper.cpp:
547         * platform/graphics/texmap/TextureMapper.h:
548         Remove BitmapTexturePool and BitmapTexture from its implementation.
549
550         * platform/graphics/texmap/TextureMapperGL.cpp:
551         * platform/graphics/texmap/TextureMapperGL.h:
552         Remove BitmapTextureGL from its implementation.
553         (WebCore::TextureMapperGL::TextureMapperGL):
554         (WebCore::TextureMapperGL::clipStack):
555         (WebCore::TextureMapperGL::bindSurface):
556         (WebCore::TextureMapperGL::currentSurface):
557         Add a getter of the current surface for filtering operation in BitmapTextureGL.
558         It would be clear to move filtering operation from BitmapTextureGL to TextureMapperGL later.
559
560         (WebCore::TextureMapperGL::ClipStack):
561         Move inner class declaration to public.
562
563         * platform/graphics/texmap/TextureMapperImageBuffer.cpp:
564         * platform/graphics/texmap/TextureMapperImageBuffer.h:
565         Remove BitmapTextureImageBuffer from its implementation.
566
567 2015-03-27  Tim Horton  <timothy_horton@apple.com>
568
569         WebProcess started by editable WKWebView spends 15% of its initialization time loading DataDetectors
570         https://bugs.webkit.org/show_bug.cgi?id=143142
571         <rdar://problem/20324495>
572
573         Reviewed by Anders Carlsson.
574
575         Calling DataDetectorsLibrary() is expensive; we should avoid doing it
576         until actually necessary. When loading a page that makes a caret selection,
577         ServicesOverlayController was calling DataDetectorsLibrary() (ignoring the fact
578         that a caret selection can't have any services associated with it) to avoid
579         crashing on systems where DataDetectors is not available. Instead, we should
580         first check if there's anything to do, and then check for the existence
581         of DataDetectors.
582
583         * page/mac/ServicesOverlayController.mm:
584         (WebCore::ServicesOverlayController::buildPhoneNumberHighlights):
585         Build the list of phone number ranges, and bail (clearing the potential highlights)
586         if it is empty, before calling DataDetectorsLibrary().
587
588         (WebCore::ServicesOverlayController::buildSelectionHighlight):
589         Check the list of selection rects, and bail (clearing the potential highlights)
590         if it is empty, before calling DataDetectorsLibrary().
591
592 2015-03-27  Jer Noble  <jer.noble@apple.com>
593
594         [Mac] Safari fails to fire page "load" event with video[preload=none]
595         https://bugs.webkit.org/show_bug.cgi?id=143147
596
597         Reviewed by Simon Fraser.
598
599         Test: media/video-page-load-preload-none.html
600
601         When told to load() when preload == None, set the networkState to Idle.
602         This causes HTMLMediaElement to set the shouldDelayLoadEvent flag to
603         false, and allows the page's 'load' event to fire.
604
605         Drive-by fix: add setNetworkState() and setReadyState() methods to
606         MediaPlayerPrivateAVFoundation, reducing a bunch of code duplication.
607
608         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
609         (WebCore::MediaPlayerPrivateAVFoundation::load):
610         (WebCore::MediaPlayerPrivateAVFoundation::setNetworkState):
611         (WebCore::MediaPlayerPrivateAVFoundation::setReadyState):
612         (WebCore::MediaPlayerPrivateAVFoundation::updateStates):
613         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
614
615 2015-03-27  Alexey Proskuryakov  <ap@apple.com>
616
617         Calling crypto.webkitSubtle.generateKey causes page memory to never be released
618         https://bugs.webkit.org/show_bug.cgi?id=143151
619         rdar://problem/18940687
620
621         Reviewed by Tim Horton.
622
623         * crypto/mac/CryptoKeyRSAMac.cpp: (WebCore::CryptoKeyRSA::generatePair): Don't.
624
625 2015-03-27  Brent Fulgham  <bfulgham@apple.com>
626
627         Null dereference in InbandMetadataTextTrack handling
628         https://bugs.webkit.org/show_bug.cgi?id=143144
629         <rdar://problem/18983250>
630
631         Reviewed by Eric Carlson.
632
633         * platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.cpp:
634         (WebCore::InbandMetadataTextTrackPrivateAVF::updatePendingCueEndTimes): Check for null return value from
635         'client()', just like we do in all other methods.
636
637 2015-03-27  Oliver Hunt  <oliver@apple.com>
638
639         Forward additional CFNetwork ATS information to child processes
640         https://bugs.webkit.org/show_bug.cgi?id=143136
641
642         Reviewed by Anders Carlsson.
643
644         Declare SPI.
645
646         * platform/spi/cf/CFNetworkSPI.h:
647
648 2015-03-27  Chris Dumez  <cdumez@apple.com>
649
650         [WK2][NetworkCache] We only cache responses with status codes that are cacheable by default
651         https://bugs.webkit.org/show_bug.cgi?id=143125
652         <rdar://problem/20321172>
653
654         Reviewed by Antti Koivisto.
655
656         Export a couple of extra symbols.
657
658         * platform/network/ResourceResponseBase.h:
659
660 2015-03-27  Jer Noble  <jer.noble@apple.com>
661
662         HTMLMediaElement will fire 'seeked' before seek completes, leading to currentTime discontinuities.
663         https://bugs.webkit.org/show_bug.cgi?id=143132
664
665         Reviewed by Eric Carlson.
666
667         When seeking, if the ready state rises to >= HAVE_CURRENT_DATA, we will fire the 'seeked'
668         event and continue playback. However, if a media engine updates the ready state before its
669         seek operation actually completes, the currentTime it returns may still be the time before
670         the seek.
671
672         Wait until both the ready state rises to HAVE_CURRENT_DATA and m_player->seeking() returns
673         false before firing the 'seeked' event.
674
675         * html/HTMLMediaElement.cpp:
676         (WebCore::HTMLMediaElement::parseAttribute):
677
678 2015-03-26  Geoffrey Garen  <ggaren@apple.com>
679
680         Make some more objects use FastMalloc
681         https://bugs.webkit.org/show_bug.cgi?id=143122
682
683         Reviewed by Csaba Osztrogonác.
684
685         * Modules/geolocation/GeolocationController.h:
686         * Modules/geolocation/NavigatorGeolocation.h:
687         * Modules/indexeddb/DOMWindowIndexedDatabase.h:
688         * Modules/notifications/NotificationController.h:
689         * Modules/webdatabase/DatabaseServer.h:
690         * css/CSSFontFaceSource.h:
691         * html/HTMLMediaSession.h:
692         * inspector/InspectorIndexedDBAgent.h:
693         * inspector/InspectorReplayAgent.h:
694         * page/CaptionUserPreferencesMediaAF.h:
695         * page/PageConsoleClient.h:
696         * page/PageDebuggable.h:
697         * page/animation/CSSPropertyAnimation.cpp:
698         * page/mac/ServicesOverlayController.h:
699         * platform/RemoteCommandListener.h:
700         * platform/Timer.h:
701         * platform/audio/MediaSessionManager.h:
702         * platform/mac/SystemSleepListenerMac.h:
703         * platform/mac/ThemeMac.h:
704         * rendering/svg/RenderSVGResourceSolidColor.h:
705         * replay/ReplayController.h:
706
707 2015-03-27  Said Abou-Hallawa  <sabouhallawa@apple.com>
708
709         FEMorphology::platformApplyGeneric() should bail out if the radius is less than or equal to zero.
710         https://bugs.webkit.org/show_bug.cgi?id=142885.
711
712         Reviewed by Dean Jackson.
713
714         FEMorphology class implementation code clean up.
715         
716         Tests: svg/filters/feMorphology-radius-cases.svg
717
718         * platform/graphics/filters/FEMorphology.cpp:
719         (WebCore::shouldSupersedeExtremum): Reuse code instead of repeating it and
720         use < and > instead of =< and >=.
721         
722         (WebCore::pixelArrayIndex): Returns the array index of a pixel in an image
723         buffer, given: position(x, y), image width and the color channel.
724         
725         (WebCore::columnExtremum): Returns the extremum of a column of pixels.
726         
727         (WebCore::kernelExtremum): Returns the extremum of a filter kernel.
728         
729         (WebCore::FEMorphology::platformApplyGeneric): Apply some code clean-up.
730         The kernel size should be equal to radius of the filter. The extra pixel
731         was causing the resulted image to be asymmetric in some cases.
732         
733         (WebCore::FEMorphology::platformApplyDegenerate):
734         (WebCore::FEMorphology::platformApplySoftware): After applying scaling, we
735         still need to check the resulted radius is negative (overflow case) or less
736         than one (zero radius case) and treat these cases differently.
737         
738         (WebCore::FEMorphology::morphologyOperator): Deleted.
739         (WebCore::FEMorphology::radiusX): Deleted.
740         (WebCore::FEMorphology::radiusY): Deleted.
741         * platform/graphics/filters/FEMorphology.h:
742         (WebCore::FEMorphology::morphologyOperator):
743         (WebCore::FEMorphology::radiusX):
744         (WebCore::FEMorphology::radiusY):
745         Move a single line functions from the source file to the header file.
746
747 2015-03-27  Antti Koivisto  <antti@apple.com>
748
749         Move CacheValidation to platform
750         https://bugs.webkit.org/show_bug.cgi?id=143133
751
752         Reviewed by Chris Dumez.
753
754         It deals with platform types only and is currently violating layering.
755
756         * WebCore.xcodeproj/project.pbxproj:
757         * loader/cache/CacheValidation.cpp: Removed.
758         * loader/cache/CacheValidation.h: Removed.
759         * platform/network/CacheValidation.cpp: Copied from Source/WebCore/loader/cache/CacheValidation.cpp.
760         * platform/network/CacheValidation.h: Copied from Source/WebCore/loader/cache/CacheValidation.h.
761
762 2015-03-27  Commit Queue  <commit-queue@webkit.org>
763
764         Unreviewed, rolling out r177896.
765         https://bugs.webkit.org/show_bug.cgi?id=142978
766
767         Loading libgstclutter.so in-process hangs web process
768         (Requested by mcatanzaro on #webkit).
769
770         Reverted changeset:
771
772         "[GStreamer] Disable gst-plugin-scanner if seccomp filters are
773         enabled"
774         https://bugs.webkit.org/show_bug.cgi?id=140069
775         http://trac.webkit.org/changeset/177896
776
777 2015-03-26  Antti Koivisto  <antti@apple.com>
778
779         Respect cache-control directives in request
780         https://bugs.webkit.org/show_bug.cgi?id=143121
781         rdar://problem/19714040
782
783         Reviewed by Chris Dumez.
784
785         Test: http/tests/cache/disk-cache/disk-cache-request-headers.html
786
787         * loader/cache/CacheValidation.cpp:
788         (WebCore::isCacheHeaderSeparator):
789         (WebCore::isControlCharacter):
790         (WebCore::trimToNextSeparator):
791         (WebCore::parseCacheHeader):
792         (WebCore::parseCacheControlDirectives):
793
794             Factor Cache-control parsing here so it can be used for both requests and responses.
795
796         * loader/cache/CacheValidation.h:
797         * platform/network/ResourceRequestBase.h:
798         * platform/network/ResourceResponseBase.cpp:
799         (WebCore::ResourceResponseBase::ResourceResponseBase):
800         (WebCore::ResourceResponseBase::parseCacheControlDirectives):
801         (WebCore::ResourceResponseBase::cacheControlContainsNoCache):
802         (WebCore::ResourceResponseBase::cacheControlContainsNoStore):
803         (WebCore::ResourceResponseBase::cacheControlContainsMustRevalidate):
804         (WebCore::ResourceResponseBase::cacheControlMaxAge):
805         (WebCore::isCacheHeaderSeparator): Deleted.
806         (WebCore::isControlCharacter): Deleted.
807         (WebCore::trimToNextSeparator): Deleted.
808         (WebCore::parseCacheHeader): Deleted.
809         * platform/network/ResourceResponseBase.h:
810
811 2015-03-27  Víctor Manuel Jáquez Leal  <vjaquez@igalia.com>
812
813         [GStreamer] share GL context in pipeline, part 2
814         https://bugs.webkit.org/show_bug.cgi?id=143049
815
816         Reviewed by Carlos Garcia Campos.
817
818         This patch, instead of cluttering the GstGL attributes creation in
819         ::handleSyncMessage(), creates a new method ::ensureGstGLContext(),
820         where those attributes are defined. This method is guarded by
821         USE(GSTREAMER_GL)
822
823         ::handlSyncMessage() shall return nothing, according to GStreamer
824         documentation, not a boolean.
825
826         The GstGL attributes are now GRefPtr<> to avoid memory leaks.
827
828         The GstGLAPI and GstGLPlatform are now set given by the pre-processor
829         directives, and the code in ::ensureGstGLContext() is simpler.
830
831         No new tests because this is platform specific and it depends in the
832         run-time availability and configurations of GstGL elements.
833
834         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
835         (WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer):
836         Don't initialise the GstGL attributes since are GRefPtr<>
837         (WebCore::MediaPlayerPrivateGStreamer::handleSyncMessage): Changed the
838         signature to use void instead of gboolean.
839         (WebCore::MediaPlayerPrivateGStreamer::ensureGstGLContext): New method.
840         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
841
842 2015-03-26  Jeremy Jones  <jeremyj@apple.com>
843
844         Optimized Fullscreen fails to cleanup because of no longer necessary release of m_playerController in exitFullscreen()
845         https://bugs.webkit.org/show_bug.cgi?id=143120
846
847         Reviewed by Eric Carlson.
848
849         We used to release m_playerController in WebVideoFullscreenInterfaceAVKit::exitFullscreen() in order to make sure 
850         media state was reset. This is no longer necessary as we now have a way the model can explicitly request resetting the
851         media state via resetMediaState(). m_playerController is already released in 
852         WebVideoFullscreenInterfaceAVKit::cleanupFullscreenInternal(). Releasing it prematurely can actually prevent the exit
853         fullscreen process from completing successfully.
854
855         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
856         (WebVideoFullscreenInterfaceAVKit::exitFullscreen):
857
858 2015-03-26  Zalan Bujtas  <zalan@apple.com>
859
860         Inline continuation code should not take anonymous containing wrapper granted.
861         https://bugs.webkit.org/show_bug.cgi?id=133312
862
863         Reviewed by Dave Hyatt.
864
865         It's wrong to assume that when RenderInline is part of an inline continuation, its containing block
866         is an anonymous wrapper and its sibling might be a block level renderer.
867         When the inline continuation is no longer needed, for example when the block level renderer that initiated the continuation
868         is detached from the render tree, the inline renderes still continue to form continuation.(however they no longer require
869         anonymous wrappers)
870
871         Test: fast/inline/crash-when-position-property-is-changed-and-no-longer-in-continuation.html
872
873         * rendering/RenderInline.cpp:
874         (WebCore::updateStyleOfAnonymousBlockContinuations):
875         (WebCore::RenderInline::styleDidChange):
876
877 2015-03-26  Tim Horton  <timothy_horton@apple.com>
878
879         REGRESSION (r181358 and r181507): Lots of sites think that we support touch events on OS X
880         https://bugs.webkit.org/show_bug.cgi?id=142888
881         <rdar://problem/20227304>
882
883         Reviewed by Beth Dakin.
884
885         * dom/Document.idl:
886         * dom/Element.idl:
887         * html/HTMLBodyElement.idl:
888         * html/HTMLFrameSetElement.idl:
889         * page/DOMWindow.idl:
890         Re-conditionalize a lot of event listeners; sites test ("ontouchstart" in window), which
891         is not covered by NotEnumerable, and so r181358 and r181507 broke a bunch of sites
892         (apple.com, blaze.com, anything using nicescroll.js, etc.) by causing them to think
893         that (Mac) Safari was touch-enabled.
894
895 2015-03-26  Geoffrey Garen  <ggaren@apple.com>
896
897         "lineNo" does not match WebKit coding style guidelines
898         https://bugs.webkit.org/show_bug.cgi?id=143119
899
900         Reviewed by Michael Saboff.
901
902         We can afford to use whole words.
903
904         * bindings/js/JSLazyEventListener.cpp:
905         (WebCore::JSLazyEventListener::initializeJSFunction):
906         * bindings/js/JSMainThreadExecStateInstrumentation.h:
907         (WebCore::JSMainThreadExecState::instrumentFunctionCall):
908         * inspector/InspectorDOMAgent.cpp:
909         (WebCore::InspectorDOMAgent::buildObjectForEventListener):
910         * testing/Internals.cpp:
911         (WebCore::Internals::parserMetaData):
912
913 2015-03-26  Roger Fong  <roger_fong@apple.com>
914
915         Apply blur effect to media control background.
916         https://bugs.webkit.org/show_bug.cgi?id=143116.
917         <rdar://problem/20316964>.
918
919         Reviewed by Brent Fulgham.
920
921         There are still a few issues, like the borders of the controls being blurred with black,
922         and the volume slider background not showing the blur effect. Will fix those separately.
923
924         Add CSS for new divs to create blur effect using back drop filters and blend modes.
925         * Modules/mediacontrols/mediaControlsApple.css:
926         (audio::-webkit-media-controls-panel):
927         (audio::-webkit-media-controls-panel-tint):
928         (audio::-webkit-media-controls-panel-background):
929         (audio::-webkit-media-controls-panel .volume-box):
930         (audio::-webkit-media-controls-volume-slider-container-background):
931         (audio::-webkit-media-controls-volume-slider-container-tint):
932         (audio::-webkit-media-controls-toggle-closed-captions-button): Adjust fill.
933         (audio::-webkit-media-controls-fullscreen-button): Adjust fill.
934         (audio::-webkit-media-controls-fullscreen-button.exit): Adjust fill.
935         (video:-webkit-full-screen::-webkit-media-controls-panel):
936         (audio:-webkit-full-screen::-webkit-media-controls-panel-tint):
937         (audio:-webkit-full-screen::-webkit-media-controls-panel-background):
938         (video:-webkit-full-screen::-webkit-media-controls-panel .volume-box):
939         (video:-webkit-full-screen::-webkit-media-controls-play-button):
940         (video:-webkit-full-screen::-webkit-media-controls-seek-back-button):
941         (video:-webkit-full-screen::-webkit-media-controls-seek-forward-button):
942         (video:-webkit-full-screen::-webkit-media-controls-timeline-container):
943         (video:-webkit-full-screen::-webkit-media-controls-status-display):
944         (audio::-webkit-media-controls-panel .volume-box:active): Deleted.
945         * Modules/mediacontrols/mediaControlsApple.js:
946         (Controller.prototype.createControls):
947         (Controller.prototype.configureInlineControls): Add new divs for blurred background effect.
948         (Controller.prototype.configureFullScreenControls): Ditto.
949         (Controller.prototype.handlePanelMouseDown): The tint div is now in front.
950         (Controller.prototype.drawTimelineBackground): Adjust colors to make border look better with new background.
951         (Controller.prototype.drawVolumeBackground): Ditto.
952
953 2015-03-26  Geoffrey Garen  <ggaren@apple.com>
954
955         Assertion firing in JavaScriptCore/parser/parser.h for statesman.com site
956         https://bugs.webkit.org/show_bug.cgi?id=142974
957
958         Reviewed by Joseph Pecoraro.
959
960         * bindings/js/JSLazyEventListener.cpp:
961         (WebCore::JSLazyEventListener::initializeJSFunction): Use the new override
962         line number API to guarantee that errors will map to the .html file locations
963         that we like.
964
965         * bindings/js/ScriptController.cpp:
966         (WebCore::ScriptController::eventHandlerPosition): Added a FIXME to cover
967         some cases where our line and column numbers are still nonsense.
968
969 2015-03-26  Beth Dakin  <bdakin@apple.com>
970
971         Relevant repainted objects callback is inaccurate and inconsistent for PDF 
972         documents
973         https://bugs.webkit.org/show_bug.cgi?id=143118
974         -and corresponding-
975         rdar://problem/13371582
976
977         Reviewed by Tim Horton.
978
979         Investigating this bug resulted in finding two things that should change for the 
980         relevant repainted objects heuristic. First, we should not count any objects 
981         painted while updating control tints. And secondly, we should not use it at all 
982         for plugin documents. In other documents, we count the plugin area as “painted” 
983         when we get to paint whether or not the plugin has actually loaded. This is 
984         intentional because it allows us to account for chunks of the page that will be 
985         filled in by possibly slow-loading ads. However, if the plugin is the whole 
986         document, then the heuristic just doesn’t make any sense and it leads to 
987         inconsistent behavior at different window sizes. So we’ll only count plugins when 
988         the document is not a plugin document. 
989
990         Don’t count objects during this paint!
991         * page/FrameView.cpp:
992         (WebCore::FrameView::updateControlTints):
993         * page/Page.h:
994         (WebCore::Page::setIsCountingRelevantRepaintedObjects):
995
996         Make sure the document is not a plugin document.
997         * rendering/RenderEmbeddedObject.cpp:
998         (WebCore::RenderEmbeddedObject::paint):
999
1000 2015-03-26  Alex Christensen  <achristensen@webkit.org>
1001
1002         Progress towards CMake on Mac.
1003         https://bugs.webkit.org/show_bug.cgi?id=143112
1004
1005         Reviewed by Chris Dumez.
1006
1007         * CMakeLists.txt:
1008         * PlatformEfl.cmake:
1009         * PlatformGTK.cmake:
1010         * PlatformMac.cmake:
1011         * platform/graphics/mac/IconMac.mm:
1012
1013 2015-03-26  Jer Noble  <jer.noble@apple.com>
1014
1015         [iOS] Accessibility crashing because MediaPlayer is laying out UI off the main thread
1016         https://bugs.webkit.org/show_bug.cgi?id=142970
1017
1018         Reviewed by Eric Carlson.
1019
1020         isMainThread() will (ironically) return true if called from the web thread. Rather than dispatch
1021         synchronously to the main thread to allocate the _volumeView, dispatch asynchronously and handle
1022         the case where the MPVolumeView has not yet been created.
1023
1024         * platform/audio/ios/MediaSessionManagerIOS.mm:
1025         (-[WebMediaSessionHelper allocateVolumeView]): Dispatch to the main thread to allocate. Move notification
1026             registration to -setVolumeView:.
1027         (-[WebMediaSessionHelper setVolumeView:]): Added. Register/Unregister for route availablitiy notifications.
1028         (-[WebMediaSessionHelper hasWirelessTargetsAvailable]): Handle the possibility of a nil _volumeView.
1029
1030 2015-03-26  Benjamin Poulain  <bpoulain@apple.com>
1031
1032         Fix state maching debugging after r181964
1033         https://bugs.webkit.org/show_bug.cgi?id=143082
1034
1035         Reviewed by Alex Christensen.
1036
1037         * contentextensions/ContentExtensionCompiler.cpp:
1038         (WebCore::ContentExtensions::compileRuleList):
1039
1040 2015-03-25  David Hyatt  <hyatt@apple.com>
1041
1042         Improve the offsetWidth/Height layout optimization
1043         https://bugs.webkit.org/show_bug.cgi?id=143008
1044
1045         Reviewed by Zalan Bujtas.
1046
1047         * dom/Document.cpp:
1048         (WebCore::Document::updateLayoutIfDimensionsOutOfDate):
1049         * dom/Document.h:
1050         Change Element* to Element&. Clean up the dimension bits to use shifting. Remove both the inline and
1051         the positioning restrictions on the optimization check.
1052
1053         * dom/Element.cpp:
1054         (WebCore::Element::offsetWidth):
1055         (WebCore::Element::offsetHeight):
1056         Change to use Element& instead of Element*.
1057
1058         (WebCore::Element::clientWidth):
1059         (WebCore::Element::clientHeight):
1060         (WebCore::Element::scrollWidth):
1061         (WebCore::Element::scrollHeight):
1062         Turn on the optimization for clientWidth/Height and scrollWidth/Height.
1063
1064 2015-03-26  Brady Eidson  <beidson@apple.com>
1065
1066         Apply ContentExtension actions after redirects.
1067         <rdar://problem/20062613> and https://bugs.webkit.org/show_bug.cgi?id=143055
1068
1069         Reviewed by Alex Christensen.
1070
1071         Tests: http/tests/contentextensions/loading/main-resource-redirect-blocked.php
1072                http/tests/contentextensions/subresource-redirect-blocked.html
1073
1074         This patch moves the "run a URL against the content extension" code from CachedResourceLoader to
1075         the ContentExtensionsBackend.
1076
1077         That allows it to be shared between the CachedResourceLoader where loads are initiated and 
1078         ResourceLoader where redirects are handled.
1079
1080         * contentextensions/ContentExtension.cpp:
1081         (WebCore::ContentExtensions::ContentExtension::globalDisplayNoneStyleSheet):
1082
1083         * contentextensions/ContentExtensionsBackend.cpp:
1084         (WebCore::ContentExtensions::ContentExtensionsBackend::processContentExtensionRulesForLoad):
1085         (WebCore::ContentExtensions::ContentExtensionsBackend::displayNoneCSSRule):
1086         * contentextensions/ContentExtensionsBackend.h:
1087
1088         * loader/NetscapePlugInStreamLoader.cpp:
1089         (WebCore::NetscapePlugInStreamLoader::NetscapePlugInStreamLoader):
1090
1091         * loader/ResourceLoadInfo.h:
1092
1093         * loader/ResourceLoader.cpp:
1094         (WebCore::ResourceLoader::ResourceLoader):
1095         (WebCore::ResourceLoader::willSendRequest):
1096         * loader/ResourceLoader.h:
1097
1098         * loader/SubresourceLoader.cpp:
1099         (WebCore::SubresourceLoader::SubresourceLoader):
1100
1101         * loader/cache/CachedResourceLoader.cpp:
1102         (WebCore::CachedResourceLoader::requestResource):
1103
1104         * page/UserContentController.cpp:
1105         (WebCore::UserContentController::processContentExtensionRulesForLoad):
1106         (WebCore::UserContentController::actionsForResourceLoad): Deleted.
1107         (WebCore::UserContentController::globalDisplayNoneStyleSheet): Deleted.
1108         (WebCore::UserContentController::displayNoneCSSRule): Deleted.
1109         * page/UserContentController.h:
1110
1111 2015-03-26  Myles C. Maxfield  <mmaxfield@apple.com>
1112
1113         Crash when laying out (char)0
1114         https://bugs.webkit.org/show_bug.cgi?id=143103
1115
1116         Reviewed by Dean Jackson.
1117
1118         We currently cache a character -> Font mapping in a HashMap.
1119         However, keys in Hashmaps can't be 0. This patch simply skips
1120         the cache in this case.
1121
1122         No new tests, for now. I'm having trouble creating a test because
1123         the site that causes this bug generates their page using script,
1124         and the script is all minified, and difficult to understand. I
1125         will contact the owner of the site and ask for and unminified
1126         version of their sources. However, I don't want to that to block
1127         this tiny fix from going in.
1128
1129         * platform/graphics/Font.cpp:
1130         (WebCore::Font::systemFallbackFontForCharacter):
1131
1132 2015-03-26  Jer Noble  <jer.noble@apple.com>
1133
1134         [Mac][EME] Crash at com.apple.WebCore: WebCore::CDMSessionMediaSourceAVFObjC::releaseKeys + 177
1135         https://bugs.webkit.org/show_bug.cgi?id=143080
1136
1137         Reviewed by Eric Carlson.
1138
1139         Null-check m_certificate before dereferencing.
1140
1141         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm:
1142         (WebCore::CDMSessionMediaSourceAVFObjC::releaseKeys):
1143
1144 2015-03-26  Chris Fleizach  <cfleizach@apple.com>
1145
1146         AX: [role="button"][aria-pressed] should be exposed as AXCheckbox:AXToggleButton, with role description of "toggle button"
1147         https://bugs.webkit.org/show_bug.cgi?id=115298
1148
1149         Reviewed by Mario Sanchez Prada.
1150
1151         A role=button + aria-pressed object should be exposed as AXCheckbox on Mac now. It should also convert the
1152         aria-pressed state into a 0, 1, 2 number value for the Mac.
1153
1154         Test: platform/mac/accessibility/aria-pressed-button-attributes.html
1155
1156         * accessibility/AccessibilityObject.cpp:
1157         (WebCore::AccessibilityObject::checkboxOrRadioValue):
1158         * accessibility/AccessibilityObject.h:
1159         (WebCore::AccessibilityObject::isToggleButton):
1160         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1161         (-[WebAccessibilityObjectWrapper additionalAccessibilityAttributeNames]):
1162         (createAccessibilityRoleMap):
1163         (-[WebAccessibilityObjectWrapper subrole]):
1164         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
1165
1166 2015-03-25  Dean Jackson  <dino@apple.com>
1167
1168         CSS blend modes do not parse when in the shadow tree
1169         https://bugs.webkit.org/show_bug.cgi?id=143067
1170         <rdar://problem/20302662>
1171
1172         Reviewed by Anders Carlson.
1173
1174         The media controls style sheets are injected as UA stylesheets
1175         when we come across a <video> or <audio> element. These stylesheets
1176         have a different parsing context than the document stylesheets -
1177         one that uses the default constructor, which initializes some
1178         features like cssCompositingEnabled to false without checking
1179         the runtime state.
1180
1181         The easy fix is to use the global state to initialize the context.
1182
1183         Unfortunately we can't test this since it only occurs in the shadow
1184         tree.
1185
1186         * css/CSSParser.cpp:
1187         (WebCore::CSSParserContext::CSSParserContext): Check the state
1188         of RuntimeEnabledFeatures to initialize CSS Regions and
1189         CSS Compositing (Blending).
1190
1191 2015-03-25  Chris Fleizach  <cfleizach@apple.com>
1192
1193         AX: table cells that use display:block render the table inaccessible to VoiceOver
1194         https://bugs.webkit.org/show_bug.cgi?id=143007
1195
1196         Reviewed by Mario Sanchez Prada.
1197
1198         When display:block is used on a table cell, it was being ignored because it was anonymous.
1199         This is still a valid scenario however if it's still inside of a valid table.
1200
1201         Test: accessibility/table-cell-display-block.html
1202
1203         * accessibility/AccessibilityTableCell.cpp:
1204         (WebCore::AccessibilityTableCell::computeAccessibilityIsIgnored):
1205
1206 2015-03-25  Tim Horton  <timothy_horton@apple.com>
1207
1208         Add a preference to prevent "user-scalable=no" from having any effect
1209         https://bugs.webkit.org/show_bug.cgi?id=143032
1210
1211         Reviewed by Sam Weinig.
1212
1213         * page/ViewportConfiguration.cpp:
1214         (WebCore::ViewportConfiguration::ViewportConfiguration):
1215         (WebCore::ViewportConfiguration::allowsUserScaling):
1216         * page/ViewportConfiguration.h:
1217         (WebCore::ViewportConfiguration::setForceAlwaysUserScalable):
1218         If forceAlwaysUserScalable is set to true, force "user-scalable=yes".
1219
1220 2015-03-25  Dan Bernstein  <mitz@apple.com>
1221
1222         Another attempt to get the iOS EWS building again.
1223
1224         * WebCore.xcodeproj/project.pbxproj:
1225
1226 2015-03-25  Alex Christensen  <achristensen@webkit.org>
1227
1228         Add case-insensitive checks to DFA bytecode.
1229         https://bugs.webkit.org/show_bug.cgi?id=142977
1230
1231         Reviewed by Benjamin Poulain.
1232
1233         * contentextensions/DFABytecode.h:
1234         (WebCore::ContentExtensions::instructionSizeWithArguments):
1235         * contentextensions/DFABytecodeCompiler.cpp:
1236         (WebCore::ContentExtensions::DFABytecodeCompiler::emitCheckValue):
1237         (WebCore::ContentExtensions::DFABytecodeCompiler::emitCheckValueRange):
1238         Add case-insensitive bytecode.
1239         (WebCore::ContentExtensions::DFABytecodeCompiler::compileNodeTransitions):
1240         Check to see if case-insensitive bytecodes can be used.
1241         (WebCore::ContentExtensions::DFABytecodeCompiler::compileCheckForRange):
1242         * contentextensions/DFABytecodeCompiler.h:
1243         (WebCore::ContentExtensions::DFABytecodeCompiler::Range::Range):
1244         Added Range structure to be able to count the ranges in a future patch deciding if we want to use jump tables.
1245         * contentextensions/DFABytecodeInterpreter.cpp:
1246         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
1247         Interpret case-insensitive bytecodes.
1248
1249 2015-03-25  Sam Weinig  <sam@webkit.org>
1250
1251         Address additional review feedback from https://bugs.webkit.org/show_bug.cgi?id=143059.
1252
1253         * contentextensions/ContentExtensionCompiler.cpp:
1254         (WebCore::ContentExtensions::compileRuleList):
1255         * contentextensions/ContentExtensionCompiler.h:
1256         * contentextensions/ContentExtensionParser.cpp:
1257         (WebCore::ContentExtensions::getTypeFlags):
1258
1259 2015-03-25  Sam Weinig  <sam@webkit.org>
1260
1261         [Content Extensions] Convert content extension compiling to return error codes and write its output using a client
1262         https://bugs.webkit.org/show_bug.cgi?id=143059
1263
1264         Reviewed by Alex Christensen.
1265
1266         * WebCore.xcodeproj/project.pbxproj:
1267         Add ContentExtensionError.h/cpp.
1268
1269         * contentextensions/ContentExtensionError.cpp: Added.
1270         (WebCore::ContentExtensions::contentExtensionErrorCategory):
1271         * contentextensions/ContentExtensionError.h: Added.
1272         (WebCore::ContentExtensions::make_error_code):
1273         Add ContentExtensionError enum and std::error_code adaptor.
1274
1275         * contentextensions/ContentExtensionCompiler.h:
1276         Instead of returning CompiledContentExtensionData, use a client interface
1277         to pass data. Eventually, this should be turned into a direct streaming 
1278         interface so we can write directly to a file.
1279
1280         * contentextensions/ContentExtensionCompiler.cpp:
1281         (WebCore::ContentExtensions::compileRuleList):
1282         * contentextensions/ContentExtensionParser.cpp:
1283         (WebCore::ContentExtensions::getTypeFlags):
1284         (WebCore::ContentExtensions::loadTrigger):
1285         (WebCore::ContentExtensions::loadAction):
1286         (WebCore::ContentExtensions::loadRule):
1287         (WebCore::ContentExtensions::loadEncodedRules):
1288         (WebCore::ContentExtensions::parseRuleList):
1289         * contentextensions/ContentExtensionParser.h:
1290         Convert to return an error.
1291
1292 2015-03-25  Beth Dakin  <bdakin@apple.com>
1293
1294         REGRESSION (r181660): Safari navigates to link after a starting and canceling a 
1295         force preview
1296         https://bugs.webkit.org/show_bug.cgi?id=143057
1297         -and corresponding-
1298         rdar://problem/20251436
1299
1300         Reviewed by Tim Horton.
1301
1302         This patch adds a value for ActionUpdated to the ImmediateActionStage enum. Now if 
1303         m_immediateActionStage indicates that an immediate action has either begun or 
1304         completed then we can have the same behavior.
1305         * page/EventHandler.cpp:
1306         (WebCore::EventHandler::handleMouseReleaseEvent):
1307         * page/EventHandler.h:
1308
1309 2015-03-25  Dean Jackson  <dino@apple.com>
1310
1311         MediaControls: Use font with fixed number width
1312         https://bugs.webkit.org/show_bug.cgi?id=143018
1313         <rdar://problem/20245415>
1314
1315         Reviewed by Eric Carlson.
1316
1317         Add a new font-family, specific to Apple platforms,
1318         called -apple-system-font-monospaced-numbers. This is
1319         a special variant of the system font which uses monospaced
1320         forms for the number glyphs - allowing a time reading that
1321         doesn't bounce around as the time changes.
1322
1323         * Modules/mediacontrols/mediaControlsApple.css: Media controls should
1324         use the new font.
1325         (audio::-webkit-media-controls-time-remaining-display):
1326         * Modules/mediacontrols/mediaControlsiOS.css:
1327         (audio::-webkit-media-controls-time-remaining-display):
1328
1329         * platform/graphics/ios/FontCacheIOS.mm: Request a new CTFontRef with
1330         the appropriate attributes.
1331         (WebCore::createCTFontWithFamilyNameAndWeight):
1332         * platform/graphics/mac/FontCacheMac.mm: Ditto, but NSFont.
1333         (WebCore::fontWithFamily):
1334         * platform/spi/cocoa/CoreTextSPI.h: Expose the constants for
1335         the new form so that the public SDK can build.
1336
1337 2015-03-25  Alex Christensen  <achristensen@webkit.org>
1338
1339         [Content Extensions] Add multi-DFA compiling and interpreting.
1340         https://bugs.webkit.org/show_bug.cgi?id=143010
1341
1342         Reviewed by Benjamin Poulain.
1343
1344         * contentextensions/ContentExtensionCompiler.cpp:
1345         (WebCore::ContentExtensions::compileRuleList):
1346         Compile multiple NFAs to DFAs.
1347         * contentextensions/ContentExtensionsBackend.cpp:
1348         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
1349         Fixed a bug when there are no non-universal actions.
1350         We still need to report that no ignore-previous-rules was hit to apply the
1351         universal actions which are now accessed through DFABytecodeInterpreter::actionsFromDFARoot
1352         and skipped in DFABytecodeInterpreter::interpret.
1353         * contentextensions/DFABytecodeCompiler.cpp:
1354         (WebCore::ContentExtensions::DFABytecodeCompiler::compile):
1355         Add a header for each DFA.
1356         * contentextensions/DFABytecodeInterpreter.cpp:
1357         (WebCore::ContentExtensions::DFABytecodeInterpreter::actionsFromDFARoot):
1358         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
1359         Interpret as many DFAs as there are in the bytecode.
1360
1361 2015-03-25  Per Arne Vollan  <peavo@outlook.com>
1362
1363         [Win] Illegal character in project file.
1364         https://bugs.webkit.org/show_bug.cgi?id=143051
1365
1366         Reviewed by Brent Fulgham.
1367
1368         There is an illegal character in the WebCore project filter.
1369         WebCore files are shown unfiltered.
1370
1371         * WebCore.vcxproj/WebCore.vcxproj.filters:
1372
1373 2015-03-25  David Hyatt  <hyatt@apple.com>
1374
1375         Add a pref to enable the new block-inside-inline model
1376         https://bugs.webkit.org/show_bug.cgi?id=143050
1377
1378         Reviewed by Sam Weinig.
1379
1380         * page/Settings.in:
1381
1382 2015-03-25  Dan Bernstein  <mitz@apple.com>
1383
1384         iOS Simulator build fix.
1385
1386         * platform/spi/cocoa/IOSurfaceSPI.h:
1387
1388 2015-03-25  Commit Queue  <commit-queue@webkit.org>
1389
1390         Unreviewed, rolling out r181932.
1391         https://bugs.webkit.org/show_bug.cgi?id=143041
1392
1393         The test fails most of the time on bots (Requested by ap on
1394         #webkit).
1395
1396         Reverted changeset:
1397
1398         "[Content Extensions] Add multi-DFA compiling and
1399         interpreting."
1400         https://bugs.webkit.org/show_bug.cgi?id=143010
1401         http://trac.webkit.org/changeset/181932
1402
1403 2015-03-24  Dean Jackson  <dino@apple.com>
1404
1405         Source/WebCore/rendering/RenderThemeMac.mm:2181:118: error: null passed to a callee that requires a non-null argument [-Werror,-Wnonnull]
1406         https://bugs.webkit.org/show_bug.cgi?id=143039
1407
1408         Unreviewed build fix for newer versions of OS X.
1409
1410         * rendering/RenderThemeMac.mm: Define a null language parameter. This
1411         seemed better than turning the clang warning off for just that
1412         function.
1413         (WebCore::AttachmentLayout::layOutTitle):
1414         (WebCore::AttachmentLayout::layOutSubtitle):
1415
1416 2015-03-24  Dan Bernstein  <mitz@apple.com>
1417
1418         Another attempt to fix the build.
1419
1420         * WebCore.xcodeproj/project.pbxproj:
1421         * platform/spi/cocoa/QuartzCoreSPI.h:
1422
1423 2015-03-24  Alex Christensen  <achristensen@webkit.org>
1424
1425         [Content Extensions] Add multi-DFA compiling and interpreting.
1426         https://bugs.webkit.org/show_bug.cgi?id=143010
1427
1428         Reviewed by Benjamin Poulain.
1429
1430         * contentextensions/ContentExtensionCompiler.cpp:
1431         (WebCore::ContentExtensions::compileRuleList):
1432         Compile multiple NFAs to DFAs.
1433         * contentextensions/ContentExtensionsBackend.cpp:
1434         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
1435         Fixed a bug when there are no non-universal actions.
1436         We still need to report that no ignore-previous-rules was hit to apply the
1437         universal actions which are now accessed through DFABytecodeInterpreter::actionsFromDFARoot
1438         and skipped in DFABytecodeInterpreter::interpret.
1439         * contentextensions/DFABytecodeCompiler.cpp:
1440         (WebCore::ContentExtensions::DFABytecodeCompiler::compile):
1441         Add a header for each DFA.
1442         * contentextensions/DFABytecodeInterpreter.cpp:
1443         (WebCore::ContentExtensions::DFABytecodeInterpreter::actionsFromDFARoot):
1444         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
1445         Interpret as many DFAs as there are in the bytecode.
1446
1447 2015-03-24  Dan Bernstein  <mitz@apple.com>
1448
1449         Tried to fix the EWS build.
1450
1451         * platform/spi/cocoa/QuartzCoreSPI.h:
1452
1453 2015-03-24  Commit Queue  <commit-queue@webkit.org>
1454
1455         Unreviewed, rolling out r181898 and r181909.
1456         https://bugs.webkit.org/show_bug.cgi?id=143034
1457
1458         Broke fast/regions/auto-size/autoheight-two-pass-layout-
1459         complex-002.html (Requested by ap on #webkit).
1460
1461         Reverted changesets:
1462
1463         "Improve the offsetWidth/Height layout optimization"
1464         https://bugs.webkit.org/show_bug.cgi?id=143008
1465         http://trac.webkit.org/changeset/181898
1466
1467         "Disable layout dimensions optimization for RenderRegions"
1468         https://bugs.webkit.org/show_bug.cgi?id=143017
1469         http://trac.webkit.org/changeset/181909
1470
1471 2015-03-24  Zhuo Li  <zachli@apple.com>
1472
1473         Scripts running in isolated world should not subject to a page's CSP about 'eval'.
1474         https://bugs.webkit.org/show_bug.cgi?id=141316.
1475
1476         Reviewed by Geoffrey Garen.
1477
1478         * bindings/js/ScriptController.cpp:
1479         (WebCore::ScriptController::initScript):
1480         We should not impose the main world Content Security Policy onto the isolated world.
1481
1482 2015-03-24  Chris Dumez  <cdumez@apple.com>
1483
1484         [Mac] Use .cpp file extension instead of .mm for SharedTimerCF and PowerObserverMac
1485         https://bugs.webkit.org/show_bug.cgi?id=143026
1486
1487         Reviewed by Andy Estes.
1488
1489         Use .cpp file extension instead of .mm for SharedTimerCF and
1490         PowerObserverMac.
1491
1492         * WebCore.xcodeproj/project.pbxproj:
1493         * platform/cf/SharedTimerCF.cpp: Renamed from Source/WebCore/platform/cf/SharedTimerCF.mm.
1494         (WebCore::timerFired):
1495         Use WTF::AutodrainedPool instead of @autoreleasepool {}.
1496
1497         * platform/mac/PowerObserverMac.cpp: Renamed from Source/WebCore/platform/mac/PowerObserverMac.mm.
1498
1499 2015-03-24  Yusuke Suzuki  <utatane.tea@gmail.com>
1500
1501         REGRESSION (r181458): Heap use-after-free in JSSetIterator destructor
1502         https://bugs.webkit.org/show_bug.cgi?id=142696
1503
1504         Reviewed and tweaked by Geoffrey Garen.
1505
1506         Use JSSetIterator/JSMapIterator to iterate over JSSet and JSMap.
1507
1508         * ForwardingHeaders/runtime/JSMapIterator.h: Added.
1509         * ForwardingHeaders/runtime/JSSetIterator.h: Added.
1510         * bindings/js/SerializedScriptValue.cpp:
1511         (WebCore::CloneSerializer::serialize):
1512
1513 2015-03-24  Dan Bernstein  <mitz@apple.com>
1514
1515         Tried to fix the iOS Simulator build.
1516
1517         * platform/spi/cocoa/QuartzCoreSPI.h:
1518
1519 2015-03-24  Benjamin Poulain  <bpoulain@apple.com>
1520
1521         Make URL filter patterns matching consistent and add a simple canonicalization step
1522         https://bugs.webkit.org/show_bug.cgi?id=142998
1523
1524         Reviewed by Alex Christensen.
1525
1526         This patch makes two changes to the url filter input:
1527         -Make the matching "Search" by default, the pattern can now appear anywhere
1528          in the URL by default.
1529         -Make the input a little less fragile: do not explode on valid input
1530          that is not formatted in a certain way.
1531
1532         To implement the search behavior, I simply add an implict ".*" in front of the patterns
1533         when that make sense.
1534
1535         To make the input more solid, we do some little modification on the input:
1536         -Remove duplicated ".*".
1537         -Remove matching suffixes that do not bring new information.
1538         -Unify all the ".*" in the same format.
1539
1540         Why do that here? That should be done through a graph analysis on the machine.
1541
1542         The reason is this is incredibly cheap compared to the graph analysis. Any state
1543         removed upfront will save the handling of several hundred nodes in the deterministic
1544         graph.
1545
1546         * contentextensions/URLFilterParser.cpp:
1547         (WebCore::ContentExtensions::Term::isKnownToMatchAnyString):
1548         (WebCore::ContentExtensions::Term::isUniversalTransition):
1549         (WebCore::ContentExtensions::GraphBuilder::finalize):
1550         (WebCore::ContentExtensions::GraphBuilder::assertionBOL):
1551         (WebCore::ContentExtensions::GraphBuilder::fail):
1552         (WebCore::ContentExtensions::GraphBuilder::simplifySunkTerms):
1553
1554 2015-03-24  Chris Dumez  <cdumez@apple.com>
1555
1556         Regression(r181671): Caused Timer-related crashes on iOS / WK1
1557         https://bugs.webkit.org/show_bug.cgi?id=143025
1558
1559         Reviewed by Andy Estes.
1560
1561         Call CFRunLoopAddTimer() on WebThreadRunLoop() instead of
1562         CFRunLoopGetCurrent() for iOS, as we did before r181671.
1563
1564         I inadvertently changed this in r181671 when merging the Mac
1565         and iOS implementations.
1566
1567         No new tests, already covered by existing tests.
1568
1569         * platform/cf/SharedTimerCF.mm:
1570         (WebCore::setSharedTimerFireInterval):
1571
1572 2015-03-24  Dan Bernstein  <mitz@apple.com>
1573
1574         WebCore part of <rdar://problem/20282863> Transforms are flattened in snapshots of on-screen WKWebViews
1575         https://bugs.webkit.org/show_bug.cgi?id=143023
1576
1577         Reviewed by Tim Horton.
1578
1579         * platform/spi/cocoa/QuartzCoreSPI.h: Added the declaration of
1580         CARenderServerRenderLayerWithTransform.
1581
1582 2015-03-24  David Hyatt  <hyatt@apple.com>
1583
1584         Disable layout dimensions optimization for RenderRegions
1585         https://bugs.webkit.org/show_bug.cgi?id=143017
1586
1587         Reviewed by Dean Jackson.
1588
1589         * dom/Document.cpp:
1590         (WebCore::Document::updateLayoutIfDimensionsOutOfDate):
1591         Turn off the optimization for regions, since auto height regions can change size
1592         without needing a layout.
1593
1594 2015-03-24  Beth Dakin  <bdakin@apple.com>
1595
1596         Add events related to force click gesture
1597         https://bugs.webkit.org/show_bug.cgi?id=142836
1598         -and corresponding-
1599         rdar://problem/20210239
1600
1601         Reviewed by Dean Jackson.
1602
1603         This patch adds six new events for the force click gesture:
1604
1605         webkitmouseforcewillbegin -> Event is sent just before mousedown to indicate that 
1606         force can be perceived if the user presses any harder. The author should prevent 
1607         default on this event to both prevent the user agent’s default force click 
1608         features and to receive the other 5 events.
1609
1610         webkitmouseforcechanged -> This event fires whenever force changes between the 
1611         mousedown and mouseup. It is a new type of mouse event that includes a force 
1612         variable which is a normalized number between 0 (corresponds to click) and 1 
1613         (corresponds to force click). In this patch, I have only added code to send this 
1614         event between mousedown and mouseforcedown, but as a followup patch, we plan to 
1615         send it through mouseup.
1616
1617         webkitmouseforcecancelled -> If the user releases their finger from the trackpad 
1618         after pressing hard enough to send webkitmouseforcewillbegin events but not hard 
1619         enough to force click, this event will be sent to indicate that the user bailed 
1620         out on the gesture.
1621
1622         webkitmouseforcedown -> The down part of the force click.
1623
1624         webkitmouseforceup -> The up part of the force click. This event is added in this 
1625         patch, but does not yet fire. That is work for a follow-up patch.
1626
1627         webkitmouseforceclick -> The equivalent of the click event for the force click. 
1628         Should fire just after webkitmouseforceup. This event is added in this patch, but 
1629         does not yet fire. That is work for a follow-up patch.
1630
1631         Add new files for WebKitMouseForceEvent to build systems.
1632         * DerivedSources.cpp:
1633         * DerivedSources.make:
1634         * WebCore.vcxproj/WebCore.vcxproj:
1635         * WebCore.vcxproj/WebCore.vcxproj.filters:
1636         * WebCore.xcodeproj/project.pbxproj:
1637         * WebCore.xcodeproj/project.pbxproj:
1638
1639         Plumbing for new events.
1640         * dom/Document.idl:
1641
1642         Code to dispatch the new events. Currently the code that calls these functions is 
1643         in WebKit2.
1644         * dom/Element.cpp:
1645         (WebCore::Element::dispatchMouseForceWillBegin):
1646         (WebCore::Element::dispatchMouseForceChanged):
1647         (WebCore::Element::dispatchMouseForceDown):
1648         (WebCore::Element::dispatchMouseForceUp):
1649         (WebCore::Element::dispatchMouseForceClick):
1650         (WebCore::Element::dispatchMouseForceCancelled):
1651         * dom/Element.h:
1652
1653         More plumbing.
1654         * dom/Element.idl:
1655         * dom/EventNames.h:
1656         * dom/EventNames.in:
1657
1658         Our new type of mouse event that includes force.
1659         * dom/WebKitMouseForceEvent.cpp: Added.
1660         (WebCore::WebKitMouseForceEventInit::WebKitMouseForceEventInit):
1661         (WebCore::WebKitMouseForceEvent::WebKitMouseForceEvent):
1662         (WebCore::WebKitMouseForceEvent::~WebKitMouseForceEvent):
1663         (WebCore::WebKitMouseForceEvent::eventInterface):
1664         * dom/WebKitMouseForceEvent.h: Added.
1665         * dom/WebKitMouseForceEvent.idl: Added.
1666
1667         More plumbing.
1668         * html/HTMLAttributeNames.in:
1669         * html/HTMLBodyElement.cpp:
1670         (WebCore::HTMLBodyElement::createWindowEventHandlerNameMap):
1671         * html/HTMLBodyElement.idl:
1672         * html/HTMLElement.cpp:
1673         (WebCore::HTMLElement::createEventHandlerNameMap):
1674         * page/DOMWindow.idl:
1675         * page/EventHandler.h:
1676         (WebCore::EventHandler::lastMouseDownEvent):
1677
1678 2015-03-24  Anders Carlsson  <andersca@apple.com>
1679
1680         Fix designated initializer violations
1681         https://bugs.webkit.org/show_bug.cgi?id=143016
1682         rdar://problem/20268858
1683
1684         Reviewed by Dan Bernstein.
1685
1686         Mark -[DOMObject init] as unavailable.
1687
1688         * bindings/objc/DOMObject.h:
1689         * bindings/objc/DOMObject.mm:
1690         (-[DOMObject init]):
1691
1692 2015-03-24  Benjamin Poulain  <benjamin@webkit.org>
1693
1694         CSS Selectors Level 4: enable case-insensitive attribute matching by default
1695         https://bugs.webkit.org/show_bug.cgi?id=142960
1696
1697         Reviewed by Andreas Kling.
1698
1699         All open issues have been resolved, enable the feature by default.
1700
1701         Test: fast/css/attribute-selector-case-insensitive.html
1702
1703         * css/CSSGrammar.y.in:
1704
1705 2015-03-24  Dean Jackson  <dino@apple.com>
1706
1707         MediaControls: Scrubber and Time displays have the incorrect blending
1708         https://bugs.webkit.org/show_bug.cgi?id=143011
1709         <rdar://problem/20245251>
1710
1711         Reviewed by Eric Carlson.
1712
1713         The scrubber in media controls should use plus-darker blending. Then
1714         the scrubber itself should use a slightly transparent black (55% opacity)
1715         when drawing.
1716
1717         * Modules/mediacontrols/mediaControlsiOS.css:
1718         (audio::-webkit-media-controls-timeline): Add the blend mode.
1719         * Modules/mediacontrols/mediaControlsiOS.js:
1720         (ControllerIOS.prototype.drawTimelineBackground): Start drawing with
1721         transparency. I changed the order of rendering to make it
1722         more clear we draw the three parts in left to right order.
1723
1724 2015-03-24  David Hyatt  <hyatt@apple.com>
1725
1726         Improve the offsetWidth/Height layout optimization
1727         https://bugs.webkit.org/show_bug.cgi?id=143008
1728
1729         Reviewed by Dean Jackson.
1730
1731         * dom/Document.cpp:
1732         (WebCore::Document::updateLayoutIfDimensionsOutOfDate):
1733         * dom/Document.h:
1734         Change Element* to Element&. Clean up the dimension bits to use shifting. Remove both the inline and
1735         the positioning restrictions on the optimization check.
1736
1737         * dom/Element.cpp:
1738         (WebCore::Element::offsetWidth):
1739         (WebCore::Element::offsetHeight):
1740         Change to use Element& instead of Element*.
1741
1742         (WebCore::Element::clientWidth):
1743         (WebCore::Element::clientHeight):
1744         (WebCore::Element::scrollWidth):
1745         (WebCore::Element::scrollHeight):
1746         Turn on the optimization for clientWidth/Height and scrollWidth/Height.
1747
1748 2015-03-24  Yoav Weiss  <yoav@yoav.ws>
1749
1750         Stop image from displaying when src attribute is removed or emptied
1751         https://bugs.webkit.org/show_bug.cgi?id=142677
1752
1753         Reviewed by Chris Dumez.
1754
1755         Previously, we ignored empty attribute as failed URL, and didn't update the
1756         renderer when an image was removed. This patch fixes that.
1757
1758         Tests: fast/dom/HTMLImageElement/image-empty-src.html
1759                fast/dom/HTMLImageElement/image-remove-src.html
1760
1761         * loader/ImageLoader.cpp:
1762         (WebCore::ImageLoader::updateFromElement):
1763
1764 2015-03-17  Philippe Normand  <pnormand@igalia.com>
1765
1766         [OpenWebRTC] RealtimeMediaSourceCenter implementation
1767         https://bugs.webkit.org/show_bug.cgi?id=142476
1768
1769         Reviewed by Eric Carlson.
1770
1771         The old GStreamer MediaStreamCenter is replaced by the OpenWebRTC
1772         RealtimeMediaSourceCenter. It is not yet able to correctly assess
1773         MediaConstraints so it selects the first audio/video sources
1774         available through OpenWebRTC.
1775
1776         * PlatformEfl.cmake: Add new files to the build.
1777         * PlatformGTK.cmake: Ditto.
1778         * platform/mediastream/gstreamer/MediaStreamCenterGStreamer.cpp: Removed.
1779         * platform/mediastream/openwebrtc/OpenWebRTCUtilities.cpp: Added.
1780         (WebCore::initializeOpenWebRTC): Simple function to initialize the
1781         framework, it is going to be used by the PeerConnection backend as well.
1782         * platform/mediastream/openwebrtc/OpenWebRTCUtilities.h: Added.
1783         * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp: Added.
1784         (WebCore::mediaSourcesAvailableCallback): Function invoked once
1785         the media sources discovery succeeded within OpenWebRTC.
1786         (WebCore::RealtimeMediaSourceCenter::platformCenter): Instantiate
1787         the OpenWebRTC RealtimeMediaSourceCenter.
1788         (WebCore::RealtimeMediaSourceCenterOwr::RealtimeMediaSourceCenterOwr):
1789         (WebCore::RealtimeMediaSourceCenterOwr::~RealtimeMediaSourceCenterOwr):
1790         (WebCore::RealtimeMediaSourceCenterOwr::validateRequestConstraints):
1791         Schedule a discovery process for the capture sources.
1792         (WebCore::RealtimeMediaSourceCenterOwr::createMediaStream): Pick
1793         the first audio/video sources and create a MediaStream accordingly.
1794         (WebCore::RealtimeMediaSourceCenterOwr::getMediaStreamTrackSources):
1795         Not yet implemented.
1796         (WebCore::RealtimeMediaSourceCenterOwr::mediaSourcesAvailable):
1797         Method invoked once the capture sources process succeeded. Parse
1798         them and create an internal cache of RealtimeMediaSources accordingly.
1799         (WebCore::RealtimeMediaSourceCenterOwr::firstSource): Utility
1800         function to fetch the first source of the given type from the
1801         RealtimeMediaSources cache.
1802         * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.h: Renamed from Source/WebCore/platform/mediastream/gstreamer/MediaStreamCenterGStreamer.h.
1803         * platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.h: Added.
1804
1805 2015-03-24  Csaba Osztrogonác  <ossy@webkit.org>
1806
1807         [EFL] Add OpenWebRTC in jhbuild
1808         https://bugs.webkit.org/show_bug.cgi?id=142778
1809
1810         Reviewed by Gyuyoung Kim.
1811
1812         Original patch by Philippe Normand <pnormand@igalia.com>
1813
1814         * PlatformEfl.cmake: Add OpenWebRTC CFLAGS and LDFLAGS.
1815
1816 2015-03-23 Yoav Weiss  <yoav@yoav.ws>
1817
1818         Update empty image canvas tests and fix a related bug
1819         https://bugs.webkit.org/show_bug.cgi?id=142694
1820
1821         Reviewed by Chris Dumez.
1822
1823         During the work on https://bugs.webkit.org/show_bug.cgi?id=142677
1824         we encountered an issue with canvas tests related to empty image handling
1825         when drawn or used as a pattern. After updating these tests, an issue with
1826         pattern handling was encountered.
1827
1828         The spec, as well as Chrome's implementation, say that when an empty image
1829         is used as a pattern, createPattern should return null. See
1830         https://html.spec.whatwg.org/multipage/scripting.html#fill-and-stroke-styles:check-the-usability-of-the-image-argument
1831         Instead, createPattern returned an exception in this case.
1832         This patch fixes that and makes sure that it returns a null when image loading hasn't started.
1833
1834         Tests: canvas/philip/tests/2d.drawImage.incomplete.emptysrc.html
1835                canvas/philip/tests/2d.drawImage.incomplete.nosrc.html
1836                canvas/philip/tests/2d.drawImage.incomplete.removedsrc.html
1837                canvas/philip/tests/2d.pattern.image.incomplete.emptysrc.html
1838                canvas/philip/tests/2d.pattern.image.incomplete.removedsrc.html
1839
1840         * html/canvas/CanvasRenderingContext2D.cpp:
1841         (WebCore::CanvasRenderingContext2D::createPattern): Return "null" if image is not fully decodeable.
1842
1843 2015-03-23  Alex Christensen  <achristensen@webkit.org>
1844
1845         Fix api tests after r181876.
1846
1847         * contentextensions/ContentExtensionsBackend.cpp:
1848         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
1849         Always append a CSSDisplayNoneStyleSheet action if no ignore-previous-rules is seen.
1850         * loader/cache/CachedResourceLoader.cpp:
1851         (WebCore::CachedResourceLoader::requestResource):
1852         Changed an assertion to a null check.
1853
1854 2015-03-23  Dean Jackson  <dino@apple.com>
1855
1856         Timelines are sharing the same canvas background
1857         https://bugs.webkit.org/show_bug.cgi?id=142994
1858         <rdar://problem/20209466>
1859
1860         Reviewed by Brent Fulgham.
1861
1862         Since each MediaControl lives in an isolated world, we
1863         can't rely on a global variable to provide a unique
1864         identifier for a named canvas. The fix is to expose
1865         WebCore's UUID generator, and have each canvas use
1866         that for a name.
1867
1868         * Modules/mediacontrols/MediaControlsHost.cpp:
1869         (WebCore::MediaControlsHost::generateUUID): New method on the
1870         MediaControlsHost that generates a UUID.
1871         * Modules/mediacontrols/MediaControlsHost.h:
1872         * Modules/mediacontrols/MediaControlsHost.idl:
1873
1874         * Modules/mediacontrols/mediaControlsApple.js: Remove the global
1875         variable unique ID that wasn't working, and instead get
1876         an ID from the MediaControlsHost.
1877         (Controller.prototype.createControls):
1878         * Modules/mediacontrols/mediaControlsiOS.js:
1879         (ControllerIOS):
1880
1881 2015-03-23  Brent Fulgham  <bfulgham@apple.com>
1882
1883         Scroll latching logic can get stuck in 'scrollable="no"' iframes
1884         https://bugs.webkit.org/show_bug.cgi?id=142789
1885         <rdar://problem/20129494>
1886
1887         Reviewed by Dean Jackson.
1888
1889         Clean up the EventHandler and latching code as follows:
1890         (1) Do not handle iframe elements as part of the normal latching logic. Instead, iframes should
1891             be evaluated during the 'platformCompleteWheelEvent' phase of processing as top-level scrolling
1892             frames.
1893         (2) Get rid of the ill-conceived notation that we should process non-mainframe and main-frame frames
1894             different.
1895         (3) Modify code to reflect that the scroll latching code really deals with overflow scrolling. Consequently,
1896             the 'findEnclosingScrollableContainer' was renamed to 'findEnclosingOverflowScroll' and does not
1897             treat iframe as a suitable target.
1898         (4) Do not create a latching state object when the container being evaluated is already scrolled to the
1899             extreme position in the direction of the mouse gesture. In this case, we want the enclosing frame
1900             to be the latching target.
1901         (5) Do not treat the state where the mouse wheel gesture has ended manual scrolling, but has not ended
1902             momentum scrolling, as an appropriate time to select a latching target.
1903
1904         * page/EventHandler.cpp:
1905         (WebCore::EventHandler::platformCompleteWheelEvent): Modify signature to remove unneeded argument.
1906         (WebCore::EventHandler::handleWheelEvent): Modify call to 'platformCompleteWheelEvent' to remove unused argument.
1907         * page/EventHandler.h:
1908         * page/mac/EventHandlerMac.mm:
1909         (WebCore::findEnclosingOverflowScroll): Renamed from 'findEnclosingScrollableContainer' and revised per the
1910         notes above.
1911         (WebCore::EventHandler::platformPrepareForWheelEvents): Remove mainFrame vs. non-mainFrame code paths and
1912         consolidate logic.
1913         (WebCore::EventHandler::platformCompleteWheelEvent): Remove unused argument. The wheel event target is no
1914         longer needed here, now that iframes are not processed by this code.
1915         (WebCore::findEnclosingScrollableContainer): Deleted.
1916         * page/scrolling/ScrollLatchingState.cpp:
1917         (WebCore::ScrollLatchingState::setPreviousWheelScrolledElement:) Switch to move operator for passing
1918         a temporary RefPtr to the the function.
1919         * page/scrolling/ScrollLatchingState.h:
1920         * platform/PlatformWheelEvent.h:
1921         (WebCore::PlatformWheelEvent::useLatchedEventElement): Recognize 'phase=ended, momentum=none' as a state
1922         that should not cause latching state to be revised.
1923
1924 2015-03-23  Anders Carlsson  <andersca@apple.com>
1925
1926         Try to fix the iOS build.
1927
1928         * platform/network/mac/CookieJarMac.mm:
1929
1930 2015-03-23  Brady Eidson  <beidson@apple.com>
1931
1932         Content extensions should apply css selectors
1933         https://bugs.webkit.org/show_bug.cgi?id=142604
1934
1935         Reviewed by Alex Christensen.
1936
1937         Tests: http/tests/contentextensions/css-display-none.html
1938
1939         * WebCore.xcodeproj/project.pbxproj:
1940
1941         * contentextensions/ContentExtension.cpp:
1942         (WebCore::ContentExtensions::ContentExtension::create):
1943         (WebCore::ContentExtensions::ContentExtension::ContentExtension):
1944         (WebCore::ContentExtensions::ContentExtension::globalDisplayNoneStyleSheet):
1945         * contentextensions/ContentExtension.h:
1946         (WebCore::ContentExtensions::ContentExtension::identifier):
1947         (WebCore::ContentExtensions::ContentExtension::compiledExtension):
1948
1949         * contentextensions/ContentExtensionsBackend.cpp:
1950         (WebCore::ContentExtensions::ContentExtensionsBackend::addContentExtension):
1951         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
1952         (WebCore::ContentExtensions::ContentExtensionsBackend::globalDisplayNoneStyleSheet):
1953         * contentextensions/ContentExtensionsBackend.h:
1954
1955         * contentextensions/DFABytecodeInterpreter.cpp:
1956         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
1957
1958         * dom/DocumentStyleSheetCollection.cpp:
1959         (WebCore::DocumentStyleSheetCollection::maybeAddContentExtensionSheet):
1960         * dom/DocumentStyleSheetCollection.h:
1961
1962         * loader/DocumentLoader.cpp:
1963         (WebCore::DocumentLoader::commitData):
1964         (WebCore::DocumentLoader::startLoadingMainResource):
1965         (WebCore::DocumentLoader::addPendingContentExtensionSheet):
1966         * loader/DocumentLoader.h:
1967
1968         * loader/cache/CachedResourceLoader.cpp:
1969         (WebCore::CachedResourceLoader::requestResource):
1970
1971         * loader/cache/CachedResourceRequest.cpp:
1972         (WebCore::CachedResourceRequest::setInitiator):
1973         * loader/cache/CachedResourceRequest.h:
1974         (WebCore::CachedResourceRequest::initiatingDocumentLoader):
1975
1976         * page/UserContentController.cpp:
1977         (WebCore::UserContentController::globalDisplayNoneStyleSheet):
1978         (WebCore::UserContentController::displayNoneCSSRule):
1979         * page/UserContentController.h:
1980
1981 2015-03-23  Anders Carlsson  <andersca@apple.com>
1982
1983         -[_WKWebsiteDataStore removeDataOfTypes:modifiedSince:completionHandler:] doesn't remove cookies
1984         https://bugs.webkit.org/show_bug.cgi?id=142990
1985         rdar://problem/20241645
1986
1987         Reviewed by Andreas Kling.
1988
1989         Use the Mac version of deleteAllCookiesModifiedSince on iOS as well.
1990
1991         * platform/network/cf/CookieJarCFNet.cpp:
1992         * platform/network/mac/CookieJarMac.mm:
1993
1994 2015-03-23  Conrad Shultz  <conrad_shultz@apple.com>
1995
1996         Replace uses of kCTFontSystemFontType
1997         https://bugs.webkit.org/show_bug.cgi?id=142984
1998
1999         Reviewed by Tim Horton.
2000
2001         * rendering/RenderThemeMac.mm:
2002         (WebCore::AttachmentLayout::layOutTitle):
2003         (WebCore::AttachmentLayout::layOutSubtitle):
2004
2005 2015-03-23  Dean Jackson  <dino@apple.com>
2006
2007         kCTFontSystemFontType is deprecated in CoreText
2008         https://bugs.webkit.org/show_bug.cgi?id=142981
2009         <rdar://problem/20261171>
2010
2011         Reviewed by Beth Dakin.
2012
2013         Update to the non-deprecated version.
2014
2015         * rendering/RenderThemeIOS.mm: kCTFontSystemFontType -> kCTFontUIFontSystem
2016         (WebCore::RenderThemeIOS::updateCachedSystemFontDescription):
2017
2018 2015-03-23  Eric Carlson  <eric.carlson@apple.com>
2019
2020         [Mac] Enable fullscreen for MSE-based videos
2021         https://bugs.webkit.org/show_bug.cgi?id=142971
2022
2023         Reviewed by Jer Noble.
2024
2025         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
2026         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsFullscreen): Return true;
2027
2028 2015-03-23  Alex Christensen  <achristensen@webkit.org>
2029
2030         [MediaFoundation] Implement seek.
2031         https://bugs.webkit.org/show_bug.cgi?id=142594
2032
2033         Reviewed by Darin Adler.
2034
2035         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
2036         (WebCore::MediaPlayerPrivateMediaFoundation::seeking):
2037         (WebCore::MediaPlayerPrivateMediaFoundation::seekDouble):
2038         (WebCore::MediaPlayerPrivateMediaFoundation::durationDouble):
2039         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
2040
2041 2015-03-23  Dan Bernstein  <mitz@apple.com>
2042
2043         Fixed the build.
2044
2045         * platform/graphics/cocoa/FontCocoa.mm:
2046         (WebCore::Font::platformBoundsForGlyph): Switched to non-deprecated CTFontOrientation values.
2047         (WebCore::Font::platformWidthForGlyph): Ditto.
2048
2049 2015-03-23  Jer Noble  <jer.noble@apple.com>
2050
2051         [iOS] Accessibility crashing because MediaPlayer is laying out UI off the main thread
2052         https://bugs.webkit.org/show_bug.cgi?id=142970
2053
2054         Reviewed by Eric Carlson.
2055
2056         Return early after synchronously calling to the main thread to allocate the volume
2057         view, to avoid re-allocating the volume view again on the web thread.
2058
2059         * platform/audio/ios/MediaSessionManagerIOS.mm:
2060         (-[WebMediaSessionHelper allocateVolumeView]):
2061
2062 2015-03-23  Tim Horton  <timothy_horton@apple.com>
2063
2064         Add a share item to the link action menu
2065         https://bugs.webkit.org/show_bug.cgi?id=142961
2066         <rdar://problem/19198374>
2067
2068         Reviewed by Beth Dakin.
2069
2070         * English.lproj/Localizable.strings:
2071         Remove some now-unused strings.
2072
2073         * platform/spi/mac/NSMenuSPI.h:
2074         Add some SPI.
2075
2076 2015-03-23  David Kilzer  <ddkilzer@apple.com>
2077
2078         [iOS] Build fix: CoreText deprecated kCTFontSystemFontType
2079
2080         Fix tracked by:  <rdar://problem/20261171>
2081
2082         * rendering/RenderThemeIOS.mm:
2083         (WebCore::RenderThemeIOS::updateCachedSystemFontDescription):
2084         Add clang pragmas.
2085
2086 2015-03-23  Brent Fulgham  <bfulgham@apple.com>
2087
2088         Unreviewed test fix.
2089
2090         * css/CSSParser.cpp:
2091         (WebCore::CSSParser::parseScrollSnapDestination): Remove new assertion.
2092
2093 2015-03-23  Brent Fulgham  <bfulgham@apple.com>
2094
2095         scroll-snap-destination and scroll-snap-coordinate do not seem to work together properly
2096         https://bugs.webkit.org/show_bug.cgi?id=142552
2097         <rdar://problem/20114743>
2098
2099         Reviewed by Dean Jackson.
2100
2101         Revise the snap point logic as follows:
2102         (1) Put the snap point destination handling in a helper function to make the rest of the code
2103             easier to read.
2104         (2) Make sure we always have a left-hand snap point (i.e., position 0), but don't add multiple
2105             left-hand snap points.
2106         (3) Create a helper function to determine if we should be working with the scroll snap 'elements'
2107             behavior. We want to use this for scroll-snap-destination/scroll-snap-coordinate markup.
2108         (4) Create per-element snap point offsets when using scroll-snap-destination/scroll-snap-coordinate.
2109
2110         * css/CSSParser.cpp:
2111         (WebCore::CSSParser::parseScrollSnapDestination): Add assertion to try to catch bad parser state.
2112         * page/scrolling/AxisScrollSnapOffsets.cpp:
2113         (WebCore::destinationOffsetForViewSize): Added helper function to consolidate logic for handling
2114         destination coordinates.
2115         (WebCore::updateFromStyle): Make sure a left-hand snap point is always provided.
2116         (WebCore::styleUsesElements): Added helper function.
2117         (WebCore::updateSnapOffsetsForScrollableArea): Revise logic to generate 'per-element' snap point
2118         offsets.
2119
2120 2015-03-23  Yoav Weiss  <yoav@yoav.ws>
2121
2122         Refactor ImageLoader's setting of CachedImage
2123         https://bugs.webkit.org/show_bug.cgi?id=142825
2124
2125         Reviewed by Chris Dumez.
2126
2127         No new tests, since there's no functional change.
2128
2129         setImage and setImageWithoutConsideringPendingLoadEvent were not called with new
2130         CachedImages and were not used as originally intended. That resulted in some dead code,
2131         and confusion when going over the code.
2132         This patch renames these methods into equivalent clearImage* methods, and deletes resulting dead code.
2133
2134         * html/HTMLObjectElement.cpp:
2135         (WebCore::HTMLObjectElement::renderFallbackContent): Changed setImage call to clearImage.
2136         * loader/ImageLoader.cpp:
2137         (WebCore::ImageLoader::clearImage):
2138         (WebCore::ImageLoader::clearImageWithoutConsideringPendingLoadEvent):
2139         (WebCore::ImageLoader::notifyFinished):
2140         (WebCore::ImageLoader::elementDidMoveToNewDocument):
2141         (WebCore::ImageLoader::setImage): Deleted.
2142         (WebCore::ImageLoader::setImageWithoutConsideringPendingLoadEvent): Deleted.
2143         * loader/ImageLoader.h:
2144
2145 2015-03-22  Benjamin Poulain  <benjamin@webkit.org>
2146
2147         CSS Selectors: fix attribute case-insensitive matching of Contain and List
2148         https://bugs.webkit.org/show_bug.cgi?id=142932
2149
2150         Reviewed by Darin Adler.
2151
2152         Fix the last two attribute selectors that were using full case-insensitive
2153         match:
2154             -Contain ([foo*=bar]).
2155             -List (foo~=bar]).
2156
2157         Tests: fast/selectors/attribute-contains-value-matching-is-ascii-case-insensitive.html
2158                fast/selectors/attribute-list-value-matching-is-ascii-case-insensitive.html
2159
2160         * css/SelectorChecker.cpp:
2161         (WebCore::attributeValueMatches):
2162         * cssjit/SelectorCompiler.cpp:
2163         (WebCore::SelectorCompiler::attributeValueContains):
2164         (WebCore::SelectorCompiler::attributeValueSpaceSeparetedListContains):
2165
2166 2015-03-22  Benjamin Poulain  <bpoulain@apple.com>
2167
2168         Detect when url filter pattern with groups match the empty string
2169         https://bugs.webkit.org/show_bug.cgi?id=142930
2170
2171         Reviewed by Sam Weinig.
2172
2173         The previous test was only accounting for simple atoms. This patch extends
2174         it to groups.
2175
2176         * contentextensions/URLFilterParser.cpp:
2177         (WebCore::ContentExtensions::Term::quantify):
2178         (WebCore::ContentExtensions::Term::matchesAtLeastOneCharacter):
2179         (WebCore::ContentExtensions::GraphBuilder::finalize):
2180         (WebCore::ContentExtensions::Term::quantifier): Deleted.
2181
2182 2015-03-22  Eric Carlson  <eric.carlson@apple.com>
2183
2184         [Mac] Enable WIRELESS_PLAYBACK_TARGET for WK1
2185         https://bugs.webkit.org/show_bug.cgi?id=142940
2186
2187         Reviewed by Sam Weinig.
2188
2189         * dom/Document.cpp:
2190         (WebCore::Document::didChoosePlaybackTarget): const-ify the didChoosePlaybackTarget argument.
2191         * dom/Document.h:
2192
2193         * html/HTMLMediaSession.cpp:
2194         (WebCore::HTMLMediaSession::didChoosePlaybackTarget): Ditto.
2195         * html/HTMLMediaSession.h:
2196
2197         * page/Page.cpp:
2198         (WebCore::Page::didChoosePlaybackTarget):  Ditto.
2199         * page/Page.h:
2200
2201         * platform/audio/MediaSession.h:
2202         * platform/graphics/MediaPlaybackTargetPickerClient.h:
2203         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm: 
2204         (WebCore::MediaPlaybackTargetPickerMac::devicePicker):  Ditto.
2205
2206 2015-03-22  Anders Carlsson  <andersca@apple.com>
2207
2208         _WKWebsiteDataStore should clear WebSQL databases
2209         https://bugs.webkit.org/show_bug.cgi?id=142947
2210
2211         Reviewed by Sam Weinig.
2212
2213         * Modules/webdatabase/DatabaseTracker.cpp:
2214         (WebCore::DatabaseTracker::trackerWithDatabasePath):
2215         Add a hack so we can get at a tracker from the UI process.
2216
2217         (WebCore::DatabaseTracker::deleteDatabasesModifiedSince):
2218         New function that deletes all databases modified after a given time.
2219
2220         * Modules/webdatabase/DatabaseTracker.h:
2221         Add new members and export the ones we want to call from WebKit2.
2222
2223         * Modules/webdatabase/OriginLock.h:
2224         Export the destructor.
2225
2226 2015-03-21  Dean Jackson  <dino@apple.com>
2227
2228         Remove the prefix for CSS Transforms
2229         https://bugs.webkit.org/show_bug.cgi?id=142927
2230         <rdar://problem/11568151>
2231
2232         Reviewed by Simon Fraser.
2233
2234         Support the bare form of:
2235         - transform
2236         - transform-style
2237         - transform-origin
2238         - perspective
2239         - perspective-origin
2240
2241         For transform-style, we also still differentiate the prefixed property
2242         because we may want to use that as an indicator of legacy content.
2243
2244         This is mostly a find and replace, but with some related naming
2245         changes. The DOM interface for WebKitCSSTransformValue remains
2246         unchanged.
2247
2248         Tests: transforms/2d/transform-2d-prefixed.html
2249                transforms/3d/general/prefixed-3dtransform-values.html
2250
2251         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
2252         (WebCore::propertyChangeMayRepaintNonDescendants):
2253         * css/CSSComputedStyleDeclaration.cpp:
2254         (WebCore::isLayoutDependent):
2255         (WebCore::ComputedStyleExtractor::propertyValue):
2256         * css/CSSParser.cpp:
2257         (WebCore::isValidKeywordPropertyAndValue):
2258         (WebCore::isKeywordPropertyID):
2259         (WebCore::parseTranslateTransformValue):
2260         (WebCore::CSSParser::parseValue):
2261         (WebCore::CSSParser::parseTransformOrigin):
2262         (WebCore::CSSParser::parsePerspectiveOrigin):
2263         * css/CSSPropertyNames.in:
2264         * css/StyleProperties.cpp:
2265         (WebCore::StyleProperties::getPropertyValue):
2266         (WebCore::StyleProperties::asText):
2267         * css/WebKitCSSMatrix.cpp:
2268         (WebCore::WebKitCSSMatrix::setMatrixValue):
2269         * html/track/VTTCue.cpp:
2270         (WebCore::VTTCueBox::applyCSSProperties):
2271         * page/animation/AnimationController.cpp:
2272         (WebCore::AnimationControllerPrivate::computeExtentOfAnimation):
2273         * page/animation/CSSPropertyAnimation.cpp:
2274         (WebCore::PropertyWrapperAcceleratedTransform::PropertyWrapperAcceleratedTransform):
2275         (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
2276         * page/animation/CompositeAnimation.cpp:
2277         (WebCore::CompositeAnimation::computeExtentOfTransformAnimation):
2278         * page/animation/ImplicitAnimation.cpp:
2279         (WebCore::ImplicitAnimation::computeExtentOfTransformAnimation):
2280         * page/animation/KeyframeAnimation.cpp:
2281         (WebCore::KeyframeAnimation::computeExtentOfTransformAnimation):
2282         (WebCore::KeyframeAnimation::validateTransformFunctionList):
2283         * platform/graphics/GraphicsLayer.cpp:
2284         (WebCore::GraphicsLayer::validateTransformOperations):
2285         * platform/graphics/GraphicsLayerClient.h:
2286         * platform/graphics/ca/GraphicsLayerCA.cpp:
2287         (WebCore::propertyIdToString):
2288         (WebCore::GraphicsLayerCA::moveOrCopyAnimations):
2289         (WebCore::GraphicsLayerCA::addAnimation):
2290         (WebCore::GraphicsLayerCA::isRunningTransformAnimation):
2291         (WebCore::GraphicsLayerCA::createAnimationFromKeyframes):
2292         (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
2293         * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
2294         (WebCore::GraphicsLayerTextureMapper::addAnimation):
2295         * platform/graphics/texmap/TextureMapperAnimation.cpp:
2296         (WebCore::TextureMapperAnimation::applyInternal):
2297         * platform/graphics/texmap/TextureMapperLayer.cpp:
2298         (WebCore::TextureMapperLayer::syncAnimations):
2299         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
2300         (WebCore::CoordinatedGraphicsLayer::selfOrAncestorHasActiveTransformAnimation):
2301         (WebCore::CoordinatedGraphicsLayer::selfOrAncestorHaveNonAffineTransforms):
2302         (WebCore::CoordinatedGraphicsLayer::addAnimation):
2303         * rendering/RenderLayerBacking.cpp:
2304         (WebCore::RenderLayerBacking::updateGeometry):
2305         (WebCore::RenderLayerBacking::startAnimation):
2306         (WebCore::RenderLayerBacking::startTransition):
2307         (WebCore::RenderLayerBacking::graphicsLayerToCSSProperty):
2308         (WebCore::RenderLayerBacking::cssToGraphicsLayerProperty):
2309         * rendering/RenderLayerCompositor.cpp:
2310         (WebCore::RenderLayerCompositor::requiresCompositingForAnimation):
2311         (WebCore::RenderLayerCompositor::isRunningTransformAnimation):
2312         * svg/SVGElement.cpp:
2313         (WebCore::populateAttributeNameToCSSPropertyIDMap):
2314
2315 2015-03-21  Commit Queue  <commit-queue@webkit.org>
2316
2317         Unreviewed, rolling out r181824.
2318         https://bugs.webkit.org/show_bug.cgi?id=142935
2319
2320         Broke Windows build (Requested by ap on #webkit).
2321
2322         Reverted changeset:
2323
2324         "Remove the prefix for CSS Transforms"
2325         https://bugs.webkit.org/show_bug.cgi?id=142927
2326         http://trac.webkit.org/changeset/181824
2327
2328 2015-03-20  Dean Jackson  <dino@apple.com>
2329
2330         Remove the prefix for CSS Transforms
2331         https://bugs.webkit.org/show_bug.cgi?id=142927
2332         <rdar://problem/11568151>
2333
2334         Reviewed by Simon Fraser.
2335
2336         Support the bare form of:
2337         - transform
2338         - transform-style
2339         - transform-origin
2340         - perspective
2341         - perspective-origin
2342
2343         For transform-style, we also still differentiate the prefixed property
2344         because we may want to use that as an indicator of legacy content.
2345
2346         This is mostly a find and replace, but with some related naming
2347         changes. The DOM interface for WebKitCSSTransformValue remains
2348         unchanged.
2349
2350         Tests: transforms/2d/transform-2d-prefixed.html
2351                transforms/3d/general/prefixed-3dtransform-values.html
2352
2353         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
2354         (WebCore::propertyChangeMayRepaintNonDescendants):
2355         * css/CSSComputedStyleDeclaration.cpp:
2356         (WebCore::isLayoutDependent):
2357         (WebCore::ComputedStyleExtractor::propertyValue):
2358         * css/CSSParser.cpp:
2359         (WebCore::isValidKeywordPropertyAndValue):
2360         (WebCore::isKeywordPropertyID):
2361         (WebCore::parseTranslateTransformValue):
2362         (WebCore::CSSParser::parseValue):
2363         (WebCore::CSSParser::parseTransformOrigin):
2364         (WebCore::CSSParser::parsePerspectiveOrigin):
2365         * css/CSSPropertyNames.in:
2366         * css/StyleProperties.cpp:
2367         (WebCore::StyleProperties::getPropertyValue):
2368         (WebCore::StyleProperties::asText):
2369         * css/WebKitCSSMatrix.cpp:
2370         (WebCore::WebKitCSSMatrix::setMatrixValue):
2371         * html/track/VTTCue.cpp:
2372         (WebCore::VTTCueBox::applyCSSProperties):
2373         * page/animation/AnimationController.cpp:
2374         (WebCore::AnimationControllerPrivate::computeExtentOfAnimation):
2375         * page/animation/CSSPropertyAnimation.cpp:
2376         (WebCore::PropertyWrapperAcceleratedTransform::PropertyWrapperAcceleratedTransform):
2377         (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
2378         * page/animation/CompositeAnimation.cpp:
2379         (WebCore::CompositeAnimation::computeExtentOfTransformAnimation):
2380         * page/animation/ImplicitAnimation.cpp:
2381         (WebCore::ImplicitAnimation::computeExtentOfTransformAnimation):
2382         * page/animation/KeyframeAnimation.cpp:
2383         (WebCore::KeyframeAnimation::computeExtentOfTransformAnimation):
2384         (WebCore::KeyframeAnimation::validateTransformFunctionList):
2385         * platform/graphics/GraphicsLayer.cpp:
2386         (WebCore::GraphicsLayer::validateTransformOperations):
2387         * platform/graphics/GraphicsLayerClient.h:
2388         * platform/graphics/ca/GraphicsLayerCA.cpp:
2389         (WebCore::propertyIdToString):
2390         (WebCore::GraphicsLayerCA::moveOrCopyAnimations):
2391         (WebCore::GraphicsLayerCA::addAnimation):
2392         (WebCore::GraphicsLayerCA::isRunningTransformAnimation):
2393         (WebCore::GraphicsLayerCA::createAnimationFromKeyframes):
2394         (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
2395         * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
2396         (WebCore::GraphicsLayerTextureMapper::addAnimation):
2397         * platform/graphics/texmap/TextureMapperAnimation.cpp:
2398         (WebCore::TextureMapperAnimation::applyInternal):
2399         * platform/graphics/texmap/TextureMapperLayer.cpp:
2400         (WebCore::TextureMapperLayer::syncAnimations):
2401         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
2402         (WebCore::CoordinatedGraphicsLayer::selfOrAncestorHasActiveTransformAnimation):
2403         (WebCore::CoordinatedGraphicsLayer::selfOrAncestorHaveNonAffineTransforms):
2404         (WebCore::CoordinatedGraphicsLayer::addAnimation):
2405         * rendering/RenderLayerBacking.cpp:
2406         (WebCore::RenderLayerBacking::updateGeometry):
2407         (WebCore::RenderLayerBacking::startAnimation):
2408         (WebCore::RenderLayerBacking::startTransition):
2409         (WebCore::RenderLayerBacking::graphicsLayerToCSSProperty):
2410         (WebCore::RenderLayerBacking::cssToGraphicsLayerProperty):
2411         * rendering/RenderLayerCompositor.cpp:
2412         (WebCore::RenderLayerCompositor::requiresCompositingForAnimation):
2413         (WebCore::RenderLayerCompositor::isRunningTransformAnimation):
2414         * svg/SVGElement.cpp:
2415         (WebCore::populateAttributeNameToCSSPropertyIDMap):
2416
2417 2015-03-20  Yusuke Suzuki  <utatane.tea@gmail.com>
2418
2419         REGRESSION (r179429): Potential Use after free in JavaScriptCore`WTF::StringImpl::ref + 83
2420         https://bugs.webkit.org/show_bug.cgi?id=142410
2421
2422         Reviewed by Geoffrey Garen.
2423
2424         The same issues are found in the existing code; PropertyName does not have ownership.
2425         This patch rewrite the point that should have ownership to Identifier.
2426
2427         * bindings/js/JSDOMWindowCustom.cpp:
2428         (WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
2429         (WebCore::JSDOMWindow::putByIndex):
2430         * bindings/js/ReadableStreamJSSource.cpp:
2431         (WebCore::getInternalSlotFromObject):
2432         * bindings/scripts/CodeGeneratorJS.pm:
2433         (GenerateImplementation):
2434         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
2435         (WebCore::JSTestCustomNamedGetter::getOwnPropertySlotByIndex):
2436         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
2437         (WebCore::JSTestEventTarget::getOwnPropertySlotByIndex):
2438         * bindings/scripts/test/JS/JSTestInterface.cpp:
2439         (WebCore::JSTestInterface::putByIndex):
2440
2441 2015-03-20  Simon Fraser  <simon.fraser@apple.com>
2442
2443         Log the slow-scrolling reasons (if any) on first commit of a ScrollingTreeFrameScrollingNodeMac
2444         https://bugs.webkit.org/show_bug.cgi?id=142917
2445
2446         Reviewed by Beth Dakin.
2447         
2448         The scrollperf test would fail to detect transitions between slow and fast scrolling
2449         for new pages, because there was no logging when slow-scrolling scrolling tree was
2450         torn down, and a new fast-scrolling tree constructed.
2451         
2452         Fix by always logging the slow-scrolling reasons in the first update of the
2453         ScrollingTreeFrameScrollingNodeMac, even when the slow-scrolling reasons haven't
2454         changed.
2455
2456         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
2457         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
2458         (WebCore::ScrollingTreeFrameScrollingNodeMac::ScrollingTreeFrameScrollingNodeMac):
2459         (WebCore::ScrollingTreeFrameScrollingNodeMac::updateBeforeChildren):
2460
2461 2015-03-19  Geoffrey Garen  <ggaren@apple.com>
2462
2463         Function.prototype.toString should not decompile the AST
2464         https://bugs.webkit.org/show_bug.cgi?id=142853
2465
2466         Reviewed by Sam Weinig.
2467
2468         * bindings/js/JSLazyEventListener.cpp:
2469         (WebCore::JSLazyEventListener::initializeJSFunction): Adjust the line
2470         number of attribute event listeners to account for the leading newline
2471         now added by JavaScriptCore.
2472
2473         This solution is not perfect, but there are a lot of pre-existing problems
2474         with line and column reporting for attribute event listeners, and this
2475         preserves existing behavior with reasonable reliability.
2476
2477 2015-03-20  Alex Christensen  <achristensen@webkit.org>
2478
2479         Progress towards CMake on Mac.
2480         https://bugs.webkit.org/show_bug.cgi?id=136003
2481
2482         Reviewed by Chris Dumez.
2483
2484         * PlatformMac.cmake:
2485         Added some directories to create forwarding headers from.
2486         Generate ObjC bindings.
2487
2488 2015-03-20  Per Arne Vollan  <peavo@outlook.com>
2489
2490         [WinCairo] Crash when leaving page while video is playing.
2491         https://bugs.webkit.org/show_bug.cgi?id=142578
2492
2493         Reviewed by Alex Christensen.
2494
2495         This can happen when there is an asynchronous event invoked from a video worker
2496         thread, accessing the media player object after it has been deleted.
2497         This is solved by resetting the media player pointer in the event object,
2498         when the media player is deleted.
2499
2500         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
2501         (WebCore::MediaPlayerPrivateMediaFoundation::~MediaPlayerPrivateMediaFoundation):
2502         (WebCore::MediaPlayerPrivateMediaFoundation::addListener):
2503         (WebCore::MediaPlayerPrivateMediaFoundation::removeListener):
2504         (WebCore::MediaPlayerPrivateMediaFoundation::notifyDeleted):
2505         (WebCore::MediaPlayerPrivateMediaFoundation::AsyncCallback::AsyncCallback):
2506         (WebCore::MediaPlayerPrivateMediaFoundation::AsyncCallback::~AsyncCallback):
2507         (WebCore::MediaPlayerPrivateMediaFoundation::AsyncCallback::Invoke):
2508         (WebCore::MediaPlayerPrivateMediaFoundation::AsyncCallback::onMediaPlayerDeleted):
2509         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
2510         (WebCore::MediaPlayerPrivateMediaFoundation::MediaPlayerListener::MediaPlayerListener):
2511         (WebCore::MediaPlayerPrivateMediaFoundation::MediaPlayerListener::~MediaPlayerListener):
2512         (WebCore::MediaPlayerPrivateMediaFoundation::MediaPlayerListener::onMediaPlayerDeleted):
2513
2514 2015-03-20  Chris Dumez  <cdumez@apple.com>
2515
2516         Regression(r181782): Caused WebKit2.RestoreSessionStateContainingFormData API test to crash
2517         https://bugs.webkit.org/show_bug.cgi?id=142911
2518
2519         Reviewed by Antti Koivisto.
2520
2521         Drop the isBackForwardLoadType(m_loadType) assertion in
2522         FrameLoader::retryAfterFailedCacheOnlyMainResourceLoad(). This assertion
2523         used to hold true when goToBackForwardItem() was only called with
2524         history navigation load types. However, after r181782, we use a Standard
2525         load in the cases where we do not wish to display stale content (e.g.
2526         restoring session state).
2527
2528         The assertion comment says "We only use cache-only loads to avoid
2529         resubmitting forms". However, we then call loadDifferentDocumentItem()
2530         which already takes care of using the ReturnCacheDataElseLoad cache
2531         policy as the HistoryItem has form data and we pass
2532         MayNotAttemptCacheOnlyLoadForFormSubmissionItem as parameter.
2533
2534         No new tests, covered by WebKit2.RestoreSessionStateContainingFormData
2535         API test.
2536
2537         * loader/FrameLoader.cpp:
2538         (WebCore::FrameLoader::retryAfterFailedCacheOnlyMainResourceLoad):
2539
2540 2015-03-20  Andy Estes  <aestes@apple.com>
2541
2542         [Content Filtering] Adopt NEFilterSource unblock handling
2543         https://bugs.webkit.org/show_bug.cgi?id=142904
2544
2545         Reviewed by Andreas Kling.
2546
2547         * platform/cocoa/NetworkExtensionContentFilter.mm:
2548         (WebCore::NetworkExtensionContentFilter::unblockHandler):
2549         Returned an unblock handler that calls -[NEFilterSource remediateWithDecisionHandler:].
2550         * platform/cocoa/ParentalControlsContentFilter.mm:
2551         (WebCore::ParentalControlsContentFilter::unblockHandler): Used ASCIILiteral.
2552
2553 2015-03-19  Andy Estes  <aestes@apple.com>
2554
2555         [Content Filtering] Add tests for unblock requests
2556         https://bugs.webkit.org/show_bug.cgi?id=142900
2557
2558         Reviewed by Andreas Kling.
2559
2560         Currently the iOS Parental Controls content filter has a mechanism for requesting that a page be unblocked.
2561         WebKit implements this by listening for navigations originating from the filter's error page to a special URL,
2562         and requesting the page be unblocked via platform API, which might cause UI to be displayed. If the unblock is
2563         successful then we schedule a reload of the frame in order to display the unblocked document.
2564
2565         NetworkExtension also supports unblock requests, so in preparation for adopting its API, this patch allows
2566         content filters to specify their own unblock request method, teaches MockContentFilter to provide such a method,
2567         and writes tests to cover both allowed and denied unblock requests.
2568
2569         The content filter that blocks a load creates a ContentFilterUnblockHandler, passing it a lambda that is executed
2570         when a navigation matches the filter's special unblock URL. Filters can also specify that a script be executed in
2571         the context of its error page if the unblock is denied.
2572
2573         All platform content filters can handle unblock requests like this with the exception of iOS Parental Controls in WebKit2.
2574         Since UI can be displayed by the system in this case, the request must be made from within the UI process. Therefore the
2575         existing method is retained of serializing a WebFilterEvaluator and intercepting navigation policy calls in the UI process.
2576
2577         Tests: contentfiltering/allow-after-unblock-request.html
2578                contentfiltering/block-after-unblock-request.html
2579
2580         * bindings/js/JSMockContentFilterSettingsCustom.cpp:
2581         (WebCore::JSMockContentFilterSettings::decisionPoint): Added some using statements for clarity.
2582         (WebCore::JSMockContentFilterSettings::setDecisionPoint): Ditto.
2583         (WebCore::toJSValue): Returns a JSValue from a Decision.
2584         (WebCore::toDecision): Returns a Decision from a JSValue.
2585         (WebCore::JSMockContentFilterSettings::decision): Used toJSValue.
2586         (WebCore::JSMockContentFilterSettings::setDecision): Used toDecision.
2587         (WebCore::JSMockContentFilterSettings::unblockRequestDecision): Used toJSValue.
2588         (WebCore::JSMockContentFilterSettings::setUnblockRequestDecision): Used toDecision.
2589         * loader/ContentFilter.cpp:
2590         (WebCore::ContentFilter::createIfNeeded): Passed a reference to the owning DocumentLoader.
2591         (WebCore::ContentFilter::ContentFilter): Ditto.
2592         (WebCore::ContentFilter::unblockHandler): If the unblockHandler requests that a script be executed when an
2593         unblock request is denied, create a wrapper unblockHandler that executes that script in m_documentLoader's frame.
2594         * loader/ContentFilter.h:
2595         * loader/DocumentLoader.cpp:
2596         (WebCore::DocumentLoader::responseReceived): Passed this to ContentFilter::createIfNeeded.
2597         * loader/FrameLoader.cpp:
2598         (WebCore::FrameLoader::prepareForLoadStart): Called PolicyChecker::prepareForLoadStart.
2599         * loader/PolicyChecker.cpp:
2600         (WebCore::PolicyChecker::prepareForLoadStart): Reset m_contentFilterUnblockHandler.
2601         (WebCore::PolicyChecker::checkNavigationPolicy): Moved logic to here from WebKit1's WebFrameLoaderClient.
2602         Placing it here allows it to be shared between WebKit1 and WebKit2 (when the unblock handler does not need to
2603         be called in the UI process).
2604         * loader/PolicyChecker.h:
2605         (WebCore::PolicyChecker::setContentFilterUnblockHandler): Added.
2606         * page/Frame.h: Made Frame ThreadSafeRefCounted, since RefPtr<Frames> are captured in lambdas that can be
2607         copied by background threads managed by the underlying platform.
2608         * platform/ContentFilterUnblockHandler.h:
2609         (WebCore::ContentFilterUnblockHandler::unblockURLScheme): Returned the Apple content filter scheme.
2610         (WebCore::ContentFilterUnblockHandler::unblockURLHost): Returned the unblock URL host.
2611         (WebCore::ContentFilterUnblockHandler::clear): Deleted.
2612         * platform/PlatformContentFilter.h:
2613         (WebCore::PlatformContentFilter::unblockRequestDeniedScript): Returned the unblock request denied script.
2614         * platform/cocoa/ContentFilterUnblockHandlerCocoa.mm:
2615         (WebCore::ContentFilterUnblockHandler::ContentFilterUnblockHandler): Added a constructor that takes an
2616         unblockURLHost and a UnblockRequesterFunction. Added an alternate constructor for iOS Parental Controls on
2617         WebKit2 that takes an unblockURLHost and a WebFilterEvaluator.
2618         (WebCore::ContentFilterUnblockHandler::needsUIProcess): Returned true if m_webFilterEvaluator is non-null.
2619         (WebCore::ContentFilterUnblockHandler::encode): Encoded m_unblockURLHost in addition to m_webFilterEvaluator.
2620         (WebCore::ContentFilterUnblockHandler::decode): Decoded m_unblockURLHost in addition to m_webFilterEvaluator.
2621         (WebCore::ContentFilterUnblockHandler::canHandleRequest): Returned true if there is a either a m_unblockRequester
2622         or a m_webFilterEvaluator and the request's host and scheme match those of the unblock request URL.
2623         (WebCore::dispatchToMainThread): Added a helper to dispatch a block to the main thread. Then if the web thread
2624         is enabled on iOS, dispatch it there.
2625         (WebCore::ContentFilterUnblockHandler::requestUnblockAsync): Renamed from handleUnblockRequestAndDispatchIfSuccessful.
2626         Requested an unblock using either m_unblockRequester or m_webFilterEvaluator, then called decisionHandler with the response.
2627         (WebCore::scheme): Moved to ContentFilterUnblockHandler::unblockURLScheme.
2628         (WebCore::ContentFilterUnblockHandler::handleUnblockRequestAndDispatchIfSuccessful): Renamed to requestUnblockAsync.
2629         * platform/cocoa/ParentalControlsContentFilter.mm:
2630         (WebCore::ParentalControlsContentFilter::unblockHandler): Returned an unblock handler using the WebFilterEvaluator constructor.
2631         * testing/MockContentFilter.cpp: Added using statments for clarity.
2632         (WebCore::settings): Added a helper to get MockContentFilterSettings::singleton().
2633         (WebCore::MockContentFilter::canHandleResponse): Used the helper.
2634         (WebCore::MockContentFilter::MockContentFilter): Took advantage of the using statements.
2635         (WebCore::MockContentFilter::addData): Ditto.
2636         (WebCore::MockContentFilter::finishedAddingData): Ditto.
2637         (WebCore::MockContentFilter::unblockHandler): Returned a ContentFilterUnblockHandler that checks settings() for its decision.
2638         (WebCore::MockContentFilter::unblockRequestDeniedScript): Returned the script to execute in MockContentFilter's
2639         error page when an unblock request is denied.
2640         (WebCore::MockContentFilter::maybeDetermineStatus): Took advantage of settings() and using statements.
2641         * testing/MockContentFilterSettings.cpp:
2642         (WebCore::MockContentFilterSettings::unblockRequestURL): Constructed a static unblock URL and returned it.
2643         * testing/MockContentFilterSettings.h:
2644         (WebCore::MockContentFilterSettings::unblockURLHost): Returned the filter's unblock URL host.
2645         (WebCore::MockContentFilterSettings::unblockRequestDecision): Returns the decision to make for an unblock request.
2646         (WebCore::MockContentFilterSettings::setUnblockRequestDecision): Sets the decision to make for an unblock request.
2647         * testing/MockContentFilterSettings.idl: Added the unblockRequestDecision and unblockRequestURL attributes.
2648
2649 2015-03-20  Carlos Garcia Campos  <cgarcia@igalia.com>
2650
2651         [GTK] Crash due to empty drag image during drag-and-drop
2652         https://bugs.webkit.org/show_bug.cgi?id=142671
2653
2654         Reviewed by Philippe Normand.
2655
2656         Return early from ImageBuffer constructor if an empty size is
2657         given. This is a speculative fix for a crash while starting a drag
2658         and drop operation, that I haven't been able to reproduce.
2659
2660         * platform/graphics/cairo/ImageBufferCairo.cpp:
2661         (WebCore::ImageBuffer::ImageBuffer):
2662
2663 2015-03-19  Chris Dumez  <cdumez@apple.com>
2664
2665         [WK2] We should allow stale content when restoring a killed / crashed WebProcess
2666         https://bugs.webkit.org/show_bug.cgi?id=142893
2667         <rdar://problem/19633737>
2668         <rdar://problem/19869257>
2669
2670         Reviewed by Antti Koivisto.
2671
2672         Always use ReturnCacheDataElseLoad cache policy for history navigations.
2673         Previously, we would use the default protocol cache policy for history
2674         navigations if m_stateMachine.committedFirstRealDocumentLoad() returned
2675         false so that we do not display stale content when restoring the session
2676         state of Safari statup (rdar://problem/8131355). This is now handled
2677         before reaching this method by no longer using "IndexedBackForward"
2678         FrameLoadType when restoring session tabs, and using "Standard" load
2679         type instead.
2680
2681         * loader/FrameLoader.cpp:
2682         (WebCore::FrameLoader::loadDifferentDocumentItem):
2683
2684 2015-03-19  Andy Estes  <aestes@apple.com>
2685
2686         [Content Filtering] Move ContentFilter to from platform/ to loader/
2687         https://bugs.webkit.org/show_bug.cgi?id=142897
2688
2689         Reviewed by Dan Bernstein.
2690
2691         ContentFilterCollection never contained any platform code, so it doesn't make sense for it to be in platform.
2692         Move it to loader/, since ContentFilters are owned by DocumentLoaders, and just call it ContentFilter. Extract
2693         the abstract part of ContentFilter into a new base class called PlatformContentFilter that each of the
2694         individual filters inherit from.
2695
2696         * WebCore.xcodeproj/project.pbxproj:
2697         * loader/ContentFilter.cpp: Renamed from Source/WebCore/platform/ContentFilter.cpp.
2698         (WebCore::ContentFilter::types): Moved from ContentFilterCollection.
2699         (WebCore::ContentFilter::createIfNeeded): Ditto.
2700         (WebCore::ContentFilter::ContentFilter): Ditto.
2701         (WebCore::ContentFilter::addData): Ditto.
2702         (WebCore::ContentFilter::finishedAddingData): Ditto.
2703         (WebCore::ContentFilter::needsMoreData): Ditto.
2704         (WebCore::ContentFilter::didBlockData): Ditto.
2705         (WebCore::ContentFilter::getReplacementData): Ditto.
2706         (WebCore::ContentFilter::unblockHandler): Ditto.
2707         * loader/ContentFilter.h: Copied from Source/WebCore/platform/ContentFilter.h.
2708         (WebCore::ContentFilter::type): Replaced a use of ContentFilterCollection.
2709         * platform/PlatformContentFilter.h: Renamed from Source/WebCore/platform/ContentFilter.h.
2710         * platform/cocoa/NetworkExtensionContentFilter.h: Inherited from PlatformContentFilter.
2711         * platform/cocoa/ParentalControlsContentFilter.h: Ditto.
2712         * testing/MockContentFilter.h: Ditto.
2713
2714 2015-03-19  Dean Jackson  <dino@apple.com>
2715
2716         CSS Animations with triggers should map scroll position to duration
2717         https://bugs.webkit.org/show_bug.cgi?id=142870
2718         <rdar://problem/20227244>
2719
2720         Reviewed by Simon Fraser.
2721
2722         Expose a prototype implementation of what will eventually be called
2723         animation-timebase, mapping the scroll location to the duration of an
2724         animation. This only applies if the animation has a start and end
2725         trigger.
2726
2727         Test: animations/trigger-container-scroll-boundaries.html
2728
2729         * css/CSSComputedStyleDeclaration.cpp:
2730         (WebCore::createAnimationTriggerValue): Change to downcast.
2731
2732         * css/CSSToStyleMap.cpp:
2733         (WebCore::CSSToStyleMap::mapAnimationTrigger): Fix a bug where I wasn't
2734         telling the ScrollAnimationTrigger object whether or not it had
2735         an end value. This wasn't visible before because we were not using
2736         the end value.
2737
2738         * page/animation/AnimationBase.cpp:
2739         (WebCore::AnimationBase::fireAnimationEventsIfNeeded): Add a comment and
2740         change to using a downcast.
2741         (WebCore::AnimationBase::timeToNextService): Change to downcast.
2742         (WebCore::AnimationBase::freezeAtTime): Whitespace cleanup.
2743         (WebCore::AnimationBase::getElapsedTime): Calculate the elapsedTime based
2744         on the scroll position relative to the start and end trigger spots.
2745
2746         * page/animation/AnimationController.cpp:
2747         (WebCore::AnimationControllerPrivate::updateAnimations): Since this
2748         can potentially call into beginAnimationUpdateTime, it should have
2749         an update blocker. This fixes the assert we were seeing in tests.
2750         (WebCore::AnimationControllerPrivate::scrollWasUpdated): Keep track of the scroll
2751         position so we don't need to ask for it all the time.
2752         * page/animation/AnimationControllerPrivate.h:
2753         (WebCore::AnimationControllerPrivate::scrollPosition): New accessor.
2754
2755         * platform/animation/AnimationTrigger.h: Add downcast macros.
2756         (WebCore::ScrollAnimationTrigger::create): Calculate hasEndValue from the passed
2757         parameters rather than a separate value.
2758         (WebCore::ScrollAnimationTrigger::hasEndValue):
2759         (WebCore::ScrollAnimationTrigger::ScrollAnimationTrigger):
2760         (WebCore::ScrollAnimationTrigger::setHasEndValue): Deleted.
2761
2762         * platform/graphics/ca/GraphicsLayerCA.cpp:
2763         (WebCore::GraphicsLayerCA::animationCanBeAccelerated): If we have an
2764         animation of this sort, we can't use a CAAnimation.
2765
2766 2015-03-19  Eric Carlson  <eric.carlson@apple.com>
2767
2768         [Mac] Move MediaPlaybackTargetPicker
2769         https://bugs.webkit.org/show_bug.cgi?id=142889
2770
2771         Move WebMediaPlaybackTargetPickerProxy from WK2 and rename as MediaPlaybackTargetPicker so it
2772         can be used by both WK2 and WK1.
2773
2774         Reviewed by Tim Horton.
2775
2776         * WebCore.xcodeproj/project.pbxproj:
2777         * platform/graphics/MediaPlaybackTargetPicker.cpp: Copied from Source/WebKit2/UIProcess/WebMediaPlaybackTargetPickerProxy.cpp.
2778         * platform/graphics/MediaPlaybackTargetPicker.h: Copied from Source/WebKit2/UIProcess/WebMediaPlaybackTargetPickerProxy.h.
2779         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.h: Copied from Source/WebKit2/UIProcess/mac/WebMediaPlaybackTargetPickerProxyMac.h.
2780         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm: Copied from Source/WebKit2/UIProcess/mac/WebMediaPlaybackTargetPickerProxyMac.mm.
2781
2782 2015-03-19  Enrica Casucci  <enrica@apple.com>
2783
2784         REGRESSION (r109593): Clicking after last inline element could cause a crash.
2785         https://bugs.webkit.org/show_bug.cgi?id=142880
2786         rdar://problem/17222294
2787
2788         Reviewed by Ryosuke Niwa.
2789
2790         Test: editing/selection/click-after-last-inline-crash.html
2791
2792         * rendering/RootInlineBox.cpp:
2793         (WebCore::RootInlineBox::closestLeafChildForLogicalLeftPosition):
2794
2795 2015-03-19  Enrica Casucci  <enrica@apple.com>
2796
2797         One more build fix after r181760.
2798
2799         * page/EventHandler.cpp:
2800         (WebCore::EventHandler::handleDrag):
2801
2802 2015-03-19  Jessie Berlin  <jberlin@webkit.org>
2803
2804         Build fix after r181760.
2805
2806         * rendering/RenderAttachment.h:
2807
2808 2015-03-19  Jer Noble  <jer.noble@apple.com>
2809
2810         [WK2][Mac] Fullscreen animations with mismatched aspect ratios are "squished".
2811         https://bugs.webkit.org/show_bug.cgi?id=142132
2812
2813         Reviewed by Tim Horton.
2814
2815         Add a new utility method to calculate a rect with a specific aspect ratio wrapping a smaller one.
2816
2817         * platform/graphics/GeometryUtilities.cpp:
2818         (WebCore::smallestRectWithAspectRatioAroundRect):
2819         * platform/graphics/GeometryUtilities.h:
2820
2821 2015-03-19  Chris Dumez  <cdumez@apple.com>
2822
2823         Get rid of "CachePolicyCache" cache policy
2824         https://bugs.webkit.org/show_bug.cgi?id=142881
2825
2826         Reviewed by Antti Koivisto.
2827
2828         Get rid of "CachePolicyCache" cache policy as it is unused.
2829
2830         * loader/cache/CachePolicy.h:
2831         * loader/cache/CachedResource.cpp:
2832         (WebCore::CachedResource::mustRevalidateDueToCacheHeaders):
2833         * page/DiagnosticLoggingKeys.cpp:
2834         (WebCore::DiagnosticLoggingKeys::mustRevalidateIsExpiredKey): Deleted.
2835         * page/DiagnosticLoggingKeys.h:
2836
2837 2015-03-19  Alex Christensen  <achristensen@webkit.org>
2838
2839         [Content Extensions] Test regular expression parse failures.
2840         https://bugs.webkit.org/show_bug.cgi?id=142872
2841
2842         Reviewed by Benjamin Poulain.
2843
2844         * contentextensions/URLFilterParser.cpp:
2845         (WebCore::ContentExtensions::GraphBuilder::finalize):
2846         (WebCore::ContentExtensions::GraphBuilder::quantifyAtom):
2847         (WebCore::ContentExtensions::URLFilterParser::addPattern):
2848         (WebCore::ContentExtensions::URLFilterParser::statusString):
2849         * contentextensions/URLFilterParser.h:
2850         Changed failures that can never happen to assertions.
2851
2852 2015-03-19  Enrica Casucci  <enrica@apple.com>
2853
2854         Release build fix after https://trac.webkit.org/r181760.
2855
2856         Unreviewed.
2857
2858         * page/EventHandler.cpp:
2859         (WebCore::EventHandler::handleDrag):
2860
2861 2015-03-19  Enrica Casucci  <enrica@apple.com>
2862
2863         <attachment> should put URLs on the pasteboard so that Finder can accept drops.
2864         https://bugs.webkit.org/show_bug.cgi?id=142801
2865         rdar://problem/19982527
2866
2867         Reviewed by Tim Horton.
2868
2869         Test: editing/pasteboard/drag-and-drop-attachment-contenteditable.html
2870
2871         This patch adds all the necessary support to write attachment elements into
2872         the pasteboard, including the promised type.
2873
2874         * WebCore.xcodeproj/project.pbxproj:
2875         * page/DragActions.h:
2876         * page/DragClient.h:
2877         (WebCore::DragClient::declareAndWriteAttachment):
2878         * page/DragController.cpp:
2879         (WebCore::DragController::draggableElement):
2880         (WebCore::DragController::startDrag):
2881         * page/DragController.h:
2882         (WebCore::DragController::draggingAttachmentURL):
2883         * page/EventHandler.cpp:
2884         (WebCore::EventHandler::dragHysteresisExceeded):
2885         (WebCore::EventHandler::handleDrag):
2886         * page/mac/DragControllerMac.mm:
2887         (WebCore::DragController::declareAndWriteAttachment):
2888         * page/win/DragControllerWin.cpp:
2889         (WebCore::DragController::declareAndWriteAttachment):
2890         * platform/URL.cpp:
2891         (WebCore::URL::fileURLWithFileSystemPath):
2892         * platform/URL.h:
2893         * rendering/HitTestResult.cpp:
2894         (WebCore::HitTestResult::absoluteAttachmentURL):
2895         * rendering/HitTestResult.h:
2896
2897 2015-03-19  Chris Dumez  <cdumez@apple.com>
2898
2899         Unreviewed, fix linking error after r181753.
2900
2901         Drop WEBCORE_EXPORT for Settings::minimumDOMTimerInterval() as it is
2902         now inlined.
2903
2904         * page/Settings.h:
2905         (WebCore::Settings::minimumDOMTimerInterval):
2906
2907 2015-03-19  Brady Eidson  <beidson@apple.com>
2908
2909         Part of content extensions should apply css selectors
2910         https://bugs.webkit.org/show_bug.cgi?id=142604
2911
2912         Reviewed by Alex Christensen.
2913
2914         Add a new action for applying the cached global stylesheet.
2915
2916         * contentextensions/CompiledContentExtension.cpp:
2917         (WebCore::ContentExtensions::CompiledContentExtension::globalDisplayNoneSelectors):
2918
2919         * contentextensions/ContentExtensionActions.h:
2920
2921         * contentextensions/ContentExtensionCompiler.cpp:
2922         (WebCore::ContentExtensions::serializeActions):
2923
2924         * contentextensions/ContentExtensionParser.cpp:
2925         (WebCore::ContentExtensions::loadAction):
2926
2927         * contentextensions/ContentExtensionRule.cpp:
2928         (WebCore::ContentExtensions::Action::deserialize):
2929         * contentextensions/ContentExtensionRule.h:
2930         (WebCore::ContentExtensions::Action::Action):
2931         (WebCore::ContentExtensions::Action::operator==):
2932         (WebCore::ContentExtensions::Action::stringArgument):
2933         (WebCore::ContentExtensions::Action::cssSelector): Deleted.
2934
2935         * contentextensions/ContentExtensionsBackend.cpp:
2936         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
2937
2938         * loader/cache/CachedResourceLoader.cpp:
2939         (WebCore::CachedResourceLoader::requestResource):
2940
2941 2015-03-19  Chris Dumez  <cdumez@apple.com>
2942
2943         Clean up DOMTimer related settings
2944         https://bugs.webkit.org/show_bug.cgi?id=142837
2945
2946         Reviewed by Darin Adler.
2947
2948         Clean up DOMTimer related settings:
2949         - Make default minimum timer interval 4ms instead of 10ms as all ports
2950           were setting it to 4ms and the specifications says 4ms.
2951         - Get rid of setters for default DOMTimer interval values as they are
2952           not set anymore.
2953         - Move default DOMTimer interval values from Settings to DOMTimer as
2954           those are global (not per-page) and not really settings.
2955         - Stop using abbreviations in the names (e.g. min -> minimum).
2956         - Move DOMTimer settings members from Page to Settings. There is no
2957           reason for those to be stored on the Page. The getters were private
2958           so call-sites had to go via Settings anyway. Also, call-sites already
2959           had to do a null check on the page to get the settings. It seems
2960           unfortunate for the settings to do another null-check on the page for
2961           retrieving the setting value from the page.
2962         - Inline the DOMTimer settings getters as these are trivial.
2963
2964         * dom/Document.cpp:
2965         (WebCore::Document::minimumTimerInterval):
2966         (WebCore::Document::timerAlignmentInterval):
2967         * dom/ScriptExecutionContext.cpp:
2968         (WebCore::ScriptExecutionContext::minimumTimerInterval):
2969         (WebCore::ScriptExecutionContext::timerAlignmentInterval):
2970         * page/DOMTimer.h:
2971         * page/Page.cpp:
2972         (WebCore::Page::Page):
2973         (WebCore::Page::setTimerThrottlingEnabled):
2974         (WebCore::Page::setMinimumTimerInterval): Deleted.
2975         (WebCore::Page::minimumTimerInterval): Deleted.
2976         * page/Page.h:
2977         (WebCore::Page::timerAlignmentInterval): Deleted.
2978         * page/Settings.cpp:
2979         (WebCore::Settings::Settings):
2980         (WebCore::Settings::setMinimumDOMTimerInterval):
2981         (WebCore::Settings::setDOMTimerAlignmentInterval):
2982         (WebCore::Settings::setHiddenPageDOMTimerAlignmentInterval): Deleted.
2983         (WebCore::Settings::hiddenPageDOMTimerAlignmentInterval): Deleted.
2984         (WebCore::Settings::setDefaultMinDOMTimerInterval): Deleted.
2985         (WebCore::Settings::defaultMinDOMTimerInterval): Deleted.
2986         (WebCore::Settings::setMinDOMTimerInterval): Deleted.
2987         (WebCore::Settings::minDOMTimerInterval): Deleted.
2988         (WebCore::Settings::setDefaultDOMTimerAlignmentInterval): Deleted.
2989         (WebCore::Settings::defaultDOMTimerAlignmentInterval): Deleted.
2990         (WebCore::Settings::domTimerAlignmentInterval): Deleted.
2991         * page/Settings.h:
2992         (WebCore::Settings::minimumDOMTimerInterval):
2993         (WebCore::Settings::domTimerAlignmentInterval):
2994         * testing/InternalSettings.cpp:
2995         (WebCore::InternalSettings::Backup::Backup):
2996         (WebCore::InternalSettings::Backup::restoreTo):
2997         (WebCore::InternalSettings::setMinimumTimerInterval):
2998
2999 2015-03-19  Carlos Garcia Campos  <cgarcia@igalia.com>
3000
3001         [GTK] Scrollbars look bad with GTK+ 3.16
3002         https://bugs.webkit.org/show_bug.cgi?id=140800
3003
3004         Reviewed by Sergio Villar Senin.
3005
3006         Take margin into account when rendering scrollbars. This fixes the
3007         huge scrollbars rendered with GTK+ 3.16. We don't need to check
3008         the GTK+ version because in previous versions the marging were 0,
3009         so the same code just works.
3010
3011         * platform/gtk/ScrollbarThemeGtk.cpp:
3012         (WebCore::adjustRectAccordingToMargin):
3013         (WebCore::ScrollbarThemeGtk::paintTrackBackground):
3014         (WebCore::ScrollbarThemeGtk::paintThumb):
3015
3016 2015-03-19  Xabier Rodriguez Calvar <calvaris@igalia.com> and Youenn Fablet  <youenn.fablet@crf.canon.fr>
3017
3018         [Streams API] Update ReadableStream API according new version of the specification
3019         https://bugs.webkit.org/show_bug.cgi?id=142822
3020
3021         Reviewed by Benjamin Poulain.
3022
3023         This patch updates the IDL of ReadableStream according the new version of the spec, which splits functionality between ReadableStream and ReadableStreamReader.
3024         In particular, this patch removes read(), ready, closed and state from ReadableStream and it adds the getReader method.
3025
3026         Covered by updated readablestream-constructor.html test.
3027
3028         * Modules/streams/ReadableStream.cpp:
3029         (WebCore::ReadableStream::ReadableStream):
3030         (WebCore::ReadableStream::state): Deleted.
3031         (WebCore::ReadableStream::closed): Deleted.
3032         (WebCore::ReadableStream::ready): Deleted.
3033         * Modules/streams/ReadableStream.h:
3034         (WebCore::ReadableStream::internalState): Added to make mac build system happy, to be used by ReadableStreamReader.
3035         * Modules/streams/ReadableStream.idl:
3036         * bindings/js/JSReadableStreamCustom.cpp:
3037         (WebCore::JSReadableStream::cancel):
3038         (WebCore::JSReadableStream::getReader):
3039         (WebCore::JSReadableStream::read): Deleted.
3040         (WebCore::getOrCreatePromiseDeferredFromObject): Deleted.
3041         (WebCore::readyPromiseSlotName): Deleted.
3042         (WebCore::JSReadableStream::ready): Deleted.
3043         (WebCore::closedPromiseSlotName): Deleted.
3044         (WebCore::JSReadableStream::closed): Deleted.
3045
3046 2015-03-18  Manuel Rego Casasnovas  <rego@igalia.com>
3047
3048         Unreviewed. GTK build fix after r181720.
3049
3050         * rendering/RenderImage.cpp:
3051         (WebCore::RenderImage::styleDidChange):
3052
3053 2015-03-18  Antti Koivisto  <antti@apple.com>
3054
3055         Test disk cache behavior when using back navigation cache policy
3056         https://bugs.webkit.org/show_bug.cgi?id=142848
3057
3058         Reviewed by Chris Dumez.
3059
3060         Add a way to override the normal cache policy so we can test reload behavior of cache without actually reloading.
3061
3062         Test: http/tests/cache/disk-cache-validation-back-navigation-policy.html
3063
3064         * loader/FrameLoader.cpp:
3065         (WebCore::FrameLoader::addExtraFieldsToRequest):
3066         * loader/FrameLoader.h:
3067         (WebCore::FrameLoader::setOverrideCachePolicyForTesting):
3068         * testing/Internals.cpp:
3069         (WebCore::Internals::setOverrideCachePolicy):
3070         * testing/Internals.h:
3071         * testing/Internals.idl:
3072
3073 2015-03-18  Yusuke Suzuki  <utatane.tea@gmail.com>
3074
3075         TextFragment#start() is always >= 0 since its type is unsigned
3076         https://bugs.webkit.org/show_bug.cgi?id=142860
3077
3078         Reviewed by Andreas Kling.
3079
3080         Since TextFragment::m_start is unsigned, the result of
3081         TextFragment::start() is always >= 0 and assertion is not effective.
3082         This patch removes this assertion to suppress warnings.
3083
3084         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
3085         (WebCore::SimpleLineLayout::TextFragmentIterator::revertToFragment):
3086
3087 2015-03-18  Alex Christensen  <achristensen@webkit.org>
3088
3089         [ContentExtensions] Prepare for compiling stylesheets of selectors to be used on every page.
3090         https://bugs.webkit.org/show_bug.cgi?id=142799
3091
3092         Reviewed by Brady Eidson.
3093
3094         * WebCore.xcodeproj/project.pbxproj:
3095         Make private headers to use with API tests.
3096         * contentextensions/CompiledContentExtension.cpp:
3097         (WebCore::ContentExtensions::CompiledContentExtension::globalDisplayNoneSelectors):
3098         * contentextensions/CompiledContentExtension.h:
3099         Added method to get only the selectors from the root of the DFA, which apply to all URLs.
3100         * contentextensions/ContentExtensionCompiler.cpp:
3101         (WebCore::ContentExtensions::compileRuleList):
3102         Added checking if the trigger will match everything.
3103         These actions can be put directly on the root of the DFA without adding extra epsilon transitions to the NFA.
3104         * contentextensions/DFA.h:
3105         (WebCore::ContentExtensions::DFA::nodeAt):
3106         * contentextensions/DFABytecodeInterpreter.cpp:
3107         (WebCore::ContentExtensions::DFABytecodeInterpreter::actionsFromDFARoot):
3108         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
3109         * contentextensions/DFABytecodeInterpreter.h:
3110         * contentextensions/NFA.h:
3111         * contentextensions/URLFilterParser.cpp:
3112         (WebCore::ContentExtensions::Term::quantifier):
3113         Sink terms to a vector then add nodes to NFA when finalizing after checking for regexes that match everything.
3114         (WebCore::ContentExtensions::GraphBuilder::GraphBuilder):
3115         (WebCore::ContentExtensions::GraphBuilder::finalize):
3116         (WebCore::ContentExtensions::GraphBuilder::parseStatus):
3117         (WebCore::ContentExtensions::GraphBuilder::atomPatternCharacter):
3118         (WebCore::ContentExtensions::GraphBuilder::atomBuiltInCharacterClass):
3119         (WebCore::ContentExtensions::GraphBuilder::quantifyAtom):
3120         (WebCore::ContentExtensions::GraphBuilder::atomBackReference):
3121         (WebCore::ContentExtensions::GraphBuilder::assertionBOL):
3122         (WebCore::ContentExtensions::GraphBuilder::assertionWordBoundary):
3123         (WebCore::ContentExtensions::GraphBuilder::atomCharacterClassAtom):
3124         (WebCore::ContentExtensions::GraphBuilder::atomCharacterClassRange):
3125         (WebCore::ContentExtensions::GraphBuilder::atomCharacterClassBuiltIn):
3126         (WebCore::ContentExtensions::GraphBuilder::atomParentheticalAssertionBegin):
3127         (WebCore::ContentExtensions::GraphBuilder::disjunction):
3128         (WebCore::ContentExtensions::GraphBuilder::hasError):
3129         (WebCore::ContentExtensions::GraphBuilder::fail):
3130         (WebCore::ContentExtensions::GraphBuilder::sinkFloatingTermIfNecessary):
3131         (WebCore::ContentExtensions::URLFilterParser::addPattern):
3132         (WebCore::ContentExtensions::URLFilterParser::statusString):
3133         (WebCore::ContentExtensions::GraphBuilder::errorMessage): Deleted.
3134         * contentextensions/URLFilterParser.h:
3135         Use an enum instead of strings for the status to avoid checking strings when we have a regex that matches everything.
3136
3137 2015-03-18  Yusuke Suzuki  <utatane.tea@gmail.com>
3138
3139         Fix build failure due to FALLTHROUGH in unreachable code
3140         https://bugs.webkit.org/show_bug.cgi?id=142703
3141
3142         Reviewed by Benjamin Poulain.
3143
3144         FALLTHROUGH should not exist in unreachable code marked by
3145         ASSERT_NOT_REACHABLE.
3146
3147         When !ENABLE(CSS_SELECTOR_JIT) and Debug mode is enabled,
3148         both ASSERT_NOT_REACHED and FALLTHROUGH are instantiated
3149         and it cause build failure.
3150
3151         Here, since CompiledSingle/CompiledSingleWithRootFilter are
3152         not set when !ENABLE(CSS_SELECTOR_JIT). So dropping FALLTHROUGH
3153         and leave ASSERT_NOT_REACHED.
3154         And since ASSERT_NOT_ReACHED is stripped when Release build,
3155         I've inserted FALLTHROUGH() if ASSERT_DISABLED.
3156         This fix is the same to r162906.
3157
3158         * dom/SelectorQuery.cpp:
3159         (WebCore::SelectorDataList::execute):
3160
3161 2015-03-18  Said Abou-Hallawa  <sabouhallawa@apple.com>
3162
3163         Switching between two SVG images with no intrinsic sizes causes them to get the default SVG size instead of the container size.
3164         https://bugs.webkit.org/show_bug.cgi?id=142805.
3165
3166         Reviewed by Darin Adler.
3167         
3168         The bug happens due to wrong logic in RenderImage::imageDimensionsChanged().
3169         This function decides to setNeedsLayout() if the intrinsic size of the image
3170         changes. If the size does not change, it only repaints the image rectangle.
3171         When switching the src of the an image between two SVG images and both of
3172         them have no intrinsic size, we do not updateInnerContentRect() and this
3173         means an SVGImageForContainer is not going to be created for this image.
3174         When the image is drawn, it is drawn directly from the SVGImage. And this
3175         means the drawing has to be scaled by container_size / SVG_default_intrinsic_size
3176         
3177         After figuring out that I need to updateInnerContentRect() to fix this bug,
3178         I found out Blink has already changed this code to do the same thing. But 
3179         they also did more clean-up in this function. Here is the link
3180         https://codereview.chromium.org/114323004. I think their change seems correct
3181         although they did not say what exactly they were trying to fix.
3182         
3183         The plan for repaintOrMarkForLayout(), which is the new name of this function,
3184         is the following:
3185             -- setNeedLayout() if the intrinsic size changes and it affects the size
3186                of the image.
3187             -- updateInnerContentRect() if the intrinsic size did not change but the
3188                image has exiting layout.
3189             -- repaint the image rectangle if layout is not needed.
3190             
3191         This change also removes the call to computeLogicalWidthInRegion(), which is
3192         almost running a layout for the image. This call figures out whether the image
3193         needs to setNeedsLayout(). This call is unnecessary; the image needs to run a
3194         layout if the intrinsic size has changed and it affects the size of the image.
3195                     
3196         Test: svg/as-image/svg-no-intrinsic-size-switching.html
3197
3198         * rendering/RenderImage.cpp:
3199         (WebCore::RenderImage::styleDidChange): Change the function call.
3200         (WebCore::RenderImage::imageChanged): Rename local variable and change the
3201         function call.
3202         
3203         (WebCore::RenderImage::updateIntrinsicSizeIfNeeded): Simplify this function.
3204         Call setIntrinsicSize() with the new size unless the image is in error state.
3205         
3206         (WebCore::RenderImage::repaintOrMarkForLayout): This a better name for this
3207         function since it is called even if the intrinsic size was not changed.
3208         (WebCore::RenderImage::imageDimensionsChanged): Deleted.
3209         
3210         * rendering/RenderImage.h: Rename imageDimensionsChanged() and change the 
3211         updateIntrinsicSizeIfNeeded() to return void.
3212         
3213         * rendering/svg/RenderSVGForeignObject.cpp:
3214         (WebCore::RenderSVGForeignObject::paint): Code cleanup. This function can
3215         only handle the paint phases PaintPhaseForeground and PaintPhaseSelection.
3216         Use this information to simplify the logic and order of painting there.
3217
3218 2015-03-18  Jeremy Jones  <jeremyj@apple.com>
3219
3220         Fix typo in playerViewControllerWillCancelOptimizedFullscree.
3221         https://bugs.webkit.org/show_bug.cgi?id=142745
3222
3223         Reviewed by Darin Adler.
3224
3225         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
3226         (-[WebAVPlayerController playerViewControllerWillCancelOptimizedFullscreen:]):
3227         (-[WebAVPlayerController playerViewControllerWillCancelOptimizedFullscree:]): Deleted.
3228
3229 2015-03-18  Simon Fraser  <simon.fraser@apple.com>
3230
3231         Avoid repaints when changing transform on an element with multiple background images
3232         https://bugs.webkit.org/show_bug.cgi?id=142841
3233
3234         Reviewed by Zalan Bujtas.
3235         
3236         Replace the cheap test for changed images in RenderElement::updateFillImages()
3237         with an exhaustive test that walks the entire list of background images,
3238         since any ensuing repaint is way more expensive than a slightly more expensive check here.
3239         
3240         Test: fast/repaint/multiple-backgrounds-style-change.html
3241
3242         * rendering/RenderElement.cpp:
3243         (WebCore::RenderElement::updateFillImages):
3244         * rendering/style/FillLayer.cpp:
3245         (WebCore::layerImagesIdentical): See if both images are the same (either none
3246         or both mask images, and same image pointer).
3247         (WebCore::FillLayer::imagesIdentical): Walk the two FillLayer lists, checking the images
3248         on each one. Returns false if we reach the end of one list before the other, or the images
3249         are different.
3250         * rendering/style/FillLayer.h: New static function; static because
3251         it compares two FillLayer lists, and I think that makes more sense than
3252         a member function.
3253
3254 2015-03-18  Anders Carlsson  <andersca@apple.com>
3255
3256         Pass cookies by reference in CookieHash functions
3257         https://bugs.webkit.org/show_bug.cgi?id=142839
3258
3259         Reviewed by Sam Weinig.
3260
3261         * platform/Cookie.h:
3262         (WebCore::CookieHash::hash):
3263         (WebCore::CookieHash::equal):
3264
3265 2015-03-18  Tim Horton  <timothy_horton@apple.com>
3266
3267         Temporarily fix the !ENABLE(CSS_SELECTOR_JIT) and assertions-enabled build
3268
3269         * dom/SelectorQuery.cpp:
3270         (WebCore::SelectorDataList::execute):
3271
3272 2015-03-18  Myles C. Maxfield  <mmaxfield@apple.com>
3273
3274         Call CTFontSetRenderingParameters before rendering text
3275         https://bugs.webkit.org/show_bug.cgi?id=142816
3276
3277         Reviewed by Darin Adler.
3278
3279         No new tests.
3280
3281         * platform/graphics/cocoa/FontCascadeCocoa.mm:
3282         (WebCore::showGlyphsWithAdvances):
3283         * platform/spi/cocoa/CoreTextSPI.h:
3284
3285 2015-03-18  Chris Dumez  <cdumez@apple.com>
3286
3287         [WK2] Log the number of network cache requests that we have never seen before
3288         https://bugs.webkit.org/show_bug.cgi?id=142828
3289         <rdar://problem/19632130>
3290
3291         Reviewed by Antti Koivisto.
3292
3293         Add diagnostic logging key for network cache efficacy logging.
3294
3295         * page/DiagnosticLoggingKeys.cpp:
3296         (WebCore::DiagnosticLoggingKeys::neverSeenBeforeKey):
3297         (WebCore::DiagnosticLoggingKeys::requestKey):
3298         * page/DiagnosticLoggingKeys.h:
3299
3300 2015-03-18  Yusuke Suzuki  <utatane.tea@gmail.com>
3301
3302         Use filterRootId in SelectorQuery even if CSS JIT is not enabled
3303         https://bugs.webkit.org/show_bug.cgi?id=142703
3304
3305         Reviewed by Benjamin Poulain.
3306
3307         filterRootId pruning path is not inherently related to CSS JIT.
3308         This patch enables filterRootId even in the environment
3309         where CSS JIT is not enabled.
3310
3311         * dom/SelectorQuery.cpp:
3312         (WebCore::filterRootById):
3313         (WebCore::SelectorDataList::executeSingleSelectorData):
3314         (WebCore::SelectorDataList::execute):
3315         * dom/SelectorQuery.h:
3316
3317 2015-03-18  Zalan Bujtas  <zalan@apple.com>
3318
3319         Simple line layout: Use Vector<>::const_iterator instead of custom FlowContents::Iterator.
3320         https://bugs.webkit.org/show_bug.cgi?id=142809
3321
3322         Reviewed by Antti Koivisto.
3323
3324         FlowContents::Iterator simply iterates on a vector<>. No need to custom implement it.
3325
3326         No change in functionality.
3327
3328         * rendering/SimpleLineLayoutFlowContents.h:
3329         (WebCore::SimpleLineLayout::FlowContents::begin):
3330         (WebCore::SimpleLineLayout::FlowContents::end):
3331         (WebCore::SimpleLineLayout::FlowContents::Iterator::Iterator): Deleted.
3332         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator++): Deleted.
3333         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator--): Deleted.
3334         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator==): Deleted.
3335         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator!=): Deleted.
3336         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator*): Deleted.
3337         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator->): Deleted.
3338         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
3339         (WebCore::SimpleLineLayout::TextFragmentIterator::skipToNextPosition):
3340
3341 2015-03-18  Zalan Bujtas  <zalan@apple.com>
3342
3343         Simple line layout: Change FlowContents::segmentForPosition() to segmentForRun().
3344         https://bugs.webkit.org/show_bug.cgi?id=142785
3345
3346         Reviewed by Antti Koivisto.
3347
3348         This is in transition to support <br>. A particular position could point to multiple
3349         segments when <br> is directly followed by text.
3350
3351         No change in functionality.
3352
3353         * rendering/SimpleLineLayoutFlowContents.cpp:
3354         (WebCore::SimpleLineLayout::FlowContents::segmentIndexForRunSlow):
3355         (WebCore::SimpleLineLayout::FlowContents::segmentIndexForPositionSlow): Deleted.
3356         * rendering/SimpleLineLayoutFlowContents.h:
3357         (WebCore::SimpleLineLayout::FlowContents::segmentForRun):
3358         (WebCore::SimpleLineLayout::FlowContents::segmentIndexForPosition): Deleted.
3359         (WebCore::SimpleLineLayout::FlowContents::segmentForPosition): Deleted.
3360         * rendering/SimpleLineLayoutResolver.cpp:
3361         (WebCore::SimpleLineLayout::RunResolver::Run::text):
3362
3363 2015-03-17  Simon Fraser  <simon.fraser@apple.com>
3364
3365         Skip trying to paint overlay scrollbars when there are none or they are clipped out
3366         https://bugs.webkit.org/show_bug.cgi?id=142811
3367         rdar://problem/20200725
3368
3369         Reviewed by Darin Adler.
3370
3371         In some content with lots of layers and overflow:scroll, we could spend 20% of
3372         the time under paintOverflowControlsForFragments() setting up an (empty) clip,
3373         and then trying to draw scrollbars that we don't have.
3374         
3375         Avoid calling paintOverflowControlsForFragments() if there are no scrollbars,
3376         and don't both setting up an empty clip just to paint nothing.
3377
3378         * rendering/RenderLayer.cpp:
3379         (WebCore::RenderLayer::paintLayerContents):
3380         (WebCore::RenderLayer::paintOverflowControlsForFragments):
3381
3382 2015-03-18  Per Arne Vollan  <peavo@outlook.com>
3383
3384         [WinCairo] Unreviewed build fix after r181665.
3385
3386         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
3387         (WebCore::MediaPlayerPrivateMediaFoundation::setSize):
3388
3389 2015-03-18  Joseph Pecoraro  <pecoraro@apple.com>
3390
3391         Remove unused "preprocessor" parameter to sub-CodeGenerators
3392         https://bugs.webkit.org/show_bug.cgi?id=142793
3393
3394         Reviewed by Darin Adler.
3395
3396         * bindings/scripts/CodeGenerator.pm:
3397         (ProcessDocument):
3398         (FileNamePrefix):
3399         * bindings/scripts/CodeGeneratorObjC.pm:
3400
3401 2015-03-18  Zalan Bujtas  <zalan@apple.com>
3402
3403         Simple line layout: Split fragments on renderer boundary on the fly.
3404         https://bugs.webkit.org/show_bug.cgi?id=142579
3405
3406         Reviewed by Antti Koivisto.
3407
3408         Fragment splitting at renderers' boundary at the end of the line is no longer needed.
3409         This patch ensures that TextFragmentIterator::nextTextFragment() does not concatenate
3410         fragments across renderer boundary.
3411
3412         Test: fast/text/simple-line-with-multiple-renderers.html
3413
3414         * rendering/SimpleLineLayout.cpp:
3415         (WebCore::SimpleLineLayout::revertRuns):
3416         (WebCore::SimpleLineLayout::LineState::isEmpty):
3417         (WebCore::SimpleLineLayout::LineState::appendFragmentAndCreateRunIfNeeded): Check if fragments need a new run and
3418         whether neighboring fragments need collapsing.
3419         (WebCore::SimpleLineLayout::LineState::revertUncommitted): Revert fragments over multiple renderers if they form
3420         a fragment continuation.
3421         (WebCore::SimpleLineLayout::LineState::removeTrailingWhitespace):
3422         (WebCore::SimpleLineLayout::forceFragmentToLine): Ensure that if a fragment has continuation across multiple renderers,
3423         they all get added to the current line.
3424         (WebCore::SimpleLineLayout::createLineRuns):
3425         (WebCore::SimpleLineLayout::LineState::appendFragment): Deleted.
3426         (WebCore::SimpleLineLayout::FragmentForwardIterator::FragmentForwardIterator): Deleted.
3427         (WebCore::SimpleLineLayout::FragmentForwardIterator::operator++): Deleted.
3428         (WebCore::SimpleLineLayout::FragmentForwardIterator::operator!=): Deleted.
3429         (WebCore::SimpleLineLayout::FragmentForwardIterator::operator*): Deleted.
3430         (WebCore::SimpleLineLayout::begin): Deleted.
3431         (WebCore::SimpleLineLayout::end): Deleted.
3432         (WebCore::SimpleLineLayout::preWrap): Deleted.
3433         (WebCore::SimpleLineLayout::removeTrailingWhitespace): Deleted.
3434         (WebCore::SimpleLineLayout::updateLineConstrains): Deleted.
3435         (WebCore::SimpleLineLayout::splitRunsAtRendererBoundary): Deleted.
3436         (WebCore::SimpleLineLayout::createTextRuns): Deleted.
3437         (WebCore::SimpleLineLayout::create): Deleted.
3438         (WebCore::SimpleLineLayout::Layout::create): Deleted.
3439         * rendering/SimpleLineLayoutFlowContents.h:
3440         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator+):
3441         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator*):
3442         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator->):
3443         * rendering/SimpleLineLayoutFunctions.cpp:
3444         (WebCore::SimpleLineLayout::paintFlow): Unrelated fix on non-collapsed tab position.
3445         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
3446         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragmentIterator):
3447         (WebCore::SimpleLineLayout::TextFragmentIterator::nextTextFragment):
3448         (WebCore::SimpleLineLayout::TextFragmentIterator::revertToFragment):
3449         (WebCore::SimpleLineLayout::TextFragmentIterator::textWidth):
3450         (WebCore::SimpleLineLayout::TextFragmentIterator::skipToNextPosition):
3451         * rendering/SimpleLineLayoutTextFragmentIterator.h:
3452         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::TextFragment):
3453         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::overlapsToNextRenderer):
3454         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::isCollapsible):
3455         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::operator==):
3456         (WebCore::SimpleLineLayout::TextFragmentIterator::isLineBreak):
3457         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::split): Deleted.
3458
3459 2015-03-18  Manuel Rego Casasnovas  <rego@igalia.com>
3460
3461         Flex and grid items should be painted as inline-blocks
3462         https://bugs.webkit.org/show_bug.cgi?id=142266
3463
3464         Reviewed by Darin Adler.
3465
3466         Based on Blink r157004 by <cbiesinger@chromium.org>.
3467         https://src.chromium.org/viewvc/blink?revision=157004&view=revision
3468
3469         Both flexbox and grid specs define that the painting order of flex/grid
3470         items is the same as inline blocks. See
3471         http://dev.w3.org/csswg/css-flexbox/#painting and
3472         http://dev.w3.org/csswg/css-grid/#z-order.
3473
3474         Extracted inline blocks painting code from InlineElementBox and moved to
3475         a helper method that will be reused for flexboxes and grids.
3476
3477         Tests: css3/flexbox/flex-item-text-background-not-interleaved.html
3478                fast/css-grid-layout/grid-item-text-background-not-interleaved.html
3479
3480         * rendering/InlineElementBox.cpp:
3481         (WebCore::InlineElementBox::paint): Move code to
3482         RenderElement::paintAsInlineBlock().
3483         * rendering/RenderBlock.cpp:
3484         (WebCore::RenderBlock::paintChild): Add new argument to paint children
3485         as inline blocks.
3486         * rendering/RenderBlock.h: Define PaintType enmu and modify paintChild()
3487         signature to add the new argument.
3488         * rendering/RenderElement.cpp:
3489         (WebCore::paintPhase): Paint element in a phase.
3490         (WebCore::RenderElement::paintAsInlineBlock): Code extracted from
3491         InlineElementBox::paint().
3492         * rendering/RenderElement.h: Add new method signature.
3493         * rendering/RenderFlexibleBox.cpp:
3494         (WebCore::RenderFlexibleBox::paintChildren): Call
3495         RenderBlock::paintChild() with the new argument.
3496         * rendering/RenderGrid.cpp:
3497         (WebCore::RenderGrid::paintChildren): Ditto.
3498
3499 2015-03-18  Chris Dumez  <cdumez@apple.com>
3500
3501         [WK2] Log total number of network cache queries using diagnostic logging
3502         https://bugs.webkit.org/show_bug.cgi?id=142803
3503         <rdar://problem/19632130>
3504
3505         Reviewed by Antti Koivisto.
3506
3507         Add diagnostic logging key needed for network efficacy logging.
3508
3509         * page/DiagnosticLoggingKeys.cpp:
3510         (WebCore::DiagnosticLoggingKeys::retrievalRequestKey):
3511         * page/DiagnosticLoggingKeys.h:
3512
3513 2015-03-18  Tim Horton  <timothy_horton@apple.com>
3514
3515         Fix the build after r181660
3516
3517         * page/EventHandler.cpp:
3518         (WebCore::EventHandler::setImmediateActionStage):
3519         * page/EventHandler.h:
3520         (WebCore::EventHandler::setImmediateActionStage):
3521         Un-inline setImmediateActionStage, because it is exported to WebCore, and
3522         exporting inline thing causes random weak symbol errors on some platforms.
3523
3524 2015-03-17  Conrad Shultz  <conrad_shultz@apple.com>
3525
3526         Ignore some deprecation warnings
3527         https://bugs.webkit.org/show_bug.cgi?id=142813
3528
3529         Reviewed by Mark Rowe.
3530
3531         Fixing the deprecations is tracked by: <rdar://problem/20201450>
3532
3533         * editing/cocoa/HTMLConverter.mm:
3534         (HTMLConverter::_processElement):
3535
3536 2015-03-17  Commit Queue  <commit-queue@webkit.org>
3537
3538         Unreviewed, rolling out r181667, r181682, and r181683.
3539         https://bugs.webkit.org/show_bug.cgi?id=142812
3540
3541         Broke multiple tests with ASan, plus dependent commits
3542         (Requested by ap on #webkit).
3543
3544         Reverted changesets:
3545
3546         "Simple line layout: Split fragments on renderer boundary on
3547         the fly."
3548         https://bugs.webkit.org/show_bug.cgi?id=142579
3549         http://trac.webkit.org/changeset/181667
3550
3551         "Simple line layout: Change FlowContents::segmentForPosition()
3552         to segmentForRun()."
3553         https://bugs.webkit.org/show_bug.cgi?id=142785
3554         http://trac.webkit.org/changeset/181682
3555
3556         "Simple line layout: Use Vector<>::const_iterator instead of
3557         custom FlowContents::Iterator."
3558         https://bugs.webkit.org/show_bug.cgi?id=142809
3559         http://trac.webkit.org/changeset/181683
3560
3561 2015-03-17  Zalan Bujtas  <zalan@apple.com>
3562
3563         Simple line layout: Use Vector<>::const_iterator instead of custom FlowContents::Iterator.
3564         https://bugs.webkit.org/show_bug.cgi?id=142809
3565
3566         Reviewed by Antti Koivisto.
3567
3568         FlowContents::Iterator simply iterates on a vector<>. No need to custom implement it.
3569
3570         No change in functionality.
3571
3572         * rendering/SimpleLineLayoutFlowContents.h:
3573         (WebCore::SimpleLineLayout::FlowContents::begin):
3574         (WebCore::SimpleLineLayout::FlowContents::end):
3575         (WebCore::SimpleLineLayout::FlowContents::Iterator::Iterator): Deleted.
3576         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator++): Deleted.
3577         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator--): Deleted.
3578         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator==): Deleted.
3579         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator!=): Deleted.
3580         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator*): Deleted.
3581         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator->): Deleted.
3582         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
3583         (WebCore::SimpleLineLayout::TextFragmentIterator::skipToNextPosition):
3584
3585 2015-03-17  Zalan Bujtas  <zalan@apple.com>
3586
3587         Simple line layout: Change FlowContents::segmentForPosition() to segmentForRun().
3588         https://bugs.webkit.org/show_bug.cgi?id=142785
3589
3590         Reviewed by Antti Koivisto.
3591
3592         This is in transition to support <br>. A particular position could point to multiple
3593         segments when <br> is directly followed by text.
3594
3595         No change in functionality.
3596
3597         * rendering/SimpleLineLayoutFlowContents.cpp:
3598         (WebCore::SimpleLineLayout::FlowContents::segmentIndexForRunSlow):
3599         (WebCore::SimpleLineLayout::FlowContents::segmentIndexForPositionSlow): Deleted.
3600         * rendering/SimpleLineLayoutFlowContents.h:
3601         (WebCore::SimpleLineLayout::FlowContents::segmentForRun):
3602         (WebCore::SimpleLineLayout::FlowContents::segmentIndexForPosition): Deleted.
3603         (WebCore::SimpleLineLayout::FlowContents::segmentForPosition): Deleted.
3604         * rendering/SimpleLineLayoutResolver.cpp:
3605         (WebCore::SimpleLineLayout::RunResolver::Run::text):
3606
3607 2015-03-17  Chris Dumez  <cdumez@apple.com>
3608
3609         [Mac][iOS] setSharedTimerFireInterval() / stopSharedTimer() are expensive
3610         https://bugs.webkit.org/show_bug.cgi?id=142752
3611         <rdar://problem/20176731>
3612
3613         Reviewed by Antti Koivisto.
3614
3615         setSharedTimerFireInterval() / stopSharedTimer() are expensive on Mac
3616         and iOS on pages using a lot of timers.
3617
3618         For example, on bing.com / iOS, ~15.4% of the CPU time is spent in
3619         setSharedTimerFireInterval() and ~14.7% of the CPU time is spent in
3620         stopSharedTimer(). The expensive calls are CFRunLoopAddTimer (11.4%),
3621         CFRunLoopTimerInvalidate (14.1%), CFRunLoopTimerCreate (3.3%).
3622
3623         The issue is that we keep creating, adding to run loop modes, and then
3624         destroying the sharedTimer for each firing event. This is very
3625         expensive. In such case, the CFRunLoopTimerRef documentation advises to
3626         """
3627         ... create a repeating timer with an initial firing time in the distant
3628         future (or the initial firing time) and a very large repeat interval—on
3629         the order of decades or more—and add it to all the necessary run loop
3630         modes. Then, when you know when the timer should fire next, you reset
3631         the firing time with CFRunLoopTimerSetNextFireDate, perhaps from the
3632         timer’s own callback function. This technique effectively produces a
3633         reusable, asynchronous timer.
3634         """ [1].
3635
3636         Doing so greatly decreases CPU time spend in:
3637         - setSharedTimerFireInterval(): 15.4% -> 4.6%
3638         - stopSharedTimer(): 14.6% -> 8.6%
3639
3640         Overall CPU time spent on bing.com in timerFired() goes down from
3641         ~61.2% to ~49.5%.
3642
3643         This patch also refactors the SharedTimer code to share as much as
3644         possible between Mac and iOS.
3645
3646         This patch is based in part on the following patch:
3647         http://trac.webkit.org/changeset/143210
3648
3649         [1] https://developer.apple.com/library/prerelease/ios/documentation/CoreFoundation/Reference/CFRunLoopTimerRef/index.html#//apple_ref/c/func/CFRunLoopTimerSetNextFireDate
3650
3651         * WebCore.xcodeproj/project.pbxproj:
3652         * platform/SharedTimer.h:
3653         (WebCore::SharedTimer::invalidate):
3654         (WebCore::MainThreadSharedTimer::setFiredFunction): Deleted.
3655         (WebCore::MainThreadSharedTimer::setFireInterval): Deleted.
3656         (WebCore::MainThreadSharedTimer::stop): Deleted.
3657         * platform/ThreadTimers.cpp:
3658         (WebCore::ThreadTimers::fireTimersInNestedEventLoop):
3659         * platform/cf/SharedTimerCF.mm: Added.
3660         (WebCore::applicationDidBecomeActive):
3661         (WebCore::setupPowerObserver):
3662         (WebCore::setSharedTimerFiredFunction):
3663         (WebCore::timerFired):
3664         (WebCore::restartSharedTimer):
3665         (WebCore::invalidateSharedTimer):
3666         (WebCore::setSharedTimerFireInterval):
3667         (WebCore::stopSharedTimer):
3668         * platform/efl/SharedTimerEfl.cpp:
3669         (WebCore::invalidateSharedTimer):
3670         * platform/gtk/SharedTimerGtk.cpp:
3671         (WebCore::invalidateSharedTimer):
3672         * platform/ios/SharedTimerIOS.mm: Removed.
3673         * platform/mac/PowerObserverMac.h: Copied from Source/WebCore/platform/efl/SharedTimerEfl.cpp.
3674         * platform/mac/PowerObserverMac.mm: Renamed from Source/WebCore/platform/mac/SharedTimerMac.mm.
3675         (WebCore::PowerObserver::PowerObserver):
3676         (WebCore::PowerObserver::~PowerObserver):
3677         (WebCore::PowerObserver::didReceiveSystemPowerNotification):
3678         * platform/win/SharedTimerWin.cpp:
3679         (WebCore::removeSharedTimer):
3680
3681 2015-03-17  Tim Horton  <timothy_horton@apple.com>
3682
3683         Cannot invoke action menus anymore
3684         https://bugs.webkit.org/show_bug.cgi?id=142797
3685         <rdar://problem/20032670>
3686
3687         Reviewed by Beth Dakin.
3688
3689         * platform/spi/mac/NSMenuSPI.h:
3690         Add additional NSMenu SPI.
3691
3692 2015-03-17  Zalan Bujtas  <zalan@apple.com>
3693
3694         Simple line layout: Split fragments on renderer boundary on the fly.
3695         https://bugs.webkit.org/show_bug.cgi?id=142579
3696
3697         Reviewed by Antti Koivisto.
3698
3699         Fragment splitting at renderers' boundary at the end of the line is no longer needed.
3700         This patch ensures that TextFragmentIterator::nextTextFragment() does not concatenate
3701         fragments across renderer boundary.
3702
3703         Test: fast/text/simple-line-with-multiple-renderers.html
3704
3705         * rendering/SimpleLineLayout.cpp:
3706         (WebCore::SimpleLineLayout::revertRuns):
3707         (WebCore::SimpleLineLayout::LineState::isEmpty):
3708         (WebCore::SimpleLineLayout::LineState::appendFragmentAndCreateRunIfNeeded): Check if fragments need a new run and
3709         whether neighboring fragments need collapsing.
3710         (WebCore::SimpleLineLayout::LineState::revertUncommitted): Revert fragments over multiple renderers if they form
3711         a fragment continuation.
3712         (WebCore::SimpleLineLayout::LineState::removeTrailingWhitespace):
3713         (WebCore::SimpleLineLayout::forceFragmentToLine): Ensure that if a fragment has continuation across multiple renderers,
3714         they all get added to the current line.
3715         (WebCore::SimpleLineLayout::createLineRuns):
3716         (WebCore::SimpleLineLayout::LineState::appendFragment): Deleted.
3717         (WebCore::SimpleLineLayout::FragmentForwardIterator::FragmentForwardIterator): Deleted.
3718         (WebCore::SimpleLineLayout::FragmentForwardIterator::operator++): Deleted.
3719         (WebCore::SimpleLineLayout::FragmentForwardIterator::operator!=): Deleted.
3720         (WebCore::SimpleLineLayout::FragmentForwardIterator::operator*): Deleted.
3721         (WebCore::SimpleLineLayout::begin): Deleted.
3722         (WebCore::SimpleLineLayout::end): Deleted.
3723         (WebCore::SimpleLineLayout::preWrap): Deleted.
3724         (WebCore::SimpleLineLayout::removeTrailingWhitespace): Deleted.
3725         (WebCore::SimpleLineLayout::updateLineConstrains): Deleted.
3726         (WebCore::SimpleLineLayout::splitRunsAtRendererBoundary): Deleted.
3727         (WebCore::SimpleLineLayout::createTextRuns): Deleted.
3728         (WebCore::SimpleLineLayout::create): Deleted.
3729         (WebCore::SimpleLineLayout::Layout::create): Deleted.
3730         * rendering/SimpleLineLayoutFlowContents.h:
3731         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator+):
3732         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator*):
3733         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator->):
3734         * rendering/SimpleLineLayoutFunctions.cpp:
3735         (WebCore::SimpleLineLayout::paintFlow): Unrelated fix on non-collapsed tab position.
3736         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
3737         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragmentIterator):
3738         (WebCore::SimpleLineLayout::TextFragmentIterator::nextTextFragment):
3739         (WebCore::SimpleLineLayout::TextFragmentIterator::revertToFragment):
3740         (WebCore::SimpleLineLayout::TextFragmentIterator::textWidth):
3741         (WebCore::SimpleLineLayout::TextFragmentIterator::skipToNextPosition):
3742         * rendering/SimpleLineLayoutTextFragmentIterator.h:
3743         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::TextFragment):
3744         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::overlapsToNextRenderer):
3745         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::isCollapsible):
3746         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::operator==):
3747         (WebCore::SimpleLineLayout::TextFragmentIterator::isLineBreak):
3748         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::split): Deleted.
3749
3750 2015-03-17  Jeremy Jones  <jeremyj@apple.com>
3751
3752         When tab hides, pause fullscreen and exit normally.
3753         https://bugs.webkit.org/show_bug.cgi?id=142685
3754
3755         Reviewed by Eric Carlson.
3756
3757         Pause fullscreen playback when switching tabs. Exit fullscreen is not necessary and even prevents
3758         the normal flow of teardown. This allows the normal exit fullscreen call to succeed and call its callback.
3759
3760         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
3761         (WebVideoFullscreenInterfaceAVKit::requestHideAndExitFullscreen):
3762
3763 2015-03-17  Per Arne Vollan  <peavo@outlook.com>
3764
3765         [WinCairo] Video position is incorrect when located inside a frame.
3766         https://bugs.webkit.org/show_bug.cgi?id=142784
3767
3768         Reviewed by Brent Fulgham.
3769
3770         We need to take the enclosing frame's position into account, when finding the video position.
3771
3772         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
3773         (WebCore::MediaPlayerPrivateMediaFoundation::setSize):
3774
3775 2015-03-17  Benjamin Poulain  <bpoulain@apple.com>
3776
3777         Compile character ranges targeting the same state as range check in the bytecode
3778         https://bugs.webkit.org/show_bug.cgi?id=142759
3779
3780         Reviewed by Alex Christensen.
3781
3782         Previously, character ranges would be compiled as many individual character checks.
3783         For example, a transition on "[a-z]" would do 26 character checks + jump, which leads
3784         to enormous matchines.
3785
3786         With this patch, we find the ranges at lowering time and generate a single instruction
3787         for them: "CheckValueRange". This helps making the machine denser when the input
3788         use character sets.
3789
3790         The second part of this patch goes further in the case where the transitions out of
3791         a state cover the entire alphabet. In that case, we create a fallback transition
3792         on the fly and remove all the ranges made useless.
3793         That case is common when ranges are used with inverse character set (e.g. [^a]+a).
3794
3795         * contentextensions/DFABytecode.h:
3796         (WebCore::ContentExtensions::instructionSizeWithArguments):
3797         * contentextensions/DFABytecodeCompiler.cpp:
3798         (WebCore::ContentExtensions::DFABytecodeCompiler::emitCheckValueRange):
3799         (WebCore::ContentExtensions::DFABytecodeCompiler::compileNode):
3800         (WebCore::ContentExtensions::DFABytecodeCompiler::compileNodeTransitions):
3801         (WebCore::ContentExtensions::DFABytecodeCompiler::compileCheckForRange):
3802         * contentextensions/DFABytecodeCompiler.h:
3803         Extend the compiler to detect ranges and lower them as CheckValueRange.
3804
3805         * contentextensions/DFABytecodeInterpreter.cpp:
3806         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
3807         Range checks in the interpreter.
3808
3809         * contentextensions/NFA.cpp:
3810         (WebCore::ContentExtensions::NFA::setFinal):
3811         This assertion does not make sense with the current codebase. Actions are "compressed",
3812         it is possible to have two patterns with the same action.
3813
3814         * contentextensions/NFAToDFA.cpp:
3815         (WebCore::ContentExtensions::simplifyTransitions):
3816         A very simple DFA optimization function: it only reduce the strength of ranges.
3817
3818         (WebCore::ContentExtensions::NFAToDFA::convert):
3819
3820 2015-03-17  Jer Noble  <jer.noble@apple.com>
3821
3822         REGRESSION (r181423): Crash @ generatedcontent.org at com.apple.WebCore: WebCore::MediaPlayer::maximumDurationToCacheMediaTime const + 4
3823         https://bugs.webkit.org/show_bug.cgi?id=142787
3824
3825         Reviewed by Eric Carlson.
3826
3827         Null check m_player before derefencing.
3828
3829         * html/HTMLMediaElement.cpp:
3830         (WebCore::HTMLMediaElement::parseAttribute):
3831
3832 2015-03-17  Beth Dakin  <bdakin@apple.com>
3833
3834         DOM mouse events have weird timing for force clickable elements in Safari 8.0.3 on 
3835         10.10.2
3836         https://bugs.webkit.org/show_bug.cgi?id=142700
3837         -and corresponding-
3838         rdar://problem/20165168
3839
3840         Reviewed by Tim Horton.
3841
3842         This patch adds a new enum and member variable so that EventHandler can keep track 
3843         of the current immediate action state.
3844         * page/EventHandler.cpp:
3845         (WebCore::EventHandler::EventHandler):
3846
3847         A new mouse press even is starting. We can re-set m_immediateActionStage to none 
3848         unless a Hit Test has already been performed.
3849         (WebCore::EventHandler::handleMousePressEvent):
3850
3851         If an immediate action was completed, then send mouse to the DOM and return early. 
3852         This will prevent us from doing our own normal mouseup behaviors such as 
3853         navigating to a link that was clicked — we only want to do that if the click was 
3854         not used to perform an immediate action.
3855         (WebCore::EventHandler::handleMouseReleaseEvent):
3856         * page/EventHandler.h:
3857         (WebCore::EventHandler::setImmediateActionStage):
3858
3859 2015-03-17  Joseph Pecoraro  <pecoraro@apple.com>
3860
3861         Use a better parameter name for Document.getElementsByClassName
3862         https://bugs.webkit.org/show_bug.cgi?id=142771
3863
3864         Reviewed by Chris Dumez.
3865
3866         * bindings/objc/PublicDOMInterfaces.h:
3867         * dom/Document.idl:
3868
3869 2015-03-17  Timothy Horton  <timothy_horton@apple.com>
3870
3871         Reproducible null deref under ScriptedAnimationController::createDisplayRefreshMonitor
3872         https://bugs.webkit.org/show_bug.cgi?id=142776
3873         <rdar://problem/18921338>
3874
3875         Reviewed by Alexey Proskuryakov.
3876
3877         Test: fast/animation/request-animation-frame-unparented-iframe-crash.html
3878
3879         In some cases (like the new test), we can end up trying to start
3880         requestAnimationFrame on a Document that has no Page. Most paths null-checked
3881         the Page and did the right thing, but one failed to do so. In addition,
3882         the current fallback (when Page is null) can result in us constructing
3883         the wrong kind of DisplayRefreshMonitor, which could lead to trouble
3884         down the road when it's reused. Instead, just completely avoid making a
3885         DisplayRefreshMonitor in the null-page case.
3886
3887         * dom/ScriptedAnimationController.cpp:
3888         (WebCore::ScriptedAnimationController::createDisplayRefreshMonitor):
3889         If the page is null, bail.
3890
3891         * dom/ScriptedAnimationController.h:
3892         * platform/graphics/DisplayRefreshMonitor.cpp:
3893         (WebCore::DisplayRefreshMonitor::create):
3894         Use Optional<> to make it easy to distinguish between ChromeClient
3895         being unreachable (because we don't have a Page for some reason) and
3896         ChromeClient declaring that it doesn't want to override the type of
3897         DisplayRefreshMonitor that is created.
3898
3899         If ChromeClient was unreachable for some reason, we'll get back an engaged
3900         nullptr and return it (instead of creating a DisplayRefreshMonitor based
3901         on the platform). This avoids creating the wrong type of DisplayRefreshMonitor
3902         in the rare case where we can't reach the ChromeClient (e.g. a freshly unparented
3903         IFrame).
3904
3905         If instead the client returns a disengaged Nullopt, we'll interpret that as
3906         "construct the default type", which falls back on the platform #ifdefs to
3907         decide what to make.
3908
3909         * platform/graphics/DisplayRefreshMonitorManager.cpp:
3910         (WebCore::DisplayRefreshMonitorManager::ensureMonitorForClient):
3911         (WebCore::DisplayRefreshMonitorManager::scheduleAnimation):
3912         Silently handle the case where we failed to make a DisplayRefreshMonitor.
3913
3914         * platform/graphics/DisplayRefreshMonitor.h:
3915         * platform/graphics/DisplayRefreshMonitorClient.h:
3916         * platform/graphics/GraphicsLayerUpdater.cpp:
3917         (WebCore::GraphicsLayerUpdater::createDisplayRefreshMonitor):
3918         * platform/graphics/GraphicsLayerUpdater.h:
3919         * rendering/RenderLayerCompositor.cpp:
3920         (WebCore::RenderLayerCompositor::createDisplayRefreshMonitor):
3921         * rendering/RenderLayerCompositor.h:
3922         Adjust to the new signature of createDisplayRefreshMonitor, and return
3923         an engaged (nullptr) Optional if we can't get to ChromeClient for any reason.
3924
3925         * page/ChromeClient.h:
3926         Return Nullopt (indicating a lack of override) by default.
3927
3928 2015-03-17  Dean Jackson  <dino@apple.com>
3929
3930         Implement Scroll Container Animation Triggers
3931         https://bugs.webkit.org/show_bug.cgi?id=142732
3932
3933         Attempt to fix the build.
3934
3935         * css/CSSComputedStyleDeclaration.cpp: Add an #if ENABLE guard.
3936
3937 2015-03-17  Dean Jackson  <dino@apple.com>
3938
3939         Implement Scroll Container Animation Triggers
3940         https://bugs.webkit.org/show_bug.cgi?id=142732
3941
3942         Reviewed by Simon Fraser.
3943
3944         Test: animations/trigger-container-scroll-simple.html
3945
3946         Basic implementation of container-scroll. It only checks
3947         the page scroll position for trigger values (not the scrolling
3948         container in an overflow).
3949
3950         * css/CSSComputedStyleDeclaration.cpp: Add CSSPropertyWebkitAnimationTrigger
3951         so that this property will appear in the inspector.
3952
3953         * page/FrameView.cpp:
3954         (WebCore::FrameView::sendScrollEvent): If the page has scrolled, let the animation
3955         controller know about it.
3956
3957         * page/animation/AnimationBase.cpp:
3958         (WebCore::AnimationBase::updateStateMachine): Whitespace fix.
3959         (WebCore::AnimationBase::fireAnimationEventsIfNeeded): If there is a trigger,
3960         and the scroll position is past it, then tell the state machine that
3961         we should start.
3962         (WebCore::AnimationBase::timeToNextService): Use the scroll position as
3963         an input to the update timer if a trigger is involved.
3964
3965         * page/animation/AnimationController.cpp:
3966         (WebCore::AnimationControllerPrivate::ensureCompositeAnimation): Add whitespace.