e52155f61719b7c0b8c8c92d964716b483c75341
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2015-03-19  Dean Jackson  <dino@apple.com>
2
3         CSS Animations with triggers should map scroll position to duration
4         https://bugs.webkit.org/show_bug.cgi?id=142870
5         <rdar://problem/20227244>
6
7         Reviewed by Simon Fraser.
8
9         Expose a prototype implementation of what will eventually be called
10         animation-timebase, mapping the scroll location to the duration of an
11         animation. This only applies if the animation has a start and end
12         trigger.
13
14         Test: animations/trigger-container-scroll-boundaries.html
15
16         * css/CSSComputedStyleDeclaration.cpp:
17         (WebCore::createAnimationTriggerValue): Change to downcast.
18
19         * css/CSSToStyleMap.cpp:
20         (WebCore::CSSToStyleMap::mapAnimationTrigger): Fix a bug where I wasn't
21         telling the ScrollAnimationTrigger object whether or not it had
22         an end value. This wasn't visible before because we were not using
23         the end value.
24
25         * page/animation/AnimationBase.cpp:
26         (WebCore::AnimationBase::fireAnimationEventsIfNeeded): Add a comment and
27         change to using a downcast.
28         (WebCore::AnimationBase::timeToNextService): Change to downcast.
29         (WebCore::AnimationBase::freezeAtTime): Whitespace cleanup.
30         (WebCore::AnimationBase::getElapsedTime): Calculate the elapsedTime based
31         on the scroll position relative to the start and end trigger spots.
32
33         * page/animation/AnimationController.cpp:
34         (WebCore::AnimationControllerPrivate::updateAnimations): Since this
35         can potentially call into beginAnimationUpdateTime, it should have
36         an update blocker. This fixes the assert we were seeing in tests.
37         (WebCore::AnimationControllerPrivate::scrollWasUpdated): Keep track of the scroll
38         position so we don't need to ask for it all the time.
39         * page/animation/AnimationControllerPrivate.h:
40         (WebCore::AnimationControllerPrivate::scrollPosition): New accessor.
41
42         * platform/animation/AnimationTrigger.h: Add downcast macros.
43         (WebCore::ScrollAnimationTrigger::create): Calculate hasEndValue from the passed
44         parameters rather than a separate value.
45         (WebCore::ScrollAnimationTrigger::hasEndValue):
46         (WebCore::ScrollAnimationTrigger::ScrollAnimationTrigger):
47         (WebCore::ScrollAnimationTrigger::setHasEndValue): Deleted.
48
49         * platform/graphics/ca/GraphicsLayerCA.cpp:
50         (WebCore::GraphicsLayerCA::animationCanBeAccelerated): If we have an
51         animation of this sort, we can't use a CAAnimation.
52
53 2015-03-19  Eric Carlson  <eric.carlson@apple.com>
54
55         [Mac] Move MediaPlaybackTargetPicker
56         https://bugs.webkit.org/show_bug.cgi?id=142889
57
58         Move WebMediaPlaybackTargetPickerProxy from WK2 and rename as MediaPlaybackTargetPicker so it
59         can be used by both WK2 and WK1.
60
61         Reviewed by Tim Horton.
62
63         * WebCore.xcodeproj/project.pbxproj:
64         * platform/graphics/MediaPlaybackTargetPicker.cpp: Copied from Source/WebKit2/UIProcess/WebMediaPlaybackTargetPickerProxy.cpp.
65         * platform/graphics/MediaPlaybackTargetPicker.h: Copied from Source/WebKit2/UIProcess/WebMediaPlaybackTargetPickerProxy.h.
66         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.h: Copied from Source/WebKit2/UIProcess/mac/WebMediaPlaybackTargetPickerProxyMac.h.
67         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm: Copied from Source/WebKit2/UIProcess/mac/WebMediaPlaybackTargetPickerProxyMac.mm.
68
69 2015-03-19  Enrica Casucci  <enrica@apple.com>
70
71         REGRESSION (r109593): Clicking after last inline element could cause a crash.
72         https://bugs.webkit.org/show_bug.cgi?id=142880
73         rdar://problem/17222294
74
75         Reviewed by Ryosuke Niwa.
76
77         Test: editing/selection/click-after-last-inline-crash.html
78
79         * rendering/RootInlineBox.cpp:
80         (WebCore::RootInlineBox::closestLeafChildForLogicalLeftPosition):
81
82 2015-03-19  Enrica Casucci  <enrica@apple.com>
83
84         One more build fix after r181760.
85
86         * page/EventHandler.cpp:
87         (WebCore::EventHandler::handleDrag):
88
89 2015-03-19  Jessie Berlin  <jberlin@webkit.org>
90
91         Build fix after r181760.
92
93         * rendering/RenderAttachment.h:
94
95 2015-03-19  Jer Noble  <jer.noble@apple.com>
96
97         [WK2][Mac] Fullscreen animations with mismatched aspect ratios are "squished".
98         https://bugs.webkit.org/show_bug.cgi?id=142132
99
100         Reviewed by Tim Horton.
101
102         Add a new utility method to calculate a rect with a specific aspect ratio wrapping a smaller one.
103
104         * platform/graphics/GeometryUtilities.cpp:
105         (WebCore::smallestRectWithAspectRatioAroundRect):
106         * platform/graphics/GeometryUtilities.h:
107
108 2015-03-19  Chris Dumez  <cdumez@apple.com>
109
110         Get rid of "CachePolicyCache" cache policy
111         https://bugs.webkit.org/show_bug.cgi?id=142881
112
113         Reviewed by Antti Koivisto.
114
115         Get rid of "CachePolicyCache" cache policy as it is unused.
116
117         * loader/cache/CachePolicy.h:
118         * loader/cache/CachedResource.cpp:
119         (WebCore::CachedResource::mustRevalidateDueToCacheHeaders):
120         * page/DiagnosticLoggingKeys.cpp:
121         (WebCore::DiagnosticLoggingKeys::mustRevalidateIsExpiredKey): Deleted.
122         * page/DiagnosticLoggingKeys.h:
123
124 2015-03-19  Alex Christensen  <achristensen@webkit.org>
125
126         [Content Extensions] Test regular expression parse failures.
127         https://bugs.webkit.org/show_bug.cgi?id=142872
128
129         Reviewed by Benjamin Poulain.
130
131         * contentextensions/URLFilterParser.cpp:
132         (WebCore::ContentExtensions::GraphBuilder::finalize):
133         (WebCore::ContentExtensions::GraphBuilder::quantifyAtom):
134         (WebCore::ContentExtensions::URLFilterParser::addPattern):
135         (WebCore::ContentExtensions::URLFilterParser::statusString):
136         * contentextensions/URLFilterParser.h:
137         Changed failures that can never happen to assertions.
138
139 2015-03-19  Enrica Casucci  <enrica@apple.com>
140
141         Release build fix after https://trac.webkit.org/r181760.
142
143         Unreviewed.
144
145         * page/EventHandler.cpp:
146         (WebCore::EventHandler::handleDrag):
147
148 2015-03-19  Enrica Casucci  <enrica@apple.com>
149
150         <attachment> should put URLs on the pasteboard so that Finder can accept drops.
151         https://bugs.webkit.org/show_bug.cgi?id=142801
152         rdar://problem/19982527
153
154         Reviewed by Tim Horton.
155
156         Test: editing/pasteboard/drag-and-drop-attachment-contenteditable.html
157
158         This patch adds all the necessary support to write attachment elements into
159         the pasteboard, including the promised type.
160
161         * WebCore.xcodeproj/project.pbxproj:
162         * page/DragActions.h:
163         * page/DragClient.h:
164         (WebCore::DragClient::declareAndWriteAttachment):
165         * page/DragController.cpp:
166         (WebCore::DragController::draggableElement):
167         (WebCore::DragController::startDrag):
168         * page/DragController.h:
169         (WebCore::DragController::draggingAttachmentURL):
170         * page/EventHandler.cpp:
171         (WebCore::EventHandler::dragHysteresisExceeded):
172         (WebCore::EventHandler::handleDrag):
173         * page/mac/DragControllerMac.mm:
174         (WebCore::DragController::declareAndWriteAttachment):
175         * page/win/DragControllerWin.cpp:
176         (WebCore::DragController::declareAndWriteAttachment):
177         * platform/URL.cpp:
178         (WebCore::URL::fileURLWithFileSystemPath):
179         * platform/URL.h:
180         * rendering/HitTestResult.cpp:
181         (WebCore::HitTestResult::absoluteAttachmentURL):
182         * rendering/HitTestResult.h:
183
184 2015-03-19  Chris Dumez  <cdumez@apple.com>
185
186         Unreviewed, fix linking error after r181753.
187
188         Drop WEBCORE_EXPORT for Settings::minimumDOMTimerInterval() as it is
189         now inlined.
190
191         * page/Settings.h:
192         (WebCore::Settings::minimumDOMTimerInterval):
193
194 2015-03-19  Brady Eidson  <beidson@apple.com>
195
196         Part of content extensions should apply css selectors
197         https://bugs.webkit.org/show_bug.cgi?id=142604
198
199         Reviewed by Alex Christensen.
200
201         Add a new action for applying the cached global stylesheet.
202
203         * contentextensions/CompiledContentExtension.cpp:
204         (WebCore::ContentExtensions::CompiledContentExtension::globalDisplayNoneSelectors):
205
206         * contentextensions/ContentExtensionActions.h:
207
208         * contentextensions/ContentExtensionCompiler.cpp:
209         (WebCore::ContentExtensions::serializeActions):
210
211         * contentextensions/ContentExtensionParser.cpp:
212         (WebCore::ContentExtensions::loadAction):
213
214         * contentextensions/ContentExtensionRule.cpp:
215         (WebCore::ContentExtensions::Action::deserialize):
216         * contentextensions/ContentExtensionRule.h:
217         (WebCore::ContentExtensions::Action::Action):
218         (WebCore::ContentExtensions::Action::operator==):
219         (WebCore::ContentExtensions::Action::stringArgument):
220         (WebCore::ContentExtensions::Action::cssSelector): Deleted.
221
222         * contentextensions/ContentExtensionsBackend.cpp:
223         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
224
225         * loader/cache/CachedResourceLoader.cpp:
226         (WebCore::CachedResourceLoader::requestResource):
227
228 2015-03-19  Chris Dumez  <cdumez@apple.com>
229
230         Clean up DOMTimer related settings
231         https://bugs.webkit.org/show_bug.cgi?id=142837
232
233         Reviewed by Darin Adler.
234
235         Clean up DOMTimer related settings:
236         - Make default minimum timer interval 4ms instead of 10ms as all ports
237           were setting it to 4ms and the specifications says 4ms.
238         - Get rid of setters for default DOMTimer interval values as they are
239           not set anymore.
240         - Move default DOMTimer interval values from Settings to DOMTimer as
241           those are global (not per-page) and not really settings.
242         - Stop using abbreviations in the names (e.g. min -> minimum).
243         - Move DOMTimer settings members from Page to Settings. There is no
244           reason for those to be stored on the Page. The getters were private
245           so call-sites had to go via Settings anyway. Also, call-sites already
246           had to do a null check on the page to get the settings. It seems
247           unfortunate for the settings to do another null-check on the page for
248           retrieving the setting value from the page.
249         - Inline the DOMTimer settings getters as these are trivial.
250
251         * dom/Document.cpp:
252         (WebCore::Document::minimumTimerInterval):
253         (WebCore::Document::timerAlignmentInterval):
254         * dom/ScriptExecutionContext.cpp:
255         (WebCore::ScriptExecutionContext::minimumTimerInterval):
256         (WebCore::ScriptExecutionContext::timerAlignmentInterval):
257         * page/DOMTimer.h:
258         * page/Page.cpp:
259         (WebCore::Page::Page):
260         (WebCore::Page::setTimerThrottlingEnabled):
261         (WebCore::Page::setMinimumTimerInterval): Deleted.
262         (WebCore::Page::minimumTimerInterval): Deleted.
263         * page/Page.h:
264         (WebCore::Page::timerAlignmentInterval): Deleted.
265         * page/Settings.cpp:
266         (WebCore::Settings::Settings):
267         (WebCore::Settings::setMinimumDOMTimerInterval):
268         (WebCore::Settings::setDOMTimerAlignmentInterval):
269         (WebCore::Settings::setHiddenPageDOMTimerAlignmentInterval): Deleted.
270         (WebCore::Settings::hiddenPageDOMTimerAlignmentInterval): Deleted.
271         (WebCore::Settings::setDefaultMinDOMTimerInterval): Deleted.
272         (WebCore::Settings::defaultMinDOMTimerInterval): Deleted.
273         (WebCore::Settings::setMinDOMTimerInterval): Deleted.
274         (WebCore::Settings::minDOMTimerInterval): Deleted.
275         (WebCore::Settings::setDefaultDOMTimerAlignmentInterval): Deleted.
276         (WebCore::Settings::defaultDOMTimerAlignmentInterval): Deleted.
277         (WebCore::Settings::domTimerAlignmentInterval): Deleted.
278         * page/Settings.h:
279         (WebCore::Settings::minimumDOMTimerInterval):
280         (WebCore::Settings::domTimerAlignmentInterval):
281         * testing/InternalSettings.cpp:
282         (WebCore::InternalSettings::Backup::Backup):
283         (WebCore::InternalSettings::Backup::restoreTo):
284         (WebCore::InternalSettings::setMinimumTimerInterval):
285
286 2015-03-19  Carlos Garcia Campos  <cgarcia@igalia.com>
287
288         [GTK] Scrollbars look bad with GTK+ 3.16
289         https://bugs.webkit.org/show_bug.cgi?id=140800
290
291         Reviewed by Sergio Villar Senin.
292
293         Take margin into account when rendering scrollbars. This fixes the
294         huge scrollbars rendered with GTK+ 3.16. We don't need to check
295         the GTK+ version because in previous versions the marging were 0,
296         so the same code just works.
297
298         * platform/gtk/ScrollbarThemeGtk.cpp:
299         (WebCore::adjustRectAccordingToMargin):
300         (WebCore::ScrollbarThemeGtk::paintTrackBackground):
301         (WebCore::ScrollbarThemeGtk::paintThumb):
302
303 2015-03-19  Xabier Rodriguez Calvar <calvaris@igalia.com> and Youenn Fablet  <youenn.fablet@crf.canon.fr>
304
305         [Streams API] Update ReadableStream API according new version of the specification
306         https://bugs.webkit.org/show_bug.cgi?id=142822
307
308         Reviewed by Benjamin Poulain.
309
310         This patch updates the IDL of ReadableStream according the new version of the spec, which splits functionality between ReadableStream and ReadableStreamReader.
311         In particular, this patch removes read(), ready, closed and state from ReadableStream and it adds the getReader method.
312
313         Covered by updated readablestream-constructor.html test.
314
315         * Modules/streams/ReadableStream.cpp:
316         (WebCore::ReadableStream::ReadableStream):
317         (WebCore::ReadableStream::state): Deleted.
318         (WebCore::ReadableStream::closed): Deleted.
319         (WebCore::ReadableStream::ready): Deleted.
320         * Modules/streams/ReadableStream.h:
321         (WebCore::ReadableStream::internalState): Added to make mac build system happy, to be used by ReadableStreamReader.
322         * Modules/streams/ReadableStream.idl:
323         * bindings/js/JSReadableStreamCustom.cpp:
324         (WebCore::JSReadableStream::cancel):
325         (WebCore::JSReadableStream::getReader):
326         (WebCore::JSReadableStream::read): Deleted.
327         (WebCore::getOrCreatePromiseDeferredFromObject): Deleted.
328         (WebCore::readyPromiseSlotName): Deleted.
329         (WebCore::JSReadableStream::ready): Deleted.
330         (WebCore::closedPromiseSlotName): Deleted.
331         (WebCore::JSReadableStream::closed): Deleted.
332
333 2015-03-18  Manuel Rego Casasnovas  <rego@igalia.com>
334
335         Unreviewed. GTK build fix after r181720.
336
337         * rendering/RenderImage.cpp:
338         (WebCore::RenderImage::styleDidChange):
339
340 2015-03-18  Antti Koivisto  <antti@apple.com>
341
342         Test disk cache behavior when using back navigation cache policy
343         https://bugs.webkit.org/show_bug.cgi?id=142848
344
345         Reviewed by Chris Dumez.
346
347         Add a way to override the normal cache policy so we can test reload behavior of cache without actually reloading.
348
349         Test: http/tests/cache/disk-cache-validation-back-navigation-policy.html
350
351         * loader/FrameLoader.cpp:
352         (WebCore::FrameLoader::addExtraFieldsToRequest):
353         * loader/FrameLoader.h:
354         (WebCore::FrameLoader::setOverrideCachePolicyForTesting):
355         * testing/Internals.cpp:
356         (WebCore::Internals::setOverrideCachePolicy):
357         * testing/Internals.h:
358         * testing/Internals.idl:
359
360 2015-03-18  Yusuke Suzuki  <utatane.tea@gmail.com>
361
362         TextFragment#start() is always >= 0 since its type is unsigned
363         https://bugs.webkit.org/show_bug.cgi?id=142860
364
365         Reviewed by Andreas Kling.
366
367         Since TextFragment::m_start is unsigned, the result of
368         TextFragment::start() is always >= 0 and assertion is not effective.
369         This patch removes this assertion to suppress warnings.
370
371         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
372         (WebCore::SimpleLineLayout::TextFragmentIterator::revertToFragment):
373
374 2015-03-18  Alex Christensen  <achristensen@webkit.org>
375
376         [ContentExtensions] Prepare for compiling stylesheets of selectors to be used on every page.
377         https://bugs.webkit.org/show_bug.cgi?id=142799
378
379         Reviewed by Brady Eidson.
380
381         * WebCore.xcodeproj/project.pbxproj:
382         Make private headers to use with API tests.
383         * contentextensions/CompiledContentExtension.cpp:
384         (WebCore::ContentExtensions::CompiledContentExtension::globalDisplayNoneSelectors):
385         * contentextensions/CompiledContentExtension.h:
386         Added method to get only the selectors from the root of the DFA, which apply to all URLs.
387         * contentextensions/ContentExtensionCompiler.cpp:
388         (WebCore::ContentExtensions::compileRuleList):
389         Added checking if the trigger will match everything.
390         These actions can be put directly on the root of the DFA without adding extra epsilon transitions to the NFA.
391         * contentextensions/DFA.h:
392         (WebCore::ContentExtensions::DFA::nodeAt):
393         * contentextensions/DFABytecodeInterpreter.cpp:
394         (WebCore::ContentExtensions::DFABytecodeInterpreter::actionsFromDFARoot):
395         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
396         * contentextensions/DFABytecodeInterpreter.h:
397         * contentextensions/NFA.h:
398         * contentextensions/URLFilterParser.cpp:
399         (WebCore::ContentExtensions::Term::quantifier):
400         Sink terms to a vector then add nodes to NFA when finalizing after checking for regexes that match everything.
401         (WebCore::ContentExtensions::GraphBuilder::GraphBuilder):
402         (WebCore::ContentExtensions::GraphBuilder::finalize):
403         (WebCore::ContentExtensions::GraphBuilder::parseStatus):
404         (WebCore::ContentExtensions::GraphBuilder::atomPatternCharacter):
405         (WebCore::ContentExtensions::GraphBuilder::atomBuiltInCharacterClass):
406         (WebCore::ContentExtensions::GraphBuilder::quantifyAtom):
407         (WebCore::ContentExtensions::GraphBuilder::atomBackReference):
408         (WebCore::ContentExtensions::GraphBuilder::assertionBOL):
409         (WebCore::ContentExtensions::GraphBuilder::assertionWordBoundary):
410         (WebCore::ContentExtensions::GraphBuilder::atomCharacterClassAtom):
411         (WebCore::ContentExtensions::GraphBuilder::atomCharacterClassRange):
412         (WebCore::ContentExtensions::GraphBuilder::atomCharacterClassBuiltIn):
413         (WebCore::ContentExtensions::GraphBuilder::atomParentheticalAssertionBegin):
414         (WebCore::ContentExtensions::GraphBuilder::disjunction):
415         (WebCore::ContentExtensions::GraphBuilder::hasError):
416         (WebCore::ContentExtensions::GraphBuilder::fail):
417         (WebCore::ContentExtensions::GraphBuilder::sinkFloatingTermIfNecessary):
418         (WebCore::ContentExtensions::URLFilterParser::addPattern):
419         (WebCore::ContentExtensions::URLFilterParser::statusString):
420         (WebCore::ContentExtensions::GraphBuilder::errorMessage): Deleted.
421         * contentextensions/URLFilterParser.h:
422         Use an enum instead of strings for the status to avoid checking strings when we have a regex that matches everything.
423
424 2015-03-18  Yusuke Suzuki  <utatane.tea@gmail.com>
425
426         Fix build failure due to FALLTHROUGH in unreachable code
427         https://bugs.webkit.org/show_bug.cgi?id=142703
428
429         Reviewed by Benjamin Poulain.
430
431         FALLTHROUGH should not exist in unreachable code marked by
432         ASSERT_NOT_REACHABLE.
433
434         When !ENABLE(CSS_SELECTOR_JIT) and Debug mode is enabled,
435         both ASSERT_NOT_REACHED and FALLTHROUGH are instantiated
436         and it cause build failure.
437
438         Here, since CompiledSingle/CompiledSingleWithRootFilter are
439         not set when !ENABLE(CSS_SELECTOR_JIT). So dropping FALLTHROUGH
440         and leave ASSERT_NOT_REACHED.
441         And since ASSERT_NOT_ReACHED is stripped when Release build,
442         I've inserted FALLTHROUGH() if ASSERT_DISABLED.
443         This fix is the same to r162906.
444
445         * dom/SelectorQuery.cpp:
446         (WebCore::SelectorDataList::execute):
447
448 2015-03-18  Said Abou-Hallawa  <sabouhallawa@apple.com>
449
450         Switching between two SVG images with no intrinsic sizes causes them to get the default SVG size instead of the container size.
451         https://bugs.webkit.org/show_bug.cgi?id=142805.
452
453         Reviewed by Darin Adler.
454         
455         The bug happens due to wrong logic in RenderImage::imageDimensionsChanged().
456         This function decides to setNeedsLayout() if the intrinsic size of the image
457         changes. If the size does not change, it only repaints the image rectangle.
458         When switching the src of the an image between two SVG images and both of
459         them have no intrinsic size, we do not updateInnerContentRect() and this
460         means an SVGImageForContainer is not going to be created for this image.
461         When the image is drawn, it is drawn directly from the SVGImage. And this
462         means the drawing has to be scaled by container_size / SVG_default_intrinsic_size
463         
464         After figuring out that I need to updateInnerContentRect() to fix this bug,
465         I found out Blink has already changed this code to do the same thing. But 
466         they also did more clean-up in this function. Here is the link
467         https://codereview.chromium.org/114323004. I think their change seems correct
468         although they did not say what exactly they were trying to fix.
469         
470         The plan for repaintOrMarkForLayout(), which is the new name of this function,
471         is the following:
472             -- setNeedLayout() if the intrinsic size changes and it affects the size
473                of the image.
474             -- updateInnerContentRect() if the intrinsic size did not change but the
475                image has exiting layout.
476             -- repaint the image rectangle if layout is not needed.
477             
478         This change also removes the call to computeLogicalWidthInRegion(), which is
479         almost running a layout for the image. This call figures out whether the image
480         needs to setNeedsLayout(). This call is unnecessary; the image needs to run a
481         layout if the intrinsic size has changed and it affects the size of the image.
482                     
483         Test: svg/as-image/svg-no-intrinsic-size-switching.html
484
485         * rendering/RenderImage.cpp:
486         (WebCore::RenderImage::styleDidChange): Change the function call.
487         (WebCore::RenderImage::imageChanged): Rename local variable and change the
488         function call.
489         
490         (WebCore::RenderImage::updateIntrinsicSizeIfNeeded): Simplify this function.
491         Call setIntrinsicSize() with the new size unless the image is in error state.
492         
493         (WebCore::RenderImage::repaintOrMarkForLayout): This a better name for this
494         function since it is called even if the intrinsic size was not changed.
495         (WebCore::RenderImage::imageDimensionsChanged): Deleted.
496         
497         * rendering/RenderImage.h: Rename imageDimensionsChanged() and change the 
498         updateIntrinsicSizeIfNeeded() to return void.
499         
500         * rendering/svg/RenderSVGForeignObject.cpp:
501         (WebCore::RenderSVGForeignObject::paint): Code cleanup. This function can
502         only handle the paint phases PaintPhaseForeground and PaintPhaseSelection.
503         Use this information to simplify the logic and order of painting there.
504
505 2015-03-18  Jeremy Jones  <jeremyj@apple.com>
506
507         Fix typo in playerViewControllerWillCancelOptimizedFullscree.
508         https://bugs.webkit.org/show_bug.cgi?id=142745
509
510         Reviewed by Darin Adler.
511
512         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
513         (-[WebAVPlayerController playerViewControllerWillCancelOptimizedFullscreen:]):
514         (-[WebAVPlayerController playerViewControllerWillCancelOptimizedFullscree:]): Deleted.
515
516 2015-03-18  Simon Fraser  <simon.fraser@apple.com>
517
518         Avoid repaints when changing transform on an element with multiple background images
519         https://bugs.webkit.org/show_bug.cgi?id=142841
520
521         Reviewed by Zalan Bujtas.
522         
523         Replace the cheap test for changed images in RenderElement::updateFillImages()
524         with an exhaustive test that walks the entire list of background images,
525         since any ensuing repaint is way more expensive than a slightly more expensive check here.
526         
527         Test: fast/repaint/multiple-backgrounds-style-change.html
528
529         * rendering/RenderElement.cpp:
530         (WebCore::RenderElement::updateFillImages):
531         * rendering/style/FillLayer.cpp:
532         (WebCore::layerImagesIdentical): See if both images are the same (either none
533         or both mask images, and same image pointer).
534         (WebCore::FillLayer::imagesIdentical): Walk the two FillLayer lists, checking the images
535         on each one. Returns false if we reach the end of one list before the other, or the images
536         are different.
537         * rendering/style/FillLayer.h: New static function; static because
538         it compares two FillLayer lists, and I think that makes more sense than
539         a member function.
540
541 2015-03-18  Anders Carlsson  <andersca@apple.com>
542
543         Pass cookies by reference in CookieHash functions
544         https://bugs.webkit.org/show_bug.cgi?id=142839
545
546         Reviewed by Sam Weinig.
547
548         * platform/Cookie.h:
549         (WebCore::CookieHash::hash):
550         (WebCore::CookieHash::equal):
551
552 2015-03-18  Tim Horton  <timothy_horton@apple.com>
553
554         Temporarily fix the !ENABLE(CSS_SELECTOR_JIT) and assertions-enabled build
555
556         * dom/SelectorQuery.cpp:
557         (WebCore::SelectorDataList::execute):
558
559 2015-03-18  Myles C. Maxfield  <mmaxfield@apple.com>
560
561         Call CTFontSetRenderingParameters before rendering text
562         https://bugs.webkit.org/show_bug.cgi?id=142816
563
564         Reviewed by Darin Adler.
565
566         No new tests.
567
568         * platform/graphics/cocoa/FontCascadeCocoa.mm:
569         (WebCore::showGlyphsWithAdvances):
570         * platform/spi/cocoa/CoreTextSPI.h:
571
572 2015-03-18  Chris Dumez  <cdumez@apple.com>
573
574         [WK2] Log the number of network cache requests that we have never seen before
575         https://bugs.webkit.org/show_bug.cgi?id=142828
576         <rdar://problem/19632130>
577
578         Reviewed by Antti Koivisto.
579
580         Add diagnostic logging key for network cache efficacy logging.
581
582         * page/DiagnosticLoggingKeys.cpp:
583         (WebCore::DiagnosticLoggingKeys::neverSeenBeforeKey):
584         (WebCore::DiagnosticLoggingKeys::requestKey):
585         * page/DiagnosticLoggingKeys.h:
586
587 2015-03-18  Yusuke Suzuki  <utatane.tea@gmail.com>
588
589         Use filterRootId in SelectorQuery even if CSS JIT is not enabled
590         https://bugs.webkit.org/show_bug.cgi?id=142703
591
592         Reviewed by Benjamin Poulain.
593
594         filterRootId pruning path is not inherently related to CSS JIT.
595         This patch enables filterRootId even in the environment
596         where CSS JIT is not enabled.
597
598         * dom/SelectorQuery.cpp:
599         (WebCore::filterRootById):
600         (WebCore::SelectorDataList::executeSingleSelectorData):
601         (WebCore::SelectorDataList::execute):
602         * dom/SelectorQuery.h:
603
604 2015-03-18  Zalan Bujtas  <zalan@apple.com>
605
606         Simple line layout: Use Vector<>::const_iterator instead of custom FlowContents::Iterator.
607         https://bugs.webkit.org/show_bug.cgi?id=142809
608
609         Reviewed by Antti Koivisto.
610
611         FlowContents::Iterator simply iterates on a vector<>. No need to custom implement it.
612
613         No change in functionality.
614
615         * rendering/SimpleLineLayoutFlowContents.h:
616         (WebCore::SimpleLineLayout::FlowContents::begin):
617         (WebCore::SimpleLineLayout::FlowContents::end):
618         (WebCore::SimpleLineLayout::FlowContents::Iterator::Iterator): Deleted.
619         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator++): Deleted.
620         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator--): Deleted.
621         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator==): Deleted.
622         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator!=): Deleted.
623         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator*): Deleted.
624         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator->): Deleted.
625         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
626         (WebCore::SimpleLineLayout::TextFragmentIterator::skipToNextPosition):
627
628 2015-03-18  Zalan Bujtas  <zalan@apple.com>
629
630         Simple line layout: Change FlowContents::segmentForPosition() to segmentForRun().
631         https://bugs.webkit.org/show_bug.cgi?id=142785
632
633         Reviewed by Antti Koivisto.
634
635         This is in transition to support <br>. A particular position could point to multiple
636         segments when <br> is directly followed by text.
637
638         No change in functionality.
639
640         * rendering/SimpleLineLayoutFlowContents.cpp:
641         (WebCore::SimpleLineLayout::FlowContents::segmentIndexForRunSlow):
642         (WebCore::SimpleLineLayout::FlowContents::segmentIndexForPositionSlow): Deleted.
643         * rendering/SimpleLineLayoutFlowContents.h:
644         (WebCore::SimpleLineLayout::FlowContents::segmentForRun):
645         (WebCore::SimpleLineLayout::FlowContents::segmentIndexForPosition): Deleted.
646         (WebCore::SimpleLineLayout::FlowContents::segmentForPosition): Deleted.
647         * rendering/SimpleLineLayoutResolver.cpp:
648         (WebCore::SimpleLineLayout::RunResolver::Run::text):
649
650 2015-03-17  Simon Fraser  <simon.fraser@apple.com>
651
652         Skip trying to paint overlay scrollbars when there are none or they are clipped out
653         https://bugs.webkit.org/show_bug.cgi?id=142811
654         rdar://problem/20200725
655
656         Reviewed by Darin Adler.
657
658         In some content with lots of layers and overflow:scroll, we could spend 20% of
659         the time under paintOverflowControlsForFragments() setting up an (empty) clip,
660         and then trying to draw scrollbars that we don't have.
661         
662         Avoid calling paintOverflowControlsForFragments() if there are no scrollbars,
663         and don't both setting up an empty clip just to paint nothing.
664
665         * rendering/RenderLayer.cpp:
666         (WebCore::RenderLayer::paintLayerContents):
667         (WebCore::RenderLayer::paintOverflowControlsForFragments):
668
669 2015-03-18  Per Arne Vollan  <peavo@outlook.com>
670
671         [WinCairo] Unreviewed build fix after r181665.
672
673         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
674         (WebCore::MediaPlayerPrivateMediaFoundation::setSize):
675
676 2015-03-18  Joseph Pecoraro  <pecoraro@apple.com>
677
678         Remove unused "preprocessor" parameter to sub-CodeGenerators
679         https://bugs.webkit.org/show_bug.cgi?id=142793
680
681         Reviewed by Darin Adler.
682
683         * bindings/scripts/CodeGenerator.pm:
684         (ProcessDocument):
685         (FileNamePrefix):
686         * bindings/scripts/CodeGeneratorObjC.pm:
687
688 2015-03-18  Zalan Bujtas  <zalan@apple.com>
689
690         Simple line layout: Split fragments on renderer boundary on the fly.
691         https://bugs.webkit.org/show_bug.cgi?id=142579
692
693         Reviewed by Antti Koivisto.
694
695         Fragment splitting at renderers' boundary at the end of the line is no longer needed.
696         This patch ensures that TextFragmentIterator::nextTextFragment() does not concatenate
697         fragments across renderer boundary.
698
699         Test: fast/text/simple-line-with-multiple-renderers.html
700
701         * rendering/SimpleLineLayout.cpp:
702         (WebCore::SimpleLineLayout::revertRuns):
703         (WebCore::SimpleLineLayout::LineState::isEmpty):
704         (WebCore::SimpleLineLayout::LineState::appendFragmentAndCreateRunIfNeeded): Check if fragments need a new run and
705         whether neighboring fragments need collapsing.
706         (WebCore::SimpleLineLayout::LineState::revertUncommitted): Revert fragments over multiple renderers if they form
707         a fragment continuation.
708         (WebCore::SimpleLineLayout::LineState::removeTrailingWhitespace):
709         (WebCore::SimpleLineLayout::forceFragmentToLine): Ensure that if a fragment has continuation across multiple renderers,
710         they all get added to the current line.
711         (WebCore::SimpleLineLayout::createLineRuns):
712         (WebCore::SimpleLineLayout::LineState::appendFragment): Deleted.
713         (WebCore::SimpleLineLayout::FragmentForwardIterator::FragmentForwardIterator): Deleted.
714         (WebCore::SimpleLineLayout::FragmentForwardIterator::operator++): Deleted.
715         (WebCore::SimpleLineLayout::FragmentForwardIterator::operator!=): Deleted.
716         (WebCore::SimpleLineLayout::FragmentForwardIterator::operator*): Deleted.
717         (WebCore::SimpleLineLayout::begin): Deleted.
718         (WebCore::SimpleLineLayout::end): Deleted.
719         (WebCore::SimpleLineLayout::preWrap): Deleted.
720         (WebCore::SimpleLineLayout::removeTrailingWhitespace): Deleted.
721         (WebCore::SimpleLineLayout::updateLineConstrains): Deleted.
722         (WebCore::SimpleLineLayout::splitRunsAtRendererBoundary): Deleted.
723         (WebCore::SimpleLineLayout::createTextRuns): Deleted.
724         (WebCore::SimpleLineLayout::create): Deleted.
725         (WebCore::SimpleLineLayout::Layout::create): Deleted.
726         * rendering/SimpleLineLayoutFlowContents.h:
727         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator+):
728         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator*):
729         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator->):
730         * rendering/SimpleLineLayoutFunctions.cpp:
731         (WebCore::SimpleLineLayout::paintFlow): Unrelated fix on non-collapsed tab position.
732         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
733         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragmentIterator):
734         (WebCore::SimpleLineLayout::TextFragmentIterator::nextTextFragment):
735         (WebCore::SimpleLineLayout::TextFragmentIterator::revertToFragment):
736         (WebCore::SimpleLineLayout::TextFragmentIterator::textWidth):
737         (WebCore::SimpleLineLayout::TextFragmentIterator::skipToNextPosition):
738         * rendering/SimpleLineLayoutTextFragmentIterator.h:
739         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::TextFragment):
740         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::overlapsToNextRenderer):
741         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::isCollapsible):
742         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::operator==):
743         (WebCore::SimpleLineLayout::TextFragmentIterator::isLineBreak):
744         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::split): Deleted.
745
746 2015-03-18  Manuel Rego Casasnovas  <rego@igalia.com>
747
748         Flex and grid items should be painted as inline-blocks
749         https://bugs.webkit.org/show_bug.cgi?id=142266
750
751         Reviewed by Darin Adler.
752
753         Based on Blink r157004 by <cbiesinger@chromium.org>.
754         https://src.chromium.org/viewvc/blink?revision=157004&view=revision
755
756         Both flexbox and grid specs define that the painting order of flex/grid
757         items is the same as inline blocks. See
758         http://dev.w3.org/csswg/css-flexbox/#painting and
759         http://dev.w3.org/csswg/css-grid/#z-order.
760
761         Extracted inline blocks painting code from InlineElementBox and moved to
762         a helper method that will be reused for flexboxes and grids.
763
764         Tests: css3/flexbox/flex-item-text-background-not-interleaved.html
765                fast/css-grid-layout/grid-item-text-background-not-interleaved.html
766
767         * rendering/InlineElementBox.cpp:
768         (WebCore::InlineElementBox::paint): Move code to
769         RenderElement::paintAsInlineBlock().
770         * rendering/RenderBlock.cpp:
771         (WebCore::RenderBlock::paintChild): Add new argument to paint children
772         as inline blocks.
773         * rendering/RenderBlock.h: Define PaintType enmu and modify paintChild()
774         signature to add the new argument.
775         * rendering/RenderElement.cpp:
776         (WebCore::paintPhase): Paint element in a phase.
777         (WebCore::RenderElement::paintAsInlineBlock): Code extracted from
778         InlineElementBox::paint().
779         * rendering/RenderElement.h: Add new method signature.
780         * rendering/RenderFlexibleBox.cpp:
781         (WebCore::RenderFlexibleBox::paintChildren): Call
782         RenderBlock::paintChild() with the new argument.
783         * rendering/RenderGrid.cpp:
784         (WebCore::RenderGrid::paintChildren): Ditto.
785
786 2015-03-18  Chris Dumez  <cdumez@apple.com>
787
788         [WK2] Log total number of network cache queries using diagnostic logging
789         https://bugs.webkit.org/show_bug.cgi?id=142803
790         <rdar://problem/19632130>
791
792         Reviewed by Antti Koivisto.
793
794         Add diagnostic logging key needed for network efficacy logging.
795
796         * page/DiagnosticLoggingKeys.cpp:
797         (WebCore::DiagnosticLoggingKeys::retrievalRequestKey):
798         * page/DiagnosticLoggingKeys.h:
799
800 2015-03-18  Tim Horton  <timothy_horton@apple.com>
801
802         Fix the build after r181660
803
804         * page/EventHandler.cpp:
805         (WebCore::EventHandler::setImmediateActionStage):
806         * page/EventHandler.h:
807         (WebCore::EventHandler::setImmediateActionStage):
808         Un-inline setImmediateActionStage, because it is exported to WebCore, and
809         exporting inline thing causes random weak symbol errors on some platforms.
810
811 2015-03-17  Conrad Shultz  <conrad_shultz@apple.com>
812
813         Ignore some deprecation warnings
814         https://bugs.webkit.org/show_bug.cgi?id=142813
815
816         Reviewed by Mark Rowe.
817
818         Fixing the deprecations is tracked by: <rdar://problem/20201450>
819
820         * editing/cocoa/HTMLConverter.mm:
821         (HTMLConverter::_processElement):
822
823 2015-03-17  Commit Queue  <commit-queue@webkit.org>
824
825         Unreviewed, rolling out r181667, r181682, and r181683.
826         https://bugs.webkit.org/show_bug.cgi?id=142812
827
828         Broke multiple tests with ASan, plus dependent commits
829         (Requested by ap on #webkit).
830
831         Reverted changesets:
832
833         "Simple line layout: Split fragments on renderer boundary on
834         the fly."
835         https://bugs.webkit.org/show_bug.cgi?id=142579
836         http://trac.webkit.org/changeset/181667
837
838         "Simple line layout: Change FlowContents::segmentForPosition()
839         to segmentForRun()."
840         https://bugs.webkit.org/show_bug.cgi?id=142785
841         http://trac.webkit.org/changeset/181682
842
843         "Simple line layout: Use Vector<>::const_iterator instead of
844         custom FlowContents::Iterator."
845         https://bugs.webkit.org/show_bug.cgi?id=142809
846         http://trac.webkit.org/changeset/181683
847
848 2015-03-17  Zalan Bujtas  <zalan@apple.com>
849
850         Simple line layout: Use Vector<>::const_iterator instead of custom FlowContents::Iterator.
851         https://bugs.webkit.org/show_bug.cgi?id=142809
852
853         Reviewed by Antti Koivisto.
854
855         FlowContents::Iterator simply iterates on a vector<>. No need to custom implement it.
856
857         No change in functionality.
858
859         * rendering/SimpleLineLayoutFlowContents.h:
860         (WebCore::SimpleLineLayout::FlowContents::begin):
861         (WebCore::SimpleLineLayout::FlowContents::end):
862         (WebCore::SimpleLineLayout::FlowContents::Iterator::Iterator): Deleted.
863         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator++): Deleted.
864         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator--): Deleted.
865         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator==): Deleted.
866         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator!=): Deleted.
867         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator*): Deleted.
868         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator->): Deleted.
869         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
870         (WebCore::SimpleLineLayout::TextFragmentIterator::skipToNextPosition):
871
872 2015-03-17  Zalan Bujtas  <zalan@apple.com>
873
874         Simple line layout: Change FlowContents::segmentForPosition() to segmentForRun().
875         https://bugs.webkit.org/show_bug.cgi?id=142785
876
877         Reviewed by Antti Koivisto.
878
879         This is in transition to support <br>. A particular position could point to multiple
880         segments when <br> is directly followed by text.
881
882         No change in functionality.
883
884         * rendering/SimpleLineLayoutFlowContents.cpp:
885         (WebCore::SimpleLineLayout::FlowContents::segmentIndexForRunSlow):
886         (WebCore::SimpleLineLayout::FlowContents::segmentIndexForPositionSlow): Deleted.
887         * rendering/SimpleLineLayoutFlowContents.h:
888         (WebCore::SimpleLineLayout::FlowContents::segmentForRun):
889         (WebCore::SimpleLineLayout::FlowContents::segmentIndexForPosition): Deleted.
890         (WebCore::SimpleLineLayout::FlowContents::segmentForPosition): Deleted.
891         * rendering/SimpleLineLayoutResolver.cpp:
892         (WebCore::SimpleLineLayout::RunResolver::Run::text):
893
894 2015-03-17  Chris Dumez  <cdumez@apple.com>
895
896         [Mac][iOS] setSharedTimerFireInterval() / stopSharedTimer() are expensive
897         https://bugs.webkit.org/show_bug.cgi?id=142752
898         <rdar://problem/20176731>
899
900         Reviewed by Antti Koivisto.
901
902         setSharedTimerFireInterval() / stopSharedTimer() are expensive on Mac
903         and iOS on pages using a lot of timers.
904
905         For example, on bing.com / iOS, ~15.4% of the CPU time is spent in
906         setSharedTimerFireInterval() and ~14.7% of the CPU time is spent in
907         stopSharedTimer(). The expensive calls are CFRunLoopAddTimer (11.4%),
908         CFRunLoopTimerInvalidate (14.1%), CFRunLoopTimerCreate (3.3%).
909
910         The issue is that we keep creating, adding to run loop modes, and then
911         destroying the sharedTimer for each firing event. This is very
912         expensive. In such case, the CFRunLoopTimerRef documentation advises to
913         """
914         ... create a repeating timer with an initial firing time in the distant
915         future (or the initial firing time) and a very large repeat interval—on
916         the order of decades or more—and add it to all the necessary run loop
917         modes. Then, when you know when the timer should fire next, you reset
918         the firing time with CFRunLoopTimerSetNextFireDate, perhaps from the
919         timer’s own callback function. This technique effectively produces a
920         reusable, asynchronous timer.
921         """ [1].
922
923         Doing so greatly decreases CPU time spend in:
924         - setSharedTimerFireInterval(): 15.4% -> 4.6%
925         - stopSharedTimer(): 14.6% -> 8.6%
926
927         Overall CPU time spent on bing.com in timerFired() goes down from
928         ~61.2% to ~49.5%.
929
930         This patch also refactors the SharedTimer code to share as much as
931         possible between Mac and iOS.
932
933         This patch is based in part on the following patch:
934         http://trac.webkit.org/changeset/143210
935
936         [1] https://developer.apple.com/library/prerelease/ios/documentation/CoreFoundation/Reference/CFRunLoopTimerRef/index.html#//apple_ref/c/func/CFRunLoopTimerSetNextFireDate
937
938         * WebCore.xcodeproj/project.pbxproj:
939         * platform/SharedTimer.h:
940         (WebCore::SharedTimer::invalidate):
941         (WebCore::MainThreadSharedTimer::setFiredFunction): Deleted.
942         (WebCore::MainThreadSharedTimer::setFireInterval): Deleted.
943         (WebCore::MainThreadSharedTimer::stop): Deleted.
944         * platform/ThreadTimers.cpp:
945         (WebCore::ThreadTimers::fireTimersInNestedEventLoop):
946         * platform/cf/SharedTimerCF.mm: Added.
947         (WebCore::applicationDidBecomeActive):
948         (WebCore::setupPowerObserver):
949         (WebCore::setSharedTimerFiredFunction):
950         (WebCore::timerFired):
951         (WebCore::restartSharedTimer):
952         (WebCore::invalidateSharedTimer):
953         (WebCore::setSharedTimerFireInterval):
954         (WebCore::stopSharedTimer):
955         * platform/efl/SharedTimerEfl.cpp:
956         (WebCore::invalidateSharedTimer):
957         * platform/gtk/SharedTimerGtk.cpp:
958         (WebCore::invalidateSharedTimer):
959         * platform/ios/SharedTimerIOS.mm: Removed.
960         * platform/mac/PowerObserverMac.h: Copied from Source/WebCore/platform/efl/SharedTimerEfl.cpp.
961         * platform/mac/PowerObserverMac.mm: Renamed from Source/WebCore/platform/mac/SharedTimerMac.mm.
962         (WebCore::PowerObserver::PowerObserver):
963         (WebCore::PowerObserver::~PowerObserver):
964         (WebCore::PowerObserver::didReceiveSystemPowerNotification):
965         * platform/win/SharedTimerWin.cpp:
966         (WebCore::removeSharedTimer):
967
968 2015-03-17  Tim Horton  <timothy_horton@apple.com>
969
970         Cannot invoke action menus anymore
971         https://bugs.webkit.org/show_bug.cgi?id=142797
972         <rdar://problem/20032670>
973
974         Reviewed by Beth Dakin.
975
976         * platform/spi/mac/NSMenuSPI.h:
977         Add additional NSMenu SPI.
978
979 2015-03-17  Zalan Bujtas  <zalan@apple.com>
980
981         Simple line layout: Split fragments on renderer boundary on the fly.
982         https://bugs.webkit.org/show_bug.cgi?id=142579
983
984         Reviewed by Antti Koivisto.
985
986         Fragment splitting at renderers' boundary at the end of the line is no longer needed.
987         This patch ensures that TextFragmentIterator::nextTextFragment() does not concatenate
988         fragments across renderer boundary.
989
990         Test: fast/text/simple-line-with-multiple-renderers.html
991
992         * rendering/SimpleLineLayout.cpp:
993         (WebCore::SimpleLineLayout::revertRuns):
994         (WebCore::SimpleLineLayout::LineState::isEmpty):
995         (WebCore::SimpleLineLayout::LineState::appendFragmentAndCreateRunIfNeeded): Check if fragments need a new run and
996         whether neighboring fragments need collapsing.
997         (WebCore::SimpleLineLayout::LineState::revertUncommitted): Revert fragments over multiple renderers if they form
998         a fragment continuation.
999         (WebCore::SimpleLineLayout::LineState::removeTrailingWhitespace):
1000         (WebCore::SimpleLineLayout::forceFragmentToLine): Ensure that if a fragment has continuation across multiple renderers,
1001         they all get added to the current line.
1002         (WebCore::SimpleLineLayout::createLineRuns):
1003         (WebCore::SimpleLineLayout::LineState::appendFragment): Deleted.
1004         (WebCore::SimpleLineLayout::FragmentForwardIterator::FragmentForwardIterator): Deleted.
1005         (WebCore::SimpleLineLayout::FragmentForwardIterator::operator++): Deleted.
1006         (WebCore::SimpleLineLayout::FragmentForwardIterator::operator!=): Deleted.
1007         (WebCore::SimpleLineLayout::FragmentForwardIterator::operator*): Deleted.
1008         (WebCore::SimpleLineLayout::begin): Deleted.
1009         (WebCore::SimpleLineLayout::end): Deleted.
1010         (WebCore::SimpleLineLayout::preWrap): Deleted.
1011         (WebCore::SimpleLineLayout::removeTrailingWhitespace): Deleted.
1012         (WebCore::SimpleLineLayout::updateLineConstrains): Deleted.
1013         (WebCore::SimpleLineLayout::splitRunsAtRendererBoundary): Deleted.
1014         (WebCore::SimpleLineLayout::createTextRuns): Deleted.
1015         (WebCore::SimpleLineLayout::create): Deleted.
1016         (WebCore::SimpleLineLayout::Layout::create): Deleted.
1017         * rendering/SimpleLineLayoutFlowContents.h:
1018         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator+):
1019         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator*):
1020         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator->):
1021         * rendering/SimpleLineLayoutFunctions.cpp:
1022         (WebCore::SimpleLineLayout::paintFlow): Unrelated fix on non-collapsed tab position.
1023         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
1024         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragmentIterator):
1025         (WebCore::SimpleLineLayout::TextFragmentIterator::nextTextFragment):
1026         (WebCore::SimpleLineLayout::TextFragmentIterator::revertToFragment):
1027         (WebCore::SimpleLineLayout::TextFragmentIterator::textWidth):
1028         (WebCore::SimpleLineLayout::TextFragmentIterator::skipToNextPosition):
1029         * rendering/SimpleLineLayoutTextFragmentIterator.h:
1030         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::TextFragment):
1031         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::overlapsToNextRenderer):
1032         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::isCollapsible):
1033         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::operator==):
1034         (WebCore::SimpleLineLayout::TextFragmentIterator::isLineBreak):
1035         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::split): Deleted.
1036
1037 2015-03-17  Jeremy Jones  <jeremyj@apple.com>
1038
1039         When tab hides, pause fullscreen and exit normally.
1040         https://bugs.webkit.org/show_bug.cgi?id=142685
1041
1042         Reviewed by Eric Carlson.
1043
1044         Pause fullscreen playback when switching tabs. Exit fullscreen is not necessary and even prevents
1045         the normal flow of teardown. This allows the normal exit fullscreen call to succeed and call its callback.
1046
1047         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
1048         (WebVideoFullscreenInterfaceAVKit::requestHideAndExitFullscreen):
1049
1050 2015-03-17  Per Arne Vollan  <peavo@outlook.com>
1051
1052         [WinCairo] Video position is incorrect when located inside a frame.
1053         https://bugs.webkit.org/show_bug.cgi?id=142784
1054
1055         Reviewed by Brent Fulgham.
1056
1057         We need to take the enclosing frame's position into account, when finding the video position.
1058
1059         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
1060         (WebCore::MediaPlayerPrivateMediaFoundation::setSize):
1061
1062 2015-03-17  Benjamin Poulain  <bpoulain@apple.com>
1063
1064         Compile character ranges targeting the same state as range check in the bytecode
1065         https://bugs.webkit.org/show_bug.cgi?id=142759
1066
1067         Reviewed by Alex Christensen.
1068
1069         Previously, character ranges would be compiled as many individual character checks.
1070         For example, a transition on "[a-z]" would do 26 character checks + jump, which leads
1071         to enormous matchines.
1072
1073         With this patch, we find the ranges at lowering time and generate a single instruction
1074         for them: "CheckValueRange". This helps making the machine denser when the input
1075         use character sets.
1076
1077         The second part of this patch goes further in the case where the transitions out of
1078         a state cover the entire alphabet. In that case, we create a fallback transition
1079         on the fly and remove all the ranges made useless.
1080         That case is common when ranges are used with inverse character set (e.g. [^a]+a).
1081
1082         * contentextensions/DFABytecode.h:
1083         (WebCore::ContentExtensions::instructionSizeWithArguments):
1084         * contentextensions/DFABytecodeCompiler.cpp:
1085         (WebCore::ContentExtensions::DFABytecodeCompiler::emitCheckValueRange):
1086         (WebCore::ContentExtensions::DFABytecodeCompiler::compileNode):
1087         (WebCore::ContentExtensions::DFABytecodeCompiler::compileNodeTransitions):
1088         (WebCore::ContentExtensions::DFABytecodeCompiler::compileCheckForRange):
1089         * contentextensions/DFABytecodeCompiler.h:
1090         Extend the compiler to detect ranges and lower them as CheckValueRange.
1091
1092         * contentextensions/DFABytecodeInterpreter.cpp:
1093         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
1094         Range checks in the interpreter.
1095
1096         * contentextensions/NFA.cpp:
1097         (WebCore::ContentExtensions::NFA::setFinal):
1098         This assertion does not make sense with the current codebase. Actions are "compressed",
1099         it is possible to have two patterns with the same action.
1100
1101         * contentextensions/NFAToDFA.cpp:
1102         (WebCore::ContentExtensions::simplifyTransitions):
1103         A very simple DFA optimization function: it only reduce the strength of ranges.
1104
1105         (WebCore::ContentExtensions::NFAToDFA::convert):
1106
1107 2015-03-17  Jer Noble  <jer.noble@apple.com>
1108
1109         REGRESSION (r181423): Crash @ generatedcontent.org at com.apple.WebCore: WebCore::MediaPlayer::maximumDurationToCacheMediaTime const + 4
1110         https://bugs.webkit.org/show_bug.cgi?id=142787
1111
1112         Reviewed by Eric Carlson.
1113
1114         Null check m_player before derefencing.
1115
1116         * html/HTMLMediaElement.cpp:
1117         (WebCore::HTMLMediaElement::parseAttribute):
1118
1119 2015-03-17  Beth Dakin  <bdakin@apple.com>
1120
1121         DOM mouse events have weird timing for force clickable elements in Safari 8.0.3 on 
1122         10.10.2
1123         https://bugs.webkit.org/show_bug.cgi?id=142700
1124         -and corresponding-
1125         rdar://problem/20165168
1126
1127         Reviewed by Tim Horton.
1128
1129         This patch adds a new enum and member variable so that EventHandler can keep track 
1130         of the current immediate action state.
1131         * page/EventHandler.cpp:
1132         (WebCore::EventHandler::EventHandler):
1133
1134         A new mouse press even is starting. We can re-set m_immediateActionStage to none 
1135         unless a Hit Test has already been performed.
1136         (WebCore::EventHandler::handleMousePressEvent):
1137
1138         If an immediate action was completed, then send mouse to the DOM and return early. 
1139         This will prevent us from doing our own normal mouseup behaviors such as 
1140         navigating to a link that was clicked — we only want to do that if the click was 
1141         not used to perform an immediate action.
1142         (WebCore::EventHandler::handleMouseReleaseEvent):
1143         * page/EventHandler.h:
1144         (WebCore::EventHandler::setImmediateActionStage):
1145
1146 2015-03-17  Joseph Pecoraro  <pecoraro@apple.com>
1147
1148         Use a better parameter name for Document.getElementsByClassName
1149         https://bugs.webkit.org/show_bug.cgi?id=142771
1150
1151         Reviewed by Chris Dumez.
1152
1153         * bindings/objc/PublicDOMInterfaces.h:
1154         * dom/Document.idl:
1155
1156 2015-03-17  Timothy Horton  <timothy_horton@apple.com>
1157
1158         Reproducible null deref under ScriptedAnimationController::createDisplayRefreshMonitor
1159         https://bugs.webkit.org/show_bug.cgi?id=142776
1160         <rdar://problem/18921338>
1161
1162         Reviewed by Alexey Proskuryakov.
1163
1164         Test: fast/animation/request-animation-frame-unparented-iframe-crash.html
1165
1166         In some cases (like the new test), we can end up trying to start
1167         requestAnimationFrame on a Document that has no Page. Most paths null-checked
1168         the Page and did the right thing, but one failed to do so. In addition,
1169         the current fallback (when Page is null) can result in us constructing
1170         the wrong kind of DisplayRefreshMonitor, which could lead to trouble
1171         down the road when it's reused. Instead, just completely avoid making a
1172         DisplayRefreshMonitor in the null-page case.
1173
1174         * dom/ScriptedAnimationController.cpp:
1175         (WebCore::ScriptedAnimationController::createDisplayRefreshMonitor):
1176         If the page is null, bail.
1177
1178         * dom/ScriptedAnimationController.h:
1179         * platform/graphics/DisplayRefreshMonitor.cpp:
1180         (WebCore::DisplayRefreshMonitor::create):
1181         Use Optional<> to make it easy to distinguish between ChromeClient
1182         being unreachable (because we don't have a Page for some reason) and
1183         ChromeClient declaring that it doesn't want to override the type of
1184         DisplayRefreshMonitor that is created.
1185
1186         If ChromeClient was unreachable for some reason, we'll get back an engaged
1187         nullptr and return it (instead of creating a DisplayRefreshMonitor based
1188         on the platform). This avoids creating the wrong type of DisplayRefreshMonitor
1189         in the rare case where we can't reach the ChromeClient (e.g. a freshly unparented
1190         IFrame).
1191
1192         If instead the client returns a disengaged Nullopt, we'll interpret that as
1193         "construct the default type", which falls back on the platform #ifdefs to
1194         decide what to make.
1195
1196         * platform/graphics/DisplayRefreshMonitorManager.cpp:
1197         (WebCore::DisplayRefreshMonitorManager::ensureMonitorForClient):
1198         (WebCore::DisplayRefreshMonitorManager::scheduleAnimation):
1199         Silently handle the case where we failed to make a DisplayRefreshMonitor.
1200
1201         * platform/graphics/DisplayRefreshMonitor.h:
1202         * platform/graphics/DisplayRefreshMonitorClient.h:
1203         * platform/graphics/GraphicsLayerUpdater.cpp:
1204         (WebCore::GraphicsLayerUpdater::createDisplayRefreshMonitor):
1205         * platform/graphics/GraphicsLayerUpdater.h:
1206         * rendering/RenderLayerCompositor.cpp:
1207         (WebCore::RenderLayerCompositor::createDisplayRefreshMonitor):
1208         * rendering/RenderLayerCompositor.h:
1209         Adjust to the new signature of createDisplayRefreshMonitor, and return
1210         an engaged (nullptr) Optional if we can't get to ChromeClient for any reason.
1211
1212         * page/ChromeClient.h:
1213         Return Nullopt (indicating a lack of override) by default.
1214
1215 2015-03-17  Dean Jackson  <dino@apple.com>
1216
1217         Implement Scroll Container Animation Triggers
1218         https://bugs.webkit.org/show_bug.cgi?id=142732
1219
1220         Attempt to fix the build.
1221
1222         * css/CSSComputedStyleDeclaration.cpp: Add an #if ENABLE guard.
1223
1224 2015-03-17  Dean Jackson  <dino@apple.com>
1225
1226         Implement Scroll Container Animation Triggers
1227         https://bugs.webkit.org/show_bug.cgi?id=142732
1228
1229         Reviewed by Simon Fraser.
1230
1231         Test: animations/trigger-container-scroll-simple.html
1232
1233         Basic implementation of container-scroll. It only checks
1234         the page scroll position for trigger values (not the scrolling
1235         container in an overflow).
1236
1237         * css/CSSComputedStyleDeclaration.cpp: Add CSSPropertyWebkitAnimationTrigger
1238         so that this property will appear in the inspector.
1239
1240         * page/FrameView.cpp:
1241         (WebCore::FrameView::sendScrollEvent): If the page has scrolled, let the animation
1242         controller know about it.
1243
1244         * page/animation/AnimationBase.cpp:
1245         (WebCore::AnimationBase::updateStateMachine): Whitespace fix.
1246         (WebCore::AnimationBase::fireAnimationEventsIfNeeded): If there is a trigger,
1247         and the scroll position is past it, then tell the state machine that
1248         we should start.
1249         (WebCore::AnimationBase::timeToNextService): Use the scroll position as
1250         an input to the update timer if a trigger is involved.
1251
1252         * page/animation/AnimationController.cpp:
1253         (WebCore::AnimationControllerPrivate::ensureCompositeAnimation): Add whitespace.
1254         (WebCore::AnimationControllerPrivate::scrollWasUpdated): Call updateAnimations.
1255         (WebCore::AnimationController::scrollWasUpdated): Call into AnimationControllerPrivate.
1256         * page/animation/AnimationController.h:
1257         * page/animation/AnimationControllerPrivate.h:
1258
1259         * page/animation/CompositeAnimation.cpp: Keep a record of whether we have a scroll
1260         triggered animation.
1261         (WebCore::CompositeAnimation::CompositeAnimation):
1262         (WebCore::CompositeAnimation::updateKeyframeAnimations):
1263         * page/animation/CompositeAnimation.h:
1264         (WebCore::CompositeAnimation::hasScrollTriggeredAnimation):
1265         * platform/animation/Animation.cpp:
1266         (WebCore::Animation::operator=):
1267
1268 2015-03-17  Simon Fraser  <simon.fraser@apple.com>
1269
1270         Move some code from LogicalSelectionOffsetCaches into RenderElement
1271         https://bugs.webkit.org/show_bug.cgi?id=142758
1272
1273         Reviewed by Myles C. Maxfield.
1274
1275         LogicalSelectionOffsetCaches had some useful code regarding containing blocks etc
1276         that should be used in more places, so move it into RenderElement.
1277         
1278         No behavior change.
1279
1280         * rendering/LogicalSelectionOffsetCaches.h:
1281         (WebCore::LogicalSelectionOffsetCaches::LogicalSelectionOffsetCaches):
1282         (WebCore::isContainingBlockCandidateForAbsolutelyPositionedObject): Deleted.
1283         (WebCore::isNonRenderBlockInline): Deleted.
1284         (WebCore::containingBlockForFixedPosition): Deleted.
1285         (WebCore::containingBlockForAbsolutePosition): Deleted.
1286         (WebCore::containingBlockForObjectInFlow): Deleted.
1287         * rendering/RenderBlock.cpp: No need to initialize static data.
1288         (WebCore::RenderBlock::positionedObjects): nullptr
1289         * rendering/RenderElement.cpp:
1290         (WebCore::RenderElement::containingBlockForFixedPosition):
1291         (WebCore::RenderElement::containingBlockForAbsolutePosition):
1292         (WebCore::isNonRenderBlockInline):
1293         (WebCore::RenderElement::containingBlockForObjectInFlow):
1294         * rendering/RenderElement.h:
1295         (WebCore::RenderElement::canContainAbsolutelyPositionedObjects):
1296         * rendering/RenderLayer.cpp:
1297         (WebCore::isContainerForPositioned):
1298         * rendering/RenderObject.cpp:
1299         (WebCore::RenderObject::containingBlock):
1300
1301 2015-03-17  Alex Christensen  <achristensen@webkit.org>
1302
1303         [WinCairo] Unreviewed build fix after r181640.
1304
1305         * platform/graphics/cairo/GraphicsContext3DCairo.cpp:
1306         Tell Windows how to find ShaderLang.h.
1307
1308 2015-03-17  Chris Dumez  <cdumez@apple.com>
1309
1310         'pageLoaded' diagnostic logging is too verbose
1311         https://bugs.webkit.org/show_bug.cgi?id=142727
1312         <rdar://problem/18937048>
1313
1314         Reviewed by Eric Carlson.
1315
1316         Make 'pageLoaded' diagnostic logging less verbose:
1317         - Log once per main frame instead of once for subframe
1318         - Apply sampling
1319
1320         * loader/FrameLoader.cpp:
1321         (WebCore::FrameLoader::checkLoadCompleteForThisFrame):
1322
1323 2015-03-17  Carlos Garcia Campos  <cgarcia@igalia.com>
1324
1325         [GTK] Wrong transfer annotations used in GObject DOM bindings
1326         https://bugs.webkit.org/show_bug.cgi?id=142780
1327
1328         Reviewed by Gustavo Noronha Silva.
1329
1330         We are using transfer none for all methods returning a GObject DOM
1331         Object. That's not true. Only objects derived from Node are
1332         automatically released by the DOM object cache and can be transfer
1333         none. All other objects are added to the cache only to avoid
1334         creating the same wrapper twice for the same core object, but
1335         caller should release the returned reference.
1336
1337         * bindings/gobject/WebKitDOMCustomUnstable.h:
1338         * bindings/scripts/CodeGeneratorGObject.pm:
1339         (GetTransferTypeForReturnType):
1340         (GenerateFunction):
1341
1342 2015-03-17  Carlos Garcia Campos  <cgarcia@igalia.com>
1343
1344         [GTK] WebKitDOM objects leaking
1345         https://bugs.webkit.org/show_bug.cgi?id=118788
1346
1347         Reviewed by Darin Adler and Sergio Villar Senin.
1348
1349         Use a DOMwindowObserver class, derived from DOMWindowProperty to
1350         be notified when the window object is detached from the frame to
1351         clear the DOM objects associated to that frame in that case too.
1352
1353         * bindings/gobject/DOMObjectCache.cpp:
1354
1355 2015-03-17  Zan Dobersek  <zdobersek@igalia.com>
1356
1357         [CMake] Use a forwarding header for ANGLE's ShaderLang.h to avoid picking up ANGLE's EGL headers
1358         https://bugs.webkit.org/show_bug.cgi?id=142530
1359
1360         Reviewed by Darin Adler.
1361
1362         Include the ANGLE's ShaderLang.h through the new forwarding header. This allows
1363         us to not list Source/ThirdParty/ANGLE/include in the list of inclusion directories
1364         and thus avoid ANGLE's EGL and GLES2/GLES3 headers, defaulting to the system-provided
1365         headers instead.
1366
1367         Source/ThirdParty/ANGLE/include/KHR is still used because ANGLE's khrplatform.h is
1368         required by the ShaderLang.h header. Source/ThirdParty/ANGLE/src is not used for the
1369         whole WebCore library anymore, only the ANGLESupport library.
1370
1371         * CMakeLists.txt:
1372         * platform/graphics/ANGLEWebKitBridge.h:
1373         * platform/graphics/cairo/GraphicsContext3DCairo.cpp:
1374
1375 2015-03-17  Matt Baker  <mattbaker@apple.com>
1376
1377         Web Inspector: Show rendering frames (and FPS) in Layout and Rendering timeline
1378         https://bugs.webkit.org/show_bug.cgi?id=142029
1379
1380         Reviewed by Timothy Hatcher.
1381
1382         Add new functionality to the Inspector timelines backend to add runloop data to timeline recordings.
1383
1384         * inspector/InspectorTimelineAgent.cpp:
1385         (WebCore::currentRunLoop):
1386         (WebCore::InspectorTimelineAgent::internalStart):
1387         (WebCore::InspectorTimelineAgent::internalStop):
1388         (WebCore::toProtocol):
1389         (WebCore::InspectorTimelineAgent::InspectorTimelineAgent):
1390         Install observers for the begining and end of the runloop when recording begins. All other
1391         instrumented timeline events get added as children of the current runloop record, which is
1392         sent to the frontend once the runloop completes.
1393
1394         * inspector/InspectorTimelineAgent.h:
1395
1396         * platform/cf/RunLoopObserver.cpp:
1397         (WebCore::RunLoopObserver::schedule):
1398         Wrapper changed to allow observing arbitrary runloop activities.
1399
1400         * platform/cf/RunLoopObserver.h:
1401
1402 2015-03-17  Philippe Normand  <pnormand@igalia.com>
1403
1404         [GTK] basic OpenWebRTC build support
1405         https://bugs.webkit.org/show_bug.cgi?id=142393
1406
1407         Reviewed by Carlos Garcia Campos.
1408
1409         * PlatformGTK.cmake: Add OpenWebRTC CFLAGS and LDFLAGS.
1410
1411 2015-03-17  Joseph Pecoraro  <pecoraro@apple.com>
1412
1413         Remove never used "useLayerOnTop" bindings generator argument
1414         https://bugs.webkit.org/show_bug.cgi?id=142773
1415
1416         Reviewed by Darin Adler.
1417
1418         * bindings/scripts/CodeGenerator.pm:
1419         * bindings/scripts/CodeGeneratorJS.pm:
1420         * bindings/scripts/CodeGeneratorObjC.pm:
1421         * bindings/scripts/generate-bindings.pl:
1422
1423 2015-03-16  Ryosuke Niwa  <rniwa@webkit.org>
1424
1425         Enable ES6 classes by default
1426         https://bugs.webkit.org/show_bug.cgi?id=142774
1427
1428         Reviewed by Gavin Barraclough.
1429
1430         * Configurations/FeatureDefines.xcconfig:
1431
1432 2015-03-16  Simon Fraser  <simon.fraser@apple.com>
1433
1434         Update the debug overlays after layout
1435         https://bugs.webkit.org/show_bug.cgi?id=142768
1436
1437         Reviewed by Zalan Bujtas.
1438
1439         The debug overlays need to be updated after layout, in case elements with wheel event handlers
1440         moved around.
1441         
1442         DebugPageOverlays::didLayout() is cheap if there are no overlays.
1443         
1444         Call DebugPageOverlays::didLayout() for all frames, not just the main frame, since subframes can contribute
1445         to the main frame's event handler region.
1446
1447         * page/DebugPageOverlays.cpp:
1448         (WebCore::DebugPageOverlays::regionChanged):
1449         * page/DebugPageOverlays.h:
1450         (WebCore::DebugPageOverlays::didLayout):
1451         (WebCore::DebugPageOverlays::didChangeEventHandlers):
1452         * page/FrameView.cpp:
1453         (WebCore::FrameView::layout):
1454
1455 2015-03-16  Jon Lee  <jonlee@apple.com>
1456
1457         Unreviewed fix for crash after r181608.
1458
1459         * WebCore.xcodeproj/project.pbxproj: Include it in the WebCore framework.
1460
1461 2015-03-16  Simon Fraser  <simon.fraser@apple.com>
1462
1463         Generalize the Document code that maintains a set of nodes with event handlers
1464         https://bugs.webkit.org/show_bug.cgi?id=142762
1465
1466         Reviewed by Zalan Bujtas, Darin Adler.
1467
1468         Document.h defines a TouchEventTargetSet type, which will in future be used for
1469         other event types too (wheel events), so rename it to EventTargetSet.
1470         
1471         Take didRemoveEventTargetNode() outside the TOUCH_EVENTS #ifdef, and change it
1472         to take a reference.
1473
1474         * dom/Document.cpp:
1475         (WebCore::Document::prepareForDestruction): References
1476         (WebCore::Document::didAddTouchEventHandler): Ditto.
1477         (WebCore::Document::didRemoveEventTargetNode): Ditto.
1478         * dom/Document.h:
1479         (WebCore::Document::touchEventTargets): No-one calls this; just remove the non
1480         #ideffed one.
1481         * html/HTMLInputElement.cpp:
1482         (WebCore::HTMLInputElement::~HTMLInputElement): Pass a ref.
1483         (WebCore::HTMLInputElement::didMoveToNewDocument): Pass a ref.
1484         * page/DOMWindow.cpp:
1485         (WebCore::DOMWindow::removeAllEventListeners): Pass a ref.
1486
1487 2015-03-16  Joseph Pecoraro  <pecoraro@apple.com>
1488
1489         Web Inspector: Object Previews in Indexed DB tables
1490         https://bugs.webkit.org/show_bug.cgi?id=140813
1491
1492         Reviewed by Timothy Hatcher.
1493
1494         * inspector/InspectorIndexedDBAgent.cpp:
1495         Include previews with object store objects.
1496
1497 2015-03-16  Jer Noble  <jer.noble@apple.com>
1498
1499         [Mac] Update missing image UI
1500         https://bugs.webkit.org/show_bug.cgi?id=142592
1501
1502         Reviewed by Darin Adler.
1503
1504         Update the broken image glyphs with new art (including a 3x image).
1505
1506         Test: fast/hidpi/broken-image-icon-very-hidpi.html
1507
1508         * Resources/missingImage.png:
1509         * Resources/missingImage@2x.png:
1510         * Resources/missingImage@3x.png: Added.
1511         * WebCore.xcodeproj/project.pbxproj:
1512         * loader/cache/CachedImage.cpp:
1513         (WebCore::CachedImage::brokenImage):
1514
1515 2015-03-16  Dean Jackson  <dino@apple.com>
1516
1517         Parsing and Style Resolution of Container-based Animation Triggers
1518         https://bugs.webkit.org/show_bug.cgi?id=142687
1519         <rdar://problem/20170007>
1520
1521         Reviewed by Simon Fraser.
1522
1523         Take 2 after the previous patch was rolled out.
1524
1525         This is the beginning of a prototype implementation of
1526         CSS Animation Triggers, as described by
1527         https://lists.w3.org/Archives/Public/www-style/2014Sep/0135.html
1528
1529         In this patch we parse and resolve the value of a new
1530         CSS property "-webkit-animation-trigger". At the moment it
1531         only accepts one function value "container-scroll", which
1532         will trigger the animation at an absolute position within
1533         an element's scrolling container. We expect the syntax to
1534         change in the near future, as the spec is written.
1535
1536         Tests: animations/trigger-computed-style.html
1537                animations/trigger-parsing.html
1538
1539         * WebCore.xcodeproj/project.pbxproj: Add the new files.
1540
1541         * css/CSSAnimationTriggerScrollValue.cpp: Added.
1542         (WebCore::CSSAnimationTriggerScrollValue::customCSSText): Output text for computed style.
1543         (WebCore::CSSAnimationTriggerScrollValue::equals): Compare two values.
1544         * css/CSSAnimationTriggerScrollValue.h: Added. This holds the CSS side of the
1545         scroll trigger. This name may change in the future to better represent the
1546         type of trigger, but it is good enough for now.
1547         (WebCore::CSSAnimationTriggerScrollValue::create):
1548         (WebCore::CSSAnimationTriggerScrollValue::startValue):
1549         (WebCore::CSSAnimationTriggerScrollValue::endValue):
1550         (WebCore::CSSAnimationTriggerScrollValue::CSSAnimationTriggerScrollValue):
1551
1552         * css/CSSComputedStyleDeclaration.cpp:
1553         (WebCore::createAnimationTriggerValue): Maps an AnimationTrigger into a CSSValue.
1554         (WebCore::getAnimationTriggerValue): Gets the current computed style.
1555         (WebCore::ComputedStyleExtractor::propertyValue):
1556
1557         * css/CSSParser.cpp:
1558         (WebCore::CSSParser::parseValue):
1559         (WebCore::CSSParser::parseAnimationTrigger): Parse the "container-scroll" function
1560         and record the value as a CSSAnimationTriggerScrollValue.
1561         (WebCore::CSSParser::parseAnimationProperty): Handle the new property.
1562         * css/CSSParser.h:
1563
1564         * css/CSSPropertyNames.in: Add "-webkit-animation-trigger".
1565
1566         * css/CSSToStyleMap.cpp:
1567         (WebCore::CSSToStyleMap::mapAnimationTrigger): Map a CSSValue into a trigger value on
1568         an Animation object.
1569         * css/CSSToStyleMap.h:
1570
1571         * css/CSSValue.cpp: Handle the new CSSValue type.
1572         (WebCore::CSSValue::equals):
1573         (WebCore::CSSValue::cssText):
1574         (WebCore::CSSValue::destroy):
1575         * css/CSSValue.h:
1576         (WebCore::CSSValue::isAnimationTriggerScrollValue):
1577
1578         * platform/animation/Animation.cpp: Make sure to initialise m_trigger and m_triggerSet,
1579         and use them in the operator==.
1580         * platform/animation/Animation.h: Add AnimationTrigger as a new field.
1581         (WebCore::Animation::isTriggerSet):
1582         (WebCore::Animation::isEmpty):
1583
1584         * platform/animation/AnimationTrigger.h: Added. New base class and subclasses for
1585         "auto" and the scrolling trigger.
1586         (WebCore::AnimationTrigger::~AnimationTrigger):
1587         (WebCore::AnimationTrigger::type):
1588         (WebCore::AnimationTrigger::isAutoAnimationTrigger):
1589         (WebCore::AnimationTrigger::isScrollAnimationTrigger):
1590         (WebCore::AnimationTrigger::AnimationTrigger):
1591         (WebCore::AutoAnimationTrigger::create):
1592         (WebCore::AutoAnimationTrigger::~AutoAnimationTrigger):
1593         (WebCore::AutoAnimationTrigger::AutoAnimationTrigger):
1594         (WebCore::ScrollAnimationTrigger::create):
1595         (WebCore::ScrollAnimationTrigger::~ScrollAnimationTrigger):
1596         (WebCore::ScrollAnimationTrigger::startValue):
1597         (WebCore::ScrollAnimationTrigger::setStartValue):
1598         (WebCore::ScrollAnimationTrigger::endValue):
1599         (WebCore::ScrollAnimationTrigger::setEndValue):
1600         (WebCore::ScrollAnimationTrigger::hasEndValue):
1601         (WebCore::ScrollAnimationTrigger::setHasEndValue):
1602         (WebCore::ScrollAnimationTrigger::ScrollAnimationTrigger):
1603
1604 2015-03-16  Alex Christensen  <achristensen@webkit.org>
1605
1606         Progress towards CMake on Mac
1607         https://bugs.webkit.org/show_bug.cgi?id=142747
1608
1609         Reviewed by Chris Dumez.
1610
1611         * CMakeLists.txt:
1612         * PlatformMac.cmake:
1613         Added more directories, interfaces, and forwarding headers.
1614         Temporarily disabled the generating of ObjC bindings in CMake builds.
1615         * platform/mac/PasteboardMac.mm:
1616         Removed unused include.
1617
1618 2015-03-16  Joanmarie Diggs  <jdiggs@igalia.com>
1619
1620         AX: Crash viewing http://www.last.fm/
1621         https://bugs.webkit.org/show_bug.cgi?id=142309
1622
1623         Reviewed by Chris Fleizach.
1624
1625         The crash occurs when a not-yet-rendered object emits a children-changed
1626         signal. If an assistive technology is listening, AT-SPI2 will attempt to
1627         create and cache the state set for the child being added and the creation
1628         of the state set assumes a rendered object.
1629
1630         Test: platform/gtk/accessibility/no-notification-for-unrendered-iframe-children.html
1631
1632         * accessibility/atk/AXObjectCacheAtk.cpp:
1633         (WebCore::AXObjectCache::attachWrapper):
1634
1635 2015-03-16  Commit Queue  <commit-queue@webkit.org>
1636
1637         Unreviewed, rolling out r181492.
1638         https://bugs.webkit.org/show_bug.cgi?id=142756
1639
1640         May have regressed PLT (Requested by anttik on #webkit).
1641
1642         Reverted changeset:
1643
1644         "Cache glyph widths to GlyphPages"
1645         https://bugs.webkit.org/show_bug.cgi?id=142028
1646         http://trac.webkit.org/changeset/181492
1647
1648 2015-03-16  Roger Fong  <roger_fong@apple.com>
1649
1650         [WebGL2] Instancing draw calls.
1651         https://bugs.webkit.org/show_bug.cgi?id=126939.
1652         <rdar://problem/15002379>
1653
1654         Reviewed by Dean Jackson.
1655
1656         Tested by a modified version of the 1.0.3 conformance tests:
1657         conformance/extensions/angle-instanced-arrays.html
1658         conformance/extensions/angle-instanced-arrays-out-of-bounds.html
1659
1660         These tests will be landed along with other modified extension conformance tests
1661         once approval from Khronos is received.
1662
1663         * html/canvas/WebGL2RenderingContext.cpp:
1664         (WebCore::WebGL2RenderingContext::clear): Generate error if clearing an integer color buffer.
1665         (WebCore::WebGL2RenderingContext::vertexAttribDivisor): Call method from base class.
1666         (WebCore::WebGL2RenderingContext::drawArraysInstanced): Ditto.
1667         (WebCore::WebGL2RenderingContext::drawElementsInstanced): Ditto.
1668         (WebCore::WebGL2RenderingContext::isIntegerFormat): Ditto.
1669         (WebCore::WebGL2RenderingContext::validateDrawElements): Deleted. Move back to base class.
1670         * html/canvas/WebGL2RenderingContext.h:
1671         * html/canvas/WebGL2RenderingContext.idl: Add a missing enum.
1672         * html/canvas/WebGLRenderingContext.cpp:
1673         (WebCore::WebGLRenderingContext::clear): Copied from WebGLRenderingContextBase.
1674         (WebCore::WebGLRenderingContext::validateDrawElements): Deleted. Move back to base class.
1675         * html/canvas/WebGLRenderingContext.h:
1676         * html/canvas/WebGLRenderingContextBase.cpp: 
1677         (WebCore::WebGLRenderingContextBase::clear): Deleted. Moved to WebGLRenderingContext.
1678         (WebCore::WebGLRenderingContextBase::getVertexAttrib): Check for WebGL2 context.
1679         (WebCore::WebGLRenderingContext::validateDrawElements): Ditto.
1680         * html/canvas/WebGLRenderingContextBase.h:
1681
1682 2015-03-16  Commit Queue  <commit-queue@webkit.org>
1683
1684         Unreviewed, rolling out r181572.
1685         https://bugs.webkit.org/show_bug.cgi?id=142755
1686
1687         Caused weird test failures in transitions and animations
1688         (Requested by dino on #webkit).
1689
1690         Reverted changeset:
1691
1692         "Parsing and Style Resolution of Container-based Animation
1693         Triggers"
1694         https://bugs.webkit.org/show_bug.cgi?id=142687
1695         http://trac.webkit.org/changeset/181572
1696
1697 2015-03-16  Yoav Weiss  <yoav@yoav.ws>
1698
1699         Remove setCachedImage from HTMLImageElement since it is not used
1700         https://bugs.webkit.org/show_bug.cgi?id=142740
1701
1702         Reviewed by Chris Dumez.
1703
1704         No new tests since this patch is just removing dead code.
1705
1706         HTMLImageElement::setCachedImage is not being called by anyone.
1707         This patch removes it, since it's dead code.
1708
1709         * html/HTMLImageElement.h:
1710         (WebCore::HTMLImageElement::setCachedImage): Deleted.
1711
1712 2015-03-16  Brent Fulgham  <bfulgham@apple.com>
1713
1714         WebKit1 Clients Are Not Reliably Repainted
1715         https://bugs.webkit.org/show_bug.cgi?id=142750
1716         <rdar://problem/20042453>
1717
1718         Reviewed by Simon Fraser.
1719
1720         * page/FrameView.cpp:
1721         (WebCore::FrameView::paintContents): Move "Red Rect" debug painting before
1722         the early return so we can see when this happening in debug builds.
1723         * page/FrameView.h:
1724         (WebCore::FrameView::inPaintableState): Added.
1725
1726 2015-03-16  Chris Dumez  <cdumez@apple.com>
1727
1728         Make DatabaseContext suspendable if there is no pending database activity
1729         https://bugs.webkit.org/show_bug.cgi?id=142716
1730         <rdar://problem/19923085>
1731
1732         Reviewed by Andreas Kling.
1733
1734         Make DatabaseContext suspendable if there is no pending database
1735         activity, i.e:
1736         - No pending Database creation JS callback
1737         - No pending transaction(s)
1738
1739         Suspending is safe in this case because we are not going to interrupt
1740         any database activity, nor fire any JS event.
1741
1742         This greatly increases the likelihood of pages using websql to enter
1743         the PageCache.
1744
1745         Tests: fast/history/page-cache-webdatabase-no-transaction-db.html
1746                fast/history/page-cache-webdatabase-pending-transaction.html
1747
1748         * Modules/webdatabase/Database.cpp:
1749         (WebCore::Database::hasPendingTransaction):
1750         * Modules/webdatabase/Database.h:
1751         * Modules/webdatabase/DatabaseContext.cpp:
1752         (WebCore::DatabaseContext::canSuspend):
1753         * Modules/webdatabase/DatabaseManager.cpp:
1754         (WebCore::DatabaseManager::openDatabase):
1755         * Modules/webdatabase/DatabaseThread.cpp:
1756         (WebCore::DatabaseThread::hasPendingDatabaseActivity):
1757         * Modules/webdatabase/DatabaseThread.h:
1758
1759 2015-03-16  Brady Eidson  <beidson@apple.com>
1760
1761         Addressing additional review feedback after http://trac.webkit.org/changeset/181565
1762         https://bugs.webkit.org/show_bug.cgi?id=142733
1763
1764         Reviewed by Darin Adler.
1765
1766         * loader/icon/IconController.cpp:
1767         (WebCore::IconController::startLoader): Null check page()
1768
1769 2015-03-16  Roger Fong  <roger_fong@apple.com>
1770
1771         [Win] Unreviewed build fix attempt after r181571.
1772
1773         * WebCore.vcxproj/WebCore.vcxproj:
1774
1775 2015-03-16  Roger Fong  <roger_fong@apple.com>
1776
1777         [WebGL2] Multiple Render Targets.
1778         https://bugs.webkit.org/show_bug.cgi?id=126994.
1779         <rdar://problem/15815766>
1780
1781         Reviewed by Dean Jackson.
1782
1783         Tested by a modified version of the 1.0.3 conformance test:
1784         conformance/extensions/webgl-draw-buffers.html
1785         This test will be landed along with other modified extension conformance tests
1786         once approval from Khronos is received.
1787
1788         * html/canvas/WebGL2RenderingContext.cpp:
1789         (WebCore::WebGL2RenderingContext::drawBuffers): Mostly the same as WebGLDrawBuffers::drawBuffersWEBGL.
1790         Returns different error messages, uses non EXT enums.
1791         (WebCore::WebGL2RenderingContext::clearBufferiv): This actually does nothing for now but the validation has been implemented.
1792         (WebCore::WebGL2RenderingContext::clearBufferuiv): Ditto.
1793         (WebCore::WebGL2RenderingContext::clearBufferfv): Ditto.
1794         (WebCore::WebGL2RenderingContext::clearBufferfi): Ditto.
1795         (WebCore::WebGL2RenderingContext::validateFramebufferFuncParameters): Removes the extension object check.
1796         (WebCore::WebGL2RenderingContext::getMaxDrawBuffers):
1797         (WebCore::WebGL2RenderingContext::getMaxColorAttachments): Must return the same thing as getMaxDrawBuffers.
1798         (WebCore::WebGL2RenderingContext::getParameter): Remove extension object checks.
1799         * html/canvas/WebGL2RenderingContext.h:
1800         * html/canvas/WebGLFramebuffer.cpp:
1801         (WebCore::WebGLFramebuffer::drawBuffersIfNecessary):
1802         * html/canvas/WebGLRenderingContext.cpp:
1803         (WebCore::WebGLRenderingContext::validateFramebufferFuncParameters): Copied from WebGLRenderingContextBase.
1804         (WebCore::WebGLRenderingContext::getMaxDrawBuffers): Ditto.
1805         (WebCore::WebGLRenderingContext::getMaxColorAttachments): Ditto.
1806         * html/canvas/WebGLRenderingContext.h:
1807         * html/canvas/WebGLRenderingContextBase.cpp:
1808         (WebCore::WebGLRenderingContextBase::validateFramebufferFuncParameters): Deleted.
1809         * html/canvas/WebGLRenderingContextBase.h:
1810
1811 2015-03-16  Dean Jackson  <dino@apple.com>
1812
1813         Parsing and Style Resolution of Container-based Animation Triggers
1814         https://bugs.webkit.org/show_bug.cgi?id=142687
1815         <rdar://problem/20170007>
1816
1817         Reviewed by Simon Fraser.
1818
1819         This is the beginning of a prototype implementation of
1820         CSS Animation Triggers, as described by
1821         https://lists.w3.org/Archives/Public/www-style/2014Sep/0135.html
1822
1823         In this patch we parse and resolve the value of a new
1824         CSS property "-webkit-animation-trigger". At the moment it
1825         only accepts one function value "container-scroll", which
1826         will trigger the animation at an absolute position within
1827         an element's scrolling container. We expect the syntax to
1828         change in the near future, as the spec is written.
1829
1830         Tests: animations/trigger-computed-style.html
1831                animations/trigger-parsing.html
1832
1833         * WebCore.xcodeproj/project.pbxproj: Add the new files.
1834
1835         * css/CSSAnimationTriggerScrollValue.cpp: Added.
1836         (WebCore::CSSAnimationTriggerScrollValue::customCSSText): Output text for computed style.
1837         (WebCore::CSSAnimationTriggerScrollValue::equals): Compare two values.
1838         * css/CSSAnimationTriggerScrollValue.h: Added. This holds the CSS side of the
1839         scroll trigger. This name may change in the future to better represent the
1840         type of trigger, but it is good enough for now.
1841         (WebCore::CSSAnimationTriggerScrollValue::create):
1842         (WebCore::CSSAnimationTriggerScrollValue::startValue):
1843         (WebCore::CSSAnimationTriggerScrollValue::endValue):
1844         (WebCore::CSSAnimationTriggerScrollValue::CSSAnimationTriggerScrollValue):
1845
1846         * css/CSSComputedStyleDeclaration.cpp:
1847         (WebCore::createAnimationTriggerValue): Maps an AnimationTrigger into a CSSValue.
1848         (WebCore::getAnimationTriggerValue): Gets the current computed style.
1849         (WebCore::ComputedStyleExtractor::propertyValue):
1850
1851         * css/CSSParser.cpp:
1852         (WebCore::CSSParser::parseValue):
1853         (WebCore::CSSParser::parseAnimationTrigger): Parse the "container-scroll" function
1854         and record the value as a CSSAnimationTriggerScrollValue.
1855         (WebCore::CSSParser::parseAnimationProperty): Handle the new property.
1856         * css/CSSParser.h:
1857
1858         * css/CSSPropertyNames.in: Add "-webkit-animation-trigger".
1859
1860         * css/CSSToStyleMap.cpp:
1861         (WebCore::CSSToStyleMap::mapAnimationTrigger): Map a CSSValue into a trigger value on
1862         an Animation object.
1863         * css/CSSToStyleMap.h:
1864
1865         * css/CSSValue.cpp: Handle the new CSSValue type.
1866         (WebCore::CSSValue::equals):
1867         (WebCore::CSSValue::cssText):
1868         (WebCore::CSSValue::destroy):
1869         * css/CSSValue.h:
1870         (WebCore::CSSValue::isAnimationTriggerScrollValue):
1871
1872         * platform/animation/Animation.h: Add AnimationTrigger as a new field.
1873         (WebCore::Animation::isTriggerSet):
1874         (WebCore::Animation::isEmpty):
1875
1876         * platform/animation/AnimationTrigger.h: Added. New base class and subclasses for
1877         "auto" and the scrolling trigger.
1878         (WebCore::AnimationTrigger::~AnimationTrigger):
1879         (WebCore::AnimationTrigger::type):
1880         (WebCore::AnimationTrigger::isAutoAnimationTrigger):
1881         (WebCore::AnimationTrigger::isScrollAnimationTrigger):
1882         (WebCore::AnimationTrigger::AnimationTrigger):
1883         (WebCore::AutoAnimationTrigger::create):
1884         (WebCore::AutoAnimationTrigger::~AutoAnimationTrigger):
1885         (WebCore::AutoAnimationTrigger::AutoAnimationTrigger):
1886         (WebCore::ScrollAnimationTrigger::create):
1887         (WebCore::ScrollAnimationTrigger::~ScrollAnimationTrigger):
1888         (WebCore::ScrollAnimationTrigger::startValue):
1889         (WebCore::ScrollAnimationTrigger::setStartValue):
1890         (WebCore::ScrollAnimationTrigger::endValue):
1891         (WebCore::ScrollAnimationTrigger::setEndValue):
1892         (WebCore::ScrollAnimationTrigger::hasEndValue):
1893         (WebCore::ScrollAnimationTrigger::setHasEndValue):
1894         (WebCore::ScrollAnimationTrigger::ScrollAnimationTrigger):
1895
1896 2015-03-15  Roger Fong  <roger_fong@apple.com>
1897
1898         [WebGL2] Vertex Array Objects.
1899         https://bugs.webkit.org/show_bug.cgi?id=126944.
1900         <rdar://problem/15002455>
1901
1902         Reviewed by Dean Jackson.
1903
1904         Tested by a modified version of the 1.0.3 conformance test:
1905         conformance/extensions/oes-vertex-array-object.html
1906         This test will be landed along with other modified extension conformance tests
1907         once approval from Khronos is received.
1908
1909         * html/canvas/OESVertexArrayObject.cpp: Associate extension calls only with WebGLRenderingContext.
1910         (WebCore::OESVertexArrayObject::deleteVertexArrayOES):
1911         (WebCore::OESVertexArrayObject::bindVertexArrayOES):
1912         * html/canvas/WebGLRenderingContext.cpp:
1913         (WebCore::WebGLRenderingContext::initializeVertexArrayObjects):
1914         (WebCore::WebGLRenderingContext::getParameter):
1915         * html/canvas/WebGL2RenderingContext.cpp: Implement vertex array object calls as part WebGL2 context.
1916         (WebCore::WebGL2RenderingContext::createVertexArray):
1917         (WebCore::WebGL2RenderingContext::deleteVertexArray):
1918         (WebCore::WebGL2RenderingContext::isVertexArray):
1919         (WebCore::WebGL2RenderingContext::bindVertexArray):
1920         (WebCore::WebGL2RenderingContext::initializeVertexArrayObjects):
1921         (WebCore::WebGL2RenderingContext::getParameter):
1922
1923         Duplicate extension object vertex array object extension methods in GraphicsContext3D.
1924         Implementation may change after we upgrade to newer GL headers and profile.
1925         * platform/graphics/GraphicsContext3D.h:
1926         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
1927         (WebCore::GraphicsContext3D::createVertexArray):
1928         (WebCore::GraphicsContext3D::deleteVertexArray):
1929         (WebCore::GraphicsContext3D::isVertexArray):
1930         (WebCore::GraphicsContext3D::bindVertexArray):
1931
1932         Have WebGLVertexArrayObjectOES and WebGLVertexArrayObject inherit from WebGLRenderingContextBase.
1933         * CMakeLists.txt:
1934         * WebCore.xcodeproj/project.pbxproj:
1935         * html/canvas/WebGLVertexArrayObject.cpp:
1936         (WebCore::WebGLVertexArrayObject::create):
1937         (WebCore::WebGLVertexArrayObject::WebGLVertexArrayObject): Use GraphicsContext3D implementation of createVertexArray.
1938         (WebCore::WebGLVertexArrayObject::deleteObjectImpl):
1939         * html/canvas/WebGLVertexArrayObject.h:
1940         * html/canvas/WebGLVertexArrayObjectBase.cpp: Added.
1941         (WebCore::WebGLVertexArrayObjectBase::WebGLVertexArrayObjectBase):
1942         (WebCore::WebGLVertexArrayObjectBase::setElementArrayBuffer):
1943         (WebCore::WebGLVertexArrayObjectBase::setVertexAttribState):
1944         (WebCore::WebGLVertexArrayObjectBase::unbindBuffer):
1945         (WebCore::WebGLVertexArrayObjectBase::setVertexAttribDivisor):
1946         * html/canvas/WebGLVertexArrayObjectBase.h: Added.
1947         (WebCore::WebGLVertexArrayObjectBase::~WebGLVertexArrayObjectBase):
1948         (WebCore::WebGLVertexArrayObjectBase::VertexAttribState::VertexAttribState):
1949         (WebCore::WebGLVertexArrayObjectBase::VertexAttribState::isBound):
1950         (WebCore::WebGLVertexArrayObjectBase::VertexAttribState::validateBinding):
1951         (WebCore::WebGLVertexArrayObjectBase::isDefaultObject):
1952         (WebCore::WebGLVertexArrayObjectBase::hasEverBeenBound):
1953         (WebCore::WebGLVertexArrayObjectBase::setHasEverBeenBound):
1954         (WebCore::WebGLVertexArrayObjectBase::getElementArrayBuffer):
1955         (WebCore::WebGLVertexArrayObjectBase::getVertexAttribState):
1956         * html/canvas/WebGLVertexArrayObjectOES.cpp:
1957         (WebCore::WebGLVertexArrayObjectOES::WebGLVertexArrayObjectOES):
1958         (WebCore::WebGLVertexArrayObjectOES::deleteObjectImpl):
1959         (WebCore::WebGLVertexArrayObjectOES::setElementArrayBuffer): Deleted.
1960         (WebCore::WebGLVertexArrayObjectOES::setVertexAttribState): Deleted.
1961         (WebCore::WebGLVertexArrayObjectOES::unbindBuffer): Deleted.
1962         (WebCore::WebGLVertexArrayObjectOES::setVertexAttribDivisor): Deleted.
1963         * html/canvas/WebGLVertexArrayObjectOES.h:
1964
1965         * html/canvas/WebGLRenderingContextBase.cpp: Use WebGLVertexArrayObjectBase class.
1966         (WebCore::WebGLRenderingContextBase::initializeNewContext):
1967         (WebCore::WebGLRenderingContextBase::disableVertexAttribArray):
1968         (WebCore::WebGLRenderingContextBase::validateVertexAttributes):
1969         (WebCore::WebGLRenderingContextBase::enableVertexAttribArray):
1970         (WebCore::WebGLRenderingContextBase::getVertexAttrib):
1971         (WebCore::WebGLRenderingContextBase::initVertexAttrib0):
1972         (WebCore::WebGLRenderingContextBase::simulateVertexAttrib0):
1973         (WebCore::WebGLRenderingContextBase::restoreStatesAfterVertexAttrib0Simulation):
1974         * html/canvas/WebGLRenderingContextBase.h:
1975         (WebCore::WebGLRenderingContextBase::setBoundVertexArrayObject):
1976
1977         Handle construction of WebGLGetInfo using WebGLVertexArrayObject.
1978         * bindings/js/JSWebGLRenderingContextBaseCustom.cpp:
1979         (WebCore::toJS):
1980         * html/canvas/WebGLGetInfo.cpp:
1981         (WebCore::WebGLGetInfo::WebGLGetInfo):
1982         (WebCore::WebGLGetInfo::getWebGLVertexArrayObjectOES):
1983         (WebCore::WebGLGetInfo::getWebGLVertexArrayObject):
1984         * html/canvas/WebGLGetInfo.h:
1985
1986 2015-03-16  Brent Fulgham  <bfulgham@apple.com>
1987
1988         Potentially uninitialized Inspector values
1989         https://bugs.webkit.org/show_bug.cgi?id=142730
1990
1991         Reviewed by Joseph Pecoraro.
1992
1993         * inspector/InspectorDOMAgent.cpp:
1994         (WebCore::parseColor): Make sure color values are given an initial value.
1995
1996 2015-03-16  Brady Eidson  <beidson@apple.com>
1997
1998         URLs visited during private browsing show up in WebpageIcons.db
1999         rdar://problem/11254910 and https://bugs.webkit.org/show_bug.cgi?id=142733
2000
2001         Patch by Sam Weinig. Reviewed by Brady Eidson.
2002
2003         * loader/icon/IconController.cpp:
2004         (WebCore::IconController::startLoader): Bail early here if the page is using an ephemeral session.
2005         (WebCore::IconController::continueLoadWithDecision): Instead of here.
2006
2007 2015-03-16  Conrad Shultz  <conrad_shultz@apple.com>
2008
2009         Allow clients to selectively disable plug-ins
2010         https://bugs.webkit.org/show_bug.cgi?id=142506
2011
2012         Reviewed by Anders Carlsson.
2013
2014         Add new functionality allow clients to declaratively disable individual plug-ins (in a manner that conceals them
2015         from the page). As part of this:
2016
2017         1) Introduce the concept of web-visible plug-ins and related concepts, as distinct from the real underlying
2018            set of plug-ins.
2019
2020         2) Where applicable, plumb additional information about plug-ins (specifically, bundle identification) deeper
2021            down the stack.
2022
2023         3) Add generic functionality to PluginStrategy to support filtering plug-ins for visibility and introduce
2024            a concrete implementation thereof in WebPlatformStrategies in WebKit2.
2025
2026         4) Add messaging infrastructure to allow clients to set and clear plug-in policies.
2027
2028         While currently only used in a very limited manner, the new declarative plug-in policies are written generically
2029         so that they could be easily used in the future to reduce synchronous messaging to the client when loading plug-ins.
2030
2031         * dom/DOMImplementation.cpp:
2032         (WebCore::DOMImplementation::createDocument):
2033         Update to reflect function rename.
2034
2035         * loader/SubframeLoader.cpp:
2036         (WebCore::findPluginMIMETypeFromURL):
2037         Adopt getWebVisibleMimesAndPluginIndices().
2038         (WebCore::logPluginRequest):
2039         Update to reflect function rename.
2040         (WebCore::SubframeLoader::shouldUsePlugin):
2041         Ditto.
2042
2043         * platform/PlatformStrategies.h:
2044         Export platformStrategies(), since it is now used in WebProcess.cpp.
2045
2046         * plugins/DOMMimeType.cpp:
2047         (WebCore::DOMMimeType::type):
2048         (WebCore::DOMMimeType::description):
2049         (WebCore::DOMMimeType::mimeClassInfo):
2050         Adopt getWebVisibleMimesAndPluginIndices().
2051         (WebCore::DOMMimeType::enabledPlugin):
2052         Ditto.
2053
2054         * plugins/DOMMimeType.h:
2055         Don't return references in a few places where it is no longer safe to do so.
2056         (WebCore::DOMMimeType::mimeClassInfo): Deleted.
2057
2058         * plugins/DOMMimeTypeArray.cpp:
2059         (WebCore::DOMMimeTypeArray::length):
2060         Adopt getWebVisibleMimesAndPluginIndices().
2061         (WebCore::DOMMimeTypeArray::item):
2062         Ditto.
2063         (WebCore::DOMMimeTypeArray::canGetItemsForName):
2064         Ditto.
2065         (WebCore::DOMMimeTypeArray::namedItem):
2066         Ditto.
2067
2068         * plugins/DOMPlugin.cpp:
2069         (WebCore::DOMPlugin::pluginInfo):
2070         Adopt getWebVisiblePlugins().
2071         (WebCore::DOMPlugin::item):
2072         Adopt getWebVisibleMimesAndPluginIndices().
2073         (WebCore::DOMPlugin::canGetItemsForName):
2074         Ditto.
2075         (WebCore::DOMPlugin::namedItem):
2076         Ditto.
2077
2078         * plugins/DOMPlugin.h:
2079         (WebCore::DOMPlugin::pluginInfo): Deleted.
2080
2081         * plugins/DOMPluginArray.cpp:
2082         (WebCore::DOMPluginArray::length):
2083         Adopt getWebVisiblePlugins().
2084         (WebCore::DOMPluginArray::item):
2085         Ditto.
2086         (WebCore::DOMPluginArray::canGetItemsForName):
2087         Ditto.
2088         (WebCore::DOMPluginArray::namedItem):
2089         Ditto.
2090
2091         * plugins/PluginData.cpp:
2092         (WebCore::PluginData::PluginData):
2093         Stash the passed-in Page and call initPlugins().
2094         (WebCore::PluginData::getWebVisiblePlugins):
2095         New member function; call through to PluginStrategy::getWebVisiblePluginInfo().
2096         (WebCore::PluginData::getWebVisibleMimesAndPluginIndices):
2097         New member function; build up the mimes and mimePluginIndices vectors in the same manner as before, but
2098         limited to the web-visible plug-ins.
2099         (WebCore::PluginData::supportsWebVisibleMimeType):
2100         Renamed from supportsMimeType(); update to work in terms of web-visible plug-ins.
2101         (WebCore::PluginData::pluginInfoForWebVisibleMimeType):
2102         Renamed from pluginInfoForMimeType(); ditto.
2103         (WebCore::PluginData::pluginNameForWebVisibleMimeType):
2104         Renamed from pluginNameForMimeType(); ditto.
2105         (WebCore::PluginData::pluginFileForWebVisibleMimeType):
2106         Renamed from pluginFileForMimeType(); ditto.
2107         (WebCore::PluginData::initPlugins):
2108         (WebCore::PluginData::supportsMimeType): Deleted.
2109         (WebCore::PluginData::pluginInfoForMimeType): Deleted.
2110         (WebCore::PluginData::pluginNameForMimeType): Deleted.
2111         (WebCore::PluginData::pluginFileForMimeType): Deleted.
2112
2113         * plugins/PluginData.h:
2114         Add a member variable for the associate Page; declare the PluginLoadClientPolicy enumeration; add
2115         new members to PluginInfo for the clientLoadPolicy and bundle information.
2116         (WebCore::PluginData::PluginData):
2117         Replace some member functions with new ones that will hide plug-ins upon request from the client;
2118         (WebCore::PluginData::mimes): Deleted.
2119         (WebCore::PluginData::mimePluginIndices): Deleted.
2120
2121         * plugins/PluginStrategy.h:
2122         Declare new member functions for retrieving web-visible plug-ins and setting/clearing plug-in policies.
2123
2124         * replay/SerializationMethods.cpp:
2125         (JSC::EncodingTraits<PluginData>::encodeValue):
2126         Remove now-obsolete code for handling MIME types and add a FIXME.
2127         (JSC::DeserializedPluginData::DeserializedPluginData):
2128         (JSC::EncodingTraits<PluginData>::decodeValue):
2129         Ditto.
2130         (JSC::EncodingTraits<PluginInfo>::encodeValue):
2131         Handle the new members in PluginInfo.
2132         (JSC::EncodingTraits<PluginInfo>::decodeValue):
2133         Ditto.
2134
2135         * replay/WebInputs.json:
2136         Teach Replay about PluginLoadClientPolicy.
2137
2138 2015-03-16  Max Stepin  <maxstepin@gmail.com>
2139
2140         Add APNG support
2141         https://bugs.webkit.org/show_bug.cgi?id=17022
2142
2143         Reviewed by Carlos Garcia Campos.
2144
2145         Test: fast/images/animated-png.html
2146
2147         * platform/image-decoders/ImageDecoder.h:
2148         (WebCore::ImageFrame::divide255):
2149         (WebCore::ImageFrame::overRGBA):
2150         * platform/image-decoders/png/PNGImageDecoder.cpp:
2151         (WebCore::frameHeader):
2152         (WebCore::readChunks):
2153         (WebCore::PNGImageReader::PNGImageReader):
2154         (WebCore::PNGImageDecoder::PNGImageDecoder):
2155         (WebCore::PNGImageDecoder::frameBufferAtIndex):
2156         (WebCore::PNGImageDecoder::headerAvailable):
2157         (WebCore::PNGImageDecoder::rowAvailable):
2158         (WebCore::PNGImageDecoder::pngComplete):
2159         (WebCore::PNGImageDecoder::readChunks):
2160         (WebCore::PNGImageDecoder::frameHeader):
2161         (WebCore::PNGImageDecoder::init):
2162         (WebCore::PNGImageDecoder::clearFrameBufferCache):
2163         (WebCore::PNGImageDecoder::initFrameBuffer):
2164         (WebCore::PNGImageDecoder::frameComplete):
2165         (WebCore::PNGImageDecoder::processingStart):
2166         (WebCore::PNGImageDecoder::processingFinish):
2167         (WebCore::PNGImageDecoder::fallbackNotAnimated):
2168         * platform/image-decoders/png/PNGImageDecoder.h:
2169         (WebCore::PNGImageDecoder::frameCount):
2170         (WebCore::PNGImageDecoder::repetitionCount):
2171         (WebCore::PNGImageDecoder::isComplete):
2172
2173 2015-03-15  Benjamin Poulain  <benjamin@webkit.org>
2174
2175         CSS: fix the case-insensitive matching of the attribute selectors Begin, End and Hyphen
2176         https://bugs.webkit.org/show_bug.cgi?id=142715
2177
2178         Reviewed by Brent Fulgham.
2179
2180         Fix attribute matching with:
2181         -Begin: [a^=b].
2182         -End: [a$=b].
2183         -Hyphen: [a|=b].
2184
2185         Tests: fast/selectors/attribute-endswith-value-matching-is-ascii-case-insensitive.html
2186                fast/selectors/attribute-hyphen-value-matching-is-ascii-case-insensitive.html
2187                fast/selectors/attribute-startswith-value-matching-is-ascii-case-insensitive.html
2188
2189         * css/SelectorChecker.cpp:
2190         (WebCore::attributeValueMatches):
2191         I forgot to change CSSSelector::Exact in my last patch.
2192         The tests could not catch that since we use the CSS JIT almost everywhere.
2193
2194         * cssjit/SelectorCompiler.cpp:
2195         (WebCore::SelectorCompiler::attributeValueBeginsWith):
2196         (WebCore::SelectorCompiler::attributeValueEndsWith):
2197         (WebCore::SelectorCompiler::attributeValueMatchHyphenRule):
2198
2199 2015-03-15  Dan Bernstein  <mitz@apple.com>
2200
2201         Fixed the iOS build after r181522.
2202
2203         * page/FrameView.cpp:
2204         (WebCore::FrameView::performPostLayoutTasks):
2205
2206 2015-03-15  Andy Estes  <aestes@apple.com>
2207
2208         [Content Filtering] Adopt new NEFilterSource SPI
2209         https://bugs.webkit.org/show_bug.cgi?id=142710
2210         rdar://problem/19023855
2211
2212         Reviewed by Dan Bernstein.
2213
2214         Teach NetworkExtensionContentFilter to use a new, alternate NEFilterSource SPI on platforms where it is available.
2215
2216         * platform/ContentFilter.cpp:
2217         (WebCore::ContentFilter::types): Renamed HAVE(NE_FILTER_SOURCE) to HAVE(NETWORK_EXTENSION).
2218         * platform/cocoa/NetworkExtensionContentFilter.h: Renamed member variables to remove redundancy, forward-declared NEFilterSourceStatus,
2219         added a dispatch_semaphore member variable to avoid creating and destroying multiple semaphores, and made m_originalData a SharedBuffer.
2220         * platform/cocoa/NetworkExtensionContentFilter.mm:
2221         (decisionInfoReplacementData): Returned the replacement data from a decision handler info dictionary.
2222         (WebCore::createNEFilterSource): Created either an old-style or new-style NEFilterSource object.
2223         (WebCore::NetworkExtensionContentFilter::NetworkExtensionContentFilter): Called receivedResponse:decisionHandler: when using the new SPI.
2224         (WebCore::NetworkExtensionContentFilter::~NetworkExtensionContentFilter): Released the dispatch_semaphore.
2225         (WebCore::NetworkExtensionContentFilter::addData): Appended the copied NSData to m_originalData, avoiding an additional copy previously
2226         being made by NSMutableData. Used the new receivedData:decisionHandler: SPI when appropriate.
2227         (WebCore::NetworkExtensionContentFilter::finishedAddingData): Used the new finishedLoadingWithDecisionHandler: SPI when appropriate.
2228         (WebCore::NetworkExtensionContentFilter::needsMoreData): Changed m_neFilterSourceStatus to m_status.
2229         (WebCore::NetworkExtensionContentFilter::didBlockData): Ditto.
2230         (WebCore::NetworkExtensionContentFilter::getReplacementData): Returned the replacement data from NEFilterSource if the load was blocked.
2231         Otherwise, returned the original data.
2232         (WebCore::NetworkExtensionContentFilter::handleDecision): Added a helper to set m_status and m_replacementData, and to signal m_semaphore.
2233         * platform/spi/cocoa/NEFilterSourceSPI.h: Declared the new NEFilterSource SPI on platforms that support it.
2234
2235 2015-03-15  Brent Fulgham  <bfulgham@apple.com>
2236
2237         Scroll snap points are not supported on iframe content
2238         https://bugs.webkit.org/show_bug.cgi?id=142582
2239         <rdar://problem/20121319>
2240
2241         Tested by css3/scroll-snap/scroll-snap-iframe.html
2242
2243         Reviewed by Simon Fraser.
2244
2245         The scroll snap points were not being applied to the iframe contents because the code
2246         that sets up the scroll snap point content is not called for iframes.
2247
2248         To correct this, we need to make sure the snap offsets are set during post-frame layout
2249         for iframes. We also need to make sure (on Mac) that the scroll animator and timers are updated.
2250
2251         * page/FrameView.cpp:
2252         (WebCore::FrameView::performPostLayoutTasks): Call 'updateSnapOffsets' if the frame is not a
2253         MainFrame. Also notify scroll animators they need to update their snap point settings.
2254
2255 2015-03-15  Simon Fraser  <simon.fraser@apple.com>
2256
2257         Add the same is<RenderBox> test to KeyframeAnimation::computeExtentOfTransformAnimation()
2258         that ImplicitAnimation::computeExtentOfTransformAnimation() has, and change the latter
2259         to the more canonical is<RenderBox>() form.
2260         
2261         Fixes an assertion in animations/animation-on-inline-crash.html
2262
2263         * page/animation/ImplicitAnimation.cpp:
2264         (WebCore::ImplicitAnimation::computeExtentOfTransformAnimation):
2265         * page/animation/KeyframeAnimation.cpp:
2266         (WebCore::KeyframeAnimation::computeExtentOfTransformAnimation):
2267
2268 2015-03-15  Simon Fraser  <simon.fraser@apple.com>
2269
2270         And another fix. Thanks to Hunseop Jeong for the fix.
2271
2272         * html/HTMLInputElement.cpp:
2273         (WebCore::HTMLInputElement::runPostTypeUpdateTasks):
2274         (WebCore::HTMLInputElement::didMoveToNewDocument):
2275
2276 2015-03-15  Simon Fraser  <simon.fraser@apple.com>
2277
2278         Fix the touch-event build.
2279
2280         * dom/Document.cpp:
2281         (WebCore::Document::didAddTouchEventHandler):
2282         (WebCore::Document::didRemoveTouchEventHandler):
2283
2284 2015-03-15  Simon Fraser  <simon.fraser@apple.com>
2285
2286         Reduce the side-effects of animations turning off overlap testing
2287         https://bugs.webkit.org/show_bug.cgi?id=92791
2288
2289         Reviewed by Dean Jackson.
2290         
2291         When a layer is running a transition or animation of the transform property,
2292         we would simply disable overlap testing for later layers, which had the side-effect
2293         of promoting lots of unrelated elements into layers temporarily.
2294         
2295         Fix by maintaining overlap, but computing an overlap extent that takes the animation
2296         into account.
2297         
2298         Rotations are currently treated as full rotations. If an extent for the overlap is
2299         hard to compute (e.g. 3d transforms, or matrix animations with a rotation component),
2300         then we fall back to the current behavior.
2301
2302         Tests: compositing/layer-creation/mismatched-rotated-transform-animation-overlap.html
2303                compositing/layer-creation/mismatched-rotated-transform-transition-overlap.html
2304                compositing/layer-creation/mismatched-transform-transition-overlap.html
2305                compositing/layer-creation/multiple-keyframes-animation-overlap.html
2306                compositing/layer-creation/scale-rotation-animation-overlap.html
2307                compositing/layer-creation/scale-rotation-transition-overlap.html
2308                compositing/layer-creation/translate-animation-overlap.html
2309                compositing/layer-creation/translate-scale-animation-overlap.html
2310                compositing/layer-creation/translate-scale-transition-overlap.html
2311                compositing/layer-creation/translate-transition-overlap.html
2312
2313         * page/animation/AnimationBase.cpp:
2314         (WebCore::containsRotation):
2315         (WebCore::AnimationBase::computeTransformedExtentViaTransformList): When we have matched
2316         transform lists, we can map a rectangle through the various operations. Transform-origin
2317         is used to shift the origin of the box first, and then unshift after. If we encounter
2318         a rotation, for now assume it's a full rotation (a future patch could tighten this up).
2319         (WebCore::AnimationBase::computeTransformedExtentViaMatrix): If we're using matrix
2320         interpolation, we have to decompose the matrix to see if there's any rotation component,
2321         and, if there is, fall back to current behavior.
2322         * page/animation/AnimationBase.h:
2323         * page/animation/AnimationController.cpp:
2324         (WebCore::AnimationControllerPrivate::computeExtentOfAnimation):
2325         (WebCore::AnimationController::computeExtentOfAnimation):
2326         * page/animation/AnimationController.h:
2327         * page/animation/AnimationControllerPrivate.h:
2328         * page/animation/CompositeAnimation.cpp:
2329         (WebCore::CompositeAnimation::computeExtentOfTransformAnimation): Ask active keyframe
2330         animations and transitions to compute the bounds extent.
2331         * page/animation/CompositeAnimation.h:
2332         * page/animation/ImplicitAnimation.cpp:
2333         (WebCore::ImplicitAnimation::computeExtentOfTransformAnimation): Compute the extent
2334         of the start and end transforms, and union them.
2335         * page/animation/ImplicitAnimation.h:
2336         * page/animation/KeyframeAnimation.cpp:
2337         (WebCore::KeyframeAnimation::animate):
2338         (WebCore::KeyframeAnimation::getAnimatedStyle): Some nullptr goodness.
2339         (WebCore::KeyframeAnimation::computeExtentOfTransformAnimation): Compute an extent
2340         for each keyframe, and take their union.
2341         * page/animation/KeyframeAnimation.h:
2342         * platform/graphics/GeometryUtilities.cpp:
2343         (WebCore::euclidianDistance): Use Pythagoras to compute a distance.
2344         (WebCore::boundsOfRotatingRect): Given a rect whose location is relative
2345         to the rotation origin, compute a bounds for the rotated rect by computing
2346         the furthest corner from the origin, and sweeping out a circle.
2347         * platform/graphics/GeometryUtilities.h:
2348         * platform/graphics/transforms/Matrix3DTransformOperation.h:
2349         * platform/graphics/transforms/MatrixTransformOperation.h:
2350         * platform/graphics/transforms/PerspectiveTransformOperation.h:
2351         * platform/graphics/transforms/RotateTransformOperation.h:
2352         * platform/graphics/transforms/ScaleTransformOperation.h:
2353         * platform/graphics/transforms/SkewTransformOperation.h:
2354         * platform/graphics/transforms/TransformOperation.h:
2355         (WebCore::TransformOperation::isAffectedByTransformOrigin):
2356         * platform/graphics/transforms/TransformOperations.cpp:
2357         (WebCore::TransformOperations::affectedByTransformOrigin): Ask all the operations if
2358         they are affected by transform-origin.
2359         (WebCore::TransformOperations::blendByMatchingOperations): nullptr.
2360         * platform/graphics/transforms/TransformOperations.h:
2361         * rendering/RenderBox.cpp:
2362         (WebCore::RenderBox::pushMappingToContainer): Comment fix. Only take transforms into account
2363         if the geometry map says so (which is most of the time).
2364         * rendering/RenderGeometryMap.cpp:
2365         (WebCore::RenderGeometryMap::mapToContainer): RenderLayerCompositor is now using the
2366         geometry map in a way that is incompatible with this assertion; it deliberately ignores
2367         transforms sometimes, so we can't easily verify that the mapping matches mapping through
2368         renderers.
2369         (WebCore::RenderGeometryMap::pushMappingsToAncestor): Save and restore the UseTransforms
2370         bit.
2371         * rendering/RenderGeometryMap.h:
2372         * rendering/RenderLayer.cpp:
2373         (WebCore::RenderLayer::boundingBox): Whitespace.
2374         (WebCore::RenderLayer::getOverlapBoundsIncludingChildrenAccountingForTransformAnimations): Helper
2375         function to get the bounds of a layer, including descendants, when a transform animation is running.
2376         * rendering/RenderLayer.h:
2377         * rendering/RenderLayerCompositor.cpp:
2378         (WebCore::RenderLayerCompositor::CompositingState::CompositingState): Add a ancestorHasTransformAnimation
2379         flag to detect nested animated transforms.
2380         (WebCore::RenderLayerCompositor::OverlapExtent::knownToBeHaveExtentUncertainty): This returns true when
2381         the layer is animating transform, and the transition/animation is such that we can't easily compute the
2382         bounds of the animation.
2383         (WebCore::RenderLayerCompositor::computeExtent): const RenderLayer&.
2384         Compute the animated bounds if there's a transform animation running.
2385         (WebCore::RenderLayerCompositor::addToOverlapMap): const RenderLayer&
2386         (WebCore::RenderLayerCompositor::addToOverlapMapRecursive): const RenderLayer&
2387         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
2388         Delay the call to pushMappingsToAncestor() until knowing if there's a transform animation running, and
2389         if there is, push the mapping while ignoring transforms (since the transform is implicitly taken into account
2390         for overlap via the computed animated bounds).
2391         If this layer is running a transform animation, set the childState.ancestorHasTransformAnimation flag so
2392         that descendants will know (nested transform animations fall back to current behavior).
2393         The if (.... && isRunningAcceleratedTransformAnimation()) is what previously caused us to turn off overlap
2394         testing in the face of animations. That now only happens if we were unable to easily compute the animation bounds.
2395         (WebCore::RenderLayerCompositor::isRunningTransformAnimation): This previously tested whether an accelerated animation
2396         was running, but that's timing sensitive; AnimationController can start the transform animation, but it's not yet
2397         considered accelerated until we get an async callback from GraphicsLayer, yet this code needed to know if the
2398         animation was running.
2399         Since transform animations are always accelerated, we can just test for a running transform animation.
2400         (WebCore::RenderLayerCompositor::isRunningAcceleratedTransformAnimation): Deleted.
2401         * rendering/RenderLayerCompositor.h:
2402         * rendering/style/RenderStyle.cpp:
2403         (WebCore::requireTransformOrigin): Some FIXME comments.
2404
2405 2015-03-15  Simon Fraser  <simon.fraser@apple.com>
2406
2407         Clean up related to wheelEvent names
2408         https://bugs.webkit.org/show_bug.cgi?id=142713
2409
2410         Reviewed by Anders Carlsson.
2411
2412         Add EventNames::isWheelEventType() and use it in places that test for the
2413         two wheel event names.
2414
2415         * dom/Document.cpp:
2416         (WebCore::Document::didAddWheelEventHandler):
2417         (WebCore::Document::didRemoveWheelEventHandler):
2418         * dom/Document.h: No need for exports (I grepped). Pass the Node*, which
2419         will be used in a later patch.
2420         * dom/EventNames.h:
2421         (WebCore::EventNames::isWheelEventType):
2422         * dom/Node.cpp:
2423         (WebCore::Node::didMoveToNewDocument):
2424         (WebCore::tryAddEventListener):
2425         (WebCore::tryRemoveEventListener):
2426         (WebCore::Node::defaultEventHandler):
2427         * html/shadow/MediaControlsApple.cpp:
2428         (WebCore::MediaControlsAppleEventListener::handleEvent):
2429         * page/DOMWindow.cpp:
2430         (WebCore::DOMWindow::addEventListener):
2431         (WebCore::DOMWindow::removeEventListener):
2432         * page/ios/FrameIOS.mm:
2433         (WebCore::ancestorRespondingToScrollWheelEvents): Remove dead code.
2434
2435 2015-03-15  Simon Fraser  <simon.fraser@apple.com>
2436
2437         Remove a redundant repaint when a layer becomes composited
2438         https://bugs.webkit.org/show_bug.cgi?id=142711
2439
2440         Reviewed by Anders Carlsson.
2441
2442         RenderLayerCompositor::computeCompositingRequirements() doesn't need to call
2443         repaintOnCompositingChange() when a layer is going to become composited,
2444         because updateBacking() does exactly the same thing. I used an assertion
2445         and ran the tests to ensure this wasn't a behavior change.
2446
2447         * rendering/RenderLayerCompositor.cpp:
2448         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
2449
2450 2015-03-15  Benjamin Poulain  <bpoulain@apple.com>
2451
2452         Change the exact attribute matching to be ASCII case-insensitive
2453         https://bugs.webkit.org/show_bug.cgi?id=142609
2454
2455         Reviewed by Darin Adler.
2456
2457         In CSS, testing attribute values should be ASCII case-insensitive,
2458         previously we were using full unicode case conversion.
2459
2460         Test: fast/selectors/attribute-exact-value-match-is-ascii-case-insensitive.html
2461
2462         * css/CSSParser.cpp:
2463         (WebCore::CSSParser::parseKeyframeSelector):
2464         The CSS parser has its own fast version for ASCII case insensitive.
2465         This code was using the general equalIgnoringASCIICase() which was causing name conflicts,
2466         change that to the normal CSS parser version.
2467
2468         * css/SelectorCheckerTestFunctions.h:
2469         (WebCore::equalIgnoringASCIICase): Deleted.
2470         * cssjit/SelectorCompiler.cpp:
2471         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeValueExactMatching):
2472
2473 2015-03-15  Brent Fulgham  <bfulgham@apple.com>
2474
2475         scroll snap points do not properly account for zoomed pages
2476         https://bugs.webkit.org/show_bug.cgi?id=142706
2477         <rdar://problem/20165771>
2478
2479         Reviewed by Anders Carlsson.
2480
2481         When a WebView is zoomed (such that it has a non-unity pageScaleFactor), we need to account for this
2482         scaling value when selecting our correct scroll snap point target, as well as when specifying the
2483         pixel location for our animation to target.
2484
2485         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
2486         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
2487         (WebCore::ScrollingTreeFrameScrollingNodeMac::pageScaleFactor): Added new delegate method.
2488         * platform/cocoa/ScrollController.h:
2489         (WebCore::ScrollControllerClient::pageScaleFactor): Added new default delegate.
2490         * platform/cocoa/ScrollController.mm:
2491         (WebCore::ScrollController::beginScrollSnapAnimation): Calculate the correct scroll target
2492         based on the page scale factor.
2493
2494 2015-03-15  Csaba Osztrogonác  <ossy@webkit.org>
2495
2496         Fix run-bindings-tests on the WinCairo bot
2497         https://bugs.webkit.org/show_bug.cgi?id=142588
2498
2499         Reviewed by Alex Christensen.
2500
2501         * bindings/scripts/test/JS/JSFloat64Array.cpp: Added property svn:eol-style.
2502         * bindings/scripts/test/JS/JSFloat64Array.h: Added property svn:eol-style.
2503         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp: Added property svn:eol-style.
2504         * bindings/scripts/test/JS/JSTestActiveDOMObject.h: Modified property svn:eol-style.
2505         * bindings/scripts/test/JS/JSTestCallback.cpp: Modified property svn:eol-style.
2506         * bindings/scripts/test/JS/JSTestCallback.h: Modified property svn:eol-style.
2507         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp: Added property svn:eol-style.
2508         * bindings/scripts/test/JS/JSTestCustomNamedGetter.h: Modified property svn:eol-style.
2509         * bindings/scripts/test/JS/JSTestEventConstructor.cpp: Added property svn:eol-style.
2510         * bindings/scripts/test/JS/JSTestEventConstructor.h: Added property svn:eol-style.
2511         * bindings/scripts/test/JS/JSTestEventTarget.cpp: Added property svn:eol-style.
2512         * bindings/scripts/test/JS/JSTestEventTarget.h: Modified property svn:eol-style.
2513         * bindings/scripts/test/JS/JSTestException.cpp: Added property svn:eol-style.
2514         * bindings/scripts/test/JS/JSTestException.h: Added property svn:eol-style.
2515         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp: Added property svn:eol-style.
2516         * bindings/scripts/test/JS/JSTestGenerateIsReachable.h: Added property svn:eol-style.
2517         * bindings/scripts/test/JS/JSTestImplements.cpp: Added property svn:eol-style.
2518         * bindings/scripts/test/JS/JSTestImplements.h: Added property svn:eol-style.
2519         * bindings/scripts/test/JS/JSTestInterface.cpp: Modified property svn:eol-style.
2520         * bindings/scripts/test/JS/JSTestInterface.h: Modified property svn:eol-style.
2521         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp: Modified property svn:eol-style.
2522         * bindings/scripts/test/JS/JSTestMediaQueryListListener.h: Modified property svn:eol-style.
2523         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp: Added property svn:eol-style.
2524         * bindings/scripts/test/JS/JSTestNamedConstructor.h: Added property svn:eol-style.
2525         * bindings/scripts/test/JS/JSTestNondeterministic.cpp: Added property svn:eol-style.
2526         * bindings/scripts/test/JS/JSTestNondeterministic.h: Added property svn:eol-style.
2527         * bindings/scripts/test/JS/JSTestObj.cpp: Modified property svn:eol-style.
2528         * bindings/scripts/test/JS/JSTestObj.h: Modified property svn:eol-style.
2529         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp: Added property svn:eol-style.
2530         * bindings/scripts/test/JS/JSTestOverloadedConstructors.h: Added property svn:eol-style.
2531         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp: Modified property svn:eol-style.
2532         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h: Modified property svn:eol-style.
2533         * bindings/scripts/test/JS/JSTestSupplemental.cpp: Added property svn:eol-style.
2534         * bindings/scripts/test/JS/JSTestSupplemental.h: Added property svn:eol-style.
2535         * bindings/scripts/test/JS/JSTestTypedefs.cpp: Added property svn:eol-style.
2536         * bindings/scripts/test/JS/JSTestTypedefs.h: Added property svn:eol-style.
2537         * bindings/scripts/test/JS/JSattribute.cpp: Added property svn:eol-style.
2538         * bindings/scripts/test/JS/JSattribute.h: Added property svn:eol-style.
2539         * bindings/scripts/test/JS/JSreadonly.cpp: Added property svn:eol-style.
2540         * bindings/scripts/test/JS/JSreadonly.h: Added property svn:eol-style.
2541
2542 2015-03-14  Darin Adler  <darin@apple.com>
2543
2544         More event handler improvements
2545         https://bugs.webkit.org/show_bug.cgi?id=142701
2546
2547         Reviewed by Anders Carlsson.
2548
2549         These are the improvements:
2550
2551         - Use EventHandler rather than EventListener as the the type for event handler
2552           attributes. This matches the HTML specification, and also makes sense, since
2553           EventListener means something else (and we use it to mean that!). Also renamed
2554           JSWindowEventListener to WindowEventHandler. Even though this only affects the
2555           JavaScript code generated, it's not really a JavaScript-specific flag.
2556
2557         - Tweak formatting on addEventListener/removeEventListener/dispatchEvent in
2558           all the IDL files where the appear. This includes changing the spelling from
2559           "evt" to "event". Some day we should fix this so these functions only need to
2560           appear in EventTarget.idl.
2561
2562         - Tweak formatting a bit on the IDL files we had to modify anyway.
2563
2564         - Use [Conditional] more often and #if less often in IDL files.
2565
2566         - Added a new [DocumentEventHandler] attribute for the selectionchange event.
2567           This involved adding new event handler attribute functions to JSEventListener.h
2568           for use by the JavaScript bindings.
2569
2570         - Removed a little unused code from the JavaScript code bindings generator.
2571
2572         - Improved the mechanism used by HTMLElement and SVGElement to share the list of
2573           content attributes that are event handlers so there is only one map rather than
2574           two. Made a similar mechanism so that HTMLBodyElement and HTMLFrameSetElement
2575           can share the list of window event handlers.
2576
2577         - Followed the HTML specification by putting all the event handler support in
2578           the HTMLElement class rather than having event handlers apply only a the
2579           particular element that uses those events. We already did this for most of
2580           our event handlers, but we are now doing it for all of them.
2581
2582         * Modules/battery/BatteryManager.idl: Use EventHandler instead of EventListener
2583         as appropriate. Also reformatted addEventListener/removeEventListener/dispatchEvent.
2584         * Modules/encryptedmedia/MediaKeySession.idl: Ditto.
2585         * Modules/indexeddb/IDBDatabase.idl: Ditto.
2586         * Modules/indexeddb/IDBOpenDBRequest.idl: Ditto.
2587         * Modules/indexeddb/IDBRequest.idl: Ditto.
2588         * Modules/indexeddb/IDBTransaction.idl: Ditto.
2589         * Modules/mediastream/MediaStream.idl: Ditto.
2590         * Modules/mediastream/MediaStreamTrack.idl: Ditto.
2591         * Modules/mediastream/RTCDTMFSender.idl: Ditto.
2592         * Modules/mediastream/RTCDataChannel.idl: Ditto.
2593         * Modules/mediastream/RTCPeerConnection.idl: Ditto.
2594         * Modules/speech/SpeechSynthesisUtterance.idl: Ditto.
2595         * Modules/webaudio/AudioBufferSourceNode.idl: Ditto.
2596         * Modules/webaudio/AudioContext.idl: Ditto.
2597         * Modules/webaudio/OscillatorNode.idl: Ditto.
2598         * Modules/webaudio/ScriptProcessorNode.idl: Ditto.
2599         * Modules/websockets/WebSocket.idl: Ditto.
2600         * css/FontLoader.idl: Ditto.
2601         * dom/EventListener.idl: Ditto.
2602         * dom/EventTarget.idl: Ditto.
2603         * dom/MessagePort.idl: Ditto.
2604         * dom/Node.idl: Ditto.
2605         * dom/WebKitNamedFlow.idl: Ditto.
2606         * fileapi/FileReader.idl: Ditto.
2607         * html/MediaController.idl: Ditto.
2608         * html/track/AudioTrackList.idl: Ditto.
2609         * html/track/TextTrackCue.idl: Ditto.
2610         * html/track/TextTrackList.idl: Ditto.
2611         * html/track/VideoTrackList.idl: Ditto.
2612         * loader/appcache/DOMApplicationCache.idl: Ditto.
2613         * page/EventSource.idl: Ditto.
2614         * page/Performance.idl: Ditto.
2615         * workers/AbstractWorker.idl: Ditto.
2616         * workers/DedicatedWorkerGlobalScope.idl: Ditto.
2617         * workers/Worker.idl: Ditto.
2618         * workers/WorkerGlobalScope.idl: Ditto.
2619         * xml/XMLHttpRequest.idl: Ditto.
2620         * xml/XMLHttpRequestUpload.idl: Ditto.
2621
2622         * Modules/notifications/Notification.idl: Did the above, but also used
2623         [Conditional] instead of #if throughout.
2624         * html/track/TextTrack.idl: Ditto.
2625
2626         * Modules/webaudio/AudioNode.idl: Tweaked paragraphing of this file.
2627
2628         * bindings/js/JSEventListener.cpp:
2629         (WebCore::windowEventHandlerAttribute): Renamed to take the word "forwarded"
2630         out of this. More closely matches the terminology used in IDL files and the
2631         HTML specification.
2632         (WebCore::setWindowEventHandlerAttribute): Ditto.
2633         (WebCore::documentEventHandlerAttribute): Added.
2634         (WebCore::setDocumentEventHandlerAttribute): Added.
2635         * bindings/js/JSEventListener.h: Updated for above changes.
2636
2637         * bindings/objc/PublicDOMInterfaces.h: Renamed argument from "evt" to "event".
2638
2639         * bindings/scripts/CodeGeneratorGObject.pm:
2640         (SkipAttribute): Skip attributes of type "EventHandler" rather than attributes
2641         of type "EventListener".
2642         * bindings/scripts/CodeGeneratorObjC.pm:
2643         (SkipAttribute): Ditto.
2644
2645         * bindings/scripts/CodeGeneratorJS.pm:
2646         (GenerateImplementation): Look for the type EventHandler instead of the type
2647         EventListener for event handler attributes. Also added code to handle the new
2648         DocumentEventHandler, and use the name WindowEventHandler instead of the name
2649         JSWindowEventListener. Removed unneeded preflight check to see if we have
2650         writable attributes; it was not doing us any good. (That caused a lot of code
2651         to be un-indented and makes the diff hard to read.)
2652
2653         * bindings/scripts/IDLAttributes.txt: Removed JSWindowEventListener, and added
2654         WindowEventHandler and DocumentEventHandler.
2655
2656         * bindings/scripts/test/TestObj.idl: Use the type EventHandler instead of the
2657         type EventListener. The test output is unchanged, though.
2658
2659         * dom/Document.idl: Got rid of the conditionals and merged all the event handler
2660         attributes into a single sorted, unconditional list. Added some that were missing,
2661         as detected by the event-handler-attributes.html test.
2662
2663         * dom/Element.idl: Ditto. This includes moving attributes here that were formerly
2664         only in certain element classes. Note that the script event handler attribute
2665         support is still here, even though it should be in HTMLElement and SVGElement
2666         instead. There's a FIXME about that, but no real urgency in fixing it.
2667
2668         * html/HTMLAttributeNames.in: Added onmessage. Previously, the support for this
2669         was from the script attribute only, not the content attribute.
2670
2671         * html/HTMLBodyElement.cpp:
2672         (WebCore::HTMLBodyElement::createWindowEventHandlerNameMap): Added. This
2673         contains the list of all the window event handlers that can be set on a body
2674         or frameset element and which are triggered by events on the window.
2675         (WebCore::HTMLBodyElement::eventNameForWindowEventHandlerAttribute): Added.
2676         This is the function to call to use the map above. Given an attribute, it
2677         returns either null if it is not a window event handler attribute, or the
2678         event type if it is one.
2679         (WebCore::HTMLBodyElement::parseAttribute): Updated to use the new
2680         functions above. Handling of these attributes is now unconditional, but
2681         also we don't have to keep the nested if statements here up to date, just
2682         the list of event handler attributes names in the map create function above.
2683
2684         * html/HTMLBodyElement.h: Added public eventNameForWindowEventHandlerAttribute
2685         and private createWindowEventHandlerNameMap functions.
2686
2687         * html/HTMLBodyElement.idl: Updated to use WindowEventHandler, DocumentEventHandler,
2688         and EventHandler. Also made everything unconditional. Also filled out the list here
2689         to match the list handled as content attributes. All covered by the test.
2690
2691         * html/HTMLElement.cpp:
2692         (WebCore::HTMLElement::createEventHandlerNameMap): Added. Replaces the old
2693         populate function. Changed the list of event handler attributes to be a bit more
2694         complete, and to be entirely unconditional. Also refactored this function to use
2695         a new populateEventHandlerNameMap helper, shared with HTMLBodyElement.
2696         (WebCore::HTMLElement::populateEventHandlerNameMap): Added. Factors out the code
2697         that both this class and HTMLBodyElement use to build event handler name maps.
2698         (WebCore::HTMLElement::eventNameForEventHandlerAttribute): Added. This is the
2699         function that call to use the map above. Given an attribute it returns either
2700         null if it is not an event handler attribute, or the event type if it is one.
2701         This is actually two functions. One is a protected function for use by both this
2702         class and HTMLBodyElement so they can share things like the optimization to look
2703         for the "on" prefix. The other is the public function that we actually use in
2704         HTMLElement and SVGElement.
2705         (WebCore::HTMLElement::editabilityFromContentEditableAttr): Tweaked and refactored
2706         to use lineageOfType. Would have been even simpler if this took an element instead
2707         of a node. Unrelated to the event handler changes.
2708         (WebCore::HTMLElement::parseAttribute): Removed long-obsolete code that decided
2709         whether to call through to the base class. The base class function is empty and
2710         never needs to be called, and in any case there is no value in doing work to
2711         decide whether to call through to an empty function. Changed the style of the
2712         function to use early return instead of else. Worth considering whether we want
2713         to return early or call through to base class in this family of functions. It's
2714         more efficient to return early, but doesn't work well if both the derived class
2715         and base class want to respond to changes to the same attribute. The new logic
2716         for event handler attributes is more straightforward than the old, since the
2717         eventNameForEventHandlerAttribute has the logic.
2718         (WebCore::HTMLElement::textToFragment): Tweaked and refactored a bit, and also
2719         changed to return a Ref since this never fails and needs to return null.
2720
2721         * html/HTMLElement.h: Updated for above changes. This includes a template version
2722         of populateEventHandlerNameMap that extracts the array size at compile time and
2723         passes it to the non-template function that does the work.
2724
2725         * html/HTMLFrameElementBase.cpp:
2726         (WebCore::HTMLFrameElementBase::parseAttribute): Removed unneeded code to handle
2727         event handler attributes handled by HTMLElement.
2728         * html/HTMLImageElement.cpp:
2729         (WebCore::HTMLImageElement::parseAttribute): Ditto.
2730         * html/HTMLLinkElement.cpp:
2731         (WebCore::HTMLLinkElement::parseAttribute): Ditto.
2732         * html/HTMLObjectElement.cpp:
2733         (WebCore::HTMLObjectElement::parseAttribute): Ditto.
2734         * html/HTMLScriptElement.cpp:
2735         (WebCore::HTMLScriptElement::parseAttribute): Ditto.
2736
2737         * html/HTMLFrameSetElement.cpp:
2738         (WebCore::HTMLFrameSetElement::parseAttribute): Changed function to early return
2739         style, and added FIXMEs about the many problems in the attribute handling code.
2740         Replaced all the code to handle window event handlers with a new bit of code that
2741         calls HTMLBodyElement::eventNameForWindowEventHandlerAttribute.
2742
2743         * html/HTMLFrameSetElement.idl: Changed to match the list of window event handlers
2744         in HTMLBodyElement.idl, although I did not add the document event handler here.
2745         As in the various other cases, having some extra event handlers does not seem to
2746         do harm and this is covered by the event-handler-attributes.html test.
2747
2748         * html/HTMLMarqueeElement.idl: Renamed EventListener to EventHandler in comment.
2749
2750         * page/DOMWindow.idl: As with Element and Document, removed conditionals, and
2751         filled out the list of event handlers so all the tests in
2752         event-handler-attributes.html will pass.
2753
2754         * svg/SVGElement.cpp:
2755         (WebCore::SVGElement::parseAttribute): Changed code to the early return style,
2756         and replaced the event handler attribute code with new much simpler code that
2757         uses the new HTMLElement::eventNameForEventHandlerAttribute. Also changed the
2758         way we call through to base classes. Just call through to the
2759         SVGLangSpace::parseAttribute function unconditionally, and don't try to use
2760         early return style to arbitrate among base classes. We should make this
2761         simplification throughout the SVG code; there's no need for the complexity
2762         that was there before just to cut down slightly on calls through to base
2763         class parseAttribute functions.
2764
2765         * svg/SVGSVGElement.cpp:
2766         (WebCore::SVGSVGElement::parseAttribute): Changed some of this code to the
2767         early return style and corrected some comments about the window event handler
2768         attributes here. These could use some further testing and might later need to be
2769         properly supported when the attributes are set in script, not just in content.
2770
2771         * svg/SVGScriptElement.cpp:
2772         (WebCore::SVGScriptElement::isSupportedAttribute): Deleted.
2773         (WebCore::SVGScriptElement::parseAttribute): Changed this function to use the
2774         early return style and also to call through to all three base classes. This is
2775         a pattern we should follow elsewhere in SVG to simplify the code. There is no
2776         need for the supportedAttributes sets like the one in this calass, and the code
2777         is unnecessarily complex, perhaps in an attempt to optimize performance. I'm
2778         pretty sure the old code was slower than this new code will be. No need for the
2779         extra hash table lookup every time. Also removed handling of event handler
2780         attribute which is taken care of by SVGElement now.
2781         (WebCore::SVGScriptElement::svgAttributeChanged): Made similar changes for
2782         the same reason as in parseAttribute. This function really needs a new name:
2783         It's the same as parseAttribute, except it's also used when implementing
2784         changes due to SVG animation.
2785
2786         * svg/SVGScriptElement.h: Removed isSupportedAttribute.
2787
2788 2015-03-14  Simon Fraser  <simon.fraser@apple.com>
2789
2790         Clean up use of flags in localToContainer-type functions
2791         https://bugs.webkit.org/show_bug.cgi?id=142704
2792
2793         Reviewed by Alexey Proskuryakov.
2794         
2795         RenderObject::localToContainerQuad() had the questionable behavior of always
2796         enforcing UseTransforms in the flags. However, a future patch will need to call
2797         localToContainerQuad() without this flag.
2798         
2799         Fix by requiring callers of localToAbsoluteQuad(), localToContainerQuad(), localToContainerPoint(),
2800         and absoluteToLocalQuad() to pass the UseTransforms flag in, providing it as a default argument.
2801         
2802         The default value of the MapCoordinatesFlags parameter to mapLocalToContainer(),
2803         a lower-level function, is removed.
2804         
2805         Sprinkle a few more nullptrs around.
2806         
2807         No behavior change.
2808
2809         * rendering/RenderBlock.cpp:
2810         (WebCore::RenderBlock::selectionGapRectsForRepaint): call the higher-level localToContainerPoint()
2811         instead of mapLocalToContainer().
2812         (WebCore::RenderBlock::absoluteQuads): Pass UseTransforms.
2813         * rendering/RenderBox.cpp:
2814         (WebCore::RenderBox::absoluteQuads): Ditto.
2815         * rendering/RenderBox.h:
2816         * rendering/RenderFlowThread.h:
2817         * rendering/RenderGeometryMap.h:
2818         (WebCore::RenderGeometryMap::absolutePoint):
2819         (WebCore::RenderGeometryMap::absoluteRect):
2820         * rendering/RenderImage.cpp:
2821         (WebCore::RenderImage::collectSelectionRects): This function was erroneously passing
2822         'false' as flags. Pass UseTransforms instead (but no behavior change since
2823         UseTransforms was forced on lower down).
2824         * rendering/RenderInline.h:
2825         * rendering/RenderLayer.cpp:
2826         (WebCore::RenderLayer::scrollRectToVisible): UseTransforms is the parameter default, remove it.
2827         * rendering/RenderLineBreak.cpp:
2828         (WebCore::RenderLineBreak::absoluteQuads):
2829         (WebCore::RenderLineBreak::collectSelectionRects): Another erroneous 'false'.
2830         * rendering/RenderNamedFlowFragment.cpp:
2831         (WebCore::RenderNamedFlowFragment::absoluteQuadsForBoxInRegion):
2832         * rendering/RenderObject.cpp:
2833         (WebCore::RenderObject::localToContainerQuad): Here's where we no longer force
2834         the UseTransforms bit.
2835         (WebCore::RenderObject::localToContainerPoint): Also here.
2836         * rendering/RenderObject.h: I prefer bit flags lined up. Makes it easier to spot errors.
2837         (WebCore::RenderObject::localToAbsoluteQuad):
2838         * rendering/RenderText.cpp:
2839         (WebCore::RenderText::collectSelectionRects): Another bad 'false'.
2840         * rendering/RenderTextLineBoxes.cpp:
2841         (WebCore::RenderTextLineBoxes::absoluteRectsForRange):
2842         (WebCore::RenderTextLineBoxes::absoluteQuads):
2843         (WebCore::RenderTextLineBoxes::absoluteQuadsForRange):
2844         * rendering/RenderView.h:
2845         * rendering/SimpleLineLayoutFunctions.cpp:
2846         (WebCore::SimpleLineLayout::collectAbsoluteQuads):
2847         * rendering/svg/RenderSVGForeignObject.h:
2848         * rendering/svg/RenderSVGInline.cpp:
2849         (WebCore::RenderSVGInline::absoluteQuads): Another bad 'false'.
2850         * rendering/svg/RenderSVGInline.h:
2851         * rendering/svg/RenderSVGModelObject.cpp:
2852         (WebCore::RenderSVGModelObject::absoluteQuads):
2853         * rendering/svg/RenderSVGModelObject.h:
2854         * rendering/svg/RenderSVGRoot.h:
2855         * rendering/svg/RenderSVGText.cpp:
2856         (WebCore::RenderSVGText::absoluteQuads):
2857         * rendering/svg/RenderSVGText.h:
2858         * rendering/svg/SVGRenderSupport.h:
2859
2860 2015-03-14  Brent Fulgham  <bfulgham@apple.com>
2861
2862         [iOS] scroll snap points are animating to the wrong positions...
2863         https://bugs.webkit.org/show_bug.cgi?id=142705
2864         <rdar://problem/20136946>
2865
2866         Reviewed by Simon Fraser.
2867
2868         Avoid adding an extra '0' snap point to our set. We always start with one zero; this
2869         extra append just forces us to do more steps in our search for nearest snap point.
2870
2871         * page/scrolling/AxisScrollSnapOffsets.cpp:
2872         (WebCore::updateFromStyle): Remove extra '0' appended to offsets.
2873
2874 2015-03-14  Dean Jackson  <dino@apple.com>
2875
2876         Feature flag for Animations Level 2
2877         https://bugs.webkit.org/show_bug.cgi?id=142699
2878         <rdar://problem/20165097>
2879
2880         Reviewed by Brent Fulgham.
2881
2882         Add ENABLE_CSS_ANIMATIONS_LEVEL_2 and a runtime flag animationTriggersEnabled.
2883
2884         * Configurations/FeatureDefines.xcconfig:
2885         * bindings/generic/RuntimeEnabledFeatures.cpp:
2886         (WebCore::RuntimeEnabledFeatures::RuntimeEnabledFeatures):
2887         * bindings/generic/RuntimeEnabledFeatures.h:
2888         (WebCore::RuntimeEnabledFeatures::setAnimationTriggersEnabled):
2889         (WebCore::RuntimeEnabledFeatures::animationTriggersEnabled):
2890
2891 2015-03-14  Adenilson Cavalcanti  <cavalcantii@gmail.com>
2892
2893         RenderBlock::imageChange() calling const methods on exit
2894         https://bugs.webkit.org/show_bug.cgi?id=142648
2895
2896         Reviewed by Brent Fulgham.
2897
2898         No new tests, no change on behavior.
2899
2900         * rendering/RenderBlock.cpp:
2901         (WebCore::RenderBlock::imageChanged): Deleted.
2902         * rendering/RenderBlock.h:
2903
2904 2015-03-14  Víctor Manuel Jáquez Leal  <vjaquez@igalia.com>
2905
2906         [GStreamer] share GL context in pipeline
2907         https://bugs.webkit.org/show_bug.cgi?id=142693
2908
2909         Reviewed by Philippe Normand.
2910
2911         GstGL elements in a pipeline need to be aware of the application's
2912         display and its GL context. This information is shared through context
2913         messages between the pipeline and the browser.
2914
2915         This patch shares this context through a GStreamer's synchronous
2916         message, using the GL information held in the web process.
2917
2918         This patch is based on the work of Philippe Normand for Bug 138562.
2919
2920         No new tests because this is platform specific and it depends in the
2921         run-time availability and configurations of GstGL elements.
2922
2923         * PlatformGTK.cmake: appends the GstGL header files in the include
2924         directories. Also its library directory is appended.
2925         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2926         (WebCore::mediaPlayerPrivateSyncMessageCallback): New callback function.
2927         (WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer):
2928         Initialize the new class attributes.
2929         (WebCore::MediaPlayerPrivateGStreamer::handleSyncMessage): New method
2930         for handling synchronous messages from the pipeline. This method
2931         currently only handles the GL context sharing.
2932         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin): Configures
2933         the pipeline's bus to handle the synchronous messages.
2934         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: Add new
2935         class methods and attributes.
2936
2937 2015-03-13  Alex Christensen  <achristensen@webkit.org>
2938
2939         Progress towards CMake on Mac.
2940         https://bugs.webkit.org/show_bug.cgi?id=142680
2941
2942         Reviewed by Gyuyoung Kim.
2943
2944         * PlatformMac.cmake:
2945         Added new include directories and removed old source files.
2946
2947 2015-03-13  Commit Queue  <commit-queue@webkit.org>
2948
2949         Unreviewed, rolling out r181483.
2950         https://bugs.webkit.org/show_bug.cgi?id=142688
2951
2952         Caused use-after-free on many tests (Requested by ap on
2953         #webkit).
2954
2955         Reverted changeset:
2956
2957         "Allow clients to selectively disable plug-ins"
2958         https://bugs.webkit.org/show_bug.cgi?id=142506
2959         http://trac.webkit.org/changeset/181483
2960
2961 2015-03-13  Antti Koivisto  <antti@apple.com>
2962
2963         Cache glyph widths to GlyphPages
2964         https://bugs.webkit.org/show_bug.cgi?id=142028
2965
2966         Reviewed by Andreas Kling.
2967
2968         Currently we have a separate cache in Font for glyph widths. In practice we always need
2969         the widths so we can just cache them in GlyphPages. This simplifies the code and removes
2970         a per-character hash lookup from WidthIterator.
2971
2972         * platform/graphics/Font.cpp:
2973         (WebCore::Font::Font):
2974         (WebCore::Font::initCharWidths):
2975         (WebCore::Font::platformGlyphInit):
2976         (WebCore::createAndFillGlyphPage):
2977         (WebCore::Font::computeWidthForGlyph):
2978
2979             Rename to make it clear this doesn't cache.
2980
2981         (WebCore::GlyphPage::setGlyphDataForIndex):
2982
2983             Initialize the width.
2984             This could go to GlyphPage.cpp if we had one.
2985
2986         * platform/graphics/Font.h:
2987         (WebCore::Font::glyphZeroWidth):
2988         (WebCore::Font::isZeroWidthSpaceGlyph):
2989         (WebCore::Font::zeroGlyph): Deleted.
2990         (WebCore::Font::setZeroGlyph): Deleted.
2991         (WebCore::Font::widthForGlyph): Deleted.
2992         * platform/graphics/FontCascade.cpp:
2993         (WebCore::offsetToMiddleOfGlyph):
2994         * platform/graphics/FontCascadeFonts.cpp:
2995         (WebCore::FontCascadeFonts::glyphDataForCharacter):
2996         * platform/graphics/GlyphPage.h:
2997         (WebCore::GlyphData::GlyphData):
2998
2999             Return width too as part of GlyphData.
3000
3001         (WebCore::GlyphPage::glyphDataForIndex):
3002         (WebCore::GlyphPage::setGlyphDataForCharacter):
3003         (WebCore::GlyphPage::setGlyphDataForIndex):
3004         (WebCore::GlyphPage::GlyphPage):
3005         * platform/graphics/WidthIterator.cpp:
3006         (WebCore::WidthIterator::advanceInternal):
3007
3008             No need to lookup width separately now.
3009
3010         * platform/graphics/mac/ComplexTextController.cpp:
3011         (WebCore::ComplexTextController::adjustGlyphsAndAdvances):
3012         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
3013         (WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun):
3014         * rendering/mathml/RenderMathMLOperator.cpp:
3015         (WebCore::RenderMathMLOperator::advanceForGlyph):
3016         * rendering/svg/SVGTextRunRenderingContext.cpp:
3017         (WebCore::missingGlyphForFont):
3018         * svg/SVGFontData.cpp:
3019         (WebCore::SVGFontData::initializeFont):
3020
3021 2015-03-13  Eric Carlson  <eric.carlson@apple.com>
3022
3023         [Mac] Enable WIRELESS_PLAYBACK_TARGET
3024         https://bugs.webkit.org/show_bug.cgi?id=142635
3025
3026         Reviewed by Darin Adler.
3027
3028         * Configurations/FeatureDefines.xcconfig:
3029
3030 2015-03-13  Jeremy Jones  <jeremyj@apple.com>
3031
3032         Fix typo restoreUserInterfaceForOptimizedFullscreeStopWithCompletionHandler.
3033         https://bugs.webkit.org/show_bug.cgi?id=142678
3034
3035         Reviewed by Eric Carlson.
3036
3037         Add the missing 'n' in "fullscreen".
3038
3039         * platform/spi/ios/AVKitSPI.h:
3040
3041 2015-03-13  Timothy Horton  <timothy_horton@apple.com>
3042
3043         Sites that use a device-width viewport but don't have enough height to fill the view are scaled up
3044         https://bugs.webkit.org/show_bug.cgi?id=142664
3045         <rdar://problem/18859470>
3046
3047         Reviewed by Benjamin Poulain.
3048
3049         * page/ViewportConfiguration.cpp:
3050         (WebCore::ViewportConfiguration::shouldIgnoreHorizontalScalingConstraints):
3051         (WebCore::ViewportConfiguration::shouldIgnoreVerticalScalingConstraints):
3052         (WebCore::ViewportConfiguration::shouldIgnoreScalingConstraints):
3053         Split shouldIgnoreScalingConstraints into one for each dimension.
3054
3055         (WebCore::ViewportConfiguration::initialScale):
3056         (WebCore::ViewportConfiguration::minimumScale):
3057         Don't force the initial and minimum scales to cover the whole view if the
3058         page claims to want to lay out to device width but then lays out too big.
3059         This will allow pages that misbehave in this way to scale down further
3060         than they previously could, but will result in a region of empty background
3061         color being exposed at the initial/minimum scale.
3062
3063         (WebCore::ViewportConfiguration::description):
3064         Update the logging to show each dimension separately.
3065
3066         * page/ViewportConfiguration.h:
3067
3068 2015-03-13  Mark Lam  <mark.lam@apple.com>
3069
3070         Replace TCSpinLock with a new WTF::SpinLock based on WTF::Atomic.
3071         <https://webkit.org/b/142674>
3072
3073         Reviewed by Filip Pizlo.
3074
3075         No new tests because there is no new functionality. This is a refactoring effort.
3076
3077         * bindings/objc/WebScriptObject.mm:
3078         * platform/ios/wak/WAKWindow.mm:
3079         (-[WAKWindow initWithLayer:]):
3080         (-[WAKWindow initWithFrame:]):
3081
3082 2015-03-13  Doug Russell  <d_russell@apple.com>
3083
3084         AX: Provide API for assistive tech to ignore DOM key event handlers
3085         https://bugs.webkit.org/show_bug.cgi?id=142059
3086
3087         Reviewed by Beth Dakin.
3088
3089         Assistive technology applications on the desktop are heavily dependent on keyboard navigation being reliable. This is greatly hindered by sites that handle key events without updating keyboard selection and then consume the event. It is important for assistive technology apps to allow users to decide to ignore these handlers that are incorrect for their purposes.
3090
3091         This can be fixed by exposing, via a new accessibility attribute, a way to decide, for a given WebCore::Frame, to pre-empt DOM dispatch and instead let accessibility caret browsing take place.
3092
3093         Test: platform/mac/accessibility/prevent-keyboard-event-dispatch.html
3094
3095         * accessibility/AccessibilityObject.cpp:
3096         (WebCore::AccessibilityObject::preventKeyboardDOMEventDispatch):
3097         (WebCore::AccessibilityObject::setPreventKeyboardDOMEventDispatch):
3098         * accessibility/AccessibilityObject.h:
3099         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3100         (-[WebAccessibilityObjectWrapper accessibilityAttributeNames]):
3101         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
3102         (-[WebAccessibilityObjectWrapper accessibilityIsAttributeSettable:]):
3103         (-[WebAccessibilityObjectWrapper _accessibilitySetValue:forAttribute:]):
3104         * dom/Element.cpp:
3105         (WebCore::Element::dispatchKeyEvent):
3106         * page/EventHandler.cpp:
3107         (WebCore::EventHandler::keyEvent):
3108         (WebCore::handleKeyboardSelectionMovement):
3109         (WebCore::EventHandler::handleKeyboardSelectionMovementForAccessibility):
3110         * page/EventHandler.h:
3111         * page/Settings.in:
3112
3113 2015-03-09  Conrad Shultz  <conrad_shultz@apple.com>
3114
3115         Allow clients to selectively disable plug-ins
3116         https://bugs.webkit.org/show_bug.cgi?id=142506
3117
3118         Reviewed by Anders Carlsson.
3119
3120         Add new functionality allow clients to declaratively disable individual plug-ins (in a manner that conceals them
3121         from the page). As part of this:
3122
3123         1) Introduce the concept of web-visible plug-ins and related concepts, as distinct from the real underlying
3124            set of plug-ins.
3125
3126         2) Where applicable, plumb additional information about plug-ins (specifically, bundle identification) deeper
3127            down the stack.
3128
3129         3) Add generic functionality to PluginStrategy to support filtering plug-ins for visibility and introduce
3130            a concrete implementation thereof in WebPlatformStrategies in WebKit2.
3131
3132         4) Add messaging infrastructure to allow clients to set and clear plug-in policies.
3133
3134         While currently only used in a very limited manner, the new declarative plug-in policies are written generically
3135         so that they could be easily used in the future to reduce synchronous messaging to the client when loading plug-ins.
3136
3137         * dom/DOMImplementation.cpp:
3138         (WebCore::DOMImplementation::createDocument):
3139         Update to reflect function rename.
3140
3141         * loader/SubframeLoader.cpp:
3142         (WebCore::findPluginMIMETypeFromURL):
3143         Adopt getWebVisibleMimesAndPluginIndices().
3144         (WebCore::logPluginRequest):
3145         Update to reflect function rename.
3146         (WebCore::SubframeLoader::shouldUsePlugin):
3147         Ditto.
3148
3149         * platform/PlatformStrategies.h:
3150         Export platformStrategies(), since it is now used in WebProcess.cpp.
3151
3152         * plugins/DOMMimeType.cpp:
3153         (WebCore::DOMMimeType::type):
3154         (WebCore::DOMMimeType::description):
3155         (WebCore::DOMMimeType::mimeClassInfo):
3156         Adopt getWebVisibleMimesAndPluginIndices().
3157         (WebCore::DOMMimeType::enabledPlugin):
3158         Ditto.
3159
3160         * plugins/DOMMimeType.h:
3161         Don't return references in a few places where it is no longer safe to do so.
3162         (WebCore::DOMMimeType::mimeClassInfo): Deleted.
3163
3164         * plugins/DOMMimeTypeArray.cpp:
3165         (WebCore::DOMMimeTypeArray::length):
3166         Adopt getWebVisibleMimesAndPluginIndices().
3167         (WebCore::DOMMimeTypeArray::item):
3168         Ditto.
3169         (WebCore::DOMMimeTypeArray::canGetItemsForName):
3170         Ditto.
3171         (WebCore::DOMMimeTypeArray::namedItem):
3172         Ditto.
3173
3174         * plugins/DOMPlugin.cpp:
3175         (WebCore::DOMPlugin::pluginInfo):
3176         Adopt getWebVisiblePlugins().
3177         (WebCore::DOMPlugin::item):
3178         Adopt getWebVisibleMimesAndPluginIndices().
3179         (WebCore::DOMPlugin::canGetItemsForName):
3180         Ditto.
3181         (WebCore::DOMPlugin::namedItem):
3182         Ditto.
3183
3184         * plugins/DOMPlugin.h:
3185         (WebCore::DOMPlugin::pluginInfo): Deleted.
3186
3187         * plugins/DOMPluginArray.cpp:
3188         (WebCore::DOMPluginArray::length):
3189         Adopt getWebVisiblePlugins().
3190         (WebCore::DOMPluginArray::item):
3191         Ditto.
3192         (WebCore::DOMPluginArray::canGetItemsForName):
3193         Ditto.
3194         (WebCore::DOMPluginArray::namedItem):
3195         Ditto.
3196
3197         * plugins/PluginData.cpp:
3198         (WebCore::PluginData::PluginData):
3199         Stash the passed-in Page and call initPlugins().
3200         (WebCore::PluginData::getWebVisiblePlugins):
3201         New member function; call through to PluginStrategy::getWebVisiblePluginInfo().
3202         (WebCore::PluginData::getWebVisibleMimesAndPluginIndices):
3203         New member function; build up the mimes and mimePluginIndices vectors in the same manner as before, but
3204         limited to the web-visible plug-ins.
3205         (WebCore::PluginData::supportsWebVisibleMimeType):
3206         Renamed from supportsMimeType(); update to work in terms of web-visible plug-ins.
3207         (WebCore::PluginData::pluginInfoForWebVisibleMimeType):
3208         Renamed from pluginInfoForMimeType(); ditto.
3209         (WebCore::PluginData::pluginNameForWebVisibleMimeType):
3210         Renamed from pluginNameForMimeType(); ditto.
3211         (WebCore::PluginData::pluginFileForWebVisibleMimeType):
3212         Renamed from pluginFileForMimeType(); ditto.
3213         (WebCore::PluginData::initPlugins):
3214         (WebCore::PluginData::supportsMimeType): Deleted.
3215         (WebCore::PluginData::pluginInfoForMimeType): Deleted.
3216         (WebCore::PluginData::pluginNameForMimeType): Deleted.
3217         (WebCore::PluginData::pluginFileForMimeType): Deleted.
3218
3219         * plugins/PluginData.h:
3220         Add a member variable for the associate Page; declare the PluginLoadClientPolicy enumeration; add
3221         new members to PluginInfo for the clientLoadPolicy and bundle information.
3222         (WebCore::PluginData::PluginData):
3223         Replace some member functions with new ones that will hide plug-ins upon request from the client;
3224         (WebCore::PluginData::mimes): Deleted.
3225         (WebCore::PluginData::mimePluginIndices): Deleted.
3226
3227         * plugins/PluginStrategy.h:
3228         Declare new member functions for retrieving web-visible plug-ins and setting/clearing plug-in policies.
3229
3230         * replay/SerializationMethods.cpp:
3231         (JSC::EncodingTraits<PluginData>::encodeValue):
3232         Remove now-obsolete code for handling MIME types and add a FIXME.
3233         (JSC::DeserializedPluginData::DeserializedPluginData):
3234         (JSC::EncodingTraits<PluginData>::decodeValue):
3235         Ditto.
3236         (JSC::EncodingTraits<PluginInfo>::encodeValue):
3237         Handle the new members in PluginInfo.
3238         (JSC::EncodingTraits<PluginInfo>::decodeValue):
3239         Ditto.
3240
3241         * replay/WebInputs.json:
3242         Teach Replay about PluginLoadClientPolicy.
3243
3244 2015-03-13  Chris Dumez  <cdumez@apple.com>
3245
3246         XMLHttpRequests should not prevent a page from entering PageCache
3247         https://bugs.webkit.org/show_bug.cgi?id=142612
3248         <rdar://problem/19923085>
3249
3250         Reviewed by Alexey Proskuryakov.
3251
3252         Make XMLHttpRequest ActiveDOMObjects suspendable in most cases to
3253         drastically improve the likelihood of pages using them to enter
3254         PageCache. XMLHttpRequest used to be only suspendable when not
3255         loading. After this patch, if the XMLHttpRequest is loading when
3256         navigating away from the page, it will be aborted and the page
3257         will enter the PageCache. Upon restoring the page from PageCache,
3258         the XMLHttpRequests' error handlers will be executed to give them
3259         a chance to reload if they want to.
3260
3261         Test: http/tests/navigation/page-cache-xhr.html
3262
3263         * history/PageCache.cpp:
3264         (WebCore::logCanCacheFrameDecision):
3265         (WebCore::PageCache::canCachePageContainingThisFrame):
3266         Do not prevent a page to enter the page cache ff the main document has
3267         an error that is a cancellation and all remaining subresource loaders
3268         are for XHR. We extend the pre-existing mechanism used on iOS, which
3269         allowed PageCaching if the remaining resource loads are for images.
3270
3271         * loader/DocumentLoader.cpp:
3272         (WebCore::areAllLoadersPageCacheAcceptable):
3273         Mark XHR loaders as PageCache acceptable.
3274
3275         * loader/DocumentThreadableLoader.cpp:
3276         (WebCore::DocumentThreadableLoader::isXMLHttpRequest):
3277         * loader/DocumentThreadableLoader.h:
3278         * loader/ThreadableLoader.h:
3279         * loader/cache/CachedResource.cpp:
3280         (WebCore::CachedResource::areAllClientsXMLHttpRequests):
3281         * loader/cache/CachedResource.h:
3282         * loader/cache/CachedResourceClient.h:
3283         (WebCore::CachedResourceClient::isXMLHttpRequest):
3284         * xml/XMLHttpRequest.cpp:
3285         (WebCore::XMLHttpRequest::XMLHttpRequest):
3286         (WebCore::XMLHttpRequest::createRequest):
3287         (WebCore::XMLHttpRequest::canSuspend):
3288         Report that we can suspend XMLHttpRequests as long as the window load
3289         event has already fired. If the window load event has not fired yet,
3290         it would be unsafe to cancel the load in suspend() as it would
3291         potentially cause arbitrary JS execution while suspending.
3292
3293         (WebCore::XMLHttpRequest::suspend):
3294         If suspending for PageCache and the request is currently loading, abort
3295         the load and mark that we should fire the error event upon restoring
3296         from PageCache.
3297
3298         (WebCore::XMLHttpRequest::resume):
3299         (WebCore::XMLHttpRequest::resumeTimerFired):
3300         Upon resuming, fire the error event in a timer if the load was aborted
3301         for suspending. We need to do this in a timer because we are not allowed
3302         to execute arbitrary JS inside resume().
3303
3304         (WebCore::XMLHttpRequest::stop):
3305         Add a assertion to make sure we are not firing event inside stop() as
3306         this would potentially cause arbitrary JS execution and it would be
3307         unsafe. It seems to me that our code is currently unsafe but the
3308         assertion does not seem to be hit by our current layout tests. I am
3309         adding the assertion as it would make it clear we have a bug and we
3310         need to fix it.
3311
3312         * xml/XMLHttpRequest.h:
3313
3314 2015-03-13  Joonghun Park  <jh718.park@samsung.com>
3315
3316         Fix Debug build error 'comparison is always true due to limited range of data type [-Werror=type-limits]'
3317         https://bugs.webkit.org/show_bug.cgi?id=142652
3318
3319         Reviewed by Csaba Osztrogonác.
3320
3321         No new tests, no behavior changes.
3322
3323         Now CSSPropertyID type is uint16_t, so propertyID >= 0 check is needed no more.
3324
3325         * css/CSSPrimitiveValue.cpp:
3326         (WebCore::propertyName):
3327         * css/makeprop.pl:
3328
3329 2015-03-12  Zan Dobersek  <zdobersek@igalia.com>
3330
3331         Remove DrawingBuffer
3332         https://bugs.webkit.org/show_bug.cgi?id=142641
3333
3334         Reviewed by Darin Adler.
3335
3336         Remove the DrawingBuffer class. Objects of this type were only held in the
3337         WebGLRenderingContext (later renamed to WebGLRenderingContextBase) on the
3338         Chromium port, with the relevant code removed in r147888. Since then, the
3339         m_drawingBuffer member variable has always been null.
3340
3341         * CMakeLists.txt:
3342         * PlatformEfl.cmake:
3343         * PlatformGTK.cmake:
3344         * WebCore.vcxproj/WebCore.vcxproj:
3345         * WebCore.vcxproj/WebCore.vcxproj.filters:
3346         * WebCore.xcodeproj/project.pbxproj:
3347         * html/canvas/WebGL2RenderingContext.cpp:
3348         (WebCore::WebGL2RenderingContext::copyTexImage2D):
3349         * html/canvas/WebGLRenderingContext.cpp:
3350         (WebCore::WebGLRenderingContext::copyTexImage2D):
3351         * html/canvas/WebGLRenderingContextBase.cpp:
3352         (WebCore::WebGLRenderingContextBase::WebGLRenderingContextBase):
3353         (WebCore::WebGLRenderingContextBase::initializeNewContext):
3354         (WebCore::WebGLRenderingContextBase::destroyGraphicsContext3D):
3355         (WebCore::WebGLRenderingContextBase::markContextChanged):
3356         (WebCore::WebGLRenderingContextBase::clearIfComposited):
3357         (WebCore::WebGLRenderingContextBase::paintRenderingResultsToCanvas):
3358         (WebCore::WebGLRenderingContextBase::paintRenderingResultsToImageData):
3359         (WebCore::WebGLRenderingContextBase::reshape):
3360         (WebCore::WebGLRenderingContextBase::drawingBufferWidth):
3361         (WebCore::WebGLRenderingContextBase::drawingBufferHeight):
3362         (WebCore::WebGLRenderingContextBase::activeTexture):
3363         (WebCore::WebGLRenderingContextBase::bindFramebuffer):
3364         (WebCore::WebGLRenderingContextBase::bindTexture):
3365         (WebCore::WebGLRenderingContextBase::copyTexSubImage2D):
3366         (WebCore::WebGLRenderingContextBase::deleteFramebuffer):
3367         (WebCore::WebGLRenderingContextBase::disable):
3368         (WebCore::WebGLRenderingContextBase::enable):
3369         (WebCore::WebGLRenderingContextBase::getContextAttributes):
3370         (WebCore::WebGLRenderingContextBase::readPixels):
3371         (WebCore::WebGLRenderingContextBase::loseContextImpl):
3372         (WebCore::WebGLRenderingContextBase::getBoundFramebufferWidth):
3373         (WebCore::WebGLRenderingContextBase::getBoundFramebufferHeight):
3374         (WebCore::WebGLRenderingContextBase::maybeRestoreContext):
3375         * html/canvas/WebGLRenderingContextBase.h:
3376         (WebCore::ScopedDrawingBufferBinder::ScopedDrawingBufferBinder): Deleted.
3377         (WebCore::ScopedDrawingBufferBinder::~ScopedDrawingBufferBinder): Deleted.
3378         * platform/graphics/GraphicsContext.h:
3379         * platform/graphics/GraphicsContext3D.h:
3380         * platform/graphics/cairo/DrawingBufferCairo.cpp: Removed.
3381         * platform/graphics/gpu/DrawingBuffer.cpp: Removed.
3382         * platform/graphics/gpu/DrawingBuffer.h: Removed.
3383         * platform/graphics/gpu/mac/DrawingBufferMac.mm: Removed.
3384         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
3385         (WebCore::GraphicsContext3D::paintRenderingResultsToCanvas):
3386         (WebCore::GraphicsContext3D::paintRenderingResultsToImageData):
3387
3388 2015-03-12  Ryosuke Niwa  <rniwa@webkit.org>
3389
3390         REGRESSION(r180726): Removing an empty line at the end of textarea clears the entire texture
3391         https://bugs.webkit.org/show_bug.cgi?id=142646
3392
3393         Reviewed by Darin Adler.
3394
3395         The bug was caused by TypingCommand::deleteKeyPressed erroneously determining the editable root to be empty because
3396         Position::atStartOfTree returns true when it's anchored at a BR that is immediately below the root editable element.
3397
3398         Fixed the bug by replacing the use of the deprecated atFirstEditingPositionForNode by a code that understands modern
3399         position types such as PositionIsBeforeAnchor in atStartOfTree and atEndOfTree. These two functions will no longer
3400         return true when anchored before or after BR after this patch.
3401
3402         Test: editing/deleting/delete-empty-line-breaks-at-end-of-textarea.html
3403
3404         * dom/Position.cpp:
3405         (WebCore::Position::atStartOfTree):
3406         (WebCore::Position::atEndOfTree):
3407
3408 2015-03-12  Yusuke Suzuki  <utatane.tea@gmail.com>
3409
3410         Integrate MapData into JSMap and JSSet
3411         https://bugs.webkit.org/show_bug.cgi?id=142556
3412
3413         Reviewed by Filip Pizlo.
3414
3415         Now Set has SetData and it's different from MapData.
3416         And MapData/SetData are completely integrated into JSSet and JSMap.
3417         Structured-cloning algorithm need to be aware of these changes.
3418         And in the case of JSSet, since JSSet doesn't need dummy value for construction,
3419         Structured-cloning only serialize the keys in JSSet.
3420
3421         * ForwardingHeaders/runtime/MapDataInlines.h: Added.
3422         * bindings/js/SerializedScriptValue.cpp:
3423         (WebCore::CloneSerializer::serialize):
3424         (WebCore::CloneDeserializer::consumeCollectionDataTerminationIfPossible):
3425         (WebCore::CloneDeserializer::deserialize):
3426         (WebCore::CloneDeserializer::consumeMapDataTerminationIfPossible): Deleted.
3427
3428 2015-03-12  Dan Bernstein  <mitz@apple.com>
3429
3430         Finish up <rdar://problem/20086546> [Cocoa] Add an option to treat certificate chains with SHA1-signed certificates as insecure
3431
3432         Added back OS X bits that I couldn’t land initially in r181317 or had to remove in r181327.
3433
3434         * platform/network/mac/CertificateInfoMac.mm:
3435         (WebCore::CertificateInfo::containsNonRootSHA1SignedCertificate):
3436         * platform/spi/cocoa/SecuritySPI.h:
3437
3438 2015-03-12  Geoffrey Garen  <ggaren@apple.com>
3439
3440         REGRESSION: Crash under Heap::reportExtraMemoryAllocatedSlowCase for media element
3441         https://bugs.webkit.org/show_bug.cgi?id=142636
3442
3443         Reviewed by Mark Hahnenberg.
3444
3445         This was a pre-existing bug that I made a lot worse in
3446         <https://trac.webkit.org/changeset/181411>.
3447
3448         * html/HTMLMediaElement.cpp:
3449         (WebCore::HTMLMediaElement::parseAttribute): Compare size before
3450         subtracting rather than subtracting and then comparing to zero. The
3451         latter technique is not valid for unsigned integers, which will happily
3452         underflow into giant numbers.
3453
3454         * Modules/mediasource/SourceBuffer.cpp:
3455         (WebCore::SourceBuffer::reportExtraMemoryAllocated): This code was
3456          technically correct, but I took the opportunity to clean it up a bit.
3457          There's no need to do two checks here, and it smells bad to check for
3458          a negative unsigned integer.
3459
3460 2015-03-12  Sebastian Dröge  <sebastian@centricular.com>
3461
3462         Stop using single-include headers that are only available since GStreamer >= 1.2.
3463
3464         https://bugs.webkit.org/show_bug.cgi?id=142537
3465
3466         Reviewed by Philippe Normand.
3467
3468         * platform/audio/gstreamer/AudioDestinationGStreamer.cpp:
3469         * platform/audio/gstreamer/AudioFileReaderGStreamer.cpp:
3470         * platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp:
3471         * platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp:
3472         * platform/graphics/gstreamer/GStreamerUtilities.cpp:
3473         * platform/graphics/gstreamer/GStreamerUtilities.h:
3474         * platform/graphics/gstreamer/ImageGStreamer.h:
3475         Instead of using single-include headers for the GStreamer libraries,
3476         directly include the headers we need. The single-include headers were
3477         only added in 1.2, and this would be the only reason why we would
3478         depend on 1.2.
3479
3480 2015-03-12  Eric Carlson  <eric.carlson@apple.com>
3481
3482         [Mac] Update AirPlay handling
3483         https://bugs.webkit.org/show_bug.cgi?id=142541
3484
3485         Unreviewed, respond to post-review comments.
3486
3487         * dom/Document.cpp:
3488         (WebCore::Document::didChoosePlaybackTarget):
3489         * page/ChromeClient.h:
3490         * page/Page.cpp:
3491         (WebCore::Page::showPlaybackTargetPicker):
3492         (WebCore::Page::didChoosePlaybackTarget):
3493         (WebCore::Page::configurePlaybackTargetMonitoring):
3494
3495 2015-03-12  Csaba Osztrogonác  <ossy@webkit.org>
3496
3497         Fix the !ENABLE(PICTURE_SIZES) build
3498         https://bugs.webkit.org/show_bug.cgi?id=142617
3499
3500         Reviewed by Darin Adler.
3501
3502         * html/parser/HTMLPreloadScanner.cpp:
3503         (WebCore::TokenPreloadScanner::StartTagScanner::processAttributes):
3504
3505 2015-03-11  Joseph Pecoraro  <pecoraro@apple.com>
3506
3507         Unreviewed follow-up fix to r181426. Initialize TextPosition with zeros in case it gets used.
3508
3509         Address ASSERT in LayoutTests/printing/page-format-data.html.
3510
3511         * dom/InlineStyleSheetOwner.cpp:
3512         (WebCore::InlineStyleSheetOwner::InlineStyleSheetOwner):
3513         In case the TextPosition gets used because it wasn't created by a parser,
3514         zeros are more realistic values then beforeFirst.
3515
3516 2015-03-11  Roger Fong  <roger_fong@apple.com>
3517
3518         Media element time no longer updates while scrubbing following r181279.
3519         https://bugs.webkit.org/show_bug.cgi?id=142606.
3520         <rdar://problem/20131014>
3521
3522         Reviewed by Eric Carlson.
3523
3524         * Modules/mediacontrols/mediaControlsApple.js:
3525         (Controller.prototype.handleWrapperMouseMove):
3526         Update time as a result of a mouse move if we are scrubbing.
3527
3528 2015-03-11  Joseph Pecoraro  <pecoraro@apple.com>
3529
3530         Web Inspector: CSS parser errors in the console should include column numbers
3531         https://bugs.webkit.org/show_bug.cgi?id=114313
3532
3533         Reviewed by Darin Adler.
3534
3535         Test: inspector-protocol/console/warnings-errors.html
3536
3537         * css/CSSParser.h:
3538         (WebCore::CSSParser::currentCharacterOffset):
3539         Get the current character offset depending on the source type.
3540         Add instance variables to track column position and start
3541         line / column for inline stylesheets.
3542
3543         * css/CSSParser.cpp:
3544         (WebCore::CSSParser::CSSParser):
3545         (WebCore::CSSParser::parseSheet):
3546         Initialize new instance variables.
3547
3548         (WebCore::CSSParser::currentLocation):
3549         Update to include column information for the token. Also, if we are on the
3550         first line we may need to take into account a start column offset as well.
3551
3552         (WebCore::CSSParser::realLex):
3553         Set the token's start column.
3554         When bumping the line number, reset the column offset for the next
3555         line with the next character.
3556
3557         (WebCore::CSSParser::syntaxError):
3558         (WebCore::CSSParser::logError):
3559         Include column information.
3560
3561         * css/StyleSheetContents.cpp:
3562         (WebCore::StyleSheetContents::parseAuthorStyleSheet):
3563         (WebCore::StyleSheetContents::parseString):
3564         (WebCore::StyleSheetContents::parseStringAtPosition):
3565         Include column information.
3566
3567         * css/StyleSheetContents.h:
3568         * dom/InlineStyleSheetOwner.cpp:
3569         (WebCore::InlineStyleSheetOwner::InlineStyleSheetOwner):
3570         (WebCore::InlineStyleSheetOwner::createSheet):
3571         Save and use column information later on.
3572
3573         * dom/InlineStyleSheetOwner.h:
3574         * inspector/InspectorStyleSheet.cpp:
3575         (WebCore::InspectorStyleSheet::ensureSourceData):
3576         Updated parser signature needs starting column and no longer has optional parameters.
3577
3578 2015-03-11  Eric Carlson  <eric.carlson@apple.com>
3579
3580         [Mac] Update AirPlay handling
3581         https://bugs.webkit.org/show_bug.cgi?id=142541
3582
3583         Reviewed by Sam Weinig.
3584
3585         * WebCore.xcodeproj/project.pbxproj:
3586         * dom/Document.cpp:
3587         (WebCore::Document::showPlaybackTargetPicker):
3588         (WebCore::Document::addPlaybackTargetPickerClient):
3589         (WebCore::Document::removePlaybackTargetPickerClient):
3590         (WebCore::Document::configurePlaybackTargetMonitoring):
3591         (WebCore::Document::requiresPlaybackTargetRouteMonitoring):
3592         (WebCore::Document::playbackTargetAvailabilityDidChange):
3593         (WebCore::Document::didChoosePlaybackTarget):
3594         * dom/Document.h:
3595         * html/HTMLMediaElement.cpp:
3596         (WebCore::HTMLMediaElement::registerWithDocument):
3597         (WebCore::HTMLMediaElement::unregisterWithDocument):
3598         (WebCore::HTMLMediaElement::parseAttribute):
3599         * html/HTMLMediaElement.h:
3600         * html/HTMLMediaSession.cpp:
3601         (WebCore::HTMLMediaSession::HTMLMediaSession):
3602         (WebCore::HTMLMediaSession::registerWithDocument):
3603         (WebCore::HTMLMediaSession::unregisterWithDocument):
3604         (WebCore::HTMLMediaSession::showPlaybackTargetPicker):
3605         (WebCore::HTMLMediaSession::hasWirelessPlaybackTargets):
3606         (WebCore::HTMLMediaSession::setHasPlaybackTargetAvailabilityListeners):
3607         (WebCore::HTMLMediaSession::didChoosePlaybackTarget):
3608         (WebCore::HTMLMediaSession::externalOutputDeviceAvailableDidChange):
3609         (WebCore::HTMLMediaSession::requiresPlaybackTargetRouteMonitoring):
3610         * html/HTMLMediaSession.h:
3611         * page/ChromeClient.h:
3612         * page/Page.cpp:
3613         (WebCore::Page::didChoosePlaybackTarget):
3614         (WebCore::Page::playbackTargetAvailabilityDidChange):
3615         (WebCore::Page::configurePlaybackTargetMonitoring):
3616         * page/Page.h:
3617         (WebCore::Page::hasWirelessPlaybackTarget):
3618         (WebCore::Page::playbackTarget):
3619         * platform/audio/MediaSession.cpp:
3620         (WebCore::MediaSession::clientDataBufferingTimerFired):
3621         (WebCore::MediaSession::wirelessRoutesAvailableDidChange): Deleted.
3622         * platform/audio/MediaSession.h:
3623         (WebCore::MediaSession::didChoosePlaybackTarget):
3624         (WebCore::MediaSession::externalOutputDeviceAvailableDidChange):
3625         (WebCore::MediaSession::requiresPlaybackTargetRouteMonitoring):
3626         (WebCore::MediaSessionClient::setWirelessPlaybackTarget):
3627         * platform/audio/MediaSessionManager.cpp:
3628         (WebCore::MediaSessionManager::wirelessRoutesAvailableChanged): Deleted.
3629         * platform/audio/MediaSessionManager.h:
3630         (WebCore::MediaSessionManager::configureWireLessTargetMonitoring):
3631         * platform/audio/ios/MediaSessionManagerIOS.h:
3632         * platform/audio/ios/MediaSessionManagerIOS.mm:
3633         (WebCore::MediaSessionManageriOS::externalOutputDeviceAvailableDidChange):
3634         (-[WebMediaSessionHelper wirelessRoutesAvailableDidChange:]):
3635         * platform/graphics/AVPlaybackTarget.h: Added.
3636         (WebCore::AVPlaybackTarget::~AVPlaybackTarget):
3637         (WebCore::AVPlaybackTarget::AVPlaybackTarget):
3638         (WebCore::AVPlaybackTarget::setDevicePickerContext):
3639         (WebCore::AVPlaybackTarget::devicePickerContext):
3640         * platform/graphics/AVPlaybackTargetPickerClient.h: Added.
3641         (WebCore::AVPlaybackTargetPickerClient::~AVPlaybackTargetPickerClient):
3642         * platform/graphics/MediaPlayer.cpp:
3643         (WebCore::MediaPlayer::setWirelessPlaybackTarget):
3644         * platform/graphics/MediaPlayer.h:
3645         * platform/graphics/MediaPlayerPrivate.h:
3646         (WebCore::MediaPlayerPrivateInterface::setWirelessPlaybackTarget):
3647         * platform/graphics/avfoundation/AVPlaybackTargetMac.mm: Added.
3648         (WebCore::AVPlaybackTarget::encode):
3649         (WebCore::AVPlaybackTarget::decode):
3650         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
3651         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3652         (WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad):
3653         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer):
3654         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenLayer):
3655         (WebCore::MediaPlayerPrivateAVFoundationObjC::isCurrentPlaybackTargetWireless):
3656         (WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessPlaybackTargetType):
3657         (WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessVideoPlaybackDisabled):
3658         (WebCore::MediaPlayerPrivateAVFoundationObjC::setWirelessVideoPlaybackDisabled):
3659         (WebCore::MediaPlayerPrivateAVFoundationObjC::setWirelessPlaybackTarget):
3660         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateDisableExternalPlayback):
3661         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
3662
3663 2015-03-11  Alex Christensen  <achristensen@webkit.org>
3664
3665         [Content Extensions] Add resource type and load type triggers.
3666         https://bugs.webkit.org/show_bug.cgi?id=142422
3667
3668         Reviewed by Benjamin Poulain.
3669
3670         New API tests.
3671
3672         * WebCore.xcodeproj/project.pbxproj:
3673         * contentextensions/ContentExtensionCompiler.cpp:
3674         (WebCore::ContentExtensions::compileRuleList):
3675         * contentextensions/ContentExtensionParser.cpp:
3676         (WebCore::ContentExtensions::getTypeFlags):
3677         (WebCore::ContentExtensions::loadTrigger):
3678         * contentextensions/ContentExtensionRule.h:
3679         * contentextensions/ContentExtensionsBackend.cpp:
3680         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
3681         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForURL): Deleted.
3682         * contentextensions/ContentExtensionsBackend.h:
3683         * contentextensions/DFABytecode.h:
3684         (WebCore::ContentExtensions::instructionSizeWithArguments):
3685         * contentextensions/DFABytecodeCompiler.cpp:
3686         (WebCore::ContentExtensions::DFABytecodeCompiler::emitAppendConditionalAction):
3687         (WebCore::ContentExtensions::DFABytecodeCompiler::compileNode):
3688         * contentextensions/DFABytecodeCompiler.h:
3689         * contentextensions/DFABytecodeInterpreter.cpp:
3690         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
3691         * contentextensions/DFABytecodeInterpreter.h:
3692         * loader/ResourceLoadInfo.cpp: Added.
3693         (WebCore::toResourceType):
3694         (WebCore::readResourceType):
3695         (WebCore::readLoadType):
3696         (WebCore::ResourceLoadInfo::isThirdParty):
3697         (WebCore::ResourceLoadInfo::getResourceFlags):
3698         * loader/ResourceLoadInfo.h: Added.
3699         * loader/cache/CachedResourceLoader.cpp:
3700         (WebCore::CachedResourceLoader::requestResource):
3701         * page/UserContentController.cpp:
3702         (WebCore::UserContentController::actionsForResourceLoad):
3703         (WebCore::UserContentController::actionsForURL): Deleted.
3704         * page/UserContentController.h:
3705
3706 2015-03-11  Tim Horton  <timothy_horton@apple.com>
3707
3708         Fix the build.
3709
3710         * page/EventHandler.cpp:
3711         (WebCore::EventHandler::selectClosestWordFromHitTestResult):
3712         (WebCore::EventHandler::selectClosestWordOrLinkFromMouseEvent):
3713         (WebCore::EventHandler::handleMousePressEventTripleClick):
3714         (WebCore::EventHandler::handleMousePressEventSingleClick):
3715
3716 2015-03-11  Timothy Horton  <timothy_horton@apple.com>
3717
3718         <attachment> shouldn't use "user-select: all"
3719         https://bugs.webkit.org/show_bug.cgi?id=142453
3720
3721         Reviewed by Darin Adler.
3722
3723         It turns out that "user-select: all" is rife with bugs; in lieu of fixing them
3724         all (at least for now), let's not use "user-select: all" in the default stylesheet
3725         for <attachment>. It's really overkill anyway, since <attachment> can't have children.
3726         The only "user-select: all" behavior we actually want is select-on-click.
3727         So, we'll implement that in a slightly different way.
3728
3729         Tests: fast/attachment/attachment-select-on-click-inside-user-select-all.html
3730                fast/attachment/attachment-select-on-click.html
3731
3732         * css/html.css:
3733         (attachment):
3734         No more "user-select: all".
3735
3736         (attachment:focus): Deleted.
3737         We stopped using attachment focus a while back and forgot to remove this.
3738
3739         * dom/Node.h:
3740         (WebCore::Node::shouldSelectOnMouseDown):
3741         Add a virtual function that Node subclasses can override to indicate they
3742         should be selected on mouse down.
3743
3744         * html/HTMLAttachmentElement.h:
3745         Override the aforementioned virtual function; <attachment> should always
3746         be selected on mouse down.
3747
3748         * page/EventHandler.cpp:
3749         (WebCore::nodeToSelectOnMouseDownForNode):
3750         Determine which node should be selected when a mousedown hits the given node.
3751         If there's any "user-select: all", we go with the outermost "user-select: all".
3752         Otherwise, we give the node a chance to say that it wants to be selected itself.
3753
3754         (WebCore::expandSelectionToRespectSelectOnMouseDown):
3755         Rename this function, it's not just about "user-select: all" anymore.
3756         Make use of nodeToSelectOnMouseDownForNode.
3757
3758         (WebCore::EventHandler::selectClosestWordFromHitTestResult):
3759         (WebCore::EventHandler::selectClosestWordOrLinkFromMouseEvent):
3760         (WebCore::EventHandler::handleMousePressEventTripleClick):
3761         (WebCore::EventHandler::handleMousePressEventSingleClick):
3762         (WebCore::expandSelectionToRespectUserSelectAll): Deleted.
3763         Adjust to the new names.
3764
3765 2015-03-11  Geoffrey Garen  <ggaren@apple.com>
3766
3767         Users of Heap::deprecatedReportExtraMemory should switch to reportExtraMemoryAllocated+reportExtraMemoryVisited
3768         https://bugs.webkit.org/show_bug.cgi?id=142595
3769
3770         Reviewed by Andreas Kling.
3771
3772         Fixed this bug for canvas.
3773
3774         * html/HTMLCanvasElement.cpp:
3775         (WebCore::HTMLCanvasElement::memoryCost): Factored out the helper function
3776         required by our IDL generator.
3777
3778         (WebCore::HTMLCanvasElement::createImageBuffer): Use
3779         reportExtraMemoryAllocated.
3780
3781         * html/HTMLCanvasElement.h:
3782
3783         * html/HTMLCanvasElement.idl: Adopt the IDL for reporting cost in the
3784         right way during GC. This will match our reportExtraMemoryAllocated
3785         with a reportExtraMemoryVisited during GC.
3786
3787 2015-03-11  Roger Fong  <roger_fong@apple.com>
3788
3789         A number of minor edits to the media controls on OSX.
3790         https://bugs.webkit.org/show_bug.cgi?id=142551.
3791         <rdar://problem/20114707>
3792
3793         Reviewed by Darin Adler.
3794
3795         This covers a slew of minor edits to the new media controls. They are as follows.
3796         Small vertical placements adjustments to inline control elements.
3797         Make sure buttons have no focus outlines.
3798         Expand height of mute box that triggers the volume panel appearing.
3799         Turn all button colors into an slightly transparent white.
3800         Center status display text in fullscreen mode.
3801         Lower position of captions container in fullscreen mode.
3802         Show the controls on when done loading of the video an status display is hidden.
3803
3804         * Modules/mediacontrols/mediaControlsApple.css:
3805         (audio::-webkit-media-controls-panel):
3806         (audio::-webkit-media-controls-panel button:focus):
3807         (audio::-webkit-media-controls-rewind-button):
3808         (audio::-webkit-media-controls-play-button):
3809         (audio::-webkit-media-controls-play-button.paused):
3810         (audio::-webkit-media-controls-panel .mute-box):
3811         (video::-webkit-media-controls-volume-max-button):
3812         (audio::-webkit-media-controls-panel .volume-box):
3813         (video::-webkit-media-controls-volume-min-button):
3814         (audio::-webkit-media-controls-wireless-playback-picker-button):
3815         (audio::-webkit-media-controls-toggle-closed-captions-button):
3816         (audio::-webkit-media-controls-closed-captions-container li.selected:hover::before):
3817         (audio::-webkit-media-controls-fullscreen-button):
3818         (audio::-webkit-media-controls-fullscreen-button.exit):
3819         (audio::-webkit-media-controls-status-display):
3820         (audio::-webkit-media-controls-time-remaining-display):
3821         (video:-webkit-full-screen::-webkit-media-controls-panel .volume-box):
3822         (video:-webkit-full-screen::-webkit-media-controls-volume-max-button):
3823         (video:-webkit-full-screen::-webkit-media-controls-volume-min-button):
3824         (video:-webkit-full-screen::-webkit-media-controls-play-button):
3825         (video:-webkit-full-screen::-webkit-media-controls-play-button.paused):
3826         (video:-webkit-full-screen::-webkit-media-controls-seek-back-button):
3827         (video:-webkit-full-screen::-webkit-media-controls-seek-forward-button):
3828         (video:-webkit-full-screen::-webkit-media-controls-status-display):
3829         (video:-webkit-full-screen::-webkit-media-controls-closed-captions-container):
3830         (audio::-webkit-media-controls-panel button:active): Deleted.
3831         * Modules/mediacontrols/mediaControlsApple.js:
3832         (Controller.prototype.setStatusHidden):
3833
3834 2015-03-11  Commit Queue  <commit-queue@webkit.org>
3835
3836         Unreviewed, rolling out r179340 and r179344.
3837         https://bugs.webkit.org/show_bug.cgi?id=142598
3838
3839         Caused images to stay alive forever when navigating away from
3840         the page before they finish loading. (Requested by kling on
3841         #webkit).
3842
3843         Reverted changesets:
3844
3845         "CachedImage: ensure clients overrides imageChanged instead of
3846         notifyFinished"
3847         https://bugs.webkit.org/show_bug.cgi?id=140722
3848         http://trac.webkit.org/changeset/179340
3849
3850         "HTMLImageLoader: fix build failure on assert condition after
3851         r179340"
3852         https://bugs.webkit.org/show_bug.cgi?id=140722
3853         http://trac.webkit.org/changeset/179344
3854
3855 2015-03-11  Geoffrey Garen  <ggaren@apple.com>
3856
3857         Many users of Heap::reportExtraMemory* are wrong, causing lots of memory growth
3858         https://bugs.webkit.org/show_bug.cgi?id=142593
3859
3860         Reviewed by Andreas Kling.
3861
3862         Adopt deprecatedReportExtraMemory as a short-term fix for runaway
3863         memory growth in these cases where we have not adopted
3864         reportExtraMemoryVisited.
3865
3866         Long-term, we should use reportExtraMemoryAllocated+reportExtraMemoryVisited.
3867         That's tracked by https://bugs.webkit.org/show_bug.cgi?id=142595.
3868
3869         Using IOSDebug, I can see that the canvas stress test @ http://jsfiddle.net/fvyw4ba0/,
3870         which used to keep > 1000 1MB NonVolatile GPU allocations live, now keeps about 10 live.
3871
3872         * Modules/mediasource/SourceBuffer.cpp:
3873         (WebCore::SourceBuffer::reportExtraMemoryAllocated):
3874         * bindings/js/JSDocumentCustom.cpp:
3875         (WebCore::toJS):
3876         * bindings/js/JSImageDataCustom.cpp:
3877         (WebCore::toJS):
3878         * bindings/js/JSNodeListCustom.cpp:
3879         (WebCore::createWrapper):
3880         * dom/CollectionIndexCache.cpp:
3881         (WebCore::reportExtraMemoryAllocatedForCollectionIndexCache):
3882         * html/HTMLCanvasElement.cpp:
3883         (WebCore::HTMLCanvasElement::createImageBuffer):
3884         * html/HTMLImageLoader.cpp:
3885         (WebCore::HTMLImageLoader::imageChanged):
3886         * html/HTMLMediaElement.cpp:
3887         (WebCore::HTMLMediaElement::parseAttribute):
3888         * xml/XMLHttpRequest.cpp:
3889         (WebCore::XMLHttpRequest::dropProtection):
3890
3891 2015-03-10  Andy Estes  <aestes@apple.com>
3892
3893         REGRESSION (r180985): contentfiltering/block-after-add-data.html crashes with GuardMalloc
3894         https://bugs.webkit.org/show_bug.cgi?id=142526
3895
3896         Reviewed by Darin Adler.
3897
3898         * loader/DocumentLoader.cpp:
3899         (WebCore::DocumentLoader::dataReceived): Don't delete m_contentFilter until after we're done using its replacement data.
3900
3901 2015-03-10  Sam Weinig  <sam@webkit.org>
3902
3903         Allow adding a button in input elements for auto fill related functionality
3904         <rdar://problem/19782066>
3905         https://bugs.webkit.org/show_bug.cgi?id=142564
3906
3907         Reviewed by Anders Carlsson.
3908
3909         Test: fast/forms/input-auto-fill-button.html
3910
3911         - Adds a new button that can be shown in <input> elements - AutoFillButtonElement.
3912         - Makes the spelling of AutoFill consistent throughout WebCore and WebKit (except
3913           where not feasible due to exported API/SPI).
3914
3915         * CMakeLists.txt:
3916         * WebCore.vcxproj/WebCore.vcxproj:
3917         * WebCore.vcxproj/WebCore.vcxproj.filters:
3918         * WebCore.xcodeproj/project.pbxproj:
3919         Add new files.
3920
3921         * css/html.css:
3922         (input::-webkit-auto-fill-button):
3923         (input::-webkit-auto-fill-button:hover):
3924         (input::-webkit-auto-fill-button:active):
3925         Add default style rules for the AutoFill button based on the ones
3926         used for caps lock indicator.
3927
3928         * html/HTMLInputElement.cpp:
3929         (WebCore::HTMLInputElement::HTMLInputElement):
3930         (WebCore::HTMLInputElement::autoFillButtonElement):
3931         (WebCore::HTMLInputElement::reset):
3932         (WebCore::HTMLInputElement::setValueFromRenderer):
3933         (WebCore::HTMLInputElement::setAutoFilled):
3934         (WebCore::HTMLInputElement::setShowAutoFillButton):
3935         (WebCore::HTMLInputElement::setAutofilled): Deleted.
3936         * html/HTMLInputElement.h:
3937         (WebCore::HTMLInputElement::isAutoFilled):
3938         (WebCore::HTMLInputElement::showAutoFillButton):
3939         (WebCore::HTMLInputElement::isAutofilled): Deleted.
3940         Add new bit to represent whether the AutoFill button should be shown
3941         or not. By default it is not shown, and the client must enable it.
3942
3943         * html/InputType.cpp:
3944         (WebCore::InputType::updateAutoFillButton):
3945         * html/InputType.h:
3946         (WebCore::InputType::autoFillButtonElement):
3947         Add new virtual methods for updating and accessing the AutoFill button.
3948
3949         * html/TextFieldInputType.cpp:
3950         (WebCore::TextFieldInputType::createShadowSubtree):
3951         (WebCore::TextFieldInputType::autoFillButtonElement):
3952         (WebCore::TextFieldInputType::destroyShadowSubtree):
3953         (WebCore::TextFieldInputType::updatePlaceholderText):
3954         (WebCore::TextFieldInputType::shouldDrawAutoFillButton):
3955         (WebCore::TextFieldInputType::autoFillButtonElementWasClicked):
3956         (WebCore::TextFieldInputType::createContainer):
3957         (WebCore::TextFieldInputType::createAutoFillButton):
3958         (WebCore::TextFieldInputType::updateAutoFillButton):
3959         * html/TextFieldInputType.h:
3960         Add support for adding the AutoFill to the shadow DOM of textfields. The implementation
3961         is slightly different than for the caps lock indicator, because I didn't want to force
3962         the creation of a container for all <input> elements just in case an AutoFill button was
3963         added. Instead, if an AutoFill button is added, the container is created on the fly and
3964         the