1 2015-03-15 Brent Fulgham <bfulgham@apple.com>
3 Scroll snap points are not supported on iframe content
4 https://bugs.webkit.org/show_bug.cgi?id=142582
5 <rdar://problem/20121319>
7 Tested by css3/scroll-snap/scroll-snap-iframe.html
9 Reviewed by Simon Fraser.
11 The scroll snap points were not being applied to the iframe contents because the code
12 that sets up the scroll snap point content is not called for iframes.
14 To correct this, we need to make sure the snap offsets are set during post-frame layout
15 for iframes. We also need to make sure (on Mac) that the scroll animator and timers are updated.
18 (WebCore::FrameView::performPostLayoutTasks): Call 'updateSnapOffsets' if the frame is not a
19 MainFrame. Also notify scroll animators they need to update their snap point settings.
21 2015-03-15 Simon Fraser <simon.fraser@apple.com>
23 Add the same is<RenderBox> test to KeyframeAnimation::computeExtentOfTransformAnimation()
24 that ImplicitAnimation::computeExtentOfTransformAnimation() has, and change the latter
25 to the more canonical is<RenderBox>() form.
27 Fixes an assertion in animations/animation-on-inline-crash.html
29 * page/animation/ImplicitAnimation.cpp:
30 (WebCore::ImplicitAnimation::computeExtentOfTransformAnimation):
31 * page/animation/KeyframeAnimation.cpp:
32 (WebCore::KeyframeAnimation::computeExtentOfTransformAnimation):
34 2015-03-15 Simon Fraser <simon.fraser@apple.com>
36 And another fix. Thanks to Hunseop Jeong for the fix.
38 * html/HTMLInputElement.cpp:
39 (WebCore::HTMLInputElement::runPostTypeUpdateTasks):
40 (WebCore::HTMLInputElement::didMoveToNewDocument):
42 2015-03-15 Simon Fraser <simon.fraser@apple.com>
44 Fix the touch-event build.
47 (WebCore::Document::didAddTouchEventHandler):
48 (WebCore::Document::didRemoveTouchEventHandler):
50 2015-03-15 Simon Fraser <simon.fraser@apple.com>
52 Reduce the side-effects of animations turning off overlap testing
53 https://bugs.webkit.org/show_bug.cgi?id=92791
55 Reviewed by Dean Jackson.
57 When a layer is running a transition or animation of the transform property,
58 we would simply disable overlap testing for later layers, which had the side-effect
59 of promoting lots of unrelated elements into layers temporarily.
61 Fix by maintaining overlap, but computing an overlap extent that takes the animation
64 Rotations are currently treated as full rotations. If an extent for the overlap is
65 hard to compute (e.g. 3d transforms, or matrix animations with a rotation component),
66 then we fall back to the current behavior.
68 Tests: compositing/layer-creation/mismatched-rotated-transform-animation-overlap.html
69 compositing/layer-creation/mismatched-rotated-transform-transition-overlap.html
70 compositing/layer-creation/mismatched-transform-transition-overlap.html
71 compositing/layer-creation/multiple-keyframes-animation-overlap.html
72 compositing/layer-creation/scale-rotation-animation-overlap.html
73 compositing/layer-creation/scale-rotation-transition-overlap.html
74 compositing/layer-creation/translate-animation-overlap.html
75 compositing/layer-creation/translate-scale-animation-overlap.html
76 compositing/layer-creation/translate-scale-transition-overlap.html
77 compositing/layer-creation/translate-transition-overlap.html
79 * page/animation/AnimationBase.cpp:
80 (WebCore::containsRotation):
81 (WebCore::AnimationBase::computeTransformedExtentViaTransformList): When we have matched
82 transform lists, we can map a rectangle through the various operations. Transform-origin
83 is used to shift the origin of the box first, and then unshift after. If we encounter
84 a rotation, for now assume it's a full rotation (a future patch could tighten this up).
85 (WebCore::AnimationBase::computeTransformedExtentViaMatrix): If we're using matrix
86 interpolation, we have to decompose the matrix to see if there's any rotation component,
87 and, if there is, fall back to current behavior.
88 * page/animation/AnimationBase.h:
89 * page/animation/AnimationController.cpp:
90 (WebCore::AnimationControllerPrivate::computeExtentOfAnimation):
91 (WebCore::AnimationController::computeExtentOfAnimation):
92 * page/animation/AnimationController.h:
93 * page/animation/AnimationControllerPrivate.h:
94 * page/animation/CompositeAnimation.cpp:
95 (WebCore::CompositeAnimation::computeExtentOfTransformAnimation): Ask active keyframe
96 animations and transitions to compute the bounds extent.
97 * page/animation/CompositeAnimation.h:
98 * page/animation/ImplicitAnimation.cpp:
99 (WebCore::ImplicitAnimation::computeExtentOfTransformAnimation): Compute the extent
100 of the start and end transforms, and union them.
101 * page/animation/ImplicitAnimation.h:
102 * page/animation/KeyframeAnimation.cpp:
103 (WebCore::KeyframeAnimation::animate):
104 (WebCore::KeyframeAnimation::getAnimatedStyle): Some nullptr goodness.
105 (WebCore::KeyframeAnimation::computeExtentOfTransformAnimation): Compute an extent
106 for each keyframe, and take their union.
107 * page/animation/KeyframeAnimation.h:
108 * platform/graphics/GeometryUtilities.cpp:
109 (WebCore::euclidianDistance): Use Pythagoras to compute a distance.
110 (WebCore::boundsOfRotatingRect): Given a rect whose location is relative
111 to the rotation origin, compute a bounds for the rotated rect by computing
112 the furthest corner from the origin, and sweeping out a circle.
113 * platform/graphics/GeometryUtilities.h:
114 * platform/graphics/transforms/Matrix3DTransformOperation.h:
115 * platform/graphics/transforms/MatrixTransformOperation.h:
116 * platform/graphics/transforms/PerspectiveTransformOperation.h:
117 * platform/graphics/transforms/RotateTransformOperation.h:
118 * platform/graphics/transforms/ScaleTransformOperation.h:
119 * platform/graphics/transforms/SkewTransformOperation.h:
120 * platform/graphics/transforms/TransformOperation.h:
121 (WebCore::TransformOperation::isAffectedByTransformOrigin):
122 * platform/graphics/transforms/TransformOperations.cpp:
123 (WebCore::TransformOperations::affectedByTransformOrigin): Ask all the operations if
124 they are affected by transform-origin.
125 (WebCore::TransformOperations::blendByMatchingOperations): nullptr.
126 * platform/graphics/transforms/TransformOperations.h:
127 * rendering/RenderBox.cpp:
128 (WebCore::RenderBox::pushMappingToContainer): Comment fix. Only take transforms into account
129 if the geometry map says so (which is most of the time).
130 * rendering/RenderGeometryMap.cpp:
131 (WebCore::RenderGeometryMap::mapToContainer): RenderLayerCompositor is now using the
132 geometry map in a way that is incompatible with this assertion; it deliberately ignores
133 transforms sometimes, so we can't easily verify that the mapping matches mapping through
135 (WebCore::RenderGeometryMap::pushMappingsToAncestor): Save and restore the UseTransforms
137 * rendering/RenderGeometryMap.h:
138 * rendering/RenderLayer.cpp:
139 (WebCore::RenderLayer::boundingBox): Whitespace.
140 (WebCore::RenderLayer::getOverlapBoundsIncludingChildrenAccountingForTransformAnimations): Helper
141 function to get the bounds of a layer, including descendants, when a transform animation is running.
142 * rendering/RenderLayer.h:
143 * rendering/RenderLayerCompositor.cpp:
144 (WebCore::RenderLayerCompositor::CompositingState::CompositingState): Add a ancestorHasTransformAnimation
145 flag to detect nested animated transforms.
146 (WebCore::RenderLayerCompositor::OverlapExtent::knownToBeHaveExtentUncertainty): This returns true when
147 the layer is animating transform, and the transition/animation is such that we can't easily compute the
148 bounds of the animation.
149 (WebCore::RenderLayerCompositor::computeExtent): const RenderLayer&.
150 Compute the animated bounds if there's a transform animation running.
151 (WebCore::RenderLayerCompositor::addToOverlapMap): const RenderLayer&
152 (WebCore::RenderLayerCompositor::addToOverlapMapRecursive): const RenderLayer&
153 (WebCore::RenderLayerCompositor::computeCompositingRequirements):
154 Delay the call to pushMappingsToAncestor() until knowing if there's a transform animation running, and
155 if there is, push the mapping while ignoring transforms (since the transform is implicitly taken into account
156 for overlap via the computed animated bounds).
157 If this layer is running a transform animation, set the childState.ancestorHasTransformAnimation flag so
158 that descendants will know (nested transform animations fall back to current behavior).
159 The if (.... && isRunningAcceleratedTransformAnimation()) is what previously caused us to turn off overlap
160 testing in the face of animations. That now only happens if we were unable to easily compute the animation bounds.
161 (WebCore::RenderLayerCompositor::isRunningTransformAnimation): This previously tested whether an accelerated animation
162 was running, but that's timing sensitive; AnimationController can start the transform animation, but it's not yet
163 considered accelerated until we get an async callback from GraphicsLayer, yet this code needed to know if the
164 animation was running.
165 Since transform animations are always accelerated, we can just test for a running transform animation.
166 (WebCore::RenderLayerCompositor::isRunningAcceleratedTransformAnimation): Deleted.
167 * rendering/RenderLayerCompositor.h:
168 * rendering/style/RenderStyle.cpp:
169 (WebCore::requireTransformOrigin): Some FIXME comments.
171 2015-03-15 Simon Fraser <simon.fraser@apple.com>
173 Clean up related to wheelEvent names
174 https://bugs.webkit.org/show_bug.cgi?id=142713
176 Reviewed by Anders Carlsson.
178 Add EventNames::isWheelEventType() and use it in places that test for the
179 two wheel event names.
182 (WebCore::Document::didAddWheelEventHandler):
183 (WebCore::Document::didRemoveWheelEventHandler):
184 * dom/Document.h: No need for exports (I grepped). Pass the Node*, which
185 will be used in a later patch.
187 (WebCore::EventNames::isWheelEventType):
189 (WebCore::Node::didMoveToNewDocument):
190 (WebCore::tryAddEventListener):
191 (WebCore::tryRemoveEventListener):
192 (WebCore::Node::defaultEventHandler):
193 * html/shadow/MediaControlsApple.cpp:
194 (WebCore::MediaControlsAppleEventListener::handleEvent):
195 * page/DOMWindow.cpp:
196 (WebCore::DOMWindow::addEventListener):
197 (WebCore::DOMWindow::removeEventListener):
198 * page/ios/FrameIOS.mm:
199 (WebCore::ancestorRespondingToScrollWheelEvents): Remove dead code.
201 2015-03-15 Simon Fraser <simon.fraser@apple.com>
203 Remove a redundant repaint when a layer becomes composited
204 https://bugs.webkit.org/show_bug.cgi?id=142711
206 Reviewed by Anders Carlsson.
208 RenderLayerCompositor::computeCompositingRequirements() doesn't need to call
209 repaintOnCompositingChange() when a layer is going to become composited,
210 because updateBacking() does exactly the same thing. I used an assertion
211 and ran the tests to ensure this wasn't a behavior change.
213 * rendering/RenderLayerCompositor.cpp:
214 (WebCore::RenderLayerCompositor::computeCompositingRequirements):
216 2015-03-15 Benjamin Poulain <bpoulain@apple.com>
218 Change the exact attribute matching to be ASCII case-insensitive
219 https://bugs.webkit.org/show_bug.cgi?id=142609
221 Reviewed by Darin Adler.
223 In CSS, testing attribute values should be ASCII case-insensitive,
224 previously we were using full unicode case conversion.
226 Test: fast/selectors/attribute-exact-value-match-is-ascii-case-insensitive.html
229 (WebCore::CSSParser::parseKeyframeSelector):
230 The CSS parser has its own fast version for ASCII case insensitive.
231 This code was using the general equalIgnoringASCIICase() which was causing name conflicts,
232 change that to the normal CSS parser version.
234 * css/SelectorCheckerTestFunctions.h:
235 (WebCore::equalIgnoringASCIICase): Deleted.
236 * cssjit/SelectorCompiler.cpp:
237 (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeValueExactMatching):
239 2015-03-15 Brent Fulgham <bfulgham@apple.com>
241 scroll snap points do not properly account for zoomed pages
242 https://bugs.webkit.org/show_bug.cgi?id=142706
243 <rdar://problem/20165771>
245 Reviewed by Anders Carlsson.
247 When a WebView is zoomed (such that it has a non-unity pageScaleFactor), we need to account for this
248 scaling value when selecting our correct scroll snap point target, as well as when specifying the
249 pixel location for our animation to target.
251 * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
252 * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
253 (WebCore::ScrollingTreeFrameScrollingNodeMac::pageScaleFactor): Added new delegate method.
254 * platform/cocoa/ScrollController.h:
255 (WebCore::ScrollControllerClient::pageScaleFactor): Added new default delegate.
256 * platform/cocoa/ScrollController.mm:
257 (WebCore::ScrollController::beginScrollSnapAnimation): Calculate the correct scroll target
258 based on the page scale factor.
260 2015-03-15 Csaba Osztrogonác <ossy@webkit.org>
262 Fix run-bindings-tests on the WinCairo bot
263 https://bugs.webkit.org/show_bug.cgi?id=142588
265 Reviewed by Alex Christensen.
267 * bindings/scripts/test/JS/JSFloat64Array.cpp: Added property svn:eol-style.
268 * bindings/scripts/test/JS/JSFloat64Array.h: Added property svn:eol-style.
269 * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp: Added property svn:eol-style.
270 * bindings/scripts/test/JS/JSTestActiveDOMObject.h: Modified property svn:eol-style.
271 * bindings/scripts/test/JS/JSTestCallback.cpp: Modified property svn:eol-style.
272 * bindings/scripts/test/JS/JSTestCallback.h: Modified property svn:eol-style.
273 * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp: Added property svn:eol-style.
274 * bindings/scripts/test/JS/JSTestCustomNamedGetter.h: Modified property svn:eol-style.
275 * bindings/scripts/test/JS/JSTestEventConstructor.cpp: Added property svn:eol-style.
276 * bindings/scripts/test/JS/JSTestEventConstructor.h: Added property svn:eol-style.
277 * bindings/scripts/test/JS/JSTestEventTarget.cpp: Added property svn:eol-style.
278 * bindings/scripts/test/JS/JSTestEventTarget.h: Modified property svn:eol-style.
279 * bindings/scripts/test/JS/JSTestException.cpp: Added property svn:eol-style.
280 * bindings/scripts/test/JS/JSTestException.h: Added property svn:eol-style.
281 * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp: Added property svn:eol-style.
282 * bindings/scripts/test/JS/JSTestGenerateIsReachable.h: Added property svn:eol-style.
283 * bindings/scripts/test/JS/JSTestImplements.cpp: Added property svn:eol-style.
284 * bindings/scripts/test/JS/JSTestImplements.h: Added property svn:eol-style.
285 * bindings/scripts/test/JS/JSTestInterface.cpp: Modified property svn:eol-style.
286 * bindings/scripts/test/JS/JSTestInterface.h: Modified property svn:eol-style.
287 * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp: Modified property svn:eol-style.
288 * bindings/scripts/test/JS/JSTestMediaQueryListListener.h: Modified property svn:eol-style.
289 * bindings/scripts/test/JS/JSTestNamedConstructor.cpp: Added property svn:eol-style.
290 * bindings/scripts/test/JS/JSTestNamedConstructor.h: Added property svn:eol-style.
291 * bindings/scripts/test/JS/JSTestNondeterministic.cpp: Added property svn:eol-style.
292 * bindings/scripts/test/JS/JSTestNondeterministic.h: Added property svn:eol-style.
293 * bindings/scripts/test/JS/JSTestObj.cpp: Modified property svn:eol-style.
294 * bindings/scripts/test/JS/JSTestObj.h: Modified property svn:eol-style.
295 * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp: Added property svn:eol-style.
296 * bindings/scripts/test/JS/JSTestOverloadedConstructors.h: Added property svn:eol-style.
297 * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp: Modified property svn:eol-style.
298 * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h: Modified property svn:eol-style.
299 * bindings/scripts/test/JS/JSTestSupplemental.cpp: Added property svn:eol-style.
300 * bindings/scripts/test/JS/JSTestSupplemental.h: Added property svn:eol-style.
301 * bindings/scripts/test/JS/JSTestTypedefs.cpp: Added property svn:eol-style.
302 * bindings/scripts/test/JS/JSTestTypedefs.h: Added property svn:eol-style.
303 * bindings/scripts/test/JS/JSattribute.cpp: Added property svn:eol-style.
304 * bindings/scripts/test/JS/JSattribute.h: Added property svn:eol-style.
305 * bindings/scripts/test/JS/JSreadonly.cpp: Added property svn:eol-style.
306 * bindings/scripts/test/JS/JSreadonly.h: Added property svn:eol-style.
308 2015-03-14 Darin Adler <darin@apple.com>
310 More event handler improvements
311 https://bugs.webkit.org/show_bug.cgi?id=142701
313 Reviewed by Anders Carlsson.
315 These are the improvements:
317 - Use EventHandler rather than EventListener as the the type for event handler
318 attributes. This matches the HTML specification, and also makes sense, since
319 EventListener means something else (and we use it to mean that!). Also renamed
320 JSWindowEventListener to WindowEventHandler. Even though this only affects the
321 JavaScript code generated, it's not really a JavaScript-specific flag.
323 - Tweak formatting on addEventListener/removeEventListener/dispatchEvent in
324 all the IDL files where the appear. This includes changing the spelling from
325 "evt" to "event". Some day we should fix this so these functions only need to
326 appear in EventTarget.idl.
328 - Tweak formatting a bit on the IDL files we had to modify anyway.
330 - Use [Conditional] more often and #if less often in IDL files.
332 - Added a new [DocumentEventHandler] attribute for the selectionchange event.
333 This involved adding new event handler attribute functions to JSEventListener.h
334 for use by the JavaScript bindings.
336 - Removed a little unused code from the JavaScript code bindings generator.
338 - Improved the mechanism used by HTMLElement and SVGElement to share the list of
339 content attributes that are event handlers so there is only one map rather than
340 two. Made a similar mechanism so that HTMLBodyElement and HTMLFrameSetElement
341 can share the list of window event handlers.
343 - Followed the HTML specification by putting all the event handler support in
344 the HTMLElement class rather than having event handlers apply only a the
345 particular element that uses those events. We already did this for most of
346 our event handlers, but we are now doing it for all of them.
348 * Modules/battery/BatteryManager.idl: Use EventHandler instead of EventListener
349 as appropriate. Also reformatted addEventListener/removeEventListener/dispatchEvent.
350 * Modules/encryptedmedia/MediaKeySession.idl: Ditto.
351 * Modules/indexeddb/IDBDatabase.idl: Ditto.
352 * Modules/indexeddb/IDBOpenDBRequest.idl: Ditto.
353 * Modules/indexeddb/IDBRequest.idl: Ditto.
354 * Modules/indexeddb/IDBTransaction.idl: Ditto.
355 * Modules/mediastream/MediaStream.idl: Ditto.
356 * Modules/mediastream/MediaStreamTrack.idl: Ditto.
357 * Modules/mediastream/RTCDTMFSender.idl: Ditto.
358 * Modules/mediastream/RTCDataChannel.idl: Ditto.
359 * Modules/mediastream/RTCPeerConnection.idl: Ditto.
360 * Modules/speech/SpeechSynthesisUtterance.idl: Ditto.
361 * Modules/webaudio/AudioBufferSourceNode.idl: Ditto.
362 * Modules/webaudio/AudioContext.idl: Ditto.
363 * Modules/webaudio/OscillatorNode.idl: Ditto.
364 * Modules/webaudio/ScriptProcessorNode.idl: Ditto.
365 * Modules/websockets/WebSocket.idl: Ditto.
366 * css/FontLoader.idl: Ditto.
367 * dom/EventListener.idl: Ditto.
368 * dom/EventTarget.idl: Ditto.
369 * dom/MessagePort.idl: Ditto.
370 * dom/Node.idl: Ditto.
371 * dom/WebKitNamedFlow.idl: Ditto.
372 * fileapi/FileReader.idl: Ditto.
373 * html/MediaController.idl: Ditto.
374 * html/track/AudioTrackList.idl: Ditto.
375 * html/track/TextTrackCue.idl: Ditto.
376 * html/track/TextTrackList.idl: Ditto.
377 * html/track/VideoTrackList.idl: Ditto.
378 * loader/appcache/DOMApplicationCache.idl: Ditto.
379 * page/EventSource.idl: Ditto.
380 * page/Performance.idl: Ditto.
381 * workers/AbstractWorker.idl: Ditto.
382 * workers/DedicatedWorkerGlobalScope.idl: Ditto.
383 * workers/Worker.idl: Ditto.
384 * workers/WorkerGlobalScope.idl: Ditto.
385 * xml/XMLHttpRequest.idl: Ditto.
386 * xml/XMLHttpRequestUpload.idl: Ditto.
388 * Modules/notifications/Notification.idl: Did the above, but also used
389 [Conditional] instead of #if throughout.
390 * html/track/TextTrack.idl: Ditto.
392 * Modules/webaudio/AudioNode.idl: Tweaked paragraphing of this file.
394 * bindings/js/JSEventListener.cpp:
395 (WebCore::windowEventHandlerAttribute): Renamed to take the word "forwarded"
396 out of this. More closely matches the terminology used in IDL files and the
398 (WebCore::setWindowEventHandlerAttribute): Ditto.
399 (WebCore::documentEventHandlerAttribute): Added.
400 (WebCore::setDocumentEventHandlerAttribute): Added.
401 * bindings/js/JSEventListener.h: Updated for above changes.
403 * bindings/objc/PublicDOMInterfaces.h: Renamed argument from "evt" to "event".
405 * bindings/scripts/CodeGeneratorGObject.pm:
406 (SkipAttribute): Skip attributes of type "EventHandler" rather than attributes
407 of type "EventListener".
408 * bindings/scripts/CodeGeneratorObjC.pm:
409 (SkipAttribute): Ditto.
411 * bindings/scripts/CodeGeneratorJS.pm:
412 (GenerateImplementation): Look for the type EventHandler instead of the type
413 EventListener for event handler attributes. Also added code to handle the new
414 DocumentEventHandler, and use the name WindowEventHandler instead of the name
415 JSWindowEventListener. Removed unneeded preflight check to see if we have
416 writable attributes; it was not doing us any good. (That caused a lot of code
417 to be un-indented and makes the diff hard to read.)
419 * bindings/scripts/IDLAttributes.txt: Removed JSWindowEventListener, and added
420 WindowEventHandler and DocumentEventHandler.
422 * bindings/scripts/test/TestObj.idl: Use the type EventHandler instead of the
423 type EventListener. The test output is unchanged, though.
425 * dom/Document.idl: Got rid of the conditionals and merged all the event handler
426 attributes into a single sorted, unconditional list. Added some that were missing,
427 as detected by the event-handler-attributes.html test.
429 * dom/Element.idl: Ditto. This includes moving attributes here that were formerly
430 only in certain element classes. Note that the script event handler attribute
431 support is still here, even though it should be in HTMLElement and SVGElement
432 instead. There's a FIXME about that, but no real urgency in fixing it.
434 * html/HTMLAttributeNames.in: Added onmessage. Previously, the support for this
435 was from the script attribute only, not the content attribute.
437 * html/HTMLBodyElement.cpp:
438 (WebCore::HTMLBodyElement::createWindowEventHandlerNameMap): Added. This
439 contains the list of all the window event handlers that can be set on a body
440 or frameset element and which are triggered by events on the window.
441 (WebCore::HTMLBodyElement::eventNameForWindowEventHandlerAttribute): Added.
442 This is the function to call to use the map above. Given an attribute, it
443 returns either null if it is not a window event handler attribute, or the
444 event type if it is one.
445 (WebCore::HTMLBodyElement::parseAttribute): Updated to use the new
446 functions above. Handling of these attributes is now unconditional, but
447 also we don't have to keep the nested if statements here up to date, just
448 the list of event handler attributes names in the map create function above.
450 * html/HTMLBodyElement.h: Added public eventNameForWindowEventHandlerAttribute
451 and private createWindowEventHandlerNameMap functions.
453 * html/HTMLBodyElement.idl: Updated to use WindowEventHandler, DocumentEventHandler,
454 and EventHandler. Also made everything unconditional. Also filled out the list here
455 to match the list handled as content attributes. All covered by the test.
457 * html/HTMLElement.cpp:
458 (WebCore::HTMLElement::createEventHandlerNameMap): Added. Replaces the old
459 populate function. Changed the list of event handler attributes to be a bit more
460 complete, and to be entirely unconditional. Also refactored this function to use
461 a new populateEventHandlerNameMap helper, shared with HTMLBodyElement.
462 (WebCore::HTMLElement::populateEventHandlerNameMap): Added. Factors out the code
463 that both this class and HTMLBodyElement use to build event handler name maps.
464 (WebCore::HTMLElement::eventNameForEventHandlerAttribute): Added. This is the
465 function that call to use the map above. Given an attribute it returns either
466 null if it is not an event handler attribute, or the event type if it is one.
467 This is actually two functions. One is a protected function for use by both this
468 class and HTMLBodyElement so they can share things like the optimization to look
469 for the "on" prefix. The other is the public function that we actually use in
470 HTMLElement and SVGElement.
471 (WebCore::HTMLElement::editabilityFromContentEditableAttr): Tweaked and refactored
472 to use lineageOfType. Would have been even simpler if this took an element instead
473 of a node. Unrelated to the event handler changes.
474 (WebCore::HTMLElement::parseAttribute): Removed long-obsolete code that decided
475 whether to call through to the base class. The base class function is empty and
476 never needs to be called, and in any case there is no value in doing work to
477 decide whether to call through to an empty function. Changed the style of the
478 function to use early return instead of else. Worth considering whether we want
479 to return early or call through to base class in this family of functions. It's
480 more efficient to return early, but doesn't work well if both the derived class
481 and base class want to respond to changes to the same attribute. The new logic
482 for event handler attributes is more straightforward than the old, since the
483 eventNameForEventHandlerAttribute has the logic.
484 (WebCore::HTMLElement::textToFragment): Tweaked and refactored a bit, and also
485 changed to return a Ref since this never fails and needs to return null.
487 * html/HTMLElement.h: Updated for above changes. This includes a template version
488 of populateEventHandlerNameMap that extracts the array size at compile time and
489 passes it to the non-template function that does the work.
491 * html/HTMLFrameElementBase.cpp:
492 (WebCore::HTMLFrameElementBase::parseAttribute): Removed unneeded code to handle
493 event handler attributes handled by HTMLElement.
494 * html/HTMLImageElement.cpp:
495 (WebCore::HTMLImageElement::parseAttribute): Ditto.
496 * html/HTMLLinkElement.cpp:
497 (WebCore::HTMLLinkElement::parseAttribute): Ditto.
498 * html/HTMLObjectElement.cpp:
499 (WebCore::HTMLObjectElement::parseAttribute): Ditto.
500 * html/HTMLScriptElement.cpp:
501 (WebCore::HTMLScriptElement::parseAttribute): Ditto.
503 * html/HTMLFrameSetElement.cpp:
504 (WebCore::HTMLFrameSetElement::parseAttribute): Changed function to early return
505 style, and added FIXMEs about the many problems in the attribute handling code.
506 Replaced all the code to handle window event handlers with a new bit of code that
507 calls HTMLBodyElement::eventNameForWindowEventHandlerAttribute.
509 * html/HTMLFrameSetElement.idl: Changed to match the list of window event handlers
510 in HTMLBodyElement.idl, although I did not add the document event handler here.
511 As in the various other cases, having some extra event handlers does not seem to
512 do harm and this is covered by the event-handler-attributes.html test.
514 * html/HTMLMarqueeElement.idl: Renamed EventListener to EventHandler in comment.
516 * page/DOMWindow.idl: As with Element and Document, removed conditionals, and
517 filled out the list of event handlers so all the tests in
518 event-handler-attributes.html will pass.
520 * svg/SVGElement.cpp:
521 (WebCore::SVGElement::parseAttribute): Changed code to the early return style,
522 and replaced the event handler attribute code with new much simpler code that
523 uses the new HTMLElement::eventNameForEventHandlerAttribute. Also changed the
524 way we call through to base classes. Just call through to the
525 SVGLangSpace::parseAttribute function unconditionally, and don't try to use
526 early return style to arbitrate among base classes. We should make this
527 simplification throughout the SVG code; there's no need for the complexity
528 that was there before just to cut down slightly on calls through to base
529 class parseAttribute functions.
531 * svg/SVGSVGElement.cpp:
532 (WebCore::SVGSVGElement::parseAttribute): Changed some of this code to the
533 early return style and corrected some comments about the window event handler
534 attributes here. These could use some further testing and might later need to be
535 properly supported when the attributes are set in script, not just in content.
537 * svg/SVGScriptElement.cpp:
538 (WebCore::SVGScriptElement::isSupportedAttribute): Deleted.
539 (WebCore::SVGScriptElement::parseAttribute): Changed this function to use the
540 early return style and also to call through to all three base classes. This is
541 a pattern we should follow elsewhere in SVG to simplify the code. There is no
542 need for the supportedAttributes sets like the one in this calass, and the code
543 is unnecessarily complex, perhaps in an attempt to optimize performance. I'm
544 pretty sure the old code was slower than this new code will be. No need for the
545 extra hash table lookup every time. Also removed handling of event handler
546 attribute which is taken care of by SVGElement now.
547 (WebCore::SVGScriptElement::svgAttributeChanged): Made similar changes for
548 the same reason as in parseAttribute. This function really needs a new name:
549 It's the same as parseAttribute, except it's also used when implementing
550 changes due to SVG animation.
552 * svg/SVGScriptElement.h: Removed isSupportedAttribute.
554 2015-03-14 Simon Fraser <simon.fraser@apple.com>
556 Clean up use of flags in localToContainer-type functions
557 https://bugs.webkit.org/show_bug.cgi?id=142704
559 Reviewed by Alexey Proskuryakov.
561 RenderObject::localToContainerQuad() had the questionable behavior of always
562 enforcing UseTransforms in the flags. However, a future patch will need to call
563 localToContainerQuad() without this flag.
565 Fix by requiring callers of localToAbsoluteQuad(), localToContainerQuad(), localToContainerPoint(),
566 and absoluteToLocalQuad() to pass the UseTransforms flag in, providing it as a default argument.
568 The default value of the MapCoordinatesFlags parameter to mapLocalToContainer(),
569 a lower-level function, is removed.
571 Sprinkle a few more nullptrs around.
575 * rendering/RenderBlock.cpp:
576 (WebCore::RenderBlock::selectionGapRectsForRepaint): call the higher-level localToContainerPoint()
577 instead of mapLocalToContainer().
578 (WebCore::RenderBlock::absoluteQuads): Pass UseTransforms.
579 * rendering/RenderBox.cpp:
580 (WebCore::RenderBox::absoluteQuads): Ditto.
581 * rendering/RenderBox.h:
582 * rendering/RenderFlowThread.h:
583 * rendering/RenderGeometryMap.h:
584 (WebCore::RenderGeometryMap::absolutePoint):
585 (WebCore::RenderGeometryMap::absoluteRect):
586 * rendering/RenderImage.cpp:
587 (WebCore::RenderImage::collectSelectionRects): This function was erroneously passing
588 'false' as flags. Pass UseTransforms instead (but no behavior change since
589 UseTransforms was forced on lower down).
590 * rendering/RenderInline.h:
591 * rendering/RenderLayer.cpp:
592 (WebCore::RenderLayer::scrollRectToVisible): UseTransforms is the parameter default, remove it.
593 * rendering/RenderLineBreak.cpp:
594 (WebCore::RenderLineBreak::absoluteQuads):
595 (WebCore::RenderLineBreak::collectSelectionRects): Another erroneous 'false'.
596 * rendering/RenderNamedFlowFragment.cpp:
597 (WebCore::RenderNamedFlowFragment::absoluteQuadsForBoxInRegion):
598 * rendering/RenderObject.cpp:
599 (WebCore::RenderObject::localToContainerQuad): Here's where we no longer force
600 the UseTransforms bit.
601 (WebCore::RenderObject::localToContainerPoint): Also here.
602 * rendering/RenderObject.h: I prefer bit flags lined up. Makes it easier to spot errors.
603 (WebCore::RenderObject::localToAbsoluteQuad):
604 * rendering/RenderText.cpp:
605 (WebCore::RenderText::collectSelectionRects): Another bad 'false'.
606 * rendering/RenderTextLineBoxes.cpp:
607 (WebCore::RenderTextLineBoxes::absoluteRectsForRange):
608 (WebCore::RenderTextLineBoxes::absoluteQuads):
609 (WebCore::RenderTextLineBoxes::absoluteQuadsForRange):
610 * rendering/RenderView.h:
611 * rendering/SimpleLineLayoutFunctions.cpp:
612 (WebCore::SimpleLineLayout::collectAbsoluteQuads):
613 * rendering/svg/RenderSVGForeignObject.h:
614 * rendering/svg/RenderSVGInline.cpp:
615 (WebCore::RenderSVGInline::absoluteQuads): Another bad 'false'.
616 * rendering/svg/RenderSVGInline.h:
617 * rendering/svg/RenderSVGModelObject.cpp:
618 (WebCore::RenderSVGModelObject::absoluteQuads):
619 * rendering/svg/RenderSVGModelObject.h:
620 * rendering/svg/RenderSVGRoot.h:
621 * rendering/svg/RenderSVGText.cpp:
622 (WebCore::RenderSVGText::absoluteQuads):
623 * rendering/svg/RenderSVGText.h:
624 * rendering/svg/SVGRenderSupport.h:
626 2015-03-14 Brent Fulgham <bfulgham@apple.com>
628 [iOS] scroll snap points are animating to the wrong positions...
629 https://bugs.webkit.org/show_bug.cgi?id=142705
630 <rdar://problem/20136946>
632 Reviewed by Simon Fraser.
634 Avoid adding an extra '0' snap point to our set. We always start with one zero; this
635 extra append just forces us to do more steps in our search for nearest snap point.
637 * page/scrolling/AxisScrollSnapOffsets.cpp:
638 (WebCore::updateFromStyle): Remove extra '0' appended to offsets.
640 2015-03-14 Dean Jackson <dino@apple.com>
642 Feature flag for Animations Level 2
643 https://bugs.webkit.org/show_bug.cgi?id=142699
644 <rdar://problem/20165097>
646 Reviewed by Brent Fulgham.
648 Add ENABLE_CSS_ANIMATIONS_LEVEL_2 and a runtime flag animationTriggersEnabled.
650 * Configurations/FeatureDefines.xcconfig:
651 * bindings/generic/RuntimeEnabledFeatures.cpp:
652 (WebCore::RuntimeEnabledFeatures::RuntimeEnabledFeatures):
653 * bindings/generic/RuntimeEnabledFeatures.h:
654 (WebCore::RuntimeEnabledFeatures::setAnimationTriggersEnabled):
655 (WebCore::RuntimeEnabledFeatures::animationTriggersEnabled):
657 2015-03-14 Adenilson Cavalcanti <cavalcantii@gmail.com>
659 RenderBlock::imageChange() calling const methods on exit
660 https://bugs.webkit.org/show_bug.cgi?id=142648
662 Reviewed by Brent Fulgham.
664 No new tests, no change on behavior.
666 * rendering/RenderBlock.cpp:
667 (WebCore::RenderBlock::imageChanged): Deleted.
668 * rendering/RenderBlock.h:
670 2015-03-14 VÃctor Manuel Jáquez Leal <vjaquez@igalia.com>
672 [GStreamer] share GL context in pipeline
673 https://bugs.webkit.org/show_bug.cgi?id=142693
675 Reviewed by Philippe Normand.
677 GstGL elements in a pipeline need to be aware of the application's
678 display and its GL context. This information is shared through context
679 messages between the pipeline and the browser.
681 This patch shares this context through a GStreamer's synchronous
682 message, using the GL information held in the web process.
684 This patch is based on the work of Philippe Normand for Bug 138562.
686 No new tests because this is platform specific and it depends in the
687 run-time availability and configurations of GstGL elements.
689 * PlatformGTK.cmake: appends the GstGL header files in the include
690 directories. Also its library directory is appended.
691 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
692 (WebCore::mediaPlayerPrivateSyncMessageCallback): New callback function.
693 (WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer):
694 Initialize the new class attributes.
695 (WebCore::MediaPlayerPrivateGStreamer::handleSyncMessage): New method
696 for handling synchronous messages from the pipeline. This method
697 currently only handles the GL context sharing.
698 (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin): Configures
699 the pipeline's bus to handle the synchronous messages.
700 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: Add new
701 class methods and attributes.
703 2015-03-13 Alex Christensen <achristensen@webkit.org>
705 Progress towards CMake on Mac.
706 https://bugs.webkit.org/show_bug.cgi?id=142680
708 Reviewed by Gyuyoung Kim.
711 Added new include directories and removed old source files.
713 2015-03-13 Commit Queue <commit-queue@webkit.org>
715 Unreviewed, rolling out r181483.
716 https://bugs.webkit.org/show_bug.cgi?id=142688
718 Caused use-after-free on many tests (Requested by ap on
723 "Allow clients to selectively disable plug-ins"
724 https://bugs.webkit.org/show_bug.cgi?id=142506
725 http://trac.webkit.org/changeset/181483
727 2015-03-13 Antti Koivisto <antti@apple.com>
729 Cache glyph widths to GlyphPages
730 https://bugs.webkit.org/show_bug.cgi?id=142028
732 Reviewed by Andreas Kling.
734 Currently we have a separate cache in Font for glyph widths. In practice we always need
735 the widths so we can just cache them in GlyphPages. This simplifies the code and removes
736 a per-character hash lookup from WidthIterator.
738 * platform/graphics/Font.cpp:
739 (WebCore::Font::Font):
740 (WebCore::Font::initCharWidths):
741 (WebCore::Font::platformGlyphInit):
742 (WebCore::createAndFillGlyphPage):
743 (WebCore::Font::computeWidthForGlyph):
745 Rename to make it clear this doesn't cache.
747 (WebCore::GlyphPage::setGlyphDataForIndex):
749 Initialize the width.
750 This could go to GlyphPage.cpp if we had one.
752 * platform/graphics/Font.h:
753 (WebCore::Font::glyphZeroWidth):
754 (WebCore::Font::isZeroWidthSpaceGlyph):
755 (WebCore::Font::zeroGlyph): Deleted.
756 (WebCore::Font::setZeroGlyph): Deleted.
757 (WebCore::Font::widthForGlyph): Deleted.
758 * platform/graphics/FontCascade.cpp:
759 (WebCore::offsetToMiddleOfGlyph):
760 * platform/graphics/FontCascadeFonts.cpp:
761 (WebCore::FontCascadeFonts::glyphDataForCharacter):
762 * platform/graphics/GlyphPage.h:
763 (WebCore::GlyphData::GlyphData):
765 Return width too as part of GlyphData.
767 (WebCore::GlyphPage::glyphDataForIndex):
768 (WebCore::GlyphPage::setGlyphDataForCharacter):
769 (WebCore::GlyphPage::setGlyphDataForIndex):
770 (WebCore::GlyphPage::GlyphPage):
771 * platform/graphics/WidthIterator.cpp:
772 (WebCore::WidthIterator::advanceInternal):
774 No need to lookup width separately now.
776 * platform/graphics/mac/ComplexTextController.cpp:
777 (WebCore::ComplexTextController::adjustGlyphsAndAdvances):
778 * platform/graphics/mac/ComplexTextControllerCoreText.mm:
779 (WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun):
780 * rendering/mathml/RenderMathMLOperator.cpp:
781 (WebCore::RenderMathMLOperator::advanceForGlyph):
782 * rendering/svg/SVGTextRunRenderingContext.cpp:
783 (WebCore::missingGlyphForFont):
784 * svg/SVGFontData.cpp:
785 (WebCore::SVGFontData::initializeFont):
787 2015-03-13 Eric Carlson <eric.carlson@apple.com>
789 [Mac] Enable WIRELESS_PLAYBACK_TARGET
790 https://bugs.webkit.org/show_bug.cgi?id=142635
792 Reviewed by Darin Adler.
794 * Configurations/FeatureDefines.xcconfig:
796 2015-03-13 Jeremy Jones <jeremyj@apple.com>
798 Fix typo restoreUserInterfaceForOptimizedFullscreeStopWithCompletionHandler.
799 https://bugs.webkit.org/show_bug.cgi?id=142678
801 Reviewed by Eric Carlson.
803 Add the missing 'n' in "fullscreen".
805 * platform/spi/ios/AVKitSPI.h:
807 2015-03-13 Timothy Horton <timothy_horton@apple.com>
809 Sites that use a device-width viewport but don't have enough height to fill the view are scaled up
810 https://bugs.webkit.org/show_bug.cgi?id=142664
811 <rdar://problem/18859470>
813 Reviewed by Benjamin Poulain.
815 * page/ViewportConfiguration.cpp:
816 (WebCore::ViewportConfiguration::shouldIgnoreHorizontalScalingConstraints):
817 (WebCore::ViewportConfiguration::shouldIgnoreVerticalScalingConstraints):
818 (WebCore::ViewportConfiguration::shouldIgnoreScalingConstraints):
819 Split shouldIgnoreScalingConstraints into one for each dimension.
821 (WebCore::ViewportConfiguration::initialScale):
822 (WebCore::ViewportConfiguration::minimumScale):
823 Don't force the initial and minimum scales to cover the whole view if the
824 page claims to want to lay out to device width but then lays out too big.
825 This will allow pages that misbehave in this way to scale down further
826 than they previously could, but will result in a region of empty background
827 color being exposed at the initial/minimum scale.
829 (WebCore::ViewportConfiguration::description):
830 Update the logging to show each dimension separately.
832 * page/ViewportConfiguration.h:
834 2015-03-13 Mark Lam <mark.lam@apple.com>
836 Replace TCSpinLock with a new WTF::SpinLock based on WTF::Atomic.
837 <https://webkit.org/b/142674>
839 Reviewed by Filip Pizlo.
841 No new tests because there is no new functionality. This is a refactoring effort.
843 * bindings/objc/WebScriptObject.mm:
844 * platform/ios/wak/WAKWindow.mm:
845 (-[WAKWindow initWithLayer:]):
846 (-[WAKWindow initWithFrame:]):
848 2015-03-13 Doug Russell <d_russell@apple.com>
850 AX: Provide API for assistive tech to ignore DOM key event handlers
851 https://bugs.webkit.org/show_bug.cgi?id=142059
853 Reviewed by Beth Dakin.
855 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.
857 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.
859 Test: platform/mac/accessibility/prevent-keyboard-event-dispatch.html
861 * accessibility/AccessibilityObject.cpp:
862 (WebCore::AccessibilityObject::preventKeyboardDOMEventDispatch):
863 (WebCore::AccessibilityObject::setPreventKeyboardDOMEventDispatch):
864 * accessibility/AccessibilityObject.h:
865 * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
866 (-[WebAccessibilityObjectWrapper accessibilityAttributeNames]):
867 (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
868 (-[WebAccessibilityObjectWrapper accessibilityIsAttributeSettable:]):
869 (-[WebAccessibilityObjectWrapper _accessibilitySetValue:forAttribute:]):
871 (WebCore::Element::dispatchKeyEvent):
872 * page/EventHandler.cpp:
873 (WebCore::EventHandler::keyEvent):
874 (WebCore::handleKeyboardSelectionMovement):
875 (WebCore::EventHandler::handleKeyboardSelectionMovementForAccessibility):
876 * page/EventHandler.h:
879 2015-03-09 Conrad Shultz <conrad_shultz@apple.com>
881 Allow clients to selectively disable plug-ins
882 https://bugs.webkit.org/show_bug.cgi?id=142506
884 Reviewed by Anders Carlsson.
886 Add new functionality allow clients to declaratively disable individual plug-ins (in a manner that conceals them
887 from the page). As part of this:
889 1) Introduce the concept of web-visible plug-ins and related concepts, as distinct from the real underlying
892 2) Where applicable, plumb additional information about plug-ins (specifically, bundle identification) deeper
895 3) Add generic functionality to PluginStrategy to support filtering plug-ins for visibility and introduce
896 a concrete implementation thereof in WebPlatformStrategies in WebKit2.
898 4) Add messaging infrastructure to allow clients to set and clear plug-in policies.
900 While currently only used in a very limited manner, the new declarative plug-in policies are written generically
901 so that they could be easily used in the future to reduce synchronous messaging to the client when loading plug-ins.
903 * dom/DOMImplementation.cpp:
904 (WebCore::DOMImplementation::createDocument):
905 Update to reflect function rename.
907 * loader/SubframeLoader.cpp:
908 (WebCore::findPluginMIMETypeFromURL):
909 Adopt getWebVisibleMimesAndPluginIndices().
910 (WebCore::logPluginRequest):
911 Update to reflect function rename.
912 (WebCore::SubframeLoader::shouldUsePlugin):
915 * platform/PlatformStrategies.h:
916 Export platformStrategies(), since it is now used in WebProcess.cpp.
918 * plugins/DOMMimeType.cpp:
919 (WebCore::DOMMimeType::type):
920 (WebCore::DOMMimeType::description):
921 (WebCore::DOMMimeType::mimeClassInfo):
922 Adopt getWebVisibleMimesAndPluginIndices().
923 (WebCore::DOMMimeType::enabledPlugin):
926 * plugins/DOMMimeType.h:
927 Don't return references in a few places where it is no longer safe to do so.
928 (WebCore::DOMMimeType::mimeClassInfo): Deleted.
930 * plugins/DOMMimeTypeArray.cpp:
931 (WebCore::DOMMimeTypeArray::length):
932 Adopt getWebVisibleMimesAndPluginIndices().
933 (WebCore::DOMMimeTypeArray::item):
935 (WebCore::DOMMimeTypeArray::canGetItemsForName):
937 (WebCore::DOMMimeTypeArray::namedItem):
940 * plugins/DOMPlugin.cpp:
941 (WebCore::DOMPlugin::pluginInfo):
942 Adopt getWebVisiblePlugins().
943 (WebCore::DOMPlugin::item):
944 Adopt getWebVisibleMimesAndPluginIndices().
945 (WebCore::DOMPlugin::canGetItemsForName):
947 (WebCore::DOMPlugin::namedItem):
950 * plugins/DOMPlugin.h:
951 (WebCore::DOMPlugin::pluginInfo): Deleted.
953 * plugins/DOMPluginArray.cpp:
954 (WebCore::DOMPluginArray::length):
955 Adopt getWebVisiblePlugins().
956 (WebCore::DOMPluginArray::item):
958 (WebCore::DOMPluginArray::canGetItemsForName):
960 (WebCore::DOMPluginArray::namedItem):
963 * plugins/PluginData.cpp:
964 (WebCore::PluginData::PluginData):
965 Stash the passed-in Page and call initPlugins().
966 (WebCore::PluginData::getWebVisiblePlugins):
967 New member function; call through to PluginStrategy::getWebVisiblePluginInfo().
968 (WebCore::PluginData::getWebVisibleMimesAndPluginIndices):
969 New member function; build up the mimes and mimePluginIndices vectors in the same manner as before, but
970 limited to the web-visible plug-ins.
971 (WebCore::PluginData::supportsWebVisibleMimeType):
972 Renamed from supportsMimeType(); update to work in terms of web-visible plug-ins.
973 (WebCore::PluginData::pluginInfoForWebVisibleMimeType):
974 Renamed from pluginInfoForMimeType(); ditto.
975 (WebCore::PluginData::pluginNameForWebVisibleMimeType):
976 Renamed from pluginNameForMimeType(); ditto.
977 (WebCore::PluginData::pluginFileForWebVisibleMimeType):
978 Renamed from pluginFileForMimeType(); ditto.
979 (WebCore::PluginData::initPlugins):
980 (WebCore::PluginData::supportsMimeType): Deleted.
981 (WebCore::PluginData::pluginInfoForMimeType): Deleted.
982 (WebCore::PluginData::pluginNameForMimeType): Deleted.
983 (WebCore::PluginData::pluginFileForMimeType): Deleted.
985 * plugins/PluginData.h:
986 Add a member variable for the associate Page; declare the PluginLoadClientPolicy enumeration; add
987 new members to PluginInfo for the clientLoadPolicy and bundle information.
988 (WebCore::PluginData::PluginData):
989 Replace some member functions with new ones that will hide plug-ins upon request from the client;
990 (WebCore::PluginData::mimes): Deleted.
991 (WebCore::PluginData::mimePluginIndices): Deleted.
993 * plugins/PluginStrategy.h:
994 Declare new member functions for retrieving web-visible plug-ins and setting/clearing plug-in policies.
996 * replay/SerializationMethods.cpp:
997 (JSC::EncodingTraits<PluginData>::encodeValue):
998 Remove now-obsolete code for handling MIME types and add a FIXME.
999 (JSC::DeserializedPluginData::DeserializedPluginData):
1000 (JSC::EncodingTraits<PluginData>::decodeValue):
1002 (JSC::EncodingTraits<PluginInfo>::encodeValue):
1003 Handle the new members in PluginInfo.
1004 (JSC::EncodingTraits<PluginInfo>::decodeValue):
1007 * replay/WebInputs.json:
1008 Teach Replay about PluginLoadClientPolicy.
1010 2015-03-13 Chris Dumez <cdumez@apple.com>
1012 XMLHttpRequests should not prevent a page from entering PageCache
1013 https://bugs.webkit.org/show_bug.cgi?id=142612
1014 <rdar://problem/19923085>
1016 Reviewed by Alexey Proskuryakov.
1018 Make XMLHttpRequest ActiveDOMObjects suspendable in most cases to
1019 drastically improve the likelihood of pages using them to enter
1020 PageCache. XMLHttpRequest used to be only suspendable when not
1021 loading. After this patch, if the XMLHttpRequest is loading when
1022 navigating away from the page, it will be aborted and the page
1023 will enter the PageCache. Upon restoring the page from PageCache,
1024 the XMLHttpRequests' error handlers will be executed to give them
1025 a chance to reload if they want to.
1027 Test: http/tests/navigation/page-cache-xhr.html
1029 * history/PageCache.cpp:
1030 (WebCore::logCanCacheFrameDecision):
1031 (WebCore::PageCache::canCachePageContainingThisFrame):
1032 Do not prevent a page to enter the page cache ff the main document has
1033 an error that is a cancellation and all remaining subresource loaders
1034 are for XHR. We extend the pre-existing mechanism used on iOS, which
1035 allowed PageCaching if the remaining resource loads are for images.
1037 * loader/DocumentLoader.cpp:
1038 (WebCore::areAllLoadersPageCacheAcceptable):
1039 Mark XHR loaders as PageCache acceptable.
1041 * loader/DocumentThreadableLoader.cpp:
1042 (WebCore::DocumentThreadableLoader::isXMLHttpRequest):
1043 * loader/DocumentThreadableLoader.h:
1044 * loader/ThreadableLoader.h:
1045 * loader/cache/CachedResource.cpp:
1046 (WebCore::CachedResource::areAllClientsXMLHttpRequests):
1047 * loader/cache/CachedResource.h:
1048 * loader/cache/CachedResourceClient.h:
1049 (WebCore::CachedResourceClient::isXMLHttpRequest):
1050 * xml/XMLHttpRequest.cpp:
1051 (WebCore::XMLHttpRequest::XMLHttpRequest):
1052 (WebCore::XMLHttpRequest::createRequest):
1053 (WebCore::XMLHttpRequest::canSuspend):
1054 Report that we can suspend XMLHttpRequests as long as the window load
1055 event has already fired. If the window load event has not fired yet,
1056 it would be unsafe to cancel the load in suspend() as it would
1057 potentially cause arbitrary JS execution while suspending.
1059 (WebCore::XMLHttpRequest::suspend):
1060 If suspending for PageCache and the request is currently loading, abort
1061 the load and mark that we should fire the error event upon restoring
1064 (WebCore::XMLHttpRequest::resume):
1065 (WebCore::XMLHttpRequest::resumeTimerFired):
1066 Upon resuming, fire the error event in a timer if the load was aborted
1067 for suspending. We need to do this in a timer because we are not allowed
1068 to execute arbitrary JS inside resume().
1070 (WebCore::XMLHttpRequest::stop):
1071 Add a assertion to make sure we are not firing event inside stop() as
1072 this would potentially cause arbitrary JS execution and it would be
1073 unsafe. It seems to me that our code is currently unsafe but the
1074 assertion does not seem to be hit by our current layout tests. I am
1075 adding the assertion as it would make it clear we have a bug and we
1078 * xml/XMLHttpRequest.h:
1080 2015-03-13 Joonghun Park <jh718.park@samsung.com>
1082 Fix Debug build error 'comparison is always true due to limited range of data type [-Werror=type-limits]'
1083 https://bugs.webkit.org/show_bug.cgi?id=142652
1085 Reviewed by Csaba Osztrogonác.
1087 No new tests, no behavior changes.
1089 Now CSSPropertyID type is uint16_t, so propertyID >= 0 check is needed no more.
1091 * css/CSSPrimitiveValue.cpp:
1092 (WebCore::propertyName):
1095 2015-03-12 Zan Dobersek <zdobersek@igalia.com>
1097 Remove DrawingBuffer
1098 https://bugs.webkit.org/show_bug.cgi?id=142641
1100 Reviewed by Darin Adler.
1102 Remove the DrawingBuffer class. Objects of this type were only held in the
1103 WebGLRenderingContext (later renamed to WebGLRenderingContextBase) on the
1104 Chromium port, with the relevant code removed in r147888. Since then, the
1105 m_drawingBuffer member variable has always been null.
1108 * PlatformEfl.cmake:
1109 * PlatformGTK.cmake:
1110 * WebCore.vcxproj/WebCore.vcxproj:
1111 * WebCore.vcxproj/WebCore.vcxproj.filters:
1112 * WebCore.xcodeproj/project.pbxproj:
1113 * html/canvas/WebGL2RenderingContext.cpp:
1114 (WebCore::WebGL2RenderingContext::copyTexImage2D):
1115 * html/canvas/WebGLRenderingContext.cpp:
1116 (WebCore::WebGLRenderingContext::copyTexImage2D):
1117 * html/canvas/WebGLRenderingContextBase.cpp:
1118 (WebCore::WebGLRenderingContextBase::WebGLRenderingContextBase):
1119 (WebCore::WebGLRenderingContextBase::initializeNewContext):
1120 (WebCore::WebGLRenderingContextBase::destroyGraphicsContext3D):
1121 (WebCore::WebGLRenderingContextBase::markContextChanged):
1122 (WebCore::WebGLRenderingContextBase::clearIfComposited):
1123 (WebCore::WebGLRenderingContextBase::paintRenderingResultsToCanvas):
1124 (WebCore::WebGLRenderingContextBase::paintRenderingResultsToImageData):
1125 (WebCore::WebGLRenderingContextBase::reshape):
1126 (WebCore::WebGLRenderingContextBase::drawingBufferWidth):
1127 (WebCore::WebGLRenderingContextBase::drawingBufferHeight):
1128 (WebCore::WebGLRenderingContextBase::activeTexture):
1129 (WebCore::WebGLRenderingContextBase::bindFramebuffer):
1130 (WebCore::WebGLRenderingContextBase::bindTexture):
1131 (WebCore::WebGLRenderingContextBase::copyTexSubImage2D):
1132 (WebCore::WebGLRenderingContextBase::deleteFramebuffer):
1133 (WebCore::WebGLRenderingContextBase::disable):
1134 (WebCore::WebGLRenderingContextBase::enable):
1135 (WebCore::WebGLRenderingContextBase::getContextAttributes):
1136 (WebCore::WebGLRenderingContextBase::readPixels):
1137 (WebCore::WebGLRenderingContextBase::loseContextImpl):
1138 (WebCore::WebGLRenderingContextBase::getBoundFramebufferWidth):
1139 (WebCore::WebGLRenderingContextBase::getBoundFramebufferHeight):
1140 (WebCore::WebGLRenderingContextBase::maybeRestoreContext):
1141 * html/canvas/WebGLRenderingContextBase.h:
1142 (WebCore::ScopedDrawingBufferBinder::ScopedDrawingBufferBinder): Deleted.
1143 (WebCore::ScopedDrawingBufferBinder::~ScopedDrawingBufferBinder): Deleted.
1144 * platform/graphics/GraphicsContext.h:
1145 * platform/graphics/GraphicsContext3D.h:
1146 * platform/graphics/cairo/DrawingBufferCairo.cpp: Removed.
1147 * platform/graphics/gpu/DrawingBuffer.cpp: Removed.
1148 * platform/graphics/gpu/DrawingBuffer.h: Removed.
1149 * platform/graphics/gpu/mac/DrawingBufferMac.mm: Removed.
1150 * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
1151 (WebCore::GraphicsContext3D::paintRenderingResultsToCanvas):
1152 (WebCore::GraphicsContext3D::paintRenderingResultsToImageData):
1154 2015-03-12 Ryosuke Niwa <rniwa@webkit.org>
1156 REGRESSION(r180726): Removing an empty line at the end of textarea clears the entire texture
1157 https://bugs.webkit.org/show_bug.cgi?id=142646
1159 Reviewed by Darin Adler.
1161 The bug was caused by TypingCommand::deleteKeyPressed erroneously determining the editable root to be empty because
1162 Position::atStartOfTree returns true when it's anchored at a BR that is immediately below the root editable element.
1164 Fixed the bug by replacing the use of the deprecated atFirstEditingPositionForNode by a code that understands modern
1165 position types such as PositionIsBeforeAnchor in atStartOfTree and atEndOfTree. These two functions will no longer
1166 return true when anchored before or after BR after this patch.
1168 Test: editing/deleting/delete-empty-line-breaks-at-end-of-textarea.html
1171 (WebCore::Position::atStartOfTree):
1172 (WebCore::Position::atEndOfTree):
1174 2015-03-12 Yusuke Suzuki <utatane.tea@gmail.com>
1176 Integrate MapData into JSMap and JSSet
1177 https://bugs.webkit.org/show_bug.cgi?id=142556
1179 Reviewed by Filip Pizlo.
1181 Now Set has SetData and it's different from MapData.
1182 And MapData/SetData are completely integrated into JSSet and JSMap.
1183 Structured-cloning algorithm need to be aware of these changes.
1184 And in the case of JSSet, since JSSet doesn't need dummy value for construction,
1185 Structured-cloning only serialize the keys in JSSet.
1187 * ForwardingHeaders/runtime/MapDataInlines.h: Added.
1188 * bindings/js/SerializedScriptValue.cpp:
1189 (WebCore::CloneSerializer::serialize):
1190 (WebCore::CloneDeserializer::consumeCollectionDataTerminationIfPossible):
1191 (WebCore::CloneDeserializer::deserialize):
1192 (WebCore::CloneDeserializer::consumeMapDataTerminationIfPossible): Deleted.
1194 2015-03-12 Dan Bernstein <mitz@apple.com>
1196 Finish up <rdar://problem/20086546> [Cocoa] Add an option to treat certificate chains with SHA1-signed certificates as insecure
1198 Added back OS X bits that I couldn’t land initially in r181317 or had to remove in r181327.
1200 * platform/network/mac/CertificateInfoMac.mm:
1201 (WebCore::CertificateInfo::containsNonRootSHA1SignedCertificate):
1202 * platform/spi/cocoa/SecuritySPI.h:
1204 2015-03-12 Geoffrey Garen <ggaren@apple.com>
1206 REGRESSION: Crash under Heap::reportExtraMemoryAllocatedSlowCase for media element
1207 https://bugs.webkit.org/show_bug.cgi?id=142636
1209 Reviewed by Mark Hahnenberg.
1211 This was a pre-existing bug that I made a lot worse in
1212 <https://trac.webkit.org/changeset/181411>.
1214 * html/HTMLMediaElement.cpp:
1215 (WebCore::HTMLMediaElement::parseAttribute): Compare size before
1216 subtracting rather than subtracting and then comparing to zero. The
1217 latter technique is not valid for unsigned integers, which will happily
1218 underflow into giant numbers.
1220 * Modules/mediasource/SourceBuffer.cpp:
1221 (WebCore::SourceBuffer::reportExtraMemoryAllocated): This code was
1222 technically correct, but I took the opportunity to clean it up a bit.
1223 There's no need to do two checks here, and it smells bad to check for
1224 a negative unsigned integer.
1226 2015-03-12 Sebastian Dröge <sebastian@centricular.com>
1228 Stop using single-include headers that are only available since GStreamer >= 1.2.
1230 https://bugs.webkit.org/show_bug.cgi?id=142537
1232 Reviewed by Philippe Normand.
1234 * platform/audio/gstreamer/AudioDestinationGStreamer.cpp:
1235 * platform/audio/gstreamer/AudioFileReaderGStreamer.cpp:
1236 * platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp:
1237 * platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp:
1238 * platform/graphics/gstreamer/GStreamerUtilities.cpp:
1239 * platform/graphics/gstreamer/GStreamerUtilities.h:
1240 * platform/graphics/gstreamer/ImageGStreamer.h:
1241 Instead of using single-include headers for the GStreamer libraries,
1242 directly include the headers we need. The single-include headers were
1243 only added in 1.2, and this would be the only reason why we would
1246 2015-03-12 Eric Carlson <eric.carlson@apple.com>
1248 [Mac] Update AirPlay handling
1249 https://bugs.webkit.org/show_bug.cgi?id=142541
1251 Unreviewed, respond to post-review comments.
1254 (WebCore::Document::didChoosePlaybackTarget):
1255 * page/ChromeClient.h:
1257 (WebCore::Page::showPlaybackTargetPicker):
1258 (WebCore::Page::didChoosePlaybackTarget):
1259 (WebCore::Page::configurePlaybackTargetMonitoring):
1261 2015-03-12 Csaba Osztrogonác <ossy@webkit.org>
1263 Fix the !ENABLE(PICTURE_SIZES) build
1264 https://bugs.webkit.org/show_bug.cgi?id=142617
1266 Reviewed by Darin Adler.
1268 * html/parser/HTMLPreloadScanner.cpp:
1269 (WebCore::TokenPreloadScanner::StartTagScanner::processAttributes):
1271 2015-03-11 Joseph Pecoraro <pecoraro@apple.com>
1273 Unreviewed follow-up fix to r181426. Initialize TextPosition with zeros in case it gets used.
1275 Address ASSERT in LayoutTests/printing/page-format-data.html.
1277 * dom/InlineStyleSheetOwner.cpp:
1278 (WebCore::InlineStyleSheetOwner::InlineStyleSheetOwner):
1279 In case the TextPosition gets used because it wasn't created by a parser,
1280 zeros are more realistic values then beforeFirst.
1282 2015-03-11 Roger Fong <roger_fong@apple.com>
1284 Media element time no longer updates while scrubbing following r181279.
1285 https://bugs.webkit.org/show_bug.cgi?id=142606.
1286 <rdar://problem/20131014>
1288 Reviewed by Eric Carlson.
1290 * Modules/mediacontrols/mediaControlsApple.js:
1291 (Controller.prototype.handleWrapperMouseMove):
1292 Update time as a result of a mouse move if we are scrubbing.
1294 2015-03-11 Joseph Pecoraro <pecoraro@apple.com>
1296 Web Inspector: CSS parser errors in the console should include column numbers
1297 https://bugs.webkit.org/show_bug.cgi?id=114313
1299 Reviewed by Darin Adler.
1301 Test: inspector-protocol/console/warnings-errors.html
1304 (WebCore::CSSParser::currentCharacterOffset):
1305 Get the current character offset depending on the source type.
1306 Add instance variables to track column position and start
1307 line / column for inline stylesheets.
1309 * css/CSSParser.cpp:
1310 (WebCore::CSSParser::CSSParser):
1311 (WebCore::CSSParser::parseSheet):
1312 Initialize new instance variables.
1314 (WebCore::CSSParser::currentLocation):
1315 Update to include column information for the token. Also, if we are on the
1316 first line we may need to take into account a start column offset as well.
1318 (WebCore::CSSParser::realLex):
1319 Set the token's start column.
1320 When bumping the line number, reset the column offset for the next
1321 line with the next character.
1323 (WebCore::CSSParser::syntaxError):
1324 (WebCore::CSSParser::logError):
1325 Include column information.
1327 * css/StyleSheetContents.cpp:
1328 (WebCore::StyleSheetContents::parseAuthorStyleSheet):
1329 (WebCore::StyleSheetContents::parseString):
1330 (WebCore::StyleSheetContents::parseStringAtPosition):
1331 Include column information.
1333 * css/StyleSheetContents.h:
1334 * dom/InlineStyleSheetOwner.cpp:
1335 (WebCore::InlineStyleSheetOwner::InlineStyleSheetOwner):
1336 (WebCore::InlineStyleSheetOwner::createSheet):
1337 Save and use column information later on.
1339 * dom/InlineStyleSheetOwner.h:
1340 * inspector/InspectorStyleSheet.cpp:
1341 (WebCore::InspectorStyleSheet::ensureSourceData):
1342 Updated parser signature needs starting column and no longer has optional parameters.
1344 2015-03-11 Eric Carlson <eric.carlson@apple.com>
1346 [Mac] Update AirPlay handling
1347 https://bugs.webkit.org/show_bug.cgi?id=142541
1349 Reviewed by Sam Weinig.
1351 * WebCore.xcodeproj/project.pbxproj:
1353 (WebCore::Document::showPlaybackTargetPicker):
1354 (WebCore::Document::addPlaybackTargetPickerClient):
1355 (WebCore::Document::removePlaybackTargetPickerClient):
1356 (WebCore::Document::configurePlaybackTargetMonitoring):
1357 (WebCore::Document::requiresPlaybackTargetRouteMonitoring):
1358 (WebCore::Document::playbackTargetAvailabilityDidChange):
1359 (WebCore::Document::didChoosePlaybackTarget):
1361 * html/HTMLMediaElement.cpp:
1362 (WebCore::HTMLMediaElement::registerWithDocument):
1363 (WebCore::HTMLMediaElement::unregisterWithDocument):
1364 (WebCore::HTMLMediaElement::parseAttribute):
1365 * html/HTMLMediaElement.h:
1366 * html/HTMLMediaSession.cpp:
1367 (WebCore::HTMLMediaSession::HTMLMediaSession):
1368 (WebCore::HTMLMediaSession::registerWithDocument):
1369 (WebCore::HTMLMediaSession::unregisterWithDocument):
1370 (WebCore::HTMLMediaSession::showPlaybackTargetPicker):
1371 (WebCore::HTMLMediaSession::hasWirelessPlaybackTargets):
1372 (WebCore::HTMLMediaSession::setHasPlaybackTargetAvailabilityListeners):
1373 (WebCore::HTMLMediaSession::didChoosePlaybackTarget):
1374 (WebCore::HTMLMediaSession::externalOutputDeviceAvailableDidChange):
1375 (WebCore::HTMLMediaSession::requiresPlaybackTargetRouteMonitoring):
1376 * html/HTMLMediaSession.h:
1377 * page/ChromeClient.h:
1379 (WebCore::Page::didChoosePlaybackTarget):
1380 (WebCore::Page::playbackTargetAvailabilityDidChange):
1381 (WebCore::Page::configurePlaybackTargetMonitoring):
1383 (WebCore::Page::hasWirelessPlaybackTarget):
1384 (WebCore::Page::playbackTarget):
1385 * platform/audio/MediaSession.cpp:
1386 (WebCore::MediaSession::clientDataBufferingTimerFired):
1387 (WebCore::MediaSession::wirelessRoutesAvailableDidChange): Deleted.
1388 * platform/audio/MediaSession.h:
1389 (WebCore::MediaSession::didChoosePlaybackTarget):
1390 (WebCore::MediaSession::externalOutputDeviceAvailableDidChange):
1391 (WebCore::MediaSession::requiresPlaybackTargetRouteMonitoring):
1392 (WebCore::MediaSessionClient::setWirelessPlaybackTarget):
1393 * platform/audio/MediaSessionManager.cpp:
1394 (WebCore::MediaSessionManager::wirelessRoutesAvailableChanged): Deleted.
1395 * platform/audio/MediaSessionManager.h:
1396 (WebCore::MediaSessionManager::configureWireLessTargetMonitoring):
1397 * platform/audio/ios/MediaSessionManagerIOS.h:
1398 * platform/audio/ios/MediaSessionManagerIOS.mm:
1399 (WebCore::MediaSessionManageriOS::externalOutputDeviceAvailableDidChange):
1400 (-[WebMediaSessionHelper wirelessRoutesAvailableDidChange:]):
1401 * platform/graphics/AVPlaybackTarget.h: Added.
1402 (WebCore::AVPlaybackTarget::~AVPlaybackTarget):
1403 (WebCore::AVPlaybackTarget::AVPlaybackTarget):
1404 (WebCore::AVPlaybackTarget::setDevicePickerContext):
1405 (WebCore::AVPlaybackTarget::devicePickerContext):
1406 * platform/graphics/AVPlaybackTargetPickerClient.h: Added.
1407 (WebCore::AVPlaybackTargetPickerClient::~AVPlaybackTargetPickerClient):
1408 * platform/graphics/MediaPlayer.cpp:
1409 (WebCore::MediaPlayer::setWirelessPlaybackTarget):
1410 * platform/graphics/MediaPlayer.h:
1411 * platform/graphics/MediaPlayerPrivate.h:
1412 (WebCore::MediaPlayerPrivateInterface::setWirelessPlaybackTarget):
1413 * platform/graphics/avfoundation/AVPlaybackTargetMac.mm: Added.
1414 (WebCore::AVPlaybackTarget::encode):
1415 (WebCore::AVPlaybackTarget::decode):
1416 * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
1417 * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1418 (WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad):
1419 (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer):
1420 (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenLayer):
1421 (WebCore::MediaPlayerPrivateAVFoundationObjC::isCurrentPlaybackTargetWireless):
1422 (WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessPlaybackTargetType):
1423 (WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessVideoPlaybackDisabled):
1424 (WebCore::MediaPlayerPrivateAVFoundationObjC::setWirelessVideoPlaybackDisabled):
1425 (WebCore::MediaPlayerPrivateAVFoundationObjC::setWirelessPlaybackTarget):
1426 (WebCore::MediaPlayerPrivateAVFoundationObjC::updateDisableExternalPlayback):
1427 (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
1429 2015-03-11 Alex Christensen <achristensen@webkit.org>
1431 [Content Extensions] Add resource type and load type triggers.
1432 https://bugs.webkit.org/show_bug.cgi?id=142422
1434 Reviewed by Benjamin Poulain.
1438 * WebCore.xcodeproj/project.pbxproj:
1439 * contentextensions/ContentExtensionCompiler.cpp:
1440 (WebCore::ContentExtensions::compileRuleList):
1441 * contentextensions/ContentExtensionParser.cpp:
1442 (WebCore::ContentExtensions::getTypeFlags):
1443 (WebCore::ContentExtensions::loadTrigger):
1444 * contentextensions/ContentExtensionRule.h:
1445 * contentextensions/ContentExtensionsBackend.cpp:
1446 (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
1447 (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForURL): Deleted.
1448 * contentextensions/ContentExtensionsBackend.h:
1449 * contentextensions/DFABytecode.h:
1450 (WebCore::ContentExtensions::instructionSizeWithArguments):
1451 * contentextensions/DFABytecodeCompiler.cpp:
1452 (WebCore::ContentExtensions::DFABytecodeCompiler::emitAppendConditionalAction):
1453 (WebCore::ContentExtensions::DFABytecodeCompiler::compileNode):
1454 * contentextensions/DFABytecodeCompiler.h:
1455 * contentextensions/DFABytecodeInterpreter.cpp:
1456 (WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
1457 * contentextensions/DFABytecodeInterpreter.h:
1458 * loader/ResourceLoadInfo.cpp: Added.
1459 (WebCore::toResourceType):
1460 (WebCore::readResourceType):
1461 (WebCore::readLoadType):
1462 (WebCore::ResourceLoadInfo::isThirdParty):
1463 (WebCore::ResourceLoadInfo::getResourceFlags):
1464 * loader/ResourceLoadInfo.h: Added.
1465 * loader/cache/CachedResourceLoader.cpp:
1466 (WebCore::CachedResourceLoader::requestResource):
1467 * page/UserContentController.cpp:
1468 (WebCore::UserContentController::actionsForResourceLoad):
1469 (WebCore::UserContentController::actionsForURL): Deleted.
1470 * page/UserContentController.h:
1472 2015-03-11 Tim Horton <timothy_horton@apple.com>
1476 * page/EventHandler.cpp:
1477 (WebCore::EventHandler::selectClosestWordFromHitTestResult):
1478 (WebCore::EventHandler::selectClosestWordOrLinkFromMouseEvent):
1479 (WebCore::EventHandler::handleMousePressEventTripleClick):
1480 (WebCore::EventHandler::handleMousePressEventSingleClick):
1482 2015-03-11 Timothy Horton <timothy_horton@apple.com>
1484 <attachment> shouldn't use "user-select: all"
1485 https://bugs.webkit.org/show_bug.cgi?id=142453
1487 Reviewed by Darin Adler.
1489 It turns out that "user-select: all" is rife with bugs; in lieu of fixing them
1490 all (at least for now), let's not use "user-select: all" in the default stylesheet
1491 for <attachment>. It's really overkill anyway, since <attachment> can't have children.
1492 The only "user-select: all" behavior we actually want is select-on-click.
1493 So, we'll implement that in a slightly different way.
1495 Tests: fast/attachment/attachment-select-on-click-inside-user-select-all.html
1496 fast/attachment/attachment-select-on-click.html
1500 No more "user-select: all".
1502 (attachment:focus): Deleted.
1503 We stopped using attachment focus a while back and forgot to remove this.
1506 (WebCore::Node::shouldSelectOnMouseDown):
1507 Add a virtual function that Node subclasses can override to indicate they
1508 should be selected on mouse down.
1510 * html/HTMLAttachmentElement.h:
1511 Override the aforementioned virtual function; <attachment> should always
1512 be selected on mouse down.
1514 * page/EventHandler.cpp:
1515 (WebCore::nodeToSelectOnMouseDownForNode):
1516 Determine which node should be selected when a mousedown hits the given node.
1517 If there's any "user-select: all", we go with the outermost "user-select: all".
1518 Otherwise, we give the node a chance to say that it wants to be selected itself.
1520 (WebCore::expandSelectionToRespectSelectOnMouseDown):
1521 Rename this function, it's not just about "user-select: all" anymore.
1522 Make use of nodeToSelectOnMouseDownForNode.
1524 (WebCore::EventHandler::selectClosestWordFromHitTestResult):
1525 (WebCore::EventHandler::selectClosestWordOrLinkFromMouseEvent):
1526 (WebCore::EventHandler::handleMousePressEventTripleClick):
1527 (WebCore::EventHandler::handleMousePressEventSingleClick):
1528 (WebCore::expandSelectionToRespectUserSelectAll): Deleted.
1529 Adjust to the new names.
1531 2015-03-11 Geoffrey Garen <ggaren@apple.com>
1533 Users of Heap::deprecatedReportExtraMemory should switch to reportExtraMemoryAllocated+reportExtraMemoryVisited
1534 https://bugs.webkit.org/show_bug.cgi?id=142595
1536 Reviewed by Andreas Kling.
1538 Fixed this bug for canvas.
1540 * html/HTMLCanvasElement.cpp:
1541 (WebCore::HTMLCanvasElement::memoryCost): Factored out the helper function
1542 required by our IDL generator.
1544 (WebCore::HTMLCanvasElement::createImageBuffer): Use
1545 reportExtraMemoryAllocated.
1547 * html/HTMLCanvasElement.h:
1549 * html/HTMLCanvasElement.idl: Adopt the IDL for reporting cost in the
1550 right way during GC. This will match our reportExtraMemoryAllocated
1551 with a reportExtraMemoryVisited during GC.
1553 2015-03-11 Roger Fong <roger_fong@apple.com>
1555 A number of minor edits to the media controls on OSX.
1556 https://bugs.webkit.org/show_bug.cgi?id=142551.
1557 <rdar://problem/20114707>
1559 Reviewed by Darin Adler.
1561 This covers a slew of minor edits to the new media controls. They are as follows.
1562 Small vertical placements adjustments to inline control elements.
1563 Make sure buttons have no focus outlines.
1564 Expand height of mute box that triggers the volume panel appearing.
1565 Turn all button colors into an slightly transparent white.
1566 Center status display text in fullscreen mode.
1567 Lower position of captions container in fullscreen mode.
1568 Show the controls on when done loading of the video an status display is hidden.
1570 * Modules/mediacontrols/mediaControlsApple.css:
1571 (audio::-webkit-media-controls-panel):
1572 (audio::-webkit-media-controls-panel button:focus):
1573 (audio::-webkit-media-controls-rewind-button):
1574 (audio::-webkit-media-controls-play-button):
1575 (audio::-webkit-media-controls-play-button.paused):
1576 (audio::-webkit-media-controls-panel .mute-box):
1577 (video::-webkit-media-controls-volume-max-button):
1578 (audio::-webkit-media-controls-panel .volume-box):
1579 (video::-webkit-media-controls-volume-min-button):
1580 (audio::-webkit-media-controls-wireless-playback-picker-button):
1581 (audio::-webkit-media-controls-toggle-closed-captions-button):
1582 (audio::-webkit-media-controls-closed-captions-container li.selected:hover::before):
1583 (audio::-webkit-media-controls-fullscreen-button):
1584 (audio::-webkit-media-controls-fullscreen-button.exit):
1585 (audio::-webkit-media-controls-status-display):
1586 (audio::-webkit-media-controls-time-remaining-display):
1587 (video:-webkit-full-screen::-webkit-media-controls-panel .volume-box):
1588 (video:-webkit-full-screen::-webkit-media-controls-volume-max-button):
1589 (video:-webkit-full-screen::-webkit-media-controls-volume-min-button):
1590 (video:-webkit-full-screen::-webkit-media-controls-play-button):
1591 (video:-webkit-full-screen::-webkit-media-controls-play-button.paused):
1592 (video:-webkit-full-screen::-webkit-media-controls-seek-back-button):
1593 (video:-webkit-full-screen::-webkit-media-controls-seek-forward-button):
1594 (video:-webkit-full-screen::-webkit-media-controls-status-display):
1595 (video:-webkit-full-screen::-webkit-media-controls-closed-captions-container):
1596 (audio::-webkit-media-controls-panel button:active): Deleted.
1597 * Modules/mediacontrols/mediaControlsApple.js:
1598 (Controller.prototype.setStatusHidden):
1600 2015-03-11 Commit Queue <commit-queue@webkit.org>
1602 Unreviewed, rolling out r179340 and r179344.
1603 https://bugs.webkit.org/show_bug.cgi?id=142598
1605 Caused images to stay alive forever when navigating away from
1606 the page before they finish loading. (Requested by kling on
1609 Reverted changesets:
1611 "CachedImage: ensure clients overrides imageChanged instead of
1613 https://bugs.webkit.org/show_bug.cgi?id=140722
1614 http://trac.webkit.org/changeset/179340
1616 "HTMLImageLoader: fix build failure on assert condition after
1618 https://bugs.webkit.org/show_bug.cgi?id=140722
1619 http://trac.webkit.org/changeset/179344
1621 2015-03-11 Geoffrey Garen <ggaren@apple.com>
1623 Many users of Heap::reportExtraMemory* are wrong, causing lots of memory growth
1624 https://bugs.webkit.org/show_bug.cgi?id=142593
1626 Reviewed by Andreas Kling.
1628 Adopt deprecatedReportExtraMemory as a short-term fix for runaway
1629 memory growth in these cases where we have not adopted
1630 reportExtraMemoryVisited.
1632 Long-term, we should use reportExtraMemoryAllocated+reportExtraMemoryVisited.
1633 That's tracked by https://bugs.webkit.org/show_bug.cgi?id=142595.
1635 Using IOSDebug, I can see that the canvas stress test @ http://jsfiddle.net/fvyw4ba0/,
1636 which used to keep > 1000 1MB NonVolatile GPU allocations live, now keeps about 10 live.
1638 * Modules/mediasource/SourceBuffer.cpp:
1639 (WebCore::SourceBuffer::reportExtraMemoryAllocated):
1640 * bindings/js/JSDocumentCustom.cpp:
1642 * bindings/js/JSImageDataCustom.cpp:
1644 * bindings/js/JSNodeListCustom.cpp:
1645 (WebCore::createWrapper):
1646 * dom/CollectionIndexCache.cpp:
1647 (WebCore::reportExtraMemoryAllocatedForCollectionIndexCache):
1648 * html/HTMLCanvasElement.cpp:
1649 (WebCore::HTMLCanvasElement::createImageBuffer):
1650 * html/HTMLImageLoader.cpp:
1651 (WebCore::HTMLImageLoader::imageChanged):
1652 * html/HTMLMediaElement.cpp:
1653 (WebCore::HTMLMediaElement::parseAttribute):
1654 * xml/XMLHttpRequest.cpp:
1655 (WebCore::XMLHttpRequest::dropProtection):
1657 2015-03-10 Andy Estes <aestes@apple.com>
1659 REGRESSION (r180985): contentfiltering/block-after-add-data.html crashes with GuardMalloc
1660 https://bugs.webkit.org/show_bug.cgi?id=142526
1662 Reviewed by Darin Adler.
1664 * loader/DocumentLoader.cpp:
1665 (WebCore::DocumentLoader::dataReceived): Don't delete m_contentFilter until after we're done using its replacement data.
1667 2015-03-10 Sam Weinig <sam@webkit.org>
1669 Allow adding a button in input elements for auto fill related functionality
1670 <rdar://problem/19782066>
1671 https://bugs.webkit.org/show_bug.cgi?id=142564
1673 Reviewed by Anders Carlsson.
1675 Test: fast/forms/input-auto-fill-button.html
1677 - Adds a new button that can be shown in <input> elements - AutoFillButtonElement.
1678 - Makes the spelling of AutoFill consistent throughout WebCore and WebKit (except
1679 where not feasible due to exported API/SPI).
1682 * WebCore.vcxproj/WebCore.vcxproj:
1683 * WebCore.vcxproj/WebCore.vcxproj.filters:
1684 * WebCore.xcodeproj/project.pbxproj:
1688 (input::-webkit-auto-fill-button):
1689 (input::-webkit-auto-fill-button:hover):
1690 (input::-webkit-auto-fill-button:active):
1691 Add default style rules for the AutoFill button based on the ones
1692 used for caps lock indicator.
1694 * html/HTMLInputElement.cpp:
1695 (WebCore::HTMLInputElement::HTMLInputElement):
1696 (WebCore::HTMLInputElement::autoFillButtonElement):
1697 (WebCore::HTMLInputElement::reset):
1698 (WebCore::HTMLInputElement::setValueFromRenderer):
1699 (WebCore::HTMLInputElement::setAutoFilled):
1700 (WebCore::HTMLInputElement::setShowAutoFillButton):
1701 (WebCore::HTMLInputElement::setAutofilled): Deleted.
1702 * html/HTMLInputElement.h:
1703 (WebCore::HTMLInputElement::isAutoFilled):
1704 (WebCore::HTMLInputElement::showAutoFillButton):
1705 (WebCore::HTMLInputElement::isAutofilled): Deleted.
1706 Add new bit to represent whether the AutoFill button should be shown
1707 or not. By default it is not shown, and the client must enable it.
1709 * html/InputType.cpp:
1710 (WebCore::InputType::updateAutoFillButton):
1712 (WebCore::InputType::autoFillButtonElement):
1713 Add new virtual methods for updating and accessing the AutoFill button.
1715 * html/TextFieldInputType.cpp:
1716 (WebCore::TextFieldInputType::createShadowSubtree):
1717 (WebCore::TextFieldInputType::autoFillButtonElement):
1718 (WebCore::TextFieldInputType::destroyShadowSubtree):
1719 (WebCore::TextFieldInputType::updatePlaceholderText):
1720 (WebCore::TextFieldInputType::shouldDrawAutoFillButton):
1721 (WebCore::TextFieldInputType::autoFillButtonElementWasClicked):
1722 (WebCore::TextFieldInputType::createContainer):
1723 (WebCore::TextFieldInputType::createAutoFillButton):
1724 (WebCore::TextFieldInputType::updateAutoFillButton):
1725 * html/TextFieldInputType.h:
1726 Add support for adding the AutoFill to the shadow DOM of textfields. The implementation
1727 is slightly different than for the caps lock indicator, because I didn't want to force
1728 the creation of a container for all <input> elements just in case an AutoFill button was
1729 added. Instead, if an AutoFill button is added, the container is created on the fly and
1730 the existing DOM is updated to move into it. Once a container is created, it is never
1733 * html/shadow/AutoFillButtonElement.cpp: Added.
1734 (WebCore::AutoFillButtonElement::create):
1735 (WebCore::AutoFillButtonElement::AutoFillButtonElement):
1736 (WebCore::AutoFillButtonElement::defaultEventHandler):
1737 * html/shadow/AutoFillButtonElement.h: Added.
1738 Add div subclass that swallows the click event and forwards it to the ChromeClient.
1740 * page/ChromeClient.h:
1741 Add handleAutoFillButtonClick client function to inform WebKit that the AutoFill
1744 * testing/Internals.cpp:
1745 (WebCore::Internals::setAutofilled):
1746 (WebCore::Internals::setShowAutoFillButton):
1747 * testing/Internals.h:
1748 * testing/Internals.idl:
1749 Expose a new internals.setShowAutoFillButton() function to allow testing
1750 of the AutoFill button from layout tests.
1752 * accessibility/AccessibilityObject.cpp:
1753 (WebCore::AccessibilityObject::isValueAutofilled):
1754 * css/SelectorCheckerTestFunctions.h:
1755 (WebCore::isAutofilled):
1756 * css/StyleResolver.cpp:
1757 (WebCore::StyleResolver::canShareStyleWithControl):
1758 Update for new spelling of AutoFill.
1760 2015-03-11 Geoffrey Garen <ggaren@apple.com>
1762 Refactored the JSC::Heap extra cost API for clarity and to make some known bugs more obvious
1763 https://bugs.webkit.org/show_bug.cgi?id=142589
1765 Reviewed by Andreas Kling.
1767 Updated for renames to JSC extra cost APIs.
1769 Added FIXMEs to our 10 use cases that are currently wrong, including
1770 canvas, which is the cause of https://bugs.webkit.org/show_bug.cgi?id=142457.
1772 * Modules/mediasource/SourceBuffer.cpp:
1773 (WebCore::SourceBuffer::appendBufferInternal):
1774 (WebCore::SourceBuffer::sourceBufferPrivateAppendComplete):
1775 (WebCore::SourceBuffer::reportExtraMemoryAllocated):
1776 (WebCore::SourceBuffer::reportExtraMemoryCost): Deleted.
1777 * Modules/mediasource/SourceBuffer.h:
1778 * bindings/js/JSDocumentCustom.cpp:
1780 * bindings/js/JSImageDataCustom.cpp:
1782 * bindings/js/JSNodeListCustom.cpp:
1783 (WebCore::createWrapper):
1784 * bindings/scripts/CodeGeneratorJS.pm:
1785 (GenerateImplementation):
1786 * dom/CollectionIndexCache.cpp:
1787 (WebCore::reportExtraMemoryAllocatedForCollectionIndexCache):
1788 (WebCore::reportExtraMemoryCostForCollectionIndexCache): Deleted.
1789 * dom/CollectionIndexCache.h:
1790 (WebCore::Iterator>::computeNodeCountUpdatingListCache):
1791 * html/HTMLCanvasElement.cpp:
1792 (WebCore::HTMLCanvasElement::createImageBuffer):
1793 * html/HTMLCollection.h:
1794 (WebCore::CollectionNamedElementCache::didPopulate):
1795 * html/HTMLImageLoader.cpp:
1796 (WebCore::HTMLImageLoader::imageChanged):
1797 * html/HTMLMediaElement.cpp:
1798 (WebCore::HTMLMediaElement::parseAttribute):
1799 * xml/XMLHttpRequest.cpp:
1800 (WebCore::XMLHttpRequest::dropProtection):
1802 2015-03-11 Benjamin Poulain <bpoulain@apple.com>
1804 Add basic support for BOL and EOL assertions to the URL Filter parser
1805 https://bugs.webkit.org/show_bug.cgi?id=142568
1807 Reviewed by Alex Christensen.
1809 This patch adds heavily restricted support for BOL and EOL to the URL filter parser.
1811 Both assertions must be the first/last term of their pattern. Any advanced combination
1812 results in a parsing error.
1814 The BOL assertion is easy to represent: currently, any pattern starts at the beginning
1815 of a line and the NFA are generated accordingly.
1817 I had two options to represent the EOL assertion:
1818 1) Add a new special transition on EOL.
1819 2) Add a new vector of actions to the states, conditional to the EOL input.
1821 I picked the first option to avoid growing every state by a vector
1822 that would be empty in the vast majority of cases.
1825 On the matching side, the interpreter was modified to support transitions on '\0'.
1826 DFABytecodeInstruction::CheckValue now stops when running on a character after
1827 the end of the string.
1829 DFABytecodeInstruction::Jump gets two fixes: First we now account for the index
1830 to avoid going past the end of the input. Second, stop on '\0' too... the reason
1831 is that the unconditional jump is only used for fallback edges of the DFA, fallback
1832 edge are not supposed to accept '\0'.
1834 * contentextensions/DFA.cpp:
1835 (WebCore::ContentExtensions::printTransitions):
1836 * contentextensions/DFABytecodeInterpreter.cpp:
1837 (WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
1838 * contentextensions/DFANode.h:
1839 * contentextensions/NFA.cpp:
1840 (WebCore::ContentExtensions::NFA::addTransition):
1841 (WebCore::ContentExtensions::NFA::addEpsilonTransition):
1842 (WebCore::ContentExtensions::printTransitions):
1843 * contentextensions/NFANode.h:
1844 * contentextensions/NFAToDFA.cpp:
1845 (WebCore::ContentExtensions::populateTransitions):
1846 (WebCore::ContentExtensions::NFAToDFA::convert):
1847 * contentextensions/URLFilterParser.cpp:
1848 (WebCore::ContentExtensions::Term::Term):
1849 (WebCore::ContentExtensions::Term::isEndOfLineAssertion):
1850 (WebCore::ContentExtensions::GraphBuilder::assertionBOL):
1851 (WebCore::ContentExtensions::GraphBuilder::assertionEOL):
1852 (WebCore::ContentExtensions::GraphBuilder::sinkFloatingTermIfNecessary):
1854 2015-03-11 Jer Noble <jer.noble@apple.com>
1856 [Mac] Update fullscreen placeholder UI to use Vibrancy.
1857 https://bugs.webkit.org/show_bug.cgi?id=142586
1859 Reviewed by Eric Carlson.
1861 Update the fullscreen placeholder with a translucent vibrant appearance
1862 using NSVisualEffectView. Since NSVisuaEffectView is only available for
1863 OS X 10.10 and above, wrap the new implementation in a version check and
1864 retain the old implementation.
1866 Drive-by: Update the strings for the placeholder view with new HI guidance
1869 * English.lproj/Localizable.strings:
1870 * platform/LocalizedStrings.cpp:
1871 (WebCore::clickToExitFullScreenText):
1872 * platform/mac/WebCoreFullScreenPlaceholderView.h:
1873 * platform/mac/WebCoreFullScreenPlaceholderView.mm:
1874 (-[WebCoreFullScreenPlaceholderView setExitWarningVisible:]):
1876 2015-03-11 Timothy Horton <timothy_horton@apple.com>
1878 Make it possible to zoom on pages that claim to lay out to device size and then fail to do so
1879 https://bugs.webkit.org/show_bug.cgi?id=142549
1881 Reviewed by Simon Fraser.
1883 * page/ViewportConfiguration.cpp:
1884 (WebCore::ViewportConfiguration::ViewportConfiguration):
1885 Rename m_ignoreScalingConstraints to m_canIgnoreScalingConstraints,
1886 because it being true does not guarantee that we will ignore scaling constraints,
1887 but it being false does guarantee that we won't.
1889 (WebCore::ViewportConfiguration::shouldIgnoreScalingConstraints):
1890 Ignore scaling constraints if the page:
1891 a) claimed to want to lay out to device-width and then laid out too wide
1892 b) claimed to want to lay out to device-height and then laid out too tall
1893 c) claimed to want to lay out with initialScale=1 and then laid out too wide
1895 (WebCore::ViewportConfiguration::initialScale):
1896 (WebCore::ViewportConfiguration::minimumScale):
1897 (WebCore::ViewportConfiguration::allowsUserScaling):
1898 Call shouldIgnoreScalingConstraints() instead of looking at the local, so we can
1899 have some more logic here (as above).
1901 (WebCore::ViewportConfiguration::description):
1902 Dump whether we're ignoring scaling constraints.
1904 (WebCore::ViewportConfiguration::dump):
1905 Use WTFLogAlways so that the output goes to various other logging mechanisms
1906 instead of just stderr.
1908 * page/ViewportConfiguration.h:
1909 (WebCore::ViewportConfiguration::setCanIgnoreScalingConstraints):
1910 (WebCore::ViewportConfiguration::setIgnoreScalingConstraints): Deleted.
1912 2015-03-11 Myles C. Maxfield <mmaxfield@apple.com>
1914 Use out-of-band messaging for RenderBox::firstLineBaseline() and RenderBox::inlineBlockBaseline()
1915 https://bugs.webkit.org/show_bug.cgi?id=142569
1917 Reviewed by David Hyatt.
1919 Currently, RenderBox::firstLineBaseline() and RenderBox::inlineBlockBaseline() return -1 to mean
1920 that its baseline should be skipped. Instead of using this sentinel value, this patch changes the
1921 return type from int to Optional<int>.
1923 No new tests because there is no behavior change.
1925 * rendering/RenderBlock.cpp:
1926 (WebCore::RenderBlock::baselinePosition):
1927 (WebCore::RenderBlock::firstLineBaseline):
1928 (WebCore::RenderBlock::inlineBlockBaseline):
1929 * rendering/RenderBlock.h:
1930 * rendering/RenderBlockFlow.cpp:
1931 (WebCore::RenderBlockFlow::firstLineBaseline):
1932 (WebCore::RenderBlockFlow::inlineBlockBaseline):
1933 * rendering/RenderBlockFlow.h:
1934 * rendering/RenderBox.h:
1935 (WebCore::RenderBox::firstLineBaseline):
1936 (WebCore::RenderBox::inlineBlockBaseline):
1937 * rendering/RenderDeprecatedFlexibleBox.cpp:
1938 (WebCore::RenderDeprecatedFlexibleBox::layoutHorizontalBox):
1939 * rendering/RenderFlexibleBox.cpp:
1940 (WebCore::RenderFlexibleBox::baselinePosition):
1941 (WebCore::RenderFlexibleBox::firstLineBaseline):
1942 (WebCore::RenderFlexibleBox::inlineBlockBaseline):
1943 (WebCore::RenderFlexibleBox::marginBoxAscentForChild):
1944 * rendering/RenderFlexibleBox.h:
1945 * rendering/RenderMenuList.h:
1946 * rendering/RenderTable.cpp:
1947 (WebCore::RenderTable::cellAbove):
1948 (WebCore::RenderTable::cellBelow):
1949 (WebCore::RenderTable::cellBefore):
1950 (WebCore::RenderTable::cellAfter):
1951 (WebCore::RenderTable::firstLineBlock):
1952 (WebCore::RenderTable::baselinePosition):
1953 (WebCore::RenderTable::inlineBlockBaseline):
1954 (WebCore::RenderTable::firstLineBaseline):
1955 * rendering/RenderTable.h:
1956 * rendering/RenderTableCell.cpp:
1957 (WebCore::RenderTableCell::cellBaselinePosition):
1958 * rendering/RenderTableSection.cpp:
1959 (WebCore::RenderTableSection::firstLineBaseline):
1960 * rendering/RenderTableSection.h:
1961 * rendering/RenderTextControl.h:
1962 * rendering/mathml/RenderMathMLBlock.cpp:
1963 (WebCore::RenderMathMLBlock::baselinePosition):
1964 (WebCore::RenderMathMLTable::firstLineBaseline):
1965 * rendering/mathml/RenderMathMLBlock.h:
1966 * rendering/mathml/RenderMathMLFraction.cpp:
1967 (WebCore::RenderMathMLFraction::firstLineBaseline):
1968 * rendering/mathml/RenderMathMLFraction.h:
1969 * rendering/mathml/RenderMathMLOperator.cpp:
1970 (WebCore::RenderMathMLOperator::firstLineBaseline):
1971 * rendering/mathml/RenderMathMLOperator.h:
1972 * rendering/mathml/RenderMathMLRoot.cpp:
1973 (WebCore::RenderMathMLRoot::firstLineBaseline):
1974 (WebCore::RenderMathMLRoot::layout):
1975 * rendering/mathml/RenderMathMLRoot.h:
1976 * rendering/mathml/RenderMathMLRow.cpp:
1977 (WebCore::RenderMathMLRow::layout):
1978 * rendering/mathml/RenderMathMLScripts.cpp:
1979 (WebCore::RenderMathMLScripts::layout):
1980 (WebCore::RenderMathMLScripts::firstLineBaseline):
1981 * rendering/mathml/RenderMathMLScripts.h:
1982 * rendering/mathml/RenderMathMLSpace.cpp:
1983 (WebCore::RenderMathMLSpace::firstLineBaseline):
1984 * rendering/mathml/RenderMathMLSpace.h:
1985 * rendering/mathml/RenderMathMLUnderOver.cpp:
1986 (WebCore::RenderMathMLUnderOver::firstLineBaseline):
1987 * rendering/mathml/RenderMathMLUnderOver.h:
1989 2015-03-11 Timothy Horton <timothy_horton@apple.com>
1991 <attachment>s should be created when dropping files onto contentEditable areas
1992 https://bugs.webkit.org/show_bug.cgi?id=142494
1993 <rdar://problem/19982553>
1995 Reviewed by Anders Carlsson.
1997 Covered by existing tests.
1999 * editing/mac/EditorMac.mm:
2000 (WebCore::Editor::WebContentReader::readFilenames):
2001 Instead of inserting the dropped URLs as strings, make an <attachment>
2004 2015-03-11 David Hyatt <hyatt@apple.com>
2006 Optimize offsetWidth and offsetHeight to avoid doing layouts.
2007 https://bugs.webkit.org/show_bug.cgi?id=142544
2009 Reviewed by Beth Dakin.
2012 (WebCore::Document::updateLayoutIfDimensionsOutOfDate):
2014 Added a new method that only updates layout if it determines that the desired dimensions are out
2018 (WebCore::Element::offsetWidth):
2019 (WebCore::Element::offsetHeight):
2020 Patch offsetWidth and offsetHeight to call the new method rather than updateLayoutIgnorePendingStylesheets.
2022 2015-03-11 Commit Queue <commit-queue@webkit.org>
2024 Unreviewed, rolling out r181367.
2025 https://bugs.webkit.org/show_bug.cgi?id=142581
2027 Caused crashes on the debug bots (Requested by cdumez on
2032 "Web Inspector: CSS parser errors in the console should
2033 include column numbers"
2034 https://bugs.webkit.org/show_bug.cgi?id=114313
2035 http://trac.webkit.org/changeset/181367
2037 2015-03-11 Myles C. Maxfield <mmaxfield@apple.com>
2039 Inline block children do not have correct baselines if their children are also block elements
2040 https://bugs.webkit.org/show_bug.cgi?id=142559
2042 Reviewed by Darin Adler.
2044 Perform the same computation on child block elements as child inline elements.
2046 Test: fast/text/baseline-inline-block-block-children.html
2048 * rendering/RenderBlockFlow.cpp:
2049 (WebCore::RenderBlockFlow::inlineBlockBaseline):
2051 2015-03-11 Carlos Alberto Lopez Perez <clopez@igalia.com>
2053 [CMake][GStreamer] Building EFL or GTK with ENABLE_VIDEO and without ENABLE_WEB_AUDIO is broken.
2054 https://bugs.webkit.org/show_bug.cgi?id=142577
2056 Reviewed by Carlos Garcia Campos.
2058 No new tests, this is a build fix.
2060 * PlatformEfl.cmake: Include GSTREAMER_AUDIO_LIBRARIES on the link step both for ENABLE_VIDEO and ENABLE_WEB_AUDIO.
2061 * PlatformGTK.cmake: Idem.
2063 2015-03-10 Philippe Normand <pnormand@igalia.com>
2065 Rename MediaStreamCenter to RealtimeMediaSourceCenter
2066 https://bugs.webkit.org/show_bug.cgi?id=142535
2068 Reviewed by Eric Carlson.
2070 As per bug title, rename MediaStreamCenter to
2071 RealtimeMediaSourceCenter, this class manages
2072 RealtimeMediaSources, not MediaStreams. Some un-needed includes of
2073 the header were also removed.
2075 2015-03-11 Gyuyoung Kim <gyuyoung.kim@samsung.com>
2077 Remove unnecessary create() factory functions
2078 https://bugs.webkit.org/show_bug.cgi?id=142558
2080 Reviewed by Darin Adler.
2082 create() function which just returns new instance can be replaced with std::make_unique<>.
2084 No new tests, no behavior changes.
2086 * bindings/js/JSCryptoKeySerializationJWK.cpp:
2087 (WebCore::JSCryptoKeySerializationJWK::keyDataOctetSequence):
2088 * crypto/keys/CryptoKeyAES.cpp:
2089 (WebCore::CryptoKeyAES::exportData):
2090 * crypto/keys/CryptoKeyDataOctetSequence.h:
2091 * crypto/keys/CryptoKeyHMAC.cpp:
2092 (WebCore::CryptoKeyHMAC::exportData):
2093 * crypto/keys/CryptoKeySerializationRaw.cpp:
2094 (WebCore::CryptoKeySerializationRaw::keyData):
2095 * platform/audio/mac/CARingBuffer.cpp:
2096 (WebCore::CARingBuffer::create): Deleted.
2097 * platform/audio/mac/CARingBuffer.h:
2098 * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
2099 (WebCore::AudioSourceProviderAVFObjC::prepare):
2100 * testing/Internals.cpp:
2101 (WebCore::Internals::queueMicroTask):
2102 * testing/MicroTaskTest.cpp:
2103 (WebCore::MicroTaskTest::create): Deleted.
2104 * testing/MicroTaskTest.h:
2105 (WebCore::MicroTaskTest::MicroTaskTest):
2107 2015-03-10 Joseph Pecoraro <pecoraro@apple.com>
2109 Web Inspector: CSS parser errors in the console should include column numbers
2110 https://bugs.webkit.org/show_bug.cgi?id=114313
2112 Reviewed by Benjamin Poulain.
2114 Test: inspector-protocol/console/warnings-errors.html
2117 (WebCore::CSSParser::currentCharacterOffset):
2118 Get the current character offset depending on the source type.
2119 Add instance variables to track column position and start
2120 line / column for inline stylesheets.
2122 * css/CSSParser.cpp:
2123 (WebCore::CSSParser::CSSParser):
2124 (WebCore::CSSParser::parseSheet):
2125 Initialize new instance variables.
2127 (WebCore::CSSParser::currentLocation):
2128 Update to include column information. Also, if we are on the first line
2129 we may need to take into account a start column offset as well.
2131 (WebCore::CSSParser::realLex):
2132 When bumping the line number, reset the column offset for the next
2133 line with the next character.
2135 (WebCore::CSSParser::syntaxError):
2136 (WebCore::CSSParser::logError):
2137 Include column information.
2139 * css/StyleSheetContents.cpp:
2140 (WebCore::StyleSheetContents::parseAuthorStyleSheet):
2141 (WebCore::StyleSheetContents::parseString):
2142 (WebCore::StyleSheetContents::parseStringAtLineAndColumn):
2143 Include column information.
2145 * css/StyleSheetContents.h:
2146 * dom/InlineStyleSheetOwner.cpp:
2147 (WebCore::InlineStyleSheetOwner::InlineStyleSheetOwner):
2148 (WebCore::InlineStyleSheetOwner::createSheet):
2149 Save and use column information later on.
2151 * dom/InlineStyleSheetOwner.h:
2152 * inspector/InspectorStyleSheet.cpp:
2153 (WebCore::InspectorStyleSheet::ensureSourceData):
2154 Updated parser signature needs starting column and no longer has optional parameters.
2156 2015-03-10 Darin Adler <darin@apple.com>
2158 Try to fix the GTK build.
2160 * html/HTMLVideoElement.idl: Work around gobject bindings generator limitation
2161 by putting in a LANGUAGE_GOBJECT conditional.
2163 2015-03-10 Darin Adler <darin@apple.com>
2165 Some event handler fixes
2166 https://bugs.webkit.org/show_bug.cgi?id=142474
2168 Reviewed by Anders Carlsson.
2170 * bindings/scripts/CodeGenerator.pm:
2171 (GenerateConditionalStringFromAttributeValue): Improved the algorithm here to
2172 handle combinations of & and | in conditional expressions; that's coming up when
2173 combining conditionals for includes in NavigatorContentUtils.idl.
2175 * bindings/scripts/CodeGeneratorJS.pm:
2176 (AddToImplIncludes): Removed the rudimentary attempt to split and merge
2177 conditionals involving | here; instead we rely on the rules in the
2178 GenerateConditionalStringFromAttributeValue to handle this.
2179 (GenerateImplementation): Passed new "conditional" argument to JSValueToNative.
2180 (GenerateParametersCheck): Pass "conditional" argument to AddToImplIncludes and
2182 (JSValueToNative): Changed to take "conditional" as an argument, since getting
2183 it from the signature won't work for a method parameter.
2184 (WriteData): Merge duplicates based on the result of the
2185 GenerateConditionalStringFromAttributeValue function rather than on the values
2186 passed into that function, since that function converts conditionals into a
2187 canonical form and can make two strings equal that don't start out that way.
2189 * bindings/scripts/CodeGeneratorObjC.pm:
2190 (SkipAttribute): Added code to guarantee we won't make Objective-C bindings
2191 for event handlers. We will rename EventListener to EventHandler in a
2194 * bindings/scripts/test/JS/JSTestInterface.cpp: Updated for a progression caused
2195 by the better logic for conditional includes.
2197 * bindings/scripts/test/JS/JSTestObj.cpp: Updated for change to the test below.
2198 * bindings/scripts/test/TestObj.idl: Added test of an event handler attribute.
2200 * dom/Document.idl: Removed unneeded language #if around event handler
2201 attributes. Removed all the commented out event handler attributes.
2202 Sorted event handler attributes into a single section rather than separating
2203 "standard" from "extensions". Sorted the conditional event handler attributes
2204 into paragraphs at the bottom. We will probably make them all unconditional
2205 in a subsequent patch.
2207 * dom/Element.idl: Removed unneeded language #if around event handler
2208 attributes. Removed all the commented out event handler attributes.
2209 Moved event handler attributes here from all derived element classes to
2210 match the approach from the HTML standard. Also resorted the attributes
2211 as in Document above.
2213 * html/HTMLBodyElement.idl: Removed unneeded language #if around event handler
2214 attributes. Removed all the commented out event handler attributes.
2215 Sorted event handler attributes into a single section rather than separating
2216 "standard" from "overrides".
2218 * html/HTMLElement.cpp:
2219 (WebCore::HTMLElement::populateEventNameForAttributeLocalNameMap):
2220 Added a few missing attribute names, and re-sorted a bit. Moved any from
2221 element subclasses here.
2223 * html/HTMLFormElement.cpp:
2224 (WebCore::HTMLFormElement::parseAttribute): Moved code to handle
2225 oncomplete and oncompleteerror to Element and HTMLElement.
2226 * html/HTMLFormElement.idl: Ditto.
2228 * html/HTMLFrameSetElement.idl: Removed #if and resorted as above.
2230 * html/HTMLInputElement.cpp:
2231 (WebCore::HTMLInputElement::parseAttribute): Moved code to handle
2232 onsearch to HTMLElement.
2234 * html/HTMLMediaElement.cpp:
2235 (WebCore::HTMLMediaElement::parseAttribute): Moved code to handle
2236 all the event handler attributes to HTMLElement.
2237 (WebCore::HTMLMediaElement::updateCaptionContainer): Removed a redundant
2238 if statement I noticed while auditing all calls to JSC::call.
2239 (WebCore::HTMLMediaElement::didAddUserAgentShadowRoot): Added clearException.
2240 I noticed this was missing because a flawed earlier version of my patch was
2241 causing the script to fail, leaving an exception behind that caused an
2242 assertion later. So I audited all calls to JSC::call looking for this mistake.
2244 * html/HTMLMediaElement.idl: Moved all the event handlers from here to
2245 Element. Also changed everything possible to use Conditional instead of #if.
2247 * html/HTMLPlugInImageElement.cpp:
2248 (WebCore::HTMLPlugInImageElement::didAddUserAgentShadowRoot): Added
2249 clearException. Noticed it was missing while auditing all calls to JSC::call.
2251 * html/HTMLVideoElement.cpp:
2252 (WebCore::HTMLVideoElement::parseAttribute): Moved event handler code to
2255 * html/HTMLVideoElement.idl: Moved event handler to Element.idl and use
2256 Conditional instead of #if.
2258 * page/DOMWindow.idl: Use Conditional instead of #if and tidy up the event
2261 * svg/svgattrs.in: Remove six unused attribute names. Presumably used in
2262 some older scheme to implement event handlers but no longer used at all.
2264 2015-03-10 Brent Fulgham <bfulgham@apple.com>
2266 CSS scroll-snap-destination and scroll-snap-coordinate are not honoring position values
2267 https://bugs.webkit.org/show_bug.cgi?id=142411
2269 Reviewed by Simon Fraser.
2271 Tested by css3/scroll-snap/scroll-snap-position-values.html.
2273 Revise the CSSParser to recognize that scroll-snap-coordinates and scroll-snap-destination
2274 may be specified as positions, therefore allowing 'top', 'bottom', and 'center' for the Y axis,
2275 and 'left', 'right', and 'center' for the X axis.
2277 Correct implementation to support calculated values for Scroll Snap Point markup. This required the
2278 Scroll Snap Point-specific LengthRepeat class to change its internal representation from a CSSPrimitiveValue
2279 to a regular CSSValue.
2281 Add tests that these position labels, as well as combinations with percentages and pixel offsets
2282 are parsed properly.
2284 * css/CSSComputedStyleDeclaration.cpp:
2285 (WebCore::scrollSnapDestination): Switch from 'percentageOrZoomAdjustedValue' to 'zoomAdjustedPixelValueForLength'
2286 when working with Length values. This is necessary to allow calculated results to be based on the proper default
2288 (WebCore::scrollSnapPoints): Ditto.
2289 (WebCore::scrollSnapCoordinates): Ditto.
2290 * css/CSSParser.cpp:
2291 (WebCore::CSSParser::parseScrollSnapPositions): Consolidated code for dealing with snap point
2293 (WebCore::CSSParser::parseScrollSnapDestination): Revise to call new helper function.
2294 (WebCore::CSSParser::parseScrollSnapCoordinate): Ditto.
2295 (WebCore::CSSParser::parseFillPositionX): Rename as parsePositionX.
2296 (WebCore::CSSParser::parseFillPositionY): Rename as parsePositionY.
2297 (WebCore::CSSParser::parseFillProperty): Update to call renamed parsePosition{X|Y} methods.
2298 (WebCore::CSSParser::parseTransformOrigin): Ditto.
2299 (WebCore::CSSParser::parsePerspectiveOrigin): Ditto.
2301 * css/LengthRepeat.h: Revise class to use a CSSValue, rather than a CSSPrimitiveValue, so that we can represent
2302 repeat values as calculations.
2304 2015-03-10 Enrica Casucci <enrica@apple.com>
2306 Add support for more emoji with variation.
2307 https://bugs.webkit.org/show_bug.cgi?id=142548
2308 rdar://problem/20105008
2310 Reviewed by Tim Horton.
2312 Update ICU rules to support new emoji with variation.
2314 Test: editing/selection/extend-by-character-007.html
2316 * platform/text/TextBreakIterator.cpp:
2317 (WebCore::cursorMovementIterator):
2319 2015-03-10 Alex Christensen <achristensen@webkit.org>
2321 Use unsigned for HashSet size.
2322 https://bugs.webkit.org/show_bug.cgi?id=142518
2324 Reviewed by Benjamin Poulain.
2326 * Modules/websockets/WebSocketDeflateFramer.cpp:
2327 (WebCore::WebSocketExtensionDeflateFrame::processResponse):
2328 * bindings/js/SerializedScriptValue.cpp:
2329 (WebCore::CloneSerializer::checkForDuplicate):
2330 (WebCore::CloneSerializer::writeConstantPoolIndex):
2331 * dom/ScriptRunner.cpp:
2332 (WebCore::ScriptRunner::~ScriptRunner):
2333 * loader/ResourceLoadScheduler.h:
2334 * platform/graphics/Font.cpp:
2335 (WebCore::Font::systemFallbackFontForCharacter):
2336 * platform/graphics/FontCache.cpp:
2337 (WebCore::FontCache::purgeInactiveFontDataIfNeeded):
2338 (WebCore::FontCache::purgeInactiveFontData):
2339 * platform/graphics/FontCache.h:
2340 * platform/graphics/freetype/FontCacheFreeType.cpp:
2341 (WebCore::FontCache::systemFallbackForCharacters):
2342 * platform/graphics/ios/FontCacheIOS.mm:
2343 (WebCore::FontCache::getSystemFontFallbackForCharacters):
2344 (WebCore::FontCache::systemFallbackForCharacters):
2345 (WebCore::FontCache::similarFont):
2346 * platform/graphics/mac/FontCacheMac.mm:
2347 (WebCore::shouldAutoActivateFontIfNeeded):
2348 (WebCore::FontCache::systemFallbackForCharacters):
2349 (WebCore::FontCache::similarFont):
2350 * platform/graphics/win/FontCacheWin.cpp:
2351 (WebCore::FontCache::systemFallbackForCharacters):
2352 * rendering/RenderDeprecatedFlexibleBox.cpp:
2353 (WebCore::FlexBoxIterator::next):
2354 * rendering/RenderTableSection.cpp:
2355 (WebCore::RenderTableSection::computeOverflowFromCells):
2357 2015-03-10 Eric Carlson <eric.carlson@apple.com>
2359 [Mac] Refactor media controls code
2360 https://bugs.webkit.org/show_bug.cgi?id=142455
2362 Reviewed by Dean Jackson.
2364 No new tests, updated tests/media/hls/video-controls-live-stream-expected.txt.
2366 * Modules/mediacontrols/mediaControlsApple.js:
2368 (Controller.prototype.addVideoListeners):
2369 (Controller.prototype.removeVideoListeners):
2370 (Controller.prototype.createControls):
2371 (Controller.prototype.setControlsType):
2372 (Controller.prototype.configureInlineControls):
2373 (Controller.prototype.updateStatusDisplay):
2374 (Controller.prototype.handlePanelMouseDown):
2375 (Controller.prototype.showControls):
2376 (Controller.prototype.hideControls):
2377 (Controller.prototype.handleOptimizedFullscreenButtonClicked):
2378 (Controller.prototype.currentPlaybackTargetIsWireless):
2379 (Controller.prototype.updateShouldListenForPlaybackTargetAvailabilityEvent):
2380 (Controller.prototype.updateWirelessPlaybackStatus):
2381 (Controller.prototype.updateWirelessTargetAvailable):
2382 (Controller.prototype.handleWirelessPickerButtonClicked):
2383 (Controller.prototype.handleWirelessPlaybackChange):
2384 (Controller.prototype.handleWirelessTargetAvailableChange):
2385 (Controller.prototype.setShouldListenForPlaybackTargetAvailabilityEvent):
2386 * Modules/mediacontrols/mediaControlsiOS.js:
2388 (ControllerIOS.prototype.addVideoListeners):
2389 (ControllerIOS.prototype.removeVideoListeners):
2390 (ControllerIOS.prototype.createControls):
2391 (ControllerIOS.prototype.setControlsType):
2392 (ControllerIOS.prototype.configureInlineControls):
2393 (ControllerIOS.prototype.showControls):
2394 (ControllerIOS.prototype.handleWirelessPickerButtonTouchEnd):
2395 (ControllerIOS.prototype.updateShouldListenForPlaybackTargetAvailabilityEvent):
2396 (ControllerIOS.prototype.updateStatusDisplay):
2397 (ControllerIOS.prototype.setShouldListenForPlaybackTargetAvailabilityEvent):
2398 (ControllerIOS.prototype.currentPlaybackTargetIsWireless): Deleted.
2399 (ControllerIOS.prototype.updateWirelessPlaybackStatus): Deleted.
2400 (ControllerIOS.prototype.updateWirelessTargetAvailable): Deleted.
2401 (ControllerIOS.prototype.hideControls): Deleted.
2402 (ControllerIOS.prototype.handleWirelessPlaybackChange): Deleted.
2403 (ControllerIOS.prototype.handleWirelessTargetAvailableChange): Deleted.
2405 2015-03-10 Said Abou-Hallawa <sabouhallawa@apple.com>
2407 Remove PassRefPtr from svg/properties classes.
2408 https://bugs.webkit.org/show_bug.cgi?id=142063.
2410 Reviewed by Darin Adler.
2412 Remove PassRefPtr from svg/properties classes. All the return types and
2413 the local variables should be RefPtr. If we are sure the pointer can't
2414 be null, we use Ref instead.
2416 * svg/SVGMarkerElement.cpp:
2417 (WebCore::SVGMarkerElement::lookupOrCreateOrientTypeWrapper):
2418 (WebCore::SVGMarkerElement::orientTypeAnimated):
2419 * svg/SVGMarkerElement.h:
2420 * svg/SVGPathElement.cpp:
2421 (WebCore::SVGPathElement::lookupOrCreateDWrapper):
2422 (WebCore::SVGPathElement::pathSegList):
2423 (WebCore::SVGPathElement::animatedPathSegList):
2424 * svg/SVGPathElement.h:
2425 * svg/SVGPolyElement.cpp:
2426 (WebCore::SVGPolyElement::lookupOrCreatePointsWrapper):
2427 (WebCore::SVGPolyElement::points):
2428 (WebCore::SVGPolyElement::animatedPoints):
2429 * svg/SVGPolyElement.h:
2430 * svg/SVGTextContentElement.cpp:
2431 (WebCore::SVGTextContentElement::lookupOrCreateTextLengthWrapper):
2432 (WebCore::SVGTextContentElement::textLengthAnimated):
2433 * svg/SVGTextContentElement.h:
2434 * svg/SVGViewSpec.cpp:
2435 (WebCore::SVGViewSpec::transform):
2436 (WebCore::SVGViewSpec::viewBoxAnimated):
2437 (WebCore::SVGViewSpec::preserveAspectRatioAnimated):
2438 (WebCore::SVGViewSpec::lookupOrCreateViewBoxWrapper):
2439 (WebCore::SVGViewSpec::lookupOrCreatePreserveAspectRatioWrapper):
2440 (WebCore::SVGViewSpec::lookupOrCreateTransformWrapper):
2441 * svg/SVGViewSpec.h:
2442 * svg/properties/SVGAnimatedEnumerationPropertyTearOff.h:
2443 (WebCore::SVGAnimatedEnumerationPropertyTearOff::create):
2444 * svg/properties/SVGAnimatedListPropertyTearOff.h:
2445 (WebCore::SVGAnimatedListPropertyTearOff::create):
2446 * svg/properties/SVGAnimatedPathSegListPropertyTearOff.h:
2447 (WebCore::SVGAnimatedPathSegListPropertyTearOff::create):
2448 * svg/properties/SVGAnimatedProperty.h:
2449 (WebCore::SVGAnimatedProperty::lookupOrCreateWrapper):
2450 * svg/properties/SVGAnimatedPropertyMacros.h:
2451 * svg/properties/SVGAnimatedPropertyTearOff.h:
2452 (WebCore::SVGAnimatedPropertyTearOff::create):
2453 * svg/properties/SVGAnimatedStaticPropertyTearOff.h:
2454 (WebCore::SVGAnimatedStaticPropertyTearOff::create):
2455 * svg/properties/SVGAnimatedTransformListPropertyTearOff.h:
2456 (WebCore::SVGAnimatedTransformListPropertyTearOff::create):
2457 * svg/properties/SVGListProperty.h:
2458 (WebCore::SVGListProperty::initializeValuesAndWrappers):
2459 (WebCore::SVGListProperty::getItemValuesAndWrappers):
2460 (WebCore::SVGListProperty::insertItemBeforeValuesAndWrappers):
2461 (WebCore::SVGListProperty::replaceItemValuesAndWrappers):
2462 (WebCore::SVGListProperty::removeItemValuesAndWrappers):
2463 (WebCore::SVGListProperty::appendItemValuesAndWrappers):
2464 * svg/properties/SVGListPropertyTearOff.h:
2465 (WebCore::SVGListPropertyTearOff::create):
2466 (WebCore::SVGListPropertyTearOff::initialize):
2467 (WebCore::SVGListPropertyTearOff::getItem):
2468 (WebCore::SVGListPropertyTearOff::insertItemBefore):
2469 (WebCore::SVGListPropertyTearOff::replaceItem):
2470 (WebCore::SVGListPropertyTearOff::removeItem):
2471 (WebCore::SVGListPropertyTearOff::appendItem):
2472 * svg/properties/SVGPathSegListPropertyTearOff.cpp:
2473 (WebCore::SVGPathSegListPropertyTearOff::getItem):
2474 (WebCore::SVGPathSegListPropertyTearOff::replaceItem):
2475 (WebCore::SVGPathSegListPropertyTearOff::removeItem):
2476 * svg/properties/SVGPathSegListPropertyTearOff.h:
2477 (WebCore::SVGPathSegListPropertyTearOff::create):
2478 (WebCore::SVGPathSegListPropertyTearOff::initialize):
2479 (WebCore::SVGPathSegListPropertyTearOff::insertItemBefore):
2480 (WebCore::SVGPathSegListPropertyTearOff::appendItem):
2481 * svg/properties/SVGPropertyInfo.h:
2482 * svg/properties/SVGStaticListPropertyTearOff.h:
2483 (WebCore::SVGStaticListPropertyTearOff::create):
2484 * svg/properties/SVGStaticPropertyTearOff.h:
2485 (WebCore::SVGStaticPropertyTearOff::create):
2486 * svg/properties/SVGTransformListPropertyTearOff.h:
2487 (WebCore::SVGTransformListPropertyTearOff::create):
2488 (WebCore::SVGTransformListPropertyTearOff::createSVGTransformFromMatrix):
2489 (WebCore::SVGTransformListPropertyTearOff::consolidate):
2491 2015-03-10 Timothy Horton <timothy_horton@apple.com>
2495 * platform/network/cf/ResourceHandleCFNet.cpp:
2496 (WebCore::ResourceHandle::createCFURLConnection):
2498 2015-03-10 Benjamin Poulain <bpoulain@apple.com>
2500 Extend URL filter's Term definition to support groups/subpatterns
2501 https://bugs.webkit.org/show_bug.cgi?id=142519
2503 Reviewed by Alex Christensen.
2505 Pretty simple extension: Term is extended to support holding
2506 a Vector of Term. The quantifier of the Term applies to its
2507 Vector of term as a whole.
2509 To avoid exposing too much internal in the API of Term, I moved
2510 graph generation from GraphBuilder to Term.
2512 Sinking a CharacterSet works as usual. Sinking a Group is done
2513 by sinking each of its Terms one by one and then apply the quantifier
2514 on the whole subgraph. This is done by recursively calling into
2515 Term::generateGraph().
2517 Since groups could be nested, the groups make a stack with the latest
2519 When sinking a floating Term, it is sunk to the latest open group. If there is no open
2520 group, we use the prefix tree and sink the whole subpattern to the graph.
2522 * contentextensions/URLFilterParser.cpp:
2523 (WebCore::ContentExtensions::Term::Term):
2524 (WebCore::ContentExtensions::Term::extendGroupSubpattern):
2525 (WebCore::ContentExtensions::Term::generateGraph):
2526 (WebCore::ContentExtensions::Term::operator==):
2527 (WebCore::ContentExtensions::Term::hash):
2528 (WebCore::ContentExtensions::Term::isUniversalTransition):
2529 (WebCore::ContentExtensions::Term::generateSubgraphForAtom):
2530 (WebCore::ContentExtensions::Term::destroy):
2531 (WebCore::ContentExtensions::Term::Group::operator==):
2532 (WebCore::ContentExtensions::Term::Group::hash):
2533 (WebCore::ContentExtensions::GraphBuilder::finalize):
2534 (WebCore::ContentExtensions::GraphBuilder::atomParenthesesSubpatternBegin):
2535 (WebCore::ContentExtensions::GraphBuilder::atomParenthesesEnd):
2536 (WebCore::ContentExtensions::GraphBuilder::sinkFloatingTermIfNecessary):
2537 (WebCore::ContentExtensions::Term::quantifier): Deleted.
2538 (WebCore::ContentExtensions::Term::visitSimpleTransitions): Deleted.
2539 (WebCore::ContentExtensions::GraphBuilder::addTransitions): Deleted.
2540 (WebCore::ContentExtensions::GraphBuilder::sinkFloatingTerm): Deleted.
2542 2015-03-10 Roger Fong <roger_fong@apple.com>
2544 Adjustments to media control fonts.
2545 https://bugs.webkit.org/show_bug.cgi?id=142509.
2546 <rdar://problem/20085228>
2548 Reviewed by Darin Adler.
2550 Use system font for controls. Adjust surrounding divs accordingly.
2551 Apply subpixel antialiasing to all media control text.
2552 * Modules/mediacontrols/mediaControlsApple.css:
2553 (::-webkit-media-controls):
2554 (audio::-webkit-media-controls-closed-captions-container .list):
2555 (audio::-webkit-media-controls-status-display):
2556 (audio::-webkit-media-controls-time-remaining-display):
2557 (audio::-webkit-media-controls-current-time-display):
2558 (audio::-webkit-media-controls-time-remaining-display.five-digit-time):
2559 (audio::-webkit-media-controls-current-time-display.five-digit-time):
2560 (audio::-webkit-media-controls-time-remaining-display.six-digit-time):
2561 (audio::-webkit-media-controls-current-time-display.six-digit-time):
2563 2015-03-10 Dan Bernstein <mitz@apple.com>
2565 Fixed a crash in CertificateInfo::containsNonRootSHA1SignedCertificate when loading a non-HTTPS webapge.
2567 Reviewed by Anders Carlsson.
2569 * platform/network/mac/CertificateInfoMac.mm:
2570 (WebCore::CertificateInfo::containsNonRootSHA1SignedCertificate): Null-check the certificate chain.
2572 2015-03-10 Dan Bernstein <mitz@apple.com>
2576 * platform/spi/cocoa/SecuritySPI.h:
2578 2015-03-10 Zalan Bujtas <zalan@apple.com>
2580 Simple line layout: Merge TextFragmentIterator::findNextBreakablePosition() and TextFragmentIterator::findNextNonWhitespacePosition().
2581 https://bugs.webkit.org/show_bug.cgi?id=142344
2583 Reviewed by Antti Koivisto.
2585 This patch merges findNextBreakablePosition() and findNextNonWhitespacePosition() so that
2586 the segment looping and position handling logic are no longer duplicated. It also unifies
2587 the static next*() functions' signature.
2589 No change in functionality.
2591 * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
2592 (WebCore::SimpleLineLayout::TextFragmentIterator::nextTextFragment):
2593 (WebCore::SimpleLineLayout::nextBreakablePosition):
2594 (WebCore::SimpleLineLayout::nextNonWhitespacePosition):
2595 (WebCore::SimpleLineLayout::TextFragmentIterator::skipToNextPosition):
2596 (WebCore::SimpleLineLayout::TextFragmentIterator::findNextBreakablePosition): Deleted.
2597 (WebCore::SimpleLineLayout::findNextNonWhitespace): Deleted.
2598 (WebCore::SimpleLineLayout::TextFragmentIterator::findNextNonWhitespacePosition): Deleted.
2599 * rendering/SimpleLineLayoutTextFragmentIterator.h:
2601 2015-03-10 Carlos Garcia Campos <cgarcia@igalia.com>
2603 [GTK] GL_MAX_VARYING_FLOATS is not defined in OpenGL ES 2
2604 https://bugs.webkit.org/show_bug.cgi?id=142529
2606 Reviewed by Žan Doberšek.
2608 Do not use GL_MAX_VARYING_FLOATS when platform is GTK+ and using
2611 * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
2612 (WebCore::GraphicsContext3D::checkVaryingsPacking):
2614 2015-03-10 José Dapena Paz <jdapena@igalia.com>
2616 Unreviewed. Fix GTK+ build with OpenGL ES 2 enabled.
2618 Remove USE(OPENGL) ifdef from GLContext.cpp, since there's nothing
2619 specific to OpenGL in that file, and everything depending on
2620 configure options is already protected by USE(GLX) and USE(EGL)
2621 ifdefs. This is causing linking issues when building with OpenGL
2622 ES 2, because the header doesn't have the ifdef, and the cpp file
2623 is not compiled leaving all the interface undefined.
2625 Rubber-stamped by Carlos Garcia Campos.
2627 * platform/graphics/GLContext.cpp:
2629 2015-03-10 Carlos Garcia Campos <cgarcia@igalia.com> and José Dapena Paz <jdapena@igalia.com>
2631 [GTK] Add a configure option to build with OpenGL ES 2
2632 https://bugs.webkit.org/show_bug.cgi?id=142498
2634 Reviewed by Martin Robinson.
2636 Build GLES or GL specific files depending on the build options.
2638 * PlatformGTK.cmake:
2640 2015-03-10 Zan Dobersek <zdobersek@igalia.com>
2642 Shrink the CSSPropertyID enum type
2643 https://bugs.webkit.org/show_bug.cgi?id=142456
2645 Reviewed by Sam Weinig.
2647 Specify uint16_t as the base type for the CSSPropertyID enum.
2648 This is enough to cover all of the CSS properties (429 at this moment,
2649 with static_assert covering future changes). It halves the enum type size,
2650 from 4 bytes to 2, reducing the size of various CSSPropertyID containers.
2652 No new tests -- no change in behavior.
2654 * css/CSSPrimitiveValue.cpp:
2655 (WebCore::propertyName): Remove the unnecessary propertyID < 0 check.
2658 2015-03-10 Dan Bernstein <mitz@apple.com>
2660 WebCore part of <rdar://problem/20086546> [Cocoa] Add an option to treat certificate chains with SHA1-signed certificates as insecure
2661 https://bugs.webkit.org/show_bug.cgi?id=142461
2663 Reviewed by Sam Weinig.
2665 * WebCore.xcodeproj/project.pbxproj: Added reference to SecuritySPI.h and sorted the
2668 * platform/network/cf/CertificateInfo.h: Declared new member function
2669 containsNonRootSHA1SignedCertificate.
2671 * platform/network/mac/CertificateInfoMac.mm:
2672 (WebCore::CertificateInfo::containsNonRootSHA1SignedCertificate): Added. Checks if any but
2673 the last certificate in the chain uses SHA-1 as its signature hash algorithm.
2675 * platform/network/curl/CertificateInfo.h:
2676 (WebCore::CertificateInfo::containsNonRootSHA1SignedCertificate): Added notImplemented
2679 * platform/network/soup/CertificateInfo.h:
2680 (WebCore::CertificateInfo::containsNonRootSHA1SignedCertificate): Ditto.
2682 * platform/spi/cocoa/SecuritySPI.h: Added.
2684 2015-03-09 Chris Dumez <cdumez@apple.com>
2686 [iOS] Sweep all collected objects on critical memory pressure
2687 https://bugs.webkit.org/show_bug.cgi?id=142457
2688 <rdar://problem/20044440>
2690 Reviewed by Geoffrey Garen.
2692 Do a full sweep of objects marked for destruction on critical memory
2693 pressure to free up memory.
2695 * platform/cocoa/MemoryPressureHandlerCocoa.mm:
2696 (WebCore::MemoryPressureHandler::platformReleaseMemory):
2698 2015-03-09 Andy Estes <aestes@apple.com>
2700 [Content Filtering] Give ContentFilter subclasses private constructors, and make them fast-allocated and non-copyable
2701 https://bugs.webkit.org/show_bug.cgi?id=142515
2703 Reviewed by Andreas Kling.
2705 * platform/cocoa/NetworkExtensionContentFilter.h:
2706 * platform/cocoa/ParentalControlsContentFilter.h:
2707 * testing/MockContentFilter.h:
2709 2015-03-09 Chris Dumez <cdumez@apple.com>
2711 [CG] Have Canvas use the IOSurfacePool
2712 https://bugs.webkit.org/show_bug.cgi?id=142417
2713 <rdar://problem/20044440>
2715 Reviewed by Darin Adler.
2717 Have ImageBufferDataCG use the IOSurfacePool so that Canvas can
2718 benefit from it. I see a ~75% progression on Canvas/reuse.html
2719 performance test on my Macbook Pro with 1000 different canvas
2720 sizes and ~110% progression with 100 different canvas sizes.
2722 I also see a ~65% cache hit rate on the mobile version of
2725 Note that ImageData calls CGContextClearRect() after calling
2726 IOSurface::create() so recycling IOSurfaces in this case should
2729 Performance test: Canvas/reuse.html
2731 * platform/graphics/ImageBuffer.h:
2732 (WebCore::ImageBuffer::baseTransform):
2733 * platform/graphics/cg/ImageBufferCG.cpp:
2734 (WebCore::ImageBuffer::ImageBuffer):
2735 (WebCore::ImageBuffer::context):
2736 (WebCore::ImageBuffer::copyImage):
2737 (WebCore::ImageBuffer::copyNativeImage):
2738 (WebCore::ImageBuffer::draw):
2739 (WebCore::ImageBuffer::clip):
2740 (WebCore::ImageBuffer::putByteArray):
2741 (WebCore::ImageBuffer::toDataURL):
2742 * platform/graphics/cg/ImageBufferDataCG.cpp:
2743 (WebCore::ImageBufferData::~ImageBufferData):
2744 (WebCore::ImageBufferData::getData):
2745 (WebCore::ImageBufferData::putData):
2746 (WebCore::ImageBufferData::ImageBufferData): Deleted.
2747 * platform/graphics/cg/ImageBufferDataCG.h:
2748 * platform/graphics/cocoa/IOSurface.h:
2749 * platform/graphics/cocoa/IOSurface.mm:
2750 (IOSurface::surfaceFromPool):
2751 (IOSurface::create):
2752 (IOSurface::createFromSendRight):
2753 (IOSurface::createFromImage):
2754 (IOSurface::setContextSize):
2756 2015-03-09 Brent Fulgham <bfulgham@apple.com>
2758 Assertion in ScrollController::processWheelEventForScrollSnapOnAxis when scrolling with mechanical wheel mouse
2759 https://bugs.webkit.org/show_bug.cgi?id=142517
2761 Reviewed by Simon Fraser.
2763 * platform/cocoa/ScrollController.mm:
2764 (WebCore::toWheelEventStatus): Recognize stateless mechanical wheel events.
2765 (WebCore::ScrollController::processWheelEventForScrollSnapOnAxis): If a mechanical wheel event is processed while
2766 considering scroll snap logic, end any snap animations and clean up.
2767 (WebCore::ScrollController::updateScrollSnapPoints): Don't begin tracking scroll snap state if there is not
2768 scroll snap point defined in the markup.
2770 2015-03-09 Myles C. Maxfield <mmaxfield@apple.com>
2772 REGRESSION(r176978): Inline-blocks with overflowing contents have ascents that are too large
2773 https://bugs.webkit.org/show_bug.cgi?id=141783
2775 Reviewed by David Hyatt.
2777 When we have an inline-block element, and we want to find its baseline (to lay out other
2778 elements on the same line) we loop through the element's children and ask them what their
2779 baselines are. The children use the location of the top of their last line to compute this
2780 value. However, if the child has overflow-y, this might not be the correct calculation.
2782 This behavior is in the spec: "The baseline of an 'inline-block' is the baseline of its last
2783 line box in the normal flow, unless it has either no in-flow line boxes or if its 'overflow'
2784 property has a computed value other than 'visible', in which case the baseline is the bottom
2786 -- http://www.w3.org/TR/CSS21/visudet.html#leading
2788 However, we believe that a better policy is, when overflow is not "visible," to place the
2789 baseline at the bottom of the block if the contents overflowed in the Y direction, and to place
2790 it at the bottom of the last line if the contents did not overflow in the Y direction. This is
2791 partially consistent with previous behavior, and isn't too far from the spec to cause too many
2794 Test: fast/css/inline-block-tricky-baselines.html
2795 fast/text/baseline-inline-block.html
2797 * rendering/RenderBlockFlow.cpp:
2798 (WebCore::RenderBlockFlow::inlineBlockBaseline):
2800 2015-03-09 Andy Estes <aestes@apple.com>
2802 [Content Filtering] Add tests
2803 https://bugs.webkit.org/show_bug.cgi?id=142475
2805 Reviewed by Andreas Kling.
2807 Added a mock content filter that can be configured by window.internals. A test can control whether the filter
2808 is enabled, what to display when a page is blocked, at what point the allow/block decision is made, and what
2811 Added tests to cover allowing and blocking content at each decision point.
2813 Tests: contentfiltering/allow-after-add-data.html
2814 contentfiltering/allow-after-finished-adding-data.html
2815 contentfiltering/allow-after-response.html
2816 contentfiltering/block-after-add-data.html
2817 contentfiltering/block-after-finished-adding-data.html
2818 contentfiltering/block-after-response.html
2820 * DerivedSources.make: Added MockContentFilterSettings.idl.
2821 * WebCore.xcodeproj/project.pbxproj:
2822 * bindings/js/JSMockContentFilterSettingsCustom.cpp: Added.
2823 (WebCore::JSMockContentFilterSettings::decisionPoint): Returned the decision point's JSValue.
2824 (WebCore::JSMockContentFilterSettings::setDecisionPoint): Set the decision point; threw an exception for invalid values.
2825 (WebCore::JSMockContentFilterSettings::decision): Returned the decision's JSValue.
2826 (WebCore::JSMockContentFilterSettings::setDecision): Set the decision; threw an exception for invalid values.
2827 * platform/ContentFilter.cpp:
2828 (WebCore::ContentFilter::types): Renamed from contentFilterTypes.
2829 (WebCore::ContentFilter::createIfNeeded):
2830 (WebCore::contentFilterType): Deleted.
2831 (WebCore::contentFilterTypes): Deleted.
2832 * platform/ContentFilter.h:
2833 (WebCore::ContentFilter::addType): Used to register a new content filter type.
2834 (WebCore::ContentFilter::type): Renamed from contentFilterType.
2835 * platform/cocoa/NetworkExtensionContentFilter.h: Moved definition of HAVE_NE_FILTER_SOURCE to here.
2836 * testing/Internals.cpp:
2837 (WebCore::Internals::resetToConsistentState): Called MockContentFilterSettings::reset().
2838 (WebCore::Internals::Internals): Called MockContentFilter::ensureInstalled().
2839 (WebCore::Internals::mockContentFilterSettings): Returned a reference to MockContentFilterSettings::singleton().
2840 * testing/Internals.h:
2841 * testing/Internals.idl: Added attribute mockContentFilterSettings.
2842 * testing/MockContentFilter.cpp: Added.
2843 (WebCore::MockContentFilter::ensureInstalled): Called MockContentFilter::addType().
2844 (WebCore::MockContentFilter::canHandleResponse): Returned whether MockContentFilterSettings is enabled.
2845 (WebCore::MockContentFilter::create): Returned a new MockContentFilter.
2846 (WebCore::MockContentFilter::MockContentFilter): Called maybeDetermineStatus().
2847 (WebCore::MockContentFilter::addData): Copied data into m_replacementData and called maybeDetermineStatus().
2848 (WebCore::MockContentFilter::finishedAddingData): Called maybeDetermineStatus().
2849 (WebCore::MockContentFilter::needsMoreData): Returned whether m_status equals NeedsMoreData.
2850 (WebCore::MockContentFilter::didBlockData): Returned whether m_status equals Blocked.
2851 (WebCore::MockContentFilter::getReplacementData): Returned a pointer to the start of m_replacementData.
2852 (WebCore::MockContentFilter::unblockHandler): Returned an empty ContentFilterUnblockHandler.
2853 (WebCore::MockContentFilter::maybeDetermineStatus): If m_status is NeedsMoreData and the current decision point
2854 equals MockContentFilterSettings's decision point, set m_status according to MockContentFilterSettings's
2855 decision. If m_status becomes Blocked, clear the original page data from m_replacementData and copy
2856 MockContentFilterSettings's blocked string instead.
2857 * testing/MockContentFilter.h: Copied from Source/WebCore/platform/cocoa/NetworkExtensionContentFilter.h.
2858 * testing/MockContentFilterSettings.cpp: Copied from Source/WebCore/platform/ContentFilter.h.
2859 (WebCore::MockContentFilterSettings::singleton):
2860 (WebCore::MockContentFilterSettings::reset): Reset settings to their initial values.
2861 (WebCore::MockContentFilterSettings::MockContentFilterSettings):
2862 * testing/MockContentFilterSettings.h: Copied from Source/WebCore/platform/cocoa/NetworkExtensionContentFilter.h.
2863 (WebCore::MockContentFilterSettings::ref): Added an empty implementation to make the bindings think this is RefCounted.
2864 (WebCore::MockContentFilterSettings::deref): Ditto.
2865 (WebCore::MockContentFilterSettings::enabled):
2866 (WebCore::MockContentFilterSettings::setEnabled):
2867 (WebCore::MockContentFilterSettings::blockedString):
2868 (WebCore::MockContentFilterSettings::setBlockedString):
2869 (WebCore::MockContentFilterSettings::decisionPoint):
2870 (WebCore::MockContentFilterSettings::setDecisionPoint):
2871 (WebCore::MockContentFilterSettings::decision):
2872 (WebCore::MockContentFilterSettings::setDecision):
2873 * testing/MockContentFilterSettings.idl: Copied from Source/WebCore/platform/ContentFilter.h.
2875 2015-03-09 Zalan Bujtas <zalan@apple.com>
2877 Simple line layout should not be limited to RenderText.
2878 https://bugs.webkit.org/show_bug.cgi?id=142504
2880 Reviewed by Antti Koivisto.
2882 This is in transition to support br element.
2884 No change in functionality.
2886 * rendering/RenderText.cpp:
2887 (WebCore::RenderText::absoluteRects):
2888 (WebCore::RenderText::absoluteQuadsClippedToEllipsis):
2889 (WebCore::RenderText::absoluteQuads):
2890 (WebCore::RenderText::firstRunLocation):
2891 (WebCore::RenderText::linesBoundingBox):
2892 (WebCore::RenderText::caretMinOffset):
2893 (WebCore::RenderText::caretMaxOffset):
2894 (WebCore::RenderText::containsCaretOffset):
2895 * rendering/SimpleLineLayoutFlowContents.cpp:
2896 (WebCore::SimpleLineLayout::FlowContents::segmentForRenderer):
2897 * rendering/SimpleLineLayoutFlowContents.h:
2898 * rendering/SimpleLineLayoutFunctions.cpp:
2899 (WebCore::SimpleLineLayout::computeBoundingBox):
2900 (WebCore::SimpleLineLayout::computeFirstRunLocation):
2901 (WebCore::SimpleLineLayout::collectAbsoluteRects):
2902 (WebCore::SimpleLineLayout::collectAbsoluteQuads):
2903 (WebCore::SimpleLineLayout::computeTextBoundingBox): Deleted.
2904 (WebCore::SimpleLineLayout::computeTextFirstRunLocation): Deleted.
2905 (WebCore::SimpleLineLayout::collectTextAbsoluteRects): Deleted.
2906 (WebCore::SimpleLineLayout::collectTextAbsoluteQuads): Deleted.
2907 * rendering/SimpleLineLayoutFunctions.h:
2908 (WebCore::SimpleLineLayout::findCaretMinimumOffset):
2909 (WebCore::SimpleLineLayout::findCaretMaximumOffset):
2910 (WebCore::SimpleLineLayout::containsCaretOffset):
2911 (WebCore::SimpleLineLayout::findTextCaretMinimumOffset): Deleted.
2912 (WebCore::SimpleLineLayout::findTextCaretMaximumOffset): Deleted.
2913 (WebCore::SimpleLineLayout::containsTextCaretOffset): Deleted.
2914 * rendering/SimpleLineLayoutResolver.cpp:
2915 (WebCore::SimpleLineLayout::RunResolver::Run::text):
2916 (WebCore::SimpleLineLayout::RunResolver::rangeForRenderer):
2917 * rendering/SimpleLineLayoutResolver.h:
2918 * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
2919 (WebCore::SimpleLineLayout::TextFragmentIterator::textWidth):
2921 2015-03-09 Myles C. Maxfield <mmaxfield@apple.com>
2923 svg/custom/svg-fonts-without-missing-glyph.xhtml fails after fonts/font-fallback-prefers-pictographs.html
2924 https://bugs.webkit.org/show_bug.cgi?id=142470
2926 Reviewed by Anders Carlsson.
2928 After each test, reset all internal settings.
2930 Covered by svg/custom/svg-fonts-without-missing-glyph.xhtml
2932 * testing/InternalSettings.cpp:
2933 (WebCore::InternalSettings::Backup::Backup):
2934 (WebCore::InternalSettings::Backup::restoreTo):
2935 * testing/InternalSettings.h:
2937 2015-03-09 Commit Queue <commit-queue@webkit.org>
2939 Unreviewed, rolling out r181268.
2940 https://bugs.webkit.org/show_bug.cgi?id=142508
2942 Broke tests (Requested by ap on #webkit).
2946 "Simple line layout: Merge
2947 TextFragmentIterator::findNextBreakablePosition() and
2948 TextFragmentIterator::findNextNonWhitespacePosition()."
2949 https://bugs.webkit.org/show_bug.cgi?id=142344
2950 http://trac.webkit.org/changeset/181268
2952 2015-03-09 Benjamin Poulain <benjamin@webkit.org>
2954 CSS JIT: add aliases between :nth-child()/:nth-last-child() and :first-child/:last-child
2955 https://bugs.webkit.org/show_bug.cgi?id=142472
2957 Reviewed by Andreas Kling.
2959 The pseudo class :first-child has weaker tree marking than :nth-child(1).
2960 This patch aliases :nth-child(1) to :first-child in the CSS JIT to take
2963 The strength of :last-child and :nth-last-child(1) are pretty much identical
2964 but :last-child is a bit simpler so I changed it too. It is also easier
2965 to handle both the same.
2967 Tests: fast/selectors/nth-child-matching-first-on-root.html
2968 fast/selectors/nth-child-matching-first.html
2969 fast/selectors/nth-last-child-matching-first-on-root.html
2970 fast/selectors/nth-last-child-matching-first.html
2972 * cssjit/SelectorCompiler.cpp:
2973 (WebCore::SelectorCompiler::addNthChildType):
2974 (WebCore::SelectorCompiler::addPseudoClassType):
2976 2015-03-09 Benjamin Poulain <bpoulain@apple.com>
2978 Merge TrivialAtom and CharacterSet into a Term abstraction, prepare Term for composition
2979 https://bugs.webkit.org/show_bug.cgi?id=142429
2981 Reviewed by Darin Adler.
2983 This patch merges CharacterSet and Trivial atom into a new class: Term. A Term is
2984 a combination of an Atom and one Quantifier.
2986 With term being the basic block, we can use the PrefixTree for any construct,
2987 greatly reducing the size of the NFA graph.
2989 Term is built on top of an union holding the Atom storage. This is done in preparation
2990 for more complicated Atoms like a disjunction.
2992 Everything else is pretty much the same. BuildMode is gone since we use the prefix
2993 tree for everything. FloatingAtomType is gone, a TrivialAtom is now represented
2994 by a single character CharacterSet (or two for case insensitive).
2996 * contentextensions/ContentExtensionParser.cpp:
2997 (WebCore::ContentExtensions::parseRuleList):
2998 * contentextensions/NFA.cpp:
2999 (WebCore::ContentExtensions::NFA::addRuleId):
3000 * contentextensions/URLFilterParser.cpp:
3001 (WebCore::ContentExtensions::Term::Term):
3002 (WebCore::ContentExtensions::Term::~Term):
3003 (WebCore::ContentExtensions::Term::isValid):
3004 (WebCore::ContentExtensions::Term::addCharacter):
3005 (WebCore::ContentExtensions::Term::quantify):
3006 (WebCore::ContentExtensions::Term::quantifier):
3007 (WebCore::ContentExtensions::Term::isUniversalTransition):
3008 (WebCore::ContentExtensions::Term::visitSimpleTransitions):
3009 (WebCore::ContentExtensions::Term::operator=):
3010 (WebCore::ContentExtensions::Term::operator==):
3011 (WebCore::ContentExtensions::Term::hash):
3012 (WebCore::ContentExtensions::Term::isEmptyValue):
3013 (WebCore::ContentExtensions::Term::isDeletedValue):
3014 (WebCore::ContentExtensions::Term::destroy):
3015 (WebCore::ContentExtensions::Term::CharacterSet::operator==):
3016 (WebCore::ContentExtensions::Term::CharacterSet::hash):
3017 (WebCore::ContentExtensions::TermHash::hash):
3018 (WebCore::ContentExtensions::TermHash::equal):
3019 (WebCore::ContentExtensions::GraphBuilder::GraphBuilder):
3020 (WebCore::ContentExtensions::GraphBuilder::finalize):
3021 (WebCore::ContentExtensions::GraphBuilder::atomPatternCharacter):
3022 (WebCore::ContentExtensions::GraphBuilder::atomBuiltInCharacterClass):
3023 (WebCore::ContentExtensions::GraphBuilder::quantifyAtom):
3024 (WebCore::ContentExtensions::GraphBuilder::atomCharacterClassBegin):
3025 (WebCore::ContentExtensions::GraphBuilder::atomCharacterClassAtom):
3026 (WebCore::ContentExtensions::GraphBuilder::atomCharacterClassRange):
3027 (WebCore::ContentExtensions::GraphBuilder::addTransitions):
3028 (WebCore::ContentExtensions::GraphBuilder::sinkFloatingTerm):
3029 (WebCore::ContentExtensions::GraphBuilder::sinkFloatingTermIfNecessary):
3030 (WebCore::ContentExtensions::URLFilterParser::URLFilterParser):
3031 (WebCore::ContentExtensions::URLFilterParser::~URLFilterParser):
3032 (WebCore::ContentExtensions::URLFilterParser::addPattern):
3033 (WebCore::ContentExtensions::trivialAtomFromASCIICharacter): Deleted.
3034 (WebCore::ContentExtensions::quantifyTrivialAtom): Deleted.
3035 (WebCore::ContentExtensions::trivialAtomQuantifier): Deleted.
3036 (WebCore::ContentExtensions::trivialAtomForNewlineClassIDBuiltin): Deleted.
3037 (WebCore::ContentExtensions::GraphBuilder::sinkAtom): Deleted.
3038 (WebCore::ContentExtensions::GraphBuilder::generateTransition): Deleted.
3039 (WebCore::ContentExtensions::GraphBuilder::sinkTrivialAtom): Deleted.
3040 (WebCore::ContentExtensions::GraphBuilder::sinkCharacterSet): Deleted.
3041 (WebCore::ContentExtensions::GraphBuilder::sinkPendingAtomIfNecessary): Deleted.
3042 * contentextensions/URLFilterParser.h:
3044 2015-03-09 Csaba Osztrogonác <ossy@webkit.org>
3046 Fix the !ENABLE(WEBGL) build after r180609
3047 https://bugs.webkit.org/show_bug.cgi?id=142057
3049 Reviewed by Darin Adler.
3051 * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
3052 (WebCore::GraphicsContext3D::forceContextLost):
3054 2015-03-09 Myles C. Maxfield <mmaxfield@apple.com>
3056 Work around a Cocoa font parsing bug
3057 https://bugs.webkit.org/show_bug.cgi?id=142446
3058 <rdar://problem/20086223>
3060 Reviewed by Simon Fraser.
3062 Work around a bug in Cocoa regarding font parsing.
3064 * svg/SVGToOTFFontConversion.cpp:
3066 2015-03-09 Csaba Osztrogonác <ossy@webkit.org>
3068 Fix the build after r181153
3069 https://bugs.webkit.org/show_bug.cgi?id=142497
3071 Reviewed by Philippe Normand.
3073 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
3074 (WebCore::MediaPlayerPrivateGStreamer::load):
3076 2015-03-09 Roger Fong <roger_fong@apple.com>
3078 Only call showControls if controls are hidden.
3079 https://bugs.webkit.org/show_bug.cgi?id=142496.
3080 <rdar://problem/20083732>
3082 Reviewed by Dean Jackson.
3084 * Modules/mediacontrols/mediaControlsApple.js:
3085 (Controller.prototype.handleWrapperMouseMove):
3086 (Controller.prototype.controlsAreHidden):
3087 Controls are hidden if the ‘show’ class name is not present,
3088 not if the ‘hidden’ class name is.
3090 2015-03-09 Roger Fong <roger_fong@apple.com>
3092 Unreviewed. Re-add CSS property that was unintentionally removed in r180893
3093 <rdar://problem/20083715>
3095 * Modules/mediacontrols/mediaControlsApple.css:
3096 (audio::-webkit-media-controls-panel):
3098 2015-03-09 Zalan Bujtas <zalan@apple.com>
3100 Simple line layout: Merge TextFragmentIterator::findNextBreakablePosition() and TextFragmentIterator::findNextNonWhitespacePosition().
3101 https://bugs.webkit.org/show_bug.cgi?id=142344
3103 Reviewed by Antti Koivisto.
3105 This patch merges findNextBreakablePosition() and findNextNonWhitespacePosition() so that
3106 the segment looping and position handling logic are no longer duplicated. It also unifies
3107 the static next*() functions' signature.
3109 No change in functionality.
3111 * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
3112 (WebCore::SimpleLineLayout::TextFragmentIterator::nextTextFragment):
3113 (WebCore::SimpleLineLayout::nextBreakablePosition):
3114 (WebCore::SimpleLineLayout::nextNonWhitespacePosition):
3115 (WebCore::SimpleLineLayout::TextFragmentIterator::skipToNextPosition):
3116 (WebCore::SimpleLineLayout::TextFragmentIterator::findNextBreakablePosition): Deleted.
3117 (WebCore::SimpleLineLayout::findNextNonWhitespace): Deleted.
3118 (WebCore::SimpleLineLayout::TextFragmentIterator::findNextNonWhitespacePosition): Deleted.
3119 * rendering/SimpleLineLayoutTextFragmentIterator.h:
3121 2015-03-09 Xabier Rodriguez Calvar <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
3123 ReadableStreamJSSource should use JSC::Strong UnspecifiedBoolType operator
3124 https://bugs.webkit.org/show_bug.cgi?id=142397
3126 Reviewed by Benjamin Poulain.
3128 No behavior change. Current tests cover the changes.
3130 * bindings/js/ReadableStreamJSSource.cpp:
3131 * bindings/js/ReadableStreamJSSource.h:
3133 2015-03-09 Xabier Rodriguez Calvar <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
3135 ReadableStream does not not need to pass itself as callback parameter
3136 https://bugs.webkit.org/show_bug.cgi?id=142399
3138 Reviewed by Darin Adler.
3140 No change in behavior.
3142 * Modules/streams/ReadableStream.h: Remove ReadableStream parameter from SuccessCallback definition.
3143 * bindings/js/JSReadableStreamCustom.cpp:
3144 (WebCore::JSReadableStream::ready): Capture JSReadableStream instance instead.
3145 (WebCore::JSReadableStream::closed): Capture JSReadableStream instance instead.
3147 2015-03-08 Dean Jackson <dino@apple.com>
3149 [iOS Media] Video buffer progress missing on iPhones
3150 https://bugs.webkit.org/show_bug.cgi?id=142462
3152 Reviewed by Eric Carlson.
3154 The fullscreen controller on the iPhone idiom was using
3155 the media duration as its maximum loaded time, meaning the
3156 download progress was missing (it looked like everything
3157 was already downloaded). The fix is to calculate
3158 what the maximum buffered time is from the HTMLMediaElement,
3159 and send that to the fullscreen controller.
3161 * Modules/mediacontrols/mediaControlsiOS.js:
3162 (ControllerIOS.prototype.drawTimelineBackground): While implementing
3163 the native function I noticed that the JS controls forgot that
3164 the buffered time ranges are ordered, and thus they don't need
3165 to search through the array. The last range will be the highest.
3167 * html/HTMLMediaElement.cpp:
3168 (WebCore::HTMLMediaElement::maxBufferedTime): New helper function
3169 to calculate the highest buffered time in the media source.
3170 * html/HTMLMediaElement.h:
3172 * platform/ios/WebVideoFullscreenInterface.h: New setBufferedTime method.
3173 * platform/ios/WebVideoFullscreenInterfaceAVKit.h:
3175 * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
3176 (WebVideoFullscreenInterfaceAVKit::setDuration): No longer set
3177 the loadedTimeRanges.
3178 (WebVideoFullscreenInterfaceAVKit::setBufferedTime): Calculate a normalized
3179 value of the maximum loaded/buffered time, and tell the platform controller
3182 * platform/ios/WebVideoFullscreenModelVideoElement.mm:
3183 (WebVideoFullscreenModelVideoElement::updateForEventName): Send the maximum
3186 2015-03-08 Chris Dumez <cdumez@apple.com>
3188 Crash in WebCore::NotificationCenter::stop()
3189 https://bugs.webkit.org/show_bug.cgi?id=142444
3190 <rdar://problem/20082520>
3192 Reviewed by Darin Adler.
3194 Rework the patch in r181219 so that we do not need a Ref<NotificationCenter> protector
3195 in NotificationCenter::stop(). Instead, we put the client in a local variable and null
3196 out m_client *before* calling NotificationClient::clearNotifications().
3198 No new tests, already covered by:
3199 http/tests/notifications/event-listener-crash.html
3201 * Modules/notifications/NotificationCenter.cpp:
3202 (WebCore::NotificationCenter::stop):
3204 2015-03-08 Simon Fraser <simon.fraser@apple.com>
3206 Don't call RenderLayerCompositor::needsToBeComposited() so many times
3207 https://bugs.webkit.org/show_bug.cgi?id=142441
3209 Reviewed by Brent Fulgham.
3211 Save one call to needsToBeComposited() per RenderLayer while rebuilding compositing
3212 layers, and a call to isRunningAcceleratedTransformAnimation() in some cases.
3214 computeCompositingRequirements() already knows if the layer will be composited, so
3215 pass that to updateBacking() in the form of a "yes/no/don't" know enum. However,
3216 since updateBacking() no longer calls needsToBeComposited(), we need to call
3217 requiresCompositingForPosition() to get the viewportConstrainedNotCompositedReason flags.
3219 isRunningAcceleratedTransformAnimation() will only be true for a layer which has a
3220 direct compositing reason, so only call isRunningAcceleratedTransformAnimation()
3223 * rendering/RenderLayerCompositor.cpp:
3224 (WebCore::rendererForCompositingTests):
3225 (WebCore::RenderLayerCompositor::updateBacking):
3226 (WebCore::RenderLayerCompositor::computeCompositingRequirements):
3227 (WebCore::RenderLayerCompositor::requiresCompositingLayer): Use references.
3228 (WebCore::RenderLayerCompositor::reasonsForCompositing): Use references.
3229 * rendering/RenderLayerCompositor.h:
3231 2015-03-08 Simon Fraser <simon.fraser@apple.com>
3233 In RenderLayerCompositor, track layer bounds and the haveComputedBounds flag together in a struct
3234 https://bugs.webkit.org/show_bug.cgi?id=142449
3236 Reviewed by Brent Fulgham.
3238 Rather than tracking 'layerBounds' and 'haveComputedBounds' separately, group them together
3239 in an OverlapExtent struct and add a function to compute the bounds, which removes
3240 a copy of this code. OverlapExtent will be extended in a future patch.
3244 * rendering/RenderLayerCompositor.cpp:
3245 (WebCore::RenderLayerCompositor::OverlapMap::geometryMap): Allow const access to
3246 the geometryMap, used by computeExtent().
3247 (WebCore::RenderLayerCompositor::computeExtent):
3248 (WebCore::RenderLayerCompositor::addToOverlapMap):
3249 (WebCore::RenderLayerCompositor::addToOverlapMapRecursive):
3250 (WebCore::RenderLayerCompositor::computeCompositingRequirements):
3251 * rendering/RenderLayerCompositor.h:
3253 2015-03-07 Chris Dumez <cdumez@apple.com>
3255 Crash in WebCore::NotificationCenter::stop()
3256 https://bugs.webkit.org/show_bug.cgi?id=142444
3257 <rdar://problem/20082520>
3259 Reviewed by Andreas Kling.
3261 A use-after-free would sometimes cause us to crash in NotificationCenter::stop().
3262 After investigation, it turns out that NotificationCenter::stop() calls
3263 NotificationClient::clearNotifications() which will destroy the Notification
3264 objects, all of which hold a strong reference to the NotificationCenter. If at
3265 this point, only Notifications are ref'ing the NotificationCenter, this means
3266 that the NotificationCenter will get destroyed right after the call to
3267 NotificationClient::clearNotifications(). However, we reset m_client to null
3268 after calling clearNotifications() and it causes us to crash in this case.
3270 The issue is addressed by adding a Ref<NotificationCenter> protector in
3271 NotificationCenter::stop() so that we make sure the NotificationCenter lives
3272 at least until the end of the method execution.
3274 I was able to consistently reproduce the crash by doing:
3275 Tools/Scripts/run-webkit-tests -1 --debug --repeat-each=30 -g http/tests/notifications/event-listener-crash.html
3277 No new tests, already covered by:
3278 http/tests/notifications/event-listener-crash.html
3280 * Modules/notifications/NotificationCenter.cpp:
3281 (WebCore::NotificationCenter::stop):
3283 2015-03-07 Simon Fraser <simon.fraser@apple.com>
3285 Tidy up RenderLayerCompositor's CompositingState
3286 https://bugs.webkit.org/show_bug.cgi?id=142445
3288 Reviewed by Dan Bernstein.
3290 Make CompositingState a private struct in RenderLayerCompositor.
3291 Since it's a struct, remove the m_ prefix from its data members.
3295 * rendering/RenderLayerCompositor.cpp:
3296 (WebCore::RenderLayerCompositor::CompositingState::CompositingState):
3297 (WebCore::RenderLayerCompositor::computeCompositingRequirements):
3298 (WebCore::CompositingState::CompositingState): Deleted.
3299 * rendering/RenderLayerCompositor.h:
3301 2015-03-07 Darin Adler <darin@apple.com>
3303 Unindent EventTarget, EventListener, JSEventLister.h files
3304 https://bugs.webkit.org/show_bug.cgi?id=142440
3306 Reviewed by Alexey Proskuryakov.
3308 * bindings/js/JSEventListener.h:
3309 * dom/EventListener.h:
3310 * dom/EventTarget.h:
3311 Change indentation to match coding style rules.
3313 2015-03-07 Geoffrey Garen <ggaren@apple.com>
3315 Use FastMalloc (bmalloc) instead of BlockAllocator for GC pages
3316 https://bugs.webkit.org/show_bug.cgi?id=140900
3318 Reviewed by Mark Hahnenberg.
3320 Re-landing just the removal of BlockAllocator, which is now unused.
3322 * platform/cocoa/MemoryPressureHandlerCocoa.mm:
3323 (WebCore::MemoryPressureHandler::install):
3325 2015-03-07 Commit Queue <commit-queue@webkit.org>
3327 Unreviewed, rolling out r181010.
3328 https://bugs.webkit.org/show_bug.cgi?id=142442
3330 Broke media/video-src-invalid-poster.html (Requested by kling
3335 "Stale entries in WeakGCMaps are keeping tons of WeakBlocks
3336 alive unnecessarily."
3337 https://bugs.webkit.org/show_bug.cgi?id=142115
3338 http://trac.webkit.org/changeset/181010
3340 2015-03-07 Darin Adler <darin@apple.com>
3342 Do a bit of EventNames tidying
3343 https://bugs.webkit.org/show_bug.cgi?id=142438
3345 Reviewed by Anders Carlsson.
3347 * dom/EventNames.h: Sorted the event names into a single list instead of
3348 the rudimentary attempts at organizing the list that simply made it hard
3349 to see what is and is not in the list. Removed two unused event names.
3350 I'm sure there are more. Reorganized the EventName class, now a struct,
3351 into a more conventional "public first" order. Got the function bodies
3352 out of the struct so we can see more clearly what is in the struct.
3353 Made more things const.
3354 (WebCore::EventNames::touchEventNames): Changed the return value to a
3355 std::array of reference wrappers rather than a vector of atomic strings.
3356 This should eliminate unnecessary memory allocation and reference count churn.
3358 * dom/EventNames.cpp: Changed initialization based on the above.
3360 * dom/EventTarget.cpp:
3361 (WebCore::EventTarget::getEventListeners): Use NeverDestroyed instead of
3362 DEPRECATED_DEFINE_LOCAL and also just tightened up the function a bit.
3365 (WebCore::Node::didMoveToNewDocument): Streamlined this function with
3366 modern for loops, auto, and also tried to make what it does a bit clearer,
3367 by making loops that are just based on numbers of event listeners look a
3368 bit less like code that actually iterates a vector of listeners. Also used
3369 the type unsigned instead of size_t.
3371 * platform/ThreadGlobalData.h: Updated since it's a struct instead of class now.
3372 (Why is this file in platform!?)
3374 2015-03-07 Brent Fulgham <bfulgham@apple.com>
3376 [Win] Increase TestWebKitAPI Test Coverage
3377 https://bugs.webkit.org/show_bug.cgi?id=142433
3379 Reviewed by Darin Adler.