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