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