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