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