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