1 2015-02-08 Darin Adler <darin@apple.com>
3 Remove the SVG instance tree
4 https://bugs.webkit.org/show_bug.cgi?id=140602
6 Reviewed by Dean Jackson.
8 * CMakeLists.txt: Removed SVGElementInstance source files.
9 * DerivedSources.cpp: Ditto.
10 * DerivedSources.make: Ditto.
11 * WebCore.vcxproj/WebCore.vcxproj: Ditto.
12 * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
13 * WebCore.xcodeproj/project.pbxproj: Ditto.
14 * bindings/js/JSBindingsAllInOne.cpp: Ditto.
16 * bindings/js/JSEventListener.cpp:
17 (WebCore::forwardsEventListeners): Deleted. Only returned true for JSSVGElementInstance.
18 (WebCore::correspondingElementWrapper): Deleted. Only used for JSSVGElementInstance.
19 (WebCore::createJSEventListenerForAttribute): Deleted. Argument type was JSSVGElementInstance.
20 (WebCore::createJSEventListenerForAdd): Removed most of the code; later we can delete this entirely.
22 * bindings/js/JSEventListener.h: Removed the overload of createJSEventListenerForAttribute
23 that takes a JSSVGElementInstance.
25 * bindings/js/JSSVGElementInstanceCustom.cpp: Removed.
27 * dom/ContainerNodeAlgorithms.h: Updated comment to reflect the fact that
28 this code is really now only used for ContainerNode and no longer needs to
29 exist in a generic form.
31 * dom/EventTarget.h: Removed forward declaration of SVGElementInstance.
32 * svg/SVGElement.h: Ditto.
34 * dom/EventTargetFactory.in: Removed SVGElementInstance.
36 * svg/SVGElementInstance.cpp: Removed.
37 * svg/SVGElementInstance.h: Removed.
38 * svg/SVGElementInstance.idl: Removed.
40 * svg/SVGUseElement.cpp:
41 (WebCore::SVGUseElement::insertedInto): Removed obsolete comment.
42 (WebCore::SVGUseElement::instanceTreeIsLoading): Deleted. Unused
43 function that I forgot to delete in my last patch. It also had a
44 glaring mistake, a missing "return" before the recursive call to
45 itself that would cause it to return false when it should return true.
47 * svg/SVGUseElement.h: Removed instanceTreeIsLoading.
49 * dom/EventDispatcher.cpp: Removed include of SVGElementInstance.h.
50 * page/EventHandler.cpp: Ditto.
51 * rendering/svg/RenderSVGViewportContainer.cpp: Ditto.
52 * svg/SVGAElement.cpp: Ditto.
53 * svg/SVGAllInOne.cpp: Ditto.
54 * svg/SVGAnimateMotionElement.cpp: Ditto.
55 * svg/SVGAnimatedTypeAnimator.h: Ditto.
56 * svg/SVGAnimationElement.cpp: Ditto.
57 * svg/SVGCircleElement.cpp: Ditto.
58 * svg/SVGClipPathElement.cpp: Ditto.
59 * svg/SVGComponentTransferFunctionElement.cpp: Ditto.
60 * svg/SVGCursorElement.cpp: Ditto.
61 * svg/SVGElement.cpp: Ditto.
62 * svg/SVGEllipseElement.cpp: Ditto.
63 * svg/SVGFEBlendElement.cpp: Ditto.
64 * svg/SVGFEColorMatrixElement.cpp: Ditto.
65 * svg/SVGFECompositeElement.cpp: Ditto.
66 * svg/SVGFEConvolveMatrixElement.cpp: Ditto.
67 * svg/SVGFEDiffuseLightingElement.cpp: Ditto.
68 * svg/SVGFEDisplacementMapElement.cpp: Ditto.
69 * svg/SVGFEDropShadowElement.cpp: Ditto.
70 * svg/SVGFEGaussianBlurElement.cpp: Ditto.
71 * svg/SVGFEImageElement.cpp: Ditto.
72 * svg/SVGFELightElement.cpp: Ditto.
73 * svg/SVGFEMergeNodeElement.cpp: Ditto.
74 * svg/SVGFEMorphologyElement.cpp: Ditto.
75 * svg/SVGFEOffsetElement.cpp: Ditto.
76 * svg/SVGFESpecularLightingElement.cpp: Ditto.
77 * svg/SVGFETileElement.cpp: Ditto.
78 * svg/SVGFETurbulenceElement.cpp: Ditto.
79 * svg/SVGFilterElement.cpp: Ditto.
80 * svg/SVGFilterPrimitiveStandardAttributes.cpp: Ditto.
81 * svg/SVGForeignObjectElement.cpp: Ditto.
82 * svg/SVGGElement.cpp: Ditto.
83 * svg/SVGGradientElement.cpp: Ditto.
84 * svg/SVGGraphicsElement.cpp: Ditto.
85 * svg/SVGImageElement.cpp: Ditto.
86 * svg/SVGLineElement.cpp: Ditto.
87 * svg/SVGLinearGradientElement.cpp: Ditto.
88 * svg/SVGMarkerElement.cpp: Ditto.
89 * svg/SVGMaskElement.cpp: Ditto.
90 * svg/SVGPathElement.cpp: Ditto.
91 * svg/SVGPatternElement.cpp: Ditto.
92 * svg/SVGPolyElement.cpp: Ditto.
93 * svg/SVGRadialGradientElement.cpp: Ditto.
94 * svg/SVGRectElement.cpp: Ditto.
95 * svg/SVGSVGElement.cpp: Ditto.
96 * svg/SVGScriptElement.cpp: Ditto.
97 * svg/SVGStopElement.cpp: Ditto.
98 * svg/SVGSymbolElement.cpp: Ditto.
99 * svg/SVGTRefElement.cpp: Ditto.
100 * svg/SVGTextContentElement.cpp: Ditto.
101 * svg/SVGTextElement.cpp: Ditto.
102 * svg/SVGTextPathElement.cpp: Ditto.
103 * svg/SVGTextPositioningElement.cpp: Ditto.
105 2015-02-07 Dean Jackson <dino@apple.com>
107 Tweak inline playback controls to match system spec
108 https://bugs.webkit.org/show_bug.cgi?id=141375
109 <rdar://problem/19760754>
111 Reviewed by Sam Weinig.
113 Rework the UI of the inline media controls on iOS, to
114 better match the system specification. I've batched a
115 few changes into one patch because many of them are
116 inter-dependent, and not very aggressive. Changes are:
118 - updated artwork for the buttons.
119 - separate artwork for normal and active states.
120 - background images are now explicitly sized and positioned
121 in the middle of the element, allowing audio and video
122 to use the same glyphs even though the elements are
124 - use plus-darker blend mode on the button glyphs.
125 - rearranged some of the rules to group things in a
127 - time should front-pad a "0" character, if less than 10.
128 - no need for an "active" class on the Airplay button (although
129 I won't be surprised if this changes back).
131 * Modules/mediacontrols/mediaControlsiOS.css:
132 (::-webkit-media-controls):
133 (video::-webkit-media-controls-wireless-playback-picker-button.active): Deleted.
134 (audio::-webkit-media-controls-wireless-playback-picker-button.active): Deleted.
135 (audio::-webkit-media-controls-play-button:active): Deleted.
136 (audio::-webkit-media-controls-play-button.paused): Deleted.
137 (video::-webkit-media-controls-timeline): Deleted.
138 * Modules/mediacontrols/mediaControlsiOS.js:
139 (ControllerIOS.prototype.updateWirelessPlaybackStatus): No need
140 for the "active" class.
141 (ControllerIOS.prototype.formatTime): Pad with a leading zero.
143 2015-02-08 Darin Adler <darin@apple.com>
145 Make SVGUseElement work without creating any SVGElementInstance objects
146 https://bugs.webkit.org/show_bug.cgi?id=141374
148 Reviewed by Sam Weinig.
150 * dom/ElementIterator.h: Changed the * and -> operators to be const.
151 There is no need for the iterator itself to be modified just to dereference it.
153 * dom/TypedElementDescendantIterator.h: Added DoubleTypedElementDescendantIterator.
154 This allows callers to call descendantsOfType on two elements, as long as the caller
155 can guarantee that both have the same number of descendants of that type. It's handy
156 for walking a tree of cloned elements to set up something between each original and
157 its clone. In the future we might instead change the cloning machinery so it can do
158 this work as we clone, and if so, we could consider deleting this.
160 * svg/SVGElement.cpp:
161 (WebCore::SVGElement::correspondingElement): Made this const.
162 (WebCore::SVGElement::invalidateInstances): Got rid of the rule that said "this can
163 only be done for an element in a document", since it's useful to do this on an element
164 that has just been removed from a document. Removed the "updateStyleIfNeeded" call
165 here now that the other changes make it no longer needed. Removed an unimportant
166 assertion that we only invalidate use elements that are in a document; that's not
167 a necessary restriction. Streamlined the logic a bit.
169 * svg/SVGElement.h: Made correspondingElement const.
171 * svg/SVGUseElement.cpp:
172 (WebCore::SVGUseElement::insertedInto): Removed an assertion about
173 m_targetElementInstance since that's gone now.
174 (WebCore::SVGUseElement::svgAttributeChanged): Changed code that transfers
175 size attributes to the shadow tree to use shadowTreeTargetClone instead of
176 m_targetElementInstance.
177 (WebCore::SVGUseElement::clearResourceReferences): Removed code to detach
178 m_targetElementInstance, and also the call to removeAllTargetReferencesForElement,
179 because we no longer use those.
180 (WebCore::SVGUseElement::buildPendingResource): Moved the code to build the
181 shadow tree in here and deleted the buildShadowAndInstanceTree function.
182 Also changed logic so that we use a pending resource any time the target is not
183 a valid one. That helps us correctly handle cases where we initially have an
184 invalid target, but later get a value one
185 (WebCore::SVGUseElement::buildShadowAndInstanceTree): Deleted. The code here
186 was greatly simplified and moved into buildPendingResource.
187 (WebCore::SVGUseElement::buildInstanceTree): Deleted.
188 (WebCore::SVGUseElement::hasCycleUseReferencing): Deleted. Cycles are now
189 detected by the new isValidTarget function and so there's no need for a
190 separate explicit check for a cycle.
191 (WebCore::associateClonesWithOriginals): Added. Helper that makes
192 functions that build the shadow tree simpler and easier to read.
193 (WebCore::associateReplacementCloneWithOriginal): Added. Helper to
194 make associateReplacementClonesWithOriginals simple.
195 (WebCore::associateReplacementClonesWithOriginals): Added. Helper that
196 makes functions that build the shadow tree simpler and easier to read.
197 (WebCore::SVGUseElement::buildShadowTree): Call associateClonesWithOriginals
198 since associateInstancesWithShadowTreeElements no longer does this.
199 (WebCore::SVGUseElement::isValidTarget): Added. Covers all the different
200 reasons a target might not be valid: type of element, reference cycles, and
201 also "not in document" (refactored in here; not sure when that can happen
202 in practice, might be possible to remove it later).
203 (WebCore::SVGUseElement::expandUseElementsInShadowTree): Add checks for
204 documents that are still loading; this used to be checked when building the
205 instance tree. Added calls to associateReplacementClonesWithOriginals and
206 associateClonesWithOriginals; that used to be done by later in the
207 associateInstancesWithShadowTreeElements function. Use isValidTarget so
208 we handle cycles as well as invalid target types.
209 (WebCore::SVGUseElement::expandSymbolElementsInShadowTree): Added a call to
210 associateReplacementClonesWithOriginals, since we can no longer do that in
211 associateInstancesWithShadowTreeElements.
212 (WebCore::SVGUseElement::associateInstancesWithShadowTreeElements): Deleted.
213 (WebCore::SVGUseElement::instanceForShadowTreeElement): Deleted.
214 (WebCore::SVGUseElement::invalidateDependentShadowTrees): Removed a comment
215 that simply restated the name of the function.
217 * svg/SVGUseElement.h: Removed instanceForShadowTreeElement,
218 buildShadowAndInstanceTree, detachInstance, buildInstanceTree,
219 hasCycleUseReferencing, associateInstancesWithShadowTreeElements,
220 instanceForShadowTreeElement, and m_targetElementInstance. Added isValidTarget.
222 2015-02-08 Chris Dumez <cdumez@apple.com>
224 [WK2] Add logging to validate the network cache efficacy (Part 1)
225 https://bugs.webkit.org/show_bug.cgi?id=141269
226 <rdar://problem/19632080>
228 Reviewed by Antti Koivisto.
230 Export an extra symbol.
234 2015-02-07 Chris Fleizach <cfleizach@apple.com>
236 AX: The input element with type="search" has no default focus outline
237 https://bugs.webkit.org/show_bug.cgi?id=140326
239 Reviewed by Darin Adler.
241 The platform RenderTheme takes care of the search field, and that code
242 was missing a check for whether the element was focused.
244 Test: fast/css/focus-ring-exists-for-search-field.html
246 * rendering/RenderThemeMac.mm:
247 (WebCore::RenderThemeMac::paintSearchField):
249 2015-02-07 Tim Horton <timothy_horton@apple.com>
251 Add some dictionary lookup tests
252 https://bugs.webkit.org/show_bug.cgi?id=141355
254 Reviewed by Darin Adler.
256 Tests: platform/mac/editing/dictionary-lookup/dictionary-lookup-input.html
257 platform/mac/editing/dictionary-lookup/dictionary-lookup-inside-selection.html
258 platform/mac/editing/dictionary-lookup/dictionary-lookup-outside-selection.html
259 platform/mac/editing/dictionary-lookup/dictionary-lookup-rtl.html
260 platform/mac/editing/dictionary-lookup/dictionary-lookup.html
263 Remove an unneeded export.
265 * editing/mac/DictionaryLookup.h:
266 Use OBJC_CLASS instead of @class so that this can be included in pure-C++ files.
268 * testing/Internals.cpp:
269 (WebCore::Internals::rangeForDictionaryLookupAtLocation):
270 * testing/Internals.h:
271 * testing/Internals.idl:
272 Expose rangeForDictionaryLookupAtHitTestResult fairly directly to JavaScript.
274 2015-02-07 Chris Dumez <cdumez@apple.com>
276 Add Vector::removeFirstMatching() / removeAllMatching() methods taking lambda functions
277 https://bugs.webkit.org/show_bug.cgi?id=141321
279 Reviewed by Darin Adler.
281 Use new Vector::removeFirstMatching() / removeAllMatching() methods.
283 2015-02-07 Darin Adler <darin@apple.com>
285 Stop dispatching events to with SVGElementInstance objects as their targets
286 https://bugs.webkit.org/show_bug.cgi?id=141108
288 Reviewed by Anders Carlsson.
290 Test: svg/custom/use-event-retargeting.html
292 * dom/EventDispatcher.cpp:
293 (WebCore::eventTargetRespectingTargetRules): Replaced the code that retargeted
294 events at SVGElementInstance objects with code that retargets them at the use
295 element instead. Also wrote the code in a simpler way.
297 2015-02-07 Jer Noble <jer.noble@apple.com>
299 [Mac] Set -contentsScale on AVPlayerLayer to allow AVPlayer to select the appropriate HLS variant.
300 https://bugs.webkit.org/show_bug.cgi?id=141354
301 rdar://problem/19717591
303 Reviewed by Darin Adler.
305 AVPlayer will try to determine the correct HLS variant based on the bounds of an AVPlayerLayer.
306 When not in a layer tree, AVFoundation is not able to determine the correct mapping from logical
307 units to pixel values. To provide AVPlayer with that scaling value, set -contentsScale based on
308 both the current device scale and the current page scale.
310 Since this needs to be set at initialization time, before the AVPlayer is has any AVPlayerItems,
311 add some plumbing up from MediaPlayer to as the HTMLMediaElement for the appropriate contents
314 * html/HTMLMediaElement.cpp:
315 (WebCore::HTMLMediaElement::mediaPlayerContentsScale):
316 * html/HTMLMediaElement.h:
317 * platform/graphics/MediaPlayer.h:
318 (WebCore::MediaPlayerClient::mediaPlayerContentsScale):
319 * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
320 (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer):
321 * platform/graphics/ca/GraphicsLayerCA.cpp:
322 (WebCore::GraphicsLayerCA::updateContentsScale):
324 2015-02-07 Alexey Proskuryakov <ap@apple.com>
326 ASan complains about plugins/snapshotting/snapshot-plugin-not-quite-blocked-by-image.html
327 https://bugs.webkit.org/show_bug.cgi?id=141352
328 rdar://problem/19717490
330 Reviewed by Anders Carlsson.
332 * dom/Document.cpp: (WebCore::Document::ensurePlugInsInjectedScript): This string
333 is not null terminated.
335 2015-02-06 Zalan Bujtas <zalan@apple.com>
337 ASSERT repaintContainer->hasLayer() in WebCore::RenderObject::repaintUsingContainer
338 https://bugs.webkit.org/show_bug.cgi?id=140750
340 Reviewed by Simon Fraser.
342 There's a short period of time when RenderObject::layer() still returns a valid pointer
343 even though we already cleared the hasLayer() flag.
344 Do not use the layer as repaint container in such cases.
346 Test: compositing/repaint-container-assertion-when-toggling-compositing.html
348 * rendering/RenderObject.cpp:
349 (WebCore::RenderObject::enclosingLayer):
351 2015-02-06 Chris Dumez <cdumez@apple.com>
353 Have SQLiteStatement::database() return a reference
354 https://bugs.webkit.org/show_bug.cgi?id=141348
356 Reviewed by Andreas Kling.
358 Have SQLiteStatement::database() return a reference as it can never
361 * loader/icon/IconDatabase.cpp:
362 (WebCore::readySQLiteStatement):
363 * platform/sql/SQLiteStatement.h:
364 (WebCore::SQLiteStatement::database):
366 2015-02-06 Brent Fulgham <bfulgham@apple.com>
368 Add youtube-nocookie URL to isYouTubeURL predicate
369 https://bugs.webkit.org/show_bug.cgi?id=141347
370 <rdar://problem/19430657>
372 Reviewed by Eric Carlson.
374 * Modules/plugins/YouTubePluginReplacement.cpp:
375 (WebCore::isYouTubeURL): Update for additional youtube-nocookie site.
377 2015-02-06 Said Abou-Hallawa <sabouhallawa@apple.com>
379 Invalid cast in WebCore::SVGAnimateElement::calculateAnimatedValue.
380 https://bugs.webkit.org/show_bug.cgi?id=135171.
382 Reviewed by Dean Jackson.
384 The bug happens when an SVG element is animated by <animateMotion> followed by an
385 <animateColor> or an <animate> and the values of the "attributeName" in both elements
386 are the same. The problem is <animateMotion> should not have an attribute to animate.
387 If it does by fuzz or by mistake, then we assume the <animateMotion> and the <animate>
388 animate the same attribute for the same element target. Therefore we schedule them in
389 the same AnimationVector in SMILTimeContainer::schedule(). When we call
390 SVGAnimateElementBase::calculateAnimatedValue() for an SVGAnimateColorElement and the
391 resultElement is SVGAnimateMotionElement, we fail to cast it to SVGAnimateElementBase
392 because SVGAnimateMotionElement is derived from SVGAnimationElement which is the base
393 class of all animate elements including SVGAnimateElementBase.
395 The fix is to nullify setting "attributeName" of an SVGAnimationElement. By doing so,
396 "attributeName" and its value will be ignored from the <animateMotion> which is correct.
398 Tests: svg/animations/animate-montion-invalid-attribute.svg.
400 * svg/SVGAnimateElementBase.cpp:
401 (WebCore::SVGAnimateElementBase::setAttributeName):
402 Do not call SVGAnimationElement::setAttributeName() since SVGAnimationElement should
403 not have an attribute to animate. We prevent this by bypassing the parent in the class
404 hierarchy: SVGAnimationElement and calling SVGSMILElement::setAttributeName() directly.
406 * svg/SVGAnimationElement.cpp:
407 (WebCore::SVGAnimationElement::setAttributeName): Deleted.
408 * svg/SVGAnimationElement.h:
409 SVGAnimationElement should not have an attribute to animate. So implement its
410 setAttributeName() as a null function.
412 2015-02-06 Simon Fraser <simon.fraser@apple.com>
414 Convert the compositing overlap map to use LayoutRects
415 https://bugs.webkit.org/show_bug.cgi?id=141346
416 rdar://problem/18206365
418 Reviewed by Zalan Bujtas.
420 If two compositing layers were adjoining but not overlapping, but happened to
421 have non-integral offsets, then using enclosing IntRects in the overlap map
422 would cause us to think they are overlapping, and create unnecessary backing store.
424 Fix by converting the overlap map to use LayoutRects.
426 Test: compositing/layer-creation/subpixel-adjacent-layers-overlap.html
428 * rendering/RenderLayerCompositor.cpp:
429 (WebCore::OverlapMapContainer::add):
430 (WebCore::OverlapMapContainer::overlapsLayers):
431 (WebCore::RenderLayerCompositor::OverlapMap::add):
432 (WebCore::RenderLayerCompositor::OverlapMap::overlapsLayers):
433 (WebCore::RenderLayerCompositor::OverlapMap::RectList::append):
434 (WebCore::RenderLayerCompositor::OverlapMap::RectList::intersects):
435 (WebCore::RenderLayerCompositor::logLayerInfo):
436 (WebCore::RenderLayerCompositor::addToOverlapMap):
437 (WebCore::RenderLayerCompositor::addToOverlapMapRecursive):
438 (WebCore::RenderLayerCompositor::computeCompositingRequirements):
439 * rendering/RenderLayerCompositor.h:
441 2015-02-06 Andreas Kling <akling@apple.com>
443 Ref-ify various getters that return HTMLCollection.
444 <https://webkit.org/b/141336>
446 Reviewed by Anders Carlsson.
448 Make all the getters that return HTMLCollection objects (and never return nullptr)
449 return Ref instead of RefPtr.
451 Removed a couple of useless null checks that were exposed by this change.
453 * accessibility/AccessibilityRenderObject.cpp:
454 (WebCore::AccessibilityRenderObject::getDocumentLinks):
455 * bindings/js/JSDOMWindowCustom.cpp:
456 (WebCore::namedItemGetter):
457 * bindings/js/JSHTMLDocumentCustom.cpp:
458 (WebCore::JSHTMLDocument::nameGetter):
460 (WebCore::Document::ensureCachedCollection):
461 (WebCore::Document::images):
462 (WebCore::Document::applets):
463 (WebCore::Document::embeds):
464 (WebCore::Document::plugins):
465 (WebCore::Document::scripts):
466 (WebCore::Document::links):
467 (WebCore::Document::forms):
468 (WebCore::Document::anchors):
469 (WebCore::Document::all):
470 (WebCore::Document::windowNamedItems):
471 (WebCore::Document::documentNamedItems):
472 (WebCore::Document::iconURLs):
475 (WebCore::Element::ensureCachedHTMLCollection):
477 * html/ColorInputType.cpp:
478 (WebCore::ColorInputType::suggestions):
479 * html/HTMLDataListElement.cpp:
480 (WebCore::HTMLDataListElement::options):
481 * html/HTMLDataListElement.h:
482 * html/HTMLElement.cpp:
483 (WebCore::HTMLElement::children):
484 * html/HTMLElement.h:
485 * html/HTMLFieldSetElement.cpp:
486 (WebCore::HTMLFieldSetElement::elements):
487 * html/HTMLFieldSetElement.h:
488 * html/HTMLFormElement.cpp:
489 (WebCore::HTMLFormElement::elements):
490 * html/HTMLFormElement.h:
491 * html/HTMLInputElement.cpp:
492 (WebCore::HTMLInputElement::setupDateTimeChooserParameters):
493 * html/HTMLMapElement.cpp:
494 (WebCore::HTMLMapElement::areas):
495 * html/HTMLMapElement.h:
496 * html/HTMLSelectElement.cpp:
497 (WebCore::HTMLSelectElement::selectedOptions):
498 (WebCore::HTMLSelectElement::options):
499 * html/HTMLSelectElement.h:
500 * html/HTMLTableElement.cpp:
501 (WebCore::HTMLTableElement::rows):
502 (WebCore::HTMLTableElement::tBodies):
503 * html/HTMLTableElement.h:
504 * html/HTMLTableRowElement.cpp:
505 (WebCore::HTMLTableRowElement::insertCell):
506 (WebCore::HTMLTableRowElement::deleteCell):
507 (WebCore::HTMLTableRowElement::cells):
508 * html/HTMLTableRowElement.h:
509 * html/HTMLTableSectionElement.cpp:
510 (WebCore::HTMLTableSectionElement::insertRow):
511 (WebCore::HTMLTableSectionElement::deleteRow):
512 (WebCore::HTMLTableSectionElement::rows):
513 * html/HTMLTableSectionElement.h:
514 * html/RangeInputType.cpp:
515 (WebCore::RangeInputType::updateTickMarkValues):
516 * rendering/RenderTheme.cpp:
517 (WebCore::RenderTheme::paintSliderTicks):
519 2015-02-06 Brent Fulgham <bfulgham@apple.com>
521 [iOS] Implement audio track selection in fullscreen.
522 https://bugs.webkit.org/show_bug.cgi?id=131236
523 <rdar://problem/16552632>
525 Reviewed by Eric Carlson.
527 * platform/ios/WebVideoFullscreenModelVideoElement.h:
528 * platform/ios/WebVideoFullscreenModelVideoElement.mm:
529 (WebVideoFullscreenModelVideoElement::selectAudioMediaOption): Provide implementation.
530 (WebVideoFullscreenModelVideoElement::updateLegibleOptions): Add audio track information
531 to menu displayed to user.
533 2015-02-06 Bartlomiej Gajda <b.gajda@samsung.com>
535 [MSE] Implement Append Error algorithm.
536 https://bugs.webkit.org/show_bug.cgi?id=139439
538 Reviewed by Jer Noble.
540 If Source Buffer has not received first init segment, then it shall call endOfStream after receiving
541 Media Segment, as per Media Source spec. (from 17 July 2014) in paragraph 3.5.1 point 6.1.
543 Based this change on Editor's Draft 12 December 2014, as it clarifies order of events.
545 Test: media/media-source/media-source-append-media-segment-without-init.html
547 * Modules/mediasource/MediaSource.cpp:
548 (WebCore::MediaSource::streamEndedWithError):
549 * Modules/mediasource/MediaSource.h:
550 * Modules/mediasource/SourceBuffer.cpp:
551 (WebCore::SourceBuffer::sourceBufferPrivateAppendComplete):
552 (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment):
553 (WebCore::SourceBuffer::validateInitializationSegment):
554 (WebCore::SourceBuffer::appendError):
555 * Modules/mediasource/SourceBuffer.h:
557 2015-02-06 Timothy Horton <timothy_horton@apple.com>
559 REGRESSION: Lookup doesn't work in RTL
560 https://bugs.webkit.org/show_bug.cgi?id=141338
561 <rdar://problem/19738407>
563 Reviewed by Dan Bernstein.
565 * editing/Editor.cpp:
566 (WebCore::Editor::scanSelectionForTelephoneNumbers):
567 * editing/mac/DictionaryLookup.mm:
568 (WebCore::rangeExpandedAroundPositionByCharacters):
569 Positions are independent of writing direction, so we don't
570 need to (and shouldn't) do anything special for RTL here.
572 2015-02-06 Maciej Stachowiak <mjs@apple.com>
574 REGRESSION(r179706): Caused memory corruption on some tests (Requested by _ap_ on #webkit).
575 https://bugs.webkit.org/show_bug.cgi?id=141324
577 Reviewed by Alexey Proskuryakov.
579 No new tests. This is caught by existing tests under ASAN, and I don't know how to reproduce
582 * rendering/RenderLineBoxList.cpp:
583 (WebCore::RenderLineBoxList::dirtyLinesFromChangedChild): Give up
584 and just always invalidate the next line. It's too hard to come up
585 with the condition that catches all needed cases, doesn't itself
586 cause a crash, and isn't overzealous. And we do this for the
587 previous line anyway. Also clean up the code a bit since it
588 confusingly reuses a variable, and declares it uninitialized, for
591 2015-02-05 Dhi Aurrahman <diorahman@rockybars.com>
593 Remove duplicate loop after r179532
594 https://bugs.webkit.org/show_bug.cgi?id=141300
596 Reviewed by Benjamin Poulain.
598 No new tests, no behavior changed.
600 * css/SelectorCheckerTestFunctions.h:
601 (WebCore::matchesLangPseudoClass):
603 2015-02-05 Commit Queue <commit-queue@webkit.org>
605 Unreviewed, rolling out r179725.
606 https://bugs.webkit.org/show_bug.cgi?id=141320
608 caused 2 layout tests to fail (Requested by zalan on #webkit).
612 "[MSE] Implement Append Error algorithm."
613 https://bugs.webkit.org/show_bug.cgi?id=139439
614 http://trac.webkit.org/changeset/179725
616 2015-02-05 Andreas Kling <akling@apple.com>
618 [iOS] Run a full garbage collection on memory warning.
619 <https://webkit.org/b/141313>
620 <rdar://problem/19738024>
622 Reviewed by Chris Dumez.
624 Make sure that we run a full GC when trying to free up memory, as this might
625 be our last chance to execute before the kernel suspends this process.
627 This aligns WebKit2 with the old WebKit1 behavior.
629 * platform/cocoa/MemoryPressureHandlerCocoa.mm:
630 (WebCore::MemoryPressureHandler::platformReleaseMemory):
633 2015-02-05 Hyungwook Lee <hyungwook.lee@navercorp.com>
635 Fix ASSERTION FAILED: !root->needsLayout() in FrameView::layout()
636 https://bugs.webkit.org/show_bug.cgi?id=141032
638 Reviewed by Darin Adler.
640 This patch moves the !root->needsLayout() assert statement above
641 updateLayerPositionsAfterLayout() that can modify dirty bit system
642 when we have RenderMarquee.
644 * page/FrameView.cpp:
645 (WebCore::FrameView::layout):
647 2015-02-05 Bartlomiej Gajda <b.gajda@samsung.com>
649 [MSE] Implement Append Error algorithm.
650 https://bugs.webkit.org/show_bug.cgi?id=139439
652 Reviewed by Jer Noble.
654 If Source Buffer has not received first init segment, then it shall call endOfStream after receiving
655 Media Segment, as per Media Source spec. (from 17 July 2014) in paragraph 3.5.1 point 6.1.
657 Based this change on Editor's Draft 12 December 2014, as it clarifies order of events.
659 Test: media/media-source/media-source-append-media-segment-without-init.html
661 * Modules/mediasource/MediaSource.cpp:
662 (WebCore::MediaSource::streamEndedWithError):
663 * Modules/mediasource/MediaSource.h:
664 * Modules/mediasource/SourceBuffer.cpp:
665 (WebCore::SourceBuffer::sourceBufferPrivateAppendComplete):
666 (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment):
667 (WebCore::SourceBuffer::validateInitializationSegment):
668 (WebCore::SourceBuffer::appendError):
669 * Modules/mediasource/SourceBuffer.h:
671 2015-02-05 Maciej Stachowiak <mjs@apple.com>
673 Crash due to failing to dirty a removed text node's line box
674 https://bugs.webkit.org/show_bug.cgi?id=136544
676 Reviewed by David Hyatt.
678 Test: fast/text/remove-text-node-linebox-not-dirty-crash.html
680 * rendering/RenderLineBoxList.cpp:
681 (WebCore::RenderLineBoxList::dirtyLinesFromChangedChild): Make the check for dirtying the next
682 line box a bit more inclusive to avoid a case of a line box for a destroyed render object not
683 being dirtied. In particular, when the text node's parent has no line boxes but contains BRs.
685 2015-02-05 Chris Dumez <cdumez@apple.com>
687 Free memory read under MemoryCache::pruneLiveResourcesToSize()
688 https://bugs.webkit.org/show_bug.cgi?id=141292
689 <rdar://problem/19725522>
691 Reviewed by Antti Koivisto.
693 In MemoryCache::pruneLiveResourcesToSize(), we were iterating over the
694 m_liveDecodedResources ListHashSet and possibly calling
695 CachedResource::destroyDecodedData() on the current value. Doing so
696 would cause a call to ListHashSet::remove() to remove the value pointed
697 by the current iterator, thus invalidating our iterator.
699 In this patch, we increment the ListHashSet iterator *before* calling
700 CachedResource::destroyDecodedData(), while the current iterator is
701 still valid. Note that this is safe because unlike iteration of most
702 WTF Hash data structures, iteration is guaranteed safe against mutation
703 of the ListHashSet, except for removal of the item currently pointed to
706 Test: http/tests/cache/memory-cache-pruning.html
708 * loader/cache/MemoryCache.cpp:
709 (WebCore::MemoryCache::pruneLiveResourcesToSize):
711 2015-02-05 Jer Noble <jer.noble@apple.com>
713 [Mac] HLS <video> will not fire 'progress' events, only 'stalled'.
714 https://bugs.webkit.org/show_bug.cgi?id=141284
716 Reviewed by Brent Fulgham.
718 Test: http/tests/media/hls/hls-progress.html
720 totalBytes() will always return 0 for HLS streams, which will cause didLoadingProgress() to always
721 return false. Skip this optimization.
723 Drive-by fix: duration() will always return 0 for this class as well. Use durationMediaTime() instead.
725 * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
726 (WebCore::MediaPlayerPrivateAVFoundation::didLoadingProgress):
728 2015-02-05 Darin Adler <darin@apple.com>
730 Move InstanceInvalidationGuard/UpdateBlocker to SVGElement from SVGElementInstance
731 https://bugs.webkit.org/show_bug.cgi?id=141148
733 Reviewed by Brent Fulgham and Anders Carlsson.
735 Inspired by this change Rob Buis made in Blink:
737 http://src.chromium.org/viewvc/blink?view=revision&revision=173343
739 I actually wrote the whole thing and then discovered we did it almost identically.
741 * svg/SVGAnimatedTypeAnimator.cpp:
742 (WebCore::SVGElementAnimatedPropertyList::setInstanceUpdatesBlocked): Added this
743 helper function to get around a circular header dependency.
744 * svg/SVGAnimatedTypeAnimator.h:
745 (WebCore::SVGAnimatedTypeAnimator::executeAction): Use setInstanceUpdatesBlocked.
747 * svg/SVGElement.cpp:
748 (WebCore::SVGElement::removedFrom): Use invalidateInstances.
749 (WebCore::SVGElement::finishParsingChildren): Ditto.
750 (WebCore::SVGElement::svgAttributeChanged): Ditto.
751 (WebCore::SVGElement::childrenChanged): Ditto.
752 (WebCore::SVGElement::setInstanceUpdatesBlocked): Added an assertion that will
753 catch anyone who nests InstanceUpdateBlocker by accident.
754 (WebCore::SVGElement::invalidateInstances): Moved this here from
755 SVGElementInstance::invalidateAllInstancesOfElement. I had already modified this
756 so it had nothing to do with SVGElementInstance, so it was a simple matter of
757 converting this into a member function. Added a FIXME about the mysterious
758 updateStyleIfNeeded that makes multiple tests fail if it's removed.
760 * svg/SVGElement.h: Added public InstanceUpdateBlocker class, protected
761 InstanceInvalidationGuard class, and private invalidateInstances function.
762 Unlike the ones in SVGElementInstance these use references so they are then
763 not copyable without using the WTF_MAKE_NONCOPYABLE macro.
765 * svg/SVGElementInstance.cpp:
766 (WebCore::SVGElementInstance::invalidateAllInstancesOfElement): Deleted.
767 (WebCore::SVGElementInstance::InstanceUpdateBlocker::InstanceUpdateBlocker): Deleted.
768 (WebCore::SVGElementInstance::InstanceUpdateBlocker::~InstanceUpdateBlocker): Deleted.
769 * svg/SVGElementInstance.h: Removed InvalidationGuard, InstanceUpdateBlocker, and
770 invalidateAllInstancesOfElement. Didn't do any further cleanup since we soon will
771 delete this entire file.
773 * svg/SVGAElement.cpp:
774 (WebCore::SVGAElement::svgAttributeChanged): Updated to use new name and reference
776 * svg/SVGAnimateElementBase.cpp:
777 (WebCore::applyCSSPropertyToTargetAndInstances): Ditto.
778 (WebCore::removeCSSPropertyFromTargetAndInstances): Ditto.
779 (WebCore::notifyTargetAndInstancesAboutAnimValChange): Ditto.
780 * svg/SVGAnimatedPath.cpp:
781 (WebCore::SVGAnimatedPathAnimator::startAnimValAnimation): Ditto.
782 * svg/SVGCircleElement.cpp:
783 (WebCore::SVGCircleElement::svgAttributeChanged): Ditto.
784 * svg/SVGClipPathElement.cpp:
785 (WebCore::SVGClipPathElement::svgAttributeChanged): Ditto.
786 * svg/SVGComponentTransferFunctionElement.cpp:
787 (WebCore::SVGComponentTransferFunctionElement::svgAttributeChanged): Ditto.
788 * svg/SVGCursorElement.cpp:
789 (WebCore::SVGCursorElement::svgAttributeChanged): Ditto.
790 * svg/SVGEllipseElement.cpp:
791 (WebCore::SVGEllipseElement::svgAttributeChanged): Ditto.
792 * svg/SVGFEBlendElement.cpp:
793 (WebCore::SVGFEBlendElement::svgAttributeChanged): Ditto.
794 * svg/SVGFEColorMatrixElement.cpp:
795 (WebCore::SVGFEColorMatrixElement::svgAttributeChanged): Ditto.
796 * svg/SVGFECompositeElement.cpp:
797 (WebCore::SVGFECompositeElement::svgAttributeChanged): Ditto.
798 * svg/SVGFEConvolveMatrixElement.cpp:
799 (WebCore::SVGFEConvolveMatrixElement::svgAttributeChanged): Ditto.
800 * svg/SVGFEDiffuseLightingElement.cpp:
801 (WebCore::SVGFEDiffuseLightingElement::svgAttributeChanged): Ditto.
802 * svg/SVGFEDisplacementMapElement.cpp:
803 (WebCore::SVGFEDisplacementMapElement::svgAttributeChanged): Ditto.
804 * svg/SVGFEDropShadowElement.cpp:
805 (WebCore::SVGFEDropShadowElement::svgAttributeChanged): Ditto.
806 * svg/SVGFEGaussianBlurElement.cpp:
807 (WebCore::SVGFEGaussianBlurElement::svgAttributeChanged): Ditto.
808 * svg/SVGFEImageElement.cpp:
809 (WebCore::SVGFEImageElement::svgAttributeChanged): Ditto.
810 * svg/SVGFELightElement.cpp:
811 (WebCore::SVGFELightElement::svgAttributeChanged): Ditto.
812 * svg/SVGFEMergeNodeElement.cpp:
813 (WebCore::SVGFEMergeNodeElement::svgAttributeChanged): Ditto.
814 * svg/SVGFEMorphologyElement.cpp:
815 (WebCore::SVGFEMorphologyElement::svgAttributeChanged): Ditto.
816 * svg/SVGFEOffsetElement.cpp:
817 (WebCore::SVGFEOffsetElement::svgAttributeChanged): Ditto.
818 * svg/SVGFESpecularLightingElement.cpp:
819 (WebCore::SVGFESpecularLightingElement::svgAttributeChanged): Ditto.
820 * svg/SVGFETileElement.cpp:
821 (WebCore::SVGFETileElement::svgAttributeChanged): Ditto.
822 * svg/SVGFETurbulenceElement.cpp:
823 (WebCore::SVGFETurbulenceElement::svgAttributeChanged): Ditto.
824 * svg/SVGFilterElement.cpp:
825 (WebCore::SVGFilterElement::svgAttributeChanged): Ditto.
826 * svg/SVGFilterPrimitiveStandardAttributes.cpp:
827 (WebCore::SVGFilterPrimitiveStandardAttributes::svgAttributeChanged): Ditto.
828 * svg/SVGForeignObjectElement.cpp:
829 (WebCore::SVGForeignObjectElement::svgAttributeChanged): Ditto.
830 * svg/SVGGElement.cpp:
831 (WebCore::SVGGElement::svgAttributeChanged): Ditto.
832 * svg/SVGGradientElement.cpp:
833 (WebCore::SVGGradientElement::svgAttributeChanged): Ditto.
834 * svg/SVGGraphicsElement.cpp:
835 (WebCore::SVGGraphicsElement::svgAttributeChanged): Ditto.
836 * svg/SVGImageElement.cpp:
837 (WebCore::SVGImageElement::svgAttributeChanged): Ditto.
838 * svg/SVGLineElement.cpp:
839 (WebCore::SVGLineElement::svgAttributeChanged): Ditto.
840 * svg/SVGLinearGradientElement.cpp:
841 (WebCore::SVGLinearGradientElement::svgAttributeChanged): Ditto.
842 * svg/SVGMPathElement.cpp:
843 (WebCore::SVGMPathElement::svgAttributeChanged): Ditto.
844 * svg/SVGMarkerElement.cpp:
845 (WebCore::SVGMarkerElement::svgAttributeChanged): Ditto.
846 * svg/SVGMaskElement.cpp:
847 (WebCore::SVGMaskElement::svgAttributeChanged): Ditto.
848 * svg/SVGPathElement.cpp:
849 (WebCore::SVGPathElement::svgAttributeChanged): Ditto.
850 * svg/SVGPatternElement.cpp:
851 (WebCore::SVGPatternElement::svgAttributeChanged): Ditto.
852 * svg/SVGPolyElement.cpp:
853 (WebCore::SVGPolyElement::svgAttributeChanged): Ditto.
854 * svg/SVGRadialGradientElement.cpp:
855 (WebCore::SVGRadialGradientElement::svgAttributeChanged): Ditto.
856 * svg/SVGRectElement.cpp:
857 (WebCore::SVGRectElement::svgAttributeChanged): Ditto.
858 * svg/SVGSVGElement.cpp:
859 (WebCore::SVGSVGElement::svgAttributeChanged): Ditto.
860 * svg/SVGScriptElement.cpp:
861 (WebCore::SVGScriptElement::svgAttributeChanged): Ditto.
862 * svg/SVGStopElement.cpp:
863 (WebCore::SVGStopElement::svgAttributeChanged): Ditto.
864 * svg/SVGSymbolElement.cpp:
865 (WebCore::SVGSymbolElement::svgAttributeChanged): Ditto.
866 * svg/SVGTRefElement.cpp:
867 (WebCore::SVGTRefElement::svgAttributeChanged): Ditto.
868 * svg/SVGTextContentElement.cpp:
869 (WebCore::SVGTextContentElement::svgAttributeChanged): Ditto.
870 * svg/SVGTextPathElement.cpp:
871 (WebCore::SVGTextPathElement::svgAttributeChanged): Ditto.
872 * svg/SVGTextPositioningElement.cpp:
873 (WebCore::SVGTextPositioningElement::svgAttributeChanged): Ditto.
874 * svg/SVGUseElement.cpp:
875 (WebCore::SVGUseElement::svgAttributeChanged): Ditto.
876 * svg/animation/SVGSMILElement.cpp:
877 (WebCore::SVGSMILElement::svgAttributeChanged): Ditto.
879 2015-02-05 Brent Fulgham <bfulgham@apple.com>
881 Remind ourselves to remove work-around code
882 https://bugs.webkit.org/show_bug.cgi?id=141289
884 Unreviewed gardening: Add a reminder FIXME to CSSParser
885 so we can remove the MSVC-specific hack in the future.
889 2015-02-05 Zalan Bujtas <zalan@apple.com>
891 Do not destroy RenderQuote's text fragment child when quotation mark string is changing.
892 https://bugs.webkit.org/show_bug.cgi?id=141271
893 rdar://problem/18169375
895 Reviewed by Antti Koivisto.
897 Similar approach as https://codereview.chromium.org/679593004/
899 This patch ensures that laying out a RenderQuote does not force a sibling RenderQuote's
900 child renderer(RenderText) to be destroyed.
901 BreakingContext holds a pointer to the next renderer on the line (BreakingContext::m_nextObject).
902 While laying out the line, initiated by BreakingContext, placing the current renderer could end up destroying the "next" renderer.
903 This happens when the pseudo after quotation mark(RenderQuote) becomes floated, the sibling <q>'s pseudo
904 before text needs to be changed (from " to ') so that we don't end up with 2 sets of the same opening
906 The fix is to reuse the RenderTextFragment object instead of destroy/recreate it.
908 Test: fast/css/content/quote-crash-when-floating.html
910 * rendering/RenderQuote.cpp:
911 (WebCore::RenderQuote::RenderQuote):
912 (WebCore::fragmentChild):
913 (WebCore::RenderQuote::updateText):
914 * rendering/RenderQuote.h:
915 * rendering/RenderTextFragment.cpp:
916 (WebCore::RenderTextFragment::setText):
917 (WebCore::RenderTextFragment::setContentString):
918 * rendering/RenderTextFragment.h:
920 2015-02-04 Dean Jackson <dino@apple.com>
922 [Media iOS] Add a debug setting to always show the optimized fullscreen button
923 https://bugs.webkit.org/show_bug.cgi?id=141277
924 <rdar://problem/19724471>
926 Reviewed by Eric Carlson.
928 Add a debug option so that we can test the optimized fullscreen
929 control on media that doesn't support it.
931 * Modules/mediacontrols/mediaControlsiOS.js: Add gSimulateOptimizedFullscreenAvailable.
932 (ControllerIOS.prototype.createControls): Check the setting.
933 (ControllerIOS.prototype.configureInlineControls): Ditto.
934 (ControllerIOS.prototype.formatTime): Drive-by whitespace cleanup.
935 (ControllerIOS.prototype.handleBaseGestureChange):
936 (ControllerIOS.prototype.handleWrapperTouchStart):
937 (ControllerIOS.prototype.handleOptimizedFullscreenTouchEnd):
938 (ControllerIOS.prototype.handlePresentationModeChange): Drive-by variable renaming.
940 2015-02-05 Youenn Fablet <youenn.fablet@crf.canon.fr> and Xabier Rodriguez Calvar <calvaris@igalia.com>
942 [Streams API] Implement a barebone ReadableStream interface
943 https://bugs.webkit.org/show_bug.cgi?id=141045
945 Reviewed by Benjamin Poulain.
947 This patch implements the ReadableStream IDL (https://streams.spec.whatwg.org/#rs-model).
948 No functionality is yet added.
949 ReadableStreamSource is expected to be implemented for native sources (such as HTTP sources)
950 as well as JavaScript source through ReadableStreamJSSource.
952 Test: streams/readablestream-constructor.html
955 * Configurations/FeatureDefines.xcconfig:
956 * DerivedSources.cpp:
957 * DerivedSources.make:
958 * Modules/streams/ReadableStream.cpp: Added.
959 (WebCore::ReadableStream::create):
960 (WebCore::ReadableStream::ReadableStream):
961 (WebCore::ReadableStream::~ReadableStream):
962 (WebCore::ReadableStream::state):
963 (WebCore::ReadableStream::closed):
964 (WebCore::ReadableStream::ready):
965 * Modules/streams/ReadableStream.h: Added.
966 * Modules/streams/ReadableStream.idl: Added.
967 * Modules/streams/ReadableStreamSource.h: Added.
968 * WebCore.vcxproj/WebCore.vcxproj:
969 * WebCore.vcxproj/WebCore.vcxproj.filters:
970 * WebCore.vcxproj/WebCoreCommon.props:
971 * WebCore.xcodeproj/project.pbxproj:
972 * bindings/js/JSBindingsAllInOne.cpp:
973 * bindings/js/JSReadableStreamCustom.cpp: Added.
974 (WebCore::JSReadableStream::read):
975 (WebCore::JSReadableStream::ready):
976 (WebCore::JSReadableStream::closed):
977 (WebCore::JSReadableStream::cancel):
978 (WebCore::JSReadableStream::pipeTo):
979 (WebCore::JSReadableStream::pipeThrough):
980 (WebCore::constructJSReadableStream):
981 * bindings/js/ReadableStreamJSSource.cpp: Added.
982 (WebCore::ReadableStreamJSSource::create):
983 (WebCore::ReadableStreamJSSource::ReadableStreamJSSource):
984 (WebCore::ReadableStreamJSSource::setInternalError):
985 * bindings/JSReadableStreamJSSource.h: Added.
987 2015-02-04 Brent Fulgham <bfulgham@apple.com>
989 [Win] Unreviewed project file corrections.
991 Correct some parsing errors caused by recent manual editing of
994 * WebCore.vcxproj/WebCore.vcxproj:
995 * WebCore.vcxproj/WebCore.vcxproj.filters:
997 2015-02-04 Eric Carlson <eric.carlson@apple.com>
999 [iOS] add method to toggle playback when in the background
1000 https://bugs.webkit.org/show_bug.cgi?id=141270
1002 Reviewed by Dean Jackson.
1004 * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
1005 (-[WebAVPlayerController togglePlaybackEvenWhenInBackground:]): Added.
1007 2015-02-04 Jer Noble <jer.noble@apple.com>
1009 [Mac][EME] Support ClearKey encryption with AES128-encrypted HLS
1010 https://bugs.webkit.org/show_bug.cgi?id=140825
1012 Reviewed by Eric Carlson.
1014 Test: http/tests/media/clearkey/clear-key-hls-aes128.html
1016 Add support for ClearKey encryption when used with an AES-128 encrypted HLS stream.
1018 * Modules/encryptedmedia/CDM.cpp:
1019 (WebCore::installedCDMFactories): Add the CDMPrivateClearKey factory.
1020 * Modules/encryptedmedia/CDMPrivateClearKey.cpp:
1021 (WebCore::CDMPrivateClearKey::supportsKeySystem): Support the "org.w3c.clearkey" key system.
1022 (WebCore::CDMPrivateClearKey::supportsKeySystemAndMimeType): Ditto.
1023 (WebCore::CDMPrivateClearKey::supportsMIMEType): Ditto.
1024 (WebCore::CDMPrivateClearKey::createSession): Create a CDMSessionClearKey.
1025 * Modules/encryptedmedia/CDMPrivateClearKey.h:
1026 (WebCore::CDMPrivateClearKey::create): Simple factory.
1027 (WebCore::CDMPrivateClearKey::~CDMPrivateClearKey): Virtual destructor.
1028 (WebCore::CDMPrivateClearKey::CDMPrivateClearKey): Simple destructor.
1029 * Modules/encryptedmedia/CDMSessionClearKey.cpp: Added.
1030 (WebCore::clearKeyVM): Static method returning the VM to be used by JSON parsing.
1031 (WebCore::CDMSessionClearKey::CDMSessionClearKey): Simple constructor.
1032 (WebCore::CDMSessionClearKey::~CDMSessionClearKey): Simple destructor.
1033 (WebCore::CDMSessionClearKey::generateKeyRequest): Store the initData, ensure that it consists of a UTF8-encoded key
1034 URI, and return same.
1035 (WebCore::CDMSessionClearKey::releaseKeys): Purged all cached keys.
1036 (WebCore::CDMSessionClearKey::update): Parse raw JSON-encoded JWK keys, rejecting non-AES, non-oct keys.
1037 (WebCore::CDMSessionClearKey::cachedKeyForKeyID): Return cached keys.
1038 * Modules/encryptedmedia/CDMSessionClearKey.h:
1040 Add support for the "org.w3c.clearkey" CDM to MediaPlayerPrivateAVFoundationObjC, and do so in a platform-agnostic
1041 way by simply asking for raw key data from MediaPlayerClient when notified that a key has been added.
1043 * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
1044 * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1045 (WebCore::keySystemIsSupported):
1046 (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsType):
1047 (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsKeySystem):
1048 (WebCore::fulfillRequestWithKeyData): Added utility method.
1049 (WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource):
1050 (WebCore::MediaPlayerPrivateAVFoundationObjC::keyAdded):
1052 Pipe a keyAdded() notification down to MediaPlayer and a cachedKeyForKeyId() request up to CDMSessionClearKey:
1054 * Modules/encryptedmedia/MediaKeySession.cpp:
1055 (WebCore::MediaKeySession::cachedKeyForKeyId):
1056 (WebCore::MediaKeySession::addKeyTimerFired):
1057 * Modules/encryptedmedia/MediaKeySession.h:
1058 * Modules/encryptedmedia/MediaKeys.cpp:
1059 (WebCore::MediaKeys::keyAdded):
1060 (WebCore::MediaKeys::cachedKeyForKeyId):
1061 * Modules/encryptedmedia/MediaKeys.h:
1062 * html/HTMLMediaElement.cpp:
1063 (WebCore::HTMLMediaElement::keyAdded):
1064 * html/HTMLMediaElement.h:
1065 * platform/graphics/CDMSession.h:
1066 (WebCore::CDMSession::cachedKeyForKeyID):
1067 * platform/graphics/MediaPlayer.cpp:
1068 (WebCore::MediaPlayer::keyAdded):
1069 (WebCore::MediaPlayer::cachedKeyForKeyId):
1070 * platform/graphics/MediaPlayer.h:
1071 (WebCore::MediaPlayerClient::mediaPlayerCachedKeyForKeyId):
1072 * platform/graphics/MediaPlayerPrivate.h:
1073 (WebCore::MediaPlayerPrivateInterface::keyAdded):
1075 Add new files to project:
1077 * WebCore.xcodeproj/project.pbxproj:
1079 * WebCore.vcxproj/WebCore.vcxproj:
1080 * WebCore.vcxproj/WebCore.vcxproj.filters:
1082 2015-02-04 Commit Queue <commit-queue@webkit.org>
1084 Unreviewed, rolling out r179618.
1085 https://bugs.webkit.org/show_bug.cgi?id=141263
1087 Off-by-one error causing flaky behavior in webaudio
1088 /audiobuffersource-negative-playbackrate.html (Requested by
1089 jernoble_ on #webkit).
1093 "[WebAudio] AudioBufferSourceNodes should accurately play
1094 backwards if given a negative playbackRate."
1095 https://bugs.webkit.org/show_bug.cgi?id=140955
1096 http://trac.webkit.org/changeset/179618
1098 2015-02-03 David Hyatt <hyatt@apple.com>
1100 Tables don't repaginate properly when the pagination height changes or the pagination offset changes.
1101 https://bugs.webkit.org/show_bug.cgi?id=141207
1102 <rdar://problem/18387659>
1104 Reviewed by Dean Jackson.
1106 Added fast/multicol/table-dynamic-movement.html
1108 Change markForPaginationRelayoutIfNeeded to be called always and to check needsLayout inside it.
1110 Make RenderTable override markForPaginationRelayoutIfNeeded and also dirty the sections if the table
1111 ended up getting marked for relayout.
1113 Make sure rows do the right thing as well.
1115 * rendering/RenderBlock.cpp:
1116 (WebCore::RenderBlock::layoutPositionedObjects):
1117 (WebCore::RenderBlock::markForPaginationRelayoutIfNeeded):
1118 * rendering/RenderBlock.h:
1119 * rendering/RenderBlockFlow.cpp:
1120 (WebCore::RenderBlockFlow::layoutBlockChild):
1121 (WebCore::RenderBlockFlow::adjustBlockChildForPagination):
1122 (WebCore::RenderBlockFlow::positionNewFloats):
1123 * rendering/RenderDeprecatedFlexibleBox.cpp:
1124 (WebCore::RenderDeprecatedFlexibleBox::layoutHorizontalBox):
1125 (WebCore::RenderDeprecatedFlexibleBox::layoutVerticalBox):
1126 * rendering/RenderTable.cpp:
1127 (WebCore::RenderTable::markForPaginationRelayoutIfNeeded):
1128 * rendering/RenderTable.h:
1129 * rendering/RenderTableRow.cpp:
1130 (WebCore::RenderTableRow::layout):
1131 * rendering/RenderTableSection.cpp:
1132 (WebCore::RenderTableSection::layout):
1134 2015-02-04 Said Abou-Hallawa <sabouhallawa@apple.com>
1136 When using SVG as an image, we should load datauri images when these images are not in the image cache.
1137 https://bugs.webkit.org/show_bug.cgi?id=99677.
1139 Reviewed by Darin Adler.
1141 Data URI sub-resources are not loaded because the networking context of FrameLoader
1142 attached to the SubResourceLoader is set to null. This is done intentionally to
1143 disallow any resource from loading external sub-resources. For example if an <img>
1144 tag has its 'src' attribute points to an svg file, this svg is not allowed to load
1145 an external image through the 'xlink' attribute of an <image> element. This restriction
1146 is not valid if the value of the 'xlink' attribute is a data URI. In this case the image
1147 should be loaded into memory since there is no network traffic involved. All we need
1148 to do is to decode the data part of the URI.
1150 The fix is to pass the root FrameLoader, which has a valid NetworkingContext, through
1151 the FrameLoaderClient, to the ResourceHandle::create() which uses the NetworkingContext
1152 to decode the data and fire the load events of the data URI resources.
1154 Tests: svg/as-image/svg-image-with-data-uri-background.html
1155 svg/as-image/svg-image-with-data-uri-from-canvas.html
1156 svg/as-image/svg-image-with-data-uri-images-disabled.html
1157 svg/as-image/svg-image-with-data-uri-reloading.html
1158 svg/as-image/svg-image-with-data-uri-use-data-uri.svg
1159 svg/as-image/svg-image-with-svg-data-uri.html
1161 * accessibility/AccessibilityRenderObject.cpp:
1162 Remove unreferenced header file.
1164 * loader/FrameLoaderClient.h:
1165 Define the null virtual function dataProtocolLoader() which should return the FrameLoader
1166 for loading data URI resources.
1168 * loader/ResourceLoader.cpp:
1169 (WebCore::ResourceLoader::start):
1170 (WebCore::ResourceLoader::dataProtocolFrameLoader):
1171 * loader/ResourceLoader.h:
1172 Add ResourceLoader::dataProtocolFrameLoader() which returns the root FrameLoader. The
1173 root FrameLoader is used to get a valid NetworkingContext which can be passed to
1174 ResourceHandle::create() when url().protocolIsData().
1176 * loader/cache/CachedImage.cpp:
1177 (WebCore::CachedImage::load):
1178 (WebCore::CachedImage::finishLoading):
1179 * loader/cache/CachedResourceLoader.cpp:
1180 (WebCore::CachedResourceLoader::shouldPerformImageLoad):
1181 (WebCore::CachedResourceLoader::shouldDeferImageLoad):
1182 * loader/cache/CachedResourceLoader.h:
1183 Allow loading data URI sub-resources as long as loading images is not disabled. Also we
1184 need to call setDataProtocolLoader() before calling setData() for the isSVGImage case,
1185 setData() will create a page by calling Page::createPageFromBuffer() via SVGImage::dataChanged(),
1186 and we need to pass the correct FrameLoaderClient to the created FrameLoader of the main
1189 * svg/graphics/SVGImage.cpp:
1190 (WebCore::SVGImage::SVGImage):
1191 (WebCore::SVGImage::dataChanged):
1192 * svg/graphics/SVGImage.h:
1193 Create a new FrameLoaderClient of type SVGFrameLoaderClient and set it in pageConfiguration
1194 which is used when creating the page from the SVG data URI.
1196 * WebCore.xcodeproj/project.pbxproj:
1197 * svg/graphics/SVGImageChromeClient.h: Removed.
1198 * svg/graphics/SVGImageClients.h: Added.
1199 Add a new class SVGImageChromeClient which overrides the function dataProtocolLoader().
1200 Rename the header file SVGImageChromeClient.h to be SVGImageClients.h since it now
1201 includes the classes SVGImageChromeClient and SVGFrameLoaderClient.
1203 2015-02-04 Timothy Horton <timothy_horton@apple.com>
1205 Fix a misplaced include in CaptionUserPreferencesMediaAF
1206 https://bugs.webkit.org/show_bug.cgi?id=141239
1208 Reviewed by Jer Noble.
1210 * page/CaptionUserPreferencesMediaAF.cpp:
1211 CoreText is a system header, and there's already a good spot for it!
1213 2015-02-04 Jer Noble <jer.noble@apple.com>
1215 [WebAudio] AudioBufferSourceNodes should accurately play backwards if given a negative playbackRate.
1216 https://bugs.webkit.org/show_bug.cgi?id=140955
1218 Reviewed by Eric Carlson.
1220 Tests: webaudio/audiobuffersource-negative-playbackrate-interpolated.html
1221 webaudio/audiobuffersource-negative-playbackrate.html
1223 Add support for playing an AudioBufferSourceNode at a negative playbackRate. Change the meaning of
1224 start() to set the initial playback position at the end of the play range if the rate of playback
1227 * Modules/webaudio/AudioBufferSourceNode.cpp:
1228 (WebCore::AudioBufferSourceNode::AudioBufferSourceNode): Allow the playbackRate AudioParam to range from [-32, 32].
1229 (WebCore::AudioBufferSourceNode::renderFromBuffer): Change variable names from "start" and "end" to "min" and "max"
1230 for clarity. Add a non-interpolated and interpolated render step for negative playback.
1231 (WebCore::AudioBufferSourceNode::start): Drive-by fix: default value of grainDuration is not 0.02.
1232 (WebCore::AudioBufferSourceNode::startPlaying): Start playing at the end of the buffer for negative playback.
1233 (WebCore::AudioBufferSourceNode::totalPitchRate): Allow the pitch to be negative.
1235 2015-02-04 Eric Carlson <eric.carlson@apple.com>
1237 video.attribute should not return true just because of fullscreen
1238 https://bugs.webkit.org/show_bug.cgi?id=141219
1240 Reviewed by Dean Jackson.
1242 No new tests, updated media/video-fullscreeen-only-controls.html
1244 * Modules/mediacontrols/mediaControlsApple.js:
1245 (Controller.prototype.shouldHaveControls):
1246 * Modules/mediacontrols/mediaControlsiOS.js:
1247 (ControllerIOS.prototype.isFullScreen):
1249 * html/HTMLMediaElement.cpp:
1250 (WebCore::HTMLMediaElement::controls): Don't consider fullscreen status.
1251 (WebCore::HTMLMediaElement::configureMediaControls): Create controls if a video element
1252 isn't allowed to play inline, or if it is in fullscreen.
1254 2015-02-04 Mark Lam <mark.lam@apple.com>
1256 Remove concept of makeUsableFromMultipleThreads().
1257 <https://webkit.org/b/141221>
1259 Reviewed by Mark Hahnenberg.
1263 * bindings/js/JSDOMWindowBase.cpp:
1264 (WebCore::JSDOMWindowBase::commonVM):
1266 2015-02-04 Simon Fraser <simon.fraser@apple.com>
1268 [iOS WK2] Assert in ScrollingTreeOverflowScrollingNodeIOS::updateAfterChildren() on tab switching
1269 https://bugs.webkit.org/show_bug.cgi?id=141223
1270 rdar://problem/18458993
1272 Reviewed by Tim Horton.
1274 It's possible to submit a RemoteLayerTree transaction that contains data
1275 about a created layer, but doesn't have any properties for that layer. This
1276 happens when the newly created layer isn't reached during the traversal that
1277 gathers layer properties (i.e. it's not rooted). However, whether we create
1278 a scrolling layer or not requires having properties; they are missing, so we
1279 create a normal layer, but then the scrolling tree commit asserts that we
1280 should have a scrolling layer.
1282 Fix by making scrolling layers have a corresponding layer type, which is
1283 stored in layer creation properties. This required exposing layer types
1284 up through GraphicsLayer, but that allows for some nice cleanup:
1286 1. No need to have the hokey shouldUseTiledBacking() GraphicsLayerClient hack
1287 for creating the page tiled layer.
1288 2. The notion of "custom behaviors" can be removed from GraphicsLayer entirely.
1290 Not testable because it requires tab switching.
1293 * platform/graphics/GraphicsLayer.cpp:
1294 (WebCore::GraphicsLayer::GraphicsLayer):
1295 * platform/graphics/GraphicsLayer.h:
1296 (WebCore::GraphicsLayer::initialize):
1297 (WebCore::GraphicsLayer::setCustomBehavior): Deleted.
1298 (WebCore::GraphicsLayer::customBehavior): Deleted.
1299 * platform/graphics/GraphicsLayerClient.h:
1300 (WebCore::GraphicsLayerClient::shouldUseTiledBacking): Deleted.
1301 * platform/graphics/GraphicsLayerFactory.h:
1302 * platform/graphics/ca/GraphicsLayerCA.cpp:
1303 (WebCore::GraphicsLayer::create):
1304 (WebCore::GraphicsLayerCA::GraphicsLayerCA):
1305 (WebCore::GraphicsLayerCA::initialize):
1306 (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
1307 (WebCore::GraphicsLayerCA::ensureStructuralLayer):
1308 (WebCore::GraphicsLayerCA::swapFromOrToTiledLayer):
1309 (WebCore::GraphicsLayerCA::updateCustomBehavior): Deleted.
1310 (WebCore::GraphicsLayerCA::setCustomBehavior): Deleted.
1311 * platform/graphics/ca/GraphicsLayerCA.h:
1312 (WebCore::GraphicsLayerCA::moveAnimations):
1313 (WebCore::GraphicsLayerCA::copyAnimations):
1314 * platform/graphics/ca/PlatformCALayer.h:
1315 * platform/graphics/ca/mac/PlatformCALayerMac.h:
1316 * platform/graphics/ca/mac/PlatformCALayerMac.mm:
1317 (PlatformCALayerMac::PlatformCALayerMac):
1318 (PlatformCALayerMac::commonInit):
1319 (PlatformCALayerMac::updateCustomBehavior): Deleted.
1320 * rendering/RenderLayerBacking.cpp:
1321 (WebCore::RenderLayerBacking::createGraphicsLayer):
1322 (WebCore::RenderLayerBacking::createPrimaryGraphicsLayer):
1323 (WebCore::RenderLayerBacking::updateScrollingLayers):
1324 (WebCore::RenderLayerBacking::shouldUseTiledBacking): Deleted.
1325 * rendering/RenderLayerBacking.h:
1327 2015-02-04 Dean Jackson <dino@apple.com>
1329 [Media] Fullscreen button should always come last in inline controls (141245)
1330 https://bugs.webkit.org/show_bug.cgi?id=141245
1331 <rdar://problem/19714622>
1333 Reviewed by Eric Carlson.
1335 Make sure the optimizedFullscreen button is inserted before the
1336 normal fullscreen button.
1338 * Modules/mediacontrols/mediaControlsiOS.js:
1339 (ControllerIOS.prototype.configureInlineControls):
1341 2015-02-04 Dean Jackson <dino@apple.com>
1343 REGRESSION: AirPlay button not visible but present in inline toolbar
1344 https://bugs.webkit.org/show_bug.cgi?id=141244
1345 <rdar://problem/19328322>
1347 Reviewed by Eric Carlson.
1349 Replace the use of mask-image with a background-image (which matches
1350 what the other buttons are doing).
1352 * Modules/mediacontrols/mediaControlsiOS.css:
1353 (::-webkit-media-controls):
1354 (video::-webkit-media-controls-wireless-playback-picker-button):
1355 (audio::-webkit-media-controls-wireless-playback-picker-button):
1356 (video::-webkit-media-controls-wireless-playback-picker-button.active):
1357 (audio::-webkit-media-controls-wireless-playback-picker-button.active):
1359 2015-02-04 Chris Dumez <cdumez@apple.com>
1361 Add removeFirst(value) / removeAll(value) methods to WTF::Vector
1362 https://bugs.webkit.org/show_bug.cgi?id=141192
1364 Reviewed by Benjamin Poulain.
1366 Use new Vector::removeFirst(value) / removeAll(value) API to simplify the
1369 * css/StyleSheetContents.cpp:
1370 (WebCore::StyleSheetContents::unregisterClient):
1371 * html/HTMLFormElement.cpp:
1372 (WebCore::HTMLFormElement::removeFormElement):
1373 (WebCore::HTMLFormElement::removeImgElement):
1374 (WebCore::removeFromVector): Deleted.
1376 (WebCore::Chrome::unregisterPopupOpeningObserver):
1377 * page/PageOverlayController.cpp:
1378 (WebCore::PageOverlayController::uninstallPageOverlay):
1379 * page/SecurityPolicy.cpp:
1380 (WebCore::SecurityPolicy::removeOriginAccessWhitelistEntry):
1381 * platform/graphics/GraphicsLayer.cpp:
1382 (WebCore::GraphicsLayer::removeFromParent):
1383 * platform/graphics/texmap/TextureMapperAnimation.cpp:
1384 (WebCore::TextureMapperAnimations::remove):
1385 * rendering/RenderSearchField.cpp:
1386 (WebCore::RenderSearchField::addSearchResult):
1387 * rendering/RenderTable.cpp:
1388 (WebCore::RenderTable::removeCaption):
1389 * rendering/svg/RenderSVGText.cpp:
1390 (WebCore::RenderSVGText::subtreeChildWillBeRemoved):
1391 * svg/SVGDocumentExtensions.cpp:
1392 (WebCore::SVGDocumentExtensions::removeAllElementReferencesForTarget):
1393 * svg/animation/SMILTimeContainer.cpp:
1394 (WebCore::SMILTimeContainer::unschedule):
1396 2015-02-03 Maciej Stachowiak <mjs@apple.com>
1398 Crash when printing snapshotted plugins
1399 https://bugs.webkit.org/show_bug.cgi?id=141212
1401 Reviewed by Simon Fraser.
1403 Test: plugins/snapshotting/print-snapshotted-plugin.html
1405 * html/HTMLPlugInImageElement.cpp:
1406 (WebCore::HTMLPlugInImageElement::childShouldCreateRenderer): New
1407 method. If the current renderer is a snapshotted plugin, only
1408 allow children to create renderers if they are part of the
1409 snapshot shadow dom. Otherwise RenderEmbeddedObject invariants
1410 will be violated. This DOM class can have many other renderers, but they
1411 can just follow their own rules.
1412 (WebCore::HTMLPlugInImageElement::partOfSnapshotOverlay): Make this
1413 const-correct, and don't create UA shadow DOM as a side effect if it doesn't
1415 * html/HTMLPlugInImageElement.h:
1417 2015-02-03 Chris Dumez <cdumez@apple.com>
1419 Regression(r179584): Assertion hit in toResourceLoadPriority() on Yosemite
1420 https://bugs.webkit.org/show_bug.cgi?id=141230
1422 Reviewed by Alexey Proskuryakov.
1424 Handle -1 priority value again in toResourceLoadPriority() as it seems to
1425 be returned by CFNetwork on some configurations.
1427 No new tests, already covered by existing tests.
1429 * platform/network/cf/ResourceRequestCFNet.h:
1430 (WebCore::toResourceLoadPriority):
1432 2015-02-03 Chris Dumez <cdumez@apple.com>
1434 Drop ResourceLoadPriorityUnresolved resource load priority and use Optional<> instead
1435 https://bugs.webkit.org/show_bug.cgi?id=141186
1437 Reviewed by Antti Koivisto.
1439 Drop ResourceLoadPriorityUnresolved resource load priority value and use
1440 Optional<ResourceLoadPriority> when needed instead. If the Optional
1441 doesn't have a value, then it means it is unresolved. Having
1442 ResourceLoadPriorityUnresolved in ResourceLoadPriority was confusing
1443 because this value is only valid in CachedResourceRequest, it is not
1444 a valid value in CachedResource or in ResourceRequest. After this
1445 refactoring, it now becomes more obvious.
1447 2015-02-03 Chris Dumez <cdumez@apple.com>
1449 REGRESSION(176609): Very high memory usage in Canvas/reuse.html performance test
1450 https://bugs.webkit.org/show_bug.cgi?id=139812
1452 Reviewed by Geoffrey Garen.
1454 Update DOMTimerFireState.elementsChangedOutsideViewport to keep only
1455 weak pointers to the Elements, instead of ref'ing them, so as to not
1456 extend their life unnecessarily (by preventing garbage-collection).
1457 The same approach was already adopted in r176496 for
1458 DOMTimer.m_elementsCausingThrottling to address the same issue.
1460 No new tests, already covered by Canvas/reuse.html performance test.
1462 * page/DOMTimer.cpp:
1463 (WebCore::DOMTimerFireState::setScriptMadeNonUserObservableChangesToElement):
1464 (WebCore::DOMTimerFireState::elementsChangedOutsideViewport):
1466 2015-02-03 Jer Noble <jer.noble@apple.com>
1468 [MSE] Setting timestampOffset does not change the timestamps in the actual sample, leading to visual and audible errors.
1469 https://bugs.webkit.org/show_bug.cgi?id=140929
1471 Reviewed by Alexey Proskuryakov.
1473 Fixes http/tests/media/media-source/mediasource-config-change-mp4-v-framerate.html.
1475 Only apply the timestamp offset to the actual sample after step 1.6, where we may loop back to
1476 the top, to avoid double-offsetting the same sample.
1478 * Modules/mediasource/SourceBuffer.cpp:
1479 (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
1481 2015-02-03 Jeremy Jones <jeremyj@apple.com>
1483 Restore interface before exiting optimized fullscreen mode.
1484 https://bugs.webkit.org/show_bug.cgi?id=141167
1486 Reviewed by Simon Fraser.
1488 This change allows the user interface to be restored before exiting optimized fullscreen mode.
1490 * platform/ios/WebVideoFullscreenInterfaceAVKit.h: Add declaration.
1491 * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
1492 (-[WebAVPlayerController playerViewController:restoreUserInterfaceForOptimizedFullscreenStopWithCompletionHandler:]): Added.
1493 (WebVideoFullscreenInterfaceAVKit::fullscreenMayReturnToInline): Added.
1494 * platform/spi/ios/AVKitSPI.h: Add new SPI.
1496 2015-02-03 Jeremy Jones <jeremyj@apple.com>
1498 Prevent flicker when exiting fullscreen by synchronizing transactions.
1499 https://bugs.webkit.org/show_bug.cgi?id=140897
1501 Reviewed by Tim Horton.
1503 Synchronize across CAContexts when moving the video layer between layer hierarchies.
1504 Normally transactions involving multiple CAContexts are not synchronized.
1506 * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1507 (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenLayer):
1508 * platform/spi/cocoa/QuartzCoreSPI.h: add additional CAContext SPI declarations.
1510 2015-02-03 Ryosuke Niwa <rniwa@webkit.org>
1512 Smart quoting could move the caret backwards in some configurations
1513 https://bugs.webkit.org/show_bug.cgi?id=141203
1514 <rdar://problem/17452543>
1516 Reviewed by Enrica Casucci.
1518 The bug was caused by markAndReplaceFor not running the code to preserve the selection after
1519 text replacement only when smart quote is enabled. Furthermore, when smart link was disabled,
1520 we never applied smart quote due to the following condition at line 2502:
1522 if (!(shouldPerformReplacement || shouldCheckForCorrection || shouldMarkLink) || !doReplacement)
1525 This condition prevented the code to apply smart quote from running when both continuous
1526 spellchecking, smart link, and text replacement are disabled.
1528 Fixed the bug by treating smart quotes and smart dashes like any other text replacement and set
1529 shouldPerformReplacement to true whenever either one of those text checking options are present.
1531 Smart link didn't have this issue due to the explicit check for shouldMarkLink.
1533 Smart dashes didn't suffer this problem either because dashes replacement happens only once
1534 the caret has moved past the dashes but his patch makes go through the same code path to preserve
1535 the selection as well for consistency.
1537 Test: editing/inserting/smart-quote-with-all-configurations.html
1539 * editing/Editor.cpp:
1540 (WebCore::Editor::markAndReplaceFor):
1542 2015-02-02 Enrica Casucci <enrica@apple.com>
1544 Additional emoji support.
1545 https://bugs.webkit.org/show_bug.cgi?id=141047
1546 rdar://problem/19045135
1548 Reviewed by Darin Adler.
1550 Adds support for emoji modifiers and group emoji.
1552 Test: editing/deleting/delete-emoji.html
1554 * platform/graphics/FontCascade.cpp:
1555 (WebCore::FontCascade::characterRangeCodePath):
1556 * platform/text/TextBreakIterator.cpp:
1557 (WebCore::cursorMovementIterator):
1558 * rendering/RenderText.cpp:
1559 (WebCore::isEmojiGroupCandidate):
1560 (WebCore::isEmojiModifier):
1561 (WebCore::RenderText::previousOffsetForBackwardDeletion):
1563 2015-02-03 Jer Noble <jer.noble@apple.com>
1565 Passing invalid values to OfflineAudioContext's constructor should not crash.
1566 https://bugs.webkit.org/show_bug.cgi?id=141197
1568 Reviewed by Darin Adler.
1570 Test: webaudio/offlineaudiocontext-constructor.html
1572 Throw a SYNTAX_ERR exception if passed in a zero for channelCount or numberOfSamples. This avoids
1573 a crash where OfflineAudioDestinationNode is passed a null renderTarget.
1575 * Modules/webaudio/OfflineAudioContext.cpp:
1576 (WebCore::OfflineAudioContext::create):
1578 2015-02-03 Jer Noble <jer.noble@apple.com>
1580 [MSE] Setting timestampOffset does not change the timestamps in the actual sample, leading to visual and audible errors.
1581 https://bugs.webkit.org/show_bug.cgi?id=140929
1583 Reviewed by Darin Adler.
1585 Test: media/media-source/media-source-timeoffset.html
1587 Changing timestampOffset will correctly offset the presentation and decode times within SourceBuffer and
1588 will correctly modify things like buffered ranges. But those changes need to be reflected in the underlying
1589 MediaSample for decoders to decode and display the samples at the correct times.
1591 Add a method to MediaSample which allows the caller to offset timestamps of the underlying PlatformMediaSample.
1593 * Modules/mediasource/SourceBuffer.cpp:
1594 (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample): Call offsetTimestampsBy() on the sample.
1595 * platform/MediaSample.h:
1596 * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1597 (WebCore::MediaSampleAVFObjC::offsetTimestampsBy): Create a new sample with the same underlying data
1598 but with a new timing info array, each timing info offset by the requested amount.
1599 * platform/mock/mediasource/MockBox.h:
1600 (WebCore::MockBox::offsetTimestampsBy): Offset m_presentationTimestamp and m_decodeTimestamp;
1601 * platform/mock/mediasource/MockSourceBufferPrivate.cpp:
1602 (WebCore::MockMediaSample::offsetTimestampsBy): Pass to MockBox.
1604 2015-02-03 Jer Noble <jer.noble@apple.com>
1606 [Mac][EME] Crash in CDMSessionMediaSourceAVFObjC::layerDidReceiveError() - NSError not KVO compliant for key NSUnderlyingError.
1607 https://bugs.webkit.org/show_bug.cgi?id=140529
1609 Reviewed by Darin Adler.
1611 The underlying error should be fetched from the userInfo dictionary, not the error itself.
1613 * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm:
1614 (WebCore::systemCodeForError):
1616 2015-02-03 Commit Queue <commit-queue@webkit.org>
1618 Unreviewed, rolling out r179548.
1619 https://bugs.webkit.org/show_bug.cgi?id=141201
1621 Hits debug assertions in 50+ SVG tests (Requested by brrian on
1626 "Move InstanceInvalidationGuard/UpdateBlocker to SVGElement
1627 from SVGElementInstance"
1628 https://bugs.webkit.org/show_bug.cgi?id=141148
1629 http://trac.webkit.org/changeset/179548
1631 2015-02-03 Jer Noble <jer.noble@apple.com>
1633 [Mac] HLS audio is not correctly selected according to system language
1634 https://bugs.webkit.org/show_bug.cgi?id=140398
1635 rdar://problem/19218487
1637 Reviewed by Darin Adler.
1639 Test: http/tests/media/hls/hls-audio-tracks-locale-selection.html
1641 When AVMediaSelectionOptions come and go and no explicit track selection choice has
1642 been made, automatically pick the most appropriate track according to the user's
1643 current preferred locale settings.
1645 * platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.h:
1646 * platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm:
1647 (WebCore::MediaSelectionGroupAVFObjC::MediaSelectionGroupAVFObjC): Set m_shouldSelectOptionAutomatically
1649 (WebCore::MediaSelectionGroupAVFObjC::updateOptions): If m_shouldSelectOptionAutomatically is set
1650 pick the most appropriate media selection option.
1651 (WebCore::MediaSelectionGroupAVFObjC::setSelectedOption): Set m_shouldSelectOptionAutomatically to false.
1652 * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1653 (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerItem): Remove these automatic selection
1654 requests as they are ineffective when -appliesMediaSelectionCriteriaAutomatically is NO.
1656 2015-02-03 Darin Adler <darin@apple.com>
1658 Move InstanceInvalidationGuard/UpdateBlocker to SVGElement from SVGElementInstance
1659 https://bugs.webkit.org/show_bug.cgi?id=141148
1661 Reviewed by Brent Fulgham.
1663 Inspired by this change Rob Buis made in Blink:
1665 http://src.chromium.org/viewvc/blink?view=revision&revision=173343
1667 I actually wrote the whole thing and then discovered we did it almost identically.
1669 * svg/SVGAnimatedTypeAnimator.cpp:
1670 (WebCore::SVGElementAnimatedPropertyList::setInstanceUpdatesBlocked): Added this
1671 helper function to get around a circular header dependency.
1672 * svg/SVGAnimatedTypeAnimator.h:
1673 (WebCore::SVGAnimatedTypeAnimator::executeAction): Use setInstanceUpdatesBlocked.
1675 * svg/SVGElement.cpp:
1676 (WebCore::SVGElement::removedFrom): Use invalidateInstances.
1677 (WebCore::SVGElement::finishParsingChildren): Ditto.
1678 (WebCore::SVGElement::svgAttributeChanged): Ditto.
1679 (WebCore::SVGElement::childrenChanged): Ditto.
1680 (WebCore::SVGElement::setInstanceUpdatesBlocked): Added an assertion that will
1681 catch anyone who nests InstanceUpdateBlocker by accident.
1682 (WebCore::SVGElement::invalidateInstances): Moved this here from
1683 SVGElementInstance::invalidateAllInstancesOfElement. I had already modified this
1684 so it had nothing to do with SVGElementInstance, so it was a simple matter of
1685 converting this into a member function. Added a FIXME about the mysterious
1686 updateStyleIfNeeded that makes multiple tests fail if it's removed.
1688 * svg/SVGElement.h: Added public InstanceUpdateBlocker class, protected
1689 InstanceInvalidationGuard class, and private invalidateInstances function.
1690 Unlike the ones in SVGElementInstance these use references so they are then
1691 not copyable without using the WTF_MAKE_NONCOPYABLE macro.
1693 * svg/SVGElementInstance.cpp:
1694 (WebCore::SVGElementInstance::invalidateAllInstancesOfElement): Deleted.
1695 (WebCore::SVGElementInstance::InstanceUpdateBlocker::InstanceUpdateBlocker): Deleted.
1696 (WebCore::SVGElementInstance::InstanceUpdateBlocker::~InstanceUpdateBlocker): Deleted.
1697 * svg/SVGElementInstance.h: Removed InvalidationGuard, InstanceUpdateBlocker, and
1698 invalidateAllInstancesOfElement. Didn't do any further cleanup since we soon will
1699 delete this entire file.
1701 * svg/SVGAElement.cpp:
1702 (WebCore::SVGAElement::svgAttributeChanged): Updated to use new name and reference
1704 * svg/SVGAnimateElementBase.cpp:
1705 (WebCore::applyCSSPropertyToTargetAndInstances): Ditto.
1706 (WebCore::removeCSSPropertyFromTargetAndInstances): Ditto.
1707 (WebCore::notifyTargetAndInstancesAboutAnimValChange): Ditto.
1708 * svg/SVGAnimatedPath.cpp:
1709 (WebCore::SVGAnimatedPathAnimator::startAnimValAnimation): Ditto.
1710 * svg/SVGCircleElement.cpp:
1711 (WebCore::SVGCircleElement::svgAttributeChanged): Ditto.
1712 * svg/SVGClipPathElement.cpp:
1713 (WebCore::SVGClipPathElement::svgAttributeChanged): Ditto.
1714 * svg/SVGComponentTransferFunctionElement.cpp:
1715 (WebCore::SVGComponentTransferFunctionElement::svgAttributeChanged): Ditto.
1716 * svg/SVGCursorElement.cpp:
1717 (WebCore::SVGCursorElement::svgAttributeChanged): Ditto.
1718 * svg/SVGEllipseElement.cpp:
1719 (WebCore::SVGEllipseElement::svgAttributeChanged): Ditto.
1720 * svg/SVGFEBlendElement.cpp:
1721 (WebCore::SVGFEBlendElement::svgAttributeChanged): Ditto.
1722 * svg/SVGFEColorMatrixElement.cpp:
1723 (WebCore::SVGFEColorMatrixElement::svgAttributeChanged): Ditto.
1724 * svg/SVGFECompositeElement.cpp:
1725 (WebCore::SVGFECompositeElement::svgAttributeChanged): Ditto.
1726 * svg/SVGFEConvolveMatrixElement.cpp:
1727 (WebCore::SVGFEConvolveMatrixElement::svgAttributeChanged): Ditto.
1728 * svg/SVGFEDiffuseLightingElement.cpp:
1729 (WebCore::SVGFEDiffuseLightingElement::svgAttributeChanged): Ditto.
1730 * svg/SVGFEDisplacementMapElement.cpp:
1731 (WebCore::SVGFEDisplacementMapElement::svgAttributeChanged): Ditto.
1732 * svg/SVGFEDropShadowElement.cpp:
1733 (WebCore::SVGFEDropShadowElement::svgAttributeChanged): Ditto.
1734 * svg/SVGFEGaussianBlurElement.cpp:
1735 (WebCore::SVGFEGaussianBlurElement::svgAttributeChanged): Ditto.
1736 * svg/SVGFEImageElement.cpp:
1737 (WebCore::SVGFEImageElement::svgAttributeChanged): Ditto.
1738 * svg/SVGFELightElement.cpp:
1739 (WebCore::SVGFELightElement::svgAttributeChanged): Ditto.
1740 * svg/SVGFEMergeNodeElement.cpp:
1741 (WebCore::SVGFEMergeNodeElement::svgAttributeChanged): Ditto.
1742 * svg/SVGFEMorphologyElement.cpp:
1743 (WebCore::SVGFEMorphologyElement::svgAttributeChanged): Ditto.
1744 * svg/SVGFEOffsetElement.cpp:
1745 (WebCore::SVGFEOffsetElement::svgAttributeChanged): Ditto.
1746 * svg/SVGFESpecularLightingElement.cpp:
1747 (WebCore::SVGFESpecularLightingElement::svgAttributeChanged): Ditto.
1748 * svg/SVGFETileElement.cpp:
1749 (WebCore::SVGFETileElement::svgAttributeChanged): Ditto.
1750 * svg/SVGFETurbulenceElement.cpp:
1751 (WebCore::SVGFETurbulenceElement::svgAttributeChanged): Ditto.
1752 * svg/SVGFilterElement.cpp:
1753 (WebCore::SVGFilterElement::svgAttributeChanged): Ditto.
1754 * svg/SVGFilterPrimitiveStandardAttributes.cpp:
1755 (WebCore::SVGFilterPrimitiveStandardAttributes::svgAttributeChanged): Ditto.
1756 * svg/SVGForeignObjectElement.cpp:
1757 (WebCore::SVGForeignObjectElement::svgAttributeChanged): Ditto.
1758 * svg/SVGGElement.cpp:
1759 (WebCore::SVGGElement::svgAttributeChanged): Ditto.
1760 * svg/SVGGradientElement.cpp:
1761 (WebCore::SVGGradientElement::svgAttributeChanged): Ditto.
1762 * svg/SVGGraphicsElement.cpp:
1763 (WebCore::SVGGraphicsElement::svgAttributeChanged): Ditto.
1764 * svg/SVGImageElement.cpp:
1765 (WebCore::SVGImageElement::svgAttributeChanged): Ditto.
1766 * svg/SVGLineElement.cpp:
1767 (WebCore::SVGLineElement::svgAttributeChanged): Ditto.
1768 * svg/SVGLinearGradientElement.cpp:
1769 (WebCore::SVGLinearGradientElement::svgAttributeChanged): Ditto.
1770 * svg/SVGMPathElement.cpp:
1771 (WebCore::SVGMPathElement::svgAttributeChanged): Ditto.
1772 * svg/SVGMarkerElement.cpp:
1773 (WebCore::SVGMarkerElement::svgAttributeChanged): Ditto.
1774 * svg/SVGMaskElement.cpp:
1775 (WebCore::SVGMaskElement::svgAttributeChanged): Ditto.
1776 * svg/SVGPathElement.cpp:
1777 (WebCore::SVGPathElement::svgAttributeChanged): Ditto.
1778 * svg/SVGPatternElement.cpp:
1779 (WebCore::SVGPatternElement::svgAttributeChanged): Ditto.
1780 * svg/SVGPolyElement.cpp:
1781 (WebCore::SVGPolyElement::svgAttributeChanged): Ditto.
1782 * svg/SVGRadialGradientElement.cpp:
1783 (WebCore::SVGRadialGradientElement::svgAttributeChanged): Ditto.
1784 * svg/SVGRectElement.cpp:
1785 (WebCore::SVGRectElement::svgAttributeChanged): Ditto.
1786 * svg/SVGSVGElement.cpp:
1787 (WebCore::SVGSVGElement::svgAttributeChanged): Ditto.
1788 * svg/SVGScriptElement.cpp:
1789 (WebCore::SVGScriptElement::svgAttributeChanged): Ditto.
1790 * svg/SVGStopElement.cpp:
1791 (WebCore::SVGStopElement::svgAttributeChanged): Ditto.
1792 * svg/SVGSymbolElement.cpp:
1793 (WebCore::SVGSymbolElement::svgAttributeChanged): Ditto.
1794 * svg/SVGTRefElement.cpp:
1795 (WebCore::SVGTRefElement::svgAttributeChanged): Ditto.
1796 * svg/SVGTextContentElement.cpp:
1797 (WebCore::SVGTextContentElement::svgAttributeChanged): Ditto.
1798 * svg/SVGTextPathElement.cpp:
1799 (WebCore::SVGTextPathElement::svgAttributeChanged): Ditto.
1800 * svg/SVGTextPositioningElement.cpp:
1801 (WebCore::SVGTextPositioningElement::svgAttributeChanged): Ditto.
1802 * svg/SVGUseElement.cpp:
1803 (WebCore::SVGUseElement::svgAttributeChanged): Ditto.
1804 * svg/animation/SVGSMILElement.cpp:
1805 (WebCore::SVGSMILElement::svgAttributeChanged): Ditto.
1807 2015-02-02 Darin Adler <darin@apple.com>
1809 REGRESSION (r170576): Storage leaks in parsing of CSS image sizes
1810 https://bugs.webkit.org/show_bug.cgi?id=141026
1812 Reviewed by Brent Fulgham.
1814 Forgot to actually fix the leak in the successful parse case!
1816 * css/CSSParser.cpp:
1817 (WebCore::CSSParser::sourceSize): Added a call to destroy.
1819 2015-02-02 Benjamin Poulain <benjamin@webkit.org>
1821 JIT Compile simple cases of :nth-last-child()
1822 https://bugs.webkit.org/show_bug.cgi?id=141053
1824 Reviewed by Andreas Kling.
1826 This patch adds the code generator for :nth-last-child(), skipping
1827 any :nth-last-child(An+B of selector list).
1829 The code generator is boring here, nothing fancy.
1830 There is no optimization opportunity here so it is basically the same
1831 speed as the code generated by Clang when the simple selector is alone.
1833 The only reason to JIT compile this is to avoid going to slow-path
1834 for every selector that contain :nth-last-child().
1836 * cssjit/SelectorCompiler.cpp:
1837 (WebCore::SelectorCompiler::addNthChildType):
1838 The code creating the intermediate representation of :nth-child() is exactly
1839 the same as what we need for :nth-last-child(). I extracted the code from addPseudoClassType()
1840 and share it for both simple selectors.
1842 (WebCore::SelectorCompiler::addPseudoClassType):
1843 I fail :nth-last-child(An+B of selector list). Let's add it later.
1845 (WebCore::SelectorCompiler::minimumRegisterRequirements):
1846 Oops, there was a bug with nthChildOfFilters.
1848 (WebCore::SelectorCompiler::hasAnyCombinators):
1849 (WebCore::SelectorCompiler::computeBacktrackingMemoryRequirements):
1850 (WebCore::SelectorCompiler::computeBacktrackingInformation):
1851 (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementMatching):
1852 (WebCore::SelectorCompiler::setChildrenAffectedByBackwardPositionalRules):
1853 (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthLastChild):
1855 2015-02-02 Zalan Bujtas <zalan@apple.com>
1857 Simple line layout: Rename FlowContentsIterator to TextFragmentIterator.
1858 https://bugs.webkit.org/show_bug.cgi?id=141177
1860 Rubber-stamped by Antti Koivisto
1862 FlowContentsIterator is easy to confuse with FlowContents::Iterator.
1863 TextFragmentIterator reflects the functionality better.
1865 No change in functionality.
1868 * WebCore.vcxproj/WebCore.vcxproj:
1869 * WebCore.vcxproj/WebCore.vcxproj.filters:
1870 * WebCore.xcodeproj/project.pbxproj:
1871 * rendering/SimpleLineLayout.cpp:
1872 (WebCore::SimpleLineLayout::LineState::setOverflowedFragment):
1873 (WebCore::SimpleLineLayout::LineState::overflowedFragment):
1874 (WebCore::SimpleLineLayout::LineState::appendFragment):
1875 (WebCore::SimpleLineLayout::begin):
1876 (WebCore::SimpleLineLayout::end):
1877 (WebCore::SimpleLineLayout::preWrap):
1878 (WebCore::SimpleLineLayout::removeTrailingWhitespace):
1879 (WebCore::SimpleLineLayout::splitFragmentToFitLine):
1880 (WebCore::SimpleLineLayout::firstFragment):
1881 (WebCore::SimpleLineLayout::createLineRuns):
1882 (WebCore::SimpleLineLayout::closeLineEndingAndAdjustRuns):
1883 (WebCore::SimpleLineLayout::splitRunsAtRendererBoundary):
1884 (WebCore::SimpleLineLayout::createTextRuns):
1885 * rendering/SimpleLineLayoutTextFragmentIterator.cpp: Renamed from Source/WebCore/rendering/SimpleLineLayoutFlowContentsIterator.cpp.
1886 (WebCore::SimpleLineLayout::TextFragmentIterator::Style::Style):
1887 (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragmentIterator):
1888 (WebCore::SimpleLineLayout::TextFragmentIterator::nextTextFragment):
1889 (WebCore::SimpleLineLayout::TextFragmentIterator::textWidth):
1890 (WebCore::SimpleLineLayout::nextBreakablePosition):
1891 (WebCore::SimpleLineLayout::TextFragmentIterator::findNextBreakablePosition):
1892 (WebCore::SimpleLineLayout::findNextNonWhitespace):
1893 (WebCore::SimpleLineLayout::TextFragmentIterator::findNextNonWhitespacePosition):
1894 (WebCore::SimpleLineLayout::TextFragmentIterator::runWidth):
1895 * rendering/SimpleLineLayoutTextFragmentIterator.h: Renamed from Source/WebCore/rendering/SimpleLineLayoutFlowContentsIterator.h.
1896 (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::TextFragment):
1897 (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::start):
1898 (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::end):
1899 (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::width):
1900 (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::type):
1901 (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::isCollapsed):
1902 (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::isBreakable):
1903 (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::isEmpty):
1904 (WebCore::SimpleLineLayout::TextFragmentIterator::style):
1905 (WebCore::SimpleLineLayout::TextFragmentIterator::segmentForPosition):
1906 (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::split):
1907 (WebCore::SimpleLineLayout::TextFragmentIterator::characterAt):
1908 (WebCore::SimpleLineLayout::TextFragmentIterator::isLineBreak):
1909 (WebCore::SimpleLineLayout::TextFragmentIterator::isEnd):
1911 2015-02-02 Chris Dumez <cdumez@apple.com>
1913 Add diagnostic logging for ResourceResponse's source
1914 https://bugs.webkit.org/show_bug.cgi?id=141170
1915 <rdar://problem/19632080>
1917 Reviewed by Antti Koivisto.
1919 Add diagnostic logging for ResourceResponse's source (network, disk
1920 cache, disk cache after validation) to give us an idea of our network
1923 * loader/ResourceLoader.cpp:
1924 (WebCore::logResourceResponseSource):
1925 (WebCore::ResourceLoader::didReceiveResponse):
1926 * page/DiagnosticLoggingKeys.cpp:
1927 (WebCore::DiagnosticLoggingKeys::networkKey):
1928 (WebCore::DiagnosticLoggingKeys::diskCacheKey):
1929 (WebCore::DiagnosticLoggingKeys::diskCacheAfterValidationKey):
1930 (WebCore::DiagnosticLoggingKeys::resourceResponseKey):
1931 (WebCore::DiagnosticLoggingKeys::scriptKey):
1932 (WebCore::DiagnosticLoggingKeys::sourceKey):
1933 * page/DiagnosticLoggingKeys.h:
1935 2015-02-02 Dhi Aurrahman <diorahman@rockybars.com>
1937 Optimize matchesLangPseudoClass() of :lang()
1938 https://bugs.webkit.org/show_bug.cgi?id=140873
1940 Reviewed by Darin Adler.
1942 Avoid unnecessary memory allocation.
1944 No new tests, no behavior changed.
1946 * css/SelectorCheckerTestFunctions.h:
1947 (WebCore::equalIgnoringASCIICase):
1948 (WebCore::containslanguageSubtagMatchingRange):
1949 (WebCore::matchesLangPseudoClass):
1951 2015-02-02 Roger Fong <roger_fong@apple.com>
1953 WebGL2: Implement spec section 3.7.1 Setting and getting state (Part 2).
1954 https://bugs.webkit.org/show_bug.cgi?id=141096
1955 <rdar://problem/15002469>
1957 Reviewed by Brent Fulgham.
1959 This patch handles some of the valid arguments that could be passed into getParameter.
1960 The unhandled cases will be implemented as the associated WebGL2 features are implemented.
1961 In addition, getParameter queries that return 64 bit integer currently just return 0 as
1962 we need to use ::glGetInteger64v which is only available in GLES 3.0 headers.
1963 I will be adding these headers in a future patch.
1965 * bindings/js/JSWebGL2RenderingContextCustom.cpp:
1966 (WebCore::toJS): Accept a 64 bit integer type.
1967 * html/canvas/WebGL2RenderingContext.cpp: Handle various parameter inputs.
1968 (WebCore::WebGL2RenderingContext::getParameter):
1969 * html/canvas/WebGLGetInfo.cpp: Add a 64 bit integer type.
1970 (WebCore::WebGLGetInfo::WebGLGetInfo):
1971 (WebCore::WebGLGetInfo::getInt64):
1972 * html/canvas/WebGLGetInfo.h:
1973 * html/canvas/WebGLRenderingContextBase.cpp:
1974 (WebCore::WebGLRenderingContextBase::getInt64Parameter):
1975 * html/canvas/WebGLRenderingContextBase.h:
1976 * platform/graphics/GraphicsContext3D.h:
1977 * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
1978 (WebCore::GraphicsContext3D::getInteger64v):
1980 2015-02-02 Zalan Bujtas <zalan@apple.com>
1982 Simple line layout: use std::upper_bound in splitFragmentToFitLine()
1983 https://bugs.webkit.org/show_bug.cgi?id=141146
1985 Reviewed by Antti Koivisto.
1987 Replace the custom binary search implementation with std::upper_bound and
1988 move splitting functionality to TextFragment.
1990 No change in functionality.
1992 * rendering/SimpleLineLayout.cpp:
1993 (WebCore::SimpleLineLayout::FragmentForwardIterator::FragmentForwardIterator):
1994 (WebCore::SimpleLineLayout::FragmentForwardIterator::operator++):
1995 (WebCore::SimpleLineLayout::FragmentForwardIterator::operator!=):
1996 (WebCore::SimpleLineLayout::FragmentForwardIterator::operator*):
1997 (WebCore::SimpleLineLayout::begin):
1998 (WebCore::SimpleLineLayout::end):
1999 (WebCore::SimpleLineLayout::splitFragmentToFitLine):
2000 * rendering/SimpleLineLayoutFlowContentsIterator.cpp:
2001 (WebCore::SimpleLineLayout::FlowContentsIterator::runWidth):
2002 * rendering/SimpleLineLayoutFlowContentsIterator.h:
2003 (WebCore::SimpleLineLayout::FlowContentsIterator::TextFragment::split):
2005 2015-02-02 Geoffrey Garen <ggaren@apple.com>
2007 Use FastMalloc (bmalloc) instead of BlockAllocator for GC pages
2008 https://bugs.webkit.org/show_bug.cgi?id=140900
2010 Reviewed by Mark Hahnenberg.
2012 Re-landing just the HandleBlock piece of this patch.
2014 * platform/cocoa/MemoryPressureHandlerCocoa.mm:
2015 (WebCore::MemoryPressureHandler::install):
2017 2015-02-02 Brent Fulgham <bfulgham@apple.com>
2019 [Win] 64-bit build fix after r179492.
2021 * WebCore.vcxproj/WebCore.vcxproj: Forgot to build these files
2022 as standalone under 64-bit target.
2024 2015-02-02 Benjamin Poulain <bpoulain@apple.com>
2026 Clean up attribute handling: part 2 - attributeNode
2027 https://bugs.webkit.org/show_bug.cgi?id=141109
2029 Reviewed by Andreas Kling.
2031 Our implementation was covering some old legacy behaviors of Firefox,
2032 even copying bugs in some cases.
2034 The spec (https://dom.spec.whatwg.org) now defines the behavior precisely,
2035 let's move a bit closer to that.
2037 Tests: fast/dom/Element/attribute-ascii-case-insensitive-3.html
2038 fast/dom/Element/attribute-setAttributeNode-multiple-times.html
2039 fast/dom/Element/attribute-setAttributeNodeNS-multiple-times.html
2040 fast/dom/Element/mozilla-dom-base-tests/test_bug1075702.html
2041 fast/dom/Element/mozilla-dom-base-tests/test_bug339494.html
2042 fast/dom/Element/mozilla-dom-base-tests/test_bug364092.xhtml
2043 fast/dom/Element/setAttributeNode-overriding-lowercase-values.html
2046 (WebCore::findAttrNodeInList):
2047 New getter for the name-without-namespace case.
2049 (WebCore::Element::setAttributeNode):
2050 This one is the tricky one: https://dom.spec.whatwg.org/#dom-element-setattributenode
2052 When setAttributeNode() is used with an AttributeNode without namespace,
2053 getting the old value behaves like getAttribute(), with ASCII lowercase name matching.
2054 When used with a namespace, getting the old value behaves like getAttributeNS().
2056 Setting the value is a whole different story, the name used always keeps
2059 Now that's a bit tricky for us because AttributeNodes are just legacy stuff we don't
2062 We have 4 cases to handle:
2063 1) The name being set is lowercase, there was no conflicting name on the element.
2064 That's easy, we just override any node that would exist, set the name otherwise.
2065 2) The name is lowercase but there was an existing attribute for it.
2066 -We create a new AttributeNode for the name to represent the old name.
2067 -We check the names are the same with attribute.name().matches(attrNode->qualifiedName())
2068 and override the value.
2069 3) The name has uppercase characters, there is no conflicting name.
2070 We would not find an element to remove, we just use setAttributeInternal() as usual
2071 to add the attribute;
2072 4) The name has uppercase characters, there is a lowercase conflicing name.
2073 This is the weird behavior: we need to nuke the old attribute, then add the new attribute
2074 with a different case.
2076 First we remove the attribute with a lowercase name with removeAttributeInternal().
2077 That becomes the old node.
2079 There might still be an element of the same name as what we are trying to add. We don't want
2080 to add another version of the same attribute. We need to use findAttributeIndexByName() again
2081 to find if there is a conflicting attribute. Then we call setAttributeInternal() which handle
2082 the both the cases where there was an element or not.
2084 (WebCore::Element::setAttributeNodeNS):
2085 This should work like any "NS" method.
2087 (WebCore::Element::removeAttributeNode):
2088 The method removeAttributeNode() is supposed to be exact.
2090 (WebCore::Element::getAttributeNode):
2091 (WebCore::Element::hasAttribute):
2092 (WebCore::Element::attrIfExists):
2094 * dom/ElementData.cpp:
2095 (WebCore::ElementData::findAttributeIndexByNameSlowCase): Deleted.
2096 (WebCore::ElementData::findAttributeIndexByNameForAttributeNode): Deleted.
2097 Kill the slow case, every caller has been updated now.
2098 * dom/ElementData.h:
2099 (WebCore::ElementData::findAttributeIndexByName):
2100 * dom/QualifiedName.h:
2101 (WebCore::QualifiedName::matchesIgnoringCaseForLocalName): Deleted.
2103 2015-02-02 peavo@outlook.com <peavo@outlook.com>
2105 Memory is written to after deallocated, in GraphicsLayer::setMaskLayer.
2106 https://bugs.webkit.org/show_bug.cgi?id=141168
2108 Reviewed by Brent Fulgham.
2110 Visual Studio detected that a deallocated heap block had been modified in GraphicsLayer::setMaskLayer,
2111 when called from RenderLayerBacking::updateChildClippingStrategy.
2113 * rendering/RenderLayerBacking.cpp:
2114 (WebCore::RenderLayerBacking::updateChildClippingStrategy):
2116 2015-02-02 Andreas Kling <akling@apple.com>
2118 [Cocoa] Make decoded image data purgeable ASAP.
2119 <https://webkit.org/b/140298>
2120 <rdar://problem/19623377>
2122 Reviewed by Antti Koivisto.
2124 Re-landing this patch since it turned out to not be the cause of
2125 the memory regression we saw around that revision.
2127 Mark decoded images as "transient" which makes CoreGraphics mark
2128 the backing stores as purgeable shortly after they're used.
2130 The decoded representation will remain in CoreGraphics's caches
2131 indefinitely unless the kernel gets starved and needs the pages.
2133 Most resources will now reach a state where the encoded data is
2134 mmap'ed from disk cache (once the entire resource is downloaded)
2135 and the decoded data is purgeable.
2137 This also has the side effect of making the MemoryCache more
2138 palatial since the decoded data cost can be deducted for images,
2139 allowing us to cache more resources.
2141 Note that the worst case for this new behavior would be something
2142 like hovering below 100% memory utilization and constantly having
2143 to drop and re-decode images. While churny, it still beats
2144 crashing the process, plus there's tiling to remove many of the
2145 reasons we'd need the decoded data.
2147 * platform/graphics/cg/ImageSourceCG.cpp:
2148 (WebCore::ImageSource::createFrameAtIndex):
2150 2015-02-02 Joseph Pecoraro <pecoraro@apple.com>
2152 Web Inspector: Support console.table
2153 https://bugs.webkit.org/show_bug.cgi?id=141058
2155 Reviewed by Timothy Hatcher.
2157 * inspector/CommandLineAPIModuleSource.js:
2158 Include "table(foo)" as an alias of "console.table(foo)" on
2161 2015-02-02 Roger Fong <roger_fong@apple.com>
2163 [Win] Build fix following r179482.
2165 * WebCore.vcxproj/WebCore.vcxproj:
2166 * WebCore.vcxproj/WebCore.vcxproj.filters:
2167 * bindings/js/JSBindingsAllInOne.cpp:
2168 * platform/graphics/GraphicsContext3D.h:
2170 2015-02-02 Chris Dumez <cdumez@apple.com>
2172 Access MemoryCache singleton using MemoryCache::singleton()
2173 https://bugs.webkit.org/show_bug.cgi?id=141104
2175 Reviewed by Andreas Kling.
2177 Access MemoryCache singleton using MemoryCache::singleton() static
2178 member function, instead of a free function, as per the recent
2179 coding style discussion on WebKit-dev.
2181 2015-02-02 Zalan Bujtas <zalan@apple.com>
2183 Ambiguous naming: Do not call replacedContentRect()'s return value paint rect.
2184 https://bugs.webkit.org/show_bug.cgi?id=141125
2186 Reviewed by Simon Fraser.
2188 It's the content box rect with the object-fit adjustment.
2190 No change in functionality.
2192 * rendering/RenderHTMLCanvas.cpp:
2193 (WebCore::RenderHTMLCanvas::paintReplaced):
2194 * rendering/RenderImage.cpp:
2195 (WebCore::RenderImage::updateInnerContentRect):
2196 (WebCore::RenderImage::paintReplaced):
2197 * rendering/RenderReplaced.cpp:
2198 (WebCore::RenderReplaced::replacedContentRect):
2199 * rendering/SimpleLineLayout.cpp:
2200 (WebCore::SimpleLineLayout::splitFragmentToFitLine):
2202 2015-02-02 Brent Fulgham <bfulgham@apple.com>
2204 [Win] Build fix after r179476.
2205 https://bugs.webkit.org/show_bug.cgi?id=141026
2207 Reviewed by Anders Carlsson.
2209 MSVC has a compiler bug that forces us to make some explicit statements about how
2210 the passed pointer values are handled.
2212 * css/CSSParser.cpp:
2213 (WebCore::CSSParser::SourceSize::SourceSize):
2214 (WebCore::CSSParser::sourceSize):
2217 2015-02-02 Benjamin Poulain <benjamin@webkit.org>
2219 Get rid of invalidSelectorVector, use Bison's error recovery instead
2220 https://bugs.webkit.org/show_bug.cgi?id=141147
2222 Reviewed by Darin Adler.
2224 * css/CSSGrammar.y.in:
2225 Instead of reducing a null selector, we can use a real parsing error
2226 to get out of invalid selector endings.
2228 When that happens, Bison will pop the stack until it can reduce any
2229 valid error recovery rules.
2231 The problem is to make sure there is no floating values because
2232 none of the reduce block between the error and the recovery would
2235 In this case, "nth_selector_ending" is a non-recursive production of
2236 the NTHCHILDFUNCTIONS. In turn, NTHCHILDFUNCTIONS are productions
2237 of the non-recursive "pseudo". "pseudo" is only used as a trivial
2238 production of "specifier". "specifier" is only used by "specifier_list".
2240 "specifier_list" has error recovery code -> no production could have
2241 generated a floating values between "specifier_list" and "nth_selector_ending".
2243 2015-01-30 Roger Fong <roger_fong@apple.com>
2245 WebGL2: Implement spec section 3.7.1 Setting and getting state (Part 1).
2246 https://bugs.webkit.org/show_bug.cgi?id=141096
2247 <rdar://problem/15002469>
2249 Reviewed by Brent Fulgham.
2251 This patch implements the WebGL2 versions of getParameter, getIndexedParameter and isEnabled.
2252 It also removes the WebGL1 implementations from WebGLRenderingContextBase and moves it to WebGLRenderingContext.
2253 I’ve stubbed out most of the parameters for now, some of which will be implemented in Part 2,
2254 and the rest as the our WebGL2 implementation progresses.
2256 * bindings/js/JSWebGL2RenderingContextCustom.cpp:
2258 (WebCore::JSWebGL2RenderingContext::getIndexedParameter):
2259 * html/canvas/WebGL2RenderingContext.cpp:
2260 (WebCore::WebGL2RenderingContext::getIndexedParameter):
2261 (WebCore::WebGL2RenderingContext::getParameter):
2262 (WebCore::WebGL2RenderingContext::validateCapability):
2263 * html/canvas/WebGL2RenderingContext.h:
2264 * html/canvas/WebGL2RenderingContext.idl:
2265 * html/canvas/WebGLRenderingContext.cpp:
2266 (WebCore::WebGLRenderingContext::getParameter):
2267 (WebCore::WebGLRenderingContext::validateCapability):
2268 * html/canvas/WebGLRenderingContext.h:
2269 * html/canvas/WebGLRenderingContextBase.cpp:
2270 (WebCore::WebGLRenderingContextBase::getParameter): Deleted.
2271 (WebCore::WebGLRenderingContextBase::validateCapability): Deleted.
2272 * html/canvas/WebGLRenderingContextBase.h:
2273 * html/canvas/WebGLRenderingContextBase.idl:
2274 * platform/graphics/GraphicsContext3D.h:
2276 2015-02-02 Daniel Bates <dabates@apple.com>
2278 [iOS] ASSERTION FAILED: m_scriptExecutionContext->isContextThread() in ContextDestructionObserver::observeContext
2279 https://bugs.webkit.org/show_bug.cgi?id=141057
2280 <rdar://problem/19068790>
2282 Reviewed by Alexey Proskuryakov.
2284 Fixes an issue where we would create-/delete- the RSA crypto keys and dispatch callbacks on the wrong
2285 thread in WebKit1 for iOS. In iOS WebKit1 we should perform such operations on thread WebThread.
2287 This change is covered by existing layout tests.
2289 * crypto/mac/CryptoKeyRSAMac.cpp:
2290 (WebCore::CryptoKeyRSA::generatePair):
2292 2015-02-02 Jeremy Jones <jeremyj@apple.com>
2294 Prevent crash when accessing WebAVPlayerController.delegate.
2295 https://bugs.webkit.org/show_bug.cgi?id=140893
2297 Reviewed by Darin Adler.
2299 This patch aims to prevent a null delegate access during invalidation by adding null checks before accessing the delegate, by making explicit the recreation of m_playerController, and by consolidating and correcting the teardown sequence.
2302 * platform/ios/WebVideoFullscreenInterface.h: add resetMediaState()
2303 * platform/ios/WebVideoFullscreenInterfaceAVKit.h: ditto.
2304 * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
2305 (-[WebAVPlayerController playerViewController:shouldExitFullScreenWithReason:]): Check for null before accessing delegate.
2306 (-[WebAVPlayerController play:]): ditto.
2307 (-[WebAVPlayerController pause:]): ditto.
2308 (-[WebAVPlayerController togglePlayback:]): ditto.
2309 (-[WebAVPlayerController setPlaying:]): ditto.
2310 (-[WebAVPlayerController beginScrubbing:]): ditto.
2311 (-[WebAVPlayerController endScrubbing:]): ditto.
2312 (-[WebAVPlayerController seekToTime:]): ditto.
2313 (-[WebAVPlayerController beginScanningForward:]): ditto.
2314 (-[WebAVPlayerController endScanningForward:]): ditto.
2315 (-[WebAVPlayerController beginScanningBackward:]): ditto.
2316 (-[WebAVPlayerController endScanningBackward:]): ditto.
2317 (-[WebAVPlayerController seekToBeginning:]): ditto.
2318 (-[WebAVPlayerController seekToEnd:]): ditto.
2319 (-[WebAVPlayerController setCurrentAudioMediaSelectionOption:]): ditto.
2320 (-[WebAVPlayerController setCurrentLegibleMediaSelectionOption:]): ditto.
2321 (-[WebAVPlayerController layoutSublayersOfLayer:]): ditto.
2322 (WebVideoFullscreenInterfaceAVKit::WebVideoFullscreenInterfaceAVKit): initialize m_playerController
2323 (WebVideoFullscreenInterfaceAVKit::resetMediaState): Added.
2324 (WebVideoFullscreenInterfaceAVKit::setDuration): remove playerController()
2325 (WebVideoFullscreenInterfaceAVKit::setCurrentTime): ditto.
2326 (WebVideoFullscreenInterfaceAVKit::setRate): ditto.
2327 (WebVideoFullscreenInterfaceAVKit::setVideoDimensions): ditto.
2328 (WebVideoFullscreenInterfaceAVKit::setSeekableRanges): ditto.
2329 (WebVideoFullscreenInterfaceAVKit::setCanPlayFastReverse): ditto.
2330 (WebVideoFullscreenInterfaceAVKit::setAudioMediaSelectionOptions): ditto.
2331 (WebVideoFullscreenInterfaceAVKit::setLegibleMediaSelectionOptions): ditto.
2332 (WebVideoFullscreenInterfaceAVKit::setExternalPlayback): ditto.
2333 (WebVideoFullscreenInterfaceAVKit::setupFullscreenInternal): ditto.
2334 (WebVideoFullscreenInterfaceAVKit::enterFullscreenStandard): ditto.
2335 (WebVideoFullscreenInterfaceAVKit::cleanupFullscreenInternal): consolidated cleanup code from invalidate()
2336 (WebVideoFullscreenInterfaceAVKit::invalidate): consolidate cleanup code.
2337 (WebVideoFullscreenInterfaceAVKit::playerController): Deleted.
2338 * platform/ios/WebVideoFullscreenModelVideoElement.mm:
2339 (WebVideoFullscreenModelVideoElement::setVideoElement): call resetMediaState()
2341 2015-02-02 Darin Adler <darin@apple.com>
2343 REGRESSION (r170576): Storage leaks in parsing of CSS image sizes
2344 https://bugs.webkit.org/show_bug.cgi?id=141026
2346 Reviewed by Anders Carlsson.
2348 * css/CSSGrammar.y.in: Fixed all the shift/reduce conflicts caused
2349 by the ENABLE_PICTURE_SIZES code by removing all the redundant
2350 maybe_space which caused them. Rearranged the productions for
2351 ENABLE_PICTURE_SIZES to tighten up the code quite a bit. Changed
2352 the code to build up the source size vector as a Vector instead of
2353 a special class, and use the SourceSize struct from inside the
2356 * css/CSSParser.cpp:
2357 (WebCore::CSSParser::setupParser): Changed this to take a StringView.
2358 In the future we can change all the parsing functions to take StringView,
2359 since they don't work with the String in place.
2360 (WebCore::CSSParser::parseSizesAttribute): Changed to return a vector
2361 of SourceSize instead of a SourceSizeList. This is better because it's
2362 a real CSS data structure that does not contain a CSSParserValue.
2363 (WebCore::CSSParser::sourceSize): Added. Helper that creates a
2364 SourceSize, mapping parser data structures into real CSS ones.
2366 * css/CSSParser.h: Updated for changes above.
2368 * css/MediaQuery.cpp:
2369 (WebCore::MediaQuery::MediaQuery): Use std::make_unique and the copy
2370 constructor directly instead of using a MediaQuery::copy function.
2372 * css/MediaQueryExp.cpp: Streamlined the class a little bit.
2373 * css/MediaQueryExp.h: Removed unneeded includes. Moved functions out
2374 of the class body so the class is easier to read. Removed the unneeded
2377 * css/SourceSizeList.cpp:
2378 (WebCore::SourceSize::match): Changed to use WTF::move instead
2379 of releasing and then re-creating the unique_ptr.
2380 (WebCore::computeLength): Added a comment to explain this function
2381 is using an incorrect strategy. Also added some type checking code
2382 to handle cases where a null or non-primitive CSS value might be
2383 returned. Probably dead code, but we don't want to risk a bad cast.
2384 Worthe cleaning up when we fix the strategy.
2385 (WebCore::SourceSizeList::getEffectiveSize): Updated since the
2386 vector now contains actual SourceSize objects rather than pointers
2387 to SourceSize objects on the heap.
2389 * css/SourceSizeList.h: Changed the CSSParserValue argument to be
2390 an rvalue reference to make it clearer that we take ownership of it
2391 when it's moved in. Added a move constructor and a destructor. Added
2392 comments explaining that it's not correct design to use a
2393 CSSParserValue here, outside the parser. Changed SourceSizeList's
2394 append function to move a SourceSize in rather than a unique_ptr.
2395 Made getEffectiveSize private. Moved the various inline functions to
2396 the bottom of the file to make the class definitions easier to read.
2399 * css/SourceSizeList.cpp: Made almost everything about this private
2400 to this source file instead of public in the header.
2401 (WebCore::match): Made this a free function instead of a member function
2402 and made it take the media query expression as an argument.
2403 (WebCore::computeLength): Changed the argument type to CSSValue*,
2404 rather than using CSSParserValue here outside the parser.
2405 (WebCore::parseSizesAttribute): Streamlined and simplified this.
2406 Now that the parser builds the list in the correct order, there was
2407 no need to iterate backwards any more so we could use a modern for
2410 * css/SourceSizeList.h: Removed almost everything in this header.
2412 * html/HTMLImageElement.cpp:
2413 (WebCore::HTMLImageElement::parseAttribute): Call the
2414 parseSizesAttribute function as free function since it's no longer
2415 a member of a SourceSizeList class.
2417 * html/parser/HTMLPreloadScanner.cpp:
2418 (WebCore::TokenPreloadScanner::StartTagScanner::processAttributes):
2421 2015-02-02 Darin Adler <darin@apple.com>
2423 Fix some leaks found by the leak bot
2424 https://bugs.webkit.org/show_bug.cgi?id=141149
2426 Reviewed by Alexey Proskuryakov.
2428 * bindings/js/JSSubtleCryptoCustom.cpp:
2429 (WebCore::importKey): Changed argument types to std::unique_ptr for better code clarity.
2430 (WebCore::JSSubtleCrypto::importKey): Use WTF::move instead of release.
2431 (WebCore::JSSubtleCrypto::wrapKey): Fixed leaks by adding missing delete calls to the
2432 case where we get a DOM exception.
2433 (WebCore::JSSubtleCrypto::unwrapKey): Ditto.
2435 * dom/SelectorQuery.cpp:
2436 (WebCore::SelectorQuery::SelectorQuery): Use WTF::move here. Not clear how this could
2437 have caused the storage leak, but it does seem obviously missing. The leak is pretty big,
2438 implying that we leak almost all CSSSelectorList objects we parse; not sure this fixes it.
2440 * loader/WorkerThreadableLoader.cpp:
2441 (WebCore::WorkerThreadableLoader::MainThreadBridge::didReceiveResponse): Added code to
2442 deleted the unguarded pointer if postTaskForModeToWorkerGlobalScope fails.
2443 (WebCore::WorkerThreadableLoader::MainThreadBridge::didReceiveData): Ditto.
2444 (WebCore::WorkerThreadableLoader::MainThreadBridge::didFail): Ditto.
2445 (WebCore::WorkerThreadableLoader::MainThreadBridge::didFailAccessControlCheck): Ditto.
2447 * platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm:
2448 (WebCore::MediaSelectionGroupAVFObjC::updateOptions): Added missing adoptNS.
2450 * platform/graphics/mac/GraphicsContextMac.mm:
2451 (WebCore::GraphicsContext::updateDocumentMarkerResources): Added missing release.
2453 2015-02-01 Chris Dumez <cdumez@apple.com>
2455 Use more references in HistoryItem
2456 https://bugs.webkit.org/show_bug.cgi?id=141133
2458 Reviewed by Andreas Kling.
2460 Use more references in HistoryItem instead of pointers.
2462 2015-02-01 Commit Queue <commit-queue@webkit.org>
2464 Unreviewed, rolling out r179467 and r179470.
2465 https://bugs.webkit.org/show_bug.cgi?id=141144
2467 Broke svg/custom/use-events-crash.svg (Requested by ap on
2470 Reverted changesets:
2472 "Stop dispatching events with SVGElementInstance objects as
2474 https://bugs.webkit.org/show_bug.cgi?id=141108
2475 http://trac.webkit.org/changeset/179467
2477 "REGRESSION(r179467): svg/custom/use-events-crash.svg times
2479 http://trac.webkit.org/changeset/179470
2481 2015-01-31 Darin Adler <darin@apple.com>
2483 Stop dispatching events to with SVGElementInstance objects as their targets
2484 https://bugs.webkit.org/show_bug.cgi?id=141108
2486 Reviewed by Anders Carlsson.
2488 Test: svg/custom/use-event-retargeting.html
2490 * dom/EventDispatcher.cpp:
2491 (WebCore::eventTargetRespectingTargetRules): Replaced the code that retargeted
2492 events at SVGElementInstance objects with code that retargets them at the use
2493 element instead. Also wrote the code in a simpler way.
2495 2015-02-01 Zan Dobersek <zdobersek@igalia.com>
2497 [TexMap] Optimize TextureMapperLayer::removeAllChildren()
2498 https://bugs.webkit.org/show_bug.cgi?id=140734
2500 Reviewed by Chris Dumez.
2502 Instead of removing the children from the Vector member one by one,
2503 move the Vector out and iterate through the ex-children, clearing
2504 out the pointer to the parent.
2506 * platform/graphics/texmap/TextureMapperLayer.cpp:
2507 (WebCore::TextureMapperLayer::removeAllChildren):
2509 2015-02-01 Zan Dobersek <zdobersek@igalia.com>
2511 [TexMap] Avoid unnecessary TransformationMatrix copies in GraphicsLayerTransform
2512 https://bugs.webkit.org/show_bug.cgi?id=140735
2514 Reviewed by Chris Dumez.
2516 * platform/graphics/GraphicsLayerTransform.cpp:
2517 (WebCore::GraphicsLayerTransform::combined): Return a const reference to the matrix.
2518 (WebCore::GraphicsLayerTransform::combinedForChildren): Ditto.
2519 (WebCore::GraphicsLayerTransform::combineTransforms): First copy the parent transform,
2520 then apply the translation and multiplication. Previously this copied the parent
2521 transform into a temporary object, performed the translation and multiplication, and
2522 copied that temporary object again when assigning to the member variable.
2523 (WebCore::GraphicsLayerTransform::combineTransformsForChildren): Mark const. m_childrenDirty
2524 and m_combinedForChildren members are marked mutable.
2525 * platform/graphics/GraphicsLayerTransform.h:
2527 2015-01-31 Myles C. Maxfield <litherum@gmail.com>
2529 REGRESSION (r177689): Emoji variation sequences rendered incorrectly (as characters from other non-emoji font)
2530 https://bugs.webkit.org/show_bug.cgi?id=141112
2532 Reviewed by Sam Weinig.
2536 Test: platform/mac/fast/text/combining-mark-paint.html
2538 * platform/graphics/mac/ComplexTextControllerCoreText.mm:
2539 (WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
2541 2015-01-31 Commit Queue <commit-queue@webkit.org>
2543 Unreviewed, rolling out r178183.
2544 https://bugs.webkit.org/show_bug.cgi?id=141132
2546 Caused more mallocing than the volatility saved. (Requested by
2551 "[Cocoa] Make decoded image data purgeable ASAP."
2552 https://bugs.webkit.org/show_bug.cgi?id=140298
2553 http://trac.webkit.org/changeset/178183
2555 2015-01-31 Chris Dumez <cdumez@apple.com>
2557 Use simpler CachedResourceMap structure in MemoryCache with CACHE_PARTITIONING enabled
2558 https://bugs.webkit.org/show_bug.cgi?id=141110
2560 Reviewed by Antti Koivisto.
2562 Use simpler CachedResourceMap structure in MemoryCache with CACHE_PARTITIONING
2563 enabled. Previously, we would be using a HashMap of HashMap to store
2564 CachedResources. The outer HashMap would use the URL as key and the inner
2565 HashMap would use the partition name as key. This would make traversing the
2566 structure overly complicated, especially considering that the code needs to
2567 traverse a simple HashMap if CACHE_PARTITIONING is disabled.
2569 This patch updates the CachedResourceMap structure to be a simple HashMap,
2570 whose key is an std::pair<URL, String /* partitionName */>. Having a flat
2571 structure simplifies the traversal code a lot and enables more code sharing
2572 between CACHE_PARTITIONING and !CACHE_PARTITIONING. This shouldn't regress
2573 performance because we always have both a URL and a partition name when we
2574 need to look up a resource. We never need to retrieve all resources with
2577 This patch also switches to using a URL as key instead of a String as we
2578 always have a URL has input.
2580 * loader/cache/MemoryCache.cpp:
2581 (WebCore::MemoryCache::add):
2582 (WebCore::MemoryCache::revalidationSucceeded):
2583 (WebCore::MemoryCache::resourceForRequestImpl):
2584 (WebCore::MemoryCache::removeImageFromCache):
2585 (WebCore::MemoryCache::remove):
2586 After removing the resource from the CachedResourceMap, remove the
2587 sessionID from m_sessionResources if the CachedResourceMap is now
2588 empty. Previously, no code was removing sessionIDs from
2591 (WebCore::MemoryCache::removeResourcesWithOrigin):
2592 (WebCore::MemoryCache::getOriginsWithCache):
2593 (WebCore::MemoryCache::getStatistics):
2594 (WebCore::MemoryCache::setDisabled):
2595 * loader/cache/MemoryCache.h:
2597 2015-01-31 Sam Weinig <sam@webkit.org>
2599 Merge the iOS implementations of GraphicsContext::drawText and GraphicsContext::drawBidiText with the platform independent ones
2600 https://bugs.webkit.org/show_bug.cgi?id=141131
2602 Reviewed by Antti Koivisto.
2604 * platform/graphics/GraphicsContext.cpp:
2605 (WebCore::GraphicsContext::drawText):
2606 The only difference between the two implementation here was the iOS one returns the length of
2607 the text that was drawn. As all platforms now support that, we can merge by keeping the iOS one.
2609 (WebCore::GraphicsContext::drawBidiText):
2610 This function had a few differences:
2611 - iOS returns the length of the text that was drawn.
2612 Since this is not used anywhere, I dropped this ability.
2613 - iOS took additional inputs of initial bidi status and run length (and returned the
2614 the final bidi status as an out parameter)
2615 Since this was also unused, I dropped it.
2616 - iOS used the fact that font.drawText() returns the length that was drawn, to avoid
2617 measuring the text twice.
2618 I kept this, since all platforms now support this.
2620 * platform/graphics/GraphicsContext.h:
2621 Update signatures. Remove WEBCORE_EXPORT for function that is not used outside of WebCore.
2623 2015-01-31 Andreas Kling <akling@apple.com>
2626 <https://webkit.org/b/141129>
2628 Reviewed by Antti Koivisto.
2630 Get rid of the bitfield in RenderBlock by moving the essential bits to
2631 RenderElement (plenty of space in the bitfield there.)
2633 RenderBlock also had a cache of its line-height, but it doesn't appear
2634 to help any of the benchmarks that we're tracking so I'd say it's okay
2635 to lose this optimization.
2637 This knocks 8 bytes off of RenderBlock (and all of its subclasses.)
2639 * rendering/RenderBlock.cpp:
2640 (WebCore::RenderBlock::RenderBlock):
2641 (WebCore::RenderBlock::styleDidChange):
2642 (WebCore::RenderBlock::recomputeLogicalWidth):
2643 (WebCore::RenderBlock::lineHeight):
2644 * rendering/RenderBlock.h:
2645 (WebCore::RenderBlock::setHasMarginBeforeQuirk):
2646 (WebCore::RenderBlock::setHasMarginAfterQuirk):
2647 (WebCore::RenderBlock::setHasBorderOrPaddingLogicalWidthChanged):
2648 (WebCore::RenderBlock::hasMarginBeforeQuirk):
2649 (WebCore::RenderBlock::hasMarginAfterQuirk):
2650 (WebCore::RenderBlock::hasBorderOrPaddingLogicalWidthChanged):
2651 * rendering/RenderBlockFlow.cpp:
2652 (WebCore::RenderBlockFlow::layoutInlineChildren):
2653 (WebCore::RenderBlockFlow::invalidateLineLayoutPath):
2654 (WebCore::RenderBlockFlow::deleteLineBoxesBeforeSimpleLineLayout):
2655 (WebCore::RenderBlockFlow::ensureLineBoxes):
2656 * rendering/RenderBlockFlow.h:
2657 (WebCore::RenderBlockFlow::lineLayoutPath):
2658 (WebCore::RenderBlockFlow::setLineLayoutPath):
2659 (WebCore::RenderBlockFlow::setHasMarkupTruncation):
2660 (WebCore::RenderBlockFlow::hasMarkupTruncation):
2661 (WebCore::RenderBlockFlow::simpleLineLayout):
2662 * rendering/RenderElement.cpp:
2663 (WebCore::RenderElement::RenderElement):
2664 * rendering/RenderElement.h:
2665 (WebCore::RenderElement::setRenderBlockHasMarginBeforeQuirk):
2666 (WebCore::RenderElement::setRenderBlockHasMarginAfterQuirk):
2667 (WebCore::RenderElement::setRenderBlockHasBorderOrPaddingLogicalWidthChanged):
2668 (WebCore::RenderElement::renderBlockHasMarginBeforeQuirk):
2669 (WebCore::RenderElement::renderBlockHasMarginAfterQuirk):
2670 (WebCore::RenderElement::renderBlockHasBorderOrPaddingLogicalWidthChanged):
2671 (WebCore::RenderElement::setRenderBlockFlowLineLayoutPath):
2672 (WebCore::RenderElement::setRenderBlockFlowHasMarkupTruncation):
2673 (WebCore::RenderElement::renderBlockFlowLineLayoutPath):
2674 (WebCore::RenderElement::renderBlockFlowHasMarkupTruncation):
2675 * rendering/RenderFlowThread.cpp:
2676 (WebCore::RenderFlowThread::removeLineRegionInfo):
2678 2015-01-31 Chris Dumez <cdumez@apple.com>
2680 Remove useless PageCache::singleton() call from PageCache member function
2681 https://bugs.webkit.org/show_bug.cgi?id=141127
2683 Reviewed by Andreas Kling.
2685 * history/PageCache.cpp:
2686 (WebCore::PageCache::get):
2688 2015-01-31 Sam Weinig <sam@webkit.org>
2690 Remove empty #if/#endif
2692 Rubber-stamped by Antti Koivisto.
2694 * platform/graphics/FontPlatformData.h:
2696 2015-01-31 Sam Weinig <sam@webkit.org>
2698 Remove support for disabling drawing of emoji
2699 https://bugs.webkit.org/show_bug.cgi?id=141126
2701 Reviewed by Antti Koivisto.
2703 Remove unused support for disabling the drawing of emoji.
2706 * platform/graphics/GraphicsContext.cpp:
2707 (WebCore::GraphicsContext::emojiDrawingEnabled): Deleted.
2708 (WebCore::GraphicsContext::setEmojiDrawingEnabled): Deleted.
2709 * platform/graphics/GraphicsContext.h:
2710 (WebCore::GraphicsContextState::GraphicsContextState):
2711 * platform/graphics/cocoa/FontCascadeCocoa.mm:
2712 (WebCore::FontCascade::drawGlyphs):
2714 2015-01-31 Sam Weinig <sam@webkit.org>
2716 Remove even more Mountain Lion support
2717 https://bugs.webkit.org/show_bug.cgi?id=141124
2719 Reviewed by Alexey Proskuryakov.
2721 * Configurations/Base.xcconfig:
2722 * Configurations/DebugRelease.xcconfig:
2723 * Configurations/FeatureDefines.xcconfig:
2724 * Configurations/Version.xcconfig:
2725 * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2726 (-[WebAccessibilityObjectWrapper accessibilityActionNames]):
2727 (-[WebAccessibilityObjectWrapper subrole]):
2728 * platform/graphics/ca/mac/PlatformCALayerMac.mm:
2729 (PlatformCALayer::drawLayerContents):
2730 * platform/mac/ThemeMac.mm:
2731 (-[WebCoreThemeView _focusRingVisibleRect]):
2733 2015-01-30 Sam Weinig <sam@webkit.org>
2735 Merge SimpleFontDataIOS.mm and SimpleFontDataMac.mm into FontCocoa.mm
2736 https://bugs.webkit.org/show_bug.cgi?id=141101
2738 Rubber-stamped by Dan Bernstein.
2740 * WebCore.xcodeproj/project.pbxproj:
2741 Remove SimpleFontDataIOS.mm and SimpleFontDataMac.mm. Add FontCocoa.mm.
2743 * platform/graphics/Font.h:
2744 Remove a few CG only functions from the header that can be implemented as static functions
2745 in the implementation file.
2747 * platform/graphics/cocoa/FontCocoa.mm: Copied from Source/WebCore/platform/graphics/mac/SimpleFontDataMac.mm.
2748 (WebCore::fontFamilyShouldNotBeUsedForArabic):
2749 (WebCore::Font::platformInit):
2750 (WebCore::Font::platformCharWidthInit):
2751 (WebCore::Font::platformCreateScaledFont):
2752 (WebCore::Font::determinePitch):
2753 (WebCore::renderingStyle):
2754 (WebCore::advanceForColorBitmapFont):
2755 (WebCore::hasCustomTracking):
2756 (WebCore::canUseFastGlyphAdvanceGetter):
2757 (WebCore::Font::platformWidthForGlyph):
2758 (WebCore::Font::compositeFontReferenceFont):
2759 (WebCore::copyFontTableForTag): Deleted.
2760 (WebCore::Font::renderingStyle): Deleted.
2761 Merge in the iOS specific parts.
2763 * platform/graphics/ios/SimpleFontDataIOS.mm: Removed.
2764 * platform/graphics/mac/SimpleFontDataMac.mm: Removed.
2766 2015-01-31 Zalan Bujtas <zalan@apple.com>
2768 Regression(r179438) Simple line layout: ASSERTION at SimpleLineLayout::FlowContentsIterator::runWidth().
2769 https://bugs.webkit.org/show_bug.cgi?id=141121
2771 Reviewed by Antti Koivisto.
2773 When a breakable text fragment does not fit the current line, we split it.
2774 The first part stays on the current line, while the second part gets pushed to the next line.
2775 In certain cases, the first part could end up being empty.
2776 This patch ensures that we don't measure empty fragments.
2778 Covered by existing tests.
2780 * rendering/SimpleLineLayout.cpp:
2781 (WebCore::SimpleLineLayout::splitFragmentToFitLine):
2783 2015-01-31 Commit Queue <commit-queue@webkit.org>
2785 Unreviewed, rolling out r179426.
2786 https://bugs.webkit.org/show_bug.cgi?id=141119
2788 "caused a memory use regression" (Requested by Guest45 on
2793 "Use FastMalloc (bmalloc) instead of BlockAllocator for GC
2795 https://bugs.webkit.org/show_bug.cgi?id=140900
2796 http://trac.webkit.org/changeset/179426
2798 2015-01-30 Zalan Bujtas <zalan@apple.com>
2800 Simple line layout: Improve FlowContentsIterator::TextFragment's encapsulation.
2801 https://bugs.webkit.org/show_bug.cgi?id=141090
2803 Reviewed by Andreas Kling.
2805 Make members private to avoid accidental change in TextFragment.
2807 No change in functionality.
2809 * rendering/SimpleLineLayout.cpp:
2810 (WebCore::SimpleLineLayout::LineState::addFragment):
2811 (WebCore::SimpleLineLayout::LineState::addWhitespace):
2812 (WebCore::SimpleLineLayout::splitFragmentToFitLine):
2813 (WebCore::SimpleLineLayout::firstFragment):
2814 (WebCore::SimpleLineLayout::createLineRuns):
2815 * rendering/SimpleLineLayoutFlowContentsIterator.cpp:
2816 (WebCore::SimpleLineLayout::FlowContentsIterator::nextTextFragment):
2817 * rendering/SimpleLineLayoutFlowContentsIterator.h:
2818 (WebCore::SimpleLineLayout::FlowContentsIterator::TextFragment::TextFragment):
2819 (WebCore::SimpleLineLayout::FlowContentsIterator::TextFragment::start):
2820 (WebCore::SimpleLineLayout::FlowContentsIterator::TextFragment::end):
2821 (WebCore::SimpleLineLayout::FlowContentsIterator::TextFragment::width):
2822 (WebCore::SimpleLineLayout::FlowContentsIterator::TextFragment::type):
2823 (WebCore::SimpleLineLayout::FlowContentsIterator::TextFragment::isCollapsed):
2824 (WebCore::SimpleLineLayout::FlowContentsIterator::TextFragment::isBreakable):
2825 (WebCore::SimpleLineLayout::FlowContentsIterator::TextFragment::isEmpty):
2827 2015-01-30 Zalan Bujtas <zalan@apple.com>
2829 Simple line layout: Make LineState fragment handling simpler.
2830 https://bugs.webkit.org/show_bug.cgi?id=141100
2832 Reviewed by Andreas Kling.
2834 New fragments are appeneded to the Run's last entry
2835 instead of accumulating them until after a new run is required.
2836 (whitespace collapse or line end)
2837 LineState::appendFragment manages whitespace collapsing now.
2838 This makes createLineRuns() logic lighter and no need to "flush"
2839 the LineState when the line ends.
2841 No change in functionality.
2843 * rendering/SimpleLineLayout.cpp: Make LineState members private and introduce getters.
2844 (WebCore::SimpleLineLayout::LineState::setAvailableWidth):
2845 (WebCore::SimpleLineLayout::LineState::setLogicalLeftOffset):
2846 (WebCore::SimpleLineLayout::LineState::setOverflowedFragment):
2847 (WebCore::SimpleLineLayout::LineState::availableWidth):
2848 (WebCore::SimpleLineLayout::LineState::logicalLeftOffset):
2849 (WebCore::SimpleLineLayout::LineState::overflowedFragment):
2850 (WebCore::SimpleLineLayout::LineState::hasTrailingWhitespace):
2851 (WebCore::SimpleLineLayout::LineState::isWhitespaceOnly):
2852 (WebCore::SimpleLineLayout::LineState::fits):
2853 (WebCore::SimpleLineLayout::LineState::firstCharacterFits):
2854 (WebCore::SimpleLineLayout::LineState::width):
2855 (WebCore::SimpleLineLayout::LineState::appendFragment): Append each fragment to the Run
2856 by either creating a new run or expanding the last one.
2857 (WebCore::SimpleLineLayout::LineState::removeTrailingWhitespace): Remove trailing whitespace from
2858 the Run's and reset the trailing whitespace variables.
2859 (WebCore::SimpleLineLayout::removeTrailingWhitespace):
2860 (WebCore::SimpleLineLayout::updateLineConstrains):
2861 (WebCore::SimpleLineLayout::firstFragment):
2862 (WebCore::SimpleLineLayout::createLineRuns):
2863 (WebCore::SimpleLineLayout::closeLineEndingAndAdjustRuns):
2864 (WebCore::SimpleLineLayout::createTextRuns):
2865 (WebCore::SimpleLineLayout::LineState::createRun): Deleted.
2866 (WebCore::SimpleLineLayout::LineState::addFragment): Deleted.
2867 (WebCore::SimpleLineLayout::LineState::addWhitespace): Deleted.
2868 (WebCore::SimpleLineLayout::LineState::hasWhitespaceOnly): Deleted.
2870 2015-01-30 Chris Dumez <cdumez@apple.com>
2872 Drop HistoryItem's m_prev / m_next
2873 https://bugs.webkit.org/show_bug.cgi?id=141105
2875 Reviewed by Zalan Bujtas.
2877 Drop HistoryItem's m_prev / m_next. Those are no longer needed after
2878 the PageCache refactoring in <http://trac.webkit.org/r179347>.
2880 * history/HistoryItem.cpp:
2881 (WebCore::HistoryItem::HistoryItem):
2882 * history/HistoryItem.h:
2884 2015-01-30 Jeongmin Kim <jm86.kim@lge.com>
2886 Update the comment in RenderLayer for clarity as related code location is changed
2887 https://bugs.webkit.org/show_bug.cgi?id=141103
2889 Reviewed by Simon Fraser.
2891 Update the comment in RenderLayer for clarity as related code location is changed
2892 The repainting in implicitClose() that is now called in setVisualUpdatesAllowed(bool) is removed
2894 * rendering/RenderLayer.cpp:
2895 (WebCore::shouldSuppressPaintingLayer):
2896 * rendering/RenderLayerCompositor.cpp:
2897 (WebCore::RenderLayerCompositor::updateCompositingLayers):
2899 2015-01-30 Chris Dumez <cdumez@apple.com>
2901 Optimize MemoryCache::getSessionMap() a bit
2902 https://bugs.webkit.org/show_bug.cgi?id=141069
2904 Reviewed by Anders Carlsson.
2906 Optimize MemoryCache::getSessionMap() a bit by doing 1 HashMap lookup
2907 instead of previously 3. Also rename the method to
2908 ensureSessionResourceMap() as we usually don't use "get" prefix for
2909 getters and the implementation will also create the HashMap value if
2910 the key is not found.
2912 Also add a alternative sessionResourceMap() method which returns
2913 the HashMap value if the key exists but doesn't try to create it if
2914 missing. This is actually what we really want for some call sites.
2916 * loader/cache/MemoryCache.cpp:
2917 (WebCore::MemoryCache::add):
2918 (WebCore::MemoryCache::revalidationSucceeded):
2919 (WebCore::MemoryCache::resourceForRequest):
2920 (WebCore::MemoryCache::removeImageFromCache):
2921 (WebCore::MemoryCache::remove):
2922 (WebCore::MemoryCache::getSessionMap): Deleted.
2923 * loader/cache/MemoryCache.h:
2925 2015-01-30 Chris Dumez <cdumez@apple.com>
2927 Unreviewed. Remove outdated comment.
2929 * loader/cache/MemoryCache.cpp:
2931 2015-01-30 Eric Carlson <eric.carlson@apple.com>
2933 Remove MediaPlayerProxy.h
2934 https://bugs.webkit.org/show_bug.cgi?id=141087
2936 Reviewed by Sam Weinig.
2938 * WebCore.xcodeproj/project.pbxproj: Remove reference to MediaPlayerProxy.h.
2939 * platform/graphics/mac/MediaPlayerProxy.h: Removed.
2941 2015-01-30 Geoffrey Garen <ggaren@apple.com>
2943 Use FastMalloc (bmalloc) instead of BlockAllocator for GC pages
2944 https://bugs.webkit.org/show_bug.cgi?id=140900
2946 Reviewed by Mark Hahnenberg.
2948 Re-landing just the HandleBlock piece of this patch.
2950 * platform/cocoa/MemoryPressureHandlerCocoa.mm:
2951 (WebCore::MemoryPressureHandler::install):
2953 2015-01-30 Chris Dumez <cdumez@apple.com>
2955 Update MemoryCache code to use more references instead of pointers
2956 https://bugs.webkit.org/show_bug.cgi?id=141099
2958 Reviewed by Andreas Kling.
2960 2015-01-30 Brian J. Burg <burg@cs.washington.edu>
2962 Web Inspector: ASSERT in InspectorTimelineAgent::internalStop
2963 https://bugs.webkit.org/show_bug.cgi?id=141039
2965 Reviewed by Timothy Hatcher.
2967 Don't unconditionally stop the environment stopwatch, since it could have
2968 already stopped due to the debugger pausing.
2970 * inspector/InspectorTimelineAgent.cpp:
2971 (WebCore::InspectorTimelineAgent::internalStop):
2973 2015-01-30 Chris Dumez <cdumez@apple.com>
2975 When no background-size is specified on the 2nd background layer, it takes the first instead of the initial value
2976 https://bugs.webkit.org/show_bug.cgi?id=141059
2978 Reviewed by Antti Koivisto.
2980 This patch fixes fill size support for 'initial' value.
2982 Test: fast/css/background-layers-initial-size.html
2984 * css/CSSToStyleMap.cpp:
2985 - Add check for initial values and set fill size to initialFillSize()
2986 in this case (which is 'auto'). Previously, we were handling all
2987 non CSSPrimitiveValues the same way and setting the fill size type
2988 to SizeNone, which means no size (not 'auto').
2989 - Clean up the rest of the function (no behavior change).
2991 * rendering/style/FillLayer.cpp:
2992 (WebCore::FillLayer::FillLayer):
2993 - Initialize m_sizeLength to SizeNone instead of calling
2994 initialFillSizeType(). There is no behavior change here. However,
2995 initialFillSizeType() was not supposed to return SizeNone.
2996 - Stop explicitly initializing m_sizeLength to LengthSize() as this
2997 is already what happens implicitly.
2999 * rendering/style/FillLayer.h:
3000 (WebCore::FillLayer::initialFillSize):
3001 Return FillSize() instead of FillSize(SizeNone, LengthSize()).
3002 FillSize() is equivalent to FillSize(SizeLength, LengthSize())
3003 which is resolved to 'auto'. SizeNone means no size which isn't
3004 what we want as an initial value.
3006 (WebCore::FillLayer::initialFillSizeType): Deleted.
3007 (WebCore::FillLayer::initialFillSizeLength): Deleted.
3008 Remove Individual initialFillSizeType() / initialFillSizeLength()
3009 functions now that all caller use initialFillSize() instead.
3011 2015-01-30 Commit Queue <commit-queue@webkit.org>
3013 Unreviewed, rolling out r179403.
3014 https://bugs.webkit.org/show_bug.cgi?id=141091
3016 Broke fast/files/workers/worker-apply-blob-url-to-xhr.html
3017 (Requested by ap_ on #webkit).
3021 "Optimize MemoryCache::getSessionMap() a bit"
3022 https://bugs.webkit.org/show_bug.cgi?id=141069
3023 http://trac.webkit.org/changeset/179403
3025 2015-01-30 Chris Dumez <cdumez@apple.com>
3027 Rename shared() static member functions to singleton() for singleton classes.
3028 https://bugs.webkit.org/show_bug.cgi?id=141088
3030 Reviewed by Ryosuke Niwa and Benjamin Poulain.
3032 Rename shared() static member functions to singleton() for singleton
3033 classes as per the recent coding style change.
3035 2015-01-30 Matthew Mirman <mmirman@apple.com>
3037 Added ClientRect as an interface that requires attributes
3038 on instance for compatibility.
3039 https://bugs.webkit.org/show_bug.cgi?id=141063
3040 <rdar://problem/18437653>
3042 Reviewed by Oliver Hunt.
3044 Added a new test to LayoutTests/js/resources/JSON-stringify.js
3046 * bindings/scripts/CodeGeneratorJS.pm:
3047 (InterfaceRequiresAttributesOnInstanceForCompatibility):
3049 2015-01-30 Chris Dumez <cdumez@apple.com>
3051 Optimize MemoryCache::getSessionMap() a bit
3052 https://bugs.webkit.org/show_bug.cgi?id=141069
3054 Reviewed by Anders Carlsson.
3056 Optimize MemoryCache::getSessionMap() a bit by doing 1 HashMap lookup
3057 instead of previously 3. Also rename the method to sessionResources()
3058 as we usually don't use "get" prefix for getters.
3060 * loader/cache/MemoryCache.cpp:
3061 (WebCore::MemoryCache::sessionResources):
3062 (WebCore::MemoryCache::add):
3063 (WebCore::MemoryCache::revalidationSucceeded):
3064 (WebCore::MemoryCache::resourceForRequest):
3065 (WebCore::MemoryCache::removeImageFromCache):
3066 (WebCore::MemoryCache::remove):
3067 (WebCore::MemoryCache::getSessionMap): Deleted.
3068 * loader/cache/MemoryCache.h:
3070 2015-01-30 Chris Dumez <cdumez@apple.com>
3072 Store MemoryCache's live decoded resources in a ListHashSet
3073 https://bugs.webkit.org/show_bug.cgi?id=141051
3075 Reviewed by Antti Koivisto.
3077 Store MemoryCache's live decoded resources in a ListHashSet instead of
3078 a linked list. The frequent operations are:
3079 1. Add items to one end
3080 2. Remove items from the other end or anywhere in the container by value
3082 Using a ListHashSet instead of a manual linked list results in *much*
3083 simpler / shorter code and is fast for all operations (faster than
3084 linked list even for removing an given element from the container given
3085 its value). The previous implementation required us to keep a lot of
3086 pointers up-to-date, which was error prone.
3088 This is a first step towards simplifying the MemoryCache implementation.
3090 * loader/cache/CachedResource.cpp:
3091 (WebCore::CachedResource::CachedResource):
3092 (WebCore::CachedResource::setDecodedSize):
3093 (WebCore::CachedResource::didAccessDecodedData):
3094 * loader/cache/CachedResource.h:
3095 (WebCore::CachedResource::inLiveDecodedResourcesList): Deleted.
3096 * loader/cache/MemoryCache.cpp:
3097 (WebCore::MemoryCache::pruneLiveResourcesToSize):
3098 (WebCore::MemoryCache::removeFromLiveDecodedResourcesList):
3099 (WebCore::MemoryCache::insertInLiveDecodedResourcesList):
3100 * loader/cache/MemoryCache.h:
3101 (WebCore::MemoryCache::inLiveDecodedResourcesList):
3103 2015-01-30 Csaba Osztrogonác <ossy@webkit.org>
3105 [cairo] Fix #if guards in platform/graphics/cairo directory
3106 https://bugs.webkit.org/show_bug.cgi?id=141076
3108 Reviewed by Sergio Villar Senin.
3110 * platform/graphics/cairo/BackingStoreBackendCairo.h:
3111 * platform/graphics/cairo/BitmapImageCairo.cpp:
3112 * platform/graphics/cairo/CairoUtilities.cpp:
3113 * platform/graphics/cairo/CairoUtilities.h:
3114 * platform/graphics/cairo/DrawErrorUnderline.h:
3115 * platform/graphics/cairo/DrawingBufferCairo.cpp:
3116 * platform/graphics/cairo/FloatRectCairo.cpp:
3117 * platform/graphics/cairo/FontCairo.cpp:
3118 * platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
3119 * platform/graphics/cairo/FontCustomPlatformData.h:
3120 * platform/graphics/cairo/GradientCairo.cpp:
3121 * platform/graphics/cairo/GraphicsContext3DCairo.cpp:
3122 * platform/graphics/cairo/GraphicsContextCairo.cpp:
3123 * platform/graphics/cairo/GraphicsContextPlatformPrivateCairo.h:
3124 * platform/graphics/cairo/ImageBufferCairo.cpp:
3125 * platform/graphics/cairo/ImageBufferDataCairo.h:
3126 * platform/graphics/cairo/ImageCairo.cpp:
3127 * platform/graphics/cairo/IntRectCairo.cpp:
3128 * platform/graphics/cairo/OwnPtrCairo.cpp:
3129 * platform/graphics/cairo/OwnPtrCairo.h:
3130 * platform/graphics/cairo/PathCairo.cpp:
3131 * platform/graphics/cairo/PatternCairo.cpp:
3132 * platform/graphics/cairo/PlatformContextCairo.cpp:
3133 * platform/graphics/cairo/PlatformContextCairo.h:
3134 * platform/graphics/cairo/PlatformPathCairo.cpp:
3135 * platform/graphics/cairo/PlatformPathCairo.h:
3136 * platform/graphics/cairo/RefPtrCairo.cpp:
3137 * platform/graphics/cairo/RefPtrCairo.h:
3138 * platform/graphics/cairo/TileCairo.h:
3139 * platform/graphics/cairo/TransformationMatrixCairo.cpp:
3141 2015-01-29 Darin Adler <darin@apple.com>
3143 Remove SVGUseElement.instanceRoot and all tests that depend on it
3144 https://bugs.webkit.org/show_bug.cgi?id=141025
3146 Reviewed by Anders Carlsson.
3148 * svg/SVGUseElement.cpp:
3149 (WebCore::SVGUseElement::instanceRoot): Deleted.
3150 * svg/SVGUseElement.h: Removed instanceRoot.
3151 * svg/SVGUseElement.idl: Ditto.
3153 2015-01-29 Tim Horton <timothy_horton@apple.com>
3155 Fix the build with newer Clang.
3157 * platform/graphics/ca/GraphicsLayerCA.h:
3159 2015-01-29 Sam Weinig <sam@webkit.org>
3161 Try to fix the iOS build.
3165 2015-01-29 Brent Fulgham <bfulgham@apple.com>
3167 [Win] Build fix after r179368.
3169 * platform/graphics/win/UniscribeController.cpp:
3170 (WebCore::UniscribeController::shapeAndPlaceItem): Don't use the no longer
3171 valid isPrinterFont method.
3173 2015-01-29 Tim Horton <timothy_horton@apple.com>
3175 Fix the build after r179368
3177 * platform/graphics/FontDescription.h:
3178 (WebCore::FontDescription::equalForTextAutoSizing):
3180 2015-01-29 Simon Fraser <simon.fraser@apple.com>
3182 Border-radius clipping on a stacking context causes descendants to not render
3183 https://bugs.webkit.org/show_bug.cgi?id=140536
3185 Reviewed by Zalan Bujtas.
3187 Fix one of the issues introduced in r178029. The changes in GraphicsLayerCA
3188 failed to adhere to the "set a bit and flush later" pattern that this class uses,
3189 instead poking the platform layers directly. This caused an issue where the bounds
3190 of the clipping layer would later be set to 0x0, causing content to disappear.
3192 Fix by changing the "applyClippingBorder" function to "setMasksToBoundsRect"
3193 and have it update via a new MasksToBoundsRectChanged dirty bit.
3195 In order to avoid clobbering the mask layer used to clip contents, we need another
3196 shape mask layer, so rename m_shapeMaskLayer to m_contentsShapeMaskLayer, then
3197 introduce a new m_shapeMaskLayer which is used for masks-to-bounds clipping. Update
3198 the reflection cloning code to correctly clone this layer.
3200 Test: compositing/clipping/border-radius-stacking-context-clip.html
3203 * platform/graphics/GraphicsLayer.h:
3204 (WebCore::GraphicsLayer::maskToBoundsRect):
3205 (WebCore::GraphicsLayer::setMasksToBoundsRect):
3206 (WebCore::GraphicsLayer::applyClippingBorder): Deleted.
3207 (WebCore::GraphicsLayer::clearClippingBorder): Deleted.
3208 * platform/graphics/ca/GraphicsLayerCA.cpp:
3209 (WebCore::GraphicsLayerCA::willBeDestroyed):
3210 (WebCore::GraphicsLayerCA::setMasksToBoundsRect):
3211 (WebCore::GraphicsLayerCA::setContentsToSolidColor):
3212 (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
3213 (WebCore::GraphicsLayerCA::updateContentsImage):
3214 (WebCore::GraphicsLayerCA::updateContentsRects):
3215 (WebCore::GraphicsLayerCA::updateMasksToBoundsRect):
3216 (WebCore::GraphicsLayerCA::dumpAdditionalProperties):
3217 (WebCore::GraphicsLayerCA::applyClippingBorder): Deleted.
3218 (WebCore::GraphicsLayerCA::clearClippingBorder): Deleted.
3219 * platform/graphics/ca/GraphicsLayerCA.h:
3220 * rendering/RenderLayerBacking.cpp:
3221 (WebCore::RenderLayerBacking::updateChildClippingStrategy): Add a FIXME since
3222 this code is trying to access geometry and we may not have done layout yet.
3223 Also, to clear the rounded rect, just set a non-rounded rect the size of the layer.
3225 2015-01-29 Sam Weinig <sam@webkit.org>
3227 Remove support for screen font substitution
3228 https://bugs.webkit.org/show_bug.cgi?id=141038
3230 Reviewed by Tim Horton.
3232 - Removes the screen font substitution setting (which was only on in Mountain Lion)
3233 - Remove the concept of a printer font, from the family of Font related classes.
3236 * css/StyleResolver.cpp:
3237 (WebCore::StyleResolver::initializeFontStyle):
3238 * page/Settings.cpp:
3239 (WebCore::Settings::Settings):
3240 (WebCore::Settings::shouldEnableScreenFontSubstitutionByDefault): Deleted.
3241 (WebCore::Settings::setScreenFontSubstitutionEnabled): Deleted.
3243 (WebCore::Settings::screenFontSubstitutionEnabled): Deleted.
3244 * page/mac/SettingsMac.mm:
3245 (WebCore::Settings::shouldEnableScreenFontSubstitutionByDefault): Deleted.
3246 * platform/graphics/FontCache.h:
3247 (WebCore::FontDescriptionFontDataCacheKey::makeFlagKey):
3248 * platform/graphics/FontCascade.cpp:
3249 (WebCore::FontCascade::FontCascade):
3250 * platform/graphics/FontCascade.h:
3251 (WebCore::FontCascade::isPrinterFont): Deleted.
3252 * platform/graphics/FontDescription.h:
3253 (WebCore::FontDescription::FontDescription):
3254 (WebCore::FontDescription::setWeight):
3255 (WebCore::FontDescription::equalForTextAutoSizing):
3256 (WebCore::FontDescription::operator==):
3257 (WebCore::FontDescription::usePrinterFont): Deleted.
3258 (WebCore::FontDescription::setUsePrinterFont): Deleted.
3259 * platform/graphics/FontPlatformData.h:
3260 (WebCore::FontPlatformData::isCompositeFontReference):
3261 (WebCore::FontPlatformData::hash):
3262 (WebCore::FontPlatformData::operator==):
3263 (WebCore::FontPlatformData::isPrinterFont): Deleted.
3264 * platform/graphics/WidthIterator.h:
3265 (WebCore::WidthIterator::supportsTypesettingFeatures):
3266 * platform/graphics/cocoa/FontCascadeCocoa.mm:
3267 (WebCore::FontCascade::drawGlyphs):
3268 * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
3269 (WebCore::FontPlatformData::FontPlatformData):
3270 (WebCore::FontPlatformData::platformDataInit):
3271 (WebCore::FontPlatformData::platformDataAssign):
3272 * platform/graphics/ios/FontCacheIOS.mm:
3273 (WebCore::FontCache::getSystemFontFallbackForCharacters):
3274 (WebCore::FontCache::createFontPlatformData):
3275 * platform/graphics/ios/SimpleFontDataIOS.mm:
3276 (WebCore::Font::platformCreateScaledFont):
3277 * platform/graphics/mac/ComplexTextController.cpp:
3278 (WebCore::ComplexTextController::adjustGlyphsAndAdvances):
3279 * platform/graphics/mac/ComplexTextControllerCoreText.mm:
3280 (WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
3281 * platform/graphics/mac/FontCacheMac.mm:
3282 (WebCore::FontCache::systemFallbackForCharacters):
3283 (WebCore::FontCache::createFontPlatformData):
3284 * platform/graphics/mac/SimpleFontDataMac.mm:
3285 (WebCore::Font::compositeFontReferenceFont):
3286 (WebCore::Font::platformCreateScaledFont):
3287 * platform/mac/DragImageMac.mm:
3288 (WebCore::fontFromNSFont):
3289 (WebCore::widthWithFont):
3290 (WebCore::drawAtPoint):
3291 * style/StyleResolveForDocument.cpp:
3292 (WebCore::Style::resolveForDocument):
3294 2015-01-20 David Hyatt <hyatt@apple.com>
3296 Japanese line breaking rules need to be respected before and after Ruby.
3297 https://bugs.webkit.org/show_bug.cgi?id=91588
3298 <rdar://problem/17306535>
3300 Reviewed by Dean Jackson.
3302 Added fast/ruby/ruby-punctuation-avoid-breaking.html.
3304 This patch has to add support for following line breaking rules at both
3305 sides of a Ruby boundary. For breaking before a Ruby, unfortunately we
3306 just hard-code the rules (and apply this hard-coding only to Ruby and not
3307 to other inline replaced elements).
3309 For breaking after a Ruby we do better. The Ruby run caches its prior characters
3310 and line layout is able to obtain them and use them when deciding whether or not
3311 to break. This means for the "after" side of a Ruby, we're able to behave the same
3312 as if no Ruby was used.
3314 * rendering/RenderBlockFlow.h:
3315 (WebCore::RenderBlockFlow::cachePriorCharactersIfNeeded):
3316 * rendering/RenderBlockLineLayout.cpp:
3317 (WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):
3318 * rendering/RenderRubyBase.cpp:
3319 (WebCore::RenderRubyBase::cachePriorCharactersIfNeeded):
3320 * rendering/RenderRubyBase.h:
3321 * rendering/RenderRubyRun.cpp:
3322 (WebCore::RenderRubyRun::RenderRubyRun):
3323 (WebCore::RenderRubyRun::updatePriorContextFromCachedBreakIterator):
3324 (WebCore::RenderRubyRun::canBreakBefore):
3325 * rendering/RenderRubyRun.h:
3326 * rendering/RenderRubyText.cpp:
3327 (WebCore::RenderRubyText::canBreakBefore):
3328 * rendering/RenderRubyText.h:
3329 * rendering/line/BreakingContextInlineHeaders.h:
3330 (WebCore::BreakingContext::handleReplaced):
3331 (WebCore::BreakingContext::canBreakAtThisPosition):
3332 (WebCore::BreakingContext::commitAndUpdateLineBreakIfNeeded):
3334 2015-01-28 Beth Dakin <bdakin@apple.com>
3336 Remove more Mountain Lion code from WebCore
3337 https://bugs.webkit.org/show_bug.cgi?id=141014
3339 Reviewed by Anders Carlsson.
3342 * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3343 (AXAttributeStringSetSpelling):
3344 (AXAttributedStringAppendText):
3345 * crypto/CommonCryptoUtilities.h:
3346 * crypto/mac/CryptoAlgorithmAES_CBCMac.cpp:
3347 (WebCore::transformAES_CBC):
3348 * editing/cocoa/HTMLConverter.mm:
3350 * html/canvas/ANGLEInstancedArrays.cpp:
3351 (WebCore::ANGLEInstancedArrays::supported):
3352 * loader/cocoa/DiskCacheMonitorCocoa.mm:
3353 * page/mac/SettingsMac.mm:
3354 (WebCore::Settings::shouldEnableScreenFontSubstitutionByDefault):
3355 (WebCore::Settings::initializeDefaultFontFamilies):
3356 * platform/audio/mac/MediaSessionManagerMac.cpp:
3357 (MediaSessionManager::updateSessionState):
3358 * platform/cocoa/MemoryPressureHandlerCocoa.mm:
3359 (WebCore::MemoryPressureHandler::install):
3360 (WebCore::MemoryPressureHandler::ReliefLogger::platformLog):
3361 (WebCore::MemoryPressureHandler::ReliefLogger::platformMemoryUsage): Deleted.
3362 * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
3363 (WebCore::AVTrackPrivateAVFObjCImpl::languageForAVMediaSelectionOption):
3364 * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h:
3365 * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
3366 * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3367 (WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoLayer):
3368 (WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoOutput):
3369 * platform/graphics/cocoa/IOSurface.mm:
3371 (IOSurface::isVolatile):
3372 (IOSurface::setIsVolatile):
3373 * platform/graphics/mac/SimpleFontDataMac.mm:
3374 (WebCore::Font::platformInit):
3375 * platform/graphics/opengl/Extensions3DOpenGL.cpp:
3376 (WebCore::Extensions3DOpenGL::drawArraysInstanced):
3377 (WebCore::Extensions3DOpenGL::drawElementsInstanced):
3378 (WebCore::Extensions3DOpenGL::vertexAttribDivisor):
3379 * platform/mac/WebCoreSystemInterface.h:
3380 * platform/mac/WebCoreSystemInterface.mm:
3381 * platform/network/cf/ResourceHandleCFNet.cpp:
3382 (WebCore::ResourceHandle::createCFURLConnection):
3383 * platform/network/cocoa/ProtectionSpaceCocoa.h:
3384 (WebCore::ProtectionSpace::encodingRequiresPlatformData):
3385 * platform/network/cocoa/ProtectionSpaceCocoa.mm:
3386 (WebCore::ProtectionSpace::encodingRequiresPlatformData):
3387 * platform/network/mac/ResourceHandleMac.mm:
3388 (WebCore::ResourceHandle::createNSURLConnection):
3389 * platform/network/mac/WebCoreURLResponse.mm:
3390 (WebCore::synthesizeRedirectResponseIfNecessary):
3391 * platform/spi/cf/CFNetworkSPI.h:
3392 * platform/text/mac/LocaleMac.mm:
3393 (WebCore::LocaleMac::LocaleMac):
3395 2015-01-29 Benjamin Poulain <bpoulain@apple.com>
3397 Remove an extraneous check from the parser of :not()
3398 https://bugs.webkit.org/show_bug.cgi?id=141021
3400 Reviewed by Darin Adler.
3402 * css/CSSGrammar.y.in:
3403 :not() takes a selector list, it can be null if there selector list is invalid,
3404 but there cannot be a invalid pointer.
3406 2015-01-29 Tim Horton <timothy_horton@apple.com>
3408 Fix the iOS build after r179347
3410 * loader/FrameLoader.cpp:
3411 (WebCore::FrameLoader::commitProvisionalLoad):
3413 2015-01-29 Andreas Kling <akling@apple.com>
3415 JavaScript bindings constructors should take Ref<ImplType>&&.
3416 <https://webkit.org/b/140952>
3418 Reviewed by Darin Adler.
3420 When constructing a JS wrapper object, there is always going to be a
3421 corresponding DOM object.