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