94e36a0556ee619f0ca9ae2b9e2ffd1ffa2f539f
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2015-03-17  Timothy Horton  <timothy_horton@apple.com>
2
3         Reproducible null deref under ScriptedAnimationController::createDisplayRefreshMonitor
4         https://bugs.webkit.org/show_bug.cgi?id=142776
5         <rdar://problem/18921338>
6
7         Reviewed by Alexey Proskuryakov.
8
9         Test: fast/animation/request-animation-frame-unparented-iframe-crash.html
10
11         In some cases (like the new test), we can end up trying to start
12         requestAnimationFrame on a Document that has no Page. Most paths null-checked
13         the Page and did the right thing, but one failed to do so. In addition,
14         the current fallback (when Page is null) can result in us constructing
15         the wrong kind of DisplayRefreshMonitor, which could lead to trouble
16         down the road when it's reused. Instead, just completely avoid making a
17         DisplayRefreshMonitor in the null-page case.
18
19         * dom/ScriptedAnimationController.cpp:
20         (WebCore::ScriptedAnimationController::createDisplayRefreshMonitor):
21         If the page is null, bail.
22
23         * dom/ScriptedAnimationController.h:
24         * platform/graphics/DisplayRefreshMonitor.cpp:
25         (WebCore::DisplayRefreshMonitor::create):
26         Use Optional<> to make it easy to distinguish between ChromeClient
27         being unreachable (because we don't have a Page for some reason) and
28         ChromeClient declaring that it doesn't want to override the type of
29         DisplayRefreshMonitor that is created.
30
31         If ChromeClient was unreachable for some reason, we'll get back an engaged
32         nullptr and return it (instead of creating a DisplayRefreshMonitor based
33         on the platform). This avoids creating the wrong type of DisplayRefreshMonitor
34         in the rare case where we can't reach the ChromeClient (e.g. a freshly unparented
35         IFrame).
36
37         If instead the client returns a disengaged Nullopt, we'll interpret that as
38         "construct the default type", which falls back on the platform #ifdefs to
39         decide what to make.
40
41         * platform/graphics/DisplayRefreshMonitorManager.cpp:
42         (WebCore::DisplayRefreshMonitorManager::ensureMonitorForClient):
43         (WebCore::DisplayRefreshMonitorManager::scheduleAnimation):
44         Silently handle the case where we failed to make a DisplayRefreshMonitor.
45
46         * platform/graphics/DisplayRefreshMonitor.h:
47         * platform/graphics/DisplayRefreshMonitorClient.h:
48         * platform/graphics/GraphicsLayerUpdater.cpp:
49         (WebCore::GraphicsLayerUpdater::createDisplayRefreshMonitor):
50         * platform/graphics/GraphicsLayerUpdater.h:
51         * rendering/RenderLayerCompositor.cpp:
52         (WebCore::RenderLayerCompositor::createDisplayRefreshMonitor):
53         * rendering/RenderLayerCompositor.h:
54         Adjust to the new signature of createDisplayRefreshMonitor, and return
55         an engaged (nullptr) Optional if we can't get to ChromeClient for any reason.
56
57         * page/ChromeClient.h:
58         Return Nullopt (indicating a lack of override) by default.
59
60 2015-03-17  Dean Jackson  <dino@apple.com>
61
62         Implement Scroll Container Animation Triggers
63         https://bugs.webkit.org/show_bug.cgi?id=142732
64
65         Reviewed by Simon Fraser.
66
67         Test: animations/trigger-container-scroll-simple.html
68
69         Basic implementation of container-scroll. It only checks
70         the page scroll position for trigger values (not the scrolling
71         container in an overflow).
72
73         * css/CSSComputedStyleDeclaration.cpp: Add CSSPropertyWebkitAnimationTrigger
74         so that this property will appear in the inspector.
75
76         * page/FrameView.cpp:
77         (WebCore::FrameView::sendScrollEvent): If the page has scrolled, let the animation
78         controller know about it.
79
80         * page/animation/AnimationBase.cpp:
81         (WebCore::AnimationBase::updateStateMachine): Whitespace fix.
82         (WebCore::AnimationBase::fireAnimationEventsIfNeeded): If there is a trigger,
83         and the scroll position is past it, then tell the state machine that
84         we should start.
85         (WebCore::AnimationBase::timeToNextService): Use the scroll position as
86         an input to the update timer if a trigger is involved.
87
88         * page/animation/AnimationController.cpp:
89         (WebCore::AnimationControllerPrivate::ensureCompositeAnimation): Add whitespace.
90         (WebCore::AnimationControllerPrivate::scrollWasUpdated): Call updateAnimations.
91         (WebCore::AnimationController::scrollWasUpdated): Call into AnimationControllerPrivate.
92         * page/animation/AnimationController.h:
93         * page/animation/AnimationControllerPrivate.h:
94
95         * page/animation/CompositeAnimation.cpp: Keep a record of whether we have a scroll
96         triggered animation.
97         (WebCore::CompositeAnimation::CompositeAnimation):
98         (WebCore::CompositeAnimation::updateKeyframeAnimations):
99         * page/animation/CompositeAnimation.h:
100         (WebCore::CompositeAnimation::hasScrollTriggeredAnimation):
101         * platform/animation/Animation.cpp:
102         (WebCore::Animation::operator=):
103
104 2015-03-17  Simon Fraser  <simon.fraser@apple.com>
105
106         Move some code from LogicalSelectionOffsetCaches into RenderElement
107         https://bugs.webkit.org/show_bug.cgi?id=142758
108
109         Reviewed by Myles C. Maxfield.
110
111         LogicalSelectionOffsetCaches had some useful code regarding containing blocks etc
112         that should be used in more places, so move it into RenderElement.
113         
114         No behavior change.
115
116         * rendering/LogicalSelectionOffsetCaches.h:
117         (WebCore::LogicalSelectionOffsetCaches::LogicalSelectionOffsetCaches):
118         (WebCore::isContainingBlockCandidateForAbsolutelyPositionedObject): Deleted.
119         (WebCore::isNonRenderBlockInline): Deleted.
120         (WebCore::containingBlockForFixedPosition): Deleted.
121         (WebCore::containingBlockForAbsolutePosition): Deleted.
122         (WebCore::containingBlockForObjectInFlow): Deleted.
123         * rendering/RenderBlock.cpp: No need to initialize static data.
124         (WebCore::RenderBlock::positionedObjects): nullptr
125         * rendering/RenderElement.cpp:
126         (WebCore::RenderElement::containingBlockForFixedPosition):
127         (WebCore::RenderElement::containingBlockForAbsolutePosition):
128         (WebCore::isNonRenderBlockInline):
129         (WebCore::RenderElement::containingBlockForObjectInFlow):
130         * rendering/RenderElement.h:
131         (WebCore::RenderElement::canContainAbsolutelyPositionedObjects):
132         * rendering/RenderLayer.cpp:
133         (WebCore::isContainerForPositioned):
134         * rendering/RenderObject.cpp:
135         (WebCore::RenderObject::containingBlock):
136
137 2015-03-17  Alex Christensen  <achristensen@webkit.org>
138
139         [WinCairo] Unreviewed build fix after r181640.
140
141         * platform/graphics/cairo/GraphicsContext3DCairo.cpp:
142         Tell Windows how to find ShaderLang.h.
143
144 2015-03-17  Chris Dumez  <cdumez@apple.com>
145
146         'pageLoaded' diagnostic logging is too verbose
147         https://bugs.webkit.org/show_bug.cgi?id=142727
148         <rdar://problem/18937048>
149
150         Reviewed by Eric Carlson.
151
152         Make 'pageLoaded' diagnostic logging less verbose:
153         - Log once per main frame instead of once for subframe
154         - Apply sampling
155
156         * loader/FrameLoader.cpp:
157         (WebCore::FrameLoader::checkLoadCompleteForThisFrame):
158
159 2015-03-17  Carlos Garcia Campos  <cgarcia@igalia.com>
160
161         [GTK] Wrong transfer annotations used in GObject DOM bindings
162         https://bugs.webkit.org/show_bug.cgi?id=142780
163
164         Reviewed by Gustavo Noronha Silva.
165
166         We are using transfer none for all methods returning a GObject DOM
167         Object. That's not true. Only objects derived from Node are
168         automatically released by the DOM object cache and can be transfer
169         none. All other objects are added to the cache only to avoid
170         creating the same wrapper twice for the same core object, but
171         caller should release the returned reference.
172
173         * bindings/gobject/WebKitDOMCustomUnstable.h:
174         * bindings/scripts/CodeGeneratorGObject.pm:
175         (GetTransferTypeForReturnType):
176         (GenerateFunction):
177
178 2015-03-17  Carlos Garcia Campos  <cgarcia@igalia.com>
179
180         [GTK] WebKitDOM objects leaking
181         https://bugs.webkit.org/show_bug.cgi?id=118788
182
183         Reviewed by Darin Adler and Sergio Villar Senin.
184
185         Use a DOMwindowObserver class, derived from DOMWindowProperty to
186         be notified when the window object is detached from the frame to
187         clear the DOM objects associated to that frame in that case too.
188
189         * bindings/gobject/DOMObjectCache.cpp:
190
191 2015-03-17  Zan Dobersek  <zdobersek@igalia.com>
192
193         [CMake] Use a forwarding header for ANGLE's ShaderLang.h to avoid picking up ANGLE's EGL headers
194         https://bugs.webkit.org/show_bug.cgi?id=142530
195
196         Reviewed by Darin Adler.
197
198         Include the ANGLE's ShaderLang.h through the new forwarding header. This allows
199         us to not list Source/ThirdParty/ANGLE/include in the list of inclusion directories
200         and thus avoid ANGLE's EGL and GLES2/GLES3 headers, defaulting to the system-provided
201         headers instead.
202
203         Source/ThirdParty/ANGLE/include/KHR is still used because ANGLE's khrplatform.h is
204         required by the ShaderLang.h header. Source/ThirdParty/ANGLE/src is not used for the
205         whole WebCore library anymore, only the ANGLESupport library.
206
207         * CMakeLists.txt:
208         * platform/graphics/ANGLEWebKitBridge.h:
209         * platform/graphics/cairo/GraphicsContext3DCairo.cpp:
210
211 2015-03-17  Matt Baker  <mattbaker@apple.com>
212
213         Web Inspector: Show rendering frames (and FPS) in Layout and Rendering timeline
214         https://bugs.webkit.org/show_bug.cgi?id=142029
215
216         Reviewed by Timothy Hatcher.
217
218         Add new functionality to the Inspector timelines backend to add runloop data to timeline recordings.
219
220         * inspector/InspectorTimelineAgent.cpp:
221         (WebCore::currentRunLoop):
222         (WebCore::InspectorTimelineAgent::internalStart):
223         (WebCore::InspectorTimelineAgent::internalStop):
224         (WebCore::toProtocol):
225         (WebCore::InspectorTimelineAgent::InspectorTimelineAgent):
226         Install observers for the begining and end of the runloop when recording begins. All other
227         instrumented timeline events get added as children of the current runloop record, which is
228         sent to the frontend once the runloop completes.
229
230         * inspector/InspectorTimelineAgent.h:
231
232         * platform/cf/RunLoopObserver.cpp:
233         (WebCore::RunLoopObserver::schedule):
234         Wrapper changed to allow observing arbitrary runloop activities.
235
236         * platform/cf/RunLoopObserver.h:
237
238 2015-03-17  Philippe Normand  <pnormand@igalia.com>
239
240         [GTK] basic OpenWebRTC build support
241         https://bugs.webkit.org/show_bug.cgi?id=142393
242
243         Reviewed by Carlos Garcia Campos.
244
245         * PlatformGTK.cmake: Add OpenWebRTC CFLAGS and LDFLAGS.
246
247 2015-03-17  Joseph Pecoraro  <pecoraro@apple.com>
248
249         Remove never used "useLayerOnTop" bindings generator argument
250         https://bugs.webkit.org/show_bug.cgi?id=142773
251
252         Reviewed by Darin Adler.
253
254         * bindings/scripts/CodeGenerator.pm:
255         * bindings/scripts/CodeGeneratorJS.pm:
256         * bindings/scripts/CodeGeneratorObjC.pm:
257         * bindings/scripts/generate-bindings.pl:
258
259 2015-03-16  Ryosuke Niwa  <rniwa@webkit.org>
260
261         Enable ES6 classes by default
262         https://bugs.webkit.org/show_bug.cgi?id=142774
263
264         Reviewed by Gavin Barraclough.
265
266         * Configurations/FeatureDefines.xcconfig:
267
268 2015-03-16  Simon Fraser  <simon.fraser@apple.com>
269
270         Update the debug overlays after layout
271         https://bugs.webkit.org/show_bug.cgi?id=142768
272
273         Reviewed by Zalan Bujtas.
274
275         The debug overlays need to be updated after layout, in case elements with wheel event handlers
276         moved around.
277         
278         DebugPageOverlays::didLayout() is cheap if there are no overlays.
279         
280         Call DebugPageOverlays::didLayout() for all frames, not just the main frame, since subframes can contribute
281         to the main frame's event handler region.
282
283         * page/DebugPageOverlays.cpp:
284         (WebCore::DebugPageOverlays::regionChanged):
285         * page/DebugPageOverlays.h:
286         (WebCore::DebugPageOverlays::didLayout):
287         (WebCore::DebugPageOverlays::didChangeEventHandlers):
288         * page/FrameView.cpp:
289         (WebCore::FrameView::layout):
290
291 2015-03-16  Jon Lee  <jonlee@apple.com>
292
293         Unreviewed fix for crash after r181608.
294
295         * WebCore.xcodeproj/project.pbxproj: Include it in the WebCore framework.
296
297 2015-03-16  Simon Fraser  <simon.fraser@apple.com>
298
299         Generalize the Document code that maintains a set of nodes with event handlers
300         https://bugs.webkit.org/show_bug.cgi?id=142762
301
302         Reviewed by Zalan Bujtas, Darin Adler.
303
304         Document.h defines a TouchEventTargetSet type, which will in future be used for
305         other event types too (wheel events), so rename it to EventTargetSet.
306         
307         Take didRemoveEventTargetNode() outside the TOUCH_EVENTS #ifdef, and change it
308         to take a reference.
309
310         * dom/Document.cpp:
311         (WebCore::Document::prepareForDestruction): References
312         (WebCore::Document::didAddTouchEventHandler): Ditto.
313         (WebCore::Document::didRemoveEventTargetNode): Ditto.
314         * dom/Document.h:
315         (WebCore::Document::touchEventTargets): No-one calls this; just remove the non
316         #ideffed one.
317         * html/HTMLInputElement.cpp:
318         (WebCore::HTMLInputElement::~HTMLInputElement): Pass a ref.
319         (WebCore::HTMLInputElement::didMoveToNewDocument): Pass a ref.
320         * page/DOMWindow.cpp:
321         (WebCore::DOMWindow::removeAllEventListeners): Pass a ref.
322
323 2015-03-16  Joseph Pecoraro  <pecoraro@apple.com>
324
325         Web Inspector: Object Previews in Indexed DB tables
326         https://bugs.webkit.org/show_bug.cgi?id=140813
327
328         Reviewed by Timothy Hatcher.
329
330         * inspector/InspectorIndexedDBAgent.cpp:
331         Include previews with object store objects.
332
333 2015-03-16  Jer Noble  <jer.noble@apple.com>
334
335         [Mac] Update missing image UI
336         https://bugs.webkit.org/show_bug.cgi?id=142592
337
338         Reviewed by Darin Adler.
339
340         Update the broken image glyphs with new art (including a 3x image).
341
342         Test: fast/hidpi/broken-image-icon-very-hidpi.html
343
344         * Resources/missingImage.png:
345         * Resources/missingImage@2x.png:
346         * Resources/missingImage@3x.png: Added.
347         * WebCore.xcodeproj/project.pbxproj:
348         * loader/cache/CachedImage.cpp:
349         (WebCore::CachedImage::brokenImage):
350
351 2015-03-16  Dean Jackson  <dino@apple.com>
352
353         Parsing and Style Resolution of Container-based Animation Triggers
354         https://bugs.webkit.org/show_bug.cgi?id=142687
355         <rdar://problem/20170007>
356
357         Reviewed by Simon Fraser.
358
359         Take 2 after the previous patch was rolled out.
360
361         This is the beginning of a prototype implementation of
362         CSS Animation Triggers, as described by
363         https://lists.w3.org/Archives/Public/www-style/2014Sep/0135.html
364
365         In this patch we parse and resolve the value of a new
366         CSS property "-webkit-animation-trigger". At the moment it
367         only accepts one function value "container-scroll", which
368         will trigger the animation at an absolute position within
369         an element's scrolling container. We expect the syntax to
370         change in the near future, as the spec is written.
371
372         Tests: animations/trigger-computed-style.html
373                animations/trigger-parsing.html
374
375         * WebCore.xcodeproj/project.pbxproj: Add the new files.
376
377         * css/CSSAnimationTriggerScrollValue.cpp: Added.
378         (WebCore::CSSAnimationTriggerScrollValue::customCSSText): Output text for computed style.
379         (WebCore::CSSAnimationTriggerScrollValue::equals): Compare two values.
380         * css/CSSAnimationTriggerScrollValue.h: Added. This holds the CSS side of the
381         scroll trigger. This name may change in the future to better represent the
382         type of trigger, but it is good enough for now.
383         (WebCore::CSSAnimationTriggerScrollValue::create):
384         (WebCore::CSSAnimationTriggerScrollValue::startValue):
385         (WebCore::CSSAnimationTriggerScrollValue::endValue):
386         (WebCore::CSSAnimationTriggerScrollValue::CSSAnimationTriggerScrollValue):
387
388         * css/CSSComputedStyleDeclaration.cpp:
389         (WebCore::createAnimationTriggerValue): Maps an AnimationTrigger into a CSSValue.
390         (WebCore::getAnimationTriggerValue): Gets the current computed style.
391         (WebCore::ComputedStyleExtractor::propertyValue):
392
393         * css/CSSParser.cpp:
394         (WebCore::CSSParser::parseValue):
395         (WebCore::CSSParser::parseAnimationTrigger): Parse the "container-scroll" function
396         and record the value as a CSSAnimationTriggerScrollValue.
397         (WebCore::CSSParser::parseAnimationProperty): Handle the new property.
398         * css/CSSParser.h:
399
400         * css/CSSPropertyNames.in: Add "-webkit-animation-trigger".
401
402         * css/CSSToStyleMap.cpp:
403         (WebCore::CSSToStyleMap::mapAnimationTrigger): Map a CSSValue into a trigger value on
404         an Animation object.
405         * css/CSSToStyleMap.h:
406
407         * css/CSSValue.cpp: Handle the new CSSValue type.
408         (WebCore::CSSValue::equals):
409         (WebCore::CSSValue::cssText):
410         (WebCore::CSSValue::destroy):
411         * css/CSSValue.h:
412         (WebCore::CSSValue::isAnimationTriggerScrollValue):
413
414         * platform/animation/Animation.cpp: Make sure to initialise m_trigger and m_triggerSet,
415         and use them in the operator==.
416         * platform/animation/Animation.h: Add AnimationTrigger as a new field.
417         (WebCore::Animation::isTriggerSet):
418         (WebCore::Animation::isEmpty):
419
420         * platform/animation/AnimationTrigger.h: Added. New base class and subclasses for
421         "auto" and the scrolling trigger.
422         (WebCore::AnimationTrigger::~AnimationTrigger):
423         (WebCore::AnimationTrigger::type):
424         (WebCore::AnimationTrigger::isAutoAnimationTrigger):
425         (WebCore::AnimationTrigger::isScrollAnimationTrigger):
426         (WebCore::AnimationTrigger::AnimationTrigger):
427         (WebCore::AutoAnimationTrigger::create):
428         (WebCore::AutoAnimationTrigger::~AutoAnimationTrigger):
429         (WebCore::AutoAnimationTrigger::AutoAnimationTrigger):
430         (WebCore::ScrollAnimationTrigger::create):
431         (WebCore::ScrollAnimationTrigger::~ScrollAnimationTrigger):
432         (WebCore::ScrollAnimationTrigger::startValue):
433         (WebCore::ScrollAnimationTrigger::setStartValue):
434         (WebCore::ScrollAnimationTrigger::endValue):
435         (WebCore::ScrollAnimationTrigger::setEndValue):
436         (WebCore::ScrollAnimationTrigger::hasEndValue):
437         (WebCore::ScrollAnimationTrigger::setHasEndValue):
438         (WebCore::ScrollAnimationTrigger::ScrollAnimationTrigger):
439
440 2015-03-16  Alex Christensen  <achristensen@webkit.org>
441
442         Progress towards CMake on Mac
443         https://bugs.webkit.org/show_bug.cgi?id=142747
444
445         Reviewed by Chris Dumez.
446
447         * CMakeLists.txt:
448         * PlatformMac.cmake:
449         Added more directories, interfaces, and forwarding headers.
450         Temporarily disabled the generating of ObjC bindings in CMake builds.
451         * platform/mac/PasteboardMac.mm:
452         Removed unused include.
453
454 2015-03-16  Joanmarie Diggs  <jdiggs@igalia.com>
455
456         AX: Crash viewing http://www.last.fm/
457         https://bugs.webkit.org/show_bug.cgi?id=142309
458
459         Reviewed by Chris Fleizach.
460
461         The crash occurs when a not-yet-rendered object emits a children-changed
462         signal. If an assistive technology is listening, AT-SPI2 will attempt to
463         create and cache the state set for the child being added and the creation
464         of the state set assumes a rendered object.
465
466         Test: platform/gtk/accessibility/no-notification-for-unrendered-iframe-children.html
467
468         * accessibility/atk/AXObjectCacheAtk.cpp:
469         (WebCore::AXObjectCache::attachWrapper):
470
471 2015-03-16  Commit Queue  <commit-queue@webkit.org>
472
473         Unreviewed, rolling out r181492.
474         https://bugs.webkit.org/show_bug.cgi?id=142756
475
476         May have regressed PLT (Requested by anttik on #webkit).
477
478         Reverted changeset:
479
480         "Cache glyph widths to GlyphPages"
481         https://bugs.webkit.org/show_bug.cgi?id=142028
482         http://trac.webkit.org/changeset/181492
483
484 2015-03-16  Roger Fong  <roger_fong@apple.com>
485
486         [WebGL2] Instancing draw calls.
487         https://bugs.webkit.org/show_bug.cgi?id=126939.
488         <rdar://problem/15002379>
489
490         Reviewed by Dean Jackson.
491
492         Tested by a modified version of the 1.0.3 conformance tests:
493         conformance/extensions/angle-instanced-arrays.html
494         conformance/extensions/angle-instanced-arrays-out-of-bounds.html
495
496         These tests will be landed along with other modified extension conformance tests
497         once approval from Khronos is received.
498
499         * html/canvas/WebGL2RenderingContext.cpp:
500         (WebCore::WebGL2RenderingContext::clear): Generate error if clearing an integer color buffer.
501         (WebCore::WebGL2RenderingContext::vertexAttribDivisor): Call method from base class.
502         (WebCore::WebGL2RenderingContext::drawArraysInstanced): Ditto.
503         (WebCore::WebGL2RenderingContext::drawElementsInstanced): Ditto.
504         (WebCore::WebGL2RenderingContext::isIntegerFormat): Ditto.
505         (WebCore::WebGL2RenderingContext::validateDrawElements): Deleted. Move back to base class.
506         * html/canvas/WebGL2RenderingContext.h:
507         * html/canvas/WebGL2RenderingContext.idl: Add a missing enum.
508         * html/canvas/WebGLRenderingContext.cpp:
509         (WebCore::WebGLRenderingContext::clear): Copied from WebGLRenderingContextBase.
510         (WebCore::WebGLRenderingContext::validateDrawElements): Deleted. Move back to base class.
511         * html/canvas/WebGLRenderingContext.h:
512         * html/canvas/WebGLRenderingContextBase.cpp: 
513         (WebCore::WebGLRenderingContextBase::clear): Deleted. Moved to WebGLRenderingContext.
514         (WebCore::WebGLRenderingContextBase::getVertexAttrib): Check for WebGL2 context.
515         (WebCore::WebGLRenderingContext::validateDrawElements): Ditto.
516         * html/canvas/WebGLRenderingContextBase.h:
517
518 2015-03-16  Commit Queue  <commit-queue@webkit.org>
519
520         Unreviewed, rolling out r181572.
521         https://bugs.webkit.org/show_bug.cgi?id=142755
522
523         Caused weird test failures in transitions and animations
524         (Requested by dino on #webkit).
525
526         Reverted changeset:
527
528         "Parsing and Style Resolution of Container-based Animation
529         Triggers"
530         https://bugs.webkit.org/show_bug.cgi?id=142687
531         http://trac.webkit.org/changeset/181572
532
533 2015-03-16  Yoav Weiss  <yoav@yoav.ws>
534
535         Remove setCachedImage from HTMLImageElement since it is not used
536         https://bugs.webkit.org/show_bug.cgi?id=142740
537
538         Reviewed by Chris Dumez.
539
540         No new tests since this patch is just removing dead code.
541
542         HTMLImageElement::setCachedImage is not being called by anyone.
543         This patch removes it, since it's dead code.
544
545         * html/HTMLImageElement.h:
546         (WebCore::HTMLImageElement::setCachedImage): Deleted.
547
548 2015-03-16  Brent Fulgham  <bfulgham@apple.com>
549
550         WebKit1 Clients Are Not Reliably Repainted
551         https://bugs.webkit.org/show_bug.cgi?id=142750
552         <rdar://problem/20042453>
553
554         Reviewed by Simon Fraser.
555
556         * page/FrameView.cpp:
557         (WebCore::FrameView::paintContents): Move "Red Rect" debug painting before
558         the early return so we can see when this happening in debug builds.
559         * page/FrameView.h:
560         (WebCore::FrameView::inPaintableState): Added.
561
562 2015-03-16  Chris Dumez  <cdumez@apple.com>
563
564         Make DatabaseContext suspendable if there is no pending database activity
565         https://bugs.webkit.org/show_bug.cgi?id=142716
566         <rdar://problem/19923085>
567
568         Reviewed by Andreas Kling.
569
570         Make DatabaseContext suspendable if there is no pending database
571         activity, i.e:
572         - No pending Database creation JS callback
573         - No pending transaction(s)
574
575         Suspending is safe in this case because we are not going to interrupt
576         any database activity, nor fire any JS event.
577
578         This greatly increases the likelihood of pages using websql to enter
579         the PageCache.
580
581         Tests: fast/history/page-cache-webdatabase-no-transaction-db.html
582                fast/history/page-cache-webdatabase-pending-transaction.html
583
584         * Modules/webdatabase/Database.cpp:
585         (WebCore::Database::hasPendingTransaction):
586         * Modules/webdatabase/Database.h:
587         * Modules/webdatabase/DatabaseContext.cpp:
588         (WebCore::DatabaseContext::canSuspend):
589         * Modules/webdatabase/DatabaseManager.cpp:
590         (WebCore::DatabaseManager::openDatabase):
591         * Modules/webdatabase/DatabaseThread.cpp:
592         (WebCore::DatabaseThread::hasPendingDatabaseActivity):
593         * Modules/webdatabase/DatabaseThread.h:
594
595 2015-03-16  Brady Eidson  <beidson@apple.com>
596
597         Addressing additional review feedback after http://trac.webkit.org/changeset/181565
598         https://bugs.webkit.org/show_bug.cgi?id=142733
599
600         Reviewed by Darin Adler.
601
602         * loader/icon/IconController.cpp:
603         (WebCore::IconController::startLoader): Null check page()
604
605 2015-03-16  Roger Fong  <roger_fong@apple.com>
606
607         [Win] Unreviewed build fix attempt after r181571.
608
609         * WebCore.vcxproj/WebCore.vcxproj:
610
611 2015-03-16  Roger Fong  <roger_fong@apple.com>
612
613         [WebGL2] Multiple Render Targets.
614         https://bugs.webkit.org/show_bug.cgi?id=126994.
615         <rdar://problem/15815766>
616
617         Reviewed by Dean Jackson.
618
619         Tested by a modified version of the 1.0.3 conformance test:
620         conformance/extensions/webgl-draw-buffers.html
621         This test will be landed along with other modified extension conformance tests
622         once approval from Khronos is received.
623
624         * html/canvas/WebGL2RenderingContext.cpp:
625         (WebCore::WebGL2RenderingContext::drawBuffers): Mostly the same as WebGLDrawBuffers::drawBuffersWEBGL.
626         Returns different error messages, uses non EXT enums.
627         (WebCore::WebGL2RenderingContext::clearBufferiv): This actually does nothing for now but the validation has been implemented.
628         (WebCore::WebGL2RenderingContext::clearBufferuiv): Ditto.
629         (WebCore::WebGL2RenderingContext::clearBufferfv): Ditto.
630         (WebCore::WebGL2RenderingContext::clearBufferfi): Ditto.
631         (WebCore::WebGL2RenderingContext::validateFramebufferFuncParameters): Removes the extension object check.
632         (WebCore::WebGL2RenderingContext::getMaxDrawBuffers):
633         (WebCore::WebGL2RenderingContext::getMaxColorAttachments): Must return the same thing as getMaxDrawBuffers.
634         (WebCore::WebGL2RenderingContext::getParameter): Remove extension object checks.
635         * html/canvas/WebGL2RenderingContext.h:
636         * html/canvas/WebGLFramebuffer.cpp:
637         (WebCore::WebGLFramebuffer::drawBuffersIfNecessary):
638         * html/canvas/WebGLRenderingContext.cpp:
639         (WebCore::WebGLRenderingContext::validateFramebufferFuncParameters): Copied from WebGLRenderingContextBase.
640         (WebCore::WebGLRenderingContext::getMaxDrawBuffers): Ditto.
641         (WebCore::WebGLRenderingContext::getMaxColorAttachments): Ditto.
642         * html/canvas/WebGLRenderingContext.h:
643         * html/canvas/WebGLRenderingContextBase.cpp:
644         (WebCore::WebGLRenderingContextBase::validateFramebufferFuncParameters): Deleted.
645         * html/canvas/WebGLRenderingContextBase.h:
646
647 2015-03-16  Dean Jackson  <dino@apple.com>
648
649         Parsing and Style Resolution of Container-based Animation Triggers
650         https://bugs.webkit.org/show_bug.cgi?id=142687
651         <rdar://problem/20170007>
652
653         Reviewed by Simon Fraser.
654
655         This is the beginning of a prototype implementation of
656         CSS Animation Triggers, as described by
657         https://lists.w3.org/Archives/Public/www-style/2014Sep/0135.html
658
659         In this patch we parse and resolve the value of a new
660         CSS property "-webkit-animation-trigger". At the moment it
661         only accepts one function value "container-scroll", which
662         will trigger the animation at an absolute position within
663         an element's scrolling container. We expect the syntax to
664         change in the near future, as the spec is written.
665
666         Tests: animations/trigger-computed-style.html
667                animations/trigger-parsing.html
668
669         * WebCore.xcodeproj/project.pbxproj: Add the new files.
670
671         * css/CSSAnimationTriggerScrollValue.cpp: Added.
672         (WebCore::CSSAnimationTriggerScrollValue::customCSSText): Output text for computed style.
673         (WebCore::CSSAnimationTriggerScrollValue::equals): Compare two values.
674         * css/CSSAnimationTriggerScrollValue.h: Added. This holds the CSS side of the
675         scroll trigger. This name may change in the future to better represent the
676         type of trigger, but it is good enough for now.
677         (WebCore::CSSAnimationTriggerScrollValue::create):
678         (WebCore::CSSAnimationTriggerScrollValue::startValue):
679         (WebCore::CSSAnimationTriggerScrollValue::endValue):
680         (WebCore::CSSAnimationTriggerScrollValue::CSSAnimationTriggerScrollValue):
681
682         * css/CSSComputedStyleDeclaration.cpp:
683         (WebCore::createAnimationTriggerValue): Maps an AnimationTrigger into a CSSValue.
684         (WebCore::getAnimationTriggerValue): Gets the current computed style.
685         (WebCore::ComputedStyleExtractor::propertyValue):
686
687         * css/CSSParser.cpp:
688         (WebCore::CSSParser::parseValue):
689         (WebCore::CSSParser::parseAnimationTrigger): Parse the "container-scroll" function
690         and record the value as a CSSAnimationTriggerScrollValue.
691         (WebCore::CSSParser::parseAnimationProperty): Handle the new property.
692         * css/CSSParser.h:
693
694         * css/CSSPropertyNames.in: Add "-webkit-animation-trigger".
695
696         * css/CSSToStyleMap.cpp:
697         (WebCore::CSSToStyleMap::mapAnimationTrigger): Map a CSSValue into a trigger value on
698         an Animation object.
699         * css/CSSToStyleMap.h:
700
701         * css/CSSValue.cpp: Handle the new CSSValue type.
702         (WebCore::CSSValue::equals):
703         (WebCore::CSSValue::cssText):
704         (WebCore::CSSValue::destroy):
705         * css/CSSValue.h:
706         (WebCore::CSSValue::isAnimationTriggerScrollValue):
707
708         * platform/animation/Animation.h: Add AnimationTrigger as a new field.
709         (WebCore::Animation::isTriggerSet):
710         (WebCore::Animation::isEmpty):
711
712         * platform/animation/AnimationTrigger.h: Added. New base class and subclasses for
713         "auto" and the scrolling trigger.
714         (WebCore::AnimationTrigger::~AnimationTrigger):
715         (WebCore::AnimationTrigger::type):
716         (WebCore::AnimationTrigger::isAutoAnimationTrigger):
717         (WebCore::AnimationTrigger::isScrollAnimationTrigger):
718         (WebCore::AnimationTrigger::AnimationTrigger):
719         (WebCore::AutoAnimationTrigger::create):
720         (WebCore::AutoAnimationTrigger::~AutoAnimationTrigger):
721         (WebCore::AutoAnimationTrigger::AutoAnimationTrigger):
722         (WebCore::ScrollAnimationTrigger::create):
723         (WebCore::ScrollAnimationTrigger::~ScrollAnimationTrigger):
724         (WebCore::ScrollAnimationTrigger::startValue):
725         (WebCore::ScrollAnimationTrigger::setStartValue):
726         (WebCore::ScrollAnimationTrigger::endValue):
727         (WebCore::ScrollAnimationTrigger::setEndValue):
728         (WebCore::ScrollAnimationTrigger::hasEndValue):
729         (WebCore::ScrollAnimationTrigger::setHasEndValue):
730         (WebCore::ScrollAnimationTrigger::ScrollAnimationTrigger):
731
732 2015-03-15  Roger Fong  <roger_fong@apple.com>
733
734         [WebGL2] Vertex Array Objects.
735         https://bugs.webkit.org/show_bug.cgi?id=126944.
736         <rdar://problem/15002455>
737
738         Reviewed by Dean Jackson.
739
740         Tested by a modified version of the 1.0.3 conformance test:
741         conformance/extensions/oes-vertex-array-object.html
742         This test will be landed along with other modified extension conformance tests
743         once approval from Khronos is received.
744
745         * html/canvas/OESVertexArrayObject.cpp: Associate extension calls only with WebGLRenderingContext.
746         (WebCore::OESVertexArrayObject::deleteVertexArrayOES):
747         (WebCore::OESVertexArrayObject::bindVertexArrayOES):
748         * html/canvas/WebGLRenderingContext.cpp:
749         (WebCore::WebGLRenderingContext::initializeVertexArrayObjects):
750         (WebCore::WebGLRenderingContext::getParameter):
751         * html/canvas/WebGL2RenderingContext.cpp: Implement vertex array object calls as part WebGL2 context.
752         (WebCore::WebGL2RenderingContext::createVertexArray):
753         (WebCore::WebGL2RenderingContext::deleteVertexArray):
754         (WebCore::WebGL2RenderingContext::isVertexArray):
755         (WebCore::WebGL2RenderingContext::bindVertexArray):
756         (WebCore::WebGL2RenderingContext::initializeVertexArrayObjects):
757         (WebCore::WebGL2RenderingContext::getParameter):
758
759         Duplicate extension object vertex array object extension methods in GraphicsContext3D.
760         Implementation may change after we upgrade to newer GL headers and profile.
761         * platform/graphics/GraphicsContext3D.h:
762         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
763         (WebCore::GraphicsContext3D::createVertexArray):
764         (WebCore::GraphicsContext3D::deleteVertexArray):
765         (WebCore::GraphicsContext3D::isVertexArray):
766         (WebCore::GraphicsContext3D::bindVertexArray):
767
768         Have WebGLVertexArrayObjectOES and WebGLVertexArrayObject inherit from WebGLRenderingContextBase.
769         * CMakeLists.txt:
770         * WebCore.xcodeproj/project.pbxproj:
771         * html/canvas/WebGLVertexArrayObject.cpp:
772         (WebCore::WebGLVertexArrayObject::create):
773         (WebCore::WebGLVertexArrayObject::WebGLVertexArrayObject): Use GraphicsContext3D implementation of createVertexArray.
774         (WebCore::WebGLVertexArrayObject::deleteObjectImpl):
775         * html/canvas/WebGLVertexArrayObject.h:
776         * html/canvas/WebGLVertexArrayObjectBase.cpp: Added.
777         (WebCore::WebGLVertexArrayObjectBase::WebGLVertexArrayObjectBase):
778         (WebCore::WebGLVertexArrayObjectBase::setElementArrayBuffer):
779         (WebCore::WebGLVertexArrayObjectBase::setVertexAttribState):
780         (WebCore::WebGLVertexArrayObjectBase::unbindBuffer):
781         (WebCore::WebGLVertexArrayObjectBase::setVertexAttribDivisor):
782         * html/canvas/WebGLVertexArrayObjectBase.h: Added.
783         (WebCore::WebGLVertexArrayObjectBase::~WebGLVertexArrayObjectBase):
784         (WebCore::WebGLVertexArrayObjectBase::VertexAttribState::VertexAttribState):
785         (WebCore::WebGLVertexArrayObjectBase::VertexAttribState::isBound):
786         (WebCore::WebGLVertexArrayObjectBase::VertexAttribState::validateBinding):
787         (WebCore::WebGLVertexArrayObjectBase::isDefaultObject):
788         (WebCore::WebGLVertexArrayObjectBase::hasEverBeenBound):
789         (WebCore::WebGLVertexArrayObjectBase::setHasEverBeenBound):
790         (WebCore::WebGLVertexArrayObjectBase::getElementArrayBuffer):
791         (WebCore::WebGLVertexArrayObjectBase::getVertexAttribState):
792         * html/canvas/WebGLVertexArrayObjectOES.cpp:
793         (WebCore::WebGLVertexArrayObjectOES::WebGLVertexArrayObjectOES):
794         (WebCore::WebGLVertexArrayObjectOES::deleteObjectImpl):
795         (WebCore::WebGLVertexArrayObjectOES::setElementArrayBuffer): Deleted.
796         (WebCore::WebGLVertexArrayObjectOES::setVertexAttribState): Deleted.
797         (WebCore::WebGLVertexArrayObjectOES::unbindBuffer): Deleted.
798         (WebCore::WebGLVertexArrayObjectOES::setVertexAttribDivisor): Deleted.
799         * html/canvas/WebGLVertexArrayObjectOES.h:
800
801         * html/canvas/WebGLRenderingContextBase.cpp: Use WebGLVertexArrayObjectBase class.
802         (WebCore::WebGLRenderingContextBase::initializeNewContext):
803         (WebCore::WebGLRenderingContextBase::disableVertexAttribArray):
804         (WebCore::WebGLRenderingContextBase::validateVertexAttributes):
805         (WebCore::WebGLRenderingContextBase::enableVertexAttribArray):
806         (WebCore::WebGLRenderingContextBase::getVertexAttrib):
807         (WebCore::WebGLRenderingContextBase::initVertexAttrib0):
808         (WebCore::WebGLRenderingContextBase::simulateVertexAttrib0):
809         (WebCore::WebGLRenderingContextBase::restoreStatesAfterVertexAttrib0Simulation):
810         * html/canvas/WebGLRenderingContextBase.h:
811         (WebCore::WebGLRenderingContextBase::setBoundVertexArrayObject):
812
813         Handle construction of WebGLGetInfo using WebGLVertexArrayObject.
814         * bindings/js/JSWebGLRenderingContextBaseCustom.cpp:
815         (WebCore::toJS):
816         * html/canvas/WebGLGetInfo.cpp:
817         (WebCore::WebGLGetInfo::WebGLGetInfo):
818         (WebCore::WebGLGetInfo::getWebGLVertexArrayObjectOES):
819         (WebCore::WebGLGetInfo::getWebGLVertexArrayObject):
820         * html/canvas/WebGLGetInfo.h:
821
822 2015-03-16  Brent Fulgham  <bfulgham@apple.com>
823
824         Potentially uninitialized Inspector values
825         https://bugs.webkit.org/show_bug.cgi?id=142730
826
827         Reviewed by Joseph Pecoraro.
828
829         * inspector/InspectorDOMAgent.cpp:
830         (WebCore::parseColor): Make sure color values are given an initial value.
831
832 2015-03-16  Brady Eidson  <beidson@apple.com>
833
834         URLs visited during private browsing show up in WebpageIcons.db
835         rdar://problem/11254910 and https://bugs.webkit.org/show_bug.cgi?id=142733
836
837         Patch by Sam Weinig. Reviewed by Brady Eidson.
838
839         * loader/icon/IconController.cpp:
840         (WebCore::IconController::startLoader): Bail early here if the page is using an ephemeral session.
841         (WebCore::IconController::continueLoadWithDecision): Instead of here.
842
843 2015-03-16  Conrad Shultz  <conrad_shultz@apple.com>
844
845         Allow clients to selectively disable plug-ins
846         https://bugs.webkit.org/show_bug.cgi?id=142506
847
848         Reviewed by Anders Carlsson.
849
850         Add new functionality allow clients to declaratively disable individual plug-ins (in a manner that conceals them
851         from the page). As part of this:
852
853         1) Introduce the concept of web-visible plug-ins and related concepts, as distinct from the real underlying
854            set of plug-ins.
855
856         2) Where applicable, plumb additional information about plug-ins (specifically, bundle identification) deeper
857            down the stack.
858
859         3) Add generic functionality to PluginStrategy to support filtering plug-ins for visibility and introduce
860            a concrete implementation thereof in WebPlatformStrategies in WebKit2.
861
862         4) Add messaging infrastructure to allow clients to set and clear plug-in policies.
863
864         While currently only used in a very limited manner, the new declarative plug-in policies are written generically
865         so that they could be easily used in the future to reduce synchronous messaging to the client when loading plug-ins.
866
867         * dom/DOMImplementation.cpp:
868         (WebCore::DOMImplementation::createDocument):
869         Update to reflect function rename.
870
871         * loader/SubframeLoader.cpp:
872         (WebCore::findPluginMIMETypeFromURL):
873         Adopt getWebVisibleMimesAndPluginIndices().
874         (WebCore::logPluginRequest):
875         Update to reflect function rename.
876         (WebCore::SubframeLoader::shouldUsePlugin):
877         Ditto.
878
879         * platform/PlatformStrategies.h:
880         Export platformStrategies(), since it is now used in WebProcess.cpp.
881
882         * plugins/DOMMimeType.cpp:
883         (WebCore::DOMMimeType::type):
884         (WebCore::DOMMimeType::description):
885         (WebCore::DOMMimeType::mimeClassInfo):
886         Adopt getWebVisibleMimesAndPluginIndices().
887         (WebCore::DOMMimeType::enabledPlugin):
888         Ditto.
889
890         * plugins/DOMMimeType.h:
891         Don't return references in a few places where it is no longer safe to do so.
892         (WebCore::DOMMimeType::mimeClassInfo): Deleted.
893
894         * plugins/DOMMimeTypeArray.cpp:
895         (WebCore::DOMMimeTypeArray::length):
896         Adopt getWebVisibleMimesAndPluginIndices().
897         (WebCore::DOMMimeTypeArray::item):
898         Ditto.
899         (WebCore::DOMMimeTypeArray::canGetItemsForName):
900         Ditto.
901         (WebCore::DOMMimeTypeArray::namedItem):
902         Ditto.
903
904         * plugins/DOMPlugin.cpp:
905         (WebCore::DOMPlugin::pluginInfo):
906         Adopt getWebVisiblePlugins().
907         (WebCore::DOMPlugin::item):
908         Adopt getWebVisibleMimesAndPluginIndices().
909         (WebCore::DOMPlugin::canGetItemsForName):
910         Ditto.
911         (WebCore::DOMPlugin::namedItem):
912         Ditto.
913
914         * plugins/DOMPlugin.h:
915         (WebCore::DOMPlugin::pluginInfo): Deleted.
916
917         * plugins/DOMPluginArray.cpp:
918         (WebCore::DOMPluginArray::length):
919         Adopt getWebVisiblePlugins().
920         (WebCore::DOMPluginArray::item):
921         Ditto.
922         (WebCore::DOMPluginArray::canGetItemsForName):
923         Ditto.
924         (WebCore::DOMPluginArray::namedItem):
925         Ditto.
926
927         * plugins/PluginData.cpp:
928         (WebCore::PluginData::PluginData):
929         Stash the passed-in Page and call initPlugins().
930         (WebCore::PluginData::getWebVisiblePlugins):
931         New member function; call through to PluginStrategy::getWebVisiblePluginInfo().
932         (WebCore::PluginData::getWebVisibleMimesAndPluginIndices):
933         New member function; build up the mimes and mimePluginIndices vectors in the same manner as before, but
934         limited to the web-visible plug-ins.
935         (WebCore::PluginData::supportsWebVisibleMimeType):
936         Renamed from supportsMimeType(); update to work in terms of web-visible plug-ins.
937         (WebCore::PluginData::pluginInfoForWebVisibleMimeType):
938         Renamed from pluginInfoForMimeType(); ditto.
939         (WebCore::PluginData::pluginNameForWebVisibleMimeType):
940         Renamed from pluginNameForMimeType(); ditto.
941         (WebCore::PluginData::pluginFileForWebVisibleMimeType):
942         Renamed from pluginFileForMimeType(); ditto.
943         (WebCore::PluginData::initPlugins):
944         (WebCore::PluginData::supportsMimeType): Deleted.
945         (WebCore::PluginData::pluginInfoForMimeType): Deleted.
946         (WebCore::PluginData::pluginNameForMimeType): Deleted.
947         (WebCore::PluginData::pluginFileForMimeType): Deleted.
948
949         * plugins/PluginData.h:
950         Add a member variable for the associate Page; declare the PluginLoadClientPolicy enumeration; add
951         new members to PluginInfo for the clientLoadPolicy and bundle information.
952         (WebCore::PluginData::PluginData):
953         Replace some member functions with new ones that will hide plug-ins upon request from the client;
954         (WebCore::PluginData::mimes): Deleted.
955         (WebCore::PluginData::mimePluginIndices): Deleted.
956
957         * plugins/PluginStrategy.h:
958         Declare new member functions for retrieving web-visible plug-ins and setting/clearing plug-in policies.
959
960         * replay/SerializationMethods.cpp:
961         (JSC::EncodingTraits<PluginData>::encodeValue):
962         Remove now-obsolete code for handling MIME types and add a FIXME.
963         (JSC::DeserializedPluginData::DeserializedPluginData):
964         (JSC::EncodingTraits<PluginData>::decodeValue):
965         Ditto.
966         (JSC::EncodingTraits<PluginInfo>::encodeValue):
967         Handle the new members in PluginInfo.
968         (JSC::EncodingTraits<PluginInfo>::decodeValue):
969         Ditto.
970
971         * replay/WebInputs.json:
972         Teach Replay about PluginLoadClientPolicy.
973
974 2015-03-16  Max Stepin  <maxstepin@gmail.com>
975
976         Add APNG support
977         https://bugs.webkit.org/show_bug.cgi?id=17022
978
979         Reviewed by Carlos Garcia Campos.
980
981         Test: fast/images/animated-png.html
982
983         * platform/image-decoders/ImageDecoder.h:
984         (WebCore::ImageFrame::divide255):
985         (WebCore::ImageFrame::overRGBA):
986         * platform/image-decoders/png/PNGImageDecoder.cpp:
987         (WebCore::frameHeader):
988         (WebCore::readChunks):
989         (WebCore::PNGImageReader::PNGImageReader):
990         (WebCore::PNGImageDecoder::PNGImageDecoder):
991         (WebCore::PNGImageDecoder::frameBufferAtIndex):
992         (WebCore::PNGImageDecoder::headerAvailable):
993         (WebCore::PNGImageDecoder::rowAvailable):
994         (WebCore::PNGImageDecoder::pngComplete):
995         (WebCore::PNGImageDecoder::readChunks):
996         (WebCore::PNGImageDecoder::frameHeader):
997         (WebCore::PNGImageDecoder::init):
998         (WebCore::PNGImageDecoder::clearFrameBufferCache):
999         (WebCore::PNGImageDecoder::initFrameBuffer):
1000         (WebCore::PNGImageDecoder::frameComplete):
1001         (WebCore::PNGImageDecoder::processingStart):
1002         (WebCore::PNGImageDecoder::processingFinish):
1003         (WebCore::PNGImageDecoder::fallbackNotAnimated):
1004         * platform/image-decoders/png/PNGImageDecoder.h:
1005         (WebCore::PNGImageDecoder::frameCount):
1006         (WebCore::PNGImageDecoder::repetitionCount):
1007         (WebCore::PNGImageDecoder::isComplete):
1008
1009 2015-03-15  Benjamin Poulain  <benjamin@webkit.org>
1010
1011         CSS: fix the case-insensitive matching of the attribute selectors Begin, End and Hyphen
1012         https://bugs.webkit.org/show_bug.cgi?id=142715
1013
1014         Reviewed by Brent Fulgham.
1015
1016         Fix attribute matching with:
1017         -Begin: [a^=b].
1018         -End: [a$=b].
1019         -Hyphen: [a|=b].
1020
1021         Tests: fast/selectors/attribute-endswith-value-matching-is-ascii-case-insensitive.html
1022                fast/selectors/attribute-hyphen-value-matching-is-ascii-case-insensitive.html
1023                fast/selectors/attribute-startswith-value-matching-is-ascii-case-insensitive.html
1024
1025         * css/SelectorChecker.cpp:
1026         (WebCore::attributeValueMatches):
1027         I forgot to change CSSSelector::Exact in my last patch.
1028         The tests could not catch that since we use the CSS JIT almost everywhere.
1029
1030         * cssjit/SelectorCompiler.cpp:
1031         (WebCore::SelectorCompiler::attributeValueBeginsWith):
1032         (WebCore::SelectorCompiler::attributeValueEndsWith):
1033         (WebCore::SelectorCompiler::attributeValueMatchHyphenRule):
1034
1035 2015-03-15  Dan Bernstein  <mitz@apple.com>
1036
1037         Fixed the iOS build after r181522.
1038
1039         * page/FrameView.cpp:
1040         (WebCore::FrameView::performPostLayoutTasks):
1041
1042 2015-03-15  Andy Estes  <aestes@apple.com>
1043
1044         [Content Filtering] Adopt new NEFilterSource SPI
1045         https://bugs.webkit.org/show_bug.cgi?id=142710
1046         rdar://problem/19023855
1047
1048         Reviewed by Dan Bernstein.
1049
1050         Teach NetworkExtensionContentFilter to use a new, alternate NEFilterSource SPI on platforms where it is available.
1051
1052         * platform/ContentFilter.cpp:
1053         (WebCore::ContentFilter::types): Renamed HAVE(NE_FILTER_SOURCE) to HAVE(NETWORK_EXTENSION).
1054         * platform/cocoa/NetworkExtensionContentFilter.h: Renamed member variables to remove redundancy, forward-declared NEFilterSourceStatus,
1055         added a dispatch_semaphore member variable to avoid creating and destroying multiple semaphores, and made m_originalData a SharedBuffer.
1056         * platform/cocoa/NetworkExtensionContentFilter.mm:
1057         (decisionInfoReplacementData): Returned the replacement data from a decision handler info dictionary.
1058         (WebCore::createNEFilterSource): Created either an old-style or new-style NEFilterSource object.
1059         (WebCore::NetworkExtensionContentFilter::NetworkExtensionContentFilter): Called receivedResponse:decisionHandler: when using the new SPI.
1060         (WebCore::NetworkExtensionContentFilter::~NetworkExtensionContentFilter): Released the dispatch_semaphore.
1061         (WebCore::NetworkExtensionContentFilter::addData): Appended the copied NSData to m_originalData, avoiding an additional copy previously
1062         being made by NSMutableData. Used the new receivedData:decisionHandler: SPI when appropriate.
1063         (WebCore::NetworkExtensionContentFilter::finishedAddingData): Used the new finishedLoadingWithDecisionHandler: SPI when appropriate.
1064         (WebCore::NetworkExtensionContentFilter::needsMoreData): Changed m_neFilterSourceStatus to m_status.
1065         (WebCore::NetworkExtensionContentFilter::didBlockData): Ditto.
1066         (WebCore::NetworkExtensionContentFilter::getReplacementData): Returned the replacement data from NEFilterSource if the load was blocked.
1067         Otherwise, returned the original data.
1068         (WebCore::NetworkExtensionContentFilter::handleDecision): Added a helper to set m_status and m_replacementData, and to signal m_semaphore.
1069         * platform/spi/cocoa/NEFilterSourceSPI.h: Declared the new NEFilterSource SPI on platforms that support it.
1070
1071 2015-03-15  Brent Fulgham  <bfulgham@apple.com>
1072
1073         Scroll snap points are not supported on iframe content
1074         https://bugs.webkit.org/show_bug.cgi?id=142582
1075         <rdar://problem/20121319>
1076
1077         Tested by css3/scroll-snap/scroll-snap-iframe.html
1078
1079         Reviewed by Simon Fraser.
1080
1081         The scroll snap points were not being applied to the iframe contents because the code
1082         that sets up the scroll snap point content is not called for iframes.
1083
1084         To correct this, we need to make sure the snap offsets are set during post-frame layout
1085         for iframes. We also need to make sure (on Mac) that the scroll animator and timers are updated.
1086
1087         * page/FrameView.cpp:
1088         (WebCore::FrameView::performPostLayoutTasks): Call 'updateSnapOffsets' if the frame is not a
1089         MainFrame. Also notify scroll animators they need to update their snap point settings.
1090
1091 2015-03-15  Simon Fraser  <simon.fraser@apple.com>
1092
1093         Add the same is<RenderBox> test to KeyframeAnimation::computeExtentOfTransformAnimation()
1094         that ImplicitAnimation::computeExtentOfTransformAnimation() has, and change the latter
1095         to the more canonical is<RenderBox>() form.
1096         
1097         Fixes an assertion in animations/animation-on-inline-crash.html
1098
1099         * page/animation/ImplicitAnimation.cpp:
1100         (WebCore::ImplicitAnimation::computeExtentOfTransformAnimation):
1101         * page/animation/KeyframeAnimation.cpp:
1102         (WebCore::KeyframeAnimation::computeExtentOfTransformAnimation):
1103
1104 2015-03-15  Simon Fraser  <simon.fraser@apple.com>
1105
1106         And another fix. Thanks to Hunseop Jeong for the fix.
1107
1108         * html/HTMLInputElement.cpp:
1109         (WebCore::HTMLInputElement::runPostTypeUpdateTasks):
1110         (WebCore::HTMLInputElement::didMoveToNewDocument):
1111
1112 2015-03-15  Simon Fraser  <simon.fraser@apple.com>
1113
1114         Fix the touch-event build.
1115
1116         * dom/Document.cpp:
1117         (WebCore::Document::didAddTouchEventHandler):
1118         (WebCore::Document::didRemoveTouchEventHandler):
1119
1120 2015-03-15  Simon Fraser  <simon.fraser@apple.com>
1121
1122         Reduce the side-effects of animations turning off overlap testing
1123         https://bugs.webkit.org/show_bug.cgi?id=92791
1124
1125         Reviewed by Dean Jackson.
1126         
1127         When a layer is running a transition or animation of the transform property,
1128         we would simply disable overlap testing for later layers, which had the side-effect
1129         of promoting lots of unrelated elements into layers temporarily.
1130         
1131         Fix by maintaining overlap, but computing an overlap extent that takes the animation
1132         into account.
1133         
1134         Rotations are currently treated as full rotations. If an extent for the overlap is
1135         hard to compute (e.g. 3d transforms, or matrix animations with a rotation component),
1136         then we fall back to the current behavior.
1137
1138         Tests: compositing/layer-creation/mismatched-rotated-transform-animation-overlap.html
1139                compositing/layer-creation/mismatched-rotated-transform-transition-overlap.html
1140                compositing/layer-creation/mismatched-transform-transition-overlap.html
1141                compositing/layer-creation/multiple-keyframes-animation-overlap.html
1142                compositing/layer-creation/scale-rotation-animation-overlap.html
1143                compositing/layer-creation/scale-rotation-transition-overlap.html
1144                compositing/layer-creation/translate-animation-overlap.html
1145                compositing/layer-creation/translate-scale-animation-overlap.html
1146                compositing/layer-creation/translate-scale-transition-overlap.html
1147                compositing/layer-creation/translate-transition-overlap.html
1148
1149         * page/animation/AnimationBase.cpp:
1150         (WebCore::containsRotation):
1151         (WebCore::AnimationBase::computeTransformedExtentViaTransformList): When we have matched
1152         transform lists, we can map a rectangle through the various operations. Transform-origin
1153         is used to shift the origin of the box first, and then unshift after. If we encounter
1154         a rotation, for now assume it's a full rotation (a future patch could tighten this up).
1155         (WebCore::AnimationBase::computeTransformedExtentViaMatrix): If we're using matrix
1156         interpolation, we have to decompose the matrix to see if there's any rotation component,
1157         and, if there is, fall back to current behavior.
1158         * page/animation/AnimationBase.h:
1159         * page/animation/AnimationController.cpp:
1160         (WebCore::AnimationControllerPrivate::computeExtentOfAnimation):
1161         (WebCore::AnimationController::computeExtentOfAnimation):
1162         * page/animation/AnimationController.h:
1163         * page/animation/AnimationControllerPrivate.h:
1164         * page/animation/CompositeAnimation.cpp:
1165         (WebCore::CompositeAnimation::computeExtentOfTransformAnimation): Ask active keyframe
1166         animations and transitions to compute the bounds extent.
1167         * page/animation/CompositeAnimation.h:
1168         * page/animation/ImplicitAnimation.cpp:
1169         (WebCore::ImplicitAnimation::computeExtentOfTransformAnimation): Compute the extent
1170         of the start and end transforms, and union them.
1171         * page/animation/ImplicitAnimation.h:
1172         * page/animation/KeyframeAnimation.cpp:
1173         (WebCore::KeyframeAnimation::animate):
1174         (WebCore::KeyframeAnimation::getAnimatedStyle): Some nullptr goodness.
1175         (WebCore::KeyframeAnimation::computeExtentOfTransformAnimation): Compute an extent
1176         for each keyframe, and take their union.
1177         * page/animation/KeyframeAnimation.h:
1178         * platform/graphics/GeometryUtilities.cpp:
1179         (WebCore::euclidianDistance): Use Pythagoras to compute a distance.
1180         (WebCore::boundsOfRotatingRect): Given a rect whose location is relative
1181         to the rotation origin, compute a bounds for the rotated rect by computing
1182         the furthest corner from the origin, and sweeping out a circle.
1183         * platform/graphics/GeometryUtilities.h:
1184         * platform/graphics/transforms/Matrix3DTransformOperation.h:
1185         * platform/graphics/transforms/MatrixTransformOperation.h:
1186         * platform/graphics/transforms/PerspectiveTransformOperation.h:
1187         * platform/graphics/transforms/RotateTransformOperation.h:
1188         * platform/graphics/transforms/ScaleTransformOperation.h:
1189         * platform/graphics/transforms/SkewTransformOperation.h:
1190         * platform/graphics/transforms/TransformOperation.h:
1191         (WebCore::TransformOperation::isAffectedByTransformOrigin):
1192         * platform/graphics/transforms/TransformOperations.cpp:
1193         (WebCore::TransformOperations::affectedByTransformOrigin): Ask all the operations if
1194         they are affected by transform-origin.
1195         (WebCore::TransformOperations::blendByMatchingOperations): nullptr.
1196         * platform/graphics/transforms/TransformOperations.h:
1197         * rendering/RenderBox.cpp:
1198         (WebCore::RenderBox::pushMappingToContainer): Comment fix. Only take transforms into account
1199         if the geometry map says so (which is most of the time).
1200         * rendering/RenderGeometryMap.cpp:
1201         (WebCore::RenderGeometryMap::mapToContainer): RenderLayerCompositor is now using the
1202         geometry map in a way that is incompatible with this assertion; it deliberately ignores
1203         transforms sometimes, so we can't easily verify that the mapping matches mapping through
1204         renderers.
1205         (WebCore::RenderGeometryMap::pushMappingsToAncestor): Save and restore the UseTransforms
1206         bit.
1207         * rendering/RenderGeometryMap.h:
1208         * rendering/RenderLayer.cpp:
1209         (WebCore::RenderLayer::boundingBox): Whitespace.
1210         (WebCore::RenderLayer::getOverlapBoundsIncludingChildrenAccountingForTransformAnimations): Helper
1211         function to get the bounds of a layer, including descendants, when a transform animation is running.
1212         * rendering/RenderLayer.h:
1213         * rendering/RenderLayerCompositor.cpp:
1214         (WebCore::RenderLayerCompositor::CompositingState::CompositingState): Add a ancestorHasTransformAnimation
1215         flag to detect nested animated transforms.
1216         (WebCore::RenderLayerCompositor::OverlapExtent::knownToBeHaveExtentUncertainty): This returns true when
1217         the layer is animating transform, and the transition/animation is such that we can't easily compute the
1218         bounds of the animation.
1219         (WebCore::RenderLayerCompositor::computeExtent): const RenderLayer&.
1220         Compute the animated bounds if there's a transform animation running.
1221         (WebCore::RenderLayerCompositor::addToOverlapMap): const RenderLayer&
1222         (WebCore::RenderLayerCompositor::addToOverlapMapRecursive): const RenderLayer&
1223         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
1224         Delay the call to pushMappingsToAncestor() until knowing if there's a transform animation running, and
1225         if there is, push the mapping while ignoring transforms (since the transform is implicitly taken into account
1226         for overlap via the computed animated bounds).
1227         If this layer is running a transform animation, set the childState.ancestorHasTransformAnimation flag so
1228         that descendants will know (nested transform animations fall back to current behavior).
1229         The if (.... && isRunningAcceleratedTransformAnimation()) is what previously caused us to turn off overlap
1230         testing in the face of animations. That now only happens if we were unable to easily compute the animation bounds.
1231         (WebCore::RenderLayerCompositor::isRunningTransformAnimation): This previously tested whether an accelerated animation
1232         was running, but that's timing sensitive; AnimationController can start the transform animation, but it's not yet
1233         considered accelerated until we get an async callback from GraphicsLayer, yet this code needed to know if the
1234         animation was running.
1235         Since transform animations are always accelerated, we can just test for a running transform animation.
1236         (WebCore::RenderLayerCompositor::isRunningAcceleratedTransformAnimation): Deleted.
1237         * rendering/RenderLayerCompositor.h:
1238         * rendering/style/RenderStyle.cpp:
1239         (WebCore::requireTransformOrigin): Some FIXME comments.
1240
1241 2015-03-15  Simon Fraser  <simon.fraser@apple.com>
1242
1243         Clean up related to wheelEvent names
1244         https://bugs.webkit.org/show_bug.cgi?id=142713
1245
1246         Reviewed by Anders Carlsson.
1247
1248         Add EventNames::isWheelEventType() and use it in places that test for the
1249         two wheel event names.
1250
1251         * dom/Document.cpp:
1252         (WebCore::Document::didAddWheelEventHandler):
1253         (WebCore::Document::didRemoveWheelEventHandler):
1254         * dom/Document.h: No need for exports (I grepped). Pass the Node*, which
1255         will be used in a later patch.
1256         * dom/EventNames.h:
1257         (WebCore::EventNames::isWheelEventType):
1258         * dom/Node.cpp:
1259         (WebCore::Node::didMoveToNewDocument):
1260         (WebCore::tryAddEventListener):
1261         (WebCore::tryRemoveEventListener):
1262         (WebCore::Node::defaultEventHandler):
1263         * html/shadow/MediaControlsApple.cpp:
1264         (WebCore::MediaControlsAppleEventListener::handleEvent):
1265         * page/DOMWindow.cpp:
1266         (WebCore::DOMWindow::addEventListener):
1267         (WebCore::DOMWindow::removeEventListener):
1268         * page/ios/FrameIOS.mm:
1269         (WebCore::ancestorRespondingToScrollWheelEvents): Remove dead code.
1270
1271 2015-03-15  Simon Fraser  <simon.fraser@apple.com>
1272
1273         Remove a redundant repaint when a layer becomes composited
1274         https://bugs.webkit.org/show_bug.cgi?id=142711
1275
1276         Reviewed by Anders Carlsson.
1277
1278         RenderLayerCompositor::computeCompositingRequirements() doesn't need to call
1279         repaintOnCompositingChange() when a layer is going to become composited,
1280         because updateBacking() does exactly the same thing. I used an assertion
1281         and ran the tests to ensure this wasn't a behavior change.
1282
1283         * rendering/RenderLayerCompositor.cpp:
1284         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
1285
1286 2015-03-15  Benjamin Poulain  <bpoulain@apple.com>
1287
1288         Change the exact attribute matching to be ASCII case-insensitive
1289         https://bugs.webkit.org/show_bug.cgi?id=142609
1290
1291         Reviewed by Darin Adler.
1292
1293         In CSS, testing attribute values should be ASCII case-insensitive,
1294         previously we were using full unicode case conversion.
1295
1296         Test: fast/selectors/attribute-exact-value-match-is-ascii-case-insensitive.html
1297
1298         * css/CSSParser.cpp:
1299         (WebCore::CSSParser::parseKeyframeSelector):
1300         The CSS parser has its own fast version for ASCII case insensitive.
1301         This code was using the general equalIgnoringASCIICase() which was causing name conflicts,
1302         change that to the normal CSS parser version.
1303
1304         * css/SelectorCheckerTestFunctions.h:
1305         (WebCore::equalIgnoringASCIICase): Deleted.
1306         * cssjit/SelectorCompiler.cpp:
1307         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeValueExactMatching):
1308
1309 2015-03-15  Brent Fulgham  <bfulgham@apple.com>
1310
1311         scroll snap points do not properly account for zoomed pages
1312         https://bugs.webkit.org/show_bug.cgi?id=142706
1313         <rdar://problem/20165771>
1314
1315         Reviewed by Anders Carlsson.
1316
1317         When a WebView is zoomed (such that it has a non-unity pageScaleFactor), we need to account for this
1318         scaling value when selecting our correct scroll snap point target, as well as when specifying the
1319         pixel location for our animation to target.
1320
1321         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
1322         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
1323         (WebCore::ScrollingTreeFrameScrollingNodeMac::pageScaleFactor): Added new delegate method.
1324         * platform/cocoa/ScrollController.h:
1325         (WebCore::ScrollControllerClient::pageScaleFactor): Added new default delegate.
1326         * platform/cocoa/ScrollController.mm:
1327         (WebCore::ScrollController::beginScrollSnapAnimation): Calculate the correct scroll target
1328         based on the page scale factor.
1329
1330 2015-03-15  Csaba Osztrogonác  <ossy@webkit.org>
1331
1332         Fix run-bindings-tests on the WinCairo bot
1333         https://bugs.webkit.org/show_bug.cgi?id=142588
1334
1335         Reviewed by Alex Christensen.
1336
1337         * bindings/scripts/test/JS/JSFloat64Array.cpp: Added property svn:eol-style.
1338         * bindings/scripts/test/JS/JSFloat64Array.h: Added property svn:eol-style.
1339         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp: Added property svn:eol-style.
1340         * bindings/scripts/test/JS/JSTestActiveDOMObject.h: Modified property svn:eol-style.
1341         * bindings/scripts/test/JS/JSTestCallback.cpp: Modified property svn:eol-style.
1342         * bindings/scripts/test/JS/JSTestCallback.h: Modified property svn:eol-style.
1343         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp: Added property svn:eol-style.
1344         * bindings/scripts/test/JS/JSTestCustomNamedGetter.h: Modified property svn:eol-style.
1345         * bindings/scripts/test/JS/JSTestEventConstructor.cpp: Added property svn:eol-style.
1346         * bindings/scripts/test/JS/JSTestEventConstructor.h: Added property svn:eol-style.
1347         * bindings/scripts/test/JS/JSTestEventTarget.cpp: Added property svn:eol-style.
1348         * bindings/scripts/test/JS/JSTestEventTarget.h: Modified property svn:eol-style.
1349         * bindings/scripts/test/JS/JSTestException.cpp: Added property svn:eol-style.
1350         * bindings/scripts/test/JS/JSTestException.h: Added property svn:eol-style.
1351         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp: Added property svn:eol-style.
1352         * bindings/scripts/test/JS/JSTestGenerateIsReachable.h: Added property svn:eol-style.
1353         * bindings/scripts/test/JS/JSTestImplements.cpp: Added property svn:eol-style.
1354         * bindings/scripts/test/JS/JSTestImplements.h: Added property svn:eol-style.
1355         * bindings/scripts/test/JS/JSTestInterface.cpp: Modified property svn:eol-style.
1356         * bindings/scripts/test/JS/JSTestInterface.h: Modified property svn:eol-style.
1357         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp: Modified property svn:eol-style.
1358         * bindings/scripts/test/JS/JSTestMediaQueryListListener.h: Modified property svn:eol-style.
1359         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp: Added property svn:eol-style.
1360         * bindings/scripts/test/JS/JSTestNamedConstructor.h: Added property svn:eol-style.
1361         * bindings/scripts/test/JS/JSTestNondeterministic.cpp: Added property svn:eol-style.
1362         * bindings/scripts/test/JS/JSTestNondeterministic.h: Added property svn:eol-style.
1363         * bindings/scripts/test/JS/JSTestObj.cpp: Modified property svn:eol-style.
1364         * bindings/scripts/test/JS/JSTestObj.h: Modified property svn:eol-style.
1365         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp: Added property svn:eol-style.
1366         * bindings/scripts/test/JS/JSTestOverloadedConstructors.h: Added property svn:eol-style.
1367         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp: Modified property svn:eol-style.
1368         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h: Modified property svn:eol-style.
1369         * bindings/scripts/test/JS/JSTestSupplemental.cpp: Added property svn:eol-style.
1370         * bindings/scripts/test/JS/JSTestSupplemental.h: Added property svn:eol-style.
1371         * bindings/scripts/test/JS/JSTestTypedefs.cpp: Added property svn:eol-style.
1372         * bindings/scripts/test/JS/JSTestTypedefs.h: Added property svn:eol-style.
1373         * bindings/scripts/test/JS/JSattribute.cpp: Added property svn:eol-style.
1374         * bindings/scripts/test/JS/JSattribute.h: Added property svn:eol-style.
1375         * bindings/scripts/test/JS/JSreadonly.cpp: Added property svn:eol-style.
1376         * bindings/scripts/test/JS/JSreadonly.h: Added property svn:eol-style.
1377
1378 2015-03-14  Darin Adler  <darin@apple.com>
1379
1380         More event handler improvements
1381         https://bugs.webkit.org/show_bug.cgi?id=142701
1382
1383         Reviewed by Anders Carlsson.
1384
1385         These are the improvements:
1386
1387         - Use EventHandler rather than EventListener as the the type for event handler
1388           attributes. This matches the HTML specification, and also makes sense, since
1389           EventListener means something else (and we use it to mean that!). Also renamed
1390           JSWindowEventListener to WindowEventHandler. Even though this only affects the
1391           JavaScript code generated, it's not really a JavaScript-specific flag.
1392
1393         - Tweak formatting on addEventListener/removeEventListener/dispatchEvent in
1394           all the IDL files where the appear. This includes changing the spelling from
1395           "evt" to "event". Some day we should fix this so these functions only need to
1396           appear in EventTarget.idl.
1397
1398         - Tweak formatting a bit on the IDL files we had to modify anyway.
1399
1400         - Use [Conditional] more often and #if less often in IDL files.
1401
1402         - Added a new [DocumentEventHandler] attribute for the selectionchange event.
1403           This involved adding new event handler attribute functions to JSEventListener.h
1404           for use by the JavaScript bindings.
1405
1406         - Removed a little unused code from the JavaScript code bindings generator.
1407
1408         - Improved the mechanism used by HTMLElement and SVGElement to share the list of
1409           content attributes that are event handlers so there is only one map rather than
1410           two. Made a similar mechanism so that HTMLBodyElement and HTMLFrameSetElement
1411           can share the list of window event handlers.
1412
1413         - Followed the HTML specification by putting all the event handler support in
1414           the HTMLElement class rather than having event handlers apply only a the
1415           particular element that uses those events. We already did this for most of
1416           our event handlers, but we are now doing it for all of them.
1417
1418         * Modules/battery/BatteryManager.idl: Use EventHandler instead of EventListener
1419         as appropriate. Also reformatted addEventListener/removeEventListener/dispatchEvent.
1420         * Modules/encryptedmedia/MediaKeySession.idl: Ditto.
1421         * Modules/indexeddb/IDBDatabase.idl: Ditto.
1422         * Modules/indexeddb/IDBOpenDBRequest.idl: Ditto.
1423         * Modules/indexeddb/IDBRequest.idl: Ditto.
1424         * Modules/indexeddb/IDBTransaction.idl: Ditto.
1425         * Modules/mediastream/MediaStream.idl: Ditto.
1426         * Modules/mediastream/MediaStreamTrack.idl: Ditto.
1427         * Modules/mediastream/RTCDTMFSender.idl: Ditto.
1428         * Modules/mediastream/RTCDataChannel.idl: Ditto.
1429         * Modules/mediastream/RTCPeerConnection.idl: Ditto.
1430         * Modules/speech/SpeechSynthesisUtterance.idl: Ditto.
1431         * Modules/webaudio/AudioBufferSourceNode.idl: Ditto.
1432         * Modules/webaudio/AudioContext.idl: Ditto.
1433         * Modules/webaudio/OscillatorNode.idl: Ditto.
1434         * Modules/webaudio/ScriptProcessorNode.idl: Ditto.
1435         * Modules/websockets/WebSocket.idl: Ditto.
1436         * css/FontLoader.idl: Ditto.
1437         * dom/EventListener.idl: Ditto.
1438         * dom/EventTarget.idl: Ditto.
1439         * dom/MessagePort.idl: Ditto.
1440         * dom/Node.idl: Ditto.
1441         * dom/WebKitNamedFlow.idl: Ditto.
1442         * fileapi/FileReader.idl: Ditto.
1443         * html/MediaController.idl: Ditto.
1444         * html/track/AudioTrackList.idl: Ditto.
1445         * html/track/TextTrackCue.idl: Ditto.
1446         * html/track/TextTrackList.idl: Ditto.
1447         * html/track/VideoTrackList.idl: Ditto.
1448         * loader/appcache/DOMApplicationCache.idl: Ditto.
1449         * page/EventSource.idl: Ditto.
1450         * page/Performance.idl: Ditto.
1451         * workers/AbstractWorker.idl: Ditto.
1452         * workers/DedicatedWorkerGlobalScope.idl: Ditto.
1453         * workers/Worker.idl: Ditto.
1454         * workers/WorkerGlobalScope.idl: Ditto.
1455         * xml/XMLHttpRequest.idl: Ditto.
1456         * xml/XMLHttpRequestUpload.idl: Ditto.
1457
1458         * Modules/notifications/Notification.idl: Did the above, but also used
1459         [Conditional] instead of #if throughout.
1460         * html/track/TextTrack.idl: Ditto.
1461
1462         * Modules/webaudio/AudioNode.idl: Tweaked paragraphing of this file.
1463
1464         * bindings/js/JSEventListener.cpp:
1465         (WebCore::windowEventHandlerAttribute): Renamed to take the word "forwarded"
1466         out of this. More closely matches the terminology used in IDL files and the
1467         HTML specification.
1468         (WebCore::setWindowEventHandlerAttribute): Ditto.
1469         (WebCore::documentEventHandlerAttribute): Added.
1470         (WebCore::setDocumentEventHandlerAttribute): Added.
1471         * bindings/js/JSEventListener.h: Updated for above changes.
1472
1473         * bindings/objc/PublicDOMInterfaces.h: Renamed argument from "evt" to "event".
1474
1475         * bindings/scripts/CodeGeneratorGObject.pm:
1476         (SkipAttribute): Skip attributes of type "EventHandler" rather than attributes
1477         of type "EventListener".
1478         * bindings/scripts/CodeGeneratorObjC.pm:
1479         (SkipAttribute): Ditto.
1480
1481         * bindings/scripts/CodeGeneratorJS.pm:
1482         (GenerateImplementation): Look for the type EventHandler instead of the type
1483         EventListener for event handler attributes. Also added code to handle the new
1484         DocumentEventHandler, and use the name WindowEventHandler instead of the name
1485         JSWindowEventListener. Removed unneeded preflight check to see if we have
1486         writable attributes; it was not doing us any good. (That caused a lot of code
1487         to be un-indented and makes the diff hard to read.)
1488
1489         * bindings/scripts/IDLAttributes.txt: Removed JSWindowEventListener, and added
1490         WindowEventHandler and DocumentEventHandler.
1491
1492         * bindings/scripts/test/TestObj.idl: Use the type EventHandler instead of the
1493         type EventListener. The test output is unchanged, though.
1494
1495         * dom/Document.idl: Got rid of the conditionals and merged all the event handler
1496         attributes into a single sorted, unconditional list. Added some that were missing,
1497         as detected by the event-handler-attributes.html test.
1498
1499         * dom/Element.idl: Ditto. This includes moving attributes here that were formerly
1500         only in certain element classes. Note that the script event handler attribute
1501         support is still here, even though it should be in HTMLElement and SVGElement
1502         instead. There's a FIXME about that, but no real urgency in fixing it.
1503
1504         * html/HTMLAttributeNames.in: Added onmessage. Previously, the support for this
1505         was from the script attribute only, not the content attribute.
1506
1507         * html/HTMLBodyElement.cpp:
1508         (WebCore::HTMLBodyElement::createWindowEventHandlerNameMap): Added. This
1509         contains the list of all the window event handlers that can be set on a body
1510         or frameset element and which are triggered by events on the window.
1511         (WebCore::HTMLBodyElement::eventNameForWindowEventHandlerAttribute): Added.
1512         This is the function to call to use the map above. Given an attribute, it
1513         returns either null if it is not a window event handler attribute, or the
1514         event type if it is one.
1515         (WebCore::HTMLBodyElement::parseAttribute): Updated to use the new
1516         functions above. Handling of these attributes is now unconditional, but
1517         also we don't have to keep the nested if statements here up to date, just
1518         the list of event handler attributes names in the map create function above.
1519
1520         * html/HTMLBodyElement.h: Added public eventNameForWindowEventHandlerAttribute
1521         and private createWindowEventHandlerNameMap functions.
1522
1523         * html/HTMLBodyElement.idl: Updated to use WindowEventHandler, DocumentEventHandler,
1524         and EventHandler. Also made everything unconditional. Also filled out the list here
1525         to match the list handled as content attributes. All covered by the test.
1526
1527         * html/HTMLElement.cpp:
1528         (WebCore::HTMLElement::createEventHandlerNameMap): Added. Replaces the old
1529         populate function. Changed the list of event handler attributes to be a bit more
1530         complete, and to be entirely unconditional. Also refactored this function to use
1531         a new populateEventHandlerNameMap helper, shared with HTMLBodyElement.
1532         (WebCore::HTMLElement::populateEventHandlerNameMap): Added. Factors out the code
1533         that both this class and HTMLBodyElement use to build event handler name maps.
1534         (WebCore::HTMLElement::eventNameForEventHandlerAttribute): Added. This is the
1535         function that call to use the map above. Given an attribute it returns either
1536         null if it is not an event handler attribute, or the event type if it is one.
1537         This is actually two functions. One is a protected function for use by both this
1538         class and HTMLBodyElement so they can share things like the optimization to look
1539         for the "on" prefix. The other is the public function that we actually use in
1540         HTMLElement and SVGElement.
1541         (WebCore::HTMLElement::editabilityFromContentEditableAttr): Tweaked and refactored
1542         to use lineageOfType. Would have been even simpler if this took an element instead
1543         of a node. Unrelated to the event handler changes.
1544         (WebCore::HTMLElement::parseAttribute): Removed long-obsolete code that decided
1545         whether to call through to the base class. The base class function is empty and
1546         never needs to be called, and in any case there is no value in doing work to
1547         decide whether to call through to an empty function. Changed the style of the
1548         function to use early return instead of else. Worth considering whether we want
1549         to return early or call through to base class in this family of functions. It's
1550         more efficient to return early, but doesn't work well if both the derived class
1551         and base class want to respond to changes to the same attribute. The new logic
1552         for event handler attributes is more straightforward than the old, since the
1553         eventNameForEventHandlerAttribute has the logic.
1554         (WebCore::HTMLElement::textToFragment): Tweaked and refactored a bit, and also
1555         changed to return a Ref since this never fails and needs to return null.
1556
1557         * html/HTMLElement.h: Updated for above changes. This includes a template version
1558         of populateEventHandlerNameMap that extracts the array size at compile time and
1559         passes it to the non-template function that does the work.
1560
1561         * html/HTMLFrameElementBase.cpp:
1562         (WebCore::HTMLFrameElementBase::parseAttribute): Removed unneeded code to handle
1563         event handler attributes handled by HTMLElement.
1564         * html/HTMLImageElement.cpp:
1565         (WebCore::HTMLImageElement::parseAttribute): Ditto.
1566         * html/HTMLLinkElement.cpp:
1567         (WebCore::HTMLLinkElement::parseAttribute): Ditto.
1568         * html/HTMLObjectElement.cpp:
1569         (WebCore::HTMLObjectElement::parseAttribute): Ditto.
1570         * html/HTMLScriptElement.cpp:
1571         (WebCore::HTMLScriptElement::parseAttribute): Ditto.
1572
1573         * html/HTMLFrameSetElement.cpp:
1574         (WebCore::HTMLFrameSetElement::parseAttribute): Changed function to early return
1575         style, and added FIXMEs about the many problems in the attribute handling code.
1576         Replaced all the code to handle window event handlers with a new bit of code that
1577         calls HTMLBodyElement::eventNameForWindowEventHandlerAttribute.
1578
1579         * html/HTMLFrameSetElement.idl: Changed to match the list of window event handlers
1580         in HTMLBodyElement.idl, although I did not add the document event handler here.
1581         As in the various other cases, having some extra event handlers does not seem to
1582         do harm and this is covered by the event-handler-attributes.html test.
1583
1584         * html/HTMLMarqueeElement.idl: Renamed EventListener to EventHandler in comment.
1585
1586         * page/DOMWindow.idl: As with Element and Document, removed conditionals, and
1587         filled out the list of event handlers so all the tests in
1588         event-handler-attributes.html will pass.
1589
1590         * svg/SVGElement.cpp:
1591         (WebCore::SVGElement::parseAttribute): Changed code to the early return style,
1592         and replaced the event handler attribute code with new much simpler code that
1593         uses the new HTMLElement::eventNameForEventHandlerAttribute. Also changed the
1594         way we call through to base classes. Just call through to the
1595         SVGLangSpace::parseAttribute function unconditionally, and don't try to use
1596         early return style to arbitrate among base classes. We should make this
1597         simplification throughout the SVG code; there's no need for the complexity
1598         that was there before just to cut down slightly on calls through to base
1599         class parseAttribute functions.
1600
1601         * svg/SVGSVGElement.cpp:
1602         (WebCore::SVGSVGElement::parseAttribute): Changed some of this code to the
1603         early return style and corrected some comments about the window event handler
1604         attributes here. These could use some further testing and might later need to be
1605         properly supported when the attributes are set in script, not just in content.
1606
1607         * svg/SVGScriptElement.cpp:
1608         (WebCore::SVGScriptElement::isSupportedAttribute): Deleted.
1609         (WebCore::SVGScriptElement::parseAttribute): Changed this function to use the
1610         early return style and also to call through to all three base classes. This is
1611         a pattern we should follow elsewhere in SVG to simplify the code. There is no
1612         need for the supportedAttributes sets like the one in this calass, and the code
1613         is unnecessarily complex, perhaps in an attempt to optimize performance. I'm
1614         pretty sure the old code was slower than this new code will be. No need for the
1615         extra hash table lookup every time. Also removed handling of event handler
1616         attribute which is taken care of by SVGElement now.
1617         (WebCore::SVGScriptElement::svgAttributeChanged): Made similar changes for
1618         the same reason as in parseAttribute. This function really needs a new name:
1619         It's the same as parseAttribute, except it's also used when implementing
1620         changes due to SVG animation.
1621
1622         * svg/SVGScriptElement.h: Removed isSupportedAttribute.
1623
1624 2015-03-14  Simon Fraser  <simon.fraser@apple.com>
1625
1626         Clean up use of flags in localToContainer-type functions
1627         https://bugs.webkit.org/show_bug.cgi?id=142704
1628
1629         Reviewed by Alexey Proskuryakov.
1630         
1631         RenderObject::localToContainerQuad() had the questionable behavior of always
1632         enforcing UseTransforms in the flags. However, a future patch will need to call
1633         localToContainerQuad() without this flag.
1634         
1635         Fix by requiring callers of localToAbsoluteQuad(), localToContainerQuad(), localToContainerPoint(),
1636         and absoluteToLocalQuad() to pass the UseTransforms flag in, providing it as a default argument.
1637         
1638         The default value of the MapCoordinatesFlags parameter to mapLocalToContainer(),
1639         a lower-level function, is removed.
1640         
1641         Sprinkle a few more nullptrs around.
1642         
1643         No behavior change.
1644
1645         * rendering/RenderBlock.cpp:
1646         (WebCore::RenderBlock::selectionGapRectsForRepaint): call the higher-level localToContainerPoint()
1647         instead of mapLocalToContainer().
1648         (WebCore::RenderBlock::absoluteQuads): Pass UseTransforms.
1649         * rendering/RenderBox.cpp:
1650         (WebCore::RenderBox::absoluteQuads): Ditto.
1651         * rendering/RenderBox.h:
1652         * rendering/RenderFlowThread.h:
1653         * rendering/RenderGeometryMap.h:
1654         (WebCore::RenderGeometryMap::absolutePoint):
1655         (WebCore::RenderGeometryMap::absoluteRect):
1656         * rendering/RenderImage.cpp:
1657         (WebCore::RenderImage::collectSelectionRects): This function was erroneously passing
1658         'false' as flags. Pass UseTransforms instead (but no behavior change since
1659         UseTransforms was forced on lower down).
1660         * rendering/RenderInline.h:
1661         * rendering/RenderLayer.cpp:
1662         (WebCore::RenderLayer::scrollRectToVisible): UseTransforms is the parameter default, remove it.
1663         * rendering/RenderLineBreak.cpp:
1664         (WebCore::RenderLineBreak::absoluteQuads):
1665         (WebCore::RenderLineBreak::collectSelectionRects): Another erroneous 'false'.
1666         * rendering/RenderNamedFlowFragment.cpp:
1667         (WebCore::RenderNamedFlowFragment::absoluteQuadsForBoxInRegion):
1668         * rendering/RenderObject.cpp:
1669         (WebCore::RenderObject::localToContainerQuad): Here's where we no longer force
1670         the UseTransforms bit.
1671         (WebCore::RenderObject::localToContainerPoint): Also here.
1672         * rendering/RenderObject.h: I prefer bit flags lined up. Makes it easier to spot errors.
1673         (WebCore::RenderObject::localToAbsoluteQuad):
1674         * rendering/RenderText.cpp:
1675         (WebCore::RenderText::collectSelectionRects): Another bad 'false'.
1676         * rendering/RenderTextLineBoxes.cpp:
1677         (WebCore::RenderTextLineBoxes::absoluteRectsForRange):
1678         (WebCore::RenderTextLineBoxes::absoluteQuads):
1679         (WebCore::RenderTextLineBoxes::absoluteQuadsForRange):
1680         * rendering/RenderView.h:
1681         * rendering/SimpleLineLayoutFunctions.cpp:
1682         (WebCore::SimpleLineLayout::collectAbsoluteQuads):
1683         * rendering/svg/RenderSVGForeignObject.h:
1684         * rendering/svg/RenderSVGInline.cpp:
1685         (WebCore::RenderSVGInline::absoluteQuads): Another bad 'false'.
1686         * rendering/svg/RenderSVGInline.h:
1687         * rendering/svg/RenderSVGModelObject.cpp:
1688         (WebCore::RenderSVGModelObject::absoluteQuads):
1689         * rendering/svg/RenderSVGModelObject.h:
1690         * rendering/svg/RenderSVGRoot.h:
1691         * rendering/svg/RenderSVGText.cpp:
1692         (WebCore::RenderSVGText::absoluteQuads):
1693         * rendering/svg/RenderSVGText.h:
1694         * rendering/svg/SVGRenderSupport.h:
1695
1696 2015-03-14  Brent Fulgham  <bfulgham@apple.com>
1697
1698         [iOS] scroll snap points are animating to the wrong positions...
1699         https://bugs.webkit.org/show_bug.cgi?id=142705
1700         <rdar://problem/20136946>
1701
1702         Reviewed by Simon Fraser.
1703
1704         Avoid adding an extra '0' snap point to our set. We always start with one zero; this
1705         extra append just forces us to do more steps in our search for nearest snap point.
1706
1707         * page/scrolling/AxisScrollSnapOffsets.cpp:
1708         (WebCore::updateFromStyle): Remove extra '0' appended to offsets.
1709
1710 2015-03-14  Dean Jackson  <dino@apple.com>
1711
1712         Feature flag for Animations Level 2
1713         https://bugs.webkit.org/show_bug.cgi?id=142699
1714         <rdar://problem/20165097>
1715
1716         Reviewed by Brent Fulgham.
1717
1718         Add ENABLE_CSS_ANIMATIONS_LEVEL_2 and a runtime flag animationTriggersEnabled.
1719
1720         * Configurations/FeatureDefines.xcconfig:
1721         * bindings/generic/RuntimeEnabledFeatures.cpp:
1722         (WebCore::RuntimeEnabledFeatures::RuntimeEnabledFeatures):
1723         * bindings/generic/RuntimeEnabledFeatures.h:
1724         (WebCore::RuntimeEnabledFeatures::setAnimationTriggersEnabled):
1725         (WebCore::RuntimeEnabledFeatures::animationTriggersEnabled):
1726
1727 2015-03-14  Adenilson Cavalcanti  <cavalcantii@gmail.com>
1728
1729         RenderBlock::imageChange() calling const methods on exit
1730         https://bugs.webkit.org/show_bug.cgi?id=142648
1731
1732         Reviewed by Brent Fulgham.
1733
1734         No new tests, no change on behavior.
1735
1736         * rendering/RenderBlock.cpp:
1737         (WebCore::RenderBlock::imageChanged): Deleted.
1738         * rendering/RenderBlock.h:
1739
1740 2015-03-14  Víctor Manuel Jáquez Leal  <vjaquez@igalia.com>
1741
1742         [GStreamer] share GL context in pipeline
1743         https://bugs.webkit.org/show_bug.cgi?id=142693
1744
1745         Reviewed by Philippe Normand.
1746
1747         GstGL elements in a pipeline need to be aware of the application's
1748         display and its GL context. This information is shared through context
1749         messages between the pipeline and the browser.
1750
1751         This patch shares this context through a GStreamer's synchronous
1752         message, using the GL information held in the web process.
1753
1754         This patch is based on the work of Philippe Normand for Bug 138562.
1755
1756         No new tests because this is platform specific and it depends in the
1757         run-time availability and configurations of GstGL elements.
1758
1759         * PlatformGTK.cmake: appends the GstGL header files in the include
1760         directories. Also its library directory is appended.
1761         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1762         (WebCore::mediaPlayerPrivateSyncMessageCallback): New callback function.
1763         (WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer):
1764         Initialize the new class attributes.
1765         (WebCore::MediaPlayerPrivateGStreamer::handleSyncMessage): New method
1766         for handling synchronous messages from the pipeline. This method
1767         currently only handles the GL context sharing.
1768         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin): Configures
1769         the pipeline's bus to handle the synchronous messages.
1770         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: Add new
1771         class methods and attributes.
1772
1773 2015-03-13  Alex Christensen  <achristensen@webkit.org>
1774
1775         Progress towards CMake on Mac.
1776         https://bugs.webkit.org/show_bug.cgi?id=142680
1777
1778         Reviewed by Gyuyoung Kim.
1779
1780         * PlatformMac.cmake:
1781         Added new include directories and removed old source files.
1782
1783 2015-03-13  Commit Queue  <commit-queue@webkit.org>
1784
1785         Unreviewed, rolling out r181483.
1786         https://bugs.webkit.org/show_bug.cgi?id=142688
1787
1788         Caused use-after-free on many tests (Requested by ap on
1789         #webkit).
1790
1791         Reverted changeset:
1792
1793         "Allow clients to selectively disable plug-ins"
1794         https://bugs.webkit.org/show_bug.cgi?id=142506
1795         http://trac.webkit.org/changeset/181483
1796
1797 2015-03-13  Antti Koivisto  <antti@apple.com>
1798
1799         Cache glyph widths to GlyphPages
1800         https://bugs.webkit.org/show_bug.cgi?id=142028
1801
1802         Reviewed by Andreas Kling.
1803
1804         Currently we have a separate cache in Font for glyph widths. In practice we always need
1805         the widths so we can just cache them in GlyphPages. This simplifies the code and removes
1806         a per-character hash lookup from WidthIterator.
1807
1808         * platform/graphics/Font.cpp:
1809         (WebCore::Font::Font):
1810         (WebCore::Font::initCharWidths):
1811         (WebCore::Font::platformGlyphInit):
1812         (WebCore::createAndFillGlyphPage):
1813         (WebCore::Font::computeWidthForGlyph):
1814
1815             Rename to make it clear this doesn't cache.
1816
1817         (WebCore::GlyphPage::setGlyphDataForIndex):
1818
1819             Initialize the width.
1820             This could go to GlyphPage.cpp if we had one.
1821
1822         * platform/graphics/Font.h:
1823         (WebCore::Font::glyphZeroWidth):
1824         (WebCore::Font::isZeroWidthSpaceGlyph):
1825         (WebCore::Font::zeroGlyph): Deleted.
1826         (WebCore::Font::setZeroGlyph): Deleted.
1827         (WebCore::Font::widthForGlyph): Deleted.
1828         * platform/graphics/FontCascade.cpp:
1829         (WebCore::offsetToMiddleOfGlyph):
1830         * platform/graphics/FontCascadeFonts.cpp:
1831         (WebCore::FontCascadeFonts::glyphDataForCharacter):
1832         * platform/graphics/GlyphPage.h:
1833         (WebCore::GlyphData::GlyphData):
1834
1835             Return width too as part of GlyphData.
1836
1837         (WebCore::GlyphPage::glyphDataForIndex):
1838         (WebCore::GlyphPage::setGlyphDataForCharacter):
1839         (WebCore::GlyphPage::setGlyphDataForIndex):
1840         (WebCore::GlyphPage::GlyphPage):
1841         * platform/graphics/WidthIterator.cpp:
1842         (WebCore::WidthIterator::advanceInternal):
1843
1844             No need to lookup width separately now.
1845
1846         * platform/graphics/mac/ComplexTextController.cpp:
1847         (WebCore::ComplexTextController::adjustGlyphsAndAdvances):
1848         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
1849         (WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun):
1850         * rendering/mathml/RenderMathMLOperator.cpp:
1851         (WebCore::RenderMathMLOperator::advanceForGlyph):
1852         * rendering/svg/SVGTextRunRenderingContext.cpp:
1853         (WebCore::missingGlyphForFont):
1854         * svg/SVGFontData.cpp:
1855         (WebCore::SVGFontData::initializeFont):
1856
1857 2015-03-13  Eric Carlson  <eric.carlson@apple.com>
1858
1859         [Mac] Enable WIRELESS_PLAYBACK_TARGET
1860         https://bugs.webkit.org/show_bug.cgi?id=142635
1861
1862         Reviewed by Darin Adler.
1863
1864         * Configurations/FeatureDefines.xcconfig:
1865
1866 2015-03-13  Jeremy Jones  <jeremyj@apple.com>
1867
1868         Fix typo restoreUserInterfaceForOptimizedFullscreeStopWithCompletionHandler.
1869         https://bugs.webkit.org/show_bug.cgi?id=142678
1870
1871         Reviewed by Eric Carlson.
1872
1873         Add the missing 'n' in "fullscreen".
1874
1875         * platform/spi/ios/AVKitSPI.h:
1876
1877 2015-03-13  Timothy Horton  <timothy_horton@apple.com>
1878
1879         Sites that use a device-width viewport but don't have enough height to fill the view are scaled up
1880         https://bugs.webkit.org/show_bug.cgi?id=142664
1881         <rdar://problem/18859470>
1882
1883         Reviewed by Benjamin Poulain.
1884
1885         * page/ViewportConfiguration.cpp:
1886         (WebCore::ViewportConfiguration::shouldIgnoreHorizontalScalingConstraints):
1887         (WebCore::ViewportConfiguration::shouldIgnoreVerticalScalingConstraints):
1888         (WebCore::ViewportConfiguration::shouldIgnoreScalingConstraints):
1889         Split shouldIgnoreScalingConstraints into one for each dimension.
1890
1891         (WebCore::ViewportConfiguration::initialScale):
1892         (WebCore::ViewportConfiguration::minimumScale):
1893         Don't force the initial and minimum scales to cover the whole view if the
1894         page claims to want to lay out to device width but then lays out too big.
1895         This will allow pages that misbehave in this way to scale down further
1896         than they previously could, but will result in a region of empty background
1897         color being exposed at the initial/minimum scale.
1898
1899         (WebCore::ViewportConfiguration::description):
1900         Update the logging to show each dimension separately.
1901
1902         * page/ViewportConfiguration.h:
1903
1904 2015-03-13  Mark Lam  <mark.lam@apple.com>
1905
1906         Replace TCSpinLock with a new WTF::SpinLock based on WTF::Atomic.
1907         <https://webkit.org/b/142674>
1908
1909         Reviewed by Filip Pizlo.
1910
1911         No new tests because there is no new functionality. This is a refactoring effort.
1912
1913         * bindings/objc/WebScriptObject.mm:
1914         * platform/ios/wak/WAKWindow.mm:
1915         (-[WAKWindow initWithLayer:]):
1916         (-[WAKWindow initWithFrame:]):
1917
1918 2015-03-13  Doug Russell  <d_russell@apple.com>
1919
1920         AX: Provide API for assistive tech to ignore DOM key event handlers
1921         https://bugs.webkit.org/show_bug.cgi?id=142059
1922
1923         Reviewed by Beth Dakin.
1924
1925         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.
1926
1927         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.
1928
1929         Test: platform/mac/accessibility/prevent-keyboard-event-dispatch.html
1930
1931         * accessibility/AccessibilityObject.cpp:
1932         (WebCore::AccessibilityObject::preventKeyboardDOMEventDispatch):
1933         (WebCore::AccessibilityObject::setPreventKeyboardDOMEventDispatch):
1934         * accessibility/AccessibilityObject.h:
1935         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1936         (-[WebAccessibilityObjectWrapper accessibilityAttributeNames]):
1937         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
1938         (-[WebAccessibilityObjectWrapper accessibilityIsAttributeSettable:]):
1939         (-[WebAccessibilityObjectWrapper _accessibilitySetValue:forAttribute:]):
1940         * dom/Element.cpp:
1941         (WebCore::Element::dispatchKeyEvent):
1942         * page/EventHandler.cpp:
1943         (WebCore::EventHandler::keyEvent):
1944         (WebCore::handleKeyboardSelectionMovement):
1945         (WebCore::EventHandler::handleKeyboardSelectionMovementForAccessibility):
1946         * page/EventHandler.h:
1947         * page/Settings.in:
1948
1949 2015-03-09  Conrad Shultz  <conrad_shultz@apple.com>
1950
1951         Allow clients to selectively disable plug-ins
1952         https://bugs.webkit.org/show_bug.cgi?id=142506
1953
1954         Reviewed by Anders Carlsson.
1955
1956         Add new functionality allow clients to declaratively disable individual plug-ins (in a manner that conceals them
1957         from the page). As part of this:
1958
1959         1) Introduce the concept of web-visible plug-ins and related concepts, as distinct from the real underlying
1960            set of plug-ins.
1961
1962         2) Where applicable, plumb additional information about plug-ins (specifically, bundle identification) deeper
1963            down the stack.
1964
1965         3) Add generic functionality to PluginStrategy to support filtering plug-ins for visibility and introduce
1966            a concrete implementation thereof in WebPlatformStrategies in WebKit2.
1967
1968         4) Add messaging infrastructure to allow clients to set and clear plug-in policies.
1969
1970         While currently only used in a very limited manner, the new declarative plug-in policies are written generically
1971         so that they could be easily used in the future to reduce synchronous messaging to the client when loading plug-ins.
1972
1973         * dom/DOMImplementation.cpp:
1974         (WebCore::DOMImplementation::createDocument):
1975         Update to reflect function rename.
1976
1977         * loader/SubframeLoader.cpp:
1978         (WebCore::findPluginMIMETypeFromURL):
1979         Adopt getWebVisibleMimesAndPluginIndices().
1980         (WebCore::logPluginRequest):
1981         Update to reflect function rename.
1982         (WebCore::SubframeLoader::shouldUsePlugin):
1983         Ditto.
1984
1985         * platform/PlatformStrategies.h:
1986         Export platformStrategies(), since it is now used in WebProcess.cpp.
1987
1988         * plugins/DOMMimeType.cpp:
1989         (WebCore::DOMMimeType::type):
1990         (WebCore::DOMMimeType::description):
1991         (WebCore::DOMMimeType::mimeClassInfo):
1992         Adopt getWebVisibleMimesAndPluginIndices().
1993         (WebCore::DOMMimeType::enabledPlugin):
1994         Ditto.
1995
1996         * plugins/DOMMimeType.h:
1997         Don't return references in a few places where it is no longer safe to do so.
1998         (WebCore::DOMMimeType::mimeClassInfo): Deleted.
1999
2000         * plugins/DOMMimeTypeArray.cpp:
2001         (WebCore::DOMMimeTypeArray::length):
2002         Adopt getWebVisibleMimesAndPluginIndices().
2003         (WebCore::DOMMimeTypeArray::item):
2004         Ditto.
2005         (WebCore::DOMMimeTypeArray::canGetItemsForName):
2006         Ditto.
2007         (WebCore::DOMMimeTypeArray::namedItem):
2008         Ditto.
2009
2010         * plugins/DOMPlugin.cpp:
2011         (WebCore::DOMPlugin::pluginInfo):
2012         Adopt getWebVisiblePlugins().
2013         (WebCore::DOMPlugin::item):
2014         Adopt getWebVisibleMimesAndPluginIndices().
2015         (WebCore::DOMPlugin::canGetItemsForName):
2016         Ditto.
2017         (WebCore::DOMPlugin::namedItem):
2018         Ditto.
2019
2020         * plugins/DOMPlugin.h:
2021         (WebCore::DOMPlugin::pluginInfo): Deleted.
2022
2023         * plugins/DOMPluginArray.cpp:
2024         (WebCore::DOMPluginArray::length):
2025         Adopt getWebVisiblePlugins().
2026         (WebCore::DOMPluginArray::item):
2027         Ditto.
2028         (WebCore::DOMPluginArray::canGetItemsForName):
2029         Ditto.
2030         (WebCore::DOMPluginArray::namedItem):
2031         Ditto.
2032
2033         * plugins/PluginData.cpp:
2034         (WebCore::PluginData::PluginData):
2035         Stash the passed-in Page and call initPlugins().
2036         (WebCore::PluginData::getWebVisiblePlugins):
2037         New member function; call through to PluginStrategy::getWebVisiblePluginInfo().
2038         (WebCore::PluginData::getWebVisibleMimesAndPluginIndices):
2039         New member function; build up the mimes and mimePluginIndices vectors in the same manner as before, but
2040         limited to the web-visible plug-ins.
2041         (WebCore::PluginData::supportsWebVisibleMimeType):
2042         Renamed from supportsMimeType(); update to work in terms of web-visible plug-ins.
2043         (WebCore::PluginData::pluginInfoForWebVisibleMimeType):
2044         Renamed from pluginInfoForMimeType(); ditto.
2045         (WebCore::PluginData::pluginNameForWebVisibleMimeType):
2046         Renamed from pluginNameForMimeType(); ditto.
2047         (WebCore::PluginData::pluginFileForWebVisibleMimeType):
2048         Renamed from pluginFileForMimeType(); ditto.
2049         (WebCore::PluginData::initPlugins):
2050         (WebCore::PluginData::supportsMimeType): Deleted.
2051         (WebCore::PluginData::pluginInfoForMimeType): Deleted.
2052         (WebCore::PluginData::pluginNameForMimeType): Deleted.
2053         (WebCore::PluginData::pluginFileForMimeType): Deleted.
2054
2055         * plugins/PluginData.h:
2056         Add a member variable for the associate Page; declare the PluginLoadClientPolicy enumeration; add
2057         new members to PluginInfo for the clientLoadPolicy and bundle information.
2058         (WebCore::PluginData::PluginData):
2059         Replace some member functions with new ones that will hide plug-ins upon request from the client;
2060         (WebCore::PluginData::mimes): Deleted.
2061         (WebCore::PluginData::mimePluginIndices): Deleted.
2062
2063         * plugins/PluginStrategy.h:
2064         Declare new member functions for retrieving web-visible plug-ins and setting/clearing plug-in policies.
2065
2066         * replay/SerializationMethods.cpp:
2067         (JSC::EncodingTraits<PluginData>::encodeValue):
2068         Remove now-obsolete code for handling MIME types and add a FIXME.
2069         (JSC::DeserializedPluginData::DeserializedPluginData):
2070         (JSC::EncodingTraits<PluginData>::decodeValue):
2071         Ditto.
2072         (JSC::EncodingTraits<PluginInfo>::encodeValue):
2073         Handle the new members in PluginInfo.
2074         (JSC::EncodingTraits<PluginInfo>::decodeValue):
2075         Ditto.
2076
2077         * replay/WebInputs.json:
2078         Teach Replay about PluginLoadClientPolicy.
2079
2080 2015-03-13  Chris Dumez  <cdumez@apple.com>
2081
2082         XMLHttpRequests should not prevent a page from entering PageCache
2083         https://bugs.webkit.org/show_bug.cgi?id=142612
2084         <rdar://problem/19923085>
2085
2086         Reviewed by Alexey Proskuryakov.
2087
2088         Make XMLHttpRequest ActiveDOMObjects suspendable in most cases to
2089         drastically improve the likelihood of pages using them to enter
2090         PageCache. XMLHttpRequest used to be only suspendable when not
2091         loading. After this patch, if the XMLHttpRequest is loading when
2092         navigating away from the page, it will be aborted and the page
2093         will enter the PageCache. Upon restoring the page from PageCache,
2094         the XMLHttpRequests' error handlers will be executed to give them
2095         a chance to reload if they want to.
2096
2097         Test: http/tests/navigation/page-cache-xhr.html
2098
2099         * history/PageCache.cpp:
2100         (WebCore::logCanCacheFrameDecision):
2101         (WebCore::PageCache::canCachePageContainingThisFrame):
2102         Do not prevent a page to enter the page cache ff the main document has
2103         an error that is a cancellation and all remaining subresource loaders
2104         are for XHR. We extend the pre-existing mechanism used on iOS, which
2105         allowed PageCaching if the remaining resource loads are for images.
2106
2107         * loader/DocumentLoader.cpp:
2108         (WebCore::areAllLoadersPageCacheAcceptable):
2109         Mark XHR loaders as PageCache acceptable.
2110
2111         * loader/DocumentThreadableLoader.cpp:
2112         (WebCore::DocumentThreadableLoader::isXMLHttpRequest):
2113         * loader/DocumentThreadableLoader.h:
2114         * loader/ThreadableLoader.h:
2115         * loader/cache/CachedResource.cpp:
2116         (WebCore::CachedResource::areAllClientsXMLHttpRequests):
2117         * loader/cache/CachedResource.h:
2118         * loader/cache/CachedResourceClient.h:
2119         (WebCore::CachedResourceClient::isXMLHttpRequest):
2120         * xml/XMLHttpRequest.cpp:
2121         (WebCore::XMLHttpRequest::XMLHttpRequest):
2122         (WebCore::XMLHttpRequest::createRequest):
2123         (WebCore::XMLHttpRequest::canSuspend):
2124         Report that we can suspend XMLHttpRequests as long as the window load
2125         event has already fired. If the window load event has not fired yet,
2126         it would be unsafe to cancel the load in suspend() as it would
2127         potentially cause arbitrary JS execution while suspending.
2128
2129         (WebCore::XMLHttpRequest::suspend):
2130         If suspending for PageCache and the request is currently loading, abort
2131         the load and mark that we should fire the error event upon restoring
2132         from PageCache.
2133
2134         (WebCore::XMLHttpRequest::resume):
2135         (WebCore::XMLHttpRequest::resumeTimerFired):
2136         Upon resuming, fire the error event in a timer if the load was aborted
2137         for suspending. We need to do this in a timer because we are not allowed
2138         to execute arbitrary JS inside resume().
2139
2140         (WebCore::XMLHttpRequest::stop):
2141         Add a assertion to make sure we are not firing event inside stop() as
2142         this would potentially cause arbitrary JS execution and it would be
2143         unsafe. It seems to me that our code is currently unsafe but the
2144         assertion does not seem to be hit by our current layout tests. I am
2145         adding the assertion as it would make it clear we have a bug and we
2146         need to fix it.
2147
2148         * xml/XMLHttpRequest.h:
2149
2150 2015-03-13  Joonghun Park  <jh718.park@samsung.com>
2151
2152         Fix Debug build error 'comparison is always true due to limited range of data type [-Werror=type-limits]'
2153         https://bugs.webkit.org/show_bug.cgi?id=142652
2154
2155         Reviewed by Csaba Osztrogonác.
2156
2157         No new tests, no behavior changes.
2158
2159         Now CSSPropertyID type is uint16_t, so propertyID >= 0 check is needed no more.
2160
2161         * css/CSSPrimitiveValue.cpp:
2162         (WebCore::propertyName):
2163         * css/makeprop.pl:
2164
2165 2015-03-12  Zan Dobersek  <zdobersek@igalia.com>
2166
2167         Remove DrawingBuffer
2168         https://bugs.webkit.org/show_bug.cgi?id=142641
2169
2170         Reviewed by Darin Adler.
2171
2172         Remove the DrawingBuffer class. Objects of this type were only held in the
2173         WebGLRenderingContext (later renamed to WebGLRenderingContextBase) on the
2174         Chromium port, with the relevant code removed in r147888. Since then, the
2175         m_drawingBuffer member variable has always been null.
2176
2177         * CMakeLists.txt:
2178         * PlatformEfl.cmake:
2179         * PlatformGTK.cmake:
2180         * WebCore.vcxproj/WebCore.vcxproj:
2181         * WebCore.vcxproj/WebCore.vcxproj.filters:
2182         * WebCore.xcodeproj/project.pbxproj:
2183         * html/canvas/WebGL2RenderingContext.cpp:
2184         (WebCore::WebGL2RenderingContext::copyTexImage2D):
2185         * html/canvas/WebGLRenderingContext.cpp:
2186         (WebCore::WebGLRenderingContext::copyTexImage2D):
2187         * html/canvas/WebGLRenderingContextBase.cpp:
2188         (WebCore::WebGLRenderingContextBase::WebGLRenderingContextBase):
2189         (WebCore::WebGLRenderingContextBase::initializeNewContext):
2190         (WebCore::WebGLRenderingContextBase::destroyGraphicsContext3D):
2191         (WebCore::WebGLRenderingContextBase::markContextChanged):
2192         (WebCore::WebGLRenderingContextBase::clearIfComposited):
2193         (WebCore::WebGLRenderingContextBase::paintRenderingResultsToCanvas):
2194         (WebCore::WebGLRenderingContextBase::paintRenderingResultsToImageData):
2195         (WebCore::WebGLRenderingContextBase::reshape):
2196         (WebCore::WebGLRenderingContextBase::drawingBufferWidth):
2197         (WebCore::WebGLRenderingContextBase::drawingBufferHeight):
2198         (WebCore::WebGLRenderingContextBase::activeTexture):
2199         (WebCore::WebGLRenderingContextBase::bindFramebuffer):
2200         (WebCore::WebGLRenderingContextBase::bindTexture):
2201         (WebCore::WebGLRenderingContextBase::copyTexSubImage2D):
2202         (WebCore::WebGLRenderingContextBase::deleteFramebuffer):
2203         (WebCore::WebGLRenderingContextBase::disable):
2204         (WebCore::WebGLRenderingContextBase::enable):
2205         (WebCore::WebGLRenderingContextBase::getContextAttributes):
2206         (WebCore::WebGLRenderingContextBase::readPixels):
2207         (WebCore::WebGLRenderingContextBase::loseContextImpl):
2208         (WebCore::WebGLRenderingContextBase::getBoundFramebufferWidth):
2209         (WebCore::WebGLRenderingContextBase::getBoundFramebufferHeight):
2210         (WebCore::WebGLRenderingContextBase::maybeRestoreContext):
2211         * html/canvas/WebGLRenderingContextBase.h:
2212         (WebCore::ScopedDrawingBufferBinder::ScopedDrawingBufferBinder): Deleted.
2213         (WebCore::ScopedDrawingBufferBinder::~ScopedDrawingBufferBinder): Deleted.
2214         * platform/graphics/GraphicsContext.h:
2215         * platform/graphics/GraphicsContext3D.h:
2216         * platform/graphics/cairo/DrawingBufferCairo.cpp: Removed.
2217         * platform/graphics/gpu/DrawingBuffer.cpp: Removed.
2218         * platform/graphics/gpu/DrawingBuffer.h: Removed.
2219         * platform/graphics/gpu/mac/DrawingBufferMac.mm: Removed.
2220         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
2221         (WebCore::GraphicsContext3D::paintRenderingResultsToCanvas):
2222         (WebCore::GraphicsContext3D::paintRenderingResultsToImageData):
2223
2224 2015-03-12  Ryosuke Niwa  <rniwa@webkit.org>
2225
2226         REGRESSION(r180726): Removing an empty line at the end of textarea clears the entire texture
2227         https://bugs.webkit.org/show_bug.cgi?id=142646
2228
2229         Reviewed by Darin Adler.
2230
2231         The bug was caused by TypingCommand::deleteKeyPressed erroneously determining the editable root to be empty because
2232         Position::atStartOfTree returns true when it's anchored at a BR that is immediately below the root editable element.
2233
2234         Fixed the bug by replacing the use of the deprecated atFirstEditingPositionForNode by a code that understands modern
2235         position types such as PositionIsBeforeAnchor in atStartOfTree and atEndOfTree. These two functions will no longer
2236         return true when anchored before or after BR after this patch.
2237
2238         Test: editing/deleting/delete-empty-line-breaks-at-end-of-textarea.html
2239
2240         * dom/Position.cpp:
2241         (WebCore::Position::atStartOfTree):
2242         (WebCore::Position::atEndOfTree):
2243
2244 2015-03-12  Yusuke Suzuki  <utatane.tea@gmail.com>
2245
2246         Integrate MapData into JSMap and JSSet
2247         https://bugs.webkit.org/show_bug.cgi?id=142556
2248
2249         Reviewed by Filip Pizlo.
2250
2251         Now Set has SetData and it's different from MapData.
2252         And MapData/SetData are completely integrated into JSSet and JSMap.
2253         Structured-cloning algorithm need to be aware of these changes.
2254         And in the case of JSSet, since JSSet doesn't need dummy value for construction,
2255         Structured-cloning only serialize the keys in JSSet.
2256
2257         * ForwardingHeaders/runtime/MapDataInlines.h: Added.
2258         * bindings/js/SerializedScriptValue.cpp:
2259         (WebCore::CloneSerializer::serialize):
2260         (WebCore::CloneDeserializer::consumeCollectionDataTerminationIfPossible):
2261         (WebCore::CloneDeserializer::deserialize):
2262         (WebCore::CloneDeserializer::consumeMapDataTerminationIfPossible): Deleted.
2263
2264 2015-03-12  Dan Bernstein  <mitz@apple.com>
2265
2266         Finish up <rdar://problem/20086546> [Cocoa] Add an option to treat certificate chains with SHA1-signed certificates as insecure
2267
2268         Added back OS X bits that I couldn’t land initially in r181317 or had to remove in r181327.
2269
2270         * platform/network/mac/CertificateInfoMac.mm:
2271         (WebCore::CertificateInfo::containsNonRootSHA1SignedCertificate):
2272         * platform/spi/cocoa/SecuritySPI.h:
2273
2274 2015-03-12  Geoffrey Garen  <ggaren@apple.com>
2275
2276         REGRESSION: Crash under Heap::reportExtraMemoryAllocatedSlowCase for media element
2277         https://bugs.webkit.org/show_bug.cgi?id=142636
2278
2279         Reviewed by Mark Hahnenberg.
2280
2281         This was a pre-existing bug that I made a lot worse in
2282         <https://trac.webkit.org/changeset/181411>.
2283
2284         * html/HTMLMediaElement.cpp:
2285         (WebCore::HTMLMediaElement::parseAttribute): Compare size before
2286         subtracting rather than subtracting and then comparing to zero. The
2287         latter technique is not valid for unsigned integers, which will happily
2288         underflow into giant numbers.
2289
2290         * Modules/mediasource/SourceBuffer.cpp:
2291         (WebCore::SourceBuffer::reportExtraMemoryAllocated): This code was
2292          technically correct, but I took the opportunity to clean it up a bit.
2293          There's no need to do two checks here, and it smells bad to check for
2294          a negative unsigned integer.
2295
2296 2015-03-12  Sebastian Dröge  <sebastian@centricular.com>
2297
2298         Stop using single-include headers that are only available since GStreamer >= 1.2.
2299
2300         https://bugs.webkit.org/show_bug.cgi?id=142537
2301
2302         Reviewed by Philippe Normand.
2303
2304         * platform/audio/gstreamer/AudioDestinationGStreamer.cpp:
2305         * platform/audio/gstreamer/AudioFileReaderGStreamer.cpp:
2306         * platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp:
2307         * platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp:
2308         * platform/graphics/gstreamer/GStreamerUtilities.cpp:
2309         * platform/graphics/gstreamer/GStreamerUtilities.h:
2310         * platform/graphics/gstreamer/ImageGStreamer.h:
2311         Instead of using single-include headers for the GStreamer libraries,
2312         directly include the headers we need. The single-include headers were
2313         only added in 1.2, and this would be the only reason why we would
2314         depend on 1.2.
2315
2316 2015-03-12  Eric Carlson  <eric.carlson@apple.com>
2317
2318         [Mac] Update AirPlay handling
2319         https://bugs.webkit.org/show_bug.cgi?id=142541
2320
2321         Unreviewed, respond to post-review comments.
2322
2323         * dom/Document.cpp:
2324         (WebCore::Document::didChoosePlaybackTarget):
2325         * page/ChromeClient.h:
2326         * page/Page.cpp:
2327         (WebCore::Page::showPlaybackTargetPicker):
2328         (WebCore::Page::didChoosePlaybackTarget):
2329         (WebCore::Page::configurePlaybackTargetMonitoring):
2330
2331 2015-03-12  Csaba Osztrogonác  <ossy@webkit.org>
2332
2333         Fix the !ENABLE(PICTURE_SIZES) build
2334         https://bugs.webkit.org/show_bug.cgi?id=142617
2335
2336         Reviewed by Darin Adler.
2337
2338         * html/parser/HTMLPreloadScanner.cpp:
2339         (WebCore::TokenPreloadScanner::StartTagScanner::processAttributes):
2340
2341 2015-03-11  Joseph Pecoraro  <pecoraro@apple.com>
2342
2343         Unreviewed follow-up fix to r181426. Initialize TextPosition with zeros in case it gets used.
2344
2345         Address ASSERT in LayoutTests/printing/page-format-data.html.
2346
2347         * dom/InlineStyleSheetOwner.cpp:
2348         (WebCore::InlineStyleSheetOwner::InlineStyleSheetOwner):
2349         In case the TextPosition gets used because it wasn't created by a parser,
2350         zeros are more realistic values then beforeFirst.
2351
2352 2015-03-11  Roger Fong  <roger_fong@apple.com>
2353
2354         Media element time no longer updates while scrubbing following r181279.
2355         https://bugs.webkit.org/show_bug.cgi?id=142606.
2356         <rdar://problem/20131014>
2357
2358         Reviewed by Eric Carlson.
2359
2360         * Modules/mediacontrols/mediaControlsApple.js:
2361         (Controller.prototype.handleWrapperMouseMove):
2362         Update time as a result of a mouse move if we are scrubbing.
2363
2364 2015-03-11  Joseph Pecoraro  <pecoraro@apple.com>
2365
2366         Web Inspector: CSS parser errors in the console should include column numbers
2367         https://bugs.webkit.org/show_bug.cgi?id=114313
2368
2369         Reviewed by Darin Adler.
2370
2371         Test: inspector-protocol/console/warnings-errors.html
2372
2373         * css/CSSParser.h:
2374         (WebCore::CSSParser::currentCharacterOffset):
2375         Get the current character offset depending on the source type.
2376         Add instance variables to track column position and start
2377         line / column for inline stylesheets.
2378
2379         * css/CSSParser.cpp:
2380         (WebCore::CSSParser::CSSParser):
2381         (WebCore::CSSParser::parseSheet):
2382         Initialize new instance variables.
2383
2384         (WebCore::CSSParser::currentLocation):
2385         Update to include column information for the token. Also, if we are on the
2386         first line we may need to take into account a start column offset as well.
2387
2388         (WebCore::CSSParser::realLex):
2389         Set the token's start column.
2390         When bumping the line number, reset the column offset for the next
2391         line with the next character.
2392
2393         (WebCore::CSSParser::syntaxError):
2394         (WebCore::CSSParser::logError):
2395         Include column information.
2396
2397         * css/StyleSheetContents.cpp:
2398         (WebCore::StyleSheetContents::parseAuthorStyleSheet):
2399         (WebCore::StyleSheetContents::parseString):
2400         (WebCore::StyleSheetContents::parseStringAtPosition):
2401         Include column information.
2402
2403         * css/StyleSheetContents.h:
2404         * dom/InlineStyleSheetOwner.cpp:
2405         (WebCore::InlineStyleSheetOwner::InlineStyleSheetOwner):
2406         (WebCore::InlineStyleSheetOwner::createSheet):
2407         Save and use column information later on.
2408
2409         * dom/InlineStyleSheetOwner.h:
2410         * inspector/InspectorStyleSheet.cpp:
2411         (WebCore::InspectorStyleSheet::ensureSourceData):
2412         Updated parser signature needs starting column and no longer has optional parameters.
2413
2414 2015-03-11  Eric Carlson  <eric.carlson@apple.com>
2415
2416         [Mac] Update AirPlay handling
2417         https://bugs.webkit.org/show_bug.cgi?id=142541
2418
2419         Reviewed by Sam Weinig.
2420
2421         * WebCore.xcodeproj/project.pbxproj:
2422         * dom/Document.cpp:
2423         (WebCore::Document::showPlaybackTargetPicker):
2424         (WebCore::Document::addPlaybackTargetPickerClient):
2425         (WebCore::Document::removePlaybackTargetPickerClient):
2426         (WebCore::Document::configurePlaybackTargetMonitoring):
2427         (WebCore::Document::requiresPlaybackTargetRouteMonitoring):
2428         (WebCore::Document::playbackTargetAvailabilityDidChange):
2429         (WebCore::Document::didChoosePlaybackTarget):
2430         * dom/Document.h:
2431         * html/HTMLMediaElement.cpp:
2432         (WebCore::HTMLMediaElement::registerWithDocument):
2433         (WebCore::HTMLMediaElement::unregisterWithDocument):
2434         (WebCore::HTMLMediaElement::parseAttribute):
2435         * html/HTMLMediaElement.h:
2436         * html/HTMLMediaSession.cpp:
2437         (WebCore::HTMLMediaSession::HTMLMediaSession):
2438         (WebCore::HTMLMediaSession::registerWithDocument):
2439         (WebCore::HTMLMediaSession::unregisterWithDocument):
2440         (WebCore::HTMLMediaSession::showPlaybackTargetPicker):
2441         (WebCore::HTMLMediaSession::hasWirelessPlaybackTargets):
2442         (WebCore::HTMLMediaSession::setHasPlaybackTargetAvailabilityListeners):
2443         (WebCore::HTMLMediaSession::didChoosePlaybackTarget):
2444         (WebCore::HTMLMediaSession::externalOutputDeviceAvailableDidChange):
2445         (WebCore::HTMLMediaSession::requiresPlaybackTargetRouteMonitoring):
2446         * html/HTMLMediaSession.h:
2447         * page/ChromeClient.h:
2448         * page/Page.cpp:
2449         (WebCore::Page::didChoosePlaybackTarget):
2450         (WebCore::Page::playbackTargetAvailabilityDidChange):
2451         (WebCore::Page::configurePlaybackTargetMonitoring):
2452         * page/Page.h:
2453         (WebCore::Page::hasWirelessPlaybackTarget):
2454         (WebCore::Page::playbackTarget):
2455         * platform/audio/MediaSession.cpp:
2456         (WebCore::MediaSession::clientDataBufferingTimerFired):
2457         (WebCore::MediaSession::wirelessRoutesAvailableDidChange): Deleted.
2458         * platform/audio/MediaSession.h:
2459         (WebCore::MediaSession::didChoosePlaybackTarget):
2460         (WebCore::MediaSession::externalOutputDeviceAvailableDidChange):
2461         (WebCore::MediaSession::requiresPlaybackTargetRouteMonitoring):
2462         (WebCore::MediaSessionClient::setWirelessPlaybackTarget):
2463         * platform/audio/MediaSessionManager.cpp:
2464         (WebCore::MediaSessionManager::wirelessRoutesAvailableChanged): Deleted.
2465         * platform/audio/MediaSessionManager.h:
2466         (WebCore::MediaSessionManager::configureWireLessTargetMonitoring):
2467         * platform/audio/ios/MediaSessionManagerIOS.h:
2468         * platform/audio/ios/MediaSessionManagerIOS.mm:
2469         (WebCore::MediaSessionManageriOS::externalOutputDeviceAvailableDidChange):
2470         (-[WebMediaSessionHelper wirelessRoutesAvailableDidChange:]):
2471         * platform/graphics/AVPlaybackTarget.h: Added.
2472         (WebCore::AVPlaybackTarget::~AVPlaybackTarget):
2473         (WebCore::AVPlaybackTarget::AVPlaybackTarget):
2474         (WebCore::AVPlaybackTarget::setDevicePickerContext):
2475         (WebCore::AVPlaybackTarget::devicePickerContext):
2476         * platform/graphics/AVPlaybackTargetPickerClient.h: Added.
2477         (WebCore::AVPlaybackTargetPickerClient::~AVPlaybackTargetPickerClient):
2478         * platform/graphics/MediaPlayer.cpp:
2479         (WebCore::MediaPlayer::setWirelessPlaybackTarget):
2480         * platform/graphics/MediaPlayer.h:
2481         * platform/graphics/MediaPlayerPrivate.h:
2482         (WebCore::MediaPlayerPrivateInterface::setWirelessPlaybackTarget):
2483         * platform/graphics/avfoundation/AVPlaybackTargetMac.mm: Added.
2484         (WebCore::AVPlaybackTarget::encode):
2485         (WebCore::AVPlaybackTarget::decode):
2486         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
2487         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2488         (WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad):
2489         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer):
2490         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenLayer):
2491         (WebCore::MediaPlayerPrivateAVFoundationObjC::isCurrentPlaybackTargetWireless):
2492         (WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessPlaybackTargetType):
2493         (WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessVideoPlaybackDisabled):
2494         (WebCore::MediaPlayerPrivateAVFoundationObjC::setWirelessVideoPlaybackDisabled):
2495         (WebCore::MediaPlayerPrivateAVFoundationObjC::setWirelessPlaybackTarget):
2496         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateDisableExternalPlayback):
2497         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
2498
2499 2015-03-11  Alex Christensen  <achristensen@webkit.org>
2500
2501         [Content Extensions] Add resource type and load type triggers.
2502         https://bugs.webkit.org/show_bug.cgi?id=142422
2503
2504         Reviewed by Benjamin Poulain.
2505
2506         New API tests.
2507
2508         * WebCore.xcodeproj/project.pbxproj:
2509         * contentextensions/ContentExtensionCompiler.cpp:
2510         (WebCore::ContentExtensions::compileRuleList):
2511         * contentextensions/ContentExtensionParser.cpp:
2512         (WebCore::ContentExtensions::getTypeFlags):
2513         (WebCore::ContentExtensions::loadTrigger):
2514         * contentextensions/ContentExtensionRule.h:
2515         * contentextensions/ContentExtensionsBackend.cpp:
2516         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
2517         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForURL): Deleted.
2518         * contentextensions/ContentExtensionsBackend.h:
2519         * contentextensions/DFABytecode.h:
2520         (WebCore::ContentExtensions::instructionSizeWithArguments):
2521         * contentextensions/DFABytecodeCompiler.cpp:
2522         (WebCore::ContentExtensions::DFABytecodeCompiler::emitAppendConditionalAction):
2523         (WebCore::ContentExtensions::DFABytecodeCompiler::compileNode):
2524         * contentextensions/DFABytecodeCompiler.h:
2525         * contentextensions/DFABytecodeInterpreter.cpp:
2526         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
2527         * contentextensions/DFABytecodeInterpreter.h:
2528         * loader/ResourceLoadInfo.cpp: Added.
2529         (WebCore::toResourceType):
2530         (WebCore::readResourceType):
2531         (WebCore::readLoadType):
2532         (WebCore::ResourceLoadInfo::isThirdParty):
2533         (WebCore::ResourceLoadInfo::getResourceFlags):
2534         * loader/ResourceLoadInfo.h: Added.
2535         * loader/cache/CachedResourceLoader.cpp:
2536         (WebCore::CachedResourceLoader::requestResource):
2537         * page/UserContentController.cpp:
2538         (WebCore::UserContentController::actionsForResourceLoad):
2539         (WebCore::UserContentController::actionsForURL): Deleted.
2540         * page/UserContentController.h:
2541
2542 2015-03-11  Tim Horton  <timothy_horton@apple.com>
2543
2544         Fix the build.
2545
2546         * page/EventHandler.cpp:
2547         (WebCore::EventHandler::selectClosestWordFromHitTestResult):
2548         (WebCore::EventHandler::selectClosestWordOrLinkFromMouseEvent):
2549         (WebCore::EventHandler::handleMousePressEventTripleClick):
2550         (WebCore::EventHandler::handleMousePressEventSingleClick):
2551
2552 2015-03-11  Timothy Horton  <timothy_horton@apple.com>
2553
2554         <attachment> shouldn't use "user-select: all"
2555         https://bugs.webkit.org/show_bug.cgi?id=142453
2556
2557         Reviewed by Darin Adler.
2558
2559         It turns out that "user-select: all" is rife with bugs; in lieu of fixing them
2560         all (at least for now), let's not use "user-select: all" in the default stylesheet
2561         for <attachment>. It's really overkill anyway, since <attachment> can't have children.
2562         The only "user-select: all" behavior we actually want is select-on-click.
2563         So, we'll implement that in a slightly different way.
2564
2565         Tests: fast/attachment/attachment-select-on-click-inside-user-select-all.html
2566                fast/attachment/attachment-select-on-click.html
2567
2568         * css/html.css:
2569         (attachment):
2570         No more "user-select: all".
2571
2572         (attachment:focus): Deleted.
2573         We stopped using attachment focus a while back and forgot to remove this.
2574
2575         * dom/Node.h:
2576         (WebCore::Node::shouldSelectOnMouseDown):
2577         Add a virtual function that Node subclasses can override to indicate they
2578         should be selected on mouse down.
2579
2580         * html/HTMLAttachmentElement.h:
2581         Override the aforementioned virtual function; <attachment> should always
2582         be selected on mouse down.
2583
2584         * page/EventHandler.cpp:
2585         (WebCore::nodeToSelectOnMouseDownForNode):
2586         Determine which node should be selected when a mousedown hits the given node.
2587         If there's any "user-select: all", we go with the outermost "user-select: all".
2588         Otherwise, we give the node a chance to say that it wants to be selected itself.
2589
2590         (WebCore::expandSelectionToRespectSelectOnMouseDown):
2591         Rename this function, it's not just about "user-select: all" anymore.
2592         Make use of nodeToSelectOnMouseDownForNode.
2593
2594         (WebCore::EventHandler::selectClosestWordFromHitTestResult):
2595         (WebCore::EventHandler::selectClosestWordOrLinkFromMouseEvent):
2596         (WebCore::EventHandler::handleMousePressEventTripleClick):
2597         (WebCore::EventHandler::handleMousePressEventSingleClick):
2598         (WebCore::expandSelectionToRespectUserSelectAll): Deleted.
2599         Adjust to the new names.
2600
2601 2015-03-11  Geoffrey Garen  <ggaren@apple.com>
2602
2603         Users of Heap::deprecatedReportExtraMemory should switch to reportExtraMemoryAllocated+reportExtraMemoryVisited
2604         https://bugs.webkit.org/show_bug.cgi?id=142595
2605
2606         Reviewed by Andreas Kling.
2607
2608         Fixed this bug for canvas.
2609
2610         * html/HTMLCanvasElement.cpp:
2611         (WebCore::HTMLCanvasElement::memoryCost): Factored out the helper function
2612         required by our IDL generator.
2613
2614         (WebCore::HTMLCanvasElement::createImageBuffer): Use
2615         reportExtraMemoryAllocated.
2616
2617         * html/HTMLCanvasElement.h:
2618
2619         * html/HTMLCanvasElement.idl: Adopt the IDL for reporting cost in the
2620         right way during GC. This will match our reportExtraMemoryAllocated
2621         with a reportExtraMemoryVisited during GC.
2622
2623 2015-03-11  Roger Fong  <roger_fong@apple.com>
2624
2625         A number of minor edits to the media controls on OSX.
2626         https://bugs.webkit.org/show_bug.cgi?id=142551.
2627         <rdar://problem/20114707>
2628
2629         Reviewed by Darin Adler.
2630
2631         This covers a slew of minor edits to the new media controls. They are as follows.
2632         Small vertical placements adjustments to inline control elements.
2633         Make sure buttons have no focus outlines.
2634         Expand height of mute box that triggers the volume panel appearing.
2635         Turn all button colors into an slightly transparent white.
2636         Center status display text in fullscreen mode.
2637         Lower position of captions container in fullscreen mode.
2638         Show the controls on when done loading of the video an status display is hidden.
2639
2640         * Modules/mediacontrols/mediaControlsApple.css:
2641         (audio::-webkit-media-controls-panel):
2642         (audio::-webkit-media-controls-panel button:focus):
2643         (audio::-webkit-media-controls-rewind-button):
2644         (audio::-webkit-media-controls-play-button):
2645         (audio::-webkit-media-controls-play-button.paused):
2646         (audio::-webkit-media-controls-panel .mute-box):
2647         (video::-webkit-media-controls-volume-max-button):
2648         (audio::-webkit-media-controls-panel .volume-box):
2649         (video::-webkit-media-controls-volume-min-button):
2650         (audio::-webkit-media-controls-wireless-playback-picker-button):
2651         (audio::-webkit-media-controls-toggle-closed-captions-button):
2652         (audio::-webkit-media-controls-closed-captions-container li.selected:hover::before):
2653         (audio::-webkit-media-controls-fullscreen-button):
2654         (audio::-webkit-media-controls-fullscreen-button.exit):
2655         (audio::-webkit-media-controls-status-display):
2656         (audio::-webkit-media-controls-time-remaining-display):
2657         (video:-webkit-full-screen::-webkit-media-controls-panel .volume-box):
2658         (video:-webkit-full-screen::-webkit-media-controls-volume-max-button):
2659         (video:-webkit-full-screen::-webkit-media-controls-volume-min-button):
2660         (video:-webkit-full-screen::-webkit-media-controls-play-button):
2661         (video:-webkit-full-screen::-webkit-media-controls-play-button.paused):
2662         (video:-webkit-full-screen::-webkit-media-controls-seek-back-button):
2663         (video:-webkit-full-screen::-webkit-media-controls-seek-forward-button):
2664         (video:-webkit-full-screen::-webkit-media-controls-status-display):
2665         (video:-webkit-full-screen::-webkit-media-controls-closed-captions-container):
2666         (audio::-webkit-media-controls-panel button:active): Deleted.
2667         * Modules/mediacontrols/mediaControlsApple.js:
2668         (Controller.prototype.setStatusHidden):
2669
2670 2015-03-11  Commit Queue  <commit-queue@webkit.org>
2671
2672         Unreviewed, rolling out r179340 and r179344.
2673         https://bugs.webkit.org/show_bug.cgi?id=142598
2674
2675         Caused images to stay alive forever when navigating away from
2676         the page before they finish loading. (Requested by kling on
2677         #webkit).
2678
2679         Reverted changesets:
2680
2681         "CachedImage: ensure clients overrides imageChanged instead of
2682         notifyFinished"
2683         https://bugs.webkit.org/show_bug.cgi?id=140722
2684         http://trac.webkit.org/changeset/179340
2685
2686         "HTMLImageLoader: fix build failure on assert condition after
2687         r179340"
2688         https://bugs.webkit.org/show_bug.cgi?id=140722
2689         http://trac.webkit.org/changeset/179344
2690
2691 2015-03-11  Geoffrey Garen  <ggaren@apple.com>
2692
2693         Many users of Heap::reportExtraMemory* are wrong, causing lots of memory growth
2694         https://bugs.webkit.org/show_bug.cgi?id=142593
2695
2696         Reviewed by Andreas Kling.
2697
2698         Adopt deprecatedReportExtraMemory as a short-term fix for runaway
2699         memory growth in these cases where we have not adopted
2700         reportExtraMemoryVisited.
2701
2702         Long-term, we should use reportExtraMemoryAllocated+reportExtraMemoryVisited.
2703         That's tracked by https://bugs.webkit.org/show_bug.cgi?id=142595.
2704
2705         Using IOSDebug, I can see that the canvas stress test @ http://jsfiddle.net/fvyw4ba0/,
2706         which used to keep > 1000 1MB NonVolatile GPU allocations live, now keeps about 10 live.
2707
2708         * Modules/mediasource/SourceBuffer.cpp:
2709         (WebCore::SourceBuffer::reportExtraMemoryAllocated):
2710         * bindings/js/JSDocumentCustom.cpp:
2711         (WebCore::toJS):
2712         * bindings/js/JSImageDataCustom.cpp:
2713         (WebCore::toJS):
2714         * bindings/js/JSNodeListCustom.cpp:
2715         (WebCore::createWrapper):
2716         * dom/CollectionIndexCache.cpp:
2717         (WebCore::reportExtraMemoryAllocatedForCollectionIndexCache):
2718         * html/HTMLCanvasElement.cpp:
2719         (WebCore::HTMLCanvasElement::createImageBuffer):
2720         * html/HTMLImageLoader.cpp:
2721         (WebCore::HTMLImageLoader::imageChanged):
2722         * html/HTMLMediaElement.cpp:
2723         (WebCore::HTMLMediaElement::parseAttribute):
2724         * xml/XMLHttpRequest.cpp:
2725         (WebCore::XMLHttpRequest::dropProtection):
2726
2727 2015-03-10  Andy Estes  <aestes@apple.com>
2728
2729         REGRESSION (r180985): contentfiltering/block-after-add-data.html crashes with GuardMalloc
2730         https://bugs.webkit.org/show_bug.cgi?id=142526
2731
2732         Reviewed by Darin Adler.
2733
2734         * loader/DocumentLoader.cpp:
2735         (WebCore::DocumentLoader::dataReceived): Don't delete m_contentFilter until after we're done using its replacement data.
2736
2737 2015-03-10  Sam Weinig  <sam@webkit.org>
2738
2739         Allow adding a button in input elements for auto fill related functionality
2740         <rdar://problem/19782066>
2741         https://bugs.webkit.org/show_bug.cgi?id=142564
2742
2743         Reviewed by Anders Carlsson.
2744
2745         Test: fast/forms/input-auto-fill-button.html
2746
2747         - Adds a new button that can be shown in <input> elements - AutoFillButtonElement.
2748         - Makes the spelling of AutoFill consistent throughout WebCore and WebKit (except
2749           where not feasible due to exported API/SPI).
2750
2751         * CMakeLists.txt:
2752         * WebCore.vcxproj/WebCore.vcxproj:
2753         * WebCore.vcxproj/WebCore.vcxproj.filters:
2754         * WebCore.xcodeproj/project.pbxproj:
2755         Add new files.
2756
2757         * css/html.css:
2758         (input::-webkit-auto-fill-button):
2759         (input::-webkit-auto-fill-button:hover):
2760         (input::-webkit-auto-fill-button:active):
2761         Add default style rules for the AutoFill button based on the ones
2762         used for caps lock indicator.
2763
2764         * html/HTMLInputElement.cpp:
2765         (WebCore::HTMLInputElement::HTMLInputElement):
2766         (WebCore::HTMLInputElement::autoFillButtonElement):
2767         (WebCore::HTMLInputElement::reset):
2768         (WebCore::HTMLInputElement::setValueFromRenderer):
2769         (WebCore::HTMLInputElement::setAutoFilled):
2770         (WebCore::HTMLInputElement::setShowAutoFillButton):
2771         (WebCore::HTMLInputElement::setAutofilled): Deleted.
2772         * html/HTMLInputElement.h:
2773         (WebCore::HTMLInputElement::isAutoFilled):
2774         (WebCore::HTMLInputElement::showAutoFillButton):
2775         (WebCore::HTMLInputElement::isAutofilled): Deleted.
2776         Add new bit to represent whether the AutoFill button should be shown
2777         or not. By default it is not shown, and the client must enable it.
2778
2779         * html/InputType.cpp:
2780         (WebCore::InputType::updateAutoFillButton):
2781         * html/InputType.h:
2782         (WebCore::InputType::autoFillButtonElement):
2783         Add new virtual methods for updating and accessing the AutoFill button.
2784
2785         * html/TextFieldInputType.cpp:
2786         (WebCore::TextFieldInputType::createShadowSubtree):
2787         (WebCore::TextFieldInputType::autoFillButtonElement):
2788         (WebCore::TextFieldInputType::destroyShadowSubtree):
2789         (WebCore::TextFieldInputType::updatePlaceholderText):
2790         (WebCore::TextFieldInputType::shouldDrawAutoFillButton):
2791         (WebCore::TextFieldInputType::autoFillButtonElementWasClicked):
2792         (WebCore::TextFieldInputType::createContainer):
2793         (WebCore::TextFieldInputType::createAutoFillButton):
2794         (WebCore::TextFieldInputType::updateAutoFillButton):
2795         * html/TextFieldInputType.h:
2796         Add support for adding the AutoFill to the shadow DOM of textfields. The implementation
2797         is slightly different than for the caps lock indicator, because I didn't want to force
2798         the creation of a container for all <input> elements just in case an AutoFill button was
2799         added. Instead, if an AutoFill button is added, the container is created on the fly and
2800         the existing DOM is updated to move into it. Once a container is created, it is never
2801         removed.
2802
2803         * html/shadow/AutoFillButtonElement.cpp: Added.
2804         (WebCore::AutoFillButtonElement::create):
2805         (WebCore::AutoFillButtonElement::AutoFillButtonElement):
2806         (WebCore::AutoFillButtonElement::defaultEventHandler):
2807         * html/shadow/AutoFillButtonElement.h: Added.
2808         Add div subclass that swallows the click event and forwards it to the ChromeClient.
2809
2810         * page/ChromeClient.h:
2811         Add handleAutoFillButtonClick client function to inform WebKit that the AutoFill
2812         button was clicked.
2813
2814         * testing/Internals.cpp:
2815         (WebCore::Internals::setAutofilled):
2816         (WebCore::Internals::setShowAutoFillButton):
2817         * testing/Internals.h:
2818         * testing/Internals.idl:
2819         Expose a new internals.setShowAutoFillButton() function to allow testing
2820         of the AutoFill button from layout tests.
2821
2822         * accessibility/AccessibilityObject.cpp:
2823         (WebCore::AccessibilityObject::isValueAutofilled):
2824         * css/SelectorCheckerTestFunctions.h:
2825         (WebCore::isAutofilled):
2826         * css/StyleResolver.cpp:
2827         (WebCore::StyleResolver::canShareStyleWithControl):
2828         Update for new spelling of AutoFill.
2829
2830 2015-03-11  Geoffrey Garen  <ggaren@apple.com>
2831
2832         Refactored the JSC::Heap extra cost API for clarity and to make some known bugs more obvious
2833         https://bugs.webkit.org/show_bug.cgi?id=142589
2834
2835         Reviewed by Andreas Kling.
2836
2837         Updated for renames to JSC extra cost APIs.
2838
2839         Added FIXMEs to our 10 use cases that are currently wrong, including
2840         canvas, which is the cause of https://bugs.webkit.org/show_bug.cgi?id=142457.
2841
2842         * Modules/mediasource/SourceBuffer.cpp:
2843         (WebCore::SourceBuffer::appendBufferInternal):
2844         (WebCore::SourceBuffer::sourceBufferPrivateAppendComplete):
2845         (WebCore::SourceBuffer::reportExtraMemoryAllocated):
2846         (WebCore::SourceBuffer::reportExtraMemoryCost): Deleted.
2847         * Modules/mediasource/SourceBuffer.h:
2848         * bindings/js/JSDocumentCustom.cpp:
2849         (WebCore::toJS):
2850         * bindings/js/JSImageDataCustom.cpp:
2851         (WebCore::toJS):
2852         * bindings/js/JSNodeListCustom.cpp:
2853         (WebCore::createWrapper):
2854         * bindings/scripts/CodeGeneratorJS.pm:
2855         (GenerateImplementation):
2856         * dom/CollectionIndexCache.cpp:
2857         (WebCore::reportExtraMemoryAllocatedForCollectionIndexCache):
2858         (WebCore::reportExtraMemoryCostForCollectionIndexCache): Deleted.
2859         * dom/CollectionIndexCache.h:
2860         (WebCore::Iterator>::computeNodeCountUpdatingListCache):
2861         * html/HTMLCanvasElement.cpp:
2862         (WebCore::HTMLCanvasElement::createImageBuffer):
2863         * html/HTMLCollection.h:
2864         (WebCore::CollectionNamedElementCache::didPopulate):
2865         * html/HTMLImageLoader.cpp:
2866         (WebCore::HTMLImageLoader::imageChanged):
2867         * html/HTMLMediaElement.cpp:
2868         (WebCore::HTMLMediaElement::parseAttribute):
2869         * xml/XMLHttpRequest.cpp:
2870         (WebCore::XMLHttpRequest::dropProtection):
2871
2872 2015-03-11  Benjamin Poulain  <bpoulain@apple.com>
2873
2874         Add basic support for BOL and EOL assertions to the URL Filter parser
2875         https://bugs.webkit.org/show_bug.cgi?id=142568
2876
2877         Reviewed by Alex Christensen.
2878
2879         This patch adds heavily restricted support for BOL and EOL to the URL filter parser.
2880
2881         Both assertions must be the first/last term of their pattern. Any advanced combination
2882         results in a parsing error.
2883
2884         The BOL assertion is easy to represent: currently, any pattern starts at the beginning
2885         of a line and the NFA are generated accordingly.
2886
2887         I had two options to represent the EOL assertion:
2888         1) Add a new special transition on EOL.
2889         2) Add a new vector of actions to the states, conditional to the EOL input.
2890
2891         I picked the first option to avoid growing every state by a vector
2892         that would be empty in the vast majority of cases.
2893
2894
2895         On the matching side, the interpreter was modified to support transitions on '\0'.
2896         DFABytecodeInstruction::CheckValue now stops when running on a character after
2897         the end of the string.
2898
2899         DFABytecodeInstruction::Jump gets two fixes: First we now account for the index
2900         to avoid going past the end of the input. Second, stop on '\0' too... the reason
2901         is that the unconditional jump is only used for fallback edges of the DFA, fallback
2902         edge are not supposed to accept '\0'.
2903
2904         * contentextensions/DFA.cpp:
2905         (WebCore::ContentExtensions::printTransitions):
2906         * contentextensions/DFABytecodeInterpreter.cpp:
2907         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
2908         * contentextensions/DFANode.h:
2909         * contentextensions/NFA.cpp:
2910         (WebCore::ContentExtensions::NFA::addTransition):
2911         (WebCore::ContentExtensions::NFA::addEpsilonTransition):
2912         (WebCore::ContentExtensions::printTransitions):
2913         * contentextensions/NFANode.h:
2914         * contentextensions/NFAToDFA.cpp:
2915         (WebCore::ContentExtensions::populateTransitions):
2916         (WebCore::ContentExtensions::NFAToDFA::convert):
2917         * contentextensions/URLFilterParser.cpp:
2918         (WebCore::ContentExtensions::Term::Term):
2919         (WebCore::ContentExtensions::Term::isEndOfLineAssertion):
2920         (WebCore::ContentExtensions::GraphBuilder::assertionBOL):
2921         (WebCore::ContentExtensions::GraphBuilder::assertionEOL):
2922         (WebCore::ContentExtensions::GraphBuilder::sinkFloatingTermIfNecessary):
2923
2924 2015-03-11  Jer Noble  <jer.noble@apple.com>
2925
2926         [Mac] Update fullscreen placeholder UI to use Vibrancy.
2927         https://bugs.webkit.org/show_bug.cgi?id=142586
2928
2929         Reviewed by Eric Carlson.
2930
2931         Update the fullscreen placeholder with a translucent vibrant appearance
2932         using NSVisualEffectView. Since NSVisuaEffectView is only available for
2933         OS X 10.10 and above, wrap the new implementation in a version check and
2934         retain the old implementation.
2935
2936         Drive-by: Update the strings for the placeholder view with new HI guidance
2937         as well.
2938
2939         * English.lproj/Localizable.strings:
2940         * platform/LocalizedStrings.cpp:
2941         (WebCore::clickToExitFullScreenText):
2942         * platform/mac/WebCoreFullScreenPlaceholderView.h:
2943         * platform/mac/WebCoreFullScreenPlaceholderView.mm:
2944         (-[WebCoreFullScreenPlaceholderView setExitWarningVisible:]):
2945
2946 2015-03-11  Timothy Horton  <timothy_horton@apple.com>
2947
2948         Make it possible to zoom on pages that claim to lay out to device size and then fail to do so
2949         https://bugs.webkit.org/show_bug.cgi?id=142549
2950
2951         Reviewed by Simon Fraser.
2952
2953         * page/ViewportConfiguration.cpp:
2954         (WebCore::ViewportConfiguration::ViewportConfiguration):
2955         Rename m_ignoreScalingConstraints to m_canIgnoreScalingConstraints,
2956         because it being true does not guarantee that we will ignore scaling constraints,
2957         but it being false does guarantee that we won't.
2958
2959         (WebCore::ViewportConfiguration::shouldIgnoreScalingConstraints):
2960         Ignore scaling constraints if the page:
2961             a) claimed to want to lay out to device-width and then laid out too wide
2962             b) claimed to want to lay out to device-height and then laid out too tall
2963             c) claimed to want to lay out with initialScale=1 and then laid out too wide
2964
2965         (WebCore::ViewportConfiguration::initialScale):
2966         (WebCore::ViewportConfiguration::minimumScale):
2967         (WebCore::ViewportConfiguration::allowsUserScaling):
2968         Call shouldIgnoreScalingConstraints() instead of looking at the local, so we can
2969         have some more logic here (as above).
2970
2971         (WebCore::ViewportConfiguration::description):
2972         Dump whether we're ignoring scaling constraints.
2973
2974         (WebCore::ViewportConfiguration::dump):
2975         Use WTFLogAlways so that the output goes to various other logging mechanisms
2976         instead of just stderr.
2977
2978         * page/ViewportConfiguration.h:
2979         (WebCore::ViewportConfiguration::setCanIgnoreScalingConstraints):
2980         (WebCore::ViewportConfiguration::setIgnoreScalingConstraints): Deleted.
2981
2982 2015-03-11  Myles C. Maxfield  <mmaxfield@apple.com>
2983
2984         Use out-of-band messaging for RenderBox::firstLineBaseline() and RenderBox::inlineBlockBaseline()
2985         https://bugs.webkit.org/show_bug.cgi?id=142569
2986
2987         Reviewed by David Hyatt.
2988
2989         Currently, RenderBox::firstLineBaseline() and RenderBox::inlineBlockBaseline() return -1 to mean
2990         that its baseline should be skipped. Instead of using this sentinel value, this patch changes the
2991         return type from int to Optional<int>.
2992
2993         No new tests because there is no behavior change.
2994
2995         * rendering/RenderBlock.cpp:
2996         (WebCore::RenderBlock::baselinePosition):
2997         (WebCore::RenderBlock::firstLineBaseline):
2998         (WebCore::RenderBlock::inlineBlockBaseline):
2999         * rendering/RenderBlock.h:
3000         * rendering/RenderBlockFlow.cpp:
3001         (WebCore::RenderBlockFlow::firstLineBaseline):
3002         (WebCore::RenderBlockFlow::inlineBlockBaseline):
3003         * rendering/RenderBlockFlow.h:
3004         * rendering/RenderBox.h:
3005         (WebCore::RenderBox::firstLineBaseline):
3006         (WebCore::RenderBox::inlineBlockBaseline):
3007         * rendering/RenderDeprecatedFlexibleBox.cpp:
3008         (WebCore::RenderDeprecatedFlexibleBox::layoutHorizontalBox):
3009         * rendering/RenderFlexibleBox.cpp:
3010         (WebCore::RenderFlexibleBox::baselinePosition):
3011         (WebCore::RenderFlexibleBox::firstLineBaseline):
3012         (WebCore::RenderFlexibleBox::inlineBlockBaseline):
3013         (WebCore::RenderFlexibleBox::marginBoxAscentForChild):
3014         * rendering/RenderFlexibleBox.h:
3015         * rendering/RenderMenuList.h:
3016         * rendering/RenderTable.cpp:
3017         (WebCore::RenderTable::cellAbove):
3018         (WebCore::RenderTable::cellBelow):
3019         (WebCore::RenderTable::cellBefore):
3020         (WebCore::RenderTable::cellAfter):
3021         (WebCore::RenderTable::firstLineBlock):
3022         (WebCore::RenderTable::baselinePosition):
3023         (WebCore::RenderTable::inlineBlockBaseline):
3024         (WebCore::RenderTable::firstLineBaseline):
3025         * rendering/RenderTable.h:
3026         * rendering/RenderTableCell.cpp:
3027         (WebCore::RenderTableCell::cellBaselinePosition):
3028         * rendering/RenderTableSection.cpp:
3029         (WebCore::RenderTableSection::firstLineBaseline):
3030         * rendering/RenderTableSection.h:
3031         * rendering/RenderTextControl.h:
3032         * rendering/mathml/RenderMathMLBlock.cpp:
3033         (WebCore::RenderMathMLBlock::baselinePosition):
3034         (WebCore::RenderMathMLTable::firstLineBaseline):
3035         * rendering/mathml/RenderMathMLBlock.h:
3036         * rendering/mathml/RenderMathMLFraction.cpp:
3037         (WebCore::RenderMathMLFraction::firstLineBaseline):
3038         * rendering/mathml/RenderMathMLFraction.h:
3039         * rendering/mathml/RenderMathMLOperator.cpp:
3040         (WebCore::RenderMathMLOperator::firstLineBaseline):
3041         * rendering/mathml/RenderMathMLOperator.h:
3042         * rendering/mathml/RenderMathMLRoot.cpp:
3043         (WebCore::RenderMathMLRoot::firstLineBaseline):
3044         (WebCore::RenderMathMLRoot::layout):
3045         * rendering/mathml/RenderMathMLRoot.h:
3046         * rendering/mathml/RenderMathMLRow.cpp:
3047         (WebCore::RenderMathMLRow::layout):
3048         * rendering/mathml/RenderMathMLScripts.cpp:
3049         (WebCore::RenderMathMLScripts::layout):
3050         (WebCore::RenderMathMLScripts::firstLineBaseline):
3051         * rendering/mathml/RenderMathMLScripts.h:
3052         * rendering/mathml/RenderMathMLSpace.cpp:
3053         (WebCore::RenderMathMLSpace::firstLineBaseline):
3054         * rendering/mathml/RenderMathMLSpace.h:
3055         * rendering/mathml/RenderMathMLUnderOver.cpp:
3056         (WebCore::RenderMathMLUnderOver::firstLineBaseline):
3057         * rendering/mathml/RenderMathMLUnderOver.h:
3058
3059 2015-03-11  Timothy Horton  <timothy_horton@apple.com>
3060
3061         <attachment>s should be created when dropping files onto contentEditable areas
3062         https://bugs.webkit.org/show_bug.cgi?id=142494
3063         <rdar://problem/19982553>
3064
3065         Reviewed by Anders Carlsson.
3066
3067         Covered by existing tests.
3068
3069         * editing/mac/EditorMac.mm:
3070         (WebCore::Editor::WebContentReader::readFilenames):
3071         Instead of inserting the dropped URLs as strings, make an <attachment>
3072         for each.
3073
3074 2015-03-11  David Hyatt  <hyatt@apple.com>
3075
3076         Optimize offsetWidth and offsetHeight to avoid doing layouts.
3077         https://bugs.webkit.org/show_bug.cgi?id=142544
3078
3079         Reviewed by Beth Dakin.
3080
3081         * dom/Document.cpp:
3082         (WebCore::Document::updateLayoutIfDimensionsOutOfDate):
3083         * dom/Document.h:
3084         Added a new method that only updates layout if it determines that the desired dimensions are out
3085         of date.
3086
3087         * dom/Element.cpp:
3088         (WebCore::Element::offsetWidth):
3089         (WebCore::Element::offsetHeight):
3090         Patch offsetWidth and offsetHeight to call the new method rather than updateLayoutIgnorePendingStylesheets.
3091
3092 2015-03-11  Commit Queue  <commit-queue@webkit.org>
3093
3094         Unreviewed, rolling out r181367.
3095         https://bugs.webkit.org/show_bug.cgi?id=142581
3096
3097         Caused crashes on the debug bots (Requested by cdumez on
3098         #webkit).
3099
3100         Reverted changeset:
3101
3102         "Web Inspector: CSS parser errors in the console should
3103         include column numbers"
3104         https://bugs.webkit.org/show_bug.cgi?id=114313
3105         http://trac.webkit.org/changeset/181367
3106
3107 2015-03-11  Myles C. Maxfield  <mmaxfield@apple.com>
3108
3109         Inline block children do not have correct baselines if their children are also block elements
3110         https://bugs.webkit.org/show_bug.cgi?id=142559
3111
3112         Reviewed by Darin Adler.
3113
3114         Perform the same computation on child block elements as child inline elements.
3115
3116         Test: fast/text/baseline-inline-block-block-children.html
3117
3118         * rendering/RenderBlockFlow.cpp:
3119         (WebCore::RenderBlockFlow::inlineBlockBaseline):
3120
3121 2015-03-11  Carlos Alberto Lopez Perez  <clopez@igalia.com>
3122
3123         [CMake][GStreamer] Building EFL or GTK with ENABLE_VIDEO and without ENABLE_WEB_AUDIO is broken.
3124         https://bugs.webkit.org/show_bug.cgi?id=142577
3125
3126         Reviewed by Carlos Garcia Campos.
3127
3128         No new tests, this is a build fix.
3129
3130         * PlatformEfl.cmake: Include GSTREAMER_AUDIO_LIBRARIES on the link step both for ENABLE_VIDEO and ENABLE_WEB_AUDIO.
3131         * PlatformGTK.cmake: Idem.
3132
3133 2015-03-10  Philippe Normand  <pnormand@igalia.com>
3134
3135         Rename MediaStreamCenter to RealtimeMediaSourceCenter
3136         https://bugs.webkit.org/show_bug.cgi?id=142535
3137
3138         Reviewed by Eric Carlson.
3139
3140         As per bug title, rename MediaStreamCenter to
3141         RealtimeMediaSourceCenter, this class manages
3142         RealtimeMediaSources, not MediaStreams. Some un-needed includes of
3143         the header were also removed.
3144
3145 2015-03-11  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
3146
3147         Remove unnecessary create() factory functions
3148         https://bugs.webkit.org/show_bug.cgi?id=142558
3149
3150         Reviewed by Darin Adler.
3151
3152         create() function which just returns new instance can be replaced with std::make_unique<>.
3153
3154         No new tests, no behavior changes.
3155
3156         * bindings/js/JSCryptoKeySerializationJWK.cpp:
3157         (WebCore::JSCryptoKeySerializationJWK::keyDataOctetSequence):
3158         * crypto/keys/CryptoKeyAES.cpp:
3159         (WebCore::CryptoKeyAES::exportData):
3160         * crypto/keys/CryptoKeyDataOctetSequence.h:
3161         * crypto/keys/CryptoKeyHMAC.cpp:
3162         (WebCore::CryptoKeyHMAC::exportData):
3163         * crypto/keys/CryptoKeySerializationRaw.cpp:
3164         (WebCore::CryptoKeySerializationRaw::keyData):
3165         * platform/audio/mac/CARingBuffer.cpp:
3166         (WebCore::CARingBuffer::create): Deleted.
3167         * platform/audio/mac/CARingBuffer.h:
3168         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
3169         (WebCore::AudioSourceProviderAVFObjC::prepare):
3170         * testing/Internals.cpp:
3171         (WebCore::Internals::queueMicroTask):
3172         * testing/MicroTaskTest.cpp:
3173         (WebCore::MicroTaskTest::create): Deleted.
3174         * testing/MicroTaskTest.h:
3175         (WebCore::MicroTaskTest::MicroTaskTest):
3176
3177 2015-03-10  Joseph Pecoraro  <pecoraro@apple.com>
3178
3179         Web Inspector: CSS parser errors in the console should include column numbers
3180         https://bugs.webkit.org/show_bug.cgi?id=114313
3181
3182         Reviewed by Benjamin Poulain.
3183
3184         Test: inspector-protocol/console/warnings-errors.html
3185
3186         * css/CSSParser.h:
3187         (WebCore::CSSParser::currentCharacterOffset):
3188         Get the current character offset depending on the source type.
3189         Add instance variables to track column position and start
3190         line / column for inline stylesheets.
3191
3192         * css/CSSParser.cpp:
3193         (WebCore::CSSParser::CSSParser):
3194         (WebCore::CSSParser::parseSheet):
3195         Initialize new instance variables.
3196
3197         (WebCore::CSSParser::currentLocation):
3198         Update to include column information. Also, if we are on the first line
3199         we may need to take into account a start column offset as well.
3200
3201         (WebCore::CSSParser::realLex):
3202         When bumping the line number, reset the column offset for the next
3203         line with the next character.
3204
3205         (WebCore::CSSParser::syntaxError):
3206         (WebCore::CSSParser::logError):
3207         Include column information.
3208
3209         * css/StyleSheetContents.cpp:
3210         (WebCore::StyleSheetContents::parseAuthorStyleSheet):
3211         (WebCore::StyleSheetContents::parseString):
3212         (WebCore::StyleSheetContents::parseStringAtLineAndColumn):
3213         Include column information.
3214
3215         * css/StyleSheetContents.h:
3216         * dom/InlineStyleSheetOwner.cpp:
3217         (WebCore::InlineStyleSheetOwner::InlineStyleSheetOwner):
3218         (WebCore::InlineStyleSheetOwner::createSheet):
3219         Save and use column information later on.
3220
3221         * dom/InlineStyleSheetOwner.h:
3222         * inspector/InspectorStyleSheet.cpp:
3223         (WebCore::InspectorStyleSheet::ensureSourceData):
3224         Updated parser signature needs starting column and no longer has optional parameters.
3225
3226 2015-03-10  Darin Adler  <darin@apple.com>
3227
3228         Try to fix the GTK build.
3229
3230         * html/HTMLVideoElement.idl: Work around gobject bindings generator limitation
3231         by putting in a LANGUAGE_GOBJECT conditional.
3232
3233 2015-03-10  Darin Adler  <darin@apple.com>
3234
3235         Some event handler fixes
3236         https://bugs.webkit.org/show_bug.cgi?id=142474
3237
3238         Reviewed by Anders Carlsson.
3239
3240         * bindings/scripts/CodeGenerator.pm:
3241         (GenerateConditionalStringFromAttributeValue): Improved the algorithm here to
3242         handle combinations of & and | in conditional expressions; that's coming up when
3243         combining conditionals for includes in NavigatorContentUtils.idl.
3244
3245         * bindings/scripts/CodeGeneratorJS.pm:
3246         (AddToImplIncludes): Removed the rudimentary attempt to split and merge
3247         conditionals involving | here; instead we rely on the rules in the
3248         GenerateConditionalStringFromAttributeValue to handle this.
3249         (GenerateImplementation): Passed new "conditional" argument to JSValueToNative.
3250         (GenerateParametersCheck): Pass "conditional" argument to AddToImplIncludes and
3251         JSValueToNative.
3252         (JSValueToNative): Changed to take "conditional" as an argument, since getting
3253         it from the signature won't work for a method parameter.
3254         (WriteData): Merge duplicates based on the result of the
3255         GenerateConditionalStringFromAttributeValue function rather than on the values
3256         passed into that function, since that function converts conditionals into a
3257         canonical form and can make two strings equal that don't start out that way.
3258
3259         * bindings/scripts/CodeGeneratorObjC.pm:
3260         (SkipAttribute): Added code to guarantee we won't make Objective-C bindings
3261         for event handlers. We will rename EventListener to EventHandler in a
3262         subsequent patch.
3263
3264         * bindings/scripts/test/JS/JSTestInterface.cpp: Updated for a progression caused
3265         by the better logic for conditional includes.
3266
3267         * bindings/scripts/test/JS/JSTestObj.cpp: Updated for change to the test below.
3268         * bindings/scripts/test/TestObj.idl: Added test of an event handler attribute.
3269
3270         * dom/Document.idl: Removed unneeded language #if around event handler
3271         attributes. Removed all the commented out event handler attributes.
3272         Sorted event handler attributes into a single section rather than separating
3273         "standard" from "extensions". Sorted the conditional event handler attributes
3274         into paragraphs at the bottom. We will probably make them all unconditional
3275         in a subsequent patch.
3276
3277         * dom/Element.idl: Removed unneeded language #if around event handler
3278         attributes. Removed all the commented out event handler attributes.
3279         Moved event handler attributes here from all derived element classes to
3280         match the approach from the HTML standard. Also resorted the attributes
3281         as in Document above.
3282
3283         * html/HTMLBodyElement.idl: Removed unneeded language #if around event handler
3284         attributes. Removed all the commented out event handler attributes.
3285         Sorted event handler attributes into a single section rather than separating
3286         "standard" from "overrides".
3287
3288         * html/HTMLElement.cpp:
3289         (WebCore::HTMLElement::populateEventNameForAttributeLocalNameMap):
3290         Added a few missing attribute names, and re-sorted a bit. Moved any from
3291         element subclasses here.
3292
3293         * html/HTMLFormElement.cpp:
3294         (WebCore::HTMLFormElement::parseAttribute): Moved code to handle
3295         oncomplete and oncompleteerror to Element and HTMLElement.
3296         * html/HTMLFormElement.idl: Ditto.
3297
3298         * html/HTMLFrameSetElement.idl: Removed #if and resorted as above.
3299
3300         * html/HTMLInputElement.cpp:
3301         (WebCore::HTMLInputElement::parseAttribute): Moved code to handle
3302         onsearch to HTMLElement.
3303
3304         * html/HTMLMediaElement.cpp:
3305         (WebCore::HTMLMediaElement::parseAttribute): Moved code to handle
3306         all the event handler attributes to HTMLElement.
3307         (WebCore::HTMLMediaElement::updateCaptionContainer): Removed a redundant
3308         if statement I noticed while auditing all calls to JSC::call.
3309         (WebCore::HTMLMediaElement::didAddUserAgentShadowRoot): Added clearException.
3310         I noticed this was missing because a flawed earlier version of my patch was
3311         causing the script to fail, leaving an exception behind that caused an
3312         assertion later. So I audited all calls to JSC::call looking for this mistake.
3313
3314         * html/HTMLMediaElement.idl: Moved all the event handlers from here to
3315         Element. Also changed everything possible to use Conditional instead of #if.
3316
3317         * html/HTMLPlugInImageElement.cpp:
3318         (WebCore::HTMLPlugInImageElement::didAddUserAgentShadowRoot): Added
3319         clearException. Noticed it was missing while auditing all calls to JSC::call.
3320
3321         * html/HTMLVideoElement.cpp:
3322         (WebCore::HTMLVideoElement::parseAttribute): Moved event handler code to
3323         HTMLElement.
3324
3325         * html/HTMLVideoElement.idl: Moved event handler to Element.idl and use
3326         Conditional instead of #if.
3327
3328         * page/DOMWindow.idl: Use Conditional instead of #if and tidy up the event
3329         handlers section.
3330
3331         * svg/svgattrs.in: Remove six unused attribute names. Presumably used in
3332         some older scheme to implement event handlers but no longer used at all.
3333
3334 2015-03-10  Brent Fulgham  <bfulgham@apple.com>
3335
3336         CSS scroll-snap-destination and scroll-snap-coordinate are not honoring position values
3337         https://bugs.webkit.org/show_bug.cgi?id=142411
3338
3339         Reviewed by Simon Fraser.
3340
3341         Tested by css3/scroll-snap/scroll-snap-position-values.html.
3342
3343         Revise the CSSParser to recognize that scroll-snap-coordinates and scroll-snap-destination
3344         may be specified as positions, therefore allowing 'top', 'bottom', and 'center' for the Y axis,
3345         and 'left', 'right', and 'center' for the X axis.
3346
3347         Correct implementation to support calculated values for Scroll Snap Point markup. This required the
3348         Scroll Snap Point-specific LengthRepeat class to change its internal representation from a CSSPrimitiveValue
3349         to a regular CSSValue.
3350
3351         Add tests that these position labels, as well as combinations with percentages and pixel offsets
3352         are parsed properly.
3353
3354         * css/CSSComputedStyleDeclaration.cpp:
3355         (WebCore::scrollSnapDestination): Switch from 'percentageOrZoomAdjustedValue' to 'zoomAdjustedPixelValueForLength'
3356         when working with Length values. This is necessary to allow calculated results to be based on the proper default
3357         page dimensions.
3358         (WebCore::scrollSnapPoints): Ditto.
3359         (WebCore::scrollSnapCoordinates): Ditto.
3360         * css/CSSParser.cpp:
3361         (WebCore::CSSParser::parseScrollSnapPositions): Consolidated code for dealing with snap point
3362         positions.
3363         (WebCore::CSSParser::parseScrollSnapDestination): Revise to call new helper function.
3364         (WebCore::CSSParser::parseScrollSnapCoordinate): Ditto.
3365         (WebCore::CSSParser::parseFillPositionX): Rename as parsePositionX.
3366         (WebCore::CSSParser::parseFillPositionY): Rename as parsePositionY.
3367         (WebCore::CSSParser::parseFillProperty): Update to call renamed parsePosition{X|Y} methods.
3368         (WebCore::CSSParser::parseTransformOrigin): Ditto.
3369         (WebCore::CSSParser::parsePerspectiveOrigin): Ditto.
3370         * css/CSSParser.h:
3371         * css/LengthRepeat.h: Revise class to use a CSSValue, rather than a CSSPrimitiveValue, so that we can represent
3372         repeat values as calculations.
3373
3374 2015-03-10  Enrica Casucci  <enrica@apple.com>
3375
3376         Add support for more emoji with variation.
3377         https://bugs.webkit.org/show_bug.cgi?id=142548
3378         rdar://problem/20105008
3379
3380         Reviewed by Tim Horton.
3381
3382         Update ICU rules to support new emoji with variation.
3383
3384         Test: editing/selection/extend-by-character-007.html
3385
3386         * platform/text/TextBreakIterator.cpp:
3387         (WebCore::cursorMovementIterator):
3388
3389 2015-03-10  Alex Christensen  <achristensen@webkit.org>
3390