Make WebCore::IOSurface have single ownership instead of refcounting
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2015-02-13  Timothy Horton  <timothy_horton@apple.com>
2
3         Make WebCore::IOSurface have single ownership instead of refcounting
4         https://bugs.webkit.org/show_bug.cgi?id=141578
5
6         Reviewed by Anders Carlsson.
7
8         In the interests of making it harder to misuse and to make it more like
9         ImageBuffer, our IOSurface wrapper should have single ownership.
10
11         This will also allow future changes which depend on temporarily
12         consuming an IOSurface to more easily enforce correct usage.
13
14         * WebCore.exp.in:
15         * platform/graphics/cg/IOSurfacePool.cpp:
16         (WebCore::IOSurfacePool::takeSurface):
17         (WebCore::IOSurfacePool::addSurface):
18         (WebCore::IOSurfacePool::insertSurfaceIntoPool):
19         (WebCore::IOSurfacePool::tryEvictInUseSurface):
20         (WebCore::IOSurfacePool::tryEvictOldestCachedSurface):
21         (WebCore::IOSurfacePool::collectInUseSurfaces):
22         * platform/graphics/cg/IOSurfacePool.h:
23         * platform/graphics/cocoa/IOSurface.h:
24         * platform/graphics/cocoa/IOSurface.mm:
25         (IOSurface::create):
26         (IOSurface::createFromSendRight):
27         (IOSurface::createFromSurface):
28         (IOSurface::createFromImage):
29         Make IOSurface::create()s return a unique_ptr, and adjust everywhere.
30
31 2015-02-12  Enrica Casucci  <enrica@apple.com>
32
33         Additional emoji group support.
34         https://bugs.webkit.org/show_bug.cgi?id=141539
35         rdar://problem/19727527
36
37         Reviewed by Sam Weinig.
38
39         Adding some new emoji ligatures.
40         Updated existing test to include the new sequences.
41
42         * platform/text/TextBreakIterator.cpp:
43         (WebCore::cursorMovementIterator):
44         * rendering/RenderText.cpp:
45         (WebCore::isEmojiGroupCandidate):
46
47 2015-02-13  Alex Christensen  <achristensen@webkit.org>
48
49         Really stop using export files.
50         https://bugs.webkit.org/show_bug.cgi?id=141521
51
52         Reviewed by Mark Rowe.
53
54         * Configurations/WebCore.xcconfig:
55         Don't use exported symbols files.
56         * Configurations/WebCore.unexp:
57         Added list of symbols not to export (needed by Xcode 5.0.2).
58
59 2015-02-13  Zalan Bujtas  <zalan@apple.com>
60
61         Simplify ASSERT in lastRubyRun().
62         https://bugs.webkit.org/show_bug.cgi?id=141574
63
64         Reviewed by Daniel Bates.
65
66         r180064 made some of the conditions in the ASSERT redundant.
67
68         Covered by existing tests.
69
70         * rendering/RenderRuby.cpp:
71         (WebCore::lastRubyRun):
72
73 2015-02-13  Brent Fulgham  <bfulgham@apple.com>
74
75         [Mac, iOS] Adjust pagination behavior for Mail.app printing use
76         https://bugs.webkit.org/show_bug.cgi?id=141569
77         <rdar://problem/14912763>
78
79         Reviewed by Anders Carlsson.
80
81         * page/Settings.in: Add new pagination setting flag.
82         * rendering/RenderBlockFlow.cpp:
83         (WebCore::messageContainerName): Added.
84         (WebCore::needsPaginationQuirk): Added.
85         (WebCore::RenderBlockFlow::adjustLinePositionForPagination): Don't move the message content
86         div to a new page when using this special printing mode.
87
88 2015-02-13  Daniel Bates  <dabates@apple.com>
89
90         [iOS] DumpRenderTree.app fails to link due to undefined classes
91         <rdar://problem/19831228>
92
93         Following r179945, DumpRenderTree.app fails to link due to undefined symbols:
94
95         Undefined symbols for architecture x86_64:
96           "_OBJC_CLASS_$_WebEvent", referenced from:
97               objc-class-ref in libDumpRenderTree.a(EventSendingController.o)
98           "_OBJC_CLASS_$_WebUndefined", referenced from:
99               objc-class-ref in libDumpRenderTree.a(ObjCController.o)
100
101         We need to export the classes WebScriptObject and WebEvent.
102
103         * bindings/objc/WebScriptObject.h:
104         * platform/ios/WebEvent.h:
105
106 2015-02-13  Andreas Kling  <akling@apple.com>
107
108         CachedResource::clearLoader() should self-destruct if nothing else retains the CachedResource.
109         <https://webkit.org/b/141568>
110         <rdar://problem/19800310>
111
112         Reviewed by Antti Koivisto.
113
114         Anything that may cause CachedResource::canDelete() to return true must also make sure
115         to call CachedResource::deleteIfPossible(), or we risk leaking the CachedResource.
116         This is because CachedResource employs an extremely convoluted lifetime mechanism that
117         depends on its presence in a number of collections, as well as internal counters and
118         state.
119
120         This is a speculative fix for a potential CachedResource leak that I'm not sure exists
121         in practice, but let's be good citizens here.
122
123         * loader/cache/CachedResource.cpp:
124         (WebCore::CachedResource::clearLoader):
125
126 2015-02-13  Jer Noble  <jer.noble@apple.com>
127
128         [MSE][Mac] Crash at WebCore::SourceBufferPrivateAVFObjC::didParseStreamDataAsAsset + 2357
129         https://bugs.webkit.org/show_bug.cgi?id=141566
130         rdar://problem/19826075
131
132         Reviewed by Andreas Kling.
133
134         Null check m_mediaSource before dereferencing.
135
136         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
137         (WebCore::SourceBufferPrivateAVFObjC::didParseStreamDataAsAsset):
138
139 2015-02-13  Zalan Bujtas  <zalan@apple.com>
140
141         REGRESSION (r174761): Invalid cast in WebCore::lastRubyRun / WebCore::RenderRubyAsBlock::addChild
142         https://bugs.webkit.org/show_bug.cgi?id=137929
143         rdar://problem/18723492
144
145         Reviewed by Chris Dumez.
146
147         Ensure that the child renderer is a RenderRubyRun.
148
149         Test: fast/ruby/crash-with-before-after-on-ruby.html
150
151         * rendering/RenderRuby.cpp:
152         (WebCore::lastRubyRun):
153
154 2015-02-13  Simon Fraser  <simon.fraser@apple.com>
155
156         Crashes under RenderLayer::hitTestLayer under determinePrimarySnapshottedPlugIn()
157         https://bugs.webkit.org/show_bug.cgi?id=141551
158
159         Reviewed by Zalan Bujtas.
160         
161         It's possible for a layout to dirty the parent frame's state, via the calls to
162         ownerElement()->scheduleSetNeedsStyleRecalc() that RenderLayerCompositor does when
163         iframes toggle their compositing mode.
164         
165         That could cause FrameView::updateLayoutAndStyleIfNeededRecursive() to fail to 
166         leave all the frames in a clean state. Later on, we could enter hit testing,
167         which calls document().updateLayout() on each frame's document. Document::updateLayout()
168         does layout on all ancestor documents, so in the middle of hit testing, we could
169         layout a subframe (dirtying an ancestor frame), then layout another frame, which
170         would forcing that ancestor to be laid out while we're hit testing it, thus
171         corrupting the RenderLayer tree while it's being iterated over.
172         
173         Fix by having FrameView::updateLayoutAndStyleIfNeededRecursive() do a second
174         layout after laying out subframes, which most of the time will be a no-op.
175         
176         Also add a stronger assertion, that this frame and all subframes are clean
177         at the end of FrameView::updateLayoutAndStyleIfNeededRecursive() for the
178         main frame.
179
180         Various existing frames tests hit the new assertion if the code change is removed,
181         so this is covered by existing tests.
182
183         * page/FrameView.cpp:
184         (WebCore::FrameView::needsStyleRecalcOrLayout):
185         (WebCore::FrameView::updateLayoutAndStyleIfNeededRecursive):
186         * page/FrameView.h:
187         * rendering/RenderWidget.cpp:
188         (WebCore::RenderWidget::willBeDestroyed):
189
190 2015-02-12  Simon Fraser  <simon.fraser@apple.com>
191
192         determinePrimarySnapshottedPlugIn() should only traverse visible Frames
193         https://bugs.webkit.org/show_bug.cgi?id=141547
194         Part of rdar://problem/18445733.
195
196         Reviewed by Anders Carlsson.
197
198         There's an expectation from clients that FrameView::updateLayoutAndStyleIfNeededRecursive()
199         updates layout in all frames, but it uses the widget tree, so only hits frames
200         that are parented via renderers (i.e. not display:none frames or their descendants).
201         
202         Moving towards a future where we remove Widgets, fix by adding a FrameTree 
203         traversal function that only finds rendered frames (those with an ownerRenderer).
204         
205         Not testable.
206
207         * page/FrameTree.cpp:
208         (WebCore::FrameTree::firstRenderedChild):
209         (WebCore::FrameTree::nextRenderedSibling):
210         (WebCore::FrameTree::traverseNextRendered):
211         (printFrames):
212         * page/FrameTree.h:
213         * page/FrameView.cpp:
214         (WebCore::FrameView::updateLayoutAndStyleIfNeededRecursive):
215
216 2015-02-13  Alexey Proskuryakov  <ap@apple.com>
217
218         TimerBase::m_heapInsertionOrder calculation is racy
219         https://bugs.webkit.org/show_bug.cgi?id=141554
220
221         Reviewed by Anders Carlsson.
222
223         Use an atomic increment.
224
225         * platform/Timer.cpp: (WebCore::TimerBase::setNextFireTime):
226
227 2015-02-13  Andreas Kling  <akling@apple.com>
228
229         [iOS] Refine GC behavior in response to process suspension and memory pressure.
230         <https://webkit.org/b/141543>
231         <rdar://problem/19738024>
232
233         Reviewed by Geoffrey Garen.
234
235         Do an immediate full garbage collection when the web process is about to
236         be suspended (when another tab is moving to the foreground on iOS.)
237         This ensures that we make a best effort to reduce the process footprint
238         before we lose the ability to execute code.
239
240         When receiving a memory pressure warning, tell the garbage collector to
241         accelerate its next collection (by calling garbageCollectSoon().)
242         This gives us some confidence that a collection will happen within a
243         reasonable timeframe, but doesn't risk dooming us to a loop of endless
244         garbage collections.
245
246         * platform/cocoa/MemoryPressureHandlerCocoa.mm:
247         (WebCore::MemoryPressureHandler::platformReleaseMemory):
248
249 2015-02-13  Antti Koivisto  <antti@apple.com>
250
251         Add some RELEASE_ASSERTs to try to catch crashes in StyleResolver::loadPendingImages
252         https://bugs.webkit.org/show_bug.cgi?id=141561
253
254         Reviewed by Simon Fraser.
255
256         One possibility is that loads triggered by loadPendingImages end up synchronously destroying or re-entering
257         style resolver. Try to catch these in release builds.
258
259         * css/StyleResolver.cpp:
260         (WebCore::StyleResolver::~StyleResolver):
261         (WebCore::StyleResolver::styleForElement):
262         (WebCore::StyleResolver::styleForKeyframe):
263         (WebCore::StyleResolver::styleForPage):
264         (WebCore::StyleResolver::loadPendingImages):
265         * css/StyleResolver.h:
266
267 2015-02-13  ChangSeok Oh  <changseok.oh@collabora.com>
268
269         Div having contentEditable and display:grid cannot be edited if it is empty.
270         https://bugs.webkit.org/show_bug.cgi?id=141465
271
272         Reviewed by Ryosuke Niwa.
273
274         This bug is quite similar to webkit.org/b/141218. RenderGrid should be also treated as a candidate
275         for visible position as like RenderFlexibleBox. The only different situation between them is
276         that RenderGrid has a bug setting "0px" for logicalHeight when it is empty. RenderGrid should also have
277         a minimum height of a single line if it is editable as well as RenderFlexibleBox does.
278
279         Test: fast/events/key-events-in-editable-gridbox.html
280
281         * dom/Position.cpp:
282         (WebCore::Position::isCandidate):
283         (WebCore::Position::isRenderedCharacter):
284         * rendering/RenderGrid.cpp:
285         (WebCore::RenderGrid::layoutGridItems):
286
287 2015-02-12  Zalan Bujtas  <zalan@apple.com>
288
289         REGRESSION (r176262): Invalid cast in WebCore`WebCore::RootInlineBox::selectionTop
290         https://bugs.webkit.org/show_bug.cgi?id=138992
291
292         Reviewed by Dave Hyatt.
293
294         RenderRubyText requires the ancestor chain to be (RenderRubyAsInline | RenderRubyAsBlock) -> RenderRubyRun -> RenderRubyText.
295         This patch ensures that we create RenderRubyText for an <rt> element only when
296         the expected ancestor chain is guaranteed.
297
298         Test: fast/ruby/crash-when-ruby-is-set-to-inline-block.html
299
300         * rendering/RenderElement.cpp:
301         (WebCore::RenderElement::createFor): treat inline-block <ruby> as block.
302         * rendering/RenderObject.h:
303         (WebCore::RenderObject::isRubyInline):
304         (WebCore::RenderObject::isRubyBlock):
305         (WebCore::RenderObject::isRuby): Deleted.
306         * rendering/RenderRuby.cpp:
307         (WebCore::isAnonymousRubyInlineBlock):
308         * rendering/RenderRuby.h: add support for is<RenderRubyAsBlock>(renderer) and for is<RenderRubyAsInline>(renderer)
309         The isRuby() method does not follow the is*() -> maps to one class pattern.
310         (WebCore::isRuby):
311         * rendering/RenderRubyRun.cpp:
312         (WebCore::RenderRubyRun::addChild):
313         (WebCore::RenderRubyRun::staticCreateRubyRun):
314
315 2015-02-13  Csaba Osztrogonac  <ossy@webkit.org>
316
317         Fix the gperf related build issue on the WinCairo bot
318         https://bugs.webkit.org/show_bug.cgi?id=141507
319
320         Reviewed by Alex Christensen.
321
322         * platform/ColorData.gperf: Modified property svn:eol-style.
323
324 2015-02-13  Csaba Osztrogonác  <ossy@webkit.org>
325
326         Unreviewed, remove empty directories.
327
328         * loader/icon/wince: Removed.
329         * platform/graphics/wince: Removed.
330         * storage/wince: Removed.
331
332 2015-02-12  Timothy Horton  <timothy_horton@apple.com>
333
334         Crashes under detectItemAroundHitTestResult when DataDetectors is not available
335         https://bugs.webkit.org/show_bug.cgi?id=141549
336         <rdar://problem/19180955>
337
338         Reviewed by Dan Bernstein.
339
340         * editing/mac/DataDetection.mm:
341         (WebCore::DataDetection::detectItemAroundHitTestResult):
342         Bail out from data detection if either of the relevant frameworks aren't loaded.
343
344 2015-02-12  Dean Jackson  <dino@apple.com>
345
346         [iOS Media] Audio should hide timeline scrubber until playback starts
347         https://bugs.webkit.org/show_bug.cgi?id=141542
348         <rdar://problem/19820685>
349
350         Reviewed by Eric Carlson.
351
352         We regressed from the system behaviour in iOS 7, where the timeline
353         scrubber for an audio element is not shown until the user starts
354         playback.
355
356         * Modules/mediacontrols/mediaControlsiOS.css:
357         (video::-webkit-media-controls-panel): Fix the alignment of the flexbox.
358         (audio::-webkit-media-controls-status-display): Add the style for the status display.
359         * Modules/mediacontrols/mediaControlsiOS.js:
360         (ControllerIOS.prototype.configureInlineControls): Start hidden if we are an <audio>.
361         (ControllerIOS.prototype.configureFullScreenControls): Drive by comment change.
362         (ControllerIOS.prototype.setPlaying): Unhide the timeline.
363
364 2015-02-12  Chris Dumez  <cdumez@apple.com>
365
366         Drop the quirks-mode exception for CSS MIME types
367         https://bugs.webkit.org/show_bug.cgi?id=141501
368
369         Reviewed by Alexey Proskuryakov.
370
371         Drop the quirks-mode exception for CSS MIME types.
372         This matches Firefox's behavior.
373
374         This patch is based on the following Blink revision:
375         http://src.chromium.org/viewvc/blink?view=revision&revision=189669
376
377         Tests:
378         - http/tests/misc/css-accept-any-type.html
379         - http/tests/security/cross-origin-css.html
380
381         * css/StyleSheetContents.cpp:
382         (WebCore::StyleSheetContents::parseAuthorStyleSheet):
383         * dom/ProcessingInstruction.cpp:
384         (WebCore::ProcessingInstruction::setCSSStyleSheet):
385         * inspector/InspectorPageAgent.cpp:
386         (WebCore::InspectorPageAgent::cachedResourceContent):
387         * loader/cache/CachedCSSStyleSheet.cpp:
388         (WebCore::CachedCSSStyleSheet::sheetText):
389         (WebCore::CachedCSSStyleSheet::canUseSheet):
390         * loader/cache/CachedCSSStyleSheet.h:
391
392 2015-02-12  Beth Dakin  <bdakin@apple.com>
393
394         REGRESSION: Should not send wheel events with a delta of 0
395         https://bugs.webkit.org/show_bug.cgi?id=141537
396         -and corresponding-
397         rdar://problem/18903118
398
399         Reviewed by Simon Fraser.
400
401         This code should not have been removed entirely to accommodate rubber-banding, it 
402         just needs to return false instead of true in order to allow the MayBegin and 
403         Ended phases to be handled by the ElasticityController.
404         * dom/Element.cpp:
405         (WebCore::Element::dispatchWheelEvent):
406
407 2015-02-12  Dean Jackson  <dino@apple.com>
408
409         [iOS Media] Implement 3-style media timeline (buffered, played, unavailable)
410         https://bugs.webkit.org/show_bug.cgi?id=141526
411         <rdar://problem/19603337>
412
413         Reviewed by Eric Carlson and Antoine Quint.
414
415         Implement a 3-style media scrubber for iOS. This draws white for
416         the region that has been played (before the playhead), black
417         for the region that is buffered, and is hollow for the rest.
418
419         * Modules/mediacontrols/mediaControlsApple.js:
420         (Controller.prototype.updateProgress): Update progress is now completely
421         shared between OS X and iOS. This calls the implementation specific
422         drawTimelineBackground.
423         (Controller.prototype.drawTimelineBackground): Move the OS X code to here.
424         * Modules/mediacontrols/mediaControlsiOS.css:
425         (audio::-webkit-media-controls-timeline): New styles for the timeline. Updated thumb image, etc.
426         (video::-webkit-media-controls-timeline::-webkit-slider-runnable-track):
427         (audio::-webkit-media-controls-timeline::-webkit-slider-thumb):
428         (audio::-webkit-media-controls-timeline::-webkit-slider-thumb:active):
429         (video::-webkit-media-controls-time-remaining-display):
430         * Modules/mediacontrols/mediaControlsiOS.js:
431         (ControllerIOS): Create a globally unique canvas context name in the constructor.
432         (ControllerIOS.prototype.createControls): Set the background of the timeline to a canvas.
433         (ControllerIOS.prototype.addRoundedRect): Helper function.
434         (ControllerIOS.prototype.drawTimelineBackground): Draw the 3-style content.
435         (ControllerIOS.prototype.updateProgress): Deleted.
436
437 2015-02-12  Daniel Bates  <dabates@apple.com>
438
439         Fix some Mac linker warnings
440         https://bugs.webkit.org/show_bug.cgi?id=141522
441
442         Reviewed by Alex Christensen.
443
444         Following <https://trac.webkit.org/changeset/179945>, the linker warns about the following hidden WebCore symbols:
445         
446         ld: warning: cannot export hidden symbol __ZN7WebCore20LogNotYetImplementedE from /.../OpenSource/WebKitBuild/WebCore.build/Debug/WebCore.build/Objects-normal/x86_64/Logging.o
447         ld: warning: cannot export hidden symbol _wkCreateURLPasteboardFlavorTypeName from /.../OpenSource/WebKitBuild/WebCore.build/Debug/WebCore.build/Objects-normal/x86_64/WebCoreSystemInterface.o
448         ld: warning: cannot export hidden symbol _wkCreateURLNPasteboardFlavorTypeName from /.../OpenSource/WebKitBuild/WebCore.build/Debug/WebCore.build/Objects-normal/x86_64/WebCoreSystemInterface.o
449
450         * WebCore.exp.in: Remove symbols for functions wkCreateURLPasteboardFlavorTypeName and wkCreateURLNPasteboardFlavorTypeName.
451         * platform/Logging.h: Export WTFLogChannel for LogNotYetImplemented, which is referenced from
452         notImplementedLoggingChannel() in file NotImplemented.cpp. We make use of the associated
453         header, NotImplemented.h, in both WebKit and WebKit2.
454         * platform/mac/WebCoreSystemInterface.mm: Remove declarations for functions
455         wkCreateURLPasteboardFlavorTypeName and wkCreateURLNPasteboardFlavorTypeName that
456         were inadvertently not removed in r25494.
457
458 2015-02-12  Joseph Pecoraro  <pecoraro@apple.com>
459
460         Web Inspector: Crash inspecting styles of element with mutated stylesheet
461         https://bugs.webkit.org/show_bug.cgi?id=141451
462
463         Reviewed by Timothy Hatcher.
464
465         Test: inspector/css/stylesheet-with-mutations.html
466
467         * css/CSSStyleSheet.h:
468         * css/CSSStyleSheet.cpp:
469         (WebCore::CSSStyleSheet::CSSStyleSheet):
470         (WebCore::CSSStyleSheet::didMutateRules):
471         Keep a flag on the CSSStyleSheet to know when it has had a rule
472         mutation from the contents.
473
474         * inspector/InspectorStyleSheet.h:
475         * inspector/InspectorStyleSheet.cpp:
476         (WebCore::InspectorStyleSheet::reparseStyleSheet):
477         When completely replacing the stylesheet's contents, we will have
478         destroyed any previous rules, so clear the has mutations flag.
479
480         (WebCore::selectorsFromSource):
481         Previously there was a mismatch between the rules the parsed
482         SourceData had, and the actual CSSSelectors we were iterating.
483         We use the SourceData so we can get the exact user authored
484         text instead of generated longhands from actualy selector objects.
485         Add an ASSERT and bail to catch and more gracefully handle
486         any possible mismatches in the future.
487
488         (WebCore::InspectorStyleSheet::styleSheetMutated):
489         (WebCore::InspectorStyleSheet::ensureParsedDataReady):
490         When a CSSStyleSheet has been mutated beyond the inspector's
491         knowledge right now, fall back to readonly generated selectors.
492         We should better handle this in the future:
493         <https://webkit.org/b/141450> Web Inspector: Better support for CSSOM StyleSheet mutations (insertRule/deleteRule)
494
495 2015-02-12  Commit Queue  <commit-queue@webkit.org>
496
497         Unreviewed, rolling out r179987.
498         https://bugs.webkit.org/show_bug.cgi?id=141525
499
500         caused debug tests to fail (Requested by alexchristensen on
501         #webkit).
502
503         Reverted changeset:
504
505         "[CSS Grid Layout] Invalid initialization of track sizes with
506         non spanning grid items"
507         https://bugs.webkit.org/show_bug.cgi?id=140763
508         http://trac.webkit.org/changeset/179987
509
510 2015-02-12  Brian J. Burg  <burg@cs.washington.edu>
511
512         REGRESSION(r178060): empty arguments are passed when logging to system console
513         https://bugs.webkit.org/show_bug.cgi?id=141511
514
515         Reviewed by Timothy Hatcher.
516
517         * page/PageConsoleClient.cpp:
518         (WebCore::PageConsoleClient::messageWithTypeAndLevel): Change premature move to copyRef.
519
520 2015-02-12  Alex Christensen  <achristensen@webkit.org>
521
522         [Win] Unreviewed debug build fix after r179980.
523
524         * svg/SVGSVGElement.cpp:
525         (WebCore::SVGSVGElement::currentViewportSize):
526         Explicitly call constructor.
527
528 2015-01-23  Sergio Villar Senin  <svillar@igalia.com>
529
530         [CSS Grid Layout] Invalid initialization of track sizes with non spanning grid items
531         https://bugs.webkit.org/show_bug.cgi?id=140763
532
533         Reviewed by Antti Koivisto.
534
535         Content sized tracks with non-spanning grid items were not
536         properly sized because the growth limit was sometimes infinity
537         (-1) after calling resolveContentBasedTrackSizingFunctions() when
538         it should not. This patch adds an special initialization phase for
539         non-spanning grid items as the new track sizing algorithm
540         describes.
541
542         Granted, that was handled in the old algorithm in
543         distributeSpaceToTracks() as a special case. The problem is that
544         it regressed after the optimization added in r173868 because that
545         method is no longer called when the space to distribute is 0.
546
547         That's why we could fix this by allowing calls to
548         distributeSpaceToTracks() with spaceToDistribute>=0 but by fixing
549         it with an explicit initialization our implementation becomes
550         closer to the new algorithm and the initialization is now explicit
551         in the code instead of a side effect of calling
552         distributeSpaceToTracks() with no space to be distributed. It also
553         brings a slight performance improvement as we save sorts and hash
554         lookups.
555
556         I also took the change to add caching to several GridTrackSize
557         methods that were hot on the profiler (each one accounted for ~1%
558         of the total time, now they account for ~0.3% each).
559
560         Test: fast/css-grid-layout/grid-initialize-span-one-items.html
561
562         * rendering/RenderGrid.cpp:
563         (WebCore::GridItemWithSpan::span): New helper method for ASSERTs.
564         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctions):
565         Exclude non spanning grid items from the calls to
566         resolveContentBasedTrackSizingFunctionsForItems().
567         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForNonSpanningItems):
568         New method to resolve track sizes only using non-spanning grid
569         items.
570         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForItems):
571         Ensure that it isn't called for non-spanning grid items.
572         * rendering/RenderGrid.h:
573         * rendering/style/GridTrackSize.h:
574         (WebCore::GridTrackSize::GridTrackSize): Cache return values.
575         (WebCore::GridTrackSize::setLength): Ditto.
576         (WebCore::GridTrackSize::setMinMax): Ditto.
577         (WebCore::GridTrackSize::cacheMinMaxTrackBreadthTypes): New method
578         that caches the return values for hasXXXTrackBreadth() methods.
579         (WebCore::GridTrackSize::hasMinOrMaxContentMinTrackBreadth): Use
580         the cached return value.
581         (WebCore::GridTrackSize::hasMaxContentMaxTrackBreadth): Ditto.
582         (WebCore::GridTrackSize::hasMinContentMaxTrackBreadth): Ditto.
583         (WebCore::GridTrackSize::hasMinOrMaxContentMaxTrackBreadth): Ditto.
584         (WebCore::GridTrackSize::hasMaxContentMinTrackBreadth): Ditto.
585         (WebCore::GridTrackSize::hasMinContentMinTrackBreadth): Ditto.
586         (WebCore::GridTrackSize::hasMinContentMinTrackBreadthAndMinOrMaxContentMaxTrackBreadth):
587         Ditto.
588         (WebCore::GridTrackSize::hasMaxContentMinTrackBreadthAndMaxContentMaxTrackBreadth):
589         Ditto.
590
591 2015-02-12  Zan Dobersek  <zdobersek@igalia.com>
592
593         Remove the USE(ACCELERATED_COMPOSITING) guard from the
594         MediaPlayerPrivateGStreamerBase destructor.
595
596         The guard was removed in r163079. It was still defined through CMake
597         for the EFL and GTK ports when the guarded code was introduced in
598         r172828. In r171741 the macro was finally removed for the GTK and EFL
599         ports as well, but the guards for the affected code weren't updated
600         so TextureMapperPlatformLayer::Client::platformLayerWillBeDestroyed()
601         wasn't being called anymore.
602
603         Rubber-stamped by Philippe Normand.
604
605         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
606         (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
607
608 2015-02-11  Darin Adler  <darin@apple.com>
609
610         Streamline and simplify SVGSVGElement and related classes
611         https://bugs.webkit.org/show_bug.cgi?id=141463
612
613         Reviewed by Antti Koivisto.
614
615         * dom/Document.cpp: Removed unneeded include of SVGSVGElement.h.
616         * loader/FrameLoader.cpp: Ditto.
617         * rendering/RenderBoxModelObject.cpp: Ditto.
618         * rendering/svg/RenderSVGForeignObject.cpp: Ditto.
619         * svg/SVGImageElement.cpp: Ditto.
620         * svg/SVGMarkerElement.cpp: Ditto.
621         * svg/SVGPathElement.cpp: Ditto.
622         * svg/SVGPatternElement.cpp: Ditto.
623         * svg/SVGTransform.cpp: Ditto.
624
625         * page/FrameView.cpp:
626         (WebCore::FrameView::scrollToAnchor): Updated to call the SVGSVGElement function
627         named scrollToAnchor (was setupInitialView). Also refactored to avoid repeating
628         the expression frame().document() so often.
629
630         * platform/graphics/FloatSize.h: Added operator/.
631
632         * svg/SVGDocument.cpp:
633         (WebCore::SVGDocument::rootElement): Rearranged to use early return.
634         (WebCore::SVGDocument::zoomAndPanEnabled): Ditto.
635         (WebCore::SVGDocument::startPan): Ditto. Also used FloatPoint math instead
636         of breaking things apart into x and y.
637         (WebCore::SVGDocument::updatePan): Ditto.
638
639         * svg/SVGDocument.h: Removed some unneeded includes and forward declarations.
640         Moved function bodies out of the class to make it more readable. Renamed
641         m_translate to m_panningOffset and made it a FloatSize instead of FloatPoint.
642
643         * svg/SVGDocumentExtensions.cpp:
644         (WebCore::SVGDocumentExtensions::startAnimations): Use a modern for loop
645         and update since timeContainer() now returns a reference.
646
647         * svg/SVGSVGElement.cpp: Removed many unneeded includes.
648         (WebCore::SVGSVGElement::SVGSVGElement): Moved initialization of scalars to
649         the class definition. Updated since m_timerContainer is a Ref (later should
650         change it to be a std::unique_ptr or just directly contained in SVGSVGElement).
651         (WebCore::SVGSVGElement::~SVGSVGElement): Removed comment that doesn't say much,
652         but is worded in a confusing way.
653         (WebCore::SVGSVGElement::contentScriptType): Use NeverDestroyed instead of
654         DEPRECATED_DEFINE_STATIC_LOCAL.
655         (WebCore::SVGSVGElement::contentStyleType): Ditto.
656         (WebCore::SVGSVGElement::viewport): Streamlined a bit.
657         (WebCore::SVGSVGElement::pixelUnitToMillimeterX): Ditto.
658         (WebCore::SVGSVGElement::pixelUnitToMillimeterY): Ditto.
659         (WebCore::SVGSVGElement::currentView): Changed to return a reference.
660         (WebCore::SVGSVGElement::frameForCurrentScale): Added. Helper for the two
661         functions below.
662         (WebCore::SVGSVGElement::currentScale): Updated to use frameForCurrentScale.
663         (WebCore::SVGSVGElement::setCurrentScale): Ditto.
664         (WebCore::SVGSVGElement::setCurrentTranslate): Optimized the case where there
665         is no change to the translation. Also changed the data member's name to
666         m_currentTranslate to more directly match the DOM API naming.
667         (WebCore::SVGSVGElement::parseAttribute): Simplified the parsing a bit, and
668         changed to pass a reference to SVGZoomAndPan::parseAttribute.
669         (WebCore::SVGSVGElement::svgAttributeChanged): Tweaked formatting and removed
670         code that converts the renderer pointer to a RenderObject* unnecessarily.
671         (WebCore::SVGSVGElement::suspendRedraw): Removed FIXME about implementing this,
672         since we don't really plan to do that.
673         (WebCore::SVGSVGElement::unsuspendRedraw): Ditto.
674         (WebCore::SVGSVGElement::unsuspendRedrawAll): Ditto.
675         (WebCore::SVGSVGElement::forceRedraw): Ditto.
676         (WebCore::SVGSVGElement::collectIntersectionOrEnclosureList): Changed return
677         type to Ref, and pass in a function instead of an enumeration value.
678         (WebCore::SVGSVGElement::getIntersectionList): Updated for above.
679         (WebCore::SVGSVGElement::getEnclosureList): Ditto.
680         (WebCore::SVGSVGElement::checkIntersection): Use && instead of early return
681         for the null check.
682         (WebCore::SVGSVGElement::checkEnclosure): Ditto.
683         (WebCore::SVGSVGElement::createSVGLength): Use initialization list syntax
684         for greater brevity.
685         (WebCore::SVGSVGElement::createSVGAngle): Ditto.
686         (WebCore::SVGSVGElement::createSVGPoint): Ditto.
687         (WebCore::SVGSVGElement::createSVGMatrix): Ditto.
688         (WebCore::SVGSVGElement::createSVGRect): Ditto.
689         (WebCore::SVGSVGElement::createSVGTransform): Removed unneeded explicit
690         constructor invocation.
691         (WebCore::SVGSVGElement::createSVGTransformFromMatrix): Removed unneeded cast.
692         (WebCore::SVGSVGElement::insertedInto): Updated since timeContainer() now
693         returns a reference.
694         (WebCore::SVGSVGElement::setCurrentTime): Use isfinite instead of isnan, so
695         we won't store infinity as the current time.
696         (WebCore::SVGSVGElement::currentViewBoxRect): Renamed locals and changed
697         to use initializer lists for brevity.
698         (WebCore::SVGSVGElement::currentViewportSize): Streamlined code by using
699         initializer lists, using local variables only for things used more than once,
700         and using the / operator defined above.
701         (WebCore::SVGSVGElement::viewBoxToViewTransform): Use the concatenate function
702         in a way that is more straightforward, rather than doing it with a temporary.
703         (WebCore::SVGSVGElement::scrollToAnchor): Renamed this from
704         setupInitialView.
705         (WebCore::SVGSVGElement::inheritViewAttributes): Changed this to work with
706         references rather than pointers.
707         (WebCore::SVGSVGElement::getElementById): Use getAllElementsById as the
708         FIXME comment suggested for better efficiency when there are a lot of descendants
709         of the <svg> element at the cost of making it less efficient if there are
710         a lot of elements all with the desired ID, but not inside the <svg> element.
711         (WebCore::SVGSVGElement::isValid): Moved here from the header.
712
713         * svg/SVGSVGElement.h: Removed unneeded forward declarations. Moved the
714         animated properties to the top of the file, then other DOM, the other
715         public members. Changed return types to references and Ref. Moved
716         function bodies out of the class definition. Made createSVGNumber inline.
717
718         * svg/SVGViewElement.cpp: Removed unneeded includes.
719         (WebCore::SVGViewElement::isSupportedAttribute): Deleted.
720         (WebCore::SVGViewElement::parseAttribute): Changed to not rely on
721         isSupportedAttribute. Eventually I will do this in all the SVG classes.
722
723         * svg/SVGViewSpec.cpp: Removed unneeded include of SVGSVGElement.h.
724         (WebCore::SVGViewSpec::parseViewSpec): Updated for change in the name
725         of the parse function in the SVGZoomAndPan class.
726
727         * svg/SVGZoomAndPan.cpp:
728         (WebCore::SVGZoomAndPan::isKnownAttribute): Deleted.
729         (WebCore::SVGZoomAndPan::addSupportedAttributes): Deleted.
730         (WebCore::SVGZoomAndPan::parse): Renamed from parseZoomAndPan since
731         this is a member of the SVGZoomAndPan class and also has an argument
732         of SVGZoomAndPanType.
733         (WebCore::SVGZoomAndPan::parseAttributeValue): Added. Helper so the
734         template function is not so big. Also write it in a simpler way.
735         (WebCore::SVGZoomAndPan::ref): Deleted.
736         (WebCore::SVGZoomAndPan::deref): Deleted.
737         (WebCore::SVGZoomAndPan::setZoomAndPan): Deleted.
738
739         * svg/SVGZoomAndPan.h: Removed unneeded includes. Reformatted the enum.
740         Moved function bodies out of the class definition. Removed many unneeded
741         functions.
742
743         * svg/animation/SVGSMILElement.cpp:
744         (WebCore::SVGSMILElement::insertedInto): Updated since timeContainer
745         now returns a reference rather than a pointer.
746
747 2015-02-11  Darin Adler  <darin@apple.com>
748
749         SVGUseElement follow-up improvements
750         https://bugs.webkit.org/show_bug.cgi?id=141382
751
752         Reviewed by Antti Koivisto.
753
754         * loader/cache/CachedSVGDocumentClient.h: Removed unneeded forward declaration.
755
756         * page/EventHandler.cpp: Removed unneeded include of SVGUseElement.h.
757         * rendering/svg/RenderSVGViewportContainer.cpp: Ditto.
758
759         * svg/SVGDocumentExtensions.cpp:
760         (WebCore::SVGDocumentExtensions::clearTargetDependencies): Removed too-specific
761         check that assumed that SVG elements in shadow trees are always for <use> elements.
762         This amounted to an unneeded optimization that could be removed with no bad effect.
763
764         * svg/SVGElement.cpp:
765         (WebCore::SVGElement::correspondingElement): Removed the assertions so this could
766         be used more freely outside of cases where the shadow tree state is fully consistent.
767         It's fine to have this just be a mechanical getter; there's nothing super-tricky
768         here that needs to be caught by the assertion.
769         (WebCore::SVGElement::title): Removed unneeded special handling for titles inside
770         the shadow tree.
771
772         * svg/SVGGElement.cpp:
773         (WebCore::SVGGElement::create): Added an overload that doesn't require explicitly
774         passing in the tag name.
775         * svg/SVGGElement.h: Ditto.
776         * svg/SVGSVGElement.cpp:
777         (WebCore::SVGSVGElement::create): Ditto.
778         * svg/SVGSVGElement.h: Ditto.
779
780         * svg/SVGUseElement.cpp: Removed a lot of unneeded includes.
781         (WebCore::SVGUseElement::SVGUseElement): Removed code to initialize some booleans.
782         We do that in the class definition now.
783         (WebCore::SVGUseElement::create): Removed the code that calls the
784         ensureUserAgentShadowRoot function unconditionally. That's properly done when
785         needed; no need to do it here.
786         (WebCore::SVGUseElement::~SVGUseElement): Removed unneeded code to destroy the
787         shadow tree (that happens automatically) and simplified the code to stop loading
788         the external document.
789         (WebCore::SVGUseElement::isSupportedAttribute): Deleted.
790         (WebCore::SVGUseElement::parseAttribute): Simplified this. Removed assumptions
791         about the intersection of various sets of attributes, and also removed the
792         isSupportedAttribute function. This seems to serve no purpose here, or in any
793         other SVG element class. I plan to remove it everywhere over time.
794         (WebCore::isWellFormedDocument): Deleted.
795         (WebCore::SVGUseElement::insertedInto): Simplified code by removing all the
796         special cases during initial parsing, and did the invalidation here rather than
797         deferring it to didNotifySubtreeInsertions. Added a call to the new function,
798         updateExternalDocument, since that won't do anything when the element is not
799         in a document.
800         (WebCore::SVGUseElement::didNotifySubtreeInsertions): Deleted.
801         (WebCore::SVGUseElement::removedFrom): Added code to call clearShadowTree and
802         updateExternalDocument. Both are efficient when doing nothing, and both are
803         appropriate since the element is no longer in a document.
804         (WebCore::SVGUseElement::referencedDocument): Deleted. No longer needed.
805         (WebCore::SVGUseElement::externalDocument): Streamlined the logic here, removing
806         multiple unneeded checks.
807         (WebCore::SVGUseElement::transferSizeAttributesToTargetClone): Renamed since
808         "target clone" is clear enough within this class, without explicitly stating
809         "shadow tree". All the clones are in the shadow tree.
810         (WebCore::SVGUseElement::svgAttributeChanged): Removed unneeded code calling
811         isSupportedAttribute. Changed the code that detects changes in href to just
812         call updateExternalDocument (for the document URL) and invalidateShadowTree
813         (for the fragment). Also updated the transferSizeAttributesToTargetClone logic
814         to only trigger on width and height and updated names.
815         (WebCore::SVGUseElement::willAttachRenderers): Updated for the new name of
816         m_shouldRebuildShadowTree and added a call through to the base class.
817         (WebCore::createAllowedElementSet): Added. A more efficient way to implement
818         the initialization of the set for isDisallowedElement.
819         (WebCore::isDisallowedElement): Simplified this by using the function above,
820         and also overloaded for both SVGElement and Element for a tiny efficiency boost.
821         (WebCore::SVGUseElement::clearShadowTree): Renamed form clearResourceReferences.
822         This is a much more straightforward name. Also deleted the code that sets the
823         m_needsShadowTreeRecreation flag to false. That should be done by the build
824         function, not here.
825         (WebCore::SVGUseElement::buildPendingResource): Made this just invalidate the
826         shadow tree now instead of explicitly building it.
827         (WebCore::SVGUseElement::updateShadowTree): Moved the code to create a shadow
828         tree here from buildPendingResource. ALso changed the logic so that we
829         always blow away the old shadow tree. Moved the comment about rebuilding things
830         every time here. Updated the code to use the findTarget and cloneTarget functions,
831         eliminating the buildShadowTree function entirely. Moved the call to
832         transferSizeAttributesToShadowTreeTargetClone inside cloneTarget. Also updated
833         for the name change for m_shouldRebuildShadowTree.
834         (WebCore::SVGUseElement::targetClone): Renamed from shadowTreeTargetClone.
835         No need to emphasize "shadow tree" since that's where all clones are.
836         (WebCore::isDirectReference): Streamlined a bit using "using namespace".
837         (WebCore::SVGUseElement::toClipPath): Rewrote to use early return and updated
838         for name changes. Also used ASCIILiteral.
839         (WebCore::SVGUseElement::rendererClipChild): Changed local variable names.
840         (WebCore::removeDisallowedElementsFromSubtree): Wrote the iteration in a
841         slightly more idiomatic style.
842         (WebCore::SVGUseElement::findTarget): Added. This new function implements
843         the rule for finding a valid target for a use element. This replaces logic
844         that was duplicated in two different places and it also includes all the
845         rules that were formerly in the isValidTarget function. Also, this implements
846         a correct check for a cycle that handles cases the code in isValidTarget did not.
847         (WebCore::SVGUseElement::isValidTarget): Deleted.
848         (WebCore::SVGUseElement::cloneTarget): Added. Helper function used both when
849         cloning the target of the top level <use> elements and for other <use> elements
850         inside the shadow tree.
851         (WebCore::cloneDataAndChildren): Added. Helper function that allows both the
852         <use> and <symbol> element expanding functions to be shorter and share more code.
853         (WebCore::SVGUseElement::expandUseElementsInShadowTree): Removed unneeded checks
854         of cachedDocumentIsStillLoading. Used the new findTarget function, which handles
855         finding the target cross-document correctly. Removed the incorrect use of
856         referencedDocument when creating new elements and finding targets. Refactored
857         to use the new cloneDataAndChildren function and also moved the code that removes
858         the special attributes here, replacing the transferAttributesToShadowTreeReplacement
859         function. Made a few other simplifications.
860         (WebCore::SVGUseElement::expandSymbolElementsInShadowTree): Ditto, just like the
861         <use> changes only simpler.
862         (WebCore::SVGUseElement::transferEventListenersToShadowTree): Made this const.
863         Removed unneeded assertions.
864         (WebCore::SVGUseElement::invalidateShadowTree): Updated for name change.
865         (WebCore::SVGUseElement::invalidateDependentShadowTrees): Removed assertion.
866         (WebCore::SVGUseElement::transferAttributesToShadowTreeReplacement): Deleted.
867         (WebCore::SVGUseElement::selfHasRelativeLengths): Tweaked names.
868         (WebCore::SVGUseElement::notifyFinished): Removed the inDocument check, since
869         this function will only be called for elements that are in a document.
870         (WebCore::SVGUseElement::cachedDocumentIsStillLoading): Deleted.
871         (WebCore::SVGUseElement::finishParsingChildren): Removed the code that calls
872         buildPendingResource here. Shadow tree updating is driven solely by renderer
873         generation now.
874         (WebCore::SVGUseElement::updateExternalDocument): Replaced setCachedDocument
875         with this. This function knows how to load a different document if the URL
876         has changed, or leave it alone if not, and also stop the load if it should.
877         (WebCore::SVGUseElement::isValid): Moved this here from the header, since it's
878         always being called virtually.
879         (WebCore::SVGUseElement::haveLoadedRequiredResources): Ditto.
880         (WebCore::SVGUseElement::setHaveFiredLoadEvent): Ditto.
881         (WebCore::SVGUseElement::haveFiredLoadEvent): Ditto.
882         (WebCore::SVGUseElement::svgLoadEventTimer): Ditto.
883
884         * svg/SVGUseElement.h: Removed unneeded include. Moved the animated properties
885         to the top of the class because they are public DOM API and so are logical to
886         list first. I'd like to do that for other classes too over time. Changed to
887         derive privately from CachedSVGDocumentClient. Made the function
888         invalidateDependentShadowTrees private. Removed didNotifySubtreeInsertions,
889         isSupportedAttribute, clearResourceReferences, buildShadowTree,
890         transferAttributesToShadowTreeReplacement, isParserInserted, and
891         m_wasInsertedByParser. Added updateExternalDocument, cloneTarget, targetClone,
892         updateShadowTree, and clearShadowTree. Also did a couple other renames,
893         including renaming m_cachedDocument to m_externalDocument.
894
895         * svg/svgtags.in: Removed constructorNeedsCreatedByParser from the <use>
896         element since we don't have to handle constructing by the parser specially.
897
898 2015-02-11  Dhi Aurrahman  <diorahman@rockybars.com>
899
900         CSS selector JIT compilation support for :lang()
901         https://bugs.webkit.org/show_bug.cgi?id=140818
902
903         Reviewed by Benjamin Poulain.
904
905         Add the JIT support for :lang(), to ensure :lang() no longer force the engine to
906         the slow path.
907
908         Test: fast/selectors/lang-chained-multiple.html
909
910         * cssjit/SelectorCompiler.cpp:
911         (WebCore::SelectorCompiler::addPseudoClassType):
912         Get rid of the FunctionType::CannotCompile
913         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementMatching):
914         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsInLanguage):
915
916 2015-02-11  Alex Christensen  <achristensen@webkit.org>
917
918         Fix more weak external symbol errors.
919
920         * bindings/scripts/CodeGeneratorJS.pm:
921         (GenerateHeader):
922         * page/make_settings.pl:
923         (printGetterAndSetter):
924         Remove some WEBCORE_EXPORT macros.
925
926 2015-02-11  Alex Christensen  <achristensen@webkit.org>
927
928         Do not export functions defined in headers.
929         This prevents weak external symbol errors in some configurations.
930
931         * dom/Range.h:
932         (WebCore::Range::startContainer):
933         (WebCore::Range::startOffset):
934         (WebCore::Range::endContainer):
935         (WebCore::Range::endOffset):
936         * inspector/InspectorController.h:
937         * page/Settings.h:
938         (WebCore::Settings::setMediaKeysStorageDirectory):
939         * page/make_settings.pl:
940         (printGetterAndSetter):
941         * platform/network/cocoa/ProtectionSpaceCocoa.h:
942         (WebCore::ProtectionSpace::encodingRequiresPlatformData):
943         * platform/text/TextEncoding.h:
944         (WebCore::TextEncoding::decode):
945         Removed WEBCORE_EXPORT macros.
946
947 2015-02-11  Chris Dumez  <cdumez@apple.com>
948
949         [WK2] Add logging to validate the network cache efficacy (Part 2)
950         https://bugs.webkit.org/show_bug.cgi?id=141345
951         <rdar://problem/19632080>
952
953         Reviewed by Sam Weinig.
954
955         Add a few more diagnostic logging keys for the network cache efficacy
956         logging.
957
958 2015-02-11  Sam Weinig  <sam@webkit.org>
959
960         REGRESSION(r179166): Crash when accessing document.dir on a document with no elements
961         <rdar://problem/19804351>
962         https://bugs.webkit.org/show_bug.cgi?id=141480
963
964         Reviewed by Chris Dumez.
965
966         Test: fast/dom/document-dir-empty-document-crash.html
967
968         * html/HTMLDocument.cpp:
969         (WebCore::HTMLDocument::dir):
970         Don't unnecessarily dereference the documentElement. is<HTMLHtmlElement>() will handle null just fine.
971
972 2015-02-11  Mark Rowe  <mrowe@apple.com>
973
974         <https://webkit.org/b/141492> extract-localizable-strings.pl shouldn't update the target file if the contents haven't changed
975
976         Avoid updating the target file if the contents haven't changed. This prevents Xcode from copying the identical
977         file into the framework and resigning it, which avoids the resulting relinking of all targets that depend on
978         the framework.
979
980         Reviewed by Dan Bernstein.
981
982         * extract-localizable-strings.pl: Write our output to a temporary file. If the output differs from the
983         existing contents of the target file, move the temporary file over the target file. Otherwise, delete
984         the temporary file.
985
986 2015-02-11  Chris Dumez  <cdumez@apple.com>
987
988         Turn recent assertions into release assertions to help track down crash in DocumentLoader::stopLoadingForPolicyChange()
989         https://bugs.webkit.org/show_bug.cgi?id=141484
990         <rdar://problem/13811738>
991
992         Reviewed by Andy Estes.
993
994         Turn recent assertions into release assertions to help track down crash in
995         DocumentLoader::stopLoadingForPolicyChange(). This should increase the
996         likelyhood of tripping them so that we better understand why this happens.
997
998         * loader/DocumentLoader.cpp:
999         (WebCore::DocumentLoader::~DocumentLoader):
1000         (WebCore::DocumentLoader::detachFromFrame):
1001
1002 2015-02-11  Jer Noble  <jer.noble@apple.com>
1003
1004         [MSE] SampleMap::addRange() returns an inverted iterator_range, possibly causing a crash when that iterator_range is traversed.
1005         https://bugs.webkit.org/show_bug.cgi?id=141479
1006         rdar://problem/19067597
1007
1008         Reviewed by Chris Dumez.
1009
1010         When looking backwards through a presentationOrder map to find samples, we then reverse our iterators
1011         and put them in an iterator_range to return to the caller. But in addition to reversing the iterators
1012         themselves, we also need to put them in the iterator_range in reverse order, so that when the caller
1013         iterates from iterator_range.first -> iterator_range.second, they don't end up off the end of the
1014         the underlying storage.
1015
1016         * Modules/mediasource/SampleMap.cpp:
1017         (WebCore::PresentationOrderSampleMap::findSamplesWithinPresentationRangeFromEnd):
1018
1019 2015-02-11  Simon Fraser  <simon.fraser@apple.com>
1020
1021         Improve the showFrameTree() output slightly
1022         https://bugs.webkit.org/show_bug.cgi?id=141482
1023
1024         Reviewed by Zalan Bujtas.
1025
1026         Have showFrameTree() show the Frame's RenderView so it can be correlated with
1027         layer dumps, and show styleRecalc and needsLayout state.
1028
1029         * page/FrameTree.cpp:
1030         (printFrames):
1031         * page/FrameView.cpp:
1032         (WebCore::FrameView::updateLayoutAndStyleIfNeededRecursive): Add an explanatory
1033         comment about why we don't walk the Frame tree.
1034
1035 2015-02-11  Alex Christensen  <achristensen@webkit.org>
1036
1037         Stop using WebCore.exp.in on Mac and iOS.
1038         https://bugs.webkit.org/show_bug.cgi?id=141413
1039
1040         Reviewed by Dan Bates.
1041
1042         * Configurations/Base.xcconfig:
1043         Make symbols hidden by default unless exported by WEBCORE_EXPORT macros.
1044         * platform/PlatformExportMacros.h:
1045         Start using WEBCORE_EXPORT on Mac and iOS (but not Windows yet).
1046
1047 2015-02-11  ChangSeok Oh  <changseok.oh@collabora.com>
1048
1049         Div having contentEditable and display:flex cannot be edited if it is empty.
1050         https://bugs.webkit.org/show_bug.cgi?id=141218
1051
1052         Reviewed by Ryosuke Niwa.
1053
1054         RenderFlexibleBox should be treated as a candidate for visible position. Visible selection
1055         in an editable area is recalculated whenever an inner value of div is changed. If the inner value
1056         is empty, the visible selection recalculated with DeleteSelectionCommand::m_endingPostion
1057         is not correct. Because RenderBlockFlow is only considered but not RenderFlexibleBox
1058         in Position::isCandidate so that a calculated ending VisiblePosition for an editable div
1059         having "display : flex" goes weird and VisibleSelection is empty accordingly.
1060
1061         Test: fast/events/key-events-in-editable-flexbox.html
1062
1063         * dom/Position.cpp:
1064         (WebCore::Position::isCandidate):
1065
1066 2015-02-11  ChangSeok Oh  <changseok.oh@collabora.com>
1067
1068         Activate ReliefLogger of a memory pressure handler for linux system.
1069         https://bugs.webkit.org/show_bug.cgi?id=123611
1070
1071         Reviewed by Anders Carlsson.
1072
1073         Put more logs for the time when a system goes under memory pressure or viceversa.
1074
1075         No new tests since no engine behavior changed.
1076
1077         * platform/linux/MemoryPressureHandlerLinux.cpp:
1078         (WebCore::MemoryPressureHandler::waitForMemoryPressureEvent): Wait a memory pressure event
1079         from cgroup in a seperated thread. Once a pressure event happens, respondToMemoryPressure()
1080         would be called to get back some resources.
1081         (WebCore::MemoryPressureHandler::install): Install memoryPressureHandler module
1082         to make it work.
1083
1084 2015-02-11  Alex Christensen  <achristensen@webkit.org>
1085
1086         Final preparations to switch to WEBCORE_EXPORT.
1087
1088         * platform/ios/WebVideoFullscreenInterfaceAVKit.h:
1089         Export the vtable and a function.
1090
1091 2015-02-11  Sam Weinig  <sam@webkit.org>
1092
1093         performance.now can crash if accessed from a window that has navigated
1094         <rdar://problem/16892506>
1095         https://bugs.webkit.org/show_bug.cgi?id=141478
1096
1097         Reviewed by Alexey Proskuryakov.
1098
1099         Test: fast/performance/performance-now-crash-on-navigated-window.html
1100
1101         * page/Performance.cpp:
1102         (WebCore::Performance::now):
1103         Check for a null frame, which can happen when the window has been navigated.
1104
1105 2015-02-10  Alexey Proskuryakov  <ap@apple.com>
1106
1107         URL::setUser and URL::setPass don't percent encode
1108         https://bugs.webkit.org/show_bug.cgi?id=141453
1109         rdar://problem/14844503&16551802&19623145
1110
1111         Reviewed by Darin Adler.
1112
1113         Tests: fast/url/url-credentials-escaping.html
1114                http/tests/xmlhttprequest/basic-auth-credentials-escaping.html
1115
1116         Start adding some code that performs escaping in a way that matches the URL Standard.
1117         Right now, it's only used where we failed to do any escaping at all, and over time,
1118         we'll be moving towards a new implementation.
1119
1120         * html/URLUtils.h:
1121         (WebCore::URLUtils<T>::username):
1122         (WebCore::URLUtils<T>::password):
1123         * platform/URL.cpp:
1124         (WebCore::isSchemeFirstChar):
1125         (WebCore::URL::user):
1126         (WebCore::URL::pass):
1127         (WebCore::URL::encodedUser):
1128         (WebCore::URL::encodedPass):
1129         (WebCore::URL::setUser):
1130         (WebCore::URL::setPass):
1131         (WebCore::encodeWithURLEscapeSequences):
1132         * platform/URL.h:
1133
1134 2015-02-11  Alex Christensen  <achristensen@webkit.org>
1135
1136         Add a few more WEBCORE_EXPORT macros for debug and iOS builds.
1137
1138         * page/EventHandler.h:
1139         * page/ios/WebEventRegion.h:
1140         * platform/sql/SQLiteDatabaseTracker.h:
1141
1142 2015-02-11  Darin Adler  <darin@apple.com>
1143
1144         REGRESSION(r179476): It broke the !ENABLE(PICTURE_SIZES) build
1145         https://bugs.webkit.org/show_bug.cgi?id=141327
1146
1147         Reviewed by Csaba Osztrogonác.
1148
1149         * html/parser/HTMLPreloadScanner.cpp:
1150         (WebCore::TokenPreloadScanner::StartTagScanner::processAttributes):
1151         Put #if around use of m_sizesAttribute.
1152
1153 2015-02-11  Commit Queue  <commit-queue@webkit.org>
1154
1155         Unreviewed, rolling out r179921.
1156         https://bugs.webkit.org/show_bug.cgi?id=141473
1157
1158         caused about 30 test failures on yosemite and mavericks
1159         (Requested by alexchristensen on #webkit).
1160
1161         Reverted changeset:
1162
1163         "Div having contentEditable and display:flex cannot be edited
1164         if it is empty."
1165         https://bugs.webkit.org/show_bug.cgi?id=141218
1166         http://trac.webkit.org/changeset/179921
1167
1168 2015-02-11  ChangSeok Oh  <changseok.oh@collabora.com>
1169
1170         Div having contentEditable and display:flex cannot be edited if it is empty.
1171         https://bugs.webkit.org/show_bug.cgi?id=141218
1172
1173         Reviewed by Ryosuke Niwa.
1174
1175         RenderFlexibleBox should be treated as a candidate for visible position. Visible selection
1176         in an editable area is recalculated whenever an inner value of div is changed. If the inner value
1177         is empty, the visible selection recalculated with DeleteSelectionCommand::m_endingPostion
1178         is not correct. Because RenderBlockFlow is only considered but not RenderFlexibleBox
1179         in Position::isCandidate so that a calculated ending VisiblePosition for an editable div
1180         having "display : flex" goes weird and VisibleSelection is empty accordingly.
1181
1182         Test: fast/events/key-events-in-editable-flexbox.html
1183
1184         * dom/Position.cpp:
1185         (WebCore::Position::isCandidate):
1186
1187 2015-02-11  Commit Queue  <commit-queue@webkit.org>
1188
1189         Unreviewed, rolling out r179910.
1190         https://bugs.webkit.org/show_bug.cgi?id=141464
1191
1192         Caused assertions on debug bots (Requested by ap on #webkit).
1193
1194         Reverted changeset:
1195
1196         "[WK2] Add logging to validate the network cache efficacy
1197         (Part 2)"
1198         https://bugs.webkit.org/show_bug.cgi?id=141345
1199         http://trac.webkit.org/changeset/179910
1200
1201 2015-02-10  Chris Dumez  <cdumez@apple.com>
1202
1203         Optimize MutableStyleProperties::removePropertiesInSet()
1204         https://bugs.webkit.org/show_bug.cgi?id=141460
1205
1206         Reviewed by Andreas Kling.
1207
1208         Optimize MutableStyleProperties::removePropertiesInSet() by doing an
1209         in-place removal of the vector properties, using the new and efficient
1210         Vector::removalAllMatching().
1211
1212         I see a ~11% speed-up on CSS/CSSPropertySetterGetter.html performance
1213         test.
1214
1215         This change was inspired by the following Blink revision:
1216         https://src.chromium.org/viewvc/blink?view=rev&revision=189387
1217
1218         Test: PerformanceTests/CSS/CSSPropertySetterGetter.html
1219
1220         * css/StyleProperties.cpp:
1221         (WebCore::MutableStyleProperties::removePropertiesInSet):
1222
1223 2015-02-10  Alex Christensen  <achristensen@webkit.org>
1224
1225         [Win] Fix debug build after r179807.
1226         https://bugs.webkit.org/show_bug.cgi?id=141461
1227
1228         Reviewed by Benjamin Poulain.
1229
1230         * dom/TypedElementDescendantIterator.h:
1231         Explicitly call Iterator constructor to reduce complexity when iterating descendantsOfType.
1232
1233 2015-02-10  Chris Dumez  <cdumez@apple.com>
1234
1235         [WK2] Add logging to validate the network cache efficacy (Part 2)
1236         https://bugs.webkit.org/show_bug.cgi?id=141345
1237
1238         Reviewed by Antti Koivisto.
1239
1240         Add a few more diagnostic logging keys for the network cache efficacy
1241         logging.
1242
1243 2015-02-10  Commit Queue  <commit-queue@webkit.org>
1244
1245         Unreviewed, rolling out r179896.
1246         https://bugs.webkit.org/show_bug.cgi?id=141452
1247
1248         broke linking debug builds (Requested by thorton on #webkit).
1249
1250         Reverted changeset:
1251
1252         "Stop using WebCore.exp.in on Mac and iOS."
1253         https://bugs.webkit.org/show_bug.cgi?id=141413
1254         http://trac.webkit.org/changeset/179896
1255
1256 2015-02-10  Alex Christensen  <achristensen@webkit.org>
1257
1258         Fix bindings tests after r179886.
1259
1260         * bindings/scripts/test/ObjC/DOMFloat64Array.h:
1261         * bindings/scripts/test/ObjC/DOMTestActiveDOMObject.h:
1262         * bindings/scripts/test/ObjC/DOMTestCallback.h:
1263         * bindings/scripts/test/ObjC/DOMTestCustomNamedGetter.h:
1264         * bindings/scripts/test/ObjC/DOMTestEventConstructor.h:
1265         * bindings/scripts/test/ObjC/DOMTestEventTarget.h:
1266         * bindings/scripts/test/ObjC/DOMTestException.h:
1267         * bindings/scripts/test/ObjC/DOMTestGenerateIsReachable.h:
1268         * bindings/scripts/test/ObjC/DOMTestInterface.h:
1269         * bindings/scripts/test/ObjC/DOMTestMediaQueryListListener.h:
1270         * bindings/scripts/test/ObjC/DOMTestNamedConstructor.h:
1271         * bindings/scripts/test/ObjC/DOMTestNode.h:
1272         * bindings/scripts/test/ObjC/DOMTestNondeterministic.h:
1273         * bindings/scripts/test/ObjC/DOMTestObj.h:
1274         * bindings/scripts/test/ObjC/DOMTestOverloadedConstructors.h:
1275         * bindings/scripts/test/ObjC/DOMTestSerializedScriptValueInterface.h:
1276         * bindings/scripts/test/ObjC/DOMTestTypedefs.h:
1277         * bindings/scripts/test/ObjC/DOMattribute.h:
1278         * bindings/scripts/test/ObjC/DOMreadonly.h:
1279
1280 2015-02-10  Alex Christensen  <achristensen@webkit.org>
1281
1282         Stop using WebCore.exp.in on Mac and iOS.
1283         https://bugs.webkit.org/show_bug.cgi?id=141413
1284
1285         Reviewed by Dan Bates.
1286
1287         * Configurations/Base.xcconfig:
1288         Make symbols hidden by default unless exported by WEBCORE_EXPORT macros.
1289         * platform/PlatformExportMacros.h:
1290         Start using WEBCORE_EXPORT on Mac and iOS (but not Windows yet).
1291
1292 2015-02-10  Chris Dumez  <cdumez@apple.com>
1293
1294         Add another assertion to help track down crash in DocumentLoader::stopLoadingForPolicyChange()
1295         https://bugs.webkit.org/show_bug.cgi?id=141447
1296         <rdar://problem/13811738>
1297
1298         Reviewed by Alexey Proskuryakov.
1299
1300         Add another assertion to help track down crash in
1301         DocumentLoader::stopLoadingForPolicyChange().
1302
1303         The trace seems to hint that frameLoader() returns null when
1304         stopLoadingForPolicyChange() is called. frameLoader() can only return
1305         null after DocumentLoader::detachFromFrame() has been called.
1306         Also, stopLoadingForPolicyChange() here is called from the
1307         DocumentLoader::continueAfterContentPolicy() policy callback which
1308         requires m_waitingForContentPolicy to be true. Therefore, we should
1309         assert that m_waitingForContentPolicy is false when m_frame is cleared
1310         in DocumentLoader::detachFromFrame().
1311
1312         * loader/DocumentLoader.cpp:
1313         (WebCore::DocumentLoader::detachFromFrame):
1314
1315 2015-02-10  Alex Christensen  <achristensen@webkit.org>
1316
1317         Stop using WebCore.exp.in on Mac and iOS.
1318         https://bugs.webkit.org/show_bug.cgi?id=141413
1319
1320         Reviewed by Dan Bates.
1321
1322         * Configurations/Base.xcconfig:
1323         Make symbols hidden by default unless exported by WEBCORE_EXPORT macros.
1324         * platform/PlatformExportMacros.h:
1325         Start using WEBCORE_EXPORT on Mac and iOS (but not Windows yet).
1326
1327 2015-02-10  Alex Christensen  <achristensen@webkit.org>
1328
1329         Add more WEBCORE_EXPORT macros for iOS.
1330         https://bugs.webkit.org/show_bug.cgi?id=141430
1331
1332         Reviewed by Tim Horton.
1333
1334         * bindings/objc/WebScriptObject.h:
1335         * bindings/scripts/CodeGeneratorObjC.pm:
1336         (GenerateHeader):
1337         * dom/Event.h:
1338         * dom/Node.h:
1339         * editing/FrameSelection.h:
1340         * html/HTMLFormControlElement.h:
1341         * html/HTMLMediaSession.h:
1342         * page/Frame.h:
1343         * page/FrameView.h:
1344         * platform/ScrollView.h:
1345         * platform/ios/PasteboardIOS.mm:
1346         * platform/ios/wak/WAKAppKitStubs.h:
1347         * platform/ios/wak/WAKClipView.h:
1348         * platform/ios/wak/WAKScrollView.h:
1349         * platform/ios/wak/WAKView.h:
1350         * platform/ios/wak/WAKWindow.h:
1351         * platform/ios/wak/WAKWindow.mm:
1352         * platform/ios/wak/WKContentObservation.h:
1353         * platform/ios/wak/WKGraphics.h:
1354         * platform/ios/wak/WebCoreThread.h:
1355         * platform/ios/wak/WebCoreThread.mm:
1356         * platform/ios/wak/WebCoreThreadRun.h:
1357         * platform/ios/wak/WebCoreThreadSystemInterface.h:
1358         * platform/network/ios/QuickLook.h:
1359         * platform/text/TextBreakIterator.h:
1360
1361 2015-02-09  David Hyatt  <hyatt@apple.com>
1362
1363         text-underline-position: under is broken
1364         https://bugs.webkit.org/show_bug.cgi?id=141400
1365         <rdar://problem/18569583>
1366
1367         Reviewed by Simon Fraser.
1368
1369         Added fast/text/text-underline-position-under.html
1370
1371         * rendering/InlineFlowBox.cpp:
1372         (WebCore::InlineFlowBox::computeMaxLogicalBottom):
1373         (WebCore::InlineFlowBox::computeMaxLogicalTop): Deleted.
1374         * rendering/InlineFlowBox.h:
1375         Switch to using the bottom to compute the offset. Using the top is incorrect, since
1376         the heights of boxes can vary.
1377
1378         Fix a bug where the y() of the box was being used instead of the logical value, making the result
1379         wrong for vertical text.
1380
1381         * rendering/RootInlineBox.cpp:
1382         (WebCore::RootInlineBox::maxLogicalBottom):
1383         (WebCore::RootInlineBox::maxLogicalTop): Deleted.
1384         Switch to using the bottom instead of the top. Make sure the root box contributes its own bottom,
1385         since the old code just ignored the root's placement.
1386
1387         * rendering/RootInlineBox.h:
1388         * style/InlineTextBoxStyle.cpp:
1389         (WebCore::computeUnderlineOffset):
1390         Call the bottom function now instead of the top.
1391
1392 2015-02-10  Chris Dumez  <cdumez@apple.com>
1393
1394         Add assertion to help track down WebCore::DocumentLoader::stopLoadingForPolicyChange() crash
1395         https://bugs.webkit.org/show_bug.cgi?id=141441
1396         <rdar://problem/13811738>
1397
1398         Reviewed by Alexey Proskuryakov.
1399
1400         Add assertion to help track down a crash in
1401         WebCore::DocumentLoader::stopLoadingForPolicyChange().
1402
1403         * loader/DocumentLoader.cpp:
1404         (WebCore::DocumentLoader::~DocumentLoader):
1405         Make sure the DocumentLoader is not waiting for a content policy
1406         response when it is destroyed. If this were to happen, then the
1407         lambda function passed to PolicyChecker::checkContentPolicy()
1408         would outlive the DocumentLoader. This is an issue because
1409         that lambda function captures [this], which is the DocumentLoader.
1410         This would cause DocumentLoader::continueAfterContentPolicy() to
1411         be called after the DocumentLoader has been destroyed, which would
1412         explain the crash.
1413
1414 2015-02-07  Zalan Bujtas  <zalan@apple.com>
1415
1416         REGRESSION (r168046): Crash in WebCore::InlineBox::renderer / WebCore::RenderFlowThread::checkLinesConsistency
1417         https://bugs.webkit.org/show_bug.cgi?id=133462
1418
1419         Reviewed by David Hyatt.
1420
1421         RenderFlowThread::m_lineToRegionMap stores pointers to the root inlineboxes in the block flow.
1422         Normally root inlineboxes remove themselves from this map in their dtors. However when collapsing an anonymous block,
1423         we detach the inline tree first and destroy them after. The detached root boxes can't access
1424         the flowthread containing block and we end up with dangling pointers in this map.
1425         Call removeFlowChildInfo() before detaching the subtree to ensure proper pointer removal.
1426
1427         Test: fast/multicol/newmulticol/crash-when-switching-to-floating.html
1428
1429         * rendering/RenderBlock.cpp:
1430         (WebCore::RenderBlock::collapseAnonymousBoxChild):
1431
1432 2015-02-10  Julien Isorce  <j.isorce@samsung.com>
1433
1434         Render: properly update body's background image
1435         https://bugs.webkit.org/show_bug.cgi?id=140183
1436
1437         When HTML and BODY renderers are both composited the
1438         skipBodyBackground condition should also take into account
1439         if the HTML's layer can draw its contents.
1440
1441         Reviewed by Darin Adler.
1442
1443         Test: animations/animation-background-image.html
1444
1445         * rendering/RenderBox.cpp:
1446         (WebCore::skipBodyBackground): Do not skip
1447         if document's layer cannot draw its content.
1448         Previously both body and html did not paint the background
1449         when they are both composited.
1450
1451         * rendering/RenderLayerBacking.cpp:
1452         (WebCore::RenderLayerBacking::contentChanged): Also redisplay
1453         the content.
1454
1455 2015-02-10  Eric Carlson  <eric.carlson@apple.com>
1456
1457         [iOS] don't get out of sync when interrupt/resume calls are not balanced
1458         https://bugs.webkit.org/show_bug.cgi?id=141310
1459
1460         Reviewed by Jer Noble.
1461
1462         No new tests, updated media/video-interruption-with-resume-allowing-play.html.
1463
1464         * platform/audio/MediaSession.cpp:
1465         (WebCore::MediaSession::beginInterruption): Count interruptions.
1466         (WebCore::MediaSession::endInterruption): Ignore calls when m_interruptionCount is already zero.
1467         * platform/audio/MediaSession.h:
1468
1469 2015-02-10  Carlos Garcia Campos  <cgarcia@igalia.com>
1470
1471         [GTK] GMutexLocker build issue
1472         https://bugs.webkit.org/show_bug.cgi?id=141381
1473
1474         Reviewed by Žan Doberšek.
1475
1476         Use always WTF::GMutexLocker because newer glib versions have a
1477         GMutexLocker in the public API.
1478
1479         * platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp:
1480         (WebCore::AudioSourceProviderGStreamer::provideInput):
1481         (WebCore::AudioSourceProviderGStreamer::handleAudioBuffer):
1482         (WebCore::AudioSourceProviderGStreamer::clearAdapters):
1483         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1484         (WebCore::MediaPlayerPrivateGStreamerBase::naturalSize):
1485         (WebCore::MediaPlayerPrivateGStreamerBase::updateTexture):
1486         (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
1487         (WebCore::MediaPlayerPrivateGStreamerBase::paint):
1488         * platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
1489         (webkitVideoSinkTimeoutCallback):
1490         (webkitVideoSinkRender):
1491         (unlockSampleMutex):
1492         (webkitVideoSinkUnlockStop):
1493         (webkitVideoSinkStart):
1494         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
1495         (webKitWebSrcGetProperty):
1496         (webKitWebSrcStop):
1497         (webKitWebSrcStart):
1498         (webKitWebSrcChangeState):
1499         (webKitWebSrcQueryWithParent):
1500         (webKitWebSrcGetUri):
1501         (webKitWebSrcSetUri):
1502         (webKitWebSrcNeedDataMainCb):
1503         (webKitWebSrcNeedDataCb):
1504         (webKitWebSrcEnoughDataMainCb):
1505         (webKitWebSrcEnoughDataCb):
1506         (webKitWebSrcSeekDataCb):
1507         (webKitWebSrcSetMediaPlayer):
1508         (StreamingClient::createReadBuffer):
1509         (StreamingClient::handleResponseReceived):
1510         (StreamingClient::handleDataReceived):
1511         (StreamingClient::handleNotifyFinished):
1512         (ResourceHandleStreamingClient::wasBlocked):
1513         (ResourceHandleStreamingClient::cannotShowURL):
1514
1515 2015-02-09  Alex Christensen  <achristensen@webkit.org>
1516
1517         Update WEBCORE_EXPORT to prepare to start using it.
1518         https://bugs.webkit.org/show_bug.cgi?id=141409
1519
1520         Reviewed by Tim Horton.
1521
1522         * bindings/js/JSDOMGlobalObject.h:
1523         * bindings/objc/DOMInternal.h:
1524         * bindings/objc/ExceptionHandlers.mm:
1525         * bindings/objc/WebScriptObjectPrivate.h:
1526         * bindings/scripts/CodeGeneratorJS.pm:
1527         (GenerateHeader):
1528         * bindings/scripts/test/JS/JSTestActiveDOMObject.h:
1529         * bindings/scripts/test/JS/JSTestCustomNamedGetter.h:
1530         * bindings/scripts/test/JS/JSTestEventConstructor.h:
1531         * bindings/scripts/test/JS/JSTestEventTarget.h:
1532         * bindings/scripts/test/JS/JSTestException.h:
1533         * bindings/scripts/test/JS/JSTestGenerateIsReachable.h:
1534         * bindings/scripts/test/JS/JSTestInterface.h:
1535         * bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
1536         * bindings/scripts/test/JS/JSTestNamedConstructor.h:
1537         * bindings/scripts/test/JS/JSTestNondeterministic.h:
1538         * bindings/scripts/test/JS/JSTestObj.h:
1539         * bindings/scripts/test/JS/JSTestOverloadedConstructors.h:
1540         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
1541         * bindings/scripts/test/JS/JSTestTypedefs.h:
1542         * bindings/scripts/test/JS/JSattribute.h:
1543         * bindings/scripts/test/JS/JSreadonly.h:
1544         * css/StyleProperties.h:
1545         * dom/DeviceMotionData.h:
1546         * dom/Node.h:
1547         * dom/Position.h:
1548         * dom/ScriptExecutionContext.h:
1549         * editing/Editor.h:
1550         * editing/htmlediting.h:
1551         * html/HTMLInputElement.h:
1552         * html/TimeRanges.h:
1553         * loader/FrameLoader.h:
1554         * loader/cache/CacheValidation.h:
1555         * loader/cache/MemoryCache.h:
1556         * loader/icon/IconDatabase.h:
1557         * page/DatabaseProvider.h:
1558         * page/DiagnosticLoggingKeys.h:
1559         * page/EventHandler.h:
1560         * page/FrameSnapshotting.h:
1561         * page/MainFrame.h:
1562         * page/PageConsoleClient.h:
1563         * page/PageOverlay.h:
1564         * platform/CrossThreadCopier.h:
1565         * platform/FileSystem.h:
1566         * platform/PlatformSpeechSynthesizer.h:
1567         * platform/RemoteCommandListener.h:
1568         * platform/RuntimeApplicationChecks.h:
1569         * platform/graphics/Font.h:
1570         * platform/graphics/FontCache.h:
1571         * platform/graphics/FontGlyphs.h:
1572         * platform/graphics/FontRanges.h:
1573         * platform/graphics/GeometryUtilities.h:
1574         * platform/graphics/GlyphPage.h:
1575         * platform/graphics/Region.h:
1576         * platform/graphics/ca/PlatformCALayer.h:
1577         * platform/graphics/ca/TileController.h:
1578         * platform/graphics/transforms/TransformationMatrix.h:
1579         * platform/mac/WebCoreFullScreenWarningView.h:
1580         * platform/network/BlobDataFileReference.h:
1581         * platform/network/ResourceRequestBase.h:
1582         * platform/network/ResourceResponseBase.h:
1583         * platform/network/create-http-header-name-table:
1584         * platform/network/mac/WebCoreURLResponse.h:
1585         * platform/sql/SQLiteDatabaseTracker.h:
1586         * platform/sql/SQLiteStatement.h:
1587         * rendering/HitTestLocation.h:
1588         * rendering/HitTestResult.h:
1589         * storage/StorageEventDispatcher.h:
1590         Added WEBCORE_EXPORT macros.
1591
1592 2015-02-09  Chris Dumez  <cdumez@apple.com>
1593
1594         Check for self-assignment in Length::operator=(const Length&)
1595         https://bugs.webkit.org/show_bug.cgi?id=141402
1596
1597         Reviewed by Andreas Kling.
1598
1599         Check for self-assignment in Length::operator=(const Length&) as
1600         calling memcpy() with the same source and destination addresses has
1601         undefined behavior.
1602
1603         * platform/Length.h:
1604         (WebCore::Length::operator=):
1605
1606 2015-02-09  Roger Fong  <roger_fong@apple.com>
1607
1608         WebGL: Update 1.0.2 conformance layout tests and address new failure.
1609         https://bugs.webkit.org/show_bug.cgi?id=141408.
1610         <rdar://problem/19773236>
1611
1612         Reviewed by Dean Jackson.
1613
1614         Tests covered by updated 1.0.2 conformance tests.
1615
1616         * html/canvas/WebGLRenderingContextBase.cpp: 
1617         Return null string instead of empty string if parameter validation fails.
1618         (WebCore::WebGLRenderingContextBase::getProgramInfoLog):
1619         (WebCore::WebGLRenderingContextBase::getShaderInfoLog):
1620         (WebCore::WebGLRenderingContextBase::getShaderSource):
1621
1622 2015-02-09  Timothy Horton  <timothy_horton@apple.com>
1623
1624         Avoid using a HashMap for DisplayRefreshMonitorManager, which rarely has more than one item
1625         https://bugs.webkit.org/show_bug.cgi?id=141353
1626
1627         Reviewed by Anders Carlsson.
1628
1629         No new tests, because there's no behavior change.
1630
1631         * platform/graphics/DisplayRefreshMonitorManager.cpp:
1632         (WebCore::DisplayRefreshMonitorManager::ensureMonitorForClient):
1633         (WebCore::DisplayRefreshMonitorManager::unregisterClient):
1634         (WebCore::DisplayRefreshMonitorManager::displayDidRefresh):
1635         * platform/graphics/DisplayRefreshMonitorManager.h:
1636         Use a Vector of RefPtr<DisplayRefreshMonitor> instead of a HashMap
1637         from uint64_t to RefPtr<DisplayRefreshMonitor>. There's usually only one
1638         display, so there's usually only one DisplayRefreshMonitor. Linear search
1639         on the Vector will be faster than the hash lookup in all conceivable cases.
1640         This also avoids the situation mentioned in the comments in DisplayRefreshMonitorManager.h
1641         where we don't know enough about PlatformDisplayID to safely hash it.
1642
1643 2015-02-09  Jer Noble  <jer.noble@apple.com>
1644
1645         [Mac] Disable the currentTime estimation code in HTMLMediaElement for Yosemite+
1646         https://bugs.webkit.org/show_bug.cgi?id=141399
1647
1648         Reviewed by Eric Carlson.
1649
1650         Apparenty -[AVPlayer rate] means different things for HLS and progressive content; for progressive,
1651         the -rate is the actual rate of playback. For HLS, the -rate is the requested rate, and will return
1652         the requested value even if time is not progressing.
1653
1654         We added the currentTime estimation engine because asking AVFoundation for its -currentTime used to
1655         be expensive, but we've been assured that in recent iOS and OS X releases, -currentTime should be
1656         very fast. That, in combination with the HLS behavior of -rate and how it breaks the currentTime
1657         estimation, means we should probably turn it off for iOS and Yosemite.
1658
1659         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
1660         (WebCore::MediaPlayerPrivateAVFoundationObjC::maximumDurationToCacheMediaTime): Move implementation to .mm.
1661         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1662         (WebCore::MediaPlayerPrivateAVFoundationObjC::maximumDurationToCacheMediaTime): Disable on iOS and >=10.10.
1663
1664 2015-02-07  Roger Fong  <roger_fong@apple.com>
1665
1666         WebGL 2: Texture call format, internal format, and type validation.
1667         https://bugs.webkit.org/show_bug.cgi?id=141318.
1668         <rdar://problem/19733828>
1669
1670         Reviewed by Brent Fulgham.
1671
1672         Tests will be covered by WebGL2 conformance tests.
1673
1674         * html/canvas/WebGL2RenderingContext.cpp:
1675         (WebCore::WebGL2RenderingContext::getFramebufferAttachmentParameter): Add missing ExceptionCode argument.
1676         (WebCore::WebGL2RenderingContext::copyTexImage2D): Validate texture formats based on GLES3 spec.
1677         (WebCore::WebGL2RenderingContext::texSubImage2DBase): Validate using internal format from texture target.
1678         (WebCore::WebGL2RenderingContext::texSubImage2DImpl): Validate using internal format from texture target.
1679         (WebCore::WebGL2RenderingContext::texSubImage2D): Validate using internal format from texture target.
1680         (WebCore::WebGL2RenderingContext::validateTexFuncParameters): Do extra validation for copyTexImage2D.
1681         (WebCore::WebGL2RenderingContext::validateTexFuncFormatAndType): Validate internal format, format and type combination.
1682         (WebCore::WebGL2RenderingContext::validateTexFuncData): Validate new data types.
1683         This method now accepts an internal format argument.
1684         (WebCore::WebGL2RenderingContext::baseInternalFormatFromInternalFormat):
1685         Helper method to convert internal format to base internal format.
1686         * html/canvas/WebGL2RenderingContext.h:
1687
1688         * html/canvas/WebGLRenderingContext.cpp:
1689         (WebCore::WebGLRenderingContext::copyTexImage2D): Moved from WebGLRenderingContextBase.
1690         (WebCore::WebGLRenderingContext::texSubImage2DBase): Ditto.
1691         (WebCore::WebGLRenderingContext::texSubImage2DImpl): Ditto.
1692         (WebCore::WebGLRenderingContext::texSubImage2D): Ditto.
1693         (WebCore::WebGLRenderingContext::validateTexFuncParameters): Ditto.
1694         (WebCore::WebGLRenderingContext::validateTexFuncFormatAndType): Ditto.
1695         (WebCore::WebGLRenderingContext::validateTexFuncData): Ditto.
1696         * html/canvas/WebGLRenderingContext.h:
1697
1698         * html/canvas/WebGLRenderingContextBase.cpp:
1699         (WebCore::WebGLRenderingContextBase::texImage2DBase):
1700         (WebCore::WebGLRenderingContextBase::validateTexFunc):
1701         (WebCore::WebGLRenderingContextBase::texImage2D):
1702         (WebCore::WebGLRenderingContextBase::copyTexImage2D): Deleted.
1703         (WebCore::WebGLRenderingContextBase::texSubImage2DBase): Deleted.
1704         (WebCore::WebGLRenderingContextBase::texSubImage2DImpl): Deleted.
1705         (WebCore::WebGLRenderingContextBase::texSubImage2D): Deleted.
1706         (WebCore::WebGLRenderingContextBase::validateTexFuncFormatAndType): Deleted.
1707         (WebCore::WebGLRenderingContextBase::validateTexFuncParameters): Deleted.
1708         (WebCore::WebGLRenderingContextBase::validateTexFuncData): Deleted.
1709         * html/canvas/WebGLRenderingContextBase.h: Modify validation type enums to differentiate between CopyImage, TexImage and TexSubImage calls.
1710         (WebCore::ScopedDrawingBufferBinder::ScopedDrawingBufferBinder):  Moved from WebGLRenderingContextBase.
1711         (WebCore::ScopedDrawingBufferBinder::~ScopedDrawingBufferBinder): Ditto.
1712         (WebCore::clip1D): Ditto.
1713         (WebCore::clip2D): Ditto.
1714         * platform/graphics/GraphicsContext3D.h: Rename a typo'ed enum.
1715
1716 2015-02-09  Commit Queue  <commit-queue@webkit.org>
1717
1718         Unreviewed, rolling out r179494.
1719         https://bugs.webkit.org/show_bug.cgi?id=141395
1720
1721         Caused slowdown in a WebKit client test scenario (Requested by
1722         kling on #webkit).
1723
1724         Reverted changeset:
1725
1726         "[Cocoa] Make decoded image data purgeable ASAP."
1727         https://bugs.webkit.org/show_bug.cgi?id=140298
1728         http://trac.webkit.org/changeset/179494
1729
1730 2015-02-09  Jer Noble  <jer.noble@apple.com>
1731
1732         [WebAudio] AudioBufferSourceNodes should accurately play backwards if given a negative playbackRate.
1733         https://bugs.webkit.org/show_bug.cgi?id=140955
1734
1735         Reviewed by Eric Carlson.
1736
1737         Tests: webaudio/audiobuffersource-negative-playbackrate-interpolated.html
1738                webaudio/audiobuffersource-negative-playbackrate.html
1739
1740         Add support for playing an AudioBufferSourceNode at a negative playbackRate. Change the meaning of
1741         start() to set the initial playback position at the end of the play range if the rate of playback
1742         is negtive.
1743
1744         * Modules/webaudio/AudioBufferSourceNode.cpp:
1745         (WebCore::AudioBufferSourceNode::AudioBufferSourceNode): Allow the playbackRate AudioParam to range from [-32, 32].
1746         (WebCore::AudioBufferSourceNode::renderFromBuffer): Change variable names from "start" and "end" to "min" and "max"
1747             for clarity. Add a non-interpolated and interpolated render step for negative playback.
1748         (WebCore::AudioBufferSourceNode::start): Drive-by fix: default value of grainDuration is not 0.02.
1749         (WebCore::AudioBufferSourceNode::startPlaying): Start playing at the end of the buffer for negative playback.
1750         (WebCore::AudioBufferSourceNode::totalPitchRate): Allow the pitch to be negative.
1751
1752 2015-02-09  Darin Adler  <darin@apple.com>
1753
1754         Try to fix build on platforms that use SVG "all in one" file (Windows).
1755
1756         * svg/SVGAElement.cpp: Don't do "using namespace HTMLNames;" outside of
1757         function boundaries, because that will be inherited by other files.
1758         (WebCore::SVGAElement::isURLAttribute): Use XLinkNames directly here
1759         instead of using HTMLNames implicitly.
1760
1761         * svg/SVGElement.cpp: Don't do "using namespace HTMLNames;" outside of
1762         function boundaries, because that will be inherited by other files.
1763         (WebCore::populateAttributeNameToCSSPropertyIDMap): Instead do it in here.
1764         (WebCore::populateAttributeNameToAnimatedPropertyTypeMap): And here.
1765         (WebCore::populateCSSPropertyWithSVGDOMNameToAnimatedPropertyTypeMap): And here.
1766         (WebCore::SVGElement::parseAttribute): And use HTMLNames directly here
1767         instead of implicitly.
1768
1769 2015-02-09  Eric Carlson  <eric.carlson@apple.com>
1770
1771         [iOS] exit from fullscreen when player view controller calls delegate
1772         https://bugs.webkit.org/show_bug.cgi?id=141350
1773
1774         Reviewed by Jer Noble.
1775
1776         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
1777         (-[WebAVPlayerController playerViewControllerWillCancelOptimizedFullscree:]): New, ask delegate
1778             to exit from fullscreen.
1779
1780 2015-02-06  Sergio Villar Senin  <svillar@igalia.com>
1781
1782         ASSERTION FAILED: resolvedInitialPosition <= resolvedFinalPosition in WebCore::GridSpan::GridSpan
1783         https://bugs.webkit.org/show_bug.cgi?id=141328
1784
1785         Reviewed by Darin Adler.
1786
1787         Whenever
1788         GridResolvedPosition::resolveGridPositionsFromAutoPlacementPosition()
1789         was trying to place an item with span, it was completely ignoring
1790         the resolvedInitialPosition returned by
1791         GridResolvedPosition::resolveGridPositionAgainstOppositePosition()
1792         and only using the finalResolvedPosition. This works with an
1793         unlimited grid which can indefinitely grow. But if the item spans
1794         over the grid track limits, then it might happen that the final
1795         resolved position is placed before the initial resolved position,
1796         something that is forbidden.
1797
1798         The solution is to directly use the GridSpan returned by
1799         GridResolvedPosition::resolveGridPositionAgainstOppositePosition(), if the item
1800         does not surpass the track limits then the returned initialResolvedPosition
1801         is identical to the provided one, otherwise it's properly corrected to respect
1802         track boundaries.
1803
1804         * rendering/style/GridResolvedPosition.cpp:
1805         (WebCore::GridResolvedPosition::resolveGridPositionsFromAutoPlacementPosition):
1806
1807 2015-01-22  Sergio Villar Senin  <svillar@igalia.com>
1808
1809         [CSS Grid Layout] Tracks' growth limits must be >= base sizes
1810         https://bugs.webkit.org/show_bug.cgi?id=140540
1811
1812         Reviewed by Antti Koivisto.
1813
1814         The track sizing algorithm is supposed to avoid those situations
1815         but they easily (specially when we mix absolute lengths and
1816         intrinsic lengths in min and max track sizing functions) and
1817         frequently appear. In those cases the outcome from the algorithm
1818         is wrong, tracks are not correctly sized.
1819
1820         In order to fulfill the restriction, m_usedBreadth and
1821         m_maxBreadth are now private members of GridTrack and the class
1822         now provides a couple of methods to modify them respecting the
1823         growthLimit >= baseSize precondition.
1824
1825         Apart from that, the members and methods of GridTrack were also
1826         renamed to match the ones used in the recent algorithm rewrite:
1827         usedBreadth became baseSize and maxBreadth is now growthLimit.
1828
1829         Although the algorithm was not modified at all, this change
1830         detected and fixed several invalid results (tracks and/or grids
1831         bigger than expected).
1832
1833         * rendering/RenderGrid.cpp:
1834         (WebCore::GridTrack::GridTrack): Renamed fields and methods. Added
1835         assertions.
1836         (WebCore::GridTrack::baseSize): Renamed from usedBreadth.
1837         (WebCore::GridTrack::growthLimit): Renamed from maxBreadth.
1838         (WebCore::GridTrack::setBaseSize):
1839         (WebCore::GridTrack::setGrowthLimit):
1840         (WebCore::GridTrack::growBaseSize): Renamed from growUsedBreadth.
1841         (WebCore::GridTrack::growGrowthLimit): Renamed from growMaxBreadth.
1842         (WebCore::GridTrack::growthLimitIsInfinite): New helper method.
1843         (WebCore::GridTrack::growthLimitIfNotInfinite): Renamed from
1844         maxBreadthIfNotInfinite.
1845         (WebCore::GridTrack::isGrowthLimitBiggerThanBaseSize): New helper
1846         method to verify ASSERTs are true.
1847         (WebCore::GridTrack::ensureGrowthLimitIsBiggerThanBaseSize): Ditto.
1848         (WebCore::GridTrackForNormalization::GridTrackForNormalization):
1849         (WebCore::RenderGrid::computeIntrinsicLogicalWidths):
1850         (WebCore::RenderGrid::computeUsedBreadthOfGridTracks):
1851         (WebCore::RenderGrid::computeNormalizedFractionBreadth):
1852         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctions):
1853         (WebCore::sortByGridTrackGrowthPotential):
1854         (WebCore::RenderGrid::distributeSpaceToTracks):
1855         (WebCore::RenderGrid::tracksAreWiderThanMinTrackBreadth):
1856         (WebCore::RenderGrid::layoutGridItems):
1857         (WebCore::RenderGrid::gridAreaBreadthForChild):
1858         (WebCore::RenderGrid::populateGridPositions):
1859         (WebCore::GridTrack::growUsedBreadth): Renamed to growBaseSize.
1860         (WebCore::GridTrack::usedBreadth): Renamed to baseSize.
1861         (WebCore::GridTrack::growMaxBreadth): Renamed to growGrowthLimit.
1862         (WebCore::GridTrack::maxBreadthIfNotInfinite): Renamed to
1863         growthLimitIfNotInfinite.
1864         * rendering/RenderGrid.h:
1865
1866 2015-02-08  Chris Fleizach  <cfleizach@apple.com>
1867
1868         AX: VoiceOver appears unresponsive when JavaScript alerts are triggered via focus or blur events
1869         https://bugs.webkit.org/show_bug.cgi?id=140485
1870
1871         Reviewed by Anders Carlsson.
1872
1873         If setting an accessibility attribute results in a modal alert being displayed, it can cause VoiceOver
1874         to hang. A simple solution is perform the actual work after a short delay, which will ensure the call
1875         returns without hanging.
1876
1877         Test: platform/mac/accessibility/setting-attributes-is-asynchronous.html
1878
1879         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1880         (-[WebAccessibilityObjectWrapper accessibilitySetValue:forAttribute:]):
1881         (-[WebAccessibilityObjectWrapper _accessibilitySetValue:forAttribute:]):
1882
1883 2015-02-08  Benjamin Poulain  <benjamin@webkit.org>
1884
1885         Add parsing support for CSS Selector L4's case-insensitive attribute
1886         https://bugs.webkit.org/show_bug.cgi?id=141373
1887
1888         Reviewed by Darin Adler.
1889
1890         This patch adds parsing for the case-insensitive attribute value
1891         matching of CSS Selectors Level 4: http://dev.w3.org/csswg/selectors-4/#attribute-case
1892         Excuse of a grammar: http://dev.w3.org/csswg/selectors-4/#grammar
1893
1894         This patch also covers serialization for CSSOM. The serialization
1895         is defined here: http://dev.w3.org/csswg/cssom/#serializing-selectors
1896
1897         Matching is completely ignored in this patch. All the simple selectors
1898         are treated as regular attribute selectors.
1899
1900         Tests: fast/css/parsing-css-attribute-case-insensitive-value-1.html
1901                fast/css/parsing-css-attribute-case-insensitive-value-2.html
1902                fast/css/parsing-css-attribute-case-insensitive-value-3.html
1903                fast/css/parsing-css-attribute-case-insensitive-value-4.html
1904
1905         * css/CSSGrammar.y.in:
1906         * css/CSSParserValues.h:
1907         (WebCore::CSSParserSelector::setAttributeValueMatchingIsCaseInsensitive):
1908         * css/CSSSelector.cpp:
1909         (WebCore::CSSSelector::CSSSelector):
1910         (WebCore::CSSSelector::selectorText):
1911         * css/CSSSelector.h:
1912         (WebCore::CSSSelector::CSSSelector):
1913         (WebCore::CSSSelector::setAttributeValueMatchingIsCaseInsensitive):
1914         (WebCore::CSSSelector::attributeValueMatchingIsCaseInsensitive):
1915
1916 2015-02-08  Darin Adler  <darin@apple.com>
1917
1918         Fix CMake-based build.
1919
1920         * CMakeLists.txt: Added a dependency on the CMakeLists.txt itself, analogous
1921         to the one I added in DerivedSources.make.
1922
1923 2015-02-08  Darin Adler  <darin@apple.com>
1924
1925         Fix debug build.
1926
1927         * bindings/js/JSEventListener.h: Removed a call to forwardEventListeners.
1928
1929 2015-02-08  Darin Adler  <darin@apple.com>
1930
1931         Remove the SVG instance tree
1932         https://bugs.webkit.org/show_bug.cgi?id=140602
1933
1934         Reviewed by Dean Jackson.
1935
1936         * CMakeLists.txt: Removed SVGElementInstance source files.
1937         * DerivedSources.cpp: Ditto.
1938         * DerivedSources.make: Ditto.
1939         * WebCore.vcxproj/WebCore.vcxproj: Ditto.
1940         * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
1941         * WebCore.xcodeproj/project.pbxproj: Ditto.
1942         * bindings/js/JSBindingsAllInOne.cpp: Ditto.
1943
1944         * bindings/js/JSEventListener.cpp:
1945         (WebCore::forwardsEventListeners): Deleted. Only returned true for JSSVGElementInstance.
1946         (WebCore::correspondingElementWrapper): Deleted. Only used for JSSVGElementInstance.
1947         (WebCore::createJSEventListenerForAttribute): Deleted. Argument type was JSSVGElementInstance.
1948         (WebCore::createJSEventListenerForAdd): Removed most of the code; later we can delete this entirely.
1949
1950         * bindings/js/JSEventListener.h: Removed the overload of createJSEventListenerForAttribute
1951         that takes a JSSVGElementInstance.
1952
1953         * bindings/js/JSSVGElementInstanceCustom.cpp: Removed.
1954
1955         * dom/ContainerNodeAlgorithms.h: Updated comment to reflect the fact that
1956         this code is really now only used for ContainerNode and no longer needs to
1957         exist in a generic form.
1958
1959         * dom/EventTarget.h: Removed forward declaration of SVGElementInstance.
1960         * svg/SVGElement.h: Ditto.
1961
1962         * dom/EventTargetFactory.in: Removed SVGElementInstance.
1963
1964         * svg/SVGElementInstance.cpp: Removed.
1965         * svg/SVGElementInstance.h: Removed.
1966         * svg/SVGElementInstance.idl: Removed.
1967
1968         * svg/SVGUseElement.cpp:
1969         (WebCore::SVGUseElement::insertedInto): Removed obsolete comment.
1970         (WebCore::SVGUseElement::instanceTreeIsLoading): Deleted. Unused
1971         function that I forgot to delete in my last patch. It also had a
1972         glaring mistake, a missing "return" before the recursive call to
1973         itself that would cause it to return false when it should return true.
1974
1975         * svg/SVGUseElement.h: Removed instanceTreeIsLoading.
1976
1977         * dom/EventDispatcher.cpp: Removed include of SVGElementInstance.h.
1978         * page/EventHandler.cpp: Ditto.
1979         * rendering/svg/RenderSVGViewportContainer.cpp: Ditto.
1980         * svg/SVGAElement.cpp: Ditto.
1981         * svg/SVGAllInOne.cpp: Ditto.
1982         * svg/SVGAnimateMotionElement.cpp: Ditto.
1983         * svg/SVGAnimatedTypeAnimator.h: Ditto.
1984         * svg/SVGAnimationElement.cpp: Ditto.
1985         * svg/SVGCircleElement.cpp: Ditto.
1986         * svg/SVGClipPathElement.cpp: Ditto.
1987         * svg/SVGComponentTransferFunctionElement.cpp: Ditto.
1988         * svg/SVGCursorElement.cpp: Ditto.
1989         * svg/SVGElement.cpp: Ditto.
1990         * svg/SVGEllipseElement.cpp: Ditto.
1991         * svg/SVGFEBlendElement.cpp: Ditto.
1992         * svg/SVGFEColorMatrixElement.cpp: Ditto.
1993         * svg/SVGFECompositeElement.cpp: Ditto.
1994         * svg/SVGFEConvolveMatrixElement.cpp: Ditto.
1995         * svg/SVGFEDiffuseLightingElement.cpp: Ditto.
1996         * svg/SVGFEDisplacementMapElement.cpp: Ditto.
1997         * svg/SVGFEDropShadowElement.cpp: Ditto.
1998         * svg/SVGFEGaussianBlurElement.cpp: Ditto.
1999         * svg/SVGFEImageElement.cpp: Ditto.
2000         * svg/SVGFELightElement.cpp: Ditto.
2001         * svg/SVGFEMergeNodeElement.cpp: Ditto.
2002         * svg/SVGFEMorphologyElement.cpp: Ditto.
2003         * svg/SVGFEOffsetElement.cpp: Ditto.
2004         * svg/SVGFESpecularLightingElement.cpp: Ditto.
2005         * svg/SVGFETileElement.cpp: Ditto.
2006         * svg/SVGFETurbulenceElement.cpp: Ditto.
2007         * svg/SVGFilterElement.cpp: Ditto.
2008         * svg/SVGFilterPrimitiveStandardAttributes.cpp: Ditto.
2009         * svg/SVGForeignObjectElement.cpp: Ditto.
2010         * svg/SVGGElement.cpp: Ditto.
2011         * svg/SVGGradientElement.cpp: Ditto.
2012         * svg/SVGGraphicsElement.cpp: Ditto.
2013         * svg/SVGImageElement.cpp: Ditto.
2014         * svg/SVGLineElement.cpp: Ditto.
2015         * svg/SVGLinearGradientElement.cpp: Ditto.
2016         * svg/SVGMarkerElement.cpp: Ditto.
2017         * svg/SVGMaskElement.cpp: Ditto.
2018         * svg/SVGPathElement.cpp: Ditto.
2019         * svg/SVGPatternElement.cpp: Ditto.
2020         * svg/SVGPolyElement.cpp: Ditto.
2021         * svg/SVGRadialGradientElement.cpp: Ditto.
2022         * svg/SVGRectElement.cpp: Ditto.
2023         * svg/SVGSVGElement.cpp: Ditto.
2024         * svg/SVGScriptElement.cpp: Ditto.
2025         * svg/SVGStopElement.cpp: Ditto.
2026         * svg/SVGSymbolElement.cpp: Ditto.
2027         * svg/SVGTRefElement.cpp: Ditto.
2028         * svg/SVGTextContentElement.cpp: Ditto.
2029         * svg/SVGTextElement.cpp: Ditto.
2030         * svg/SVGTextPathElement.cpp: Ditto.
2031         * svg/SVGTextPositioningElement.cpp: Ditto.
2032
2033 2015-02-07  Dean Jackson  <dino@apple.com>
2034
2035         Tweak inline playback controls to match system spec
2036         https://bugs.webkit.org/show_bug.cgi?id=141375
2037         <rdar://problem/19760754>
2038
2039         Reviewed by Sam Weinig.
2040
2041         Rework the UI of the inline media controls on iOS, to
2042         better match the system specification. I've batched a
2043         few changes into one patch because many of them are
2044         inter-dependent, and not very aggressive. Changes are:
2045
2046         - updated artwork for the buttons.
2047         - separate artwork for normal and active states.
2048         - background images are now explicitly sized and positioned
2049           in the middle of the element, allowing audio and video
2050           to use the same glyphs even though the elements are
2051           different sizes.
2052         - use plus-darker blend mode on the button glyphs.
2053         - rearranged some of the rules to group things in a
2054           logical order.
2055         - time should front-pad a "0" character, if less than 10.
2056         - no need for an "active" class on the Airplay button (although
2057           I won't be surprised if this changes back).
2058
2059         * Modules/mediacontrols/mediaControlsiOS.css:
2060         (::-webkit-media-controls):
2061         (video::-webkit-media-controls-wireless-playback-picker-button.active): Deleted.
2062         (audio::-webkit-media-controls-wireless-playback-picker-button.active): Deleted.
2063         (audio::-webkit-media-controls-play-button:active): Deleted.
2064         (audio::-webkit-media-controls-play-button.paused): Deleted.
2065         (video::-webkit-media-controls-timeline): Deleted.
2066         * Modules/mediacontrols/mediaControlsiOS.js:
2067         (ControllerIOS.prototype.updateWirelessPlaybackStatus): No need
2068         for the "active" class.
2069         (ControllerIOS.prototype.formatTime): Pad with a leading zero.
2070
2071 2015-02-08  Darin Adler  <darin@apple.com>
2072
2073         Make SVGUseElement work without creating any SVGElementInstance objects
2074         https://bugs.webkit.org/show_bug.cgi?id=141374
2075
2076         Reviewed by Sam Weinig.
2077
2078         * dom/ElementIterator.h: Changed the * and -> operators to be const.
2079         There is no need for the iterator itself to be modified just to dereference it.
2080
2081         * dom/TypedElementDescendantIterator.h: Added DoubleTypedElementDescendantIterator.
2082         This allows callers to call descendantsOfType on two elements, as long as the caller
2083         can guarantee that both have the same number of descendants of that type. It's handy
2084         for walking a tree of cloned elements to set up something between each original and
2085         its clone. In the future we might instead change the cloning machinery so it can do
2086         this work as we clone, and if so, we could consider deleting this.
2087
2088         * svg/SVGElement.cpp:
2089         (WebCore::SVGElement::correspondingElement): Made this const.
2090         (WebCore::SVGElement::invalidateInstances): Got rid of the rule that said "this can
2091         only be done for an element in a document", since it's useful to do this on an element
2092         that has just been removed from a document. Removed the "updateStyleIfNeeded" call
2093         here now that the other changes make it no longer needed. Removed an unimportant
2094         assertion that we only invalidate use elements that are in a document; that's not
2095         a necessary restriction. Streamlined the logic a bit.
2096
2097         * svg/SVGElement.h: Made correspondingElement const.
2098
2099         * svg/SVGUseElement.cpp:
2100         (WebCore::SVGUseElement::insertedInto): Removed an assertion about
2101         m_targetElementInstance since that's gone now.
2102         (WebCore::SVGUseElement::svgAttributeChanged): Changed code that transfers
2103         size attributes to the shadow tree to use shadowTreeTargetClone instead of
2104         m_targetElementInstance.
2105         (WebCore::SVGUseElement::clearResourceReferences): Removed code to detach
2106         m_targetElementInstance, and also the call to removeAllTargetReferencesForElement,
2107         because we no longer use those.
2108         (WebCore::SVGUseElement::buildPendingResource): Moved the code to build the
2109         shadow tree in here and deleted the buildShadowAndInstanceTree function.
2110         Also changed logic so that we use a pending resource any time the target is not
2111         a valid one. That helps us correctly handle cases where we initially have an
2112         invalid target, but later get a value one
2113         (WebCore::SVGUseElement::buildShadowAndInstanceTree): Deleted. The code here
2114         was greatly simplified and moved into buildPendingResource.
2115         (WebCore::SVGUseElement::buildInstanceTree): Deleted.
2116         (WebCore::SVGUseElement::hasCycleUseReferencing): Deleted. Cycles are now
2117         detected by the new isValidTarget function and so there's no need for a
2118         separate explicit check for a cycle.
2119         (WebCore::associateClonesWithOriginals): Added. Helper that makes
2120         functions that build the shadow tree simpler and easier to read.
2121         (WebCore::associateReplacementCloneWithOriginal): Added. Helper to
2122         make associateReplacementClonesWithOriginals simple.
2123         (WebCore::associateReplacementClonesWithOriginals): Added. Helper that
2124         makes functions that build the shadow tree simpler and easier to read.
2125         (WebCore::SVGUseElement::buildShadowTree): Call associateClonesWithOriginals
2126         since associateInstancesWithShadowTreeElements no longer does this.
2127         (WebCore::SVGUseElement::isValidTarget): Added. Covers all the different
2128         reasons a target might not be valid: type of element, reference cycles, and
2129         also "not in document" (refactored in here; not sure when that can happen
2130         in practice, might be possible to remove it later).
2131         (WebCore::SVGUseElement::expandUseElementsInShadowTree): Add checks for
2132         documents that are still loading; this used to be checked when building the
2133         instance tree. Added calls to associateReplacementClonesWithOriginals and
2134         associateClonesWithOriginals; that used to be done by later in the
2135         associateInstancesWithShadowTreeElements function. Use isValidTarget so
2136         we handle cycles as well as invalid target types.
2137         (WebCore::SVGUseElement::expandSymbolElementsInShadowTree): Added a call to
2138         associateReplacementClonesWithOriginals, since we can no longer do that in
2139         associateInstancesWithShadowTreeElements.
2140         (WebCore::SVGUseElement::associateInstancesWithShadowTreeElements): Deleted.
2141         (WebCore::SVGUseElement::instanceForShadowTreeElement): Deleted.
2142         (WebCore::SVGUseElement::invalidateDependentShadowTrees): Removed a comment
2143         that simply restated the name of the function.
2144
2145         * svg/SVGUseElement.h: Removed instanceForShadowTreeElement,
2146         buildShadowAndInstanceTree, detachInstance, buildInstanceTree,
2147         hasCycleUseReferencing, associateInstancesWithShadowTreeElements,
2148         instanceForShadowTreeElement, and m_targetElementInstance. Added isValidTarget.
2149
2150 2015-02-08  Chris Dumez  <cdumez@apple.com>
2151
2152         [WK2] Add logging to validate the network cache efficacy (Part 1)
2153         https://bugs.webkit.org/show_bug.cgi?id=141269
2154         <rdar://problem/19632080>
2155
2156         Reviewed by Antti Koivisto.
2157
2158         Export an extra symbol.
2159
2160         * WebCore.exp.in:
2161
2162 2015-02-07  Chris Fleizach  <cfleizach@apple.com>
2163
2164         AX: The input element with type="search" has no default focus outline
2165         https://bugs.webkit.org/show_bug.cgi?id=140326
2166
2167         Reviewed by Darin Adler.
2168
2169         The platform RenderTheme takes care of the search field, and that code
2170         was missing a check for whether the element was focused.
2171
2172         Test: fast/css/focus-ring-exists-for-search-field.html
2173
2174         * rendering/RenderThemeMac.mm:
2175         (WebCore::RenderThemeMac::paintSearchField):
2176
2177 2015-02-07  Tim Horton  <timothy_horton@apple.com>
2178
2179         Add some dictionary lookup tests
2180         https://bugs.webkit.org/show_bug.cgi?id=141355
2181
2182         Reviewed by Darin Adler.
2183
2184         Tests: platform/mac/editing/dictionary-lookup/dictionary-lookup-input.html
2185                platform/mac/editing/dictionary-lookup/dictionary-lookup-inside-selection.html
2186                platform/mac/editing/dictionary-lookup/dictionary-lookup-outside-selection.html
2187                platform/mac/editing/dictionary-lookup/dictionary-lookup-rtl.html
2188                platform/mac/editing/dictionary-lookup/dictionary-lookup.html
2189
2190         * WebCore.exp.in:
2191         Remove an unneeded export.
2192
2193         * editing/mac/DictionaryLookup.h:
2194         Use OBJC_CLASS instead of @class so that this can be included in pure-C++ files.
2195
2196         * testing/Internals.cpp:
2197         (WebCore::Internals::rangeForDictionaryLookupAtLocation):
2198         * testing/Internals.h:
2199         * testing/Internals.idl:
2200         Expose rangeForDictionaryLookupAtHitTestResult fairly directly to JavaScript.
2201
2202 2015-02-07  Chris Dumez  <cdumez@apple.com>
2203
2204         Add Vector::removeFirstMatching() / removeAllMatching() methods taking lambda functions
2205         https://bugs.webkit.org/show_bug.cgi?id=141321
2206
2207         Reviewed by Darin Adler.
2208
2209         Use new Vector::removeFirstMatching() / removeAllMatching() methods.
2210
2211 2015-02-07  Darin Adler  <darin@apple.com>
2212
2213         Stop dispatching events to with SVGElementInstance objects as their targets
2214         https://bugs.webkit.org/show_bug.cgi?id=141108
2215
2216         Reviewed by Anders Carlsson.
2217
2218         Test: svg/custom/use-event-retargeting.html
2219
2220         * dom/EventDispatcher.cpp:
2221         (WebCore::eventTargetRespectingTargetRules): Replaced the code that retargeted
2222         events at SVGElementInstance objects with code that retargets them at the use
2223         element instead. Also wrote the code in a simpler way.
2224
2225 2015-02-07  Jer Noble  <jer.noble@apple.com>
2226
2227         [Mac] Set -contentsScale on AVPlayerLayer to allow AVPlayer to select the appropriate HLS variant.
2228         https://bugs.webkit.org/show_bug.cgi?id=141354
2229         rdar://problem/19717591
2230
2231         Reviewed by Darin Adler.
2232
2233         AVPlayer will try to determine the correct HLS variant based on the bounds of an AVPlayerLayer.
2234         When not in a layer tree, AVFoundation is not able to determine the correct mapping from logical
2235         units to pixel values. To provide AVPlayer with that scaling value, set -contentsScale based on
2236         both the current device scale and the current page scale.
2237
2238         Since this needs to be set at initialization time, before the AVPlayer is has any AVPlayerItems,
2239         add some plumbing up from MediaPlayer to as the HTMLMediaElement for the appropriate contents
2240         scale.
2241
2242         * html/HTMLMediaElement.cpp:
2243         (WebCore::HTMLMediaElement::mediaPlayerContentsScale):
2244         * html/HTMLMediaElement.h:
2245         * platform/graphics/MediaPlayer.h:
2246         (WebCore::MediaPlayerClient::mediaPlayerContentsScale):
2247         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2248         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer):
2249         * platform/graphics/ca/GraphicsLayerCA.cpp:
2250         (WebCore::GraphicsLayerCA::updateContentsScale):
2251
2252 2015-02-07  Alexey Proskuryakov  <ap@apple.com>
2253
2254         ASan complains about plugins/snapshotting/snapshot-plugin-not-quite-blocked-by-image.html
2255         https://bugs.webkit.org/show_bug.cgi?id=141352
2256         rdar://problem/19717490
2257
2258         Reviewed by Anders Carlsson.
2259
2260         * dom/Document.cpp: (WebCore::Document::ensurePlugInsInjectedScript): This string
2261         is not null terminated.
2262
2263 2015-02-06  Zalan Bujtas  <zalan@apple.com>
2264
2265         ASSERT repaintContainer->hasLayer() in WebCore::RenderObject::repaintUsingContainer
2266         https://bugs.webkit.org/show_bug.cgi?id=140750
2267
2268         Reviewed by Simon Fraser.
2269
2270         There's a short period of time when RenderObject::layer() still returns a valid pointer
2271         even though we already cleared the hasLayer() flag.
2272         Do not use the layer as repaint container in such cases.
2273
2274         Test: compositing/repaint-container-assertion-when-toggling-compositing.html
2275
2276         * rendering/RenderObject.cpp:
2277         (WebCore::RenderObject::enclosingLayer):
2278
2279 2015-02-06  Chris Dumez  <cdumez@apple.com>
2280
2281         Have SQLiteStatement::database() return a reference
2282         https://bugs.webkit.org/show_bug.cgi?id=141348
2283
2284         Reviewed by Andreas Kling.
2285
2286         Have SQLiteStatement::database() return a reference as it can never
2287         return null.
2288
2289         * loader/icon/IconDatabase.cpp:
2290         (WebCore::readySQLiteStatement):
2291         * platform/sql/SQLiteStatement.h:
2292         (WebCore::SQLiteStatement::database):
2293
2294 2015-02-06  Brent Fulgham  <bfulgham@apple.com>
2295
2296         Add youtube-nocookie URL to isYouTubeURL predicate 
2297         https://bugs.webkit.org/show_bug.cgi?id=141347
2298         <rdar://problem/19430657>
2299
2300         Reviewed by Eric Carlson.
2301
2302         * Modules/plugins/YouTubePluginReplacement.cpp:
2303         (WebCore::isYouTubeURL): Update for additional youtube-nocookie site.
2304
2305 2015-02-06  Said Abou-Hallawa  <sabouhallawa@apple.com>
2306
2307         Invalid cast in WebCore::SVGAnimateElement::calculateAnimatedValue.
2308         https://bugs.webkit.org/show_bug.cgi?id=135171.
2309
2310         Reviewed by Dean Jackson.
2311
2312         The bug happens when an SVG element is animated by <animateMotion> followed by an
2313         <animateColor> or an <animate> and the values of the "attributeName" in both elements
2314         are the same. The problem is <animateMotion> should not have an attribute to animate.
2315         If it does by fuzz or by mistake, then we assume the <animateMotion> and the <animate>
2316         animate the same attribute for the same element target. Therefore we schedule them in
2317         the same AnimationVector in SMILTimeContainer::schedule(). When we call
2318         SVGAnimateElementBase::calculateAnimatedValue() for an SVGAnimateColorElement and the
2319         resultElement is SVGAnimateMotionElement, we fail to cast it to SVGAnimateElementBase
2320         because SVGAnimateMotionElement is derived from SVGAnimationElement which is the base
2321         class of all animate elements including SVGAnimateElementBase.
2322
2323         The fix is to nullify setting "attributeName" of an SVGAnimationElement. By doing so,
2324         "attributeName" and its value will be ignored from the <animateMotion> which is correct.
2325         
2326         Tests: svg/animations/animate-montion-invalid-attribute.svg.
2327
2328         * svg/SVGAnimateElementBase.cpp:
2329         (WebCore::SVGAnimateElementBase::setAttributeName):
2330         Do not call SVGAnimationElement::setAttributeName() since SVGAnimationElement should
2331         not have an attribute to animate. We prevent this by bypassing the parent in the class 
2332         hierarchy: SVGAnimationElement and calling SVGSMILElement::setAttributeName() directly.
2333         
2334         * svg/SVGAnimationElement.cpp:
2335         (WebCore::SVGAnimationElement::setAttributeName): Deleted.
2336         * svg/SVGAnimationElement.h:
2337         SVGAnimationElement should not have an attribute to animate. So implement its
2338         setAttributeName() as a null function.
2339
2340 2015-02-06  Simon Fraser  <simon.fraser@apple.com>
2341
2342         Convert the compositing overlap map to use LayoutRects
2343         https://bugs.webkit.org/show_bug.cgi?id=141346
2344         rdar://problem/18206365
2345
2346         Reviewed by Zalan Bujtas.
2347         
2348         If two compositing layers were adjoining but not overlapping, but happened to
2349         have non-integral offsets, then using enclosing IntRects in the overlap map
2350         would cause us to think they are overlapping, and create unnecessary backing store.
2351         
2352         Fix by converting the overlap map to use LayoutRects.
2353
2354         Test: compositing/layer-creation/subpixel-adjacent-layers-overlap.html
2355
2356         * rendering/RenderLayerCompositor.cpp:
2357         (WebCore::OverlapMapContainer::add):
2358         (WebCore::OverlapMapContainer::overlapsLayers):
2359         (WebCore::RenderLayerCompositor::OverlapMap::add):
2360         (WebCore::RenderLayerCompositor::OverlapMap::overlapsLayers):
2361         (WebCore::RenderLayerCompositor::OverlapMap::RectList::append):
2362         (WebCore::RenderLayerCompositor::OverlapMap::RectList::intersects):
2363         (WebCore::RenderLayerCompositor::logLayerInfo):
2364         (WebCore::RenderLayerCompositor::addToOverlapMap):
2365         (WebCore::RenderLayerCompositor::addToOverlapMapRecursive):
2366         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
2367         * rendering/RenderLayerCompositor.h:
2368
2369 2015-02-06  Andreas Kling  <akling@apple.com>
2370
2371         Ref-ify various getters that return HTMLCollection.
2372         <https://webkit.org/b/141336>
2373
2374         Reviewed by Anders Carlsson.
2375
2376         Make all the getters that return HTMLCollection objects (and never return nullptr)
2377         return Ref instead of RefPtr.
2378
2379         Removed a couple of useless null checks that were exposed by this change.
2380
2381         * accessibility/AccessibilityRenderObject.cpp:
2382         (WebCore::AccessibilityRenderObject::getDocumentLinks):
2383         * bindings/js/JSDOMWindowCustom.cpp:
2384         (WebCore::namedItemGetter):
2385         * bindings/js/JSHTMLDocumentCustom.cpp:
2386         (WebCore::JSHTMLDocument::nameGetter):
2387         * dom/Document.cpp:
2388         (WebCore::Document::ensureCachedCollection):
2389         (WebCore::Document::images):
2390         (WebCore::Document::applets):
2391         (WebCore::Document::embeds):
2392         (WebCore::Document::plugins):
2393         (WebCore::Document::scripts):
2394         (WebCore::Document::links):
2395         (WebCore::Document::forms):
2396         (WebCore::Document::anchors):
2397         (WebCore::Document::all):
2398         (WebCore::Document::windowNamedItems):
2399         (WebCore::Document::documentNamedItems):
2400         (WebCore::Document::iconURLs):
2401         * dom/Document.h:
2402         * dom/Element.cpp:
2403         (WebCore::Element::ensureCachedHTMLCollection):
2404         * dom/Element.h:
2405         * html/ColorInputType.cpp:
2406         (WebCore::ColorInputType::suggestions):
2407         * html/HTMLDataListElement.cpp:
2408         (WebCore::HTMLDataListElement::options):
2409         * html/HTMLDataListElement.h:
2410         * html/HTMLElement.cpp:
2411         (WebCore::HTMLElement::children):
2412         * html/HTMLElement.h:
2413         * html/HTMLFieldSetElement.cpp:
2414         (WebCore::HTMLFieldSetElement::elements):
2415         * html/HTMLFieldSetElement.h:
2416         * html/HTMLFormElement.cpp:
2417         (WebCore::HTMLFormElement::elements):
2418         * html/HTMLFormElement.h:
2419         * html/HTMLInputElement.cpp:
2420         (WebCore::HTMLInputElement::setupDateTimeChooserParameters):
2421         * html/HTMLMapElement.cpp:
2422         (WebCore::HTMLMapElement::areas):
2423         * html/HTMLMapElement.h:
2424         * html/HTMLSelectElement.cpp:
2425         (WebCore::HTMLSelectElement::selectedOptions):
2426         (WebCore::HTMLSelectElement::options):
2427         * html/HTMLSelectElement.h:
2428         * html/HTMLTableElement.cpp:
2429         (WebCore::HTMLTableElement::rows):
2430         (WebCore::HTMLTableElement::tBodies):
2431         * html/HTMLTableElement.h:
2432         * html/HTMLTableRowElement.cpp:
2433         (WebCore::HTMLTableRowElement::insertCell):
2434         (WebCore::HTMLTableRowElement::deleteCell):
2435         (WebCore::HTMLTableRowElement::cells):
2436         * html/HTMLTableRowElement.h:
2437         * html/HTMLTableSectionElement.cpp:
2438         (WebCore::HTMLTableSectionElement::insertRow):
2439         (WebCore::HTMLTableSectionElement::deleteRow):
2440         (WebCore::HTMLTableSectionElement::rows):
2441         * html/HTMLTableSectionElement.h:
2442         * html/RangeInputType.cpp:
2443         (WebCore::RangeInputType::updateTickMarkValues):
2444         * rendering/RenderTheme.cpp:
2445         (WebCore::RenderTheme::paintSliderTicks):
2446
2447 2015-02-06  Brent Fulgham  <bfulgham@apple.com>
2448
2449         [iOS] Implement audio track selection in fullscreen.
2450         https://bugs.webkit.org/show_bug.cgi?id=131236
2451         <rdar://problem/16552632>
2452
2453         Reviewed by Eric Carlson.
2454
2455         * platform/ios/WebVideoFullscreenModelVideoElement.h:
2456         * platform/ios/WebVideoFullscreenModelVideoElement.mm:
2457         (WebVideoFullscreenModelVideoElement::selectAudioMediaOption): Provide implementation.
2458         (WebVideoFullscreenModelVideoElement::updateLegibleOptions): Add audio track information
2459         to menu displayed to user.
2460
2461 2015-02-06  Bartlomiej Gajda  <b.gajda@samsung.com>
2462
2463         [MSE] Implement Append Error algorithm.
2464         https://bugs.webkit.org/show_bug.cgi?id=139439
2465
2466         Reviewed by Jer Noble.
2467
2468         If Source Buffer has not received first init segment, then it shall call endOfStream after receiving
2469         Media Segment, as per Media Source spec. (from 17 July 2014) in paragraph 3.5.1 point 6.1.
2470
2471         Based this change on Editor's Draft 12 December 2014, as it clarifies order of events.
2472
2473         Test: media/media-source/media-source-append-media-segment-without-init.html
2474
2475         * Modules/mediasource/MediaSource.cpp:
2476         (WebCore::MediaSource::streamEndedWithError):
2477         * Modules/mediasource/MediaSource.h:
2478         * Modules/mediasource/SourceBuffer.cpp:
2479         (WebCore::SourceBuffer::sourceBufferPrivateAppendComplete):
2480         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment):
2481         (WebCore::SourceBuffer::validateInitializationSegment):
2482         (WebCore::SourceBuffer::appendError):
2483         * Modules/mediasource/SourceBuffer.h:
2484
2485 2015-02-06  Timothy Horton  <timothy_horton@apple.com>
2486
2487         REGRESSION: Lookup doesn't work in RTL
2488         https://bugs.webkit.org/show_bug.cgi?id=141338
2489         <rdar://problem/19738407>
2490
2491         Reviewed by Dan Bernstein.
2492
2493         * editing/Editor.cpp:
2494         (WebCore::Editor::scanSelectionForTelephoneNumbers):
2495         * editing/mac/DictionaryLookup.mm:
2496         (WebCore::rangeExpandedAroundPositionByCharacters):
2497         Positions are independent of writing direction, so we don't
2498         need to (and shouldn't) do anything special for RTL here.
2499
2500 2015-02-06  Maciej Stachowiak  <mjs@apple.com>
2501
2502         REGRESSION(r179706): Caused memory corruption on some tests (Requested by _ap_ on #webkit).
2503         https://bugs.webkit.org/show_bug.cgi?id=141324
2504
2505         Reviewed by Alexey Proskuryakov.
2506
2507         No new tests. This is caught by existing tests under ASAN, and I don't know how to reproduce
2508         it without ASAN.
2509
2510         * rendering/RenderLineBoxList.cpp:
2511         (WebCore::RenderLineBoxList::dirtyLinesFromChangedChild): Give up
2512         and just always invalidate the next line. It's too hard to come up
2513         with the condition that catches all needed cases, doesn't itself
2514         cause a crash, and isn't overzealous. And we do this for the
2515         previous line anyway.  Also clean up the code a bit since it
2516         confusingly reuses a variable, and declares it uninitialized, for
2517         no good reason.
2518
2519 2015-02-05  Dhi Aurrahman  <diorahman@rockybars.com>
2520
2521         Remove duplicate loop after r179532
2522         https://bugs.webkit.org/show_bug.cgi?id=141300
2523
2524         Reviewed by Benjamin Poulain.
2525
2526         No new tests, no behavior changed.
2527
2528         * css/SelectorCheckerTestFunctions.h:
2529         (WebCore::matchesLangPseudoClass):
2530
2531 2015-02-05  Commit Queue  <commit-queue@webkit.org>
2532
2533         Unreviewed, rolling out r179725.
2534         https://bugs.webkit.org/show_bug.cgi?id=141320
2535
2536         caused 2 layout tests to fail (Requested by zalan on #webkit).
2537
2538         Reverted changeset:
2539
2540         "[MSE] Implement Append Error algorithm."
2541         https://bugs.webkit.org/show_bug.cgi?id=139439
2542         http://trac.webkit.org/changeset/179725
2543
2544 2015-02-05  Andreas Kling  <akling@apple.com>
2545
2546         [iOS] Run a full garbage collection on memory warning.
2547         <https://webkit.org/b/141313>
2548         <rdar://problem/19738024>
2549
2550         Reviewed by Chris Dumez.
2551
2552         Make sure that we run a full GC when trying to free up memory, as this might
2553         be our last chance to execute before the kernel suspends this process.
2554
2555         This aligns WebKit2 with the old WebKit1 behavior.
2556
2557         * platform/cocoa/MemoryPressureHandlerCocoa.mm:
2558         (WebCore::MemoryPressureHandler::platformReleaseMemory):
2559
2560
2561 2015-02-05  Hyungwook Lee  <hyungwook.lee@navercorp.com>
2562
2563         Fix ASSERTION FAILED: !root->needsLayout() in FrameView::layout()
2564         https://bugs.webkit.org/show_bug.cgi?id=141032
2565
2566         Reviewed by Darin Adler.
2567
2568         This patch moves the !root->needsLayout() assert statement above
2569         updateLayerPositionsAfterLayout() that can modify dirty bit system
2570         when we have RenderMarquee.
2571
2572         * page/FrameView.cpp:
2573         (WebCore::FrameView::layout):
2574
2575 2015-02-05  Bartlomiej Gajda  <b.gajda@samsung.com>
2576
2577         [MSE] Implement Append Error algorithm.
2578         https://bugs.webkit.org/show_bug.cgi?id=139439
2579
2580         Reviewed by Jer Noble.
2581
2582         If Source Buffer has not received first init segment, then it shall call endOfStream after receiving
2583         Media Segment, as per Media Source spec. (from 17 July 2014) in paragraph 3.5.1 point 6.1.
2584
2585         Based this change on Editor's Draft 12 December 2014, as it clarifies order of events.
2586
2587         Test: media/media-source/media-source-append-media-segment-without-init.html
2588
2589         * Modules/mediasource/MediaSource.cpp:
2590         (WebCore::MediaSource::streamEndedWithError):
2591         * Modules/mediasource/MediaSource.h:
2592         * Modules/mediasource/SourceBuffer.cpp:
2593         (WebCore::SourceBuffer::sourceBufferPrivateAppendComplete):
2594         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment):
2595         (WebCore::SourceBuffer::validateInitializationSegment):
2596         (WebCore::SourceBuffer::appendError):
2597         * Modules/mediasource/SourceBuffer.h:
2598
2599 2015-02-05  Maciej Stachowiak  <mjs@apple.com>
2600
2601         Crash due to failing to dirty a removed text node's line box
2602         https://bugs.webkit.org/show_bug.cgi?id=136544
2603
2604         Reviewed by David Hyatt.
2605         
2606         Test: fast/text/remove-text-node-linebox-not-dirty-crash.html
2607
2608         * rendering/RenderLineBoxList.cpp:
2609         (WebCore::RenderLineBoxList::dirtyLinesFromChangedChild): Make the check for dirtying the next
2610         line box a bit more inclusive to avoid a case of a line box for a destroyed render object not
2611         being dirtied. In particular, when the text node's parent has no line boxes but contains BRs.
2612
2613 2015-02-05  Chris Dumez  <cdumez@apple.com>
2614
2615         Free memory read under MemoryCache::pruneLiveResourcesToSize()
2616         https://bugs.webkit.org/show_bug.cgi?id=141292
2617         <rdar://problem/19725522>
2618
2619         Reviewed by Antti Koivisto.
2620
2621         In MemoryCache::pruneLiveResourcesToSize(), we were iterating over the
2622         m_liveDecodedResources ListHashSet and possibly calling
2623         CachedResource::destroyDecodedData() on the current value. Doing so
2624         would cause a call to ListHashSet::remove() to remove the value pointed
2625         by the current iterator, thus invalidating our iterator.
2626
2627         In this patch, we increment the ListHashSet iterator *before* calling
2628         CachedResource::destroyDecodedData(), while the current iterator is
2629         still valid. Note that this is safe because unlike iteration of most
2630         WTF Hash data structures, iteration is guaranteed safe against mutation
2631         of the ListHashSet, except for removal of the item currently pointed to
2632         by a given iterator.
2633
2634         Test: http/tests/cache/memory-cache-pruning.html
2635
2636         * loader/cache/MemoryCache.cpp:
2637         (WebCore::MemoryCache::pruneLiveResourcesToSize):
2638
2639 2015-02-05  Jer Noble  <jer.noble@apple.com>
2640
2641         [Mac] HLS <video> will not fire 'progress' events, only 'stalled'.
2642         https://bugs.webkit.org/show_bug.cgi?id=141284
2643
2644         Reviewed by Brent Fulgham.
2645
2646         Test: http/tests/media/hls/hls-progress.html
2647
2648         totalBytes() will always return 0 for HLS streams, which will cause didLoadingProgress() to always
2649         return false. Skip this optimization. 
2650
2651         Drive-by fix: duration() will always return 0 for this class as well. Use durationMediaTime() instead.
2652
2653         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
2654         (WebCore::MediaPlayerPrivateAVFoundation::didLoadingProgress):
2655
2656 2015-02-05  Darin Adler  <darin@apple.com>
2657
2658         Move InstanceInvalidationGuard/UpdateBlocker to SVGElement from SVGElementInstance
2659         https://bugs.webkit.org/show_bug.cgi?id=141148
2660
2661         Reviewed by Brent Fulgham and Anders Carlsson.
2662
2663         Inspired by this change Rob Buis made in Blink:
2664
2665             http://src.chromium.org/viewvc/blink?view=revision&revision=173343
2666
2667         I actually wrote the whole thing and then discovered we did it almost identically.
2668
2669         * svg/SVGAnimatedTypeAnimator.cpp:
2670         (WebCore::SVGElementAnimatedPropertyList::setInstanceUpdatesBlocked): Added this
2671         helper function to get around a circular header dependency.
2672         * svg/SVGAnimatedTypeAnimator.h:
2673         (WebCore::SVGAnimatedTypeAnimator::executeAction): Use setInstanceUpdatesBlocked.
2674
2675         * svg/SVGElement.cpp:
2676         (WebCore::SVGElement::removedFrom): Use invalidateInstances.
2677         (WebCore::SVGElement::finishParsingChildren): Ditto.
2678         (WebCore::SVGElement::svgAttributeChanged): Ditto.
2679         (WebCore::SVGElement::childrenChanged): Ditto.
2680         (WebCore::SVGElement::setInstanceUpdatesBlocked): Added an assertion that will
2681         catch anyone who nests InstanceUpdateBlocker by accident.
2682         (WebCore::SVGElement::invalidateInstances): Moved this here from
2683         SVGElementInstance::invalidateAllInstancesOfElement. I had already modified this
2684         so it had nothing to do with SVGElementInstance, so it was a simple matter of
2685         converting this into a member function. Added a FIXME about the mysterious
2686         updateStyleIfNeeded that makes multiple tests fail if it's removed.
2687
2688         * svg/SVGElement.h: Added public InstanceUpdateBlocker class, protected
2689         InstanceInvalidationGuard class, and private invalidateInstances function.
2690         Unlike the ones in SVGElementInstance these use references so they are then
2691         not copyable without using the WTF_MAKE_NONCOPYABLE macro.
2692
2693         * svg/SVGElementInstance.cpp:
2694         (WebCore::SVGElementInstance::invalidateAllInstancesOfElement): Deleted.
2695         (WebCore::SVGElementInstance::InstanceUpdateBlocker::InstanceUpdateBlocker): Deleted.
2696         (WebCore::SVGElementInstance::InstanceUpdateBlocker::~InstanceUpdateBlocker): Deleted.
2697         * svg/SVGElementInstance.h: Removed InvalidationGuard, InstanceUpdateBlocker, and
2698         invalidateAllInstancesOfElement. Didn't do any further cleanup since we soon will
2699         delete this entire file.
2700
2701         * svg/SVGAElement.cpp:
2702         (WebCore::SVGAElement::svgAttributeChanged): Updated to use new name and reference
2703         instead of pointer.
2704         * svg/SVGAnimateElementBase.cpp:
2705         (WebCore::applyCSSPropertyToTargetAndInstances): Ditto.
2706         (WebCore::removeCSSPropertyFromTargetAndInstances): Ditto.
2707         (WebCore::notifyTargetAndInstancesAboutAnimValChange): Ditto.
2708         * svg/SVGAnimatedPath.cpp:
2709         (WebCore::SVGAnimatedPathAnimator::startAnimValAnimation): Ditto.
2710         * svg/SVGCircleElement.cpp:
2711         (WebCore::SVGCircleElement::svgAttributeChanged): Ditto.
2712         * svg/SVGClipPathElement.cpp:
2713         (WebCore::SVGClipPathElement::svgAttributeChanged): Ditto.
2714         * svg/SVGComponentTransferFunctionElement.cpp:
2715         (WebCore::SVGComponentTransferFunctionElement::svgAttributeChanged): Ditto.
2716         * svg/SVGCursorElement.cpp:
2717         (WebCore::SVGCursorElement::svgAttributeChanged): Ditto.
2718         * svg/SVGEllipseElement.cpp:
2719         (WebCore::SVGEllipseElement::svgAttributeChanged): Ditto.
2720         * svg/SVGFEBlendElement.cpp:
2721         (WebCore::SVGFEBlendElement::svgAttributeChanged): Ditto.
2722         * svg/SVGFEColorMatrixElement.cpp:
2723         (WebCore::SVGFEColorMatrixElement::svgAttributeChanged): Ditto.
2724         * svg/SVGFECompositeElement.cpp:
2725         (WebCore::SVGFECompositeElement::svgAttributeChanged): Ditto.
2726         * svg/SVGFEConvolveMatrixElement.cpp:
2727         (WebCore::SVGFEConvolveMatrixElement::svgAttributeChanged): Ditto.
2728         * svg/SVGFEDiffuseLightingElement.cpp:
2729         (WebCore::SVGFEDiffuseLightingElement::svgAttributeChanged): Ditto.
2730         * svg/SVGFEDisplacementMapElement.cpp:
2731         (WebCore::SVGFEDisplacementMapElement::svgAttributeChanged): Ditto.
2732         * svg/SVGFEDropShadowElement.cpp:
2733         (WebCore::SVGFEDropShadowElement::svgAttributeChanged): Ditto.
2734         * svg/SVGFEGaussianBlurElement.cpp:
2735         (WebCore::SVGFEGaussianBlurElement::svgAttributeChanged): Ditto.
2736         * svg/SVGFEImageElement.cpp:
2737         (WebCore::SVGFEImageElement::svgAttributeChanged): Ditto.
2738         * svg/SVGFELightElement.cpp:
2739         (WebCore::SVGFELightElement::svgAttributeChanged): Ditto.
2740         * svg/SVGFEMergeNodeElement.cpp:
2741         (WebCore::SVGFEMergeNodeElement::svgAttributeChanged): Ditto.
2742         * svg/SVGFEMorphologyElement.cpp:
2743         (WebCore::SVGFEMorphologyElement::svgAttributeChanged): Ditto.
2744         * svg/SVGFEOffsetElement.cpp:
2745         (WebCore::SVGFEOffsetElement::svgAttributeChanged): Ditto.
2746         * svg/SVGFESpecularLightingElement.cpp:
2747         (WebCore::SVGFESpecularLightingElement::svgAttributeChanged): Ditto.
2748         * svg/SVGFETileElement.cpp:
2749         (WebCore::SVGFETileElement::svgAttributeChanged): Ditto.
2750         * svg/SVGFETurbulenceElement.cpp:
2751         (WebCore::SVGFETurbulenceElement::svgAttributeChanged): Ditto.
2752         * svg/SVGFilterElement.cpp:
2753         (WebCore::SVGFilterElement::svgAttributeChanged): Ditto.
2754         * svg/SVGFilterPrimitiveStandardAttributes.cpp:
2755         (WebCore::SVGFilterPrimitiveStandardAttributes::svgAttributeChanged): Ditto.
2756         * svg/SVGForeignObjectElement.cpp:
2757         (WebCore::SVGForeignObjectElement::svgAttributeChanged): Ditto.
2758         * svg/SVGGElement.cpp:
2759         (WebCore::SVGGElement::svgAttributeChanged): Ditto.
2760         * svg/SVGGradientElement.cpp:
2761         (WebCore::SVGGradientElement::svgAttributeChanged): Ditto.
2762         * svg/SVGGraphicsElement.cpp:
2763         (WebCore::SVGGraphicsElement::svgAttributeChanged): Ditto.
2764         * svg/SVGImageElement.cpp:
2765         (WebCore::SVGImageElement::svgAttributeChanged): Ditto.
2766         * svg/SVGLineElement.cpp:
2767         (WebCore::SVGLineElement::svgAttributeChanged): Ditto.
2768         * svg/SVGLinearGradientElement.cpp:
2769         (WebCore::SVGLinearGradientElement::svgAttributeChanged): Ditto.
2770         * svg/SVGMPathElement.cpp:
2771         (WebCore::SVGMPathElement::svgAttributeChanged): Ditto.
2772         * svg/SVGMarkerElement.cpp:
2773         (WebCore::SVGMarkerElement::svgAttributeChanged): Ditto.
2774         * svg/SVGMaskElement.cpp:
2775         (WebCore::SVGMaskElement::svgAttributeChanged): Ditto.
2776         * svg/SVGPathElement.cpp:
2777         (WebCore::SVGPathElement::svgAttributeChanged): Ditto.
2778         * svg/SVGPatternElement.cpp:
2779         (WebCore::SVGPatternElement::svgAttributeChanged): Ditto.
2780         * svg/SVGPolyElement.cpp:
2781         (WebCore::SVGPolyElement::svgAttributeChanged): Ditto.
2782         * svg/SVGRadialGradientElement.cpp:
2783         (WebCore::SVGRadialGradientElement::svgAttributeChanged): Ditto.
2784         * svg/SVGRectElement.cpp:
2785         (WebCore::SVGRectElement::svgAttributeChanged): Ditto.
2786         * svg/SVGSVGElement.cpp:
2787         (WebCore::SVGSVGElement::svgAttributeChanged): Ditto.
2788         * svg/SVGScriptElement.cpp:
2789         (WebCore::SVGScriptElement::svgAttributeChanged): Ditto.
2790         * svg/SVGStopElement.cpp:
2791         (WebCore::SVGStopElement::svgAttributeChanged): Ditto.
2792         * svg/SVGSymbolElement.cpp:
2793         (WebCore::SVGSymbolElement::svgAttributeChanged): Ditto.
2794         * svg/SVGTRefElement.cpp:
2795         (WebCore::SVGTRefElement::svgAttributeChanged): Ditto.
2796         * svg/SVGTextContentElement.cpp:
2797         (WebCore::SVGTextContentElement::svgAttributeChanged): Ditto.
2798         * svg/SVGTextPathElement.cpp:
2799         (WebCore::SVGTextPathElement::svgAttributeChanged): Ditto.
2800         * svg/SVGTextPositioningElement.cpp:
2801         (WebCore::SVGTextPositioningElement::svgAttributeChanged): Ditto.
2802         * svg/SVGUseElement.cpp:
2803         (WebCore::SVGUseElement::svgAttributeChanged): Ditto.
2804         * svg/animation/SVGSMILElement.cpp:
2805         (WebCore::SVGSMILElement::svgAttributeChanged): Ditto.
2806
2807 2015-02-05  Brent Fulgham  <bfulgham@apple.com>
2808
2809         Remind ourselves to remove work-around code
2810         https://bugs.webkit.org/show_bug.cgi?id=141289
2811
2812         Unreviewed gardening: Add a reminder FIXME to CSSParser
2813         so we can remove the MSVC-specific hack in the future.
2814
2815         * css/CSSParser.cpp:
2816
2817 2015-02-05  Zalan Bujtas  <zalan@apple.com>
2818
2819         Do not destroy RenderQuote's text fragment child when quotation mark string is changing.
2820         https://bugs.webkit.org/show_bug.cgi?id=141271
2821         rdar://problem/18169375
2822
2823         Reviewed by Antti Koivisto.
2824
2825         Similar approach as https://codereview.chromium.org/679593004/
2826
2827         This patch ensures that laying out a RenderQuote does not force a sibling RenderQuote's
2828         child renderer(RenderText) to be destroyed.
2829         BreakingContext holds a pointer to the next renderer on the line (BreakingContext::m_nextObject).
2830         While laying out the line, initiated by BreakingContext, placing the current renderer could end up destroying the "next" renderer.
2831         This happens when the pseudo after quotation mark(RenderQuote) becomes floated, the sibling <q>'s pseudo
2832         before text needs to be changed (from " to ') so that we don't end up with 2 sets of the same opening
2833         strings.
2834         The fix is to reuse the RenderTextFragment object instead of destroy/recreate it.
2835
2836         Test: fast/css/content/quote-crash-when-floating.html
2837
2838         * rendering/RenderQuote.cpp:
2839         (WebCore::RenderQuote::RenderQuote):
2840         (WebCore::fragmentChild):
2841         (WebCore::RenderQuote::updateText):
2842         * rendering/RenderQuote.h:
2843         * rendering/RenderTextFragment.cpp:
2844         (WebCore::RenderTextFragment::setText):
2845         (WebCore::RenderTextFragment::setContentString):
2846         * rendering/RenderTextFragment.h:
2847
2848 2015-02-04  Dean Jackson  <dino@apple.com>
2849
2850         [Media iOS] Add a debug setting to always show the optimized fullscreen button
2851         https://bugs.webkit.org/show_bug.cgi?id=141277
2852         <rdar://problem/19724471>
2853
2854         Reviewed by Eric Carlson.
2855
2856         Add a debug option so that we can test the optimized fullscreen
2857         control on media that doesn't support it.
2858
2859         * Modules/mediacontrols/mediaControlsiOS.js: Add gSimulateOptimizedFullscreenAvailable.
2860         (ControllerIOS.prototype.createControls): Check the setting.
2861         (ControllerIOS.prototype.configureInlineControls): Ditto.
2862         (ControllerIOS.prototype.formatTime): Drive-by whitespace cleanup.
2863         (ControllerIOS.prototype.handleBaseGestureChange):
2864         (ControllerIOS.prototype.handleWrapperTouchStart):
2865         (ControllerIOS.prototype.handleOptimizedFullscreenTouchEnd):
2866         (ControllerIOS.prototype.handlePresentationModeChange): Drive-by variable renaming.
2867
2868 2015-02-05  Youenn Fablet  <youenn.fablet@crf.canon.fr> and Xabier Rodriguez Calvar <calvaris@igalia.com>
2869
2870         [Streams API] Implement a barebone ReadableStream interface
2871         https://bugs.webkit.org/show_bug.cgi?id=141045
2872
2873         Reviewed by Benjamin Poulain.
2874
2875         This patch implements the ReadableStream IDL (https://streams.spec.whatwg.org/#rs-model).
2876         No functionality is yet added.
2877         ReadableStreamSource is expected to be implemented for native sources (such as HTTP sources)
2878         as well as JavaScript source through ReadableStreamJSSource.
2879
2880         Test: streams/readablestream-constructor.html
2881
2882         * CMakeLists.txt:
2883         * Configurations/FeatureDefines.xcconfig:
2884         * DerivedSources.cpp:
2885         * DerivedSources.make:
2886         * Modules/streams/ReadableStream.cpp: Added.
2887         (WebCore::ReadableStream::create):
2888         (WebCore::ReadableStream::ReadableStream):
2889         (WebCore::ReadableStream::~ReadableStream):
2890         (WebCore::ReadableStream::state):
2891         (WebCore::ReadableStream::closed):
2892         (WebCore::ReadableStream::ready):
2893         * Modules/streams/ReadableStream.h: Added.
2894         * Modules/streams/ReadableStream.idl: Added.
2895         * Modules/streams/ReadableStreamSource.h: Added.
2896         * WebCore.vcxproj/WebCore.vcxproj:
2897         * WebCore.vcxproj/WebCore.vcxproj.filters:
2898         * WebCore.vcxproj/WebCoreCommon.props:
2899         * WebCore.xcodeproj/project.pbxproj:
2900         * bindings/js/JSBindingsAllInOne.cpp:
2901         * bindings/js/JSReadableStreamCustom.cpp: Added.
2902         (WebCore::JSReadableStream::read):
2903         (WebCore::JSReadableStream::ready):
2904         (WebCore::JSReadableStream::closed):
2905         (WebCore::JSReadableStream::cancel):
2906         (WebCore::JSReadableStream::pipeTo):
2907         (WebCore::JSReadableStream::pipeThrough):
2908         (WebCore::constructJSReadableStream):
2909         * bindings/js/ReadableStreamJSSource.cpp: Added.
2910         (WebCore::ReadableStreamJSSource::create):
2911         (WebCore::ReadableStreamJSSource::ReadableStreamJSSource):
2912         (WebCore::ReadableStreamJSSource::setInternalError):
2913         * bindings/JSReadableStreamJSSource.h: Added.
2914
2915 2015-02-04  Brent Fulgham  <bfulgham@apple.com>
2916
2917         [Win] Unreviewed project file corrections.
2918
2919         Correct some parsing errors caused by recent manual editing of
2920         the project files.
2921
2922         * WebCore.vcxproj/WebCore.vcxproj:
2923         * WebCore.vcxproj/WebCore.vcxproj.filters:
2924
2925 2015-02-04  Eric Carlson  <eric.carlson@apple.com>
2926
2927         [iOS] add method to toggle playback when in the background
2928         https://bugs.webkit.org/show_bug.cgi?id=141270
2929
2930         Reviewed by Dean Jackson.
2931
2932         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
2933         (-[WebAVPlayerController togglePlaybackEvenWhenInBackground:]): Added.
2934
2935 2015-02-04  Jer Noble  <jer.noble@apple.com>
2936
2937         [Mac][EME] Support ClearKey encryption with AES128-encrypted HLS
2938         https://bugs.webkit.org/show_bug.cgi?id=140825
2939
2940         Reviewed by Eric Carlson.
2941
2942         Test: http/tests/media/clearkey/clear-key-hls-aes128.html
2943
2944         Add support for ClearKey encryption when used with an AES-128 encrypted HLS stream.
2945
2946         * Modules/encryptedmedia/CDM.cpp:
2947         (WebCore::installedCDMFactories): Add the CDMPrivateClearKey factory.
2948         * Modules/encryptedmedia/CDMPrivateClearKey.cpp:
2949         (WebCore::CDMPrivateClearKey::supportsKeySystem): Support the "org.w3c.clearkey" key system.
2950         (WebCore::CDMPrivateClearKey::supportsKeySystemAndMimeType): Ditto.
2951         (WebCore::CDMPrivateClearKey::supportsMIMEType): Ditto.
2952         (WebCore::CDMPrivateClearKey::createSession): Create a CDMSessionClearKey.
2953         * Modules/encryptedmedia/CDMPrivateClearKey.h:
2954         (WebCore::CDMPrivateClearKey::create): Simple factory.
2955         (WebCore::CDMPrivateClearKey::~CDMPrivateClearKey): Virtual destructor.
2956         (WebCore::CDMPrivateClearKey::CDMPrivateClearKey): Simple destructor.
2957         * Modules/encryptedmedia/CDMSessionClearKey.cpp: Added.
2958         (WebCore::clearKeyVM): Static method returning the VM to be used by JSON parsing.
2959         (WebCore::CDMSessionClearKey::CDMSessionClearKey): Simple constructor.
2960         (WebCore::CDMSessionClearKey::~CDMSessionClearKey): Simple destructor.
2961         (WebCore::CDMSessionClearKey::generateKeyRequest): Store the initData, ensure that it consists of a UTF8-encoded key
2962             URI, and return same.
2963         (WebCore::CDMSessionClearKey::releaseKeys): Purged all cached keys.
2964         (WebCore::CDMSessionClearKey::update): Parse raw JSON-encoded JWK keys, rejecting non-AES, non-oct keys.
2965         (WebCore::CDMSessionClearKey::cachedKeyForKeyID): Return cached keys.
2966         * Modules/encryptedmedia/CDMSessionClearKey.h:
2967
2968         Add support for the "org.w3c.clearkey" CDM to MediaPlayerPrivateAVFoundationObjC, and do so in a platform-agnostic
2969         way by simply asking for raw key data from MediaPlayerClient when notified that a key has been added.
2970
2971         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
2972         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2973         (WebCore::keySystemIsSupported):
2974         (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsType):
2975         (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsKeySystem):
2976         (WebCore::fulfillRequestWithKeyData): Added utility method.
2977         (WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource):
2978         (WebCore::MediaPlayerPrivateAVFoundationObjC::keyAdded):
2979
2980         Pipe a keyAdded() notification down to MediaPlayer and a cachedKeyForKeyId() request up to CDMSessionClearKey:
2981
2982         * Modules/encryptedmedia/MediaKeySession.cpp:
2983         (WebCore::MediaKeySession::cachedKeyForKeyId):
2984         (WebCore::MediaKeySession::addKeyTimerFired):
2985         * Modules/encryptedmedia/MediaKeySession.h:
2986         * Modules/encryptedmedia/MediaKeys.cpp:
2987         (WebCore::MediaKeys::keyAdded):
2988         (WebCore::MediaKeys::cachedKeyForKeyId):
2989         * Modules/encryptedmedia/MediaKeys.h:
2990         * html/HTMLMediaElement.cpp:
2991         (WebCore::HTMLMediaElement::keyAdded):
2992         * html/HTMLMediaElement.h:
2993         * platform/graphics/CDMSession.h:
2994         (WebCore::CDMSession::cachedKeyForKeyID):
2995         * platform/graphics/MediaPlayer.cpp:
2996         (WebCore::MediaPlayer::keyAdded):
2997         (WebCore::MediaPlayer::cachedKeyForKeyId):
2998         * platform/graphics/MediaPlayer.h:
2999         (WebCore::MediaPlayerClient::mediaPlayerCachedKeyForKeyId):
3000         * platform/graphics/MediaPlayerPrivate.h:
3001         (WebCore::MediaPlayerPrivateInterface::keyAdded):
3002
3003         Add new files to project:
3004
3005         * WebCore.xcodeproj/project.pbxproj:
3006         * CMakeLists.txt:
3007         * WebCore.vcxproj/WebCore.vcxproj:
3008         * WebCore.vcxproj/WebCore.vcxproj.filters:
3009
3010 2015-02-04  Commit Queue  <commit-queue@webkit.org>
3011
3012         Unreviewed, rolling out r179618.
3013         https://bugs.webkit.org/show_bug.cgi?id=141263
3014
3015         Off-by-one error causing flaky behavior in webaudio
3016         /audiobuffersource-negative-playbackrate.html (Requested by
3017         jernoble_ on #webkit).
3018
3019         Reverted changeset:
3020
3021         "[WebAudio] AudioBufferSourceNodes should accurately play
3022         backwards if given a negative playbackRate."
3023         https://bugs.webkit.org/show_bug.cgi?id=140955
3024         http://trac.webkit.org/changeset/179618
3025
3026 2015-02-03  David Hyatt  <hyatt@apple.com>
3027
3028         Tables don't repaginate properly when the pagination height changes or the pagination offset changes.
3029         https://bugs.webkit.org/show_bug.cgi?id=141207
3030         <rdar://problem/18387659>
3031
3032         Reviewed by Dean Jackson.
3033
3034         Added fast/multicol/table-dynamic-movement.html
3035
3036         Change markForPaginationRelayoutIfNeeded to be called always and to check needsLayout inside it.
3037
3038         Make RenderTable override markForPaginationRelayoutIfNeeded and also dirty the sections if the table
3039         ended up getting marked for relayout.
3040
3041         Make sure rows do the right thing as well.
3042
3043         * rendering/RenderBlock.cpp:
3044         (WebCore::RenderBlock::layoutPositionedObjects):
3045         (WebCore::RenderBlock::markForPaginationRelayoutIfNeeded):
3046         * rendering/RenderBlock.h:
3047         * rendering/RenderBlockFlow.cpp:
3048         (WebCore::RenderBlockFlow::layoutBlockChild):
3049         (WebCore::RenderBlockFlow::adjustBlockChildForPagination):
3050         (WebCore::RenderBlockFlow::positionNewFloats):
3051         * rendering/RenderDeprecatedFlexibleBox.cpp:
3052         (WebCore::RenderDeprecatedFlexibleBox::layoutHorizontalBox):
3053         (WebCore::RenderDeprecatedFlexibleBox::layoutVerticalBox):
3054         * rendering/RenderTable.cpp:
3055         (WebCore::RenderTable::markForPaginationRelayoutIfNeeded):
3056         * rendering/RenderTable.h:
3057         * rendering/RenderTableRow.cpp:
3058         (WebCore::RenderTableRow::layout):
3059         * rendering/RenderTableSection.cpp:
3060         (WebCore::RenderTableSection::layout):
3061
3062 2015-02-04  Said Abou-Hallawa  <sabouhallawa@apple.com>
3063
3064         When using SVG as an image, we should load datauri images when these images are not in the image cache.
3065         https://bugs.webkit.org/show_bug.cgi?id=99677.
3066
3067         Reviewed by Darin Adler.
3068         
3069         Data URI sub-resources are not loaded because the networking context of FrameLoader
3070         attached to the SubResourceLoader is set to null. This is done intentionally to
3071         disallow any resource from loading external sub-resources. For example if an <img>
3072         tag has its 'src' attribute points to an svg file, this svg is not allowed to load
3073         an external image through the 'xlink' attribute of an <image> element. This restriction
3074         is not valid if the value of the 'xlink' attribute is a data URI. In this case the image 
3075         should be loaded into memory since there is no network traffic involved. All we need
3076         to do is to decode the data part of the URI.
3077         
3078         The fix is to pass the root FrameLoader, which has a valid NetworkingContext, through
3079         the FrameLoaderClient, to the ResourceHandle::create() which uses the NetworkingContext
3080         to decode the data and fire the load events of the data URI resources.
3081
3082         Tests:  svg/as-image/svg-image-with-data-uri-background.html
3083                 svg/as-image/svg-image-with-data-uri-from-canvas.html
3084                 svg/as-image/svg-image-with-data-uri-images-disabled.html
3085                 svg/as-image/svg-image-with-data-uri-reloading.html
3086                 svg/as-image/svg-image-with-data-uri-use-data-uri.svg
3087                 svg/as-image/svg-image-with-svg-data-uri.html
3088
3089         * accessibility/AccessibilityRenderObject.cpp:
3090         Remove unreferenced header file.
3091
3092         * loader/FrameLoaderClient.h:
3093         Define the null virtual function dataProtocolLoader() which should return the FrameLoader
3094         for loading data URI resources.
3095
3096         * loader/ResourceLoader.cpp:
3097         (WebCore::ResourceLoader::start):
3098         (WebCore::ResourceLoader::dataProtocolFrameLoader):
3099         * loader/ResourceLoader.h:
3100         Add ResourceLoader::dataProtocolFrameLoader() which returns the root FrameLoader. The
3101         root FrameLoader is used to get a valid NetworkingContext which can be passed to
3102         ResourceHandle::create() when url().protocolIsData().
3103
3104         * loader/cache/CachedImage.cpp:
3105         (WebCore::CachedImage::load):
3106         (WebCore::CachedImage::finishLoading):
3107         * loader/cache/CachedResourceLoader.cpp:
3108         (WebCore::CachedResourceLoader::shouldPerformImageLoad):
3109         (WebCore::CachedResourceLoader::shouldDeferImageLoad):
3110         * loader/cache/CachedResourceLoader.h:
3111         Allow loading data URI sub-resources as long as loading images is not disabled. Also we
3112         need to call setDataProtocolLoader() before calling setData() for the isSVGImage case, 
3113         setData() will create a page by calling Page::createPageFromBuffer() via SVGImage::dataChanged(),
3114         and we need to pass the correct FrameLoaderClient to the created FrameLoader of the main
3115          frame of this page.
3116
3117         * svg/graphics/SVGImage.cpp:
3118         (WebCore::SVGImage::SVGImage):
3119         (WebCore::SVGImage::dataChanged):
3120         * svg/graphics/SVGImage.h:
3121         Create a new FrameLoaderClient of type SVGFrameLoaderClient and set it in pageConfiguration
3122         which is used when creating the page from the SVG data URI.
3123
3124         * WebCore.xcodeproj/project.pbxproj:
3125         * svg/graphics/SVGImageChromeClient.h: Removed.
3126         * svg/graphics/SVGImageClients.h: Added.
3127         Add a new class SVGImageChromeClient which overrides the function dataProtocolLoader().
3128         Rename the header file SVGImageChromeClient.h to be SVGImageClients.h since it now 
3129         includes the classes SVGImageChromeClient and SVGFrameLoaderClient.
3130
3131 2015-02-04  Timothy Horton  <timothy_horton@apple.com>
3132
3133         Fix a misplaced include in CaptionUserPreferencesMediaAF
3134         https://bugs.webkit.org/show_bug.cgi?id=141239
3135
3136         Reviewed by Jer Noble.
3137
3138         * page/CaptionUserPreferencesMediaAF.cpp:
3139         CoreText is a system header, and there's already a good spot for it!
3140
3141 2015-02-04  Jer Noble  <jer.noble@apple.com>
3142
3143         [WebAudio] AudioBufferSourceNodes should accurately play backwards if given a negative playbackRate.
3144         https://bugs.webkit.org/show_bug.cgi?id=140955
3145
3146         Reviewed by Eric Carlson.
3147
3148         Tests: webaudio/audiobuffersource-negative-playbackrate-interpolated.html
3149                webaudio/audiobuffersource-negative-playbackrate.html
3150
3151         Add support for playing an AudioBufferSourceNode at a negative playbackRate. Change the meaning of
3152         start() to set the initial playback position at the end of the play range if the rate of playback
3153         is negtive.
3154
3155         * Modules/webaudio/AudioBufferSourceNode.cpp:
3156         (WebCore::AudioBufferSourceNode::AudioBufferSourceNode): Allow the playbackRate AudioParam to range from [-32, 32].
3157         (WebCore::AudioBufferSourceNode::renderFromBuffer): Change variable names from "start" and "end" to "min" and "max"
3158             for clarity. Add a non-interpolated and interpolated render step for negative playback.
3159         (WebCore::AudioBufferSourceNode::start): Drive-by fix: default value of grainDuration is not 0.02.
3160         (WebCore::AudioBufferSourceNode::startPlaying): Start playing at the end of the buffer for negative playback.
3161         (WebCore::AudioBufferSourceNode::totalPitchRate): Allow the pitch to be negative.
3162
3163 2015-02-04  Eric Carlson  <eric.carlson@apple.com>
3164
3165         video.attribute should not return true just because of fullscreen
3166         https://bugs.webkit.org/show_bug.cgi?id=141219
3167
3168         Reviewed by Dean Jackson.
3169
3170         No new tests, updated media/video-fullscreeen-only-controls.html
3171
3172         * Modules/mediacontrols/mediaControlsApple.js:
3173         (Controller.prototype.shouldHaveControls):
3174         * Modules/mediacontrols/mediaControlsiOS.js:
3175         (ControllerIOS.prototype.isFullScreen):
3176
3177         * html/HTMLMediaElement.cpp:
3178         (WebCore::HTMLMediaElement::controls): Don't consider fullscreen status.
3179         (WebCore::HTMLMediaElement::configureMediaControls): Create controls if a video element
3180             isn't allowed to play inline, or if it is in fullscreen.
3181
3182 2015-02-04  Mark Lam  <mark.lam@apple.com>
3183
3184         Remove concept of makeUsableFromMultipleThreads().
3185         <https://webkit.org/b/141221>
3186
3187         Reviewed by Mark Hahnenberg.
3188
3189         No new tests.
3190
3191         * bindings/js/JSDOMWindowBase.cpp:
3192         (WebCore::JSDOMWindowBase::commonVM):
3193
3194 2015-02-04  Simon Fraser  <simon.fraser@apple.com>
3195
3196         [iOS WK2] Assert in ScrollingTreeOverflowScrollingNodeIOS::updateAfterChildren() on tab switching
3197         https://bugs.webkit.org/show_bug.cgi?id=141223
3198         rdar://problem/18458993
3199
3200         Reviewed by Tim Horton.
3201         
3202         It's possible to submit a RemoteLayerTree transaction that contains data
3203         about a created layer, but doesn't have any properties for that layer. This
3204         happens when the newly created layer isn't reached during the traversal that
3205         gathers layer properties (i.e. it's not rooted). However, whether we create
3206         a scrolling layer or not requires having properties; they are missing, so we
3207         create a normal layer, but then the scrolling tree commit asserts that we
3208         should have a scrolling layer.
3209         
3210         Fix by making scrolling layers have a corresponding layer type, which is
3211         stored in layer creation properties. This required exposing layer types
3212         up through GraphicsLayer, but that allows for some nice cleanup:
3213         
3214         1. No need to have the hokey shouldUseTiledBacking() GraphicsLayerClient hack
3215            for creating the page tiled layer.
3216         2. The notion of "custom behaviors" can be removed from GraphicsLayer entirely.
3217
3218         Not testable because it requires tab switching.
3219
3220         * WebCore.exp.in:
3221         * platform/graphics/GraphicsLayer.cpp:
3222         (WebCore::GraphicsLayer::GraphicsLayer):
3223         * platform/graphics/GraphicsLayer.h:
3224         (WebCore::GraphicsLayer::initialize):
3225         (WebCore::GraphicsLayer::setCustomBehavior): Deleted.
3226         (WebCore::GraphicsLayer::customBehavior): Deleted.
3227         * platform/graphics/GraphicsLayerClient.h:
3228         (WebCore::GraphicsLayerClient::shouldUseTiledBacking): Deleted.
3229         * platform/graphics/GraphicsLayerFactory.h:
3230         * platform/graphics/ca/GraphicsLayerCA.cpp:
3231         (WebCore::GraphicsLayer::create):
3232         (WebCore::GraphicsLayerCA::GraphicsLayerCA):
3233         (WebCore::GraphicsLayerCA::initialize):
3234         (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
3235         (WebCore::GraphicsLayerCA::ensureStructuralLayer):
3236         (WebCore::GraphicsLayerCA::swapFromOrToTiledLayer):
3237         (WebCore::GraphicsLayerCA::updateCustomBehavior): Deleted.
3238         (WebCore::GraphicsLayerCA::setCustomBehavior): Deleted.
3239         * platform/graphics/ca/GraphicsLayerCA.h:
3240         (WebCore::GraphicsLayerCA::moveAnimations):
3241         (WebCore::GraphicsLayerCA::copyAnimations):
3242         * platform/graphics/ca/PlatformCALayer.h:
3243         * platform/graphics/ca/mac/PlatformCALayerMac.h:
3244         * platform/graphics/ca/mac/PlatformCALayerMac.mm:
3245         (PlatformCALayerMac::PlatformCALayerMac):
3246         (PlatformCALayerMac::commonInit):
3247         (PlatformCALayerMac::updateCustomBehavior): Deleted.
3248         * rendering/RenderLayerBacking.cpp:
3249         (WebCore::RenderLayerBacking::createGraphicsLayer):
3250         (WebCore::RenderLayerBacking::createPrimaryGraphicsLayer):
3251         (WebCore::RenderLayerBacking::updateScrollingLayers):
3252         (WebCore::RenderLayerBacking::shouldUseTiledBacking): Deleted.
3253         * rendering/RenderLayerBacking.h:
3254
3255 2015-02-04  Dean Jackson  <dino@apple.com>
3256
3257         [Media] Fullscreen button should always come last in inline controls (141245)
3258         https://bugs.webkit.org/show_bug.cgi?id=141245
3259         <rdar://problem/19714622>
3260
3261         Reviewed by Eric Carlson.
3262
3263         Make sure the optimizedFullscreen button is inserted before the
3264         normal fullscreen button.
3265
3266         * Modules/mediacontrols/mediaControlsiOS.js:
3267         (ControllerIOS.prototype.configureInlineControls):
3268
3269 2015-02-04  Dean Jackson  <dino@apple.com>
3270
3271         REGRESSION: AirPlay button not visible but present in inline toolbar
3272         https://bugs.webkit.org/show_bug.cgi?id=141244
3273         <rdar://problem/19328322>
3274
3275         Reviewed by Eric Carlson.
3276
3277         Replace the use of mask-image with a background-image (which matches
3278         what the other buttons are doing).
3279
3280         * Modules/mediacontrols/mediaControlsiOS.css:
3281         (::-webkit-media-controls):
3282         (video::-webkit-media-controls-wireless-playback-picker-button):
3283         (audio::-webkit-media-controls-wireless-playback-picker-button):
3284         (video::-webkit-media-controls-wireless-playback-picker-button.active):
3285         (audio::-webkit-media-controls-wireless-playback-picker-button.active):
3286
3287 2015-02-04  Chris Dumez  <cdumez@apple.com>
3288
3289         Add removeFirst(value) / removeAll(value) methods to WTF::Vector
3290         https://bugs.webkit.org/show_bug.cgi?id=141192
3291
3292         Reviewed by Benjamin Poulain.
3293
3294         Use new Vector::removeFirst(value) / removeAll(value) API to simplify the
3295         code a bit.
3296
3297         * css/StyleSheetContents.cpp:
3298         (WebCore::StyleSheetContents::unregisterClient):
3299         * html/HTMLFormElement.cpp:
3300         (WebCore::HTMLFormElement::removeFormElement):
3301         (WebCore::HTMLFormElement::removeImgElement):
3302         (WebCore::removeFromVector): Deleted.
3303         * page/Chrome.cpp:
3304         (WebCore::Chrome::unregisterPopupOpeningObserver):
3305         * page/PageOverlayController.cpp:
3306         (WebCore::PageOverlayController::uninstallPageOverlay):
3307         * page/SecurityPolicy.cpp:
3308         (WebCore::SecurityPolicy::removeOriginAccessWhitelistEntry):
3309         * platform/graphics/GraphicsLayer.cpp:
3310         (WebCore::GraphicsLayer::removeFromParent):
3311         * platform/graphics/texmap/TextureMapperAnimation.cpp:
3312         (WebCore::TextureMapperAnimations::remove):
3313         * rendering/RenderSearchField.cpp:
3314         (WebCore::RenderSearchField::addSearchResult):
3315         * rendering/RenderTable.cpp:
3316         (WebCore::RenderTable::removeCaption):
3317         * rendering/svg/RenderSVGText.cpp:
3318         (WebCore::RenderSVGText::subtreeChildWillBeRemoved):
3319         * svg/SVGDocumentExtensions.cpp:
3320         (WebCore::SVGDocumentExtensions::removeAllElementReferencesForTarget):
3321         * svg/animation/SMILTimeContainer.cpp:
3322         (WebCore::SMILTimeContainer::unschedule):
3323
3324 2015-02-03  Maciej Stachowiak  <mjs@apple.com>
3325
3326         Crash when printing snapshotted plugins
3327         https://bugs.webkit.org/show_bug.cgi?id=141212
3328
3329         Reviewed by Simon Fraser.
3330
3331         Test: plugins/snapshotting/print-snapshotted-plugin.html
3332
3333         * html/HTMLPlugInImageElement.cpp:
3334         (WebCore::HTMLPlugInImageElement::childShouldCreateRenderer): New
3335         method. If the current renderer is a snapshotted plugin, only
3336         allow children to create renderers if they are part of the
3337         snapshot shadow dom. Otherwise RenderEmbeddedObject invariants
3338         will be violated. This DOM class can have many other renderers, but they
3339         can just follow their own rules.
3340         (WebCore::HTMLPlugInImageElement::partOfSnapshotOverlay): Make this
3341         const-correct, and don't create UA shadow DOM as a side effect if it doesn't
3342         already exist.
3343         * html/HTMLPlugInImageElement.h:
3344
3345 2015-02-03  Chris Dumez  <cdumez@apple.com>
3346
3347         Regression(r179584): Assertion hit in toResourceLoadPriority() on Yosemite
3348         https://bugs.webkit.org/show_bug.cgi?id=141230
3349
3350         Reviewed by Alexey Proskuryakov.
3351
3352         Handle -1 priority value again in toResourceLoadPriority() as it seems to
3353         be returned by CFNetwork on some configurations.
3354
3355         No new tests, already covered by existing tests.
3356
3357         * platform/network/cf/ResourceRequestCFNet.h:
3358         (WebCore::toResourceLoadPriority):
3359
3360 2015-02-03  Chris Dumez  <cdumez@apple.com>
3361
3362         Drop ResourceLoadPriorityUnresolved resource load priority and use Optional<> instead
3363         https://bugs.webkit.org/show_bug.cgi?id=141186
3364
3365         Reviewed by Antti Koivisto.
3366
3367         Drop ResourceLoadPriorityUnresolved resource load priority value and use
3368         Optional<ResourceLoadPriority> when needed instead. If the Optional
3369         doesn't have a value, then it means it is unresolved. Having
3370         ResourceLoadPriorityUnresolved in ResourceLoadPriority was confusing
3371         because this value is only valid in CachedResourceRequest, it is not
3372         a valid value in CachedResource or in ResourceRequest. After this
3373         refactoring, it now becomes more obvious.
3374
3375 2015-02-03  Chris Dumez  <cdumez@apple.com>
3376
3377         REGRESSION(176609): Very high memory usage in Canvas/reuse.html performance test
3378         https://bugs.webkit.org/show_bug.cgi?id=139812
3379
3380         Reviewed by Geoffrey Garen.
3381
3382         Update DOMTimerFireState.elementsChangedOutsideViewport to keep only
3383         weak pointers to the Elements, instead of ref'ing them, so as to not
3384         extend their life unnecessarily (by preventing garbage-collection).
3385         The same approach was already adopted in r176496 for
3386         DOMTimer.m_elementsCausingThrottling to address the same issue.
3387
3388         No new tests, already covered by Canvas/reuse.html performance test.
3389
3390         * page/DOMTimer.cpp:
3391         (WebCore::DOMTimerFireState::setScriptMadeNonUserObservableChangesToElement):
3392         (WebCore::DOMTimerFireState::elementsChangedOutsideViewport):
3393
3394 2015-02-03  Jer Noble  <jer.noble@apple.com>
3395
3396         [MSE] Setting timestampOffset does not change the timestamps in the actual sample, leading to visual and audible errors.
3397         https://bugs.webkit.org/show_bug.cgi?id=140929
3398
3399