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