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