Modern IDB: Possible crash deallocating IDBDatabaseInfo/IDBObjectStoreInfo/IDBIndexInfo.
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2016-03-01  Brady Eidson  <beidson@apple.com>
2
3         Modern IDB: Possible crash deallocating IDBDatabaseInfo/IDBObjectStoreInfo/IDBIndexInfo.
4         https://bugs.webkit.org/show_bug.cgi?id=154860
5
6         Reviewed by Alex Christensen.
7
8         Covered by existing tests.
9
10         * Modules/indexeddb/shared/IDBDatabaseInfo.cpp:
11         (WebCore::IDBDatabaseInfo::IDBDatabaseInfo):
12         (WebCore::IDBDatabaseInfo::isolatedCopy):
13         * Modules/indexeddb/shared/IDBDatabaseInfo.h:
14
15         * Modules/indexeddb/shared/IDBTransactionInfo.cpp:
16         (WebCore::IDBTransactionInfo::isolatedCopy): If there's an IDBDatabaseInfo to copy,  that
17           copy needs to be isolated.
18
19 2016-03-01  Tim Horton  <timothy_horton@apple.com>
20
21         Expose MediaElement and VideoElement to the Objective-C DOM bindings
22         https://bugs.webkit.org/show_bug.cgi?id=154830
23
24         Reviewed by Sam Weinig.
25
26         * Modules/mediasession/HTMLMediaElementMediaSession.idl:
27         * Modules/mediastream/HTMLMediaElementMediaStream.idl:
28         * html/HTMLMediaElement.idl:
29         * html/HTMLVideoElement.idl:
30         Avoid Objective-C bindings for various extraneous bits, like MediaSource and MediaSession,
31         to avoid exposing way more than we need to.
32
33         * WebCore.xcodeproj/project.pbxproj:
34         Add a bunch of Derived Sources.
35
36 2016-03-01  Antti Koivisto  <antti@apple.com>
37
38         Text control shadow element style shouldn't depend on renderers
39         https://bugs.webkit.org/show_bug.cgi?id=154855
40
41         Reviewed by Andreas Kling.
42
43         Currently the code for computing style for text control shadow elements lives in render tree.
44         Style is the input for building a render tree and should be computable without having one.
45
46         Fix by moving virtual createInnerTextStyle() from RenderTextControl hierarchy to the DOM side
47         HTMLTextFormControlElement hierarchy.
48
49         * dom/Element.cpp:
50         (WebCore::Element::didDetachRenderers):
51         (WebCore::Element::customStyleForRenderer):
52
53             Also pass shadow host style as it is needed for text controls.
54
55         * dom/Element.h:
56         * dom/PseudoElement.cpp:
57         (WebCore::PseudoElement::clearHostElement):
58         (WebCore::PseudoElement::customStyleForRenderer):
59         * dom/PseudoElement.h:
60         * html/HTMLInputElement.cpp:
61         (WebCore::HTMLInputElement::setRangeText):
62         (WebCore::HTMLInputElement::createInnerTextStyle):
63         (WebCore::HTMLInputElement::setupDateTimeChooserParameters):
64         * html/HTMLInputElement.h:
65         * html/HTMLTextAreaElement.cpp:
66         (WebCore::HTMLTextAreaElement::willRespondToMouseClickEvents):
67         (WebCore::HTMLTextAreaElement::createInnerTextStyle):
68         * html/HTMLTextAreaElement.h:
69         * html/HTMLTextFormControlElement.cpp:
70         (WebCore::HTMLTextFormControlElement::directionForFormData):
71         (WebCore::HTMLTextFormControlElement::adjustInnerTextStyle):
72         * html/HTMLTextFormControlElement.h:
73         (WebCore::HTMLTextFormControlElement::cachedSelectionDirection):
74         * html/shadow/TextControlInnerElements.cpp:
75         (WebCore::TextControlInnerElement::create):
76         (WebCore::TextControlInnerElement::customStyleForRenderer):
77         (WebCore::TextControlInnerTextElement::renderer):
78         (WebCore::TextControlInnerTextElement::customStyleForRenderer):
79         * html/shadow/TextControlInnerElements.h:
80         * rendering/RenderTextControl.cpp:
81         (WebCore::RenderTextControl::styleDidChange):
82         (WebCore::RenderTextControl::textBlockLogicalHeight):
83         (WebCore::RenderTextControl::adjustInnerTextStyle): Deleted.
84         * rendering/RenderTextControl.h:
85         * rendering/RenderTextControlMultiLine.cpp:
86         (WebCore::RenderTextControlMultiLine::baselinePosition):
87         (WebCore::RenderTextControlMultiLine::layoutSpecialExcludedChild):
88         (WebCore::RenderTextControlMultiLine::createInnerTextStyle): Deleted.
89
90             createInnerTextStyle moves to HTMLTextAreaElement::createInnerTextStyle
91
92         * rendering/RenderTextControlMultiLine.h:
93         * rendering/RenderTextControlSingleLine.cpp:
94         (WebCore::RenderTextControlSingleLine::RenderTextControlSingleLine):
95
96             Remove m_desiredInnerTextLogicalHeight cache. It doesn't work, it is never valid when hit.
97
98         (WebCore::RenderTextControlSingleLine::layout):
99         (WebCore::RenderTextControlSingleLine::styleDidChange):
100         (WebCore::RenderTextControlSingleLine::computeControlLogicalHeight):
101         (WebCore::RenderTextControlSingleLine::textShouldBeTruncated):
102         (WebCore::RenderTextControlSingleLine::createInnerTextStyle): Deleted.
103         (WebCore::RenderTextControlSingleLine::createInnerBlockStyle): Deleted.
104
105             - createInnerTextStyle moves to HTMLInputElement::createInnerTextStyle
106             - createInnerBlockStyle moves to TextControlInnerElement::customStyleForRenderer
107
108         * rendering/RenderTextControlSingleLine.h:
109         (WebCore::RenderTextControlSingleLine::centerContainerIfNeeded):
110         (WebCore::RenderTextControlSingleLine::containerElement):
111         * style/StyleTreeResolver.cpp:
112         (WebCore::Style::TreeResolver::styleForElement):
113         * svg/SVGElement.cpp:
114         (WebCore::SVGElement::synchronizeSystemLanguage):
115         (WebCore::SVGElement::customStyleForRenderer):
116         * svg/SVGElement.h:
117
118 2016-03-01  Manuel Rego Casasnovas  <rego@igalia.com>
119
120         [css-grid] Get rid of GridResolvedPosition
121         https://bugs.webkit.org/show_bug.cgi?id=154818
122
123         Reviewed by Darin Adler.
124
125         GridResolvedPosition was a small class just wrapping a unsigned.
126         In the future it should actually wrap an integer,
127         as we want to support implicit tracks before the explicit grid.
128
129         The class itself is not providing any benefit,
130         so we can get rid of it and store directly 2 unsigned in GridSpan.
131
132         This will make simpler future changes related to this task.
133
134         We keep the class just as a utility for the methods
135         that deal with the positions resolution.
136         But it should be renamed in a follow-up patch.
137
138         No new tests, no change of behavior.
139
140         * css/CSSGridTemplateAreasValue.cpp:
141         (WebCore::stringForPosition):
142         * css/CSSParser.cpp:
143         (WebCore::CSSParser::parseGridTemplateAreasRow):
144         * css/StyleBuilderConverter.h:
145         (WebCore::StyleBuilderConverter::createImplicitNamedGridLinesFromGridArea):
146         * rendering/RenderGrid.cpp:
147         (WebCore::RenderGrid::computeUsedBreadthOfGridTracks):
148         (WebCore::RenderGrid::findFlexFactorUnitSize):
149         (WebCore::RenderGrid::spanningItemCrossesFlexibleSizedTracks):
150         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForNonSpanningItems):
151         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForItems):
152         (WebCore::RenderGrid::insertItemIntoGrid):
153         (WebCore::RenderGrid::populateExplicitGridAndOrderIterator):
154         (WebCore::RenderGrid::createEmptyGridAreaAtSpecifiedPositionsOutsideGrid):
155         (WebCore::RenderGrid::placeSpecifiedMajorAxisItemsOnGrid):
156         (WebCore::RenderGrid::placeAutoMajorAxisItemOnGrid):
157         (WebCore::RenderGrid::offsetAndBreadthForPositionedChild):
158         (WebCore::RenderGrid::gridAreaBreadthForChild):
159         (WebCore::RenderGrid::gridAreaBreadthForChildIncludingAlignmentOffsets):
160         (WebCore::RenderGrid::columnAxisOffsetForChild):
161         (WebCore::RenderGrid::rowAxisOffsetForChild):
162         * rendering/style/GridCoordinate.h:
163         (WebCore::GridSpan::definiteGridSpan):
164         (WebCore::GridSpan::integerSpan):
165         (WebCore::GridSpan::resolvedInitialPosition):
166         (WebCore::GridSpan::resolvedFinalPosition):
167         (WebCore::GridSpan::GridSpanIterator::GridSpanIterator):
168         (WebCore::GridSpan::GridSpanIterator::operator*):
169         (WebCore::GridSpan::GridSpanIterator::operator++):
170         (WebCore::GridSpan::GridSpanIterator::operator!=):
171         (WebCore::GridSpan::begin):
172         (WebCore::GridSpan::end):
173         (WebCore::GridSpan::GridSpan):
174         * rendering/style/GridResolvedPosition.cpp:
175         (WebCore::resolveNamedGridLinePositionFromStyle):
176         (WebCore::resolveRowStartColumnStartNamedGridLinePositionAgainstOppositePosition):
177         (WebCore::resolveRowEndColumnEndNamedGridLinePositionAgainstOppositePosition):
178         (WebCore::resolveNamedGridLinePositionAgainstOppositePosition):
179         (WebCore::resolveGridPositionAgainstOppositePosition):
180         (WebCore::GridResolvedPosition::resolveGridPositionsFromAutoPlacementPosition):
181         (WebCore::resolveGridPositionFromStyle):
182         (WebCore::GridResolvedPosition::resolveGridPositionsFromStyle):
183         * rendering/style/GridResolvedPosition.h:
184         (WebCore::GridResolvedPosition::GridResolvedPosition): Deleted.
185         (WebCore::GridResolvedPosition::operator*): Deleted.
186         (WebCore::GridResolvedPosition::operator++): Deleted.
187         (WebCore::GridResolvedPosition::operator==): Deleted.
188         (WebCore::GridResolvedPosition::operator!=): Deleted.
189         (WebCore::GridResolvedPosition::operator<): Deleted.
190         (WebCore::GridResolvedPosition::operator>): Deleted.
191         (WebCore::GridResolvedPosition::operator<=): Deleted.
192         (WebCore::GridResolvedPosition::operator>=): Deleted.
193         (WebCore::GridResolvedPosition::toInt): Deleted.
194         (WebCore::GridResolvedPosition::next): Deleted.
195         (WebCore::GridResolvedPosition::prev): Deleted.
196
197 2016-03-01  Andreas Kling  <akling@apple.com>
198
199         MemoryCache::forEachResource() should guard resources across function invocation.
200         <https://webkit.org/b/154846>
201
202         Reviewed by Antti Koivisto.
203
204         It occurred to me that we should protect the CachedResources from being
205         deleted while invoking the custom function here, lest we create a giant footgun.
206
207         * loader/cache/MemoryCache.cpp:
208         (WebCore::MemoryCache::forEachResource):
209
210 2016-03-01  Csaba Osztrogonác  <ossy@webkit.org>
211
212         [Mac][cmake] One more unreviewed speculative buildfix after r197375. Just for fun.
213
214         * PlatformMac.cmake:
215
216 2016-03-01  Csaba Osztrogonác  <ossy@webkit.org>
217
218         [Mac][cmake] Unreviewed speculative buildfix after r197375. Just for fun.
219
220         * PlatformMac.cmake:
221
222 2016-03-01  Youenn Fablet  <youenn.fablet@crf.canon.fr>
223
224         [Fetch API] Support Request and Response blob() when body data is a blob
225         https://bugs.webkit.org/show_bug.cgi?id=154820
226
227         Reviewed by Darin Adler.
228
229         Adding support for returning the same Blob that is stored in Body in case JS blob() is called.
230         Adding support for Blob creation when data is stored as text.
231         Updated JSDOMBinding and JSDOMPromise to return a JS ArrayBuffer for Vector<char> as well as Vector<unsigned char>.
232
233         Covered by added tests.
234
235         * Modules/fetch/FetchBody.cpp:
236         (WebCore::FetchBody::arrayBuffer):
237         (WebCore::FetchBody::blob):
238         (WebCore::FetchBody::extractFromText):
239         * Modules/fetch/FetchBody.h:
240         * bindings/js/JSDOMBinding.h:
241         (WebCore::toJS):
242         * bindings/js/JSDOMPromise.h:
243         (WebCore::DeferredWrapper::resolve): Deleted.
244
245 2016-02-29  Chris Dumez  <cdumez@apple.com>
246
247         Have parseHTMLInteger() / parseHTMLNonNegativeInteger() use WTF::Optional
248         https://bugs.webkit.org/show_bug.cgi?id=154845
249
250         Reviewed by Ryosuke Niwa.
251
252         Have parseHTMLInteger() / parseHTMLNonNegativeInteger() use
253         WTF::Optional.
254
255         * dom/Element.cpp:
256         (WebCore::Element::getIntegralAttribute):
257         (WebCore::Element::getUnsignedIntegralAttribute):
258         (WebCore::Element::setUnsignedIntegralAttribute): Deleted.
259         * html/HTMLElement.cpp:
260         (WebCore::HTMLElement::parseBorderWidthAttribute):
261         (WebCore::HTMLElement::parseAttribute):
262         * html/HTMLInputElement.cpp:
263         (WebCore::HTMLInputElement::parseMaxLengthAttribute):
264         * html/HTMLInputElement.h:
265         * html/HTMLOListElement.cpp:
266         (WebCore::HTMLOListElement::parseAttribute):
267         * html/HTMLTextAreaElement.cpp:
268         (WebCore::HTMLTextAreaElement::maxLength):
269         * html/ImageInputType.cpp:
270         (WebCore::ImageInputType::height):
271         (WebCore::ImageInputType::width):
272         * html/parser/HTMLParserIdioms.cpp:
273         (WebCore::parseHTMLIntegerInternal):
274         (WebCore::parseHTMLInteger):
275         (WebCore::parseHTMLNonNegativeInteger):
276         * html/parser/HTMLParserIdioms.h:
277         (WebCore::limitToOnlyHTMLNonNegativeNumbersGreaterThanZero):
278         (WebCore::limitToOnlyHTMLNonNegative):
279         * svg/SVGElement.cpp:
280         (WebCore::SVGElement::parseAttribute):
281
282 2016-02-29  Zan Dobersek  <zdobersek@igalia.com>
283
284         TextureMapperGL: simplify TransformationMatrix copies in draw(), beginClip()
285         https://bugs.webkit.org/show_bug.cgi?id=154791
286
287         Reviewed by Carlos Garcia Campos.
288
289         In both functions, the passed-in model-view matrix is first copied, multiplied
290         against a rect-to-rect TransformationMatrix, and then assigned into a local
291         TransformationMatrix variable, which causes another copy due to the multiply()
292         function returning a reference to the modified object.
293
294         To avoid the last copy, first copy the model-view matrix into a local variable,
295         and multiply the rect-to-rect TransformationMatrix into the new object afterwards.
296
297         * platform/graphics/texmap/TextureMapperGL.cpp:
298         (WebCore::TextureMapperGL::draw):
299         (WebCore::TextureMapperGL::beginClip):
300
301 2016-02-29  Zan Dobersek  <zdobersek@igalia.com>
302
303         ImageBufferCairo should support OpenGL ES 2 configurations
304         https://bugs.webkit.org/show_bug.cgi?id=154790
305
306         Reviewed by Carlos Garcia Campos.
307
308         When building with OpenGL ES 2 and with accelerated 2D canvas support,
309         the GLES2 header should be included instead of the OpenGLShims.h header.
310
311         The glTexParameterf() calls targeting GL_TEXTURE_WRAP_S and
312         GL_TEXTURE_WRAP_T parameters should use the GL_CLAMP_TO_EDGE value.
313         GL_CLAMP isn't available in OpenGL ES 2 and was dropped in OpenGL 3.
314
315         * platform/graphics/cairo/ImageBufferCairo.cpp:
316         (WebCore::ImageBufferData::createCairoGLSurface):
317
318 2016-02-29  Zan Dobersek  <zdobersek@igalia.com>
319
320         TextureMapperGL: beginPainting() should handle the PaintingMirrored value in PaintFlags
321         https://bugs.webkit.org/show_bug.cgi?id=154789
322
323         Reviewed by Carlos Garcia Campos.
324
325         * platform/graphics/texmap/TextureMapperGL.cpp:
326         (WebCore::TextureMapperGL::beginPainting): The ClipStack should be reset with
327         a Y-axis mode that corresponds to the presence of the PaintingMirrored value in
328         the passed-in PaintFlags argument. If present, the default Y-axis mode should be
329         used, and the inverted Y-axis otherwise.
330
331 2016-02-29  Zan Dobersek  <zdobersek@igalia.com>
332
333         CoordinatedGraphicsLayer should override the inherited TextureMapperPlatformLayer::Client methods
334         https://bugs.webkit.org/show_bug.cgi?id=154788
335
336         Reviewed by Carlos Garcia Campos.
337
338         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
339         Add the override specifiers for the two methods that are inherited
340         from the TextureMapperPlatformLayer::Client interface.
341
342 2016-02-29  Simon Fraser  <simon.fraser@apple.com>
343
344         Remove the experimental feature of antialiased font dilation
345         https://bugs.webkit.org/show_bug.cgi?id=154843
346
347         Reviewed by Zalan Bujtas.
348         
349         Remove the "antialiased font dilation" code path, and related prefs.
350
351         * page/Settings.cpp:
352         (WebCore::Settings::Settings): Deleted.
353         (WebCore::Settings::setAntialiasedFontDilationEnabled): Deleted.
354         * page/Settings.h:
355         (WebCore::Settings::antialiasedFontDilationEnabled): Deleted.
356         * platform/graphics/FontCascade.cpp:
357         (WebCore::FontCascade::setAntialiasedFontDilationEnabled): Deleted.
358         (WebCore::FontCascade::antialiasedFontDilationEnabled): Deleted.
359         * platform/graphics/FontCascade.h:
360         * platform/graphics/GraphicsContext.cpp:
361         (WebCore::GraphicsContextStateChange::changesFromState): Deleted.
362         (WebCore::GraphicsContextStateChange::accumulate): Deleted.
363         (WebCore::GraphicsContextStateChange::apply): Deleted.
364         (WebCore::GraphicsContextStateChange::dump): Deleted.
365         (WebCore::GraphicsContext::setAntialiasedFontDilationEnabled): Deleted.
366         * platform/graphics/GraphicsContext.h:
367         (WebCore::GraphicsContextState::GraphicsContextState): Deleted.
368         (WebCore::GraphicsContext::antialiasedFontDilationEnabled): Deleted.
369         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
370         (PlatformCALayer::drawLayerContents): Deleted.
371         * platform/graphics/cocoa/FontCascadeCocoa.mm:
372         (WebCore::dilationSizeForTextColor): Deleted.
373         (WebCore::FontCascade::drawGlyphs): Deleted.
374         * platform/graphics/displaylists/DisplayList.cpp:
375         (WebCore::DisplayList::DisplayList::shouldDumpForFlags): Deleted.
376
377 2016-02-29  Jer Noble  <jer.noble@apple.com>
378
379         Refactor CoreVideo API access into their own classes so code can be re-used.
380         https://bugs.webkit.org/show_bug.cgi?id=154544
381
382         Reviewed by Eric Carlson.
383
384         In order for common CoreVideo code paths to be re-used in other classes, pull those paths
385         out of MediaPlayerPrivateAVFoundationObjC and into re-usable clasess.
386
387         * WebCore.xcodeproj/project.pbxproj:
388         * platform/cf/CoreMediaSoftLink.cpp:
389         * platform/cf/CoreMediaSoftLink.h:
390         * platform/cocoa/CoreVideoSoftLink.cpp: Added.
391         * platform/cocoa/CoreVideoSoftLink.h: Added.
392         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
393         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
394         (WebCore::MediaPlayerPrivateAVFoundationObjC::createPixelBuffer):
395         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateLastImage):
396         (WebCore::MediaPlayerPrivateAVFoundationObjC::copyVideoTextureToPlatformTexture):
397         (WebCore::CVPixelBufferGetBytePointerCallback): Deleted.
398         (WebCore::CVPixelBufferReleaseBytePointerCallback): Deleted.
399         (WebCore::CVPixelBufferReleaseInfoCallback): Deleted.
400         (WebCore::createImageFromPixelBuffer): Deleted.
401         (WebCore::enumToStringMap): Deleted.
402         * platform/graphics/cv/PixelBufferConformerCV.cpp: Added.
403         (WebCore::PixelBufferConformerCV::PixelBufferConformerCV):
404         (WebCore::CVPixelBufferGetBytePointerCallback):
405         (WebCore::CVPixelBufferReleaseBytePointerCallback):
406         (WebCore::CVPixelBufferReleaseInfoCallback):
407         (WebCore::PixelBufferConformerCV::createImageFromPixelBuffer):
408         * platform/graphics/cv/PixelBufferConformerCV.h: Added.
409         * platform/graphics/cv/TextureCacheCV.h: Added.
410         (WebCore::TextureCacheCV::context):
411         * platform/graphics/cv/TextureCacheCV.mm: Added.
412         (WebCore::TextureCacheCV::create):
413         (WebCore::TextureCacheCV::TextureCacheCV):
414         (WebCore::TextureCacheCV::textureFromImage):
415         * platform/graphics/cv/VideoTextureCopierCV.cpp: Added.
416         (WebCore::VideoTextureCopierCV::VideoTextureCopierCV):
417         (WebCore::VideoTextureCopierCV::~VideoTextureCopierCV):
418         (WebCore::enumToStringMap):
419         (WebCore::VideoTextureCopierCV::copyVideoTextureToPlatformTexture):
420         * platform/graphics/cv/VideoTextureCopierCV.h: Added.
421         (WebCore::VideoTextureCopierCV::context):
422         * platform/mediastream/mac/AVVideoCaptureSource.mm: Move SOFT_LINK declarations into CoreVideoSoftLink.h/cpp.
423
424 2016-02-29  Chris Dumez  <cdumez@apple.com>
425
426         Use WTF::Optional for HTMLOListElement::m_start
427         https://bugs.webkit.org/show_bug.cgi?id=154824
428
429         Reviewed by Andreas Kling.
430
431         Use WTF::Optional for HTMLOListElement::m_start.
432
433         * html/HTMLOListElement.cpp:
434         (WebCore::HTMLOListElement::parseAttribute):
435         * html/HTMLOListElement.h:
436
437 2016-02-29  Gavin Barraclough  <barraclough@apple.com>
438
439         RefCounter<T>::Event -> RefCounterEvent
440         https://bugs.webkit.org/show_bug.cgi?id=154767
441
442         Reviewed by Darin Adler.
443
444         RefCounter<T>::Event is kinda verbose to use, and there is no need for this
445         to be specific to a particular typeof RefCounter. Move the enum class up to
446         the top level & rename to RefCounterEvent.
447
448         * page/PageThrottler.cpp:
449         (WebCore::PageThrottler::PageThrottler):
450         (WebCore::m_audiblePluginHysteresis):
451         (WebCore::m_mediaActivityCounter):
452         (WebCore::m_pageLoadActivityCounter):
453         * platform/VNodeTracker.cpp:
454         (WebCore::VNodeTracker::singleton):
455         (WebCore::VNodeTracker::VNodeTracker):
456         (WebCore::m_lastWarningTime):
457
458 2016-02-29  Chris Dumez  <cdumez@apple.com>
459
460         Use HTML parsing rules for textarea.maxLength
461         https://bugs.webkit.org/show_bug.cgi?id=154805
462
463         Reviewed by Andreas Kling.
464
465         Use HTML parsing rules for textarea.maxLength:
466         - https://html.spec.whatwg.org/multipage/forms.html#dom-textarea-maxlength
467         - https://html.spec.whatwg.org/multipage/infrastructure.html#limited-to-only-non-negative-numbers
468
469         No new tests, already covered by existing test.
470
471         * html/HTMLTextAreaElement.cpp:
472         (WebCore::HTMLTextAreaElement::maxLength):
473
474 2016-02-29  Chris Dumez  <cdumez@apple.com>
475
476         Align td.rowSpan / td.colSpan with the specification
477         https://bugs.webkit.org/show_bug.cgi?id=154803
478
479         Reviewed by Darin Adler.
480
481         Align td.rowSpan / td.colSpan with the specification:
482         - https://html.spec.whatwg.org/multipage/tables.html#htmltablecellelement
483         - https://html.spec.whatwg.org/multipage/tables.html#dom-tdth-colspan
484         - https://html.spec.whatwg.org/multipage/tables.html#dom-tdth-rowspan
485
486         In particular, the following changes were made:
487         - Change type from 'long' to 'unsigned long'.
488         - Use HTML rules for parsing unsigned integers:
489           - https://html.spec.whatwg.org/multipage/infrastructure.html#rules-for-parsing-non-negative-integers
490         - Use 1 as default value when the input value is out of range instead
491           of 0 when setting.
492         - rowspan is still clamped to [1, 8190] internally but we now expose the
493           unclamped value to JS as this is an internal restriction. The same is
494           done for a colSpan value of 0, we expose 0 to the Web but clamp to 1
495           internally.
496
497         No new tests, already covered by existing test.
498
499         * html/HTMLTableCellElement.cpp:
500         (WebCore::HTMLTableCellElement::colSpan):
501         (WebCore::HTMLTableCellElement::rowSpan):
502         (WebCore::HTMLTableCellElement::rowSpanForBindings):
503         (WebCore::HTMLTableCellElement::setColSpan):
504         (WebCore::HTMLTableCellElement::setRowSpanForBindings):
505         (WebCore::HTMLTableCellElement::axis): Deleted.
506         (WebCore::HTMLTableCellElement::headers): Deleted.
507         * html/HTMLTableCellElement.h:
508         * html/HTMLTableCellElement.idl:
509
510 2016-02-29  Chris Dumez  <cdumez@apple.com>
511
512         [Web IDL] Add support for [TreatNullAs=EmptyString] and use it
513         https://bugs.webkit.org/show_bug.cgi?id=154654
514
515         Reviewed by Darin Adler.
516
517         Add support for [TreatNullAs=EmptyString] standard Web IDL extended
518         attribute:
519         - http://heycam.github.io/webidl/#TreatNullAs
520
521         This replaces the WebKit-specific [TreatNullAs=NullString] IDL
522         extended attribute. Instead of passing a null String() to the
523         implementation, emptyString() is passed.
524
525         This patch does not cause any web-exposed behavior change. For
526         case where switching from NullString to EmptyString would change
527         the behavior (or require changes to the implementation), the old
528         IDL attribute was kept. However, it was renamed to
529         [TreatNullAs=LegacyNullString] to discourage its use in new code.
530         Eventually, this legacy IDL attribute should go away entirely.
531
532         [TreatNullAs=EmptyString] should only be used when it is present
533         in the corresponding specification. Note that there are a lot of
534         places where we use [TreatNullAs=EmptyString] in our IDL where it
535         does not match the specification. I have added FIXME comments for
536         those so we can clean them up later.
537
538         No new tests, no web-exposed behavior change.
539
540         * Modules/mediastream/RTCPeerConnection.idl:
541         No behavior change because this is not implemented.
542
543         * bindings/js/JSDOMBinding.cpp:
544         (WebCore::valueToStringTreatingNullAsEmptyString):
545         * bindings/js/JSDOMBinding.h:
546         Add new function to convert a JSValue into a String while treating
547         null as the empty string.
548
549         * bindings/scripts/CodeGeneratorJS.pm:
550         (JSValueToNative):
551         * bindings/scripts/IDLAttributes.txt:
552         - Add support for [TreatNullAs=EmptyString].
553         - Rename NullString to LegacyNullString to discourage its use.
554
555         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
556         * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
557         * bindings/scripts/test/JS/JSTestObj.cpp:
558         * bindings/scripts/test/ObjC/DOMTestObj.h:
559         * bindings/scripts/test/ObjC/DOMTestObj.mm:
560         * bindings/scripts/test/TestObj.idl:
561         Add bindings tests coverage for [TreatNullAs=EmptyString].
562
563         * css/CSSStyleDeclaration.idl:
564         * dom/CharacterData.idl:
565         * dom/DOMImplementation.idl:
566         * dom/Document.idl:
567         * dom/Element.idl:
568         * dom/ShadowRoot.idl:
569         * html/HTMLOutputElement.idl:
570         * html/HTMLScriptElement.idl:
571         * html/URLUtils.idl:
572         * svg/SVGAngle.idl:
573         * svg/SVGLength.idl:
574         Use [TreatNullAs=EmptyString] instead of [TreatNullAs=NullString].
575         There is not behavior change because the implementation does
576         not distinguish the null string from the empty string.
577
578         * html/HTMLBaseElement.idl:
579         * html/HTMLButtonElement.idl:
580         * html/HTMLFormElement.idl:
581         * html/HTMLMediaElement.idl:
582         * html/HTMLSelectElement.idl:
583         * svg/SVGElement.idl:
584         * svg/SVGScriptElement.idl:
585         Rename [TreatNullAs=NullString] to [TreatNullAs=LegacyNullString],
586         no behavior change.
587
588         * html/HTMLDocument.idl:
589         - dir and *Color: Rename [TreatNullAs=NullString] to
590           [TreatNullAs=LegacyNullString].
591         - designMode: Drop [TreatNullAs=NullString] as per the specification:
592           - https://html.spec.whatwg.org/multipage/dom.html#the-document-object
593           null now gets converted to "null" instead of the null String but this
594           does not change behavior because the implementation only recognizes
595           "on" / "off" / others. So we still end up using inherit mode when
596           set to null.
597
598         * html/HTMLElement.idl:
599         - Use [TreatNullAs=EmptyString] instead of [TreatNullAs=NullString] for
600           innerText / outerText. Does not change behavior because the
601           implementation does not distinguishes.
602         - Drop [TreatNullAs=NullString] from contentEditable to match the spec:
603           - https://html.spec.whatwg.org/multipage/interaction.html#elementcontenteditable
604           This does not change behavior because the implementation will the a SyntaxError
605           wether a null String or the string "null" is passed.
606
607         * html/HTMLFrameElement.idl:
608         Drop [TreatNullAs=NullString] from location attribute. This does not
609         change behavior because the attribute is using a custom setter.
610
611         * html/HTMLInputElement.idl:
612         - formEnctype / formMethod / autocapitalize: Rename [TreatNullAs=NullString] to
613           [TreatNullAs=LegacyNullString].
614         - value: Rename [TreatNullAs=NullString] to Rename [TreatNullAs=EmptyString], which
615           does not change behavior because the implementation does not distinguish. Also
616           drop the extended attribute for non-JS bindings as it has no impact.
617
618         * html/HTMLMediaElement.cpp:
619         (WebCore::HTMLMediaElement::setMediaGroup):
620         Drop redundant group.isNull() check as group.isEmpty() already checks for null.
621
622         * html/HTMLScriptElement.cpp:
623         (WebCore::HTMLScriptElement::setText):
624         Drop useless .impl() call as we have a String and the method requires a String
625         as input.
626
627         * html/HTMLTextAreaElement.cpp:
628         (WebCore::HTMLTextAreaElement::setValueCommon):
629         Use emptyString() instead of "" as it is slightly more efficient.
630
631         * html/HTMLTextAreaElement.idl:
632         - value: Use [TreatNullAs=EmptyString] instead of [TreatNullAs=NullString]. No
633           behavior change because the implementation does not distinguish.
634         - autocapitalize: Rename [TreatNullAs=NullString] to [TreatNullAs=LegacyNullString].
635
636         * html/canvas/CanvasRenderingContext2D.idl:
637         - globalCompositeOperation / repetitionType: Use [TreatNullAs=EmptyString] instead of
638           [TreatNullAs=NullString]. No behavior change because the implementation does not
639           distinguish.
640         - lineCap / lineJoin: Drop the [TreatNullAs=NullString] to match the spec:
641           - https://html.spec.whatwg.org/multipage/scripting.html#canvaspathdrawingstyles
642           There is no behavior change because those are string enumerations and the value
643           is not recognized either way (String() or String("null")).
644         - shadowColor: Drop the [TreatNullAs=NullString] to match the spec:
645           - https://html.spec.whatwg.org/multipage/scripting.html#canvasshadowstyles
646           No behavior change because this is not a valid color either way.
647
648 2016-02-29  Youenn Fablet  <youenn.fablet@crf.canon.fr>
649
650         Refactor FetchBody constructors
651         https://bugs.webkit.org/show_bug.cgi?id=154721
652
653         Reviewed by Sam Weinig and Darin Adler.
654
655         Covered by existing tests.
656
657         * Modules/fetch/FetchBody.cpp:
658         (WebCore::FetchBody::extract): Renamed from "fromJSValue"
659         (WebCore::FetchBody::extractFromBody): Renamed from "fromRequestBody" and making use of move constructor.
660         * Modules/fetch/FetchBody.h:
661         (WebCore::FetchBody::FetchBody): Making default constructor public and removing empty static method.
662         * Modules/fetch/FetchRequest.cpp:
663         (WebCore::buildBody):
664         * Modules/fetch/FetchResponse.cpp:
665         (WebCore::FetchResponse::error):
666         (WebCore::FetchResponse::redirect):
667         (WebCore::FetchResponse::initializeWith):
668         * Modules/fetch/FetchResponse.h:
669         (WebCore::FetchResponse::create):
670
671 2016-02-28  Antti Koivisto  <antti@apple.com>
672
673         ::slotted doesn't work in nested shadow trees
674         https://bugs.webkit.org/show_bug.cgi?id=154765
675         <rdar://problem/24870995>
676
677         Reviewed by Ryosuke Niwa.
678
679         See https://github.com/w3c/webcomponents/issues/331#issuecomment-189191593
680
681         Test: fast/shadow-dom/css-scoping-shadow-slotted-nested.html
682
683         * css/ElementRuleCollector.cpp:
684         (WebCore::ElementRuleCollector::matchSlottedPseudoElementRules):
685
686         Collect ::slotted rules from all the nested shadow trees instead of just the host's.
687
688 2016-02-28  Chris Dumez  <cdumez@apple.com>
689
690         Parse HTMLOLElement.start as per the HTML spec
691         https://bugs.webkit.org/show_bug.cgi?id=154802
692
693         Reviewed by Andreas Kling.
694
695         Parse HTMLOLElement.start as per the HTML spec:
696         - https://html.spec.whatwg.org/multipage/semantics.html#dom-ol-start
697         - https://html.spec.whatwg.org/multipage/infrastructure.html#rules-for-parsing-integers
698
699         No new tests, already covered by existing test.
700
701         * html/HTMLOListElement.cpp:
702         (WebCore::HTMLOListElement::parseAttribute):
703
704 2016-02-28  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
705
706         Reduce uses of PassRefPtr in indexeddb
707         https://bugs.webkit.org/show_bug.cgi?id=154273
708
709         Reviewed by Darin Adler.
710
711         No new tests, no behavior changes.
712
713         * Modules/indexeddb/IDBDatabaseError.h:
714         (WebCore::IDBDatabaseError::create):
715         * Modules/indexeddb/IDBKeyData.cpp:
716         (WebCore::IDBKeyData::maybeCreateIDBKey):
717         * Modules/indexeddb/IDBKeyData.h:
718         * Modules/indexeddb/IDBKeyRange.cpp:
719         (WebCore::IDBKeyRange::create):
720         (WebCore::IDBKeyRange::IDBKeyRange):
721         (WebCore::IDBKeyRange::only):
722         (WebCore::IDBKeyRange::lowerBound):
723         (WebCore::IDBKeyRange::upperBound):
724         (WebCore::IDBKeyRange::bound):
725         * Modules/indexeddb/IDBKeyRange.h:
726         (WebCore::IDBKeyRange::create):
727         (WebCore::IDBKeyRange::lower):
728         (WebCore::IDBKeyRange::upper):
729         (WebCore::IDBKeyRange::lowerBound):
730         (WebCore::IDBKeyRange::upperBound):
731         (WebCore::IDBKeyRange::bound):
732         * Modules/indexeddb/IDBKeyRangeData.cpp:
733         (WebCore::IDBKeyRangeData::maybeCreateIDBKeyRange):
734         * Modules/indexeddb/IDBKeyRangeData.h:
735         * Modules/indexeddb/IDBServerConnection.h:
736         * Modules/indexeddb/legacy/IDBCallbacks.h:
737         * Modules/indexeddb/legacy/IDBCursorBackend.cpp:
738         (WebCore::IDBCursorBackend::continueFunction):
739         * Modules/indexeddb/legacy/IDBCursorBackend.h:
740         * Modules/indexeddb/legacy/IDBCursorBackendOperations.h:
741         (WebCore::CursorIterationOperation::create):
742         (WebCore::CursorIterationOperation::CursorIterationOperation):
743         * Modules/indexeddb/legacy/IDBTransactionBackendOperations.cpp:
744         (WebCore::GetOperation::perform):
745         (WebCore::PutOperation::perform):
746         * Modules/indexeddb/legacy/LegacyCursor.cpp:
747         (WebCore::LegacyCursor::continueFunction):
748         * Modules/indexeddb/legacy/LegacyCursor.h:
749         * Modules/indexeddb/legacy/LegacyFactory.h:
750         (WebCore::LegacyFactory::create):
751         * Modules/indexeddb/legacy/LegacyRequest.cpp:
752         (WebCore::LegacyRequest::onSuccess):
753         * Modules/indexeddb/legacy/LegacyRequest.h:
754         * inspector/InspectorIndexedDBAgent.cpp:
755
756 2016-02-28  Tim Horton  <timothy_horton@apple.com>
757
758         Switch to application/vnd.apple.folder for <attachment> folder special-case
759         https://bugs.webkit.org/show_bug.cgi?id=154786
760         <rdar://problem/24416632>
761
762         Reviewed by Anders Carlsson.
763
764         No new tests, adjusted an existing test to cover this.
765
766         * rendering/RenderThemeMac.mm:
767         (WebCore::iconForAttachment):
768         Add a second folder MIME type.
769
770 2016-02-28  Tim Horton  <timothy_horton@apple.com>
771
772         Variables can resolve to the wrong value when elements differ in nothing but inherited variable value
773         https://bugs.webkit.org/show_bug.cgi?id=154785
774
775         Reviewed by Antti Koivisto.
776
777         Test: fast/css/variables/avoid-matched-property-cache.html
778
779         * css/StyleResolver.cpp:
780         (WebCore::StyleResolver::MatchResult::addMatchedProperties):
781         Disable the matched property cache when a value is variable-dependent, because
782         they can resolve to inherited values, and the matched property cache could
783         end up copying the wrong value from another similarly-styled element.
784
785 2016-02-28  Konstantin Tokarev  <annulen@yandex.ru>
786
787         SVGToOTFFontConversion.cpp does not compile with libstdc++ 4.8
788         https://bugs.webkit.org/show_bug.cgi?id=154794
789
790         Reviewed by Michael Catanzaro.
791
792         No new tests needed.
793
794         * svg/SVGToOTFFontConversion.cpp:
795         (WebCore::SVGToOTFFontConverter::appendLigatureSubtable): Added const
796         qualifiers.
797
798 2016-02-27  Chris Dumez  <cdumez@apple.com>
799
800         Prevent cross-origin access to Location.assign() / Location.reload()
801         https://bugs.webkit.org/show_bug.cgi?id=154779
802
803         Reviewed by Darin Adler.
804
805         Prevent cross-origin access to Location.assign() / Location.reload()
806         to match the latest specification:
807         - https://html.spec.whatwg.org/multipage/browsers.html#crossoriginproperties-(-o-)
808
809         Firefox and Chrome already prevent this but WebKit allowed it.
810
811         No new tests, already covered by existing tests.
812
813         * bindings/js/JSLocationCustom.cpp:
814         (WebCore::JSLocation::getOwnPropertySlotDelegate):
815         (WebCore::JSLocation::putDelegate): Deleted.
816
817 2016-02-27  Andy VanWagoner  <thetalecrafter@gmail.com>
818
819         Intl.Collator uses POSIX locale (detected by js/intl-collator.html on iOS Simulator)
820         https://bugs.webkit.org/show_bug.cgi?id=152448
821
822         Reviewed by Darin Adler.
823
824         Pass defaultLanguage from Language.h to the globalObjectMethodTable to
825         ensure Intl objects can be initialized with the correct default locale.
826
827         * bindings/js/JSDOMWindowBase.cpp:
828         * bindings/js/JSWorkerGlobalScopeBase.cpp:
829
830 2016-02-27  Chris Dumez  <cdumez@apple.com>
831
832         Align HTMLMarqueeElement.scrollAmount / scrollDelay with the specification
833         https://bugs.webkit.org/show_bug.cgi?id=154781
834
835         Reviewed by Darin Adler.
836
837         Align HTMLMarqueeElement.scrollAmount / scrollDelay with the
838         specification:
839         - https://www.w3.org/TR/html5/obsolete.html#the-marquee-element-0
840
841         In particular:
842         - The attributes should have unsigned long type
843         - We should not throw for negative values
844         - Values should be in the range [0, 2147483647] as per:
845         - https://html.spec.whatwg.org/multipage/infrastructure.html#reflect
846
847         No new tests, already covered by existing tests.
848
849         * html/HTMLMarqueeElement.cpp:
850         (WebCore::HTMLMarqueeElement::scrollAmount):
851         (WebCore::HTMLMarqueeElement::setScrollAmount):
852         (WebCore::HTMLMarqueeElement::scrollDelay):
853         (WebCore::HTMLMarqueeElement::setScrollDelay):
854         (WebCore::HTMLMarqueeElement::loop): Deleted.
855         * html/HTMLMarqueeElement.h:
856         * html/HTMLMarqueeElement.idl:
857
858 2016-02-27  Commit Queue  <commit-queue@webkit.org>
859
860         Unreviewed, rolling out r197204, r197207, r197211, r197217,
861         r197218, and r197219.
862         https://bugs.webkit.org/show_bug.cgi?id=154780
863
864         Caused crashes in WebVideoFullscreenManagerProxy (Requested by
865         ap on #webkit).
866
867         Reverted changesets:
868
869         "Add support for playbackControlsManager"
870         https://bugs.webkit.org/show_bug.cgi?id=154742
871         http://trac.webkit.org/changeset/197204
872
873         "Attempted build fix."
874         http://trac.webkit.org/changeset/197207
875
876         "Attempted build fix."
877         http://trac.webkit.org/changeset/197211
878
879         "Attempted 32-bit build fix."
880         http://trac.webkit.org/changeset/197217
881
882         "Another 32-bit build fix."
883         http://trac.webkit.org/changeset/197218
884
885         "32-bit!!!"
886         http://trac.webkit.org/changeset/197219
887
888 2016-02-27  Chris Dumez  <cdumez@apple.com>
889
890         Optimize parseHTMLInteger()
891         https://bugs.webkit.org/show_bug.cgi?id=154772
892
893         Reviewed by Ryosuke Niwa.
894
895         Optimize parseHTMLInteger() a bit now that it is used a lot more and
896         that it has decent API test coverage. In particular, we now:
897         - Avoid using a StringBuilder for the digits.
898         - Get rid of a is8Bit() branch.
899         - Only traverse the input string once.
900
901         * html/parser/HTMLParserIdioms.cpp:
902         (WebCore::parseHTMLIntegerInternal):
903         (WebCore::parseHTMLInteger):
904         (WebCore::parseHTMLNonNegativeInteger): Deleted.
905
906 2016-02-27  Andreas Kling  <akling@apple.com>
907
908         [iOS] Discard decoded image data on top-level navigation.
909         <https://webkit.org/b/154776>
910
911         Reviewed by Anders Carlsson.
912
913         Add a mechanism that destroys decoded data for all CachedImages and invoke it
914         when performing a top-level navigation on iOS.
915
916         This substantially reduces the ImageIO contribution to our peak memory footprint.
917
918         It would be even better if we could mark these images volatile during the transition
919         but we currently don't have framework support for such machinations.
920
921         * loader/FrameLoader.cpp:
922         (WebCore::FrameLoader::commitProvisionalLoad):
923         * loader/cache/MemoryCache.cpp:
924         (WebCore::MemoryCache::forEachResource):
925         (WebCore::MemoryCache::destroyDecodedDataForAllImages):
926         * loader/cache/MemoryCache.h:
927
928 2016-02-26  Carlos Garcia Campos  <cgarcia@igalia.com>
929
930         Network cache: old pages returned by disk cache on history navigation after session is restored
931         https://bugs.webkit.org/show_bug.cgi?id=153230
932
933         Reviewed by Chris Dumez.
934
935         Add a flag to HistoryItem to mark them as restored from session
936         and use it from the FrameLoader to not change the policy request
937         when navigating to a history item that was restored from session,
938         except for iOS port.
939
940         * history/HistoryItem.h:
941         (WebCore::HistoryItem::setWasRestoredFromSession):
942         (WebCore::HistoryItem::wasRestoredFromSession):
943         * loader/FrameLoader.cpp:
944         (WebCore::FrameLoader::loadDifferentDocumentItem):
945
946 2016-02-26  Michael Catanzaro  <mcatanzaro@igalia.com>
947
948         Remove unused private field from WEBPImageDecoder
949
950         Unreviewed.
951
952         * platform/image-decoders/webp/WEBPImageDecoder.cpp:
953         (WebCore::WEBPImageDecoder::WEBPImageDecoder):
954         * platform/image-decoders/webp/WEBPImageDecoder.h:
955
956 2016-02-26  Chris Dumez  <cdumez@apple.com>
957
958         Fix the behavior of reflecting IDL attributes of type unsigned long
959         https://bugs.webkit.org/show_bug.cgi?id=154771
960
961         Reviewed by Ryosuke Niwa.
962
963         Fix the behavior of reflecting IDL attributes of type unsigned long to
964         align with the specification:
965         - https://html.spec.whatwg.org/multipage/infrastructure.html#reflecting-content-attributes-in-idl-attributes
966         - https://html.spec.whatwg.org/multipage/infrastructure.html#rules-for-parsing-non-negative-integers
967
968         Firefox and Chrome already follow the specification.
969
970         There were several issues with our implementation, which are all
971         addressed in this patch:
972         - Upon getting, the value returned must be in the range 0 to 2147483647.
973           Otherwise, we must return the default value (0 unless specified
974           otherwise). We previously returned values in the range 0 to 4294967295
975           instead.
976         - Upon setting, we must set the content attribute to the default value
977           (0 unless specified otherwise) if the input value is not in the range
978           0 to 2147483647. We previously allowed values in the range 0 to
979           4294967295 instead.
980         - "-0" was not recognized as a valid unsigned integer
981
982         Test: fast/dom/reflect-unsigned-long.html
983
984         * dom/Element.cpp:
985         (WebCore::Element::setUnsignedIntegralAttribute):
986         Update setUnsignedIntegralAttribute() to limit the input value in the
987         0 to 2147483647 range, as per the HTML specification. This method is
988         called by the bindings implementation of reflecting attributes setters.
989
990         * html/parser/HTMLParserIdioms.cpp:
991         (WebCore::parseHTMLNonNegativeInteger):
992         Update parseHTMLNonNegativeInteger() to call parseHTMLInteger() instead
993         of duplicating most of its code and fail if the value returned is
994         negative. This matches the algorithm in the specification:
995         - https://html.spec.whatwg.org/multipage/infrastructure.html#rules-for-parsing-non-negative-integers
996
997         This has 2 behavior changes:
998         1. "-0" is now correctly parsed as 0.
999         2. The returned values are in the range 0 to 2147483647.
1000
1001         * html/parser/HTMLParserIdioms.h:
1002         (WebCore::limitToOnlyHTMLNonNegativeNumbersGreaterThanZero):
1003         (WebCore::limitToOnlyHTMLNonNegative):
1004         Drop the checks for "<= 2147483647" and replace with an assertion
1005         now that parseHTMLNonNegativeInteger() already returned values in
1006         the right range.
1007
1008 2016-02-26  Zalan Bujtas  <zalan@apple.com>
1009
1010         REGRESSION (188611): Search field Cancel button should not overlap search text on extensions page.
1011         https://bugs.webkit.org/show_bug.cgi?id=154692
1012         <rdar://problem/22840453>
1013
1014         Reviewed by Brent Fulgham.
1015
1016         Adjust the cancel button position using the actual size of the cancel button.
1017
1018         When the input box and the font height trigger different cancel button sizes, we need to readjust
1019         the rectangle returned by cancelButtonRectForBounds.
1020         This fixes both the mispositioned cancel button and the squared off icon when the input field is zoomed all the way in.
1021
1022         Covered by existing tests.
1023
1024         * rendering/RenderThemeMac.mm:
1025         (WebCore::RenderThemeMac::paintSearchFieldCancelButton):
1026         (WebCore::RenderThemeMac::cancelButtonSizes): Update button size.
1027
1028 2016-02-26  Brady Eidson  <beidson@apple.com>
1029
1030         Modern IDB: New database versions are never committed to SQLite.
1031         <rdar://problem/24860952> and https://bugs.webkit.org/show_bug.cgi?id=154741
1032         
1033         Modern IDB: If a database handle is not open, files are not actually deleted from disk
1034         https://bugs.webkit.org/show_bug.cgi?id=154756
1035
1036         Reviewed by Alex Christensen.
1037
1038         Tested by API test "IndexedDBPersistence"
1039
1040         * Modules/indexeddb/server/IDBServer.cpp:
1041         (WebCore::IDBServer::IDBServer::deleteDatabase): If there's not an open handle to the database, create one.
1042
1043         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
1044         (WebCore::IDBServer::SQLiteIDBBackingStore::beginTransaction): If a version change transaction, actually
1045           set the new version on disk.
1046         
1047         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1048         (WebCore::IDBServer::UniqueIDBDatabase::performCurrentDeleteOperation):
1049         (WebCore::IDBServer::UniqueIDBDatabase::deleteBackingStore): If there is no open backing store, create one.
1050           This is necessary to both read the current database version, and to actually delete the file on disk.
1051         (WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore): If necessary, manufacture a "most recently
1052           deleted database info" from the version returned by deleteBackingStore.
1053         * Modules/indexeddb/server/UniqueIDBDatabase.h:
1054
1055 2016-02-26  Chris Dumez  <cdumez@apple.com>
1056
1057         Add API test coverage for parseHTMLInteger / parseHTMLNonNegativeInteger
1058         https://bugs.webkit.org/show_bug.cgi?id=154714
1059
1060         Reviewed by Darin Adler.
1061
1062         Export a couple more symbols for API testing.
1063
1064         * html/parser/HTMLParserIdioms.h:
1065
1066 2016-02-26  Beth Dakin  <bdakin@apple.com>
1067
1068         32-bit!!!
1069
1070         * platform/mac/WebVideoFullscreenInterfaceMac.mm:
1071         (-[WebPlaybackControlsManager initWithWebVideoFullscreenInterfaceMac:]):
1072
1073 2016-02-26  Beth Dakin  <bdakin@apple.com>
1074
1075         Another 32-bit build fix.
1076
1077         * platform/spi/cocoa/AVKitSPI.h:
1078
1079 2016-02-26  Beth Dakin  <bdakin@apple.com>
1080
1081         Attempted 32-bit build fix.
1082
1083         * platform/mac/WebVideoFullscreenInterfaceMac.mm:
1084         (-[WebPlaybackControlsManager initWithWebVideoFullscreenInterfaceMac:]):
1085
1086 2016-02-26  Commit Queue  <commit-queue@webkit.org>
1087
1088         Unreviewed, rolling out r197160.
1089         https://bugs.webkit.org/show_bug.cgi?id=154757
1090
1091         This change causes editing/mac/attributed-string/font-
1092         size.html to fail on El Capitan WK1 (Requested by ryanhaddad
1093         on #webkit).
1094
1095         Reverted changeset:
1096
1097         "Font size computed style is innaccurate"
1098         https://bugs.webkit.org/show_bug.cgi?id=154705
1099         http://trac.webkit.org/changeset/197160
1100
1101 2016-02-26  Gavin Barraclough  <barraclough@apple.com>
1102
1103         Page TimerAlignmentIntervalIncrease mechanism should have upper limit
1104         https://bugs.webkit.org/show_bug.cgi?id=154744
1105
1106         Reviewed by Geoff Garen.
1107
1108         There would be diminishing returns from throttling timers in background pages infinitely.
1109         Add a heuristic to limit appropriately.
1110
1111         Keep track of the current limit, and make the increase time take this into account.
1112
1113         * page/Page.cpp:
1114         (WebCore::Page::setTimerThrottlingEnabled):
1115             - When timer throttling is disabled visit all timers to resume.
1116         (WebCore::Page::setTimerAlignmentIntervalIncreaseLimit):
1117             - Track the maximum alignment interval, and call setDOMTimerAlignmentInterval
1118               to ensure m_timerAlignmentInterval is updated in accordance with the new limit.
1119         (WebCore::Page::setDOMTimerAlignmentInterval):
1120             - When the timer alignemnt interval changes update the increase timer.
1121         (WebCore::Page::timerAlignmentIntervalIncreaseTimerFired):
1122             - Apply limit.
1123         * page/Page.h:
1124         (WebCore::Page::timerThrottlingEnabled):
1125             - Accessor for readability.
1126
1127 2016-02-26  Beth Dakin  <bdakin@apple.com>
1128
1129         Attempted build fix.
1130
1131         * platform/spi/cocoa/AVKitSPI.h:
1132
1133 2016-02-26  Beth Dakin  <bdakin@apple.com>
1134
1135         Add support for playbackControlsManager
1136         https://bugs.webkit.org/show_bug.cgi?id=154742
1137         -and corresponding-
1138         rdar://problem/23833753
1139
1140         Reviewed by Jer Noble.
1141
1142         Make AVKitSPI.h private so that it can be used from other projects.
1143         * WebCore.xcodeproj/project.pbxproj:
1144
1145         Right now, set up a controls manager for a video when it starts playing. In 
1146         the future, this is something that should be handled by the 
1147         PlatformMediaSessionManager since we only want a controls for the 
1148         currentSession.
1149         * html/HTMLMediaElement.cpp:
1150         (WebCore::HTMLMediaElement::playInternal):
1151
1152         New function setUpVideoControlsManager.
1153         * page/ChromeClient.h:
1154
1155         Make these CoreMedia functions available on Mac and iOS instead of just iOS.
1156         * platform/cf/CoreMediaSoftLink.cpp:
1157         * platform/cf/CoreMediaSoftLink.h:
1158
1159         This patch fleshes out an implementation for a bunch of these interface 
1160         functions since they need to communicate to the playbackControlsManager. This 
1161         is also where the playbackControlsManager lives.
1162         * platform/mac/WebVideoFullscreenInterfaceMac.h:
1163
1164         Define an interface and implementation for WebPlaybackControlsManager.
1165         * platform/mac/WebVideoFullscreenInterfaceMac.mm:
1166         (-[WebPlaybackControlsManager initWithWebVideoFullscreenInterfaceMac:]):
1167         (-[WebPlaybackControlsManager isSeeking]):
1168         (-[WebPlaybackControlsManager seekToTime:toleranceBefore:toleranceAfter:]):
1169         (-[WebPlaybackControlsManager audioMediaSelectionOptions]):
1170         (-[WebPlaybackControlsManager currentAudioMediaSelectionOption]):
1171         (-[WebPlaybackControlsManager setCurrentAudioMediaSelectionOption:]):
1172         (-[WebPlaybackControlsManager legibleMediaSelectionOptions]):
1173         (-[WebPlaybackControlsManager currentLegibleMediaSelectionOption]):
1174         (-[WebPlaybackControlsManager setCurrentLegibleMediaSelectionOption:]):
1175         (-[WebPlaybackControlsManager cancelThumbnailAndAudioAmplitudeSampleGeneration]):
1176
1177         Relay this information to the playbackControlsManager.
1178         (WebCore::WebVideoFullscreenInterfaceMac::setDuration):
1179         (WebCore::WebVideoFullscreenInterfaceMac::setCurrentTime):
1180         (WebCore::WebVideoFullscreenInterfaceMac::setRate):
1181         (WebCore::WebVideoFullscreenInterfaceMac::setSeekableRanges):
1182         (WebCore::WebVideoFullscreenInterfaceMac::ensureControlsManager):
1183         (WebCore::WebVideoFullscreenInterfaceMac::playBackControlsManager):
1184         (WebCore::WebVideoFullscreenInterfaceMac::setupFullscreen):
1185
1186         New SPI needed.
1187         * platform/spi/cocoa/AVKitSPI.h:
1188         * platform/spi/mac/AVFoundationSPI.h:
1189
1190 2016-02-26  Said Abou-Hallawa  <sabouhallawa@apple.com>
1191
1192         <g> wrapping <symbol> causes display of hidden <symbol>
1193         https://bugs.webkit.org/show_bug.cgi?id=154576
1194
1195         Reviewed by Darin Adler.
1196         
1197         The SVGSymbolElement is allowed in the shadow tree of an SVGUseElement
1198         only if it subtree root element. Any descendant SVGSymbolElement should
1199         be removed from the subtree because it is a hidden container. If the cloned
1200         subtree includes an SVGUseElement which references an SVGSymbolElement,
1201         the same rule will be applied to the descendant SVGUseElement. The goal
1202         is to remove all the descendant SVGSymbolElements from the cloned target
1203         because these SVGSymbolElements will be expanded to SVGSVGElements and
1204         hence become visible.
1205
1206         * svg/SVGUseElement.cpp:
1207         (WebCore::disassociateAndRemoveClones): A helper function which removes
1208         cloned SVGElements and their subtrees from their parents and disassociate
1209         them from their originals.
1210         
1211         (WebCore::removeDisallowedElementsFromSubtree): Use disassociateAndRemoveClones().
1212         
1213         (WebCore::removeSymbolElementsFromSubtree): Removes all the descendant
1214         SVGSymbolElements from the cloned subtree. It does not remove the root
1215         element itself if it is an SVGSymbolElement because this one will be
1216         expanded to an SVGSVGElement which is exactly what we need.
1217         
1218         (WebCore::SVGUseElement::cloneTarget): Call removeSymbolElementsFromSubtree()
1219         to remove the descendant SVGSymbolElements from the cloned subtree before
1220         appending it to the container shadow root.
1221
1222 2016-02-26  Olivier Blin  <olivier.blin@softathome.com>
1223
1224         Initialize LocaleICU data members in header
1225         https://bugs.webkit.org/show_bug.cgi?id=154731
1226
1227         Reviewed by Michael Catanzaro.
1228
1229         LocaleICU data members should be initialized in the header, to
1230         avoid conditional initialization lines in the constructor, as
1231         suggested by Darin in bug 154484.
1232
1233         * platform/text/LocaleICU.cpp:
1234         (WebCore::LocaleICU::LocaleICU): Deleted.
1235         * platform/text/LocaleICU.h:
1236
1237 2016-02-26  Brady Eidson  <beidson@apple.com>
1238
1239         Modern IDB: Using existing database info from SQLite backing store is busted.
1240         <rdar://problem/24848143> and https://bugs.webkit.org/show_bug.cgi?id=154735
1241
1242         Reviewed by Alex Christensen.
1243
1244         No new tests.
1245         
1246         Reproducing the bug requires having a known database on disk *before* launching the DatabaseProcess to
1247         read in the existing IDBDatabaseInfo.
1248         
1249         Our automated infrastructure currently has no way of testing this.
1250
1251         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
1252         (WebCore::IDBClient::IDBConnectionToServer::openDatabase):
1253         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
1254         (WebCore::IDBServer::SQLiteIDBBackingStore::getOrEstablishDatabaseInfo): Do the optional migrate on
1255           the IndexRecords table here; *every* time we open a SQLite backing store.
1256         (WebCore::IDBServer::SQLiteIDBBackingStore::createAndPopulateInitialDatabaseInfo): Deleted.
1257         * Modules/indexeddb/shared/IDBDatabaseInfo.cpp:
1258         (WebCore::IDBDatabaseInfo::isolatedCopy): Copy the entire object, not just name/version.
1259
1260 2016-02-25  Gavin Barraclough  <barraclough@apple.com>
1261
1262         RefCounter value changed callback should be called on all changes (not just zero edge).
1263         https://bugs.webkit.org/show_bug.cgi?id=154699
1264
1265         Reviewed by Anders Carlsson.
1266
1267         RefCounter currently only triggers a callback when the count goes from zero
1268         to non-zero and vice-versa. Change that, to be useful to more clients.
1269
1270         * page/PageThrottler.cpp:
1271         (WebCore::PageThrottler::PageThrottler):
1272             - Updated for change in RefCounter callback siganture.
1273         * platform/VNodeTracker.cpp:
1274         (WebCore::VNodeTracker::VNodeTracker):
1275             - Can now use RefCounter callback to trigger checkPressureState().
1276         (WebCore::VNodeTracker::pressureWarningTimerFired):
1277             - RefCounter count is now a size_t (%d -> %ul).
1278         * platform/VNodeTracker.h:
1279             - simplified VNodeTracker::token() [no longer needs to call checkPressureState()].
1280
1281 2016-02-26  Andreas Kling  <akling@apple.com>
1282
1283         Remove unused CFNetwork disk cache mmap optimization in WebKit2.
1284         <https://webkit.org/b/154727>
1285
1286         Reviewed by Darin Adler.
1287
1288         Remove some now-unused SPI.
1289
1290         * platform/spi/cf/CFNetworkSPI.h:
1291
1292 2016-02-26  Commit Queue  <commit-queue@webkit.org>
1293
1294         Unreviewed, rolling out r197167.
1295         https://bugs.webkit.org/show_bug.cgi?id=154730
1296
1297         This change broke the Mac build (Requested by ryanhaddad on
1298         #webkit).
1299
1300         Reverted changeset:
1301
1302         "REGRESSION (188611): Search field Cancel button should not
1303         overlap search text on extensions page."
1304         https://bugs.webkit.org/show_bug.cgi?id=154692
1305         http://trac.webkit.org/changeset/197167
1306
1307 2016-02-26  Martin Robinson  <mrobinson@igalia.com>
1308
1309         Remove libqcms support
1310         https://bugs.webkit.org/show_bug.cgi?id=154707
1311
1312         Reviewed by Žan Doberšek.
1313
1314         No new tests. This change simply removes dead code.
1315
1316         * platform/image-decoders/ImageDecoder.h: Remove QCMS support.
1317         (WebCore::ImageDecoder::qcmsOutputDeviceProfile): Deleted.
1318         * platform/image-decoders/jpeg/JPEGImageDecoder.cpp: Remove QCMS support.
1319         (WebCore::JPEGImageReader::JPEGImageReader): Deleted.
1320         (WebCore::JPEGImageReader::close): Deleted.
1321         (WebCore::JPEGImageReader::decode): Deleted.
1322         (WebCore::JPEGImageReader::colorTransform): Deleted.
1323         (WebCore::JPEGImageReader::createColorTransform): Deleted.
1324         (WebCore::JPEGImageDecoder::outputScanlines): Deleted.
1325         * platform/image-decoders/png/PNGImageDecoder.cpp: Remove QCMS support.
1326         (WebCore::PNGImageReader::PNGImageReader): Deleted.
1327         (WebCore::PNGImageReader::close): Deleted.
1328         (WebCore::PNGImageReader::rowBuffer): Deleted.
1329         (WebCore::PNGImageReader::createRowBuffer): Deleted.
1330         (WebCore::PNGImageReader::colorTransform): Deleted.
1331         (WebCore::PNGImageReader::createColorTransform): Deleted.
1332         (WebCore::PNGImageDecoder::headerAvailable): Deleted.
1333         (WebCore::PNGImageDecoder::rowAvailable): Deleted.
1334         (WebCore::PNGImageDecoder::frameComplete): Deleted.
1335         * platform/image-decoders/webp/WEBPImageDecoder.cpp: Remove QCMS support.
1336         (WebCore::WEBPImageDecoder::decode): Remove QCMS support.
1337         (WebCore::WEBPImageDecoder::WEBPImageDecoder): Deleted.
1338         (WebCore::WEBPImageDecoder::clear): Deleted.
1339         (WebCore::WEBPImageDecoder::createColorTransform): Deleted.
1340         (WebCore::WEBPImageDecoder::readColorProfile): Deleted.
1341         (WebCore::WEBPImageDecoder::applyColorProfile): Deleted.
1342         * platform/image-decoders/webp/WEBPImageDecoder.h: Remove QCMS support.
1343         (WebCore::WEBPImageDecoder::colorTransform): Deleted.
1344
1345 2016-02-26  Zalan Bujtas  <zalan@apple.com>
1346
1347         RenderTheme::controlSize* methods should take const RenderStyle&.
1348         https://bugs.webkit.org/show_bug.cgi?id=154708
1349
1350         Reviewed by Darin Adler.
1351
1352         No change in functionality.
1353
1354         * rendering/RenderTheme.h:
1355         (WebCore::RenderTheme::minimumMenuListSize):
1356         (WebCore::RenderTheme::popupInternalPaddingLeft):
1357         (WebCore::RenderTheme::popupInternalPaddingRight):
1358         (WebCore::RenderTheme::popupInternalPaddingTop):
1359         (WebCore::RenderTheme::popupInternalPaddingBottom):
1360         * rendering/RenderThemeMac.h:
1361         * rendering/RenderThemeMac.mm:
1362         (WebCore::RenderThemeMac::controlSizeForFont):
1363         (WebCore::RenderThemeMac::sizeForFont):
1364         (WebCore::RenderThemeMac::sizeForSystemFont):
1365         (WebCore::RenderThemeMac::controlSizeForSystemFont):
1366         (WebCore::RenderThemeMac::minimumProgressBarHeight):
1367         (WebCore::RenderThemeMac::popupInternalPaddingLeft):
1368         (WebCore::RenderThemeMac::popupInternalPaddingRight):
1369         (WebCore::RenderThemeMac::popupInternalPaddingTop):
1370         (WebCore::RenderThemeMac::popupInternalPaddingBottom):
1371         (WebCore::RenderThemeMac::minimumMenuListSize):
1372
1373 2016-02-26  Zalan Bujtas  <zalan@apple.com>
1374
1375         REGRESSION (188611): Search field Cancel button should not overlap search text on extensions page.
1376         https://bugs.webkit.org/show_bug.cgi?id=154692
1377         <rdar://problem/22840453>
1378
1379         Reviewed by Brent Fulgham.
1380
1381         Adjust the cancel button position using the actual size of the cancel button.
1382
1383         When the input box and the font height trigger different cancel button sizes, we need to readjust
1384         the rectangle returned by cancelButtonRectForBounds.
1385         This fixes both the mispositioned cancel button and the squared off icon when the input field is zoomed all the way in.
1386
1387         Covered by existing tests.
1388
1389         * rendering/RenderThemeMac.mm:
1390         (WebCore::RenderThemeMac::paintSearchFieldCancelButton):
1391         (WebCore::RenderThemeMac::cancelButtonSizes): Update button size.
1392
1393 2016-02-25  Antti Koivisto  <antti@apple.com>
1394
1395         Implement ::slotted pseudo element
1396         https://bugs.webkit.org/show_bug.cgi?id=149441
1397         <rdar://problem/22731987>
1398
1399         Reviewed by Andreas Kling.
1400
1401         Based on latest in https://github.com/w3c/webcomponents/issues/331
1402
1403         * css/CSSGrammar.y.in:
1404
1405             Parse ::slotted.
1406
1407         * css/CSSParser.cpp:
1408         (WebCore::CSSParser::detectFunctionTypeToken):
1409         * css/CSSParserValues.cpp:
1410         (WebCore::CSSParserSelector::parsePseudoElementCueFunctionSelector):
1411         (WebCore::CSSParserSelector::parsePseudoElementSlottedFunctionSelector):
1412
1413             Tokenize ::slotted.
1414
1415         (WebCore::CSSParserSelector::parsePseudoClassAndCompatibilityElementSelector):
1416         * css/CSSParserValues.h:
1417         * css/CSSSelector.cpp:
1418         (WebCore::CSSSelector::pseudoId):
1419         * css/CSSSelector.h:
1420         * css/ElementRuleCollector.cpp:
1421         (WebCore::ElementRuleCollector::matchAuthorRules):
1422         (WebCore::ElementRuleCollector::matchHostPseudoClassRules):
1423         (WebCore::ElementRuleCollector::matchSlottedPseudoElementRules):
1424
1425             Match ::slotted selector.
1426
1427         (WebCore::ElementRuleCollector::collectSlottedPseudoElementRulesForSlot):
1428
1429             Collect ::slotted rules that may apply to an element in a slot.
1430
1431         (WebCore::ElementRuleCollector::matchUserRules):
1432         (WebCore::ElementRuleCollector::matchUARules):
1433         (WebCore::findSlottedPseudoElementSelector):
1434         (WebCore::ElementRuleCollector::ruleMatches):
1435         * css/ElementRuleCollector.h:
1436         * css/RuleSet.cpp:
1437         (WebCore::RuleSet::addRule):
1438
1439             Collect ::slotted rules.
1440
1441         (WebCore::RuleSet::shrinkToFit):
1442         * css/RuleSet.h:
1443         (WebCore::RuleSet::hostPseudoClassRules):
1444         (WebCore::RuleSet::slottedPseudoElementRules):
1445         (WebCore::RuleSet::focusPseudoClassRules):
1446         (WebCore::RuleSet::universalRules):
1447         * css/SelectorChecker.cpp:
1448         (WebCore::SelectorChecker::checkOne):
1449         * style/StyleSharingResolver.cpp:
1450         (WebCore::Style::SharingResolver::resolve):
1451
1452             Disable style sharing for children of shadow host. They may be affected by the shadow tree style
1453             which is not considered in style sharing checks.
1454
1455 2016-02-25  Myles C. Maxfield  <mmaxfield@apple.com>
1456
1457         Font size computed style is innaccurate
1458         https://bugs.webkit.org/show_bug.cgi?id=154705
1459         <rdar://problem/23474068>
1460
1461         Reviewed by Timothy Hatcher.
1462
1463         Safari rounds the font size value reported to getComputedStyle(). Neither Firefox
1464         nor Chrome do this.
1465
1466         Covered by existing tests.
1467
1468         * css/CSSComputedStyleDeclaration.cpp:
1469         (WebCore::ComputedStyleExtractor::getFontSizeCSSValuePreferringKeyword):
1470         (WebCore::fontSizeFromStyle):
1471
1472 2016-02-25  Chris Dumez  <cdumez@apple.com>
1473
1474         [Web IDL] Mark DOMString parameters as nullable when they should be
1475         https://bugs.webkit.org/show_bug.cgi?id=154666
1476
1477         Reviewed by Darin Adler.
1478
1479         Mark DOMString parameters as nullable when they should be. We previously
1480         emulated nullable DOMString attributes by using:
1481         [TreatNullAs=NullString, TreatUndefinedAs=NullString]
1482         However, this was non-standard and very verbose. Also, developers would
1483         sometimes forget the [TreatUndefinedAs=NullString] part and the behavior
1484         would end up being wrong for undefined.
1485
1486         After this clean up, the non-standard [TreatUndefinedAs=NullString] is
1487         no longer used so this patch drops support for it. Only
1488         [TreatNullAs=NullString] remains and this one will be renamed to
1489         [TreatNullAs=EmptyString] via Bug 154654 to match Web IDL standard.
1490
1491         Tests: fast/dom/Element/getElementsByTagNameNS-nullable.html
1492                fast/dom/Node/nullable-parameters.html
1493                fast/events/storageevent-initStorageEvent-nullable.html
1494
1495         * Modules/mediastream/RTCPeerConnection.idl:
1496         Drop [TreatUndefinedAs=NullString] from createDataChannel()'s first
1497         parameter instead of marking it as nullable. This matches the
1498         specification:
1499         - http://w3c.github.io/webrtc-pc/#rtcpeerconnection-interface-extensions-1
1500         This means there is a slight behavior change when undefined is passed, it
1501         now becomes the string "undefined" instead of a null String.
1502
1503         * bindings/scripts/CodeGeneratorJS.pm:
1504         (JSValueToNative):
1505         Drop handling of [TreatUndefinedAs=] as it is no longer used.
1506
1507         * bindings/scripts/IDLAttributes.txt:
1508         Drop support for [TreatUndefinedAs=] as it is no longer used.
1509
1510         * bindings/scripts/test/TestObj.idl:
1511
1512         * dom/DOMImplementation.idl:
1513         Make a few parameters nullable and drop [TreatNullAs=NullString,
1514         TreatUndefinedAs=NullString]. There is no web-exposed behavior
1515         change.
1516
1517         * dom/Document.idl:
1518         - Make a few parameters nullable and drop [TreatNullAs=NullString,
1519           TreatUndefinedAs=NullString]. There is no web-exposed behavior
1520           change from this.
1521         - Drop these attributes from ObjC-specific bindings as they only
1522           matter to JS bindings.
1523         - The namespaceURI parameter to getElementsByTagNameNS() is now marked
1524           as nullable even though it only treated null as a null String, not
1525           undefined. This was a bug and did not match the specification:
1526           https://dom.spec.whatwg.org/#document
1527
1528         * dom/Element.idl:
1529         - Make a few parameters nullable and drop [TreatNullAs=NullString,
1530           TreatUndefinedAs=NullString]. There is no web-exposed behavior
1531           change from this.
1532         - Drop these attributes from ObjC-specific bindings as they only
1533           matter to JS bindings.
1534         - The namespaceURI parameter to getElementsByTagNameNS() is now marked
1535           as nullable even though it only treated null as a null String, not
1536           undefined. This was a bug and did not match the specification:
1537           https://dom.spec.whatwg.org/#interface-element
1538
1539         * dom/NamedNodeMap.idl:
1540         Make a few parameters nullable and drop [TreatNullAs=NullString,
1541         TreatUndefinedAs=NullString]. There is no web-exposed behavior
1542         change from this.
1543
1544         * dom/Node.idl:
1545         - Drop these attributes from isSupported() as this is not exposed
1546           to JS (only native bindings) and these attributes only matter to
1547           JS bindings.
1548         - Make the first parameter to lookupPrefix() / isDefaultNamespace()
1549           and lookupNamespaceURI() nullable. Previously, we treated null
1550           as a null string but not undefined. There is therefore a slight
1551           behavior change but this matches the specification:
1552           https://dom.spec.whatwg.org/#node
1553
1554         * fileapi/Blob.idl:
1555         * html/HTMLButtonElement.idl:
1556         * html/HTMLCanvasElement.idl:
1557         * html/HTMLFieldSetElement.idl:
1558         * html/HTMLInputElement.idl:
1559         * html/HTMLKeygenElement.idl:
1560         * html/HTMLMediaElement.idl:
1561         * html/HTMLObjectElement.idl:
1562         * html/HTMLOutputElement.idl:
1563         * html/HTMLSelectElement.idl:
1564         * html/HTMLTextAreaElement.idl:
1565         * page/DOMWindow.idl:
1566         Make a few parameters nullable and drop [TreatNullAs=NullString,
1567         TreatUndefinedAs=NullString]. There is no web-exposed behavior
1568         change from this.
1569
1570         * storage/StorageEvent.idl:
1571         Mark oldValueArg / newValueArg parameters to initStorageEvent()
1572         as nullable. Previously, we only treated null as a null string,
1573         not undefined. This is therefore a slight behavior change but
1574         it matches the specification:
1575         https://www.w3.org/TR/webstorage/#storageeventinit
1576
1577 2016-02-25  David Kilzer  <ddkilzer@apple.com>
1578
1579         REGRESSION (r196744): NetworkExtension.framework and NEFilterSource class are not available on Recovery partition
1580         <http://webkit.org/b/154703>
1581
1582         Reviewed by Andy Estes.
1583
1584         * platform/cocoa/NetworkExtensionContentFilter.mm: Make
1585         soft-linking of NetworkExtension.framework and NEFilterSource
1586         class optional since they are not available on the Recovery
1587         partition.  Note that NetworkExtensionContentFilter::enabled()
1588         does not need to change since it already had the correct
1589         behavior when getNEFilterSourceClass() returned nullptr.
1590
1591 2016-02-25  Ada Chan  <adachan@apple.com>
1592
1593         Update the definition of ENABLE_VIDEO_PRESENTATION_MODE for Mac platform
1594         https://bugs.webkit.org/show_bug.cgi?id=154702
1595
1596         Reviewed by Dan Bernstein.
1597
1598         * Configurations/FeatureDefines.xcconfig:
1599
1600 2016-02-25  David Kilzer  <ddkilzer@apple.com>
1601
1602         Change ASSERT to RELEASE_ASSERT in SOFT_LINK_CLASS() macro
1603
1604         Follow-up fix noted by Andy Estes for:
1605
1606             [Cocoa] Always check the return value of dlopen() and dlsym() in Release builds
1607             <http://webkit.org/b/154364>
1608
1609         * platform/mac/SoftLinking.h:
1610         (SOFT_LINK_CLASS): Change ASSERT to RELEASE_ASSERT to check the
1611         return value of objc_getClass().  This matches what we do for
1612         SOFT_LINK_CLASS_FOR_SOURCE().
1613
1614 2016-02-25  Daniel Bates  <dabates@apple.com>
1615
1616         CSP: Remove SecurityPolicy script interface
1617         https://bugs.webkit.org/show_bug.cgi?id=154694
1618         <rdar://problem/24846482>
1619
1620         Reviewed by Andy Estes.
1621
1622         Remove the Content Security Policy script interface, SecurityPolicy. This interface was only
1623         enabled when building with ENABLE(CSP_NEXT) (disabled by default).
1624
1625         For completeness, the SecurityPolicy interface was removed from the Content Security Policy 1.1 spec.
1626         in <https://github.com/w3c/webappsec/commit/18882953ce2d8afca25f685557fef0e0471b2c9a> (12/26/2013).
1627
1628         * CMakeLists.txt: Remove files to DOMSecurityPolicy.{cpp, idl}.
1629         * DerivedSources.cpp: Remove file JSDOMSecurityPolicy.cpp.
1630         * DerivedSources.make: Remove file DOMSecurityPolicy.idl.
1631         * PlatformGTK.cmake: Ditto.
1632         * PlatformMac.cmake: Ditto.
1633         * WebCore.xcodeproj/project.pbxproj: Remove files DOMSecurityPolicy files.
1634         * bindings/scripts/CodeGeneratorGObject.pm: Remove reference to DOMSecurityPolicy.
1635         * dom/Document.cpp:
1636         (WebCore::Document::securityPolicy): Deleted.
1637         * dom/Document.h:
1638         * dom/Document.idl: Remove attribute securityPolicy.
1639         * page/DOMSecurityPolicy.cpp: Removed.
1640         * page/DOMSecurityPolicy.h: Removed.
1641         * page/DOMSecurityPolicy.idl: Removed.
1642
1643 2016-02-25  Andreas Kling  <akling@apple.com>
1644
1645         Don't clear the weak JSString cache on memory pressure.
1646         <https://webkit.org/b/154693>
1647
1648         Reviewed by Antti Koivisto.
1649
1650         This was stupid. The cache is a WeakGCMap, so all the JSStrings pointed to are
1651         still alive anyway. This way we keep the ability to deduplicate common strings.
1652
1653         * platform/MemoryPressureHandler.cpp:
1654         (WebCore::MemoryPressureHandler::releaseNoncriticalMemory): Deleted.
1655
1656 2016-02-25  Chris Dumez  <cdumez@apple.com>
1657
1658         Drop [TreatReturnedNullStringAs=Undefined] WebKit-specific IDL attribute
1659         https://bugs.webkit.org/show_bug.cgi?id=154662
1660
1661         Reviewed by Darin Adler.
1662
1663         Drop [TreatReturnedNullStringAs=Undefined] WebKit-specific IDL attribute.
1664         This has no standard equivalent and all uses in WebKit are either useless
1665         or wrong.
1666
1667         Test: fast/frames/detached-frame-document-defaultCharset.html
1668
1669         * bindings/scripts/CodeGeneratorJS.pm:
1670         (NativeToJSValue): Deleted.
1671         * bindings/scripts/IDLAttributes.txt:
1672         Drop support for [TreatReturnedNullStringAs=X] entirely.
1673
1674         * dom/Document.cpp:
1675         (WebCore::Document::defaultCharset):
1676         Fall back to return "UTF-8" instead of the null string, similarly to
1677         what is done in for Document.characterSet. Note that this attribute
1678         is non-standard and is an IE extension. Firefox never supported it
1679         and Chrome dropped it last year.
1680
1681         * dom/Document.idl:
1682         - Drop extended attribute for Document.defaultCharset as the
1683           implementation has been updated to never return a null String.
1684         - Drop extended attribute for Document.readyState. It was useless
1685           because the implementation could never return a null String.
1686
1687         * xml/XMLHttpRequest.cpp:
1688         (WebCore::XMLHttpRequest::getAllResponseHeaders):
1689         Update implementation to return emptyString() instead of "" in case
1690         of error.
1691
1692         * xml/XMLHttpRequest.idl:
1693         Drop extended attribute from XMLHttpRequest.getAllResponseHeaders().
1694         It was useless because the implementation could never return a
1695         null String.
1696
1697         * xml/XSLTProcessor.idl:
1698         Drop extended attribute from XSLTProcessor.getParameter(). The
1699         operation is already marked as [Custom] so the extended attribute
1700         had no effect.
1701
1702 2016-02-25  Gavin Barraclough  <barraclough@apple.com>
1703
1704         Should template RefCounter instead of RefCounter::Token
1705         https://bugs.webkit.org/show_bug.cgi?id=154691
1706
1707         Reviewed by Anders Carlsson.
1708
1709         Mechanical update per RefCounter interface change.
1710
1711         * page/PageThrottler.cpp:
1712         (WebCore::PageThrottler::mediaActivityToken):
1713         (WebCore::PageThrottler::pageLoadActivityToken):
1714         (WebCore::PageThrottler::setActivityFlag):
1715         * page/PageThrottler.h:
1716         * platform/VNodeTracker.h:
1717
1718 2016-02-25  Brady Eidson  <beidson@apple.com>
1719
1720         Remove LegacyIDB.
1721         https://bugs.webkit.org/show_bug.cgi?id=150854
1722
1723         Reviewed by Alex Christensen.
1724
1725         No new tests (No change in behavior).
1726
1727         * CMakeLists.txt:
1728         * Modules/indexeddb/DOMWindowIndexedDatabase.cpp:
1729         (WebCore::DOMWindowIndexedDatabase::indexedDB):
1730         * Modules/indexeddb/IDBDatabaseMetadata.cpp: Removed.
1731         * Modules/indexeddb/IDBDatabaseMetadata.h: Removed.
1732         * Modules/indexeddb/IDBFactory.h:
1733         * Modules/indexeddb/IDBIndex.h:
1734         * Modules/indexeddb/IDBIndexMetadata.h: Removed.
1735         * Modules/indexeddb/IDBObjectStoreMetadata.h: Removed.
1736         * Modules/indexeddb/IDBOperation.h: Removed.
1737         * Modules/indexeddb/IDBServerConnection.h: Removed.
1738         * Modules/indexeddb/IDBTransaction.h:
1739         * Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.cpp:
1740         (WebCore::WorkerGlobalScopeIndexedDatabase::indexedDB):
1741         * Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.h:
1742         * Modules/indexeddb/legacy/IDBCallbacks.h: Removed.
1743         * Modules/indexeddb/legacy/IDBCursorBackend.cpp: Removed.
1744         * Modules/indexeddb/legacy/IDBCursorBackend.h: Removed.
1745         * Modules/indexeddb/legacy/IDBCursorBackendOperations.cpp: Removed.
1746         * Modules/indexeddb/legacy/IDBCursorBackendOperations.h: Removed.
1747         * Modules/indexeddb/legacy/IDBDatabaseBackend.cpp: Removed.
1748         * Modules/indexeddb/legacy/IDBDatabaseBackend.h: Removed.
1749         * Modules/indexeddb/legacy/IDBDatabaseCallbacks.h: Removed.
1750         * Modules/indexeddb/legacy/IDBDatabaseCallbacksImpl.cpp: Removed.
1751         * Modules/indexeddb/legacy/IDBDatabaseCallbacksImpl.h: Removed.
1752         * Modules/indexeddb/legacy/IDBFactoryBackendInterface.h: Removed.
1753         * Modules/indexeddb/legacy/IDBPendingDeleteCall.h: Removed.
1754         * Modules/indexeddb/legacy/IDBPendingOpenCall.h: Removed.
1755         * Modules/indexeddb/legacy/IDBPendingTransactionMonitor.cpp: Removed.
1756         * Modules/indexeddb/legacy/IDBPendingTransactionMonitor.h: Removed.
1757         * Modules/indexeddb/legacy/IDBTransactionBackend.cpp: Removed.
1758         * Modules/indexeddb/legacy/IDBTransactionBackend.h: Removed.
1759         * Modules/indexeddb/legacy/IDBTransactionBackendOperations.cpp: Removed.
1760         * Modules/indexeddb/legacy/IDBTransactionBackendOperations.h: Removed.
1761         * Modules/indexeddb/legacy/IDBTransactionCoordinator.cpp: Removed.
1762         * Modules/indexeddb/legacy/IDBTransactionCoordinator.h: Removed.
1763         * Modules/indexeddb/legacy/LegacyAny.cpp: Removed.
1764         * Modules/indexeddb/legacy/LegacyAny.h: Removed.
1765         * Modules/indexeddb/legacy/LegacyCursor.cpp: Removed.
1766         * Modules/indexeddb/legacy/LegacyCursor.h: Removed.
1767         * Modules/indexeddb/legacy/LegacyCursorWithValue.cpp: Removed.
1768         * Modules/indexeddb/legacy/LegacyCursorWithValue.h: Removed.
1769         * Modules/indexeddb/legacy/LegacyDatabase.cpp: Removed.
1770         * Modules/indexeddb/legacy/LegacyDatabase.h: Removed.
1771         * Modules/indexeddb/legacy/LegacyFactory.cpp: Removed.
1772         * Modules/indexeddb/legacy/LegacyFactory.h: Removed.
1773         * Modules/indexeddb/legacy/LegacyIndex.cpp: Removed.
1774         * Modules/indexeddb/legacy/LegacyIndex.h: Removed.
1775         * Modules/indexeddb/legacy/LegacyObjectStore.cpp: Removed.
1776         * Modules/indexeddb/legacy/LegacyObjectStore.h: Removed.
1777         * Modules/indexeddb/legacy/LegacyOpenDBRequest.cpp: Removed.
1778         * Modules/indexeddb/legacy/LegacyOpenDBRequest.h: Removed.
1779         * Modules/indexeddb/legacy/LegacyRequest.cpp: Removed.
1780         * Modules/indexeddb/legacy/LegacyRequest.h: Removed.
1781         * Modules/indexeddb/legacy/LegacyTransaction.cpp: Removed.
1782         * Modules/indexeddb/legacy/LegacyTransaction.h: Removed.
1783         * Modules/indexeddb/legacy/LegacyVersionChangeEvent.cpp: Removed.
1784         * Modules/indexeddb/legacy/LegacyVersionChangeEvent.h: Removed.
1785         * Modules/indexeddb/server/SQLiteIDBCursor.cpp:
1786         (WebCore::IDBServer::SQLiteIDBCursor::SQLiteIDBCursor):
1787         (WebCore::IDBServer::SQLiteIDBCursor::establishStatement):
1788         (WebCore::IDBServer::SQLiteIDBCursor::internalAdvanceOnce):
1789         * Modules/indexeddb/server/SQLiteIDBCursor.h:
1790         * Modules/indexeddb/shared/IDBIndexInfo.h:
1791         * WebCore.xcodeproj/project.pbxproj:
1792         * bindings/js/IDBBindingUtilities.cpp:
1793         (WebCore::generateIndexKeysForValue): Deleted.
1794         * bindings/js/IDBBindingUtilities.h:
1795         * bindings/js/JSMainThreadExecState.cpp:
1796         (WebCore::JSMainThreadExecState::didLeaveScriptContext): Deleted.
1797         * inspector/InspectorIndexedDBAgent.cpp:
1798         * loader/EmptyClients.cpp:
1799         * page/DatabaseProvider.cpp:
1800         (WebCore::DatabaseProvider::idbFactoryBackend): Deleted.
1801         * page/DatabaseProvider.h:
1802         * platform/CrossThreadCopier.cpp:
1803         (WebCore::IDBDatabaseMetadata>::copy): Deleted.
1804         (WebCore::IDBIndexMetadata>::copy): Deleted.
1805         (WebCore::IDBObjectStoreMetadata>::copy): Deleted.
1806         * platform/CrossThreadCopier.h:
1807
1808 2016-02-25  Said Abou-Hallawa  <sabouhallawa@apple.com>
1809
1810         REGRESSION (r196268): Many assertion failures and crashes on SVG path animation tests when JS garbage collection happens quickly
1811         https://bugs.webkit.org/show_bug.cgi?id=154331
1812
1813         Reviewed by Darin Adler.
1814
1815         This is not an actual regression. The bug did exist before r196268 but
1816         the whole document was leaking once an SVGAnimatedProperty was created
1817         so there was no way to produce this bug. After fixing the leak, one crash
1818         and one assert got uncovered. Both of them happen because of the fact:
1819         "if an SVGAnimatedProperty is not referenced it will be deleted."
1820
1821         * svg/SVGPathElement.cpp:
1822         (WebCore::SVGPathElement::lookupOrCreateDWrapper):
1823         The code in this function was assuming that the wrapper will be created
1824         only once which happens when SVGAnimatedProperty::lookupOrCreateWrapper()
1825         is called. Before making this single call, lookupOrCreateDWrapper() was
1826         building an initial SVGPathSegList from byte stream. But now
1827         SVGAnimatedProperty::lookupWrapper() can return false even after creating
1828         the SVGAnimatedProperty because it was deleted later. Calling
1829         buildSVGPathSegListFromByteStream() more than once was causing
1830         SVGAnimatedListPropertyTearOff::animationStarted() to fire the assertion
1831         ASSERT(m_values.size() == m_wrappers.size()) because the path segments were
1832         appended twice to m_values which is in fact SVGPathElement::m_pathSegList.value.
1833         The fix is to build the initial SVGPathSegList only once which should happen
1834         when m_pathSegList.value.isEmpty().
1835         
1836         (WebCore::SVGPathElement::animatedPropertyWillBeDeleted):
1837         * svg/SVGPathElement.h:
1838         * svg/properties/SVGAnimatedPathSegListPropertyTearOff.h:
1839         (WebCore::SVGAnimatedPathSegListPropertyTearOff::~SVGAnimatedPathSegListPropertyTearOff):
1840         SVGPathElement is assuming the following equivalence relation:
1841         m_pathSegList.shouldSynchronize ~ SVGAnimatedProperty_is_created_and_not_null.
1842         SVGPathElement::animatedPathSegList() and animatedNormalizedPathSegList()
1843         set m_pathSegList.shouldSynchronize to true when SVGAnimatedProperty is
1844         created but nothing sets m_pathSegList.shouldSynchronize back to false.
1845         This was not a problem when the SVGAnimatedProperty was leaking but after
1846         ensuring it is deleted when it is not referenced this equivalence relation
1847         becomes untrue sometimes. This caused SVGPathElement::svgAttributeChanged()
1848         to crash when we check m_pathSegList.shouldSynchronize and if it is true we
1849         assume that SVGAnimatedProperty::lookupWrapper() will return a non-null pointer
1850         and therefore we deference this pointer and call SVGAnimatedProperty::isAnimating().
1851         To fix this crash we need to set m_pathSegList.shouldSynchronize back to false
1852         when the associated SVGAnimatedProperty is deleted.
1853
1854 2016-02-25  Brady Eidson  <beidson@apple.com>
1855
1856         Modern IDB: WebKit 2 IPC layer.
1857         https://bugs.webkit.org/show_bug.cgi?id=153808
1858
1859         Reviewed by Alex Christensen.
1860
1861         No new tests (Covered by over 1,000 existing tests).
1862
1863         * Modules/indexeddb/IDBKeyData.h:
1864         (WebCore::IDBKeyData::encode): It's okay to encode Min and Max.
1865         (WebCore::IDBKeyData::decode): It's okay to decode Min and Max.
1866
1867 2016-02-25  Daniel Bates  <dabates@apple.com>
1868
1869         CSP: Make SecurityPolicyViolationEvent more closely conform to CSP spec and enable it by default
1870         https://bugs.webkit.org/show_bug.cgi?id=154522
1871         <rdar://problem/24762078>
1872
1873         Reviewed by Brent Fulgham.
1874
1875         Include attributes statusCode and columnNumber in a dispatched SecurityPolicyViolationEvent and
1876         as part of the SecurityPolicyViolationEventInit dictionary as per section Violation DOM Events
1877         of the Content Security Policy Level 3 spec., <https://w3c.github.io/webappsec-csp/> (24 February 2016).
1878         Additionally, enable dispatching of this event when a Content Security Policy violation occurs regardless
1879         of whether ENABLE(CSP_NEXT) is enabled.
1880
1881         Test: http/tests/security/contentSecurityPolicy/1.1/securitypolicyviolation-block-image-https.html
1882
1883         * WebCore.xcodeproj/project.pbxproj: Add files JSSecurityPolicyViolationEvent.{cpp, h}.
1884         * dom/EventNames.in: Enable support for SecurityPolicyViolationEvent unconditionally.
1885         * dom/SecurityPolicyViolationEvent.h: Remove ENABLE(CSP_NEXT)-guard so that we compile this
1886         code unconditionally. Modified SecurityPolicyViolationEventInit and SecurityPolicyViolationEvent
1887         to support attributes statusCode and columnNumebr.
1888         * dom/SecurityPolicyViolationEvent.idl: Add attributes statusCode and columnNumber.
1889         * page/csp/ContentSecurityPolicy.cpp:
1890         (WebCore::ContentSecurityPolicy::reportViolation): Modified to both dispatch a SecurityPolicyViolationEvent
1891         and send a violation report (if applicable).
1892
1893 2016-02-25  Eric Carlson  <eric.carlson@apple.com>
1894
1895         [MediaStream] MediaDeviceInfo deviceId and groupId must be unique to the page's origin
1896         https://bugs.webkit.org/show_bug.cgi?id=153163
1897         <rdar://problem/24334526>
1898
1899         Reviewed by Tim Horton.
1900
1901         Tests: http/tests/media/media-stream/enumerate-devices-source-id-persistent.html
1902                http/tests/media/media-stream/enumerate-devices-source-id.html
1903
1904         * Modules/mediastream/MediaDevicesRequest.cpp:
1905         (WebCore::MediaDevicesRequest::start): Don't check document.hasHadActiveMediaStreamTrack, do it
1906           in didCompleteTrackSourceInfoRequest where we need the information.
1907         (WebCore::MediaDevicesRequest::didCompletePermissionCheck): Renamed from didCompleteCheck, save
1908           device ID hash string.
1909         (WebCore::hashString): Hash a string with SHA1.
1910         (WebCore::MediaDevicesRequest::hashID): Hash and ID.
1911         (WebCore::MediaDevicesRequest::didCompleteTrackSourceInfoRequest): Hash deviceId and groupId.
1912         (WebCore::MediaDevicesRequest::didCompleteCheck): Deleted.
1913         (WebCore::MediaDevicesRequest::getTrackSources): Deleted.
1914         (WebCore::MediaDevicesRequest::didCompleteRequest): Deleted.
1915         * Modules/mediastream/MediaDevicesRequest.h:
1916
1917         * Modules/mediastream/UserMediaPermissionCheck.cpp:
1918         (WebCore::UserMediaPermissionCheck::userMediaDocumentOrigin): Renamed from securityOrigin.
1919         (WebCore::UserMediaPermissionCheck::topLevelDocumentOrigin): New, return the top level document origin.
1920         (WebCore::UserMediaPermissionCheck::setUserMediaAccessInfo): Renamed from setHasPersistentPermission.
1921         (WebCore::UserMediaPermissionCheck::securityOrigin): Deleted.
1922         (WebCore::UserMediaPermissionCheck::setHasPersistentPermission): Deleted.
1923         * Modules/mediastream/UserMediaPermissionCheck.h:
1924
1925         * Modules/mediastream/UserMediaRequest.cpp:
1926         (WebCore::UserMediaRequest::userMediaDocumentOrigin): Renamed from securityOrigin.
1927         (WebCore::UserMediaRequest::topLevelDocumentOrigin): New, return the top level document origin.
1928         (WebCore::UserMediaRequest::securityOrigin): Deleted.
1929         * Modules/mediastream/UserMediaRequest.h:
1930         (WebCore::UserMediaRequest::requiresAudio): Deleted, unused.
1931         (WebCore::UserMediaRequest::requiresVideo): Ditto.
1932
1933         * html/HTMLMediaElement.cpp:
1934         (WebCore::HTMLMediaElement::mediaPlayerMediaDeviceIdentifierStorageDirectory): Deleted, unused.
1935         * html/HTMLMediaElement.h:
1936
1937         * platform/graphics/MediaPlayer.h:
1938         (WebCore::MediaPlayerClient::mediaPlayerMediaDeviceIdentifierStorageDirectory): Deleted.
1939
1940         * platform/mediastream/MediaStreamTrackSourcesRequestClient.h:
1941         (WebCore::MediaStreamTrackSourcesRequestClient::didCompleteTrackSourceInfoRequest): Renamed from didCompleteRequest.
1942
1943         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
1944         (WebCore::RealtimeMediaSourceCenterMac::getMediaStreamTrackSources): Ditto.
1945
1946         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
1947         (WebCore::MockRealtimeMediaSourceCenter::getMediaStreamTrackSources): Ditto.
1948
1949 2016-02-24  Carlos Garcia Campos  <cgarcia@igalia.com>
1950
1951         [GTK] Tearing when entering AC mode
1952         https://bugs.webkit.org/show_bug.cgi?id=150955
1953
1954         Reviewed by Michael Catanzaro.
1955
1956         * platform/gtk/GtkUtilities.cpp:
1957         (WebCore::widgetIsOnscreenToplevelWindow): Allow passing nullptr.
1958
1959 2016-02-24  Chris Dumez  <cdumez@apple.com>
1960
1961         Drop [TreatReturnedNullStringAs=Null] WebKit-specific IDL attribute
1962         https://bugs.webkit.org/show_bug.cgi?id=154659
1963
1964         Reviewed by Sam Weinig.
1965
1966         Drop [TreatReturnedNullStringAs=Null] WebKit-specific IDL attribute and
1967         use nullable DOMString types instead:
1968         http://heycam.github.io/webidl/#idl-nullable-type
1969
1970         This is the standard way of doing things. We already had support
1971         in the bindings generator for nullable DOMString attributes so
1972         we now just leverage this support. However, our IDL parser did
1973         not correctly parse nullable DOMString return values for operations.
1974         This patch fixes this.
1975
1976         This patch also drops [TreatNullAs=NullString] and
1977         [TreatUndefinedAs=NullString] for writable DOMString attributes that
1978         are now marked as nullable because they are implied.
1979
1980         * Modules/fetch/FetchHeaders.idl:
1981         * Modules/indexeddb/IDBObjectStore.idl:
1982         * Modules/mediasource/DOMURLMediaSource.idl:
1983         * Modules/mediastream/DOMURLMediaStream.idl:
1984         * Modules/websockets/WebSocket.idl:
1985         * bindings/scripts/CodeGeneratorJS.pm:
1986         (NativeToJSValue): Deleted.
1987         * bindings/scripts/IDLAttributes.txt:
1988         * bindings/scripts/IDLParser.pm:
1989         (parseAttributeOrOperationRest):
1990         (parseOperationOrIterator):
1991         (parseSpecialOperation):
1992         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
1993         (webkit_dom_test_obj_nullable_string_method):
1994         (webkit_dom_test_obj_nullable_string_special_method):
1995         (webkit_dom_test_obj_conditional_method3): Deleted.
1996         (webkit_dom_test_obj_convert1): Deleted.
1997         * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
1998         * bindings/scripts/test/JS/JSTestObj.cpp:
1999         (WebCore::JSTestObj::getOwnPropertySlot):
2000         (WebCore::JSTestObj::getOwnPropertySlotByIndex):
2001         (WebCore::JSTestObj::getOwnPropertyNames):
2002         (WebCore::jsTestObjPrototypeFunctionNullableStringMethod):
2003         (WebCore::jsTestObjConstructorFunctionNullableStringStaticMethod):
2004         (WebCore::jsTestObjPrototypeFunctionNullableStringSpecialMethod):
2005         (WebCore::jsTestObjPrototypeFunctionMethodWithAndWithoutNullableSequence): Deleted.
2006         (WebCore::jsTestObjPrototypeFunctionMethodWithAndWithoutNullableSequence2): Deleted.
2007         * bindings/scripts/test/JS/JSTestObj.h:
2008         * bindings/scripts/test/ObjC/DOMTestObj.h:
2009         * bindings/scripts/test/ObjC/DOMTestObj.mm:
2010         (-[DOMTestObj nullableStringMethod]):
2011         (-[DOMTestObj nullableStringStaticMethod]):
2012         (-[DOMTestObj nullableStringSpecialMethod:]):
2013         (-[DOMTestObj overloadedMethod1:]): Deleted.
2014         (-[DOMTestObj getSVGDocument]): Deleted.
2015         * bindings/scripts/test/TestObj.idl:
2016         * css/CSSCharsetRule.idl:
2017         * css/CSSImportRule.idl:
2018         * css/CSSKeyframesRule.idl:
2019         * css/CSSPageRule.idl:
2020         * css/CSSRule.idl:
2021         * css/CSSStyleDeclaration.idl:
2022         * css/CSSStyleRule.idl:
2023         * css/CSSValue.idl:
2024         * css/MediaList.idl:
2025         * css/StyleSheet.idl:
2026         * dom/Attr.idl:
2027         * dom/CharacterData.idl:
2028         * dom/DOMStringList.idl:
2029         * dom/Document.idl:
2030         * dom/DocumentType.idl:
2031         * dom/Element.idl:
2032         * dom/Entity.idl:
2033         * dom/MutationRecord.idl:
2034         * dom/Node.idl:
2035         * dom/ProcessingInstruction.idl:
2036         * html/DOMSettableTokenList.idl:
2037         * html/DOMTokenList.idl:
2038         * html/DOMURL.idl:
2039         * html/canvas/WebGLDebugShaders.idl:
2040         * html/canvas/WebGLRenderingContextBase.idl:
2041         * page/DOMWindow.idl:
2042         * storage/Storage.idl:
2043         * storage/StorageEvent.idl:
2044         * xml/XMLHttpRequest.idl:
2045         * xml/XPathNSResolver.idl:
2046
2047 2016-02-24  Nikos Andronikos  <nikos.andronikos-webkit@cisra.canon.com.au>
2048
2049         [web-animations] Add AnimationTimeline, DocumentTimeline and add extensions to Document interface
2050         https://bugs.webkit.org/show_bug.cgi?id=151688
2051
2052         Reviewed by Dean Jackson.
2053
2054         - Adds DocumentTimeline interface and class implementation
2055         - Implements the DocumentAnimation extension to the Document Interface that contains a default DocumentTimeline
2056         - Add AnimationTimeline interface stub (i.e. without getAnimations and currentTime)
2057         - Adds AnimationTimeline class implementation for AnimationTimeline interface stub
2058         - Adds Javascript bindings for the above classes and interfaces
2059         - Enables the WEB_ANIMATIONS compiler switch
2060
2061         No tests yet.  Tests will be added as class functionality is added incrementally.
2062
2063         * CMakeLists.txt:
2064         * Configurations/FeatureDefines.xcconfig:
2065         * DerivedSources.make:
2066         * PlatformGTK.cmake:
2067         * WebCore.vcxproj/WebCore.vcxproj:
2068         * WebCore.vcxproj/WebCore.vcxproj.filters:
2069         * WebCore.vcxproj/WebCoreIncludeCommon.props:
2070         * WebCore.vcxproj/copyForwardingHeaders.cmd:
2071         * WebCore.xcodeproj/project.pbxproj:
2072         * animation/AnimationTimeline.cpp: Added.
2073         (WebCore::AnimationTimeline::AnimationTimeline):
2074         (WebCore::AnimationTimeline::~AnimationTimeline):
2075         (WebCore::AnimationTimeline::destroy):
2076         * animation/AnimationTimeline.h: Added.
2077         (WebCore::AnimationTimeline::deref):
2078         (WebCore::AnimationTimeline::isDocumentTimeline):
2079         (WebCore::AnimationTimeline::classType):
2080         * animation/AnimationTimeline.idl: Added.
2081         * animation/DocumentAnimation.cpp: Added.
2082         (WebCore::DocumentAnimation::DocumentAnimation):
2083         (WebCore::DocumentAnimation::~DocumentAnimation):
2084         (WebCore::DocumentAnimation::timeline):
2085         (WebCore::DocumentAnimation::supplementName):
2086         (WebCore::DocumentAnimation::from):
2087         * animation/DocumentAnimation.h: Added.
2088         * animation/DocumentAnimation.idl: Added.
2089         * animation/DocumentTimeline.cpp: Added.
2090         (WebCore::DocumentTimeline::create):
2091         (WebCore::DocumentTimeline::DocumentTimeline):
2092         (WebCore::DocumentTimeline::~DocumentTimeline):
2093         * animation/DocumentTimeline.h: Added.
2094         * animation/DocumentTimeline.idl: Added.
2095         * bindings/js/JSAnimationTimelineCustom.cpp: Added.
2096         (WebCore::toJS):
2097         * bindings/js/JSBindingsAllInOne.cpp:
2098         * bindings/scripts/CodeGeneratorGObject.pm:
2099         * dom/Document.h:
2100
2101 2016-02-24  Brady Eidson  <beidson@apple.com>
2102
2103         Modern IDB: Some w3c objectstore tests crash under GuardMalloc.
2104         https://bugs.webkit.org/show_bug.cgi?id=154460
2105
2106         Reviewed by Alex Christensen.
2107
2108         No new tests (Covered by existing tests).
2109
2110         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
2111         (WebCore::IDBServer::UniqueIDBDatabase::~UniqueIDBDatabase):
2112         (WebCore::IDBServer::UniqueIDBDatabase::performCurrentDeleteOperation):
2113         (WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore):  Don't delete the UniqueIDBDatabase yet 
2114           if there are still any connections pending close.
2115         (WebCore::IDBServer::UniqueIDBDatabase::didPerformCommitTransaction):
2116         (WebCore::IDBServer::UniqueIDBDatabase::didPerformAbortTransaction):
2117         (WebCore::IDBServer::UniqueIDBDatabase::inProgressTransactionCompleted): It's possible that with this
2118           transaction completing, and a connection finished its close process, that the UniqueIDBDatabase is
2119           now ready to be deleted.
2120
2121         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
2122         (WebCore::IDBServer::UniqueIDBDatabaseConnection::abortTransactionWithoutCallback):
2123         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.h:
2124
2125         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
2126         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::abortWithoutCallback):
2127
2128 2016-02-24  Konstantin Tokarev  <annulen@yandex.ru>
2129
2130         [cmake] Moved PRE/POST_BUILD_COMMAND to WEBKIT_FRAMEWORK.
2131         https://bugs.webkit.org/show_bug.cgi?id=154651
2132
2133         Reviewed by Alex Christensen.
2134
2135         No new tests needed.
2136
2137         * CMakeLists.txt: Moved shared code to WEBKIT_FRAMEWORK macro.
2138
2139 2016-02-24  Ryosuke Niwa  <rniwa@webkit.org>
2140
2141         Use more references in FocusNavigationScope
2142         https://bugs.webkit.org/show_bug.cgi?id=154637
2143
2144         Reviewed by Chris Dumez.
2145
2146         Use references in various functions of FocusNavigationScope as well as m_treeScope.
2147
2148         * page/FocusController.cpp:
2149         (WebCore::FocusNavigationScope::FocusNavigationScope): Takes TreeScope& instead of TreeScope*.
2150         (WebCore::FocusNavigationScope::rootNode): Returns ContainerNode& instead of ContainerNode*.
2151         (WebCore::FocusNavigationScope::owner):
2152         (WebCore::FocusNavigationScope::scopeOf): Takes Node& instead of Node*. Renamed from focusNavigationScopeOf.
2153         (WebCore::FocusNavigationScope::scopeOwnedByShadowHost): Ditto. Renamed from focusNavigationScopeOwnedByShadowHost.
2154         (WebCore::FocusNavigationScope::scopeOwnedByIFrame): Ditto. Renamed from focusNavigationScopeOwnedByIFrame.
2155         (WebCore::FocusController::findFocusableElementDescendingDownIntoFrameDocument):
2156         (WebCore::FocusController::advanceFocusInDocumentOrder):
2157         (WebCore::FocusController::findFocusableElementAcrossFocusScope): Define currentScope inside the loop now that
2158         the copy constructor of FocusNavigationScope no longer exists (since m_treeScope is a reference).
2159         (WebCore::FocusController::findFocusableElementRecursively):
2160         (WebCore::nextElementWithGreaterTabIndex):
2161         (WebCore::FocusController::nextFocusableElement):
2162         (WebCore::FocusController::previousFocusableElement):
2163
2164 2016-02-24  Adam Bergkvist  <adam.bergkvist@ericsson.com>
2165
2166         WebRTC: Add MediaEndpoint interface (WebRTC backend abstraction)
2167         https://bugs.webkit.org/show_bug.cgi?id=150165
2168
2169         Reviewed by Eric Carlson.
2170
2171         Add the MediaEndpoint interface along with its companion objects.
2172
2173         MediaEndpoint interface: A WebRTC platform abstraction that is used to
2174         configure how the the WebRTC backend sends and receives. It also abstracts
2175         ICE functionality such as generating local candidates and doing
2176         checking on remote candidates. The RTCPeerConnection API, and other API
2177         objects such as RTCRtpSender/Receiver, live above MediaEndpoint.
2178
2179         MediaEndpointConfiguration: A settings object used to configure a
2180         MediaEndpoint with, for example, ICE helper servers and other polices.
2181         A MediaEndpointConfiguration is used to initialize a MediaEndpoint, but
2182         can also be used to update settings.
2183
2184         MediaEndpointSessionConfiguration: An object that describes how the
2185         MediaEndpoint should send and receive. Contains PeerMediaDescription,
2186         MediaPayload and IceCandidate objects.
2187
2188         Tests: The MediaEndpoint platform interface has no implementations yet.
2189
2190         * CMakeLists.txt:
2191         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
2192         (WebCore::MediaEndpointPeerConnection::gotDtlsFingerprint):
2193         (WebCore::MediaEndpointPeerConnection::gotIceCandidate):
2194         (WebCore::MediaEndpointPeerConnection::doneGatheringCandidates):
2195         (WebCore::MediaEndpointPeerConnection::gotRemoteSource):
2196         * Modules/mediastream/MediaEndpointPeerConnection.h:
2197         * WebCore.xcodeproj/project.pbxproj:
2198         * platform/mediastream/IceCandidate.h: Added.
2199         (WebCore::IceCandidate::create):
2200         (WebCore::IceCandidate::~IceCandidate):
2201         (WebCore::IceCandidate::type):
2202         (WebCore::IceCandidate::setType):
2203         (WebCore::IceCandidate::foundation):
2204         (WebCore::IceCandidate::setFoundation):
2205         (WebCore::IceCandidate::componentId):
2206         (WebCore::IceCandidate::setComponentId):
2207         (WebCore::IceCandidate::transport):
2208         (WebCore::IceCandidate::setTransport):
2209         (WebCore::IceCandidate::priority):
2210         (WebCore::IceCandidate::setPriority):
2211         (WebCore::IceCandidate::address):
2212         (WebCore::IceCandidate::setAddress):
2213         (WebCore::IceCandidate::port):
2214         (WebCore::IceCandidate::setPort):
2215         (WebCore::IceCandidate::tcpType):
2216         (WebCore::IceCandidate::setTcpType):
2217         (WebCore::IceCandidate::relatedAddress):
2218         (WebCore::IceCandidate::setRelatedAddress):
2219         (WebCore::IceCandidate::relatedPort):
2220         (WebCore::IceCandidate::setRelatedPort):
2221         (WebCore::IceCandidate::clone):
2222         (WebCore::IceCandidate::IceCandidate):
2223         * platform/mediastream/MediaEndpoint.cpp: Added.
2224         (WebCore::createMediaEndpoint):
2225         * platform/mediastream/MediaEndpoint.h: Added.
2226         (WebCore::MediaEndpointClient::~MediaEndpointClient):
2227         (WebCore::MediaEndpoint::~MediaEndpoint):
2228         * platform/mediastream/MediaEndpointConfiguration.cpp: Added.
2229         (WebCore::IceServerInfo::IceServerInfo):
2230         (WebCore::MediaEndpointConfiguration::MediaEndpointConfiguration):
2231         * platform/mediastream/MediaEndpointConfiguration.h: Added.
2232         (WebCore::IceServerInfo::create):
2233         (WebCore::IceServerInfo::~IceServerInfo):
2234         (WebCore::IceServerInfo::urls):
2235         (WebCore::IceServerInfo::credential):
2236         (WebCore::IceServerInfo::username):
2237         (WebCore::MediaEndpointConfiguration::create):
2238         (WebCore::MediaEndpointConfiguration::iceServers):
2239         (WebCore::MediaEndpointConfiguration::iceTransportPolicy):
2240         (WebCore::MediaEndpointConfiguration::bundlePolicy):
2241         * platform/mediastream/MediaEndpointSessionConfiguration.h: Added.
2242         (WebCore::MediaEndpointSessionConfiguration::create):
2243         (WebCore::MediaEndpointSessionConfiguration::~MediaEndpointSessionConfiguration):
2244         (WebCore::MediaEndpointSessionConfiguration::sessionId):
2245         (WebCore::MediaEndpointSessionConfiguration::setSessionId):
2246         (WebCore::MediaEndpointSessionConfiguration::sessionVersion):
2247         (WebCore::MediaEndpointSessionConfiguration::setSessionVersion):
2248         (WebCore::MediaEndpointSessionConfiguration::mediaDescriptions):
2249         (WebCore::MediaEndpointSessionConfiguration::addMediaDescription):
2250         (WebCore::MediaEndpointSessionConfiguration::clone):
2251         (WebCore::MediaEndpointSessionConfiguration::MediaEndpointSessionConfiguration):
2252         * platform/mediastream/MediaPayload.h: Added.
2253         (WebCore::MediaPayload::create):
2254         (WebCore::MediaPayload::~MediaPayload):
2255         (WebCore::MediaPayload::type):
2256         (WebCore::MediaPayload::setType):
2257         (WebCore::MediaPayload::encodingName):
2258         (WebCore::MediaPayload::setEncodingName):
2259         (WebCore::MediaPayload::clockRate):
2260         (WebCore::MediaPayload::setClockRate):
2261         (WebCore::MediaPayload::channels):
2262         (WebCore::MediaPayload::setChannels):
2263         (WebCore::MediaPayload::ccmfir):
2264         (WebCore::MediaPayload::setCcmfir):
2265         (WebCore::MediaPayload::nackpli):
2266         (WebCore::MediaPayload::setNackpli):
2267         (WebCore::MediaPayload::nack):
2268         (WebCore::MediaPayload::setNack):
2269         (WebCore::MediaPayload::parameters):
2270         (WebCore::MediaPayload::addParameter):
2271         (WebCore::MediaPayload::clone):
2272         (WebCore::MediaPayload::MediaPayload):
2273         * platform/mediastream/PeerMediaDescription.h: Added.
2274         (WebCore::PeerMediaDescription::create):
2275         (WebCore::PeerMediaDescription::~PeerMediaDescription):
2276         (WebCore::PeerMediaDescription::type):
2277         (WebCore::PeerMediaDescription::setType):
2278         (WebCore::PeerMediaDescription::port):
2279         (WebCore::PeerMediaDescription::setPort):
2280         (WebCore::PeerMediaDescription::address):
2281         (WebCore::PeerMediaDescription::setAddress):
2282         (WebCore::PeerMediaDescription::mode):
2283         (WebCore::PeerMediaDescription::setMode):
2284         (WebCore::PeerMediaDescription::payloads):
2285         (WebCore::PeerMediaDescription::addPayload):
2286         (WebCore::PeerMediaDescription::setPayloads):
2287         (WebCore::PeerMediaDescription::rtcpMux):
2288         (WebCore::PeerMediaDescription::setRtcpMux):
2289         (WebCore::PeerMediaDescription::rtcpAddress):
2290         (WebCore::PeerMediaDescription::setRtcpAddress):
2291         (WebCore::PeerMediaDescription::rtcpPort):
2292         (WebCore::PeerMediaDescription::setRtcpPort):
2293         (WebCore::PeerMediaDescription::mediaStreamId):
2294         (WebCore::PeerMediaDescription::setMediaStreamId):
2295         (WebCore::PeerMediaDescription::mediaStreamTrackId):
2296         (WebCore::PeerMediaDescription::setMediaStreamTrackId):
2297         (WebCore::PeerMediaDescription::dtlsSetup):
2298         (WebCore::PeerMediaDescription::setDtlsSetup):
2299         (WebCore::PeerMediaDescription::dtlsFingerprintHashFunction):
2300         (WebCore::PeerMediaDescription::setDtlsFingerprintHashFunction):
2301         (WebCore::PeerMediaDescription::dtlsFingerprint):
2302         (WebCore::PeerMediaDescription::setDtlsFingerprint):
2303         (WebCore::PeerMediaDescription::cname):
2304         (WebCore::PeerMediaDescription::setCname):
2305         (WebCore::PeerMediaDescription::ssrcs):
2306         (WebCore::PeerMediaDescription::addSsrc):
2307         (WebCore::PeerMediaDescription::clearSsrcs):
2308         (WebCore::PeerMediaDescription::iceUfrag):
2309         (WebCore::PeerMediaDescription::setIceUfrag):
2310         (WebCore::PeerMediaDescription::icePassword):
2311         (WebCore::PeerMediaDescription::setIcePassword):
2312         (WebCore::PeerMediaDescription::iceCandidates):
2313         (WebCore::PeerMediaDescription::addIceCandidate):
2314         (WebCore::PeerMediaDescription::source):
2315         (WebCore::PeerMediaDescription::setSource):
2316         (WebCore::PeerMediaDescription::clone):
2317         (WebCore::PeerMediaDescription::PeerMediaDescription):
2318
2319 2016-02-24  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2320
2321         [Fetch API] Implement Fetch API Response
2322         https://bugs.webkit.org/show_bug.cgi?id=154536
2323
2324         Reviewed by Alex Christensen.
2325
2326         Tests: imported/w3c/web-platform-tests/fetch/api/response/response-clone.html
2327                imported/w3c/web-platform-tests/fetch/api/response/response-consume.html
2328                imported/w3c/web-platform-tests/fetch/api/response/response-error.html
2329                imported/w3c/web-platform-tests/fetch/api/response/response-idl.html
2330                imported/w3c/web-platform-tests/fetch/api/response/response-init-001.html
2331                imported/w3c/web-platform-tests/fetch/api/response/response-init-002.html
2332                imported/w3c/web-platform-tests/fetch/api/response/response-static-error.html
2333                imported/w3c/web-platform-tests/fetch/api/response/response-static-redirect.html
2334
2335         Adding Fetch Response as FetchResponse class.
2336         Constructor uses a built-in to pre-process the parameters.
2337         Support of body as ReadableStream is missing.
2338
2339         * CMakeLists.txt:
2340         * DerivedSources.make:
2341         * Modules/fetch/FetchBody.h:
2342         (WebCore::FetchBody::empty):
2343         * Modules/fetch/FetchResponse.cpp: Added.
2344         (WebCore::JSFetchResponse::body):
2345         (WebCore::isRedirectStatus):
2346         (WebCore::isNullBodyStatus):
2347         (WebCore::FetchResponse::error):
2348         (WebCore::FetchResponse::redirect):
2349         (WebCore::FetchResponse::initializeWith):
2350         (WebCore::FetchResponse::FetchResponse):
2351         (WebCore::FetchResponse::clone):
2352         (WebCore::FetchResponse::type):
2353         * Modules/fetch/FetchResponse.h: Added.
2354         (WebCore::FetchResponse::create):
2355         (WebCore::FetchResponse::redirect):
2356         (WebCore::FetchResponse::url):
2357         (WebCore::FetchResponse::redirected):
2358         (WebCore::FetchResponse::status):
2359         (WebCore::FetchResponse::ok):
2360         (WebCore::FetchResponse::statusText):
2361         (WebCore::FetchResponse::headers):
2362         (WebCore::FetchResponse::isDisturbed):
2363         (WebCore::FetchResponse::arrayBuffer):
2364         (WebCore::FetchResponse::formData):
2365         (WebCore::FetchResponse::blob):
2366         (WebCore::FetchResponse::json):
2367         (WebCore::FetchResponse::text):
2368         * Modules/fetch/FetchResponse.idl: Added.
2369         * Modules/fetch/FetchResponse.js: Added.
2370         (initializeFetchResponse):
2371         * WebCore.xcodeproj/project.pbxproj:
2372         * bindings/js/WebCoreJSBuiltins.cpp:
2373         * bindings/js/WebCoreJSBuiltins.h:
2374         (WebCore::JSBuiltinFunctions::JSBuiltinFunctions):
2375         (WebCore::JSBuiltinFunctions::fetchResponseBuiltins):
2376
2377 2016-02-24  Ryosuke Niwa  <rniwa@webkit.org>
2378
2379         A function named canTakeNextToken executing blocking scripts is misleading
2380         https://bugs.webkit.org/show_bug.cgi?id=154636
2381
2382         Reviewed by Darin Adler.
2383
2384         Merged canTakeNextToken into pumpTokenizer and extracted pumpTokenizerLoop out of pumpTokenizer.
2385
2386         Inlined m_parserChunkSize in HTMLParserScheduler into checkForYieldBeforeToken, and removed needsYield
2387         from PumpSession in favor of making checkForYieldBeforeToken and checkForYieldBeforeScript return a bool.
2388
2389         No new tests since this is a pure refactoring.
2390
2391         * html/parser/HTMLDocumentParser.cpp:
2392         (WebCore::HTMLDocumentParser::canTakeNextToken): Deleted.
2393         (WebCore::HTMLDocumentParser::pumpTokenizerLoop): Extracted from pumpTokenizer. We don't have to check
2394         isStopped() at the beginning since pumpTokenizer asserts that. Return true when session.needsYield would
2395         have been set to true in the old code and return false elsewhere (for stopping or incomplete token).
2396         (WebCore::HTMLDocumentParser::pumpTokenizer):
2397         * html/parser/HTMLDocumentParser.h:
2398         * html/parser/HTMLParserScheduler.cpp:
2399         (WebCore::PumpSession::PumpSession):
2400         (WebCore::HTMLParserScheduler::HTMLParserScheduler):
2401         (WebCore::HTMLParserScheduler::shouldYieldBeforeExecutingScript): Renamed from checkForYieldBeforeScript.
2402         * html/parser/HTMLParserScheduler.h:
2403         (WebCore::HTMLParserScheduler::shouldYieldBeforeToken): Renamed from checkForYieldBeforeToken.
2404         (WebCore::HTMLParserScheduler::isScheduledForResume):
2405         (WebCore::HTMLParserScheduler::checkForYield): Extracted from checkForYieldBeforeToken. Reset
2406         processedTokens to 1 instead of setting it to 0 here and incrementing it later as done in the old code.
2407
2408 2016-02-24  Daniel Bates  <dabates@apple.com>
2409
2410         CSP: Enable plugin-types directive by default
2411         https://bugs.webkit.org/show_bug.cgi?id=154420
2412         <rdar://problem/24730322>
2413
2414         Reviewed by Brent Fulgham.
2415
2416         * page/csp/ContentSecurityPolicyDirectiveList.cpp:
2417         (WebCore::isExperimentalDirectiveName): Move plugin-types from the directives considered
2418         experimental to...
2419         (WebCore::isCSPDirectiveName): ...the list of standard directives.
2420         (WebCore::ContentSecurityPolicyDirectiveList::addDirective): Move logic to parse the plugin-types
2421         directive outside the ENABLE(CSP_NEXT) macro guarded section/experimental feature runtime flag.
2422
2423 2016-02-24  Ryan Haddad  <ryanhaddad@apple.com>
2424
2425         Speculative fix for ios build.
2426
2427         Unreviewed build fix.
2428
2429         * bindings/objc/DOM.mm:
2430         (-[DOMNode nextFocusNode]):
2431         (-[DOMNode previousFocusNode]):
2432
2433 2016-02-24  Zalan Bujtas  <zalan@apple.com>
2434
2435         Background of an absolutely positioned inline element inside text-indented parent is positioned statically.
2436         https://bugs.webkit.org/show_bug.cgi?id=154019
2437
2438         Reviewed by Simon Fraser.
2439
2440         This patch ensures that statically positioned out-of-flow renderers are also text-aligned
2441         even when none of the renderers on the first line generate a linebox (so we end up with no bidi runs at all).
2442         The fix is to pass IndentTextOrNot information to startAlignedOffsetForLine through updateStaticInlinePositionForChild
2443         so that we can compute the left position for this statically positioned out of flow renderer.
2444
2445         Test: fast/css3-text/css3-text-indent/text-indent-with-absolute-pos-child.html
2446
2447         * rendering/RenderBlockFlow.cpp:
2448         (WebCore::RenderBlockFlow::adjustPositionedBlock):
2449         (WebCore::RenderBlockFlow::updateStaticInlinePositionForChild):
2450         * rendering/RenderBlockFlow.h:
2451         * rendering/RenderBlockLineLayout.cpp:
2452         (WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):
2453         (WebCore::RenderBlockFlow::startAlignedOffsetForLine):
2454         * rendering/line/LineBreaker.cpp:
2455         (WebCore::LineBreaker::skipTrailingWhitespace):
2456         (WebCore::LineBreaker::skipLeadingWhitespace):
2457         * rendering/line/LineInlineHeaders.h: webkit.org/b/154628 fixes the bool vs IndentTextOrNot issue.
2458         (WebCore::setStaticPositions):
2459
2460 2016-02-24  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2461
2462         Remove IteratorKey and IteratorValue declarations from JSXX class declarations.
2463         https://bugs.webkit.org/show_bug.cgi?id=154577
2464
2465         Reviewed by Myles C. Maxfield.
2466
2467         No change of behavior.
2468
2469         * bindings/scripts/CodeGeneratorJS.pm:
2470         (GenerateHeader): Deleted declaration of IteratorKey and IteratorValue.
2471         * bindings/scripts/test/JS/JSTestObj.h:
2472         (WebCore::JSTestObj::createStructure): Rebasing of binding test expectation.
2473
2474 2016-02-24  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2475
2476         [Fetch API] Refactor FetchHeaders initialization with iterators
2477         https://bugs.webkit.org/show_bug.cgi?id=154537
2478
2479         Reviewed by Darin Adler.
2480
2481         Covered by existing tests.
2482
2483         * Modules/fetch/FetchHeaders.cpp:
2484         (WebCore::initializeWith): Deleted.
2485         * Modules/fetch/FetchHeaders.h: Removed FetchHeaders::initializeWith.
2486         * Modules/fetch/FetchHeaders.idl: Ditto.
2487         * Modules/fetch/FetchHeaders.js:
2488         (initializeFetchHeaders): Making use of iterators to fill headers.
2489
2490 2016-02-24  Carlos Garcia Campos  <cgarcia@igalia.com>
2491
2492         Unreviewed. Fix GObject DOM bindings API break after r196998.
2493
2494         webkit_dom_node_clone_node can now raise exceptions, so rename it
2495         as webkit_dom_node_clone_node_with_error and deprecate the old one
2496         that calls the new one ignoring the error.
2497
2498         * bindings/gobject/WebKitDOMDeprecated.cpp:
2499         (webkit_dom_node_clone_node):
2500         * bindings/gobject/WebKitDOMDeprecated.h:
2501         * bindings/gobject/WebKitDOMDeprecated.symbols:
2502         * bindings/gobject/webkitdom.symbols:
2503         * bindings/scripts/CodeGeneratorGObject.pm:
2504         (FunctionUsedToNotRaiseException):
2505         (GenerateFunction):
2506
2507 2016-02-24  Carlos Garcia Campos  <cgarcia@igalia.com>
2508
2509         REGRESSION(r195949): [GTK] Test /webkit2/WebKitWebView/insert/link is failing since r195949
2510         https://bugs.webkit.org/show_bug.cgi?id=153747
2511
2512         Reviewed by Michael Catanzaro.
2513
2514         Do not return early when reaching a boundary if there's a range
2515         selection. In that case, the selection will be cleared and
2516         accessibility will be notified.
2517
2518         Test: editing/selection/move-to-line-boundary-clear-selection.html
2519
2520         * editing/FrameSelection.cpp:
2521         (WebCore::FrameSelection::modify):
2522
2523 2016-02-24  Alejandro G. Castro  <alex@igalia.com>
2524
2525         [Gstreamer] Mediaplayer should observe the tracks and not the source
2526         https://bugs.webkit.org/show_bug.cgi?id=154582
2527
2528         Reviewed by Philippe Normand.
2529
2530         We have to observe the track objects that define the
2531         mediastream. Replace the source attributes with the new tracks and
2532         use them properly in the class.
2533
2534         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.cpp:
2535         (WebCore::MediaPlayerPrivateGStreamerOwr::~MediaPlayerPrivateGStreamerOwr):
2536         Make sure we are not observing anymore the tracks after
2537         destruction.
2538         (WebCore::MediaPlayerPrivateGStreamerOwr::hasVideo): Used the track
2539         instead of the source.
2540         (WebCore::MediaPlayerPrivateGStreamerOwr::hasAudio): Ditto.
2541         (WebCore::MediaPlayerPrivateGStreamerOwr::currentTime): Ditto.
2542         (WebCore::MediaPlayerPrivateGStreamerOwr::internalLoad): Ditto.
2543         (WebCore::MediaPlayerPrivateGStreamerOwr::stop): Ditto.
2544         (WebCore::MediaPlayerPrivateGStreamerOwr::trackEnded): Added, new
2545         track observer API, make sure we disable the ended tracks.
2546         (WebCore::MediaPlayerPrivateGStreamerOwr::trackMutedChanged):
2547         Added, new track observer API.
2548         (WebCore::MediaPlayerPrivateGStreamerOwr::trackSettingsChanged):
2549         Added, new track observer API.
2550         (WebCore::MediaPlayerPrivateGStreamerOwr::trackEnabledChanged):
2551         Added, new track observer API.
2552         (WebCore::MediaPlayerPrivateGStreamerOwr::sourceStopped): Deleted,
2553         source observer API.
2554         (WebCore::MediaPlayerPrivateGStreamerOwr::sourceMutedChanged):
2555         Deleted, source observer API.
2556         (WebCore::MediaPlayerPrivateGStreamerOwr::sourceSettingsChanged):
2557         Deleted, source observer API.
2558         (WebCore::MediaPlayerPrivateGStreamerOwr::preventSourceFromStopping):
2559         Deleted, source observer API.
2560         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.h:
2561         Replaced the attributes representing the source with the tracks
2562         and added the new track observer functions.
2563
2564 2016-02-23  Sergio Villar Senin  <svillar@igalia.com>
2565
2566         [css-grid] Swap the order of columns/rows in grid-gap shorthand
2567         https://bugs.webkit.org/show_bug.cgi?id=154584
2568
2569         The latest editor's draft have just changed the order. Now it
2570         should be <grid-row-gap> <grid-column-gap>?.
2571
2572         Reviewed by Darin Adler.
2573
2574         * css/CSSParser.cpp:
2575         (WebCore::CSSParser::parseGridGapShorthand):
2576         * css/CSSPropertyNames.in:
2577
2578 2016-02-24  Ryosuke Niwa  <rniwa@webkit.org>
2579
2580         Move FocusNavigationScope into FocusController.cpp
2581         https://bugs.webkit.org/show_bug.cgi?id=154630
2582
2583         Reviewed by Darin Adler.
2584
2585         Moved FocusNavigationScope from FocusController.h to FocusController.cpp.
2586
2587         * bindings/objc/DOM.mm:
2588         (-[DOMNode nextFocusNode]):
2589         (-[DOMNode previousFocusNode]):
2590         * page/FocusController.cpp:
2591         (WebCore::parentInScope):
2592         (WebCore::FocusNavigationScope::firstChildInScope): Moved into FocusNavigationScope.
2593         (WebCore::FocusNavigationScope::lastChildInScope): Ditto.
2594         (WebCore::FocusNavigationScope::nextInScope): Ditto.
2595         (WebCore::FocusNavigationScope::previousInScope): Ditto.
2596         (WebCore::FocusController::findFocusableElementAcrossFocusScope):
2597         (WebCore::FocusController::findFocusableElementRecursively):
2598         (WebCore::FocusController::findFocusableElement):
2599         (WebCore::nextElementWithGreaterTabIndex):
2600         (WebCore::previousElementWithLowerTabIndex):
2601         (WebCore::FocusController::nextFocusableElement): Added a variant for DOM.mm and WebPageIOS.mm.
2602         (WebCore::FocusController::previousFocusableElement): Ditto.
2603         (WebCore::FocusController::nextFocusableElement):
2604         (WebCore::FocusController::previousFocusableElement): Use if instead of for loop for clarity.
2605         * page/FocusController.h:
2606
2607 2016-02-24  Adam Bergkvist  <adam.bergkvist@ericsson.com>
2608
2609         WebRTC: RTCPeerConnection: Sort out responsibilities of close() and stop()
2610         https://bugs.webkit.org/show_bug.cgi?id=154581
2611
2612         Reviewed by Eric Carlson.
2613
2614         Let RTCPeerConnection::close() contain all teardown logic be called by stop().
2615         close() is also responisble for stopping the PeerConnectionBackend and stopping
2616         all RTCRtpSender objects.
2617
2618         Test coverage:
2619         fast/mediastream/RTCRtpSender-replaceTrack.html (updated)
2620         fast/mediastream/RTCPeerConnection-closed-state.html
2621
2622         * Modules/mediastream/RTCPeerConnection.cpp:
2623         (WebCore::RTCPeerConnection::close):
2624         (WebCore::RTCPeerConnection::stop):
2625         (WebCore::RTCPeerConnection::RTCPeerConnection): Deleted.
2626         * Modules/mediastream/RTCPeerConnection.h:
2627
2628 2016-02-24  Adam Bergkvist  <adam.bergkvist@ericsson.com>
2629
2630         WebRTC: Add addReceiver() function to PeerConnectionBackendClient interface
2631         https://bugs.webkit.org/show_bug.cgi?id=154583
2632
2633         Reviewed by Eric Carlson.
2634
2635         The addRecevier() notifies the PeerConnectionBackendClient that a new RTCRtpReceiver,
2636         representing an MediaStreamTrack received from a remote peer, is added.
2637
2638         * Modules/mediastream/PeerConnectionBackend.h:
2639         * Modules/mediastream/RTCPeerConnection.cpp:
2640         (WebCore::RTCPeerConnection::addReceiver):
2641         * Modules/mediastream/RTCPeerConnection.h:
2642
2643 2016-02-23  Olivier Blin  <olivier.blin@softathome.com>
2644
2645         Support building LocaleICU with light ICU (UCONFIG_NO_FORMATTING)
2646         https://bugs.webkit.org/show_bug.cgi?id=154484
2647
2648         Reviewed by Darin Adler.
2649
2650         In this mode, this makes LocaleICU with UCONFIG_NO_FORMATTING
2651         essentially the same as LocaleNone, but allows to keep using ICU for
2652         other features.
2653
2654         * platform/text/LocaleICU.cpp:
2655         (WebCore::LocaleICU::LocaleICU):
2656         (WebCore::LocaleICU::~LocaleICU):
2657         (WebCore::LocaleICU::initializeLocaleData):
2658         * platform/text/LocaleICU.h:
2659
2660 2016-02-23  Myles C. Maxfield  <mmaxfield@apple.com>
2661
2662         Remove dead FontLoader code
2663         https://bugs.webkit.org/show_bug.cgi?id=154625
2664
2665         Reviewed by Darin Adler.
2666
2667         This code has been replaced by FontFaceSet.
2668
2669         No new tests because there is no behavior change.
2670
2671         * CMakeLists.txt:
2672         * DerivedSources.cpp:
2673         * DerivedSources.make:
2674         * WebCore.vcxproj/WebCore.vcxproj:
2675         * WebCore.vcxproj/WebCore.vcxproj.filters:
2676         * WebCore.xcodeproj/project.pbxproj:
2677         * css/CSSAllInOne.cpp:
2678         * css/FontLoader.cpp: Removed.
2679         (WebCore::LoadFontCallback::create): Deleted.
2680         (WebCore::LoadFontCallback::createFromParams): Deleted.
2681         (WebCore::LoadFontCallback::~LoadFontCallback): Deleted.
2682         (WebCore::LoadFontCallback::familyCount): Deleted.
2683         (WebCore::LoadFontCallback::LoadFontCallback): Deleted.
2684         (WebCore::LoadFontCallback::notifyLoaded): Deleted.
2685         (WebCore::LoadFontCallback::notifyError): Deleted.
2686         (WebCore::FontLoader::loadFontDone): Deleted.
2687         (WebCore::FontLoader::FontLoader): Deleted.
2688         (WebCore::FontLoader::~FontLoader): Deleted.
2689         (WebCore::FontLoader::eventTargetData): Deleted.
2690         (WebCore::FontLoader::ensureEventTargetData): Deleted.
2691         (WebCore::FontLoader::eventTargetInterface): Deleted.
2692         (WebCore::FontLoader::scriptExecutionContext): Deleted.
2693         (WebCore::FontLoader::didLayout): Deleted.
2694         (WebCore::FontLoader::activeDOMObjectName): Deleted.
2695         (WebCore::FontLoader::canSuspendForDocumentSuspension): Deleted.
2696         (WebCore::FontLoader::scheduleEvent): Deleted.
2697         (WebCore::FontLoader::firePendingEvents): Deleted.
2698         (WebCore::FontLoader::beginFontLoading): Deleted.
2699         (WebCore::FontLoader::fontLoaded): Deleted.
2700         (WebCore::FontLoader::loadError): Deleted.
2701         (WebCore::FontLoader::notifyWhenFontsReady): Deleted.
2702         (WebCore::FontLoader::loadingDone): Deleted.
2703         (WebCore::FontLoader::loadFont): Deleted.
2704         (WebCore::FontLoader::checkFont): Deleted.
2705         (WebCore::applyPropertyToCurrentStyle): Deleted.
2706         (WebCore::FontLoader::resolveFontStyle): Deleted.
2707         * css/FontLoader.h: Removed.
2708         * css/FontLoader.idl: Removed.
2709         * page/FrameView.cpp:
2710
2711 2016-02-23  Per Arne Vollan  <peavo@outlook.com>
2712
2713         [WinCairo][MediaFoundation] Implement methods to set volume.
2714         https://bugs.webkit.org/show_bug.cgi?id=154580
2715
2716         Reviewed by Alex Christensen.
2717
2718         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
2719         (WebCore::MediaPlayerPrivateMediaFoundation::paused):
2720         (WebCore::MediaPlayerPrivateMediaFoundation::setVolume):
2721         (WebCore::MediaPlayerPrivateMediaFoundation::supportsMuting):
2722         (WebCore::MediaPlayerPrivateMediaFoundation::setMuted):
2723         (WebCore::MediaPlayerPrivateMediaFoundation::networkState):
2724         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
2725
2726 2016-02-23  Chris Dumez  <cdumez@apple.com>
2727
2728         [Reflected] IDL attributes of integer types should use HTML rules for parsing integers
2729         https://bugs.webkit.org/show_bug.cgi?id=154573
2730
2731         Reviewed by Darin Adler.
2732
2733         [Reflected] IDL attributes of integer types should use HTML rules for
2734         parsing integers:
2735         - https://html.spec.whatwg.org/#reflecting-content-attributes-in-idl-attributes
2736
2737         Those rules are defined here:
2738         - https://html.spec.whatwg.org/#rules-for-parsing-integers
2739         - https://html.spec.whatwg.org/#rules-for-parsing-non-negative-integers
2740
2741         We already had an implementation for parsing HTML integers but our reflected
2742         attributes currently use WTFString::toInt() / toUint() instead.
2743
2744         No new tests, already covered by existing tests.
2745
2746         * dom/Element.cpp:
2747         (WebCore::Element::getIntegralAttribute):
2748         This method used by the bindings only, for reflected IDL attributed of
2749         type 'long'. Now call parseHTMLInteger() instead of String::toInt() to
2750         parse the content attribute as per the HTML specification.
2751
2752         (WebCore::Element::getUnsignedIntegralAttribute):
2753         This method used by the bindings only, for reflected IDL attributed of
2754         type 'unsigned long'. Now call parseHTMLNonNegativeInteger() instead of
2755         String::toUInt() to parse the content attribute as per the HTML
2756         specification.
2757
2758         * html/parser/HTMLParserIdioms.cpp:
2759         (WebCore::parseHTMLIntegerInternal):
2760         Fix a bug in our implementation of parseHTMLIntegerInternal() that
2761         would cause the string "−2147483648" to be parsed as 0. It should
2762         be parsed as −2147483648, which is in the valid range as per:
2763         http://heycam.github.io/webidl/#idl-long
2764
2765 2016-02-23  Chris Dumez  <cdumez@apple.com>
2766
2767         Align our implementation of Range.createContextualFragment with the specification
2768         https://bugs.webkit.org/show_bug.cgi?id=154627
2769
2770         Reviewed by Ryosuke Niwa.
2771
2772         Align our implementation of Range.createContextualFragment with the
2773         specification:
2774         - https://w3c.github.io/DOM-Parsing/#widl-Range-createContextualFragment-DocumentFragment-DOMString-fragment
2775
2776         In particular, if the Range's start node is a Document / DocumentFragment,
2777         we now create a new HTMLBodyElement and use it as context element, instead
2778         of throwing an exception.
2779
2780         This also aligns our behavior with Firefox and Chrome.
2781
2782         Tests: imported/blink/fast/dom/Range/create-contextual-fragment-from-bodyless-document-range.html
2783                imported/blink/fast/dom/Range/create-contextual-fragment-from-detached-text-node-range.html
2784                imported/blink/fast/dom/Range/create-contextual-fragment-from-document-fragment-range.html
2785                imported/blink/fast/dom/Range/create-contextual-fragment-from-document-range.html
2786                imported/blink/fast/dom/Range/create-contextual-fragment-from-xhtml-document-range.xhtml
2787                imported/blink/fast/dom/Range/create-contextual-fragment-script-not-ran.html
2788                imported/blink/fast/dom/Range/create-contextual-fragment-script-unmark-already-started.html
2789
2790         * dom/Range.cpp:
2791         (WebCore::Range::createContextualFragment):
2792
2793 2016-02-23  Dan Bernstein  <mitz@apple.com>
2794
2795         [Xcode] Linker errors display mangled names, but no longer should
2796         https://bugs.webkit.org/show_bug.cgi?id=154632
2797
2798         Reviewed by Sam Weinig.
2799
2800         * Configurations/Base.xcconfig: Stop setting LINKER_DISPLAYS_MANGLED_NAMES to YES.
2801
2802 2016-02-23  Dean Jackson  <dino@apple.com>
2803
2804         [WebGL] iOS doesn't respect the alpha:false context creation attribute
2805         https://bugs.webkit.org/show_bug.cgi?id=154617
2806         <rdar://problem/13417023>
2807
2808         Reviewed by Sam Weinig.
2809
2810         On iOS we were not respecting the alpha:false context creation
2811         attribute, which meant you always got output that could
2812         have an alpha channel.
2813
2814         The good news is that now we're setting the opaque flag on
2815         the CALayer, there should be a performance improvement when
2816         compositing WebGL into the page.
2817
2818         Test: fast/canvas/webgl/context-attributes-alpha.html
2819
2820         * platform/graphics/mac/GraphicsContext3DMac.mm:
2821         (WebCore::GraphicsContext3D::GraphicsContext3D): Don't tell the layer
2822         to be transparent.
2823         (WebCore::GraphicsContext3D::setRenderbufferStorageFromDrawable): Do it
2824         here instead, but based on the value of the alpha attribute.
2825
2826 2016-02-23  Daniel Bates  <dabates@apple.com>
2827
2828         CSP: Enable base-uri directive by default
2829         https://bugs.webkit.org/show_bug.cgi?id=154521
2830         <rdar://problem/24762032>
2831
2832         Reviewed by Brent Fulgham.
2833
2834         Tests: http/tests/security/contentSecurityPolicy/1.1/base-uri-default-ignored.html
2835                http/tests/security/contentSecurityPolicy/1.1/securitypolicyviolation-base-uri-deny.html
2836
2837         * page/csp/ContentSecurityPolicyDirectiveList.cpp:
2838         (WebCore::isExperimentalDirectiveName): Move base-uri from the directives considered
2839         experimental to...
2840         (WebCore::isCSPDirectiveName): ...the list of standard directives.
2841         (WebCore::ContentSecurityPolicyDirectiveList::addDirective): Move logic to parse the base-uri
2842         directive outside the ENABLE(CSP_NEXT) macro guarded section/experimental feature runtime flag.
2843
2844 2016-02-23  Gavin Barraclough  <barraclough@apple.com>
2845
2846         Remove HIDDEN_PAGE_DOM_TIMER_THROTTLING feature define
2847         https://bugs.webkit.org/show_bug.cgi?id=112323
2848
2849         Reviewed by Chris Dumez.
2850
2851         This feature is controlled by a runtime switch, and defaults off.
2852
2853         * Configurations/FeatureDefines.xcconfig:
2854         * page/Page.cpp:
2855         (WebCore::Page::setTimerThrottlingEnabled):
2856         * page/Settings.cpp:
2857         (WebCore::Settings::Settings):
2858         (WebCore::Settings::shouldRespectPriorityInCSSAttributeSetters):
2859         (WebCore::Settings::setHiddenPageDOMTimerThrottlingEnabled):
2860         (WebCore::Settings::setHiddenPageDOMTimerThrottlingAutoIncreases):
2861         * page/Settings.h:
2862         (WebCore::Settings::layoutInterval):
2863         (WebCore::Settings::hiddenPageDOMTimerThrottlingEnabled):
2864         (WebCore::Settings::hiddenPageDOMTimerThrottlingAutoIncreases):
2865
2866 2016-02-23  Gavin Barraclough  <barraclough@apple.com>
2867
2868         Add a mechanism to automatically ramp up timer alignment.
2869         https://bugs.webkit.org/show_bug.cgi?id=154578
2870
2871         Reviewed by Antti Koivisto & Chris Dumez.
2872
2873         Allow timer alignment duration to be proportional to the time the page
2874         has been hidden. This implementation does so by scaling up the throttle
2875         in exponential steps, spaced exponentially far apart.
2876
2877         * page/Page.cpp:
2878         (WebCore::Page::Page):
2879             - initialize timer.
2880         (WebCore::Page::hiddenPageDOMTimerThrottlingStateChanged):
2881             - if setting are changed fully disable/reenable to ensure new setting are read.
2882         (WebCore::Page::setTimerThrottlingEnabled):
2883             - enebled bool flag converted to an Optional<double>, tracking time throttling
2884               is enabled.
2885         (WebCore::Page::setDOMTimerAlignmentInterval):
2886             - when new mechanism is enabled schedule a timer to step up alignment.
2887         (WebCore::Page::timerAlignmentIntervalIncreaseTimerFired):
2888             - when timer fires increase alignment.
2889         * page/Page.h:
2890             - added new member.
2891         * page/Settings.cpp:
2892         (WebCore::Settings::Settings):
2893             - initialize new member.
2894         (WebCore::Settings::setHiddenPageDOMTimerThrottlingAutoIncreaseLimit):
2895             - added, update new setting. Setting to zero disabled. A non-zero value is a
2896               duration in seconds for timer throttling to ramp up to.
2897         * page/Settings.h:
2898         (WebCore::Settings::hiddenPageDOMTimerThrottlingAutoIncreases):
2899             - read as boolean whether throttle increasing is enabled.
2900         (WebCore::Settings::hiddenPageDOMTimerThrottlingAutoIncreaseLimit):
2901             - read throttle increasing limit.
2902
2903 2016-02-22  Ada Chan  <adachan@apple.com>
2904
2905         Refactor script that updates fullscreen buttons.
2906         https://bugs.webkit.org/show_bug.cgi?id=154562
2907
2908         Reviewed by Dean Jackson.
2909
2910         Also expose extra property and element in getCurrentControlsStatus() for future testing.
2911
2912         * Modules/mediacontrols/mediaControlsApple.js:
2913         (Controller.prototype.updatePictureInPictureButton):
2914         (Controller.prototype.updateFullscreenButtons):
2915
2916 2016-02-22  Ryosuke Niwa  <rniwa@webkit.org>
2917
2918         Calling importNode on shadow root causes a crash
2919         https://bugs.webkit.org/show_bug.cgi?id=154570
2920
2921         Reviewed by Anders Carlsson.
2922
2923         The bug was caused by a missing check in cloneNode. Added cloneNodeForBindings to explicitly throw
2924         an NotSupportedError when it's called on a shadow root. We don't clone shadow root when deep-cloning
2925         the tree so we don't have to check that condition.
2926
2927         The behavior of cloneNode is specified at:
2928         http://w3c.github.io/webcomponents/spec/shadow/#the-shadowroot-interface
2929         (it current says we should throw DATA_CLONE_ERR but I have an spec bug filed at
2930         https://github.com/w3c/webcomponents/issues/393)
2931
2932         The behavior of importNode and adoptNode are specified in DOM4 specification:
2933         https://dom.spec.whatwg.org/#dom-document-importnode
2934         https://dom.spec.whatwg.org/#dom-document-adoptnode
2935
2936         Tests: fast/shadow-dom/Document-prototype-adoptNode.html
2937                fast/shadow-dom/Document-prototype-importNode.html
2938                fast/shadow-dom/Node-prototype-cloneNode.html
2939
2940         * dom/Document.cpp:
2941         (WebCore::Document::importNode): Throw NotSupportedError when importing a shadow root.
2942         * dom/Node.cpp:
2943         (WebCore::Node::cloneNodeForBindings): Added.
2944         * dom/Node.h:
2945         * dom/Node.idl: Use cloneNodeForBindings here.
2946
2947 2016-02-23  Daniel Bates  <dabates@apple.com>
2948
2949         REGRESSION (r196892): No longer emit error message when CSP form-action directive is used as a source expression
2950         https://bugs.webkit.org/show_bug.cgi?id=154555
2951         <rdar://problem/24776777>
2952
2953         Reviewed by Andy Estes.
2954
2955         Fixes an issue where an error message is not emitted when directive form-action is used as a
2956         source expression. Prior to <http://trac.webkit.org/changeset/196892>, when directive form-action
2957         was used as a source expression a console error message would be emitted with the form:
2958
2959             The Content Security Policy directive 'script-src' contains 'form-action' as a source expression.
2960             Did you mean 'script-src ...; form-action...' (note the semicolon)?
2961
2962         * page/csp/ContentSecurityPolicyDirectiveList.cpp:
2963         (WebCore::isCSPDirectiveName): Return true if the specified directive name is "form-action".
2964
2965 2016-02-23  Simon Fraser  <simon.fraser@apple.com>
2966
2967         Lay the groundwork for more constness in StyleResolver-related code
2968         https://bugs.webkit.org/show_bug.cgi?id=154598
2969
2970         Reviewed by Antti Koivisto.
2971
2972         Make some of the leaf functions that are used by the style resolver take 
2973         const CSSValues, and use 'auto' more to automatically get const stack variables
2974         when appropriate.
2975
2976         * css/CSSBorderImageSliceValue.h:
2977         (WebCore::CSSBorderImageSliceValue::slices):
2978         * css/CSSPrimitiveValue.h:
2979         (WebCore::CSSPrimitiveValue::isQuirkValue):
2980         * css/FontVariantBuilder.cpp:
2981         (WebCore::extractFontVariantLigatures):
2982         (WebCore::extractFontVariantNumeric):
2983         (WebCore::extractFontVariantEastAsian):
2984         * css/FontVariantBuilder.h:
2985         * css/StyleBuilderConverter.h:
2986         (WebCore::StyleBuilderConverter::convertReflection):
2987         (WebCore::StyleBuilderConverter::convertGridAutoFlow):
2988         * css/StyleBuilderCustom.h:
2989         (WebCore::StyleBuilderCustom::applyValueSize):
2990         (WebCore::StyleBuilderCustom::applyValueStroke):
2991         * css/StyleResolver.cpp:
2992         (WebCore::StyleResolver::colorFromPrimitiveValueIsDerivedFromElement):
2993         (WebCore::StyleResolver::colorFromPrimitiveValue):
2994         (WebCore::StyleResolver::createFilterOperations):
2995         * css/StyleResolver.h:
2996         * css/TransformFunctions.cpp:
2997         (WebCore::transformsForValue):
2998         * css/TransformFunctions.h:
2999         * rendering/style/StylePendingImage.h:
3000         * svg/SVGLength.cpp:
3001         (WebCore::SVGLength::fromCSSPrimitiveValue):
3002         * svg/SVGLength.h:
3003
3004 2016-02-23  Manuel Rego Casasnovas  <rego@igalia.com>
3005
3006         [css-grid] Avoid duplicated calls to resolution code
3007         https://bugs.webkit.org/show_bug.cgi?id=154336
3008
3009         Reviewed by Sergio Villar Senin.
3010
3011         We were calling GridResolvedPosition::resolveGridPositionsFromStyle()
3012         several times per item.
3013
3014         We can store the GridCoordinates in
3015         RenderGrid::populateExplicitGridAndOrderIterator()
3016         and reuse them in the placement code.
3017         Once RenderGrid::placeItemsOnGrid() is over,
3018         all the items will have a definite position in both axis.
3019
3020         No new tests, no change of behavior.
3021
3022         * rendering/RenderGrid.cpp:
3023         (WebCore::RenderGrid::insertItemIntoGrid):
3024         (WebCore::RenderGrid::placeItemsOnGrid):
3025         (WebCore::RenderGrid::populateExplicitGridAndOrderIterator):
3026         (WebCore::RenderGrid::placeSpecifiedMajorAxisItemsOnGrid):
3027         (WebCore::RenderGrid::placeAutoMajorAxisItemOnGrid):
3028         (WebCore::RenderGrid::cachedGridCoordinate):
3029         (WebCore::RenderGrid::cachedGridSpan):
3030         * rendering/RenderGrid.h:
3031
3032 2016-02-23  Manuel Rego Casasnovas  <rego@igalia.com>
3033
3034         [css-grid] Rows track sizes are optional in grid-template shorthand
3035         https://bugs.webkit.org/show_bug.cgi?id=154586
3036
3037         Reviewed by Sergio Villar Senin.
3038
3039         You can omit the size of the rows in grid-template shorthand,
3040         even if you specify a named grid line for the end of the row,
3041         due to a change in the spec back in 2014:
3042         https://github.com/w3c/csswg-drafts/commit/9f660c4183c73c1f5279c46904dc6cb314f76194
3043
3044         Before if you want to specify a named grid line,
3045         you need to set the row size.
3046
3047         Update parsing, so it nows accepts things like:
3048             grid-template: 100px / "a" [bottom];
3049
3050         * css/CSSParser.cpp:
3051         (WebCore::CSSParser::parseGridTemplateRowsAndAreasAndColumns):
3052         (WebCore::CSSParser::parseGridTemplateShorthand):
3053
3054 2016-02-23  Nikos Andronikos  <nikos.andronikos-webkit@cisra.canon.com.au>
3055
3056         [SVG] Update SVG source to return string literals as ASCIILiteral and add test cases for case sensitivity
3057         https://bugs.webkit.org/show_bug.cgi?id=154373
3058
3059         Reviewed by Youenn Fablet.
3060
3061         Update SVGAnimatedEnumeration toString method to return ASCIILiteral for string literals and add test cases for
3062         case-sensitivity for these elements.
3063
3064         Test: svg/dom/SVGAnimatedEnumeration-case-sensitive.html
3065
3066         * svg/SVGComponentTransferFunctionElement.h:
3067         (WebCore::SVGPropertyTraits<ComponentTransferType>::toString):
3068         * svg/SVGFEBlendElement.h:
3069         (WebCore::SVGPropertyTraits<BlendMode>::toString):
3070         * svg/SVGFEColorMatrixElement.h:
3071         (WebCore::SVGPropertyTraits<ColorMatrixType>::toString):
3072         * svg/SVGFECompositeElement.h:
3073         (WebCore::SVGPropertyTraits<CompositeOperationType>::toString):
3074         * svg/SVGFEConvolveMatrixElement.h:
3075         (WebCore::SVGPropertyTraits<EdgeModeType>::toString):
3076         * svg/SVGFEDisplacementMapElement.h:
3077         (WebCore::SVGPropertyTraits<ChannelSelectorType>::toString):
3078         * svg/SVGFEMorphologyElement.h:
3079         (WebCore::SVGPropertyTraits<MorphologyOperatorType>::toString):
3080         * svg/SVGFETurbulenceElement.h:
3081         (WebCore::SVGPropertyTraits<SVGStitchOptions>::toString):
3082         (WebCore::SVGPropertyTraits<TurbulenceType>::toString):
3083         * svg/SVGGradientElement.h:
3084         (WebCore::SVGPropertyTraits<SVGSpreadMethodType>::toString):
3085         * svg/SVGMarkerElement.h:
3086         (WebCore::SVGPropertyTraits<SVGMarkerUnitsType>::toString):
3087         * svg/SVGTextContentElement.h:
3088         (WebCore::SVGPropertyTraits<SVGLengthAdjustType>::toString):
3089         * svg/SVGTextPathElement.h:
3090         (WebCore::SVGPropertyTraits<SVGTextPathMethodType>::toString):
3091         (WebCore::SVGPropertyTraits<SVGTextPathSpacingType>::toString):
3092         * svg/SVGUnitTypes.h:
3093         (WebCore::SVGPropertyTraits<SVGUnitTypes::SVGUnitType>::toString):
3094
3095 2016-02-23  Csaba Osztrogonác  <ossy@webkit.org>
3096
3097         [Mac][cmake] Unreviewed speculative buildfix after r196779. Just for fun.
3098
3099         * PlatformMac.cmake:
3100
3101 2016-02-23  Antti Koivisto  <antti@apple.com>
3102
3103         Remove tab suspension code
3104         https://bugs.webkit.org/show_bug.cgi?id=154585
3105
3106         Reviewed by Andreas Kling.
3107
3108         It causes too many problems.
3109
3110         * page/Page.cpp:
3111         (WebCore::networkStateChanged):
3112         (WebCore::Page::Page):
3113         (WebCore::Page::setPageActivityState):
3114         (WebCore::Page::setIsVisible):
3115         (WebCore::Page::setIsVisibleInternal):
3116         (WebCore::Page::setIsPrerender):
3117         (WebCore::Page::setResourceUsageOverlayVisible):
3118         (WebCore::Page::canTabSuspend): Deleted.
3119         (WebCore::Page::setIsTabSuspended): Deleted.
3120         (WebCore::Page::setTabSuspensionEnabled): Deleted.
3121         (WebCore::Page::updateTabSuspensionState): Deleted.
3122         (WebCore::Page::tabSuspensionTimerFired): Deleted.
3123         * page/Page.h:
3124         (WebCore::Page::setEditable):
3125         (WebCore::Page::isEditable):
3126         (WebCore::Page::setShowAllPlugins):
3127
3128 2016-02-23  Youenn Fablet  <youenn.fablet@crf.canon.fr>
3129
3130         Refactor DOM Iterator next signature
3131         https://bugs.webkit.org/show_bug.cgi?id=154531
3132
3133         Reviewed by Myles C. Maxfield.
3134
3135         Covered by existing tests.
3136
3137         * Modules/fetch/FetchHeaders.cpp:
3138         (WebCore::FetchHeaders::Iterator::next): Using Optional<KeyValuePair> to return iterator value.
3139         * Modules/fetch/FetchHeaders.h:
3140         * bindings/js/JSKeyValueIterator.h: Using Optional<KeyValuePair> as returned iterator value.
3141         (WebCore::keyValueIteratorForEach):
3142         (WebCore::JSKeyValueIterator<JSWrapper>::next):
3143         * css/FontFaceSet.cpp:
3144         (WebCore::FontFaceSet::Iterator::next): Using Optional<KeyValuePair> to return iterator value.
3145         * css/FontFaceSet.h:
3146
3147 2016-02-22  Gavin Barraclough  <barraclough@apple.com>
3148
3149         Some timer alignment cleanup.
3150         https://bugs.webkit.org/show_bug.cgi?id=154559
3151
3152         Reviewed by Chris Dumez.
3153
3154         Document shouldn't override Page's timer alignment policy with a lower alignment,
3155         and m_domTimerAlignmentInterval isn't really a Settings, it's just the current state
3156         for the page.
3157
3158         * dom/Document.cpp:
3159         (WebCore::Document::timerAlignmentInterval):
3160             - take the max of the possible intervals.
3161         * page/Page.cpp:
3162         (WebCore::Page::Page):
3163         (WebCore::Page::setTimerThrottlingEnabled):
3164         (WebCore::Page::setDOMTimerAlignmentInterval):
3165             - moved here from Settings.
3166         * page/Page.h:
3167         (WebCore::Page::domTimerAlignmentInterval):
3168             - moved here from Settings.
3169         * page/Settings.cpp:
3170         (WebCore::Settings::setDOMTimerAlignmentInterval): Deleted.
3171             - moved to Page.
3172         * page/Settings.h:
3173         (WebCore::Settings::domTimerAlignmentInterval): Deleted.
3174             - moved to Page.
3175
3176 2016-02-22  Myles C. Maxfield  <mmaxfield@apple.com>
3177
3178         Font features specified in @font-face blocks don't apply to local() families
3179         https://bugs.webkit.org/show_bug.cgi?id=154554
3180
3181         Reviewed by Dean Jackson.
3182
3183         The correct variables just need to be wired up. In addition, our caches need to be sensitive
3184         to the new data.
3185
3186         Test: css3/font-feature-font-face-local.html
3187
3188         * css/CSSFontFaceSource.cpp:
3189         (WebCore::CSSFontFaceSource::font):
3190         * platform/graphics/FontCache.cpp:
3191         (WebCore::FontPlatformDataCacheKey::FontPlatformDataCacheKey):
3192         (WebCore::FontPlatformDataCacheKey::operator==):
3193         (WebCore::FontPlatformDataCacheKeyHash::hash):
3194         (WebCore::FontCache::getCachedFontPlatformData):
3195         (WebCore::FontCache::fontForFamily):
3196         * platform/graphics/FontCache.h:
3197         * platform/graphics/FontFeatureSettings.h:
3198         (WebCore::FontFeature::operator!=):
3199         (WebCore::FontFeatureSettings::operator!=):
3200         * platform/graphics/cocoa/FontCacheCoreText.cpp:
3201         (WebCore::fontWithFamily):
3202         (WebCore::FontCache::createFontPlatformData):
3203         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
3204         (WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
3205         * platform/graphics/mac/FontCacheMac.mm:
3206         (WebCore::FontCache::lastResortFallbackFont):
3207         * platform/text/TextFlags.h:
3208         (WebCore::FontVariantSettings::operator==):
3209         (WebCore::FontVariantSettings::operator!=):
3210         (WebCore::FontVariantSettings::uniqueValue):
3211
3212 2016-02-22  Daniel Bates  <dabates@apple.com>
3213
3214         REGRESSION (r196892): Crash in DocumentLoader::startLoadingMainResource()
3215         https://bugs.webkit.org/show_bug.cgi?id=154563
3216         <rdar://problem/24780678>
3217
3218         Reviewed by Alexey Proskuryakov.
3219
3220         Fixes an issue where the provisional loader may be deallocated when starting
3221         a load. One example where this can occur is when cancelling the provisional load
3222         as part of a form submission because the Content Security Policy of the page
3223         blocks the submission (it violates the directive form-action).
3224
3225         This crash is covered by the test http/tests/security/contentSecurityPolicy/1.1/form-action-src-blocked.html.
3226
3227         * loader/DocumentLoader.cpp:
3228         (WebCore::DocumentLoader::startLoadingMainResource): Take a ref before calling
3229         DocumentLoader::willSendRequest().
3230
3231 2016-02-16  Ada Chan  <adachan@apple.com>
3232
3233         Implement basic functionality in WebVideoFullscreenInterfaceMac.
3234         https://bugs.webkit.org/show_bug.cgi?id=153241
3235
3236         Reviewed by Beth Dakin.
3237
3238         * platform/cocoa/WebVideoFullscreenInterface.h:
3239         * platform/mac/WebVideoFullscreenInterfaceMac.h:
3240         * platform/mac/WebVideoFullscreenInterfaceMac.mm:
3241         (WebCore::WebVideoFullscreenInterfaceMac::setupFullscreen):
3242         (WebCore::WebVideoFullscreenInterfaceMac::enterFullscreen):
3243         (WebCore::WebVideoFullscreenInterfaceMac::exitFullscreen):
3244         (WebCore::WebVideoFullscreenInterfaceMac::cleanupFullscreen):
3245         (WebCore::WebVideoFullscreenInterfaceMac::invalidate):
3246         (WebCore::WebVideoFullscreenInterfaceMac::preparedToReturnToInline):
3247
3248 2016-02-22  Chris Dumez  <cdumez@apple.com>
3249
3250         REGRESSION (r196563): Images not loading on https://klim.co.nz/blog/paypal-sans-design-information/
3251         https://bugs.webkit.org/show_bug.cgi?id=154547
3252         <rdar://problem/24772167>
3253
3254         Reviewed by Gavin Barraclough.
3255
3256         The Website was doing the following:
3257         $ var e = window.addEventListener;
3258         $ e("eventname", handler)
3259
3260         In such case, the jsEventTargetPrototypeFunctionDispatchEvent() bindings
3261         implementation was caused with a thisValue which is a JSLexicalEnvironment
3262         and the implementation did not know how to convert it into a global object.
3263         The previous implementation on JSDOMWindow used to handle tis correctly
3264         because it was always calling JSValue::toThis() on the thisValue before
3265         trying to cast it to a JSDOMWindow, and JSLexicalEnvironment::toThis()
3266         gets the globalThisValue. This patch updates the EventTarget bindings
3267         code to call always call toThis() on the thisValue before trying to
3268         cast it. This should correctly deal with JSLexicalEnvironment and be a
3269         no-op in usual cases.
3270
3271         No new tests, extended existing test.
3272
3273         * bindings/scripts/CodeGeneratorJS.pm:
3274         (GenerateFunctionCastedThis):
3275
3276 2016-02-22  Simon Fraser  <simon.fraser@apple.com>
3277
3278         Repeated background images have the wrong position when using bottom/right-relative background-position
3279         https://bugs.webkit.org/show_bug.cgi?id=154478
3280
3281         Reviewed by Dave Hyatt.
3282
3283         Fix RenderBoxModelObject::calculateBackgroundImageGeometry() to use the right position when
3284         painting repeated background images when right/bottom edges are used.
3285
3286         Also rename BackgroundEdgeOrigin to Edge
3287
3288         Test: fast/images/background-position.html
3289
3290         * css/CSSPrimitiveValueMappings.h:
3291         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
3292         (WebCore::CSSPrimitiveValue::operator Edge):
3293         (WebCore::CSSPrimitiveValue::operator BackgroundEdgeOrigin): Deleted.
3294         * rendering/RenderBoxModelObject.cpp:
3295         (WebCore::resolveEdgeRelativeLength):
3296         (WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry):
3297         * rendering/style/FillLayer.cpp:
3298         (WebCore::FillLayer::FillLayer):
3299         * rendering/style/FillLayer.h:
3300         (WebCore::FillLayer::backgroundXOrigin):
3301         (WebCore::FillLayer::backgroundYOrigin):
3302         (WebCore::FillLayer::setBackgroundXOrigin):
3303         (WebCore::FillLayer::setBackgroundYOrigin):
3304         * rendering/style/RenderStyleConstants.cpp:
3305         (WebCore::operator<<):
3306         * rendering/style/RenderStyleConstants.h:
3307
3308 2016-02-22  Commit Queue  <commit-queue@webkit.org>
3309
3310         Unreviewed, rolling out r196935.
3311         https://bugs.webkit.org/show_bug.cgi?id=154557
3312
3313         This change causes timeouts and crashes in LayoutTests
3314         (Requested by ryanhaddad on #webkit).
3315
3316         Reverted changeset:
3317
3318         "Enable AVFoundationNSURLSessionEnabled by default"
3319         https://bugs.webkit.org/show_bug.cgi?id=154469
3320         http://trac.webkit.org/changeset/196935
3321
3322 2016-02-22  Myles C. Maxfield  <mmaxfield@apple.com>
3323
3324         [Font Loading] Split CSSFontSelector into a FontFaceSet implementation and the rest of the class
3325         https://bugs.webkit.org/show_bug.cgi?id=153347
3326
3327         Reviewed by Antti Koivisto.
3328
3329         This patch implements the document.fonts Javascript object. It does so by briding the
3330         already-existing FontFaceSet Javascript object with the CSSFontSelector WebCore object.
3331         CSSFontSelector used to hold internal objects for each @font-face object in the
3332         Document. These objects have been moved into CSSFontFaceSet, so CSSFontSelector simply
3333         just owns an instance of a CSSFontFaceSet.
3334
3335         The lifetime of the FontFace and FontFaceSet objects is a little interesting: because
3336         all the ownership references are inside the WebCore CSSFontFace{,Set} objects, the
3337         higher-level Javascript FontFace{,Set} objects are held through a WeakPtr. This means
3338         that if all the references to these higher-level objects go away, and you re-query the
3339         document for its FontFace objects, you may get a new object (albeit with the same
3340         state as a previous object). However, this won't occur if there are any references to
3341         the old object, which means it is almost not observable.
3342
3343         This patch doesn't implement the relationship between the CSSOM and the FontFace
3344         objects. Changing one should result in a change in the other, but that will be
3345         implemented in a forthcoming patch.
3346
3347         This patch also doesn't alter the lifetime of the CSSFontSelector, which means that all
3348         the Document's fonts may be destroyed and recreated from CSS. There are a few things
3349         which can trigger this. A subsequent patch will make the CSSFontSelector outlive the
3350         Document.
3351
3352         This patch does implement (and test) the ability to add a new FontFace to the Document
3353         to cause a relayout, as well as changing properties of existing FontFace objects already
3354         in the Document to cause a relayout.
3355
3356         Test: fast/text/font-face-set-document.html
3357
3358         * Modules/fetch/FetchHeaders.cpp:
3359         (WebCore::FetchHeaders::Iterator::next): Pass an extra argument.
3360         * Modules/fetch/FetchHeaders.h:
3361         * bindings/js/JSKeyValueIterator.h: The ExecState is necessary to build an external
3362         wrapper from an existing CSSFontFace object.
3363         (WebCore::JSKeyValueIterator<JSWrapper>::next):
3364         * css/CSSFontFace.cpp:
3365         (WebCore::CSSFontFace::appendSources): Moved from CSSFontSelector.
3366         (WebCore::CSSFontFace::CSSFontFace):
3367         (WebCore::CSSFontFace::notifyClientsOfFontPropertyChange):
3368         (WebCore::CSSFontFace::setFamilies):
3369         (WebCore::CSSFontFace::calculateStyle): Shared code between CSSFontFaceSet and
3370         CSSFontFace.
3371         (WebCore::CSSFontFace::setStyle): Update to use calculateStyle().
3372         (WebCore::CSSFontFace::calculateWeight): Ditto.
3373         (WebCore::CSSFontFace::setWeight): Update to use caculateWeight().
3374         (WebCore::CSSFontFace::setUnicodeRange): Notify clients.
3375         (WebCore::CSSFontFace::setVariantLigatures): Ditto.
3376         (WebCore::CSSFontFace::setVariantPosition): Ditto.
3377         (WebCore::CSSFontFace::setVariantCaps): Ditto.
3378         (WebCore::CSSFontFace::setVariantNumeric): Ditto.
3379         (WebCore::CSSFontFace::setVariantAlternates): Ditto.
3380         (WebCore::CSSFontFace::setVariantEastAsian): Ditto.
3381         (WebCore::CSSFontFace::setFeatureSettings): Ditto.
3382         (WebCore::CSSFontFace::removeClient):
3383         (WebCore::CSSFontFace::wrapper): Build a new wrapper if one doesn't already
3384         exist. Note that this requires an ExecState to create a promise.
3385         (WebCore::CSSFontFace::setStatus):
3386         (WebCore::CSSFontFace::fontLoaded):
3387         (WebCore::CSSFontFace::pump):
3388         (WebCore::CSSFontFace::font):
3389         * css/CSSFontFace.h:
3390         * css/CSSFontFaceSet.cpp:
3391         (WebCore::CSSFontFaceSet::CSSFontFaceSet): Moved code from CSSFontSelector.
3392         (WebCore::CSSFontFaceSet::~CSSFontFaceSet):
3393         (WebCore::CSSFontFaceSet::addClient): This object can now have multiple
3394         clients.
3395         (WebCore::CSSFontFaceSet::removeClient):
3396         (WebCore::CSSFontFaceSet::incrementActiveCount): Update for multiple clients.
3397         (WebCore::CSSFontFaceSet::decrementActiveCount): Ditto.
3398         (WebCore::CSSFontFaceSet::hasFace):
3399         (WebCore::CSSFontFaceSet::registerLocalFontFacesForFamily): Moved from
3400         CSSFontSelector.
3401         (WebCore::CSSFontFaceSet::familyNameFromPrimitive): Ditto.
3402         (WebCore::CSSFontFaceSet::addToFacesLookupTable): This helper function can
3403         be used when a property of a FontFace is changed.
3404         (WebCore::CSSFontFaceSet::add): Update to use addToFacesLookupTable().
3405         (WebCore::CSSFontFaceSet::removeFromFacesLookupTable): Same as
3406         addToFacesLookupTable().
3407         (WebCore::CSSFontFaceSet::remove): Update to use removeFromFacesLookupTable().
3408         (WebCore::CSSFontFaceSet::clear):
3409         (WebCore::CSSFontFaceSet::operator[]):
3410         (WebCore::computeFontTraitsMask): Moved from CSSFontSelector.
3411         (WebCore::CSSFontFaceSet::matchingFaces): Update to use new data structures.
3412         (WebCore::FontFaceComparator::FontFaceComparator): Moved from
3413         CSSFontSelector.
3414         (WebCore::FontFaceComparator::operator()):
3415         (WebCore::CSSFontFaceSet::getFontFace): Update to use new data structures.
3416         (WebCore::CSSFontFaceSet::fontStateChanged): Update to use multiple clients.
3417         (WebCore::CSSFontFaceSet::fontPropertyChanged): We must update our internal
3418         data structure if the family name changed.
3419         (WebCore::extractFamilies): Deleted.
3420         (WebCore::familiesIntersect): Deleted.
3421         (WebCore::CSSFontFaceSet::load): Deleted.
3422         (WebCore::CSSFontFaceSet::stateChanged): Deleted.
3423         * css/CSSFontFaceSet.h: Now needs to be RefCounted. New data structures are
3424         taken from CSSFontSelector.
3425         (WebCore::CSSFontFaceSetClient::faceFinished):
3426         (WebCore::CSSFontFaceSetClient::fontModified):
3427         (WebCore::CSSFontFaceSetClient::startedLoading):
3428         (WebCore::CSSFontFaceSetClient::completedLoading):
3429         * css/CSSFontFaceSource.h:
3430         * css/CSSFontSelector.cpp: Move code into CSSFontFaceSet.