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