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