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