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