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