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