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