dc008e6192875d4f5a496d8671d699d3d7a11c1d
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2016-10-17  Miguel Gomez  <magomez@igalia.com>
2
3         [GTK] Several tests crashing on debug bot in (anonymous namespace)::MediaPlayerPrivateGStreamerBase::repaint
4         https://bugs.webkit.org/show_bug.cgi?id=163511
5
6         Reviewed by Carlos Garcia Campos.
7
8         Perform the video repaint in the main thread when accelerated compositing is disabled.
9
10         Covered by existent tests.
11
12         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
13         (WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase):
14         (WebCore::MediaPlayerPrivateGStreamerBase::repaint):
15         (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
16         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
17
18 2016-10-17  Konstantin Tokarev  <annulen@yandex.ru>
19
20         Eleminate code duplication between ResourceRequest encoding/decoding implementations
21         https://bugs.webkit.org/show_bug.cgi?id=163507
22
23         Reviewed by Carlos Garcia Campos.
24
25         ResourceRequestBase::encodeWithoutPlatformData() and Soup implementation of
26         ArgumentCoder<ResourceRequest>::encodePlatformData() share most of the code,
27         ditto for decoding implementations.
28
29         No new tests needed.
30
31         * platform/network/ResourceRequestBase.h:
32         (WebCore::ResourceRequestBase::encodeBase):
33         (WebCore::ResourceRequestBase::decodeBase):
34         (WebCore::ResourceRequestBase::encodeWithoutPlatformData):
35         (WebCore::ResourceRequestBase::decodeWithoutPlatformData):
36         * platform/network/soup/ResourceRequest.h:
37         (WebCore::ResourceRequest::encodeWithPlatformData):
38         (WebCore::ResourceRequest::decodeWithPlatformData):
39
40 2016-10-17  Michael Catanzaro  <mcatanzaro@igalia.com>
41
42         Move user agent quirks to cross-platform location
43         https://bugs.webkit.org/show_bug.cgi?id=163508
44
45         Reviewed by Carlos Garcia Campos.
46
47         Tested by Tools/TestWebKitAPI/Tests/WebCore/UserAgentQuirks.cpp.
48
49         * PlatformGTK.cmake:
50         * platform/UserAgent.h: Renamed from Source/WebCore/platform/gtk/UserAgentGtk.h.
51         * platform/UserAgentQuirks.cpp: Added. Moved from UserAgentGtk.cpp.
52         (WebCore::urlRequiresChromeBrowser): Sneakily tighten up Google domain detection, it should
53         only apply to sites if the base domain matches google.*, not any base domain that starts
54         with google.
55         (WebCore::urlRequiresMacintoshPlatform):
56         (WebCore::UserAgentQuirks::quirksForURL):
57         (WebCore::UserAgentQuirks::stringForQuirk):
58         * platform/UserAgentQuirks.h: Moved from UserAgentGtk.cpp. prepare-ChangeLog thinks it was
59         renamed from Source/WebCore/platform/efl/UserAgentEfl.h, but prepare-ChangeLog is dumb.
60         (WebCore::UserAgentQuirks::UserAgentQuirks):
61         (WebCore::UserAgentQuirks::add):
62         (WebCore::UserAgentQuirks::contains):
63         (WebCore::UserAgentQuirks::isEmpty):
64         * platform/efl/UserAgentEfl.cpp:
65         (WebCore::standardUserAgentForURL):
66         * platform/gtk/UserAgentGtk.cpp:
67         (WebCore::buildUserAgentString):
68         (WebCore::standardUserAgentForURL):
69         (): Deleted.
70         (WebCore::UserAgentQuirks::UserAgentQuirks): Deleted.
71         (WebCore::UserAgentQuirks::add): Deleted.
72         (WebCore::UserAgentQuirks::contains): Deleted.
73         (WebCore::UserAgentQuirks::isEmpty): Deleted.
74         (WebCore::urlRequiresChromeBrowser): Deleted.
75         (WebCore::urlRequiresMacintoshPlatform): Deleted.
76
77 2016-10-17  Alberto Garcia  <berto@igalia.com>
78
79         [GTK] gobject-introspection on package build with webkit2gtk fails without active X session
80         https://bugs.webkit.org/show_bug.cgi?id=163105
81
82         Reviewed by Carlos Garcia Campos.
83
84         Don't call XCompositeQueryExtension() or XDamageQueryExtension()
85         if m_display is NULL.
86
87         * platform/graphics/x11/PlatformDisplayX11.cpp:
88         (WebCore::PlatformDisplayX11::supportsXComposite):
89         (WebCore::PlatformDisplayX11::supportsXDamage):
90
91 2016-10-16  Nan Wang  <n_wang@apple.com>
92
93         AX: [Mac] roleDescription for AXTextField input types
94         https://bugs.webkit.org/show_bug.cgi?id=163419
95         <rdar://problem/28766192>
96
97         Reviewed by Darin Adler.
98
99         Provided more detailed role description for input types that
100         exposed as standard text fields on the mac.
101
102         Changes are covered in modified test expectation.
103
104         * English.lproj/Localizable.strings:
105         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
106         (-[WebAccessibilityObjectWrapper roleDescription]):
107         * platform/LocalizedStrings.cpp:
108         (WebCore::AXEmailFieldText):
109         (WebCore::AXTelephoneFieldText):
110         (WebCore::AXURLFieldText):
111         (WebCore::AXDateFieldText):
112         (WebCore::AXTimeFieldText):
113         * platform/LocalizedStrings.h:
114         * platform/efl/LocalizedStringsEfl.cpp:
115         (WebCore::AXEmailFieldText):
116         (WebCore::AXTelephoneFieldText):
117         (WebCore::AXURLFieldText):
118         (WebCore::AXDateFieldText):
119         (WebCore::AXTimeFieldText):
120         * platform/gtk/LocalizedStringsGtk.cpp:
121         (WebCore::AXEmailFieldText):
122         (WebCore::AXTelephoneFieldText):
123         (WebCore::AXURLFieldText):
124         (WebCore::AXDateFieldText):
125         (WebCore::AXTimeFieldText):
126
127 2016-10-16  Chris Dumez  <cdumez@apple.com>
128
129         Update WebKit localizable strings
130         https://bugs.webkit.org/show_bug.cgi?id=163513
131
132         Reviewed by Dan Bernstein.
133
134         Update WebKit localizable strings as it was missing the "too short" one needed
135         by form validation. This was causing a "Localized string not found" message to
136         be shown when testing the following sample on WebKit ToT:
137         - https://googlechrome.github.io/samples/report-validity/
138
139         * English.lproj/Localizable.strings:
140
141 2016-10-16  Chris Dumez  <cdumez@apple.com>
142
143         REGRESSION (r206750): Crash when pressing Caps Lock if “Use the Caps Lock key to switch to and from U.S.” is selected in Input Sources preferences
144         https://bugs.webkit.org/show_bug.cgi?id=163506
145         <rdar://problem/28792483>
146
147         Reviewed by Darin Adler.
148
149         As per the NSEvent documentation [1], calling [NSEvent characters] is only
150         valid on key up / key down events and will raise an NSInternalInconsistencyException
151         if accessed on any other kind of event object. The crash happens when keyForKeyEvent()
152         is called with the third kind of key event (NSFlagsChanged) which is used for
153         detecting modifier keys. We normally detect the modifier key and return early before
154         calling [NSEvent characters]. However, in some rare cases, we fail to detect the
155         modifier key and we fall through.
156
157         To address the issue, we now return "Unidentified" for NSFlagsChanged events, if we
158         fail to detect the modifier key and before calling [NSEvent characters].
159
160         [1] https://developer.apple.com/reference/appkit/nsevent/1534183-characters
161
162         No new test, not easily testable.
163
164         * platform/mac/PlatformEventFactoryMac.mm:
165         (WebCore::keyForKeyEvent):
166
167 2016-10-16  Darin Adler  <darin@apple.com>
168
169         Move CSS classes from ExceptionCode to Exception
170         https://bugs.webkit.org/show_bug.cgi?id=163494
171
172         Reviewed by Sam Weinig.
173
174         Removed the "get" prefix from the names of many CSSPrimitiveValue
175         functions to match WebKit coding style and to disambiguate them
176         from the public CSS DOM functions that raise exceptions.
177
178         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
179         (WebCore::propertyNamePrefix): Use enum class.
180         (WebCore::parseJavaScriptCSSPropertyName): Tweak style a bit.
181         (WebCore::stylePropertyGetter): Refactor to simplify structure.
182         (WebCore::stylePropertyGetterPixelOrPosPrefix): Ditto. Also use floatValue.
183         (WebCore::JSCSSStyleDeclaration::putDelegate): Use findIgnoringASCIICase,
184         and use propagateException to handle ExcpetionOr.
185         (WebCore::JSCSSStyleDeclaration::getPropertyCSSValue): Tweak style a bit.
186         (WebCore::JSCSSStyleDeclaration::getOwnPropertyNames): Use a lambda to
187         initialize a global here.
188
189         * bindings/js/JSDOMBinding.h: Added toJSString to support bindings for
190         functions returning ExceptionOr<String>.
191
192         * bindings/scripts/gobject-generate-headers.pl: Deleted.
193
194         * css/BasicShapeFunctions.cpp:
195         (WebCore::convertToLengthSize): Use pairValue.
196         (WebCore::convertToCenterCoordinate): Use valueID and pairValue.
197         (WebCore::cssValueToBasicShapeRadius): Ditto.
198         * css/CSSBasicShapes.cpp:
199         (WebCore::serializePositionOffset): Ditto.
200         (WebCore::buildSerializablePositionOffset): Ditto.
201         (WebCore::CSSBasicShapeCircle::cssText): Ditto.
202         (WebCore::CSSBasicShapeEllipse::cssText): Ditto.
203         (WebCore::updateCornerRadiusWidthAndHeight): Ditto.
204         * css/CSSBorderImageSliceValue.h: Use quadValue.
205         * css/CSSCalculationValue.cpp:
206         (WebCore::determineCategory): Use floatValue and doubleValue.
207
208         * css/CSSCharsetRule.h: Use ExceptionOr. Also made more things private.
209         * css/CSSCharsetRule.idl: Use non-legacy exceptions.
210
211         * css/CSSComputedStyleDeclaration.cpp:
212         (WebCore::CSSComputedStyleDeclaration::setCssText): Use ExceptionOr.
213         (WebCore::ComputedStyleExtractor::propertyMatches): Use valueID.
214         (WebCore::CSSComputedStyleDeclaration::setProperty): Use ExceptionOr.
215         (WebCore::CSSComputedStyleDeclaration::removeProperty): Ditto.
216         (WebCore::CSSComputedStyleDeclaration::setPropertyInternal): Ditto.
217         (WebCore::ComputedStyleExtractor::getBackgroundShorthandValue): Return
218         a Ref instead of a RefPtr.
219         * css/CSSComputedStyleDeclaration.h: Updated for above changes.
220
221         * css/CSSCrossfadeValue.cpp:
222         (WebCore::CSSCrossfadeValue::fixedSize): Use floatValue.
223         (WebCore::CSSCrossfadeValue::image): Ditto.
224         (WebCore::CSSCrossfadeValue::blend): Use doubleValue.
225
226         * css/CSSFontFace.cpp:
227         (WebCore::CSSFontFace::calculateStyleMask): Use valueID.
228         (WebCore::CSSFontFace::calculateWeightMask): Ditto.
229         * css/CSSFontFaceSet.cpp:
230         (WebCore::CSSFontFaceSet::familyNameFromPrimitive): Ditto.
231         (WebCore::CSSFontFaceSet::matchingFaces): Use ExceptoinOr.
232         (WebCore::CSSFontFaceSet::check): Ditto.
233         * css/CSSFontFaceSet.h: Updated for above changes.
234
235         * css/CSSGradientValue.cpp:
236         (WebCore::compareStops): Use doubleValue.
237         (WebCore::CSSGradientValue::addStops): Use floatValue.
238         (WebCore::positionFromValue): Use floatValue and valudID.
239         (WebCore::CSSLinearGradientValue::customCSSText): Use doubleValue and valueID.
240         (WebCore::CSSLinearGradientValue::createGradient): Use floatValue and valueID.
241         (WebCore::CSSRadialGradientValue::customCSSText): Use doubleValue and valueID.
242         (WebCore::CSSRadialGradientValue::resolveRadius): Use floatValue.
243         (WebCore::CSSRadialGradientValue::createGradient): Use valueID.
244
245         * css/CSSGroupingRule.cpp:
246         (WebCore::CSSGroupingRule::insertRule): Use ExceptionOr.
247         (WebCore::CSSGroupingRule::deleteRule): Ditto.
248         * css/CSSGroupingRule.h: Updated for above changes.
249
250         * css/CSSImageGeneratorValue.cpp:
251         (WebCore::CSSImageGeneratorValue::subimageIsPending): Use valueID.
252         (WebCore::CSSImageGeneratorValue::cachedImageForCSSValue): Ditto.
253
254         * css/CSSImageSetValue.cpp:
255         (WebCore::CSSImageSetValue::fillImageSet): Use floatValue.
256
257         * css/CSSMediaRule.idl: Use non-legacy exceptions.
258
259         * css/CSSPrimitiveValue.cpp:
260         (WebCore::CSSPrimitiveValue::computeDegrees): Use doubleValue.
261         (WebCore::CSSPrimitiveValue::setFloatValue): Use ExceptionOr.
262         (WebCore::CSSPrimitiveValue::getFloatValue): Replaced getDoubleValue with this,
263         since getDoubleValue is unused, moving the call to clampTo into this function.
264         Also changed this to use ExceptionOr.
265         (WebCore::CSSPrimitiveValue::doubleValue): Renamed from getDoubleValue.
266         (WebCore::CSSPrimitiveValue::doubleValueInternal): Use Optional instead of a bool
267         and an out argument to return the value and check for type failure.
268         (WebCore::CSSPrimitiveValue::setStringValue): Use ExceptionOr.
269         (WebCore::CSSPrimitiveValue::getStringValue): Ditto.
270         (WebCore::CSSPrimitiveValue::stringValue): Renamed from getStringValue.
271         (WebCore::CSSPrimitiveValue::getCounterValue): Use ExceptionOr.
272         (WebCore::CSSPrimitiveValue::getRectValue): Use ExceptionOr.
273         (WebCore::CSSPrimitiveValue::getQuadValue): Deleted.
274         (WebCore::CSSPrimitiveValue::getLengthRepeatValue): Deleted.
275         (WebCore::CSSPrimitiveValue::getRGBColorValue): Use ExceptionOr.
276         (WebCore::CSSPrimitiveValue::getPairValue): Deleted.
277         (WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText): Use new names for functions.
278         * css/CSSPrimitiveValue.h: Reorganized the class, moved large inline function bodies
279         out of the class definition. Updated for the above changes.
280         * css/CSSPrimitiveValue.idl: Use non-legacy exceptions.
281
282         * css/CSSPrimitiveValueMappings.h: Use value instead of getValue, etc.
283
284         * css/CSSRule.cpp:
285         (WebCore::CSSRule::setCssText): Use ExceptionOr.
286         * css/CSSRule.h: Updated for above change.
287         * css/CSSRule.idl: Use non-legacy exceptions.
288
289         * css/CSSStyleDeclaration.h: Use ExceptionOr.
290         * css/CSSStyleDeclaration.idl: Use non-legacy exceptions.
291
292         * css/CSSStyleSheet.cpp:
293         (WebCore::CSSStyleSheet::deprecatedInsertRule): Use ExceptionOr.
294         (WebCore::CSSStyleSheet::insertRule): Ditto.
295         (WebCore::CSSStyleSheet::deleteRule): Ditto.
296         (WebCore::CSSStyleSheet::addRule): Ditto.
297         * css/CSSStyleSheet.h: Updated for the above changes.
298         * css/CSSStyleSheet.idl: Use non-legacy exceptions.
299
300         * css/CSSSupportsRule.idl: Use non-legacy exceptions.
301
302         * css/CSSToStyleMap.cpp:
303         (WebCore::CSSToStyleMap::mapFillAttachment): Use valueID instead of getValueID, etc.
304         (WebCore::convertToLengthSize): Ditto.
305         (WebCore::CSSToStyleMap::mapFillSize): Ditto.
306         (WebCore::CSSToStyleMap::mapFillXPosition): Ditto.
307         (WebCore::CSSToStyleMap::mapFillYPosition): Ditto.
308         (WebCore::CSSToStyleMap::mapFillMaskSourceType): Ditto.
309         (WebCore::CSSToStyleMap::mapAnimationDirection): Ditto.
310         (WebCore::CSSToStyleMap::mapAnimationFillMode): Ditto.
311         (WebCore::CSSToStyleMap::mapAnimationIterationCount): Ditto.
312         (WebCore::CSSToStyleMap::mapAnimationName): Ditto.
313         (WebCore::CSSToStyleMap::mapAnimationPlayState): Ditto.
314         (WebCore::CSSToStyleMap::mapAnimationProperty): Ditto.
315         (WebCore::CSSToStyleMap::mapAnimationTimingFunction): Ditto.
316         (WebCore::CSSToStyleMap::mapAnimationTrigger): Ditto.
317         (WebCore::CSSToStyleMap::mapNinePieceImageSlice): Ditto.
318         (WebCore::CSSToStyleMap::mapNinePieceImageQuad): Ditto.
319         (WebCore::CSSToStyleMap::mapNinePieceImageRepeat): Ditto.
320
321         * css/CSSValue.h: Use ExceptionOr.
322         * css/CSSValue.idl: Use non-legacy exceptions.
323
324         * css/Counter.h: Use stringValue instead of getStringValue, etc.
325
326         * css/FontFace.cpp:
327         (WebCore::FontFace::create): Use ExceptionOr.
328         (WebCore::FontFace::setFamily): Ditto.
329         (WebCore::FontFace::setStyle): Ditto.
330         (WebCore::FontFace::setWeight): Ditto.
331         (WebCore::FontFace::setStretch): Ditto.
332         (WebCore::FontFace::setUnicodeRange): Ditto.
333         (WebCore::FontFace::setVariant): Ditto.
334         (WebCore::FontFace::setFeatureSettings): Ditto.
335         * css/FontFace.h: Updated for above changes.
336         * css/FontFace.idl: Use non-legacy exceptions.
337
338         * css/FontFaceSet.cpp:
339         (WebCore::FontFaceSet::load): Use ExceptionOr.
340         (WebCore::FontFaceSet::check): Ditto.
341         * css/FontFaceSet.h: Updated for above changes.
342         * css/FontFaceSet.idl: Use non-legacy exceptions.
343
344         * css/FontVariantBuilder.cpp:
345         (WebCore::extractFontVariantLigatures): Use valueID instead of getValueID, etc.
346         (WebCore::extractFontVariantNumeric): Ditto.
347         (WebCore::extractFontVariantEastAsian): Ditto.
348
349         * css/MediaList.cpp:
350         (WebCore::MediaList::setMediaText): Use ExceptionOr.
351         (WebCore::MediaList::deleteMedium): Ditto.
352         (WebCore::MediaList::appendMedium): Ditto.
353         * css/MediaList.h: Updated for above changes.
354         * css/MediaList.idl: Use non-legacy exceptions.
355
356         * css/MediaQueryEvaluator.cpp:
357         (WebCore::doubleValue): Use valueID instead of getValueID, etc.
358         (WebCore::colorGamutEvaluate): Ditto.
359         (WebCore::invertedColorsEvaluate): Ditto.
360         (WebCore::orientationEvaluate): Ditto.
361         (WebCore::evaluateResolution): Ditto.
362         (WebCore::computeLength): Ditto.
363         (WebCore::viewModeEvaluate): Ditto.
364         (WebCore::hoverEvaluate): Ditto.
365         (WebCore::pointerEvaluate): Ditto.
366         (WebCore::prefersReducedMotionEvaluate): Ditto.
367
368         * css/PropertySetCSSStyleDeclaration.cpp:
369         (WebCore::PropertySetCSSStyleDeclaration::setCssText): Use ExceptionOr.
370         (WebCore::PropertySetCSSStyleDeclaration::setProperty): Ditto.
371         (WebCore::PropertySetCSSStyleDeclaration::removeProperty): Ditto.
372         (WebCore::PropertySetCSSStyleDeclaration::getPropertyCSSValueInternal): Ditto.
373         (WebCore::PropertySetCSSStyleDeclaration::setPropertyInternal): Ditto.
374         * css/PropertySetCSSStyleDeclaration.h: Updated for above changes.
375         Also marked a couple additional functions private.
376
377         * css/StyleBuilderConverter.h: Use doubleValue instead of getDoubleValue, etc.
378         * css/StyleBuilderCustom.h: Ditto.
379         * css/StyleProperties.cpp:
380         (WebCore::StyleProperties::getLayeredShorthandValue): Ditto.
381         * css/StyleResolver.cpp:
382         (WebCore::StyleResolver::MatchResult::addMatchedProperties): Ditto.
383         (WebCore::StyleResolver::colorFromPrimitiveValueIsDerivedFromElement): Ditto.
384         (WebCore::StyleResolver::colorFromPrimitiveValue): Ditto.
385         (WebCore::StyleResolver::createFilterOperations): Ditto.
386         * css/TransformFunctions.cpp:
387         (WebCore::transformsForValue): Ditto.
388         * css/ViewportStyleResolver.cpp:
389         (WebCore::ViewportStyleResolver::getViewportArgumentValue): Ditto.
390
391         * css/WebKitCSSMatrix.cpp:
392         (WebCore::WebKitCSSMatrix::WebKitCSSMatrix): Tweaked constructors a bit,
393         getting rid of the one that uses an ExceptionCode.
394         (WebCore::WebKitCSSMatrix::create): Moved in here, and use ExceptionOr.
395         (WebCore::WebKitCSSMatrix::setMatrixValue): Use ExceptionOr.
396         (WebCore::WebKitCSSMatrix::multiply): Tweak coding style a bit.
397         (WebCore::WebKitCSSMatrix::inverse): Use ExceptionOr.
398         (WebCore::WebKitCSSMatrix::translate): Return a Ref instead of RefPtr.
399         (WebCore::WebKitCSSMatrix::scale): Ditto.
400         (WebCore::WebKitCSSMatrix::rotate): Ditto.
401         (WebCore::WebKitCSSMatrix::rotateAxisAngle): Ditto.
402         (WebCore::WebKitCSSMatrix::skewX): Ditto.
403         (WebCore::WebKitCSSMatrix::skewY): Ditto.
404         (WebCore::WebKitCSSMatrix::toString): Tweaked formatting a bit.
405         * css/WebKitCSSMatrix.h: Updated for above changes.
406         * css/WebKitCSSMatrix.idl: Use non-legacy extensions.
407
408         * css/makeprop.pl:
409         (handleCurrentColorValue): Use valueID instead of getValueID.
410         (generateValueSetter): Ditto.
411
412         * css/parser/CSSParser.cpp:
413         (WebCore::CSSParser::parse4ValuesFillPosition): Use valueID instead of getValueID, etc.
414         (WebCore::CSSParser::parse3ValuesFillPosition): Ditto.
415         (WebCore::CSSParser::parseFillPosition): Ditto.
416         (WebCore::CSSParser::parseFillRepeat): Ditto.
417         (WebCore::CSSParser::parseGridPosition): Ditto.
418         (WebCore::CSSParser::parseGridTemplateRowsAndAreasAndColumns): Ditto.
419         (WebCore::isGridTrackFixedSized): Ditto.
420         (WebCore::CSSParser::parseRadialGradient): Ditto.
421         (WebCore::CSSParser::parseBuiltinFilterArguments): Ditto.
422
423         * css/parser/CSSParserValues.cpp:
424         (WebCore::CSSParserValue::createCSSValue): Removed the unneeded call to
425         setPrimitiveType here. The createParserOperator returns an object that
426         already has the correct primitive type.
427
428         * css/parser/CSSPropertyParser.cpp: Updated most cases of calling the old
429         getXXXValue functions, but not sure if it's right since it is commented out
430         code that I did not compile.
431
432         * css/parser/CSSPropertyParserHelpers.cpp:
433         (WebCore::CSSPropertyParserHelpers::clampRGBComponent): Use intValue instead of getIntValue, etc.
434         (WebCore::CSSPropertyParserHelpers::parseHSLParameters): Ditto.
435         (WebCore::CSSPropertyParserHelpers::isHorizontalPositionKeywordOnly): Ditto.
436         (WebCore::CSSPropertyParserHelpers::isVerticalPositionKeywordOnly): Ditto.
437         (WebCore::CSSPropertyParserHelpers::positionFromThreeOrFourValues): Ditto.
438         (WebCore::CSSPropertyParserHelpers::consumeRadialGradient): Ditto.
439
440         * dom/Range.cpp: Added now-needed include of ExceptionCode.h.
441         * dom/SelectorQuery.cpp: Ditto.
442
443         * editing/ApplyStyleCommand.cpp:
444         (WebCore::toIdentifier): Use valueID instead of getValueID, etc.
445         (WebCore::ApplyStyleCommand::computedFontSize): Ditto.
446         * editing/EditingStyle.cpp:
447         (WebCore::identifierForStyleProperty): Ditto.
448         (WebCore::HTMLElementEquivalent::valueIsPresentInStyle): Ditto.
449         (WebCore::EditingStyle::extractFontSizeDelta): Ditto.
450         (WebCore::EditingStyle::textDirection): Ditto.
451         (WebCore::EditingStyle::prepareToApplyAt): Ditto.
452         (WebCore::EditingStyle::textDirectionForSelection): Ditto.
453         (WebCore::fontWeightIsBold): Ditto.
454         (WebCore::legacyFontSizeFromCSSValue): Ditto.
455         (WebCore::isTransparentColorValue): Ditto.
456         (WebCore::hasTransparentBackgroundColor): Ditto.
457         (WebCore::backgroundColorInEffect): Ditto.
458
459         * editing/Editor.cpp:
460         (WebCore::Editor::applyEditingStyleToElement): Removed IGNORE_EXCEPTION; that is
461         what we do by default for things returning ExceptionOr.
462         * editing/RemoveCSSPropertyCommand.cpp:
463         (WebCore::RemoveCSSPropertyCommand::doApply): Ditto.
464         (WebCore::RemoveCSSPropertyCommand::doUnapply): Ditto.
465         * editing/ReplaceSelectionCommand.cpp:
466         (WebCore::ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline): Ditto.
467
468         * editing/cocoa/HTMLConverter.mm:
469         (floatValueFromPrimitiveValue): Use floatValue instead of getFloatValue, etc.
470         * editing/markup.cpp:
471         (WebCore::propertyMissingOrEqualToNone): Ditto.
472
473         * inspector/InspectorStyleSheet.cpp:
474         (WebCore::InspectorStyleSheet::addRule): Updated to call ExceptionOr-returning functions.
475         (WebCore::InspectorStyleSheet::deleteRule): Ditto.
476         (WebCore::InspectorStyleSheet::setStyleText): Ditto.
477
478         * svg/SVGLength.cpp:
479         (WebCore::SVGLength::fromCSSPrimitiveValue): Use floatValue instead of getFloatValue.
480
481 2016-10-16  Antoine Quint  <graouts@apple.com>
482
483         [Modern Media Controls] Styles for StartButton are missing
484         https://bugs.webkit.org/show_bug.cgi?id=163499
485         <rdar://problem/28792009>
486
487         Reviewed by Darin Adler.
488
489         Add styling for StartButton so that instances are always displayed in the center of their container.
490
491         Test: media/modern-media-controls/start-button/start-button-styles.html
492
493         * Modules/modern-media-controls/controls/start-button.css: Added.
494         (button.start):
495         (button.start > *):
496         (button.start > div):
497         (button.start > img):
498         (button.start:active > img):
499
500 2016-10-16  Simon Fraser  <simon.fraser@apple.com>
501
502         Implement serializer = { attribute }
503         https://bugs.webkit.org/show_bug.cgi?id=163466
504         
505         Follow-up fix to die if "serializer {...}" lists an attribute not present
506         on the interface. I don't think this is testable with the current bindings tests.
507
508         * bindings/scripts/CodeGeneratorJS.pm:
509         (GenerateSerializerFunction):
510
511 2016-10-16  Simon Fraser  <simon.fraser@apple.com>
512
513         Add the "Geometry Interfaces" to features.json.
514
515         * features.json:
516
517 2016-10-16  Carlos Garcia Campos  <cgarcia@igalia.com>
518
519         Document request not updated after willSendRequest is called for a redirect
520         https://bugs.webkit.org/show_bug.cgi?id=163436
521
522         Reviewed by Michael Catanzaro.
523
524         The first willSendRequest happens before DocumentLoader::startLoadingMainResource(), that calls setRequest, but
525         the second one happens after DocumentLoader::redirectReceived() and then the request is never updated again.
526
527         Covered by GTK+ unit tests.
528
529         * loader/DocumentLoader.cpp:
530         (WebCore::DocumentLoader::willContinueMainResourceLoadAfterRedirect): Set the new request.
531         * loader/DocumentLoader.h:
532         * loader/SubresourceLoader.cpp:
533         (WebCore::SubresourceLoader::willSendRequestInternal): Notify the document loader when loading the main resource
534         and called for a redirection.
535
536 2016-10-15  Said Abou-Hallawa  <sabouhallawa@apple.com>
537
538         Delete the animated image catchup code
539         https://bugs.webkit.org/show_bug.cgi?id=163410
540
541         Reviewed by Simon Fraser.
542
543         This patch fixes two issues in the animated image workflow:
544
545         1) Setting the animation timer should follow the following rules:
546         
547             -- Initial case: Which happens before drawing the first frame. We
548             should set the timer to fire after the current_frame_duration.
549
550             -- Late case (Slow animation): This happens if the current_time is
551             past the next_frame_desired_time. In this case we should fire the
552             timer immediately.
553
554             -- Early case (Fast animation): This happens when there is still time
555             before the next_frame_desired_time. In this case we should set the
556             timer to fire after the difference between the next_frame_desired_time
557             and the current_time.
558
559         2) Deleting the code for catching up the current_frame:
560         
561             This code used to run in the slow animation case. It was never used
562             on iOS. It was trying to adjust the current_frame according to the
563             current_time as if there were no delay. It turned out that this might
564             cause a bigger delay because most likely the decoder decodes the image
565             frames incrementally; i.e. to decode frame k, it has to have frame
566             (k - 1) decoded.
567
568         Test: fast/images/ordered-animated-image-frames.html
569
570         * platform/graphics/BitmapImage.cpp:
571         (WebCore::BitmapImage::draw): Remove the iOS specific code.
572         (WebCore::BitmapImage::startAnimation): Move the animation finishing code from 
573         BitmapImage::internalAdvanceAnimation() to this function. Simplify the timer
574         duration code as it is described above.
575
576         (WebCore::BitmapImage::advanceAnimation): Merge BitmapImage::internalAdvanceAnimation()
577         into this function.
578
579         (WebCore::BitmapImage::resetAnimation):
580         
581         (WebCore::BitmapImage::internalAdvanceAnimation): Deleted.
582         * platform/graphics/BitmapImage.h:
583
584         * platform/graphics/Image.cpp:
585         (WebCore::Image::drawTiled):
586         * platform/graphics/Image.h:
587         (WebCore::Image::startAnimation):
588         * svg/graphics/SVGImage.cpp:
589         (WebCore::SVGImage::startAnimation):
590         * svg/graphics/SVGImage.h:
591         Remove the catchup code form the Image and SVGImage classes.
592
593 2016-10-15  Darin Adler  <darin@apple.com>
594
595         Move Web SQL database and WebSockets off legacy exceptions
596         https://bugs.webkit.org/show_bug.cgi?id=163284
597
598         Reviewed by Chris Dumez.
599
600         * Modules/webdatabase/DOMWindowWebDatabase.cpp:
601         (WebCore::DOMWindowWebDatabase::openDatabase): Use ExceptionOr.
602         * Modules/webdatabase/DOMWindowWebDatabase.h: Update for above.
603         * Modules/webdatabase/DOMWindowWebDatabase.idl: Ditto.
604
605         * Modules/webdatabase/SQLResultSet.cpp:
606         (WebCore::SQLResultSet::SQLResultSet): Move initialization of
607         many data members into the class definition.
608         (WebCore::SQLResultSet::insertId): Use ExceptionOr.
609         (WebCore::SQLResultSet::rowsAffected): Moved into class definition.
610         (WebCore::SQLResultSet::rows): Ditto.
611         (WebCore::SQLResultSet::setInsertId): Ditto.
612         (WebCore::SQLResultSet::setRowsAffected): Ditto.
613
614         * Modules/webdatabase/SQLResultSet.h: Updated for above.
615
616         * Modules/webdatabase/SQLResultSet.idl: Use non-legacy exceptions.
617         Added a FIXME about the mismatch between long and int64_t.
618
619         * Modules/webdatabase/SQLStatement.cpp:
620         (WebCore::SQLStatement::execute): Use reference instead of pointer.
621
622         * Modules/websockets/WebSocket.cpp:
623         (WebCore::isValidProtocolString): Use StringView.
624         (WebCore::WebSocket::subprotocolSeparator): Fixed capitalization and
625         spelling error in the name of this function.
626         (WebCore::WebSocket::WebSocket): Move initialization of many data
627         members into the class definition.
628         (WebCore::WebSocket::create): Use ExceptionOr.
629         (WebCore::WebSocket::connect): Ditto.
630         (WebCore::WebSocket::send): Ditto.
631         (WebCore::WebSocket::close): Ditto.
632         (WebCore::WebSocket::binaryType): Update to use enum class.
633         (WebCore::WebSocket::setBinaryType): Use ExecptionOr and update to
634         use enum class.
635         (WebCore::WebSocket::didReceiveBinaryData): Ditto.
636
637         * Modules/websockets/WebSocket.h: Updated for above. Changed the
638         BinaryType enum into an enum class.
639
640         * Modules/websockets/WebSocket.idl: Use non-legacy exceptions.
641
642         * Modules/websockets/WebSocketHandshake.cpp:
643         (WebCore::WebSocketHandshake::checkResponseHeaders):
644         Updated for name change to subprotocolSeparator.
645
646         * dom/ExceptionOr.h: Added a constructor for scalar types that does not
647         require an rvalue reference. We can refine this more later, but for now
648         this is sufficient to obviate the need for WTFMove where it otherwise would
649         have been needed in the code above.
650
651         * inspector/InspectorDatabaseAgent.cpp: Use reference instead of pointer.
652
653         * page/DOMWindow.idl: Touched this file to work around bugs in the dependency
654         analysis of the current CMake build system, since otherwise it doesn't process the
655         change to the partial interface WebSocket. Edited lots of comments, removed many
656         others, and tweaked formatting.
657
658 2016-10-14  Sam Weinig  <sam@webkit.org>
659
660         MessageEvent's source property should be a (DOMWindow or MessagePort)? rather than a EventTarget?
661         https://bugs.webkit.org/show_bug.cgi?id=163475
662
663         Reviewed by Simon Fraser.
664
665         Start fleshing out union support, starting with MessageEvent.
666         - Simplify things a bit for now by requiring interface types to use RefPtr<T> as their type when
667           used in sequences and unions. We should revisit this later, and see if we can use Ref<T> where
668           possible, but it causes complications for dictionaries, since they want a Ref<T> uninitialized.
669
670         * bindings/generic/IDLTypes.h:
671         Switch IDLInterface to use RefPtr<T> as its implementation type.
672
673         * bindings/js/JSDOMConvert.h:
674         (WebCore::Detail::VariadicConverterBase::convert):
675         - Remove isJSDOMWrapperType() optimization. It was not correct, due to not being able to detect window
676           and window shell, and not always an optimization, e.g. in the case of a single interface.
677         - Switch from JSC::jsDynamicCast<WrapperType*>() to WrapperType::toWrapped() which can be faster and
678           handles window and window shell correctly.
679         - Also fix an issue where we would wrongly assert that one interface had to match.
680
681         * bindings/js/JSDOMWrapper.h:
682         (WebCore::isJSDOMWrapperType): Deleted.
683         Remove unused predicate.
684
685         * bindings/scripts/IDLParser.pm:
686         (parseType):
687         Add missing support for nullable unions.
688
689         * bindings/scripts/test/JS/JSTestObj.cpp:
690         * bindings/scripts/test/TestObj.idl:
691         Add new tests for unions (both non-null and nullable) in dictionaries.
692  
693         * dom/ContainerNode.cpp:
694         (WebCore::ContainerNode::append):
695         (WebCore::ContainerNode::prepend):
696         * dom/ContainerNode.h:
697         * dom/Node.cpp:
698         (WebCore::nodeSetPreTransformedFromNodeOrStringVector):
699         (WebCore::Node::convertNodesOrStringsIntoNode):
700         (WebCore::Node::before):
701         (WebCore::Node::after):
702         (WebCore::Node::replaceWith):
703         * dom/Node.h:
704         Add using declaration for NodeOrString and change it to use RefPtr<Node>.
705
706         * bindings/js/JSMessageEventCustom.cpp:
707         (WebCore::handleInitMessageEvent):
708         * dom/MessageEvent.cpp:
709         (WebCore::MessageEvent::MessageEvent):
710         (WebCore::MessageEvent::create):
711         (WebCore::MessageEvent::initMessageEvent):
712         (WebCore::MessageEvent::source):
713         (WebCore::isValidSource): Deleted.
714         * dom/MessageEvent.h:
715         * dom/MessageEvent.idl:
716         * page/DOMWindow.cpp:
717         (WebCore::PostMessageTimer::event):
718         Change MessageEvent's source to be a std::experimental::variant<RefPtr<DOMWindow>, RefPtr<MessagePort>>.
719         For now, we only enforce this on setting, and leave the getter a EventTarget?, but that should not be
720         observable, and will rectified in subsequent patches.
721
722 2016-10-15  Chris Dumez  <cdumez@apple.com>
723
724         Add support for reportValidity() on form and form control elements
725         https://bugs.webkit.org/show_bug.cgi?id=163479
726
727         Reviewed by Darin Adler.
728
729         Add support for reportValidity() on form and form control elements:
730         - https://html.spec.whatwg.org/#dom-form-reportvalidity
731         - https://html.spec.whatwg.org/#dom-cva-reportvalidity
732
733         Firefox and Chrome already support this.
734
735         Demo: https://googlechrome.github.io/samples/report-validity/
736
737         No new tests, rebaselined existing tests.
738
739         * html/HTMLButtonElement.idl:
740         * html/HTMLFieldSetElement.idl:
741         * html/HTMLFormElement.idl:
742         * html/HTMLInputElement.idl:
743         * html/HTMLKeygenElement.idl:
744         * html/HTMLObjectElement.idl:
745         * html/HTMLOutputElement.idl:
746         * html/HTMLSelectElement.idl:
747         * html/HTMLTextAreaElement.idl:
748         Add reportValidity() operation.
749
750         * html/HTMLFormControlElement.cpp:
751         (WebCore::HTMLFormControlElement::checkValidity):
752
753         (WebCore::HTMLFormControlElement::reportValidity):
754         Add implementation for reportValidity() for form control elements.
755         First, it calls checkValidity() and returns early if there is no
756         constraint violation. if the JS canceled the 'invalid' event
757         fired by checkValidity(), then return early as well, as per the
758         specification. If the element is focusable, we scroll to it,
759         focus it and show the validation message. Otherwise, we log a
760         error message to the console. The last part of the behavior
761         matches what we already did in HTMLFormElement::validateInteractively()
762         and complies with the behavior in the specification.
763
764         (WebCore::HTMLFormControlElement::focusAndShowValidationMessage):
765         Add utility function to scroll to the form control element, focus
766         it and show its validation message. This code was moved from
767         HTMLFormElement::validateInteractively() so that it could be reused
768         in HTMLFormControlElement::reportValidity().
769
770         * html/HTMLFormControlElement.h:
771         * html/HTMLFormElement.cpp:
772         (WebCore::HTMLFormElement::validateInteractively):
773         Move the early abort checks to the existing call site (prepareForSubmission)
774         so that we can reuse this method for reportValidity().
775
776         (WebCore::HTMLFormElement::prepareForSubmission):
777         Only call validateInteractively() if we really should validate. Those checks
778         used to be in validateInteractively() but I moved them here so we could more
779         easily reuse validateInteractively().
780
781         (WebCore::HTMLFormElement::checkValidity):
782         (WebCore::HTMLFormElement::checkInvalidControlsAndCollectUnhandled):
783         Update Vector type to be a Vector of HTMLFormControlElement given that we
784         only add HTMLFormControlElement objects to it and that it results it simpler
785         code.
786
787         (WebCore::HTMLFormElement::reportValidity):
788         Add implementation for reportValidity() for form elements. The
789         implementation calls our already existing validateInteractively()
790         method, as per the specification.
791
792         * html/HTMLFormElement.h:
793
794         * html/HTMLObjectElement.h:
795         reportValidity() returns true unconditionally for object elements,
796         similarly to checkValidity().
797
798 2016-10-15  Simon Fraser  <simon.fraser@apple.com>
799
800         Sort the project file.
801
802         * WebCore.xcodeproj/project.pbxproj:
803
804 2016-10-15  Simon Fraser  <simon.fraser@apple.com>
805
806         Implement serializer = { attribute }
807         https://bugs.webkit.org/show_bug.cgi?id=163466
808
809         Reviewed by Darin Adler.
810
811         Fix the code generator to generate code for serializer = { attribute }.
812         In IDLParser, extend domSerializable with flags for the 'inherit', 'getter' and
813         'attribute' values (the first two are still unsupported). Fix parseSerializationPattern()
814         to detect these; it needs to create the domSerializable() now. Basic support
815         for isSerializableAttribute() is added (primitive types only).
816         
817         GenerateSerializerFunction is fixed to output code for the serializable attributes
818         in the order specified in "serializer = {}", as specified in WebIDL.
819         
820         Removed custom serialization for ClientRect and PerformanceTiming.
821         
822         Other minor cleanup to always get $interfaceName from $interface->name, and to fix
823         ObjectConstructor.h to be included as <runtime/ObjectConstructor.h>.
824
825         * CMakeLists.txt:
826         * WebCore.xcodeproj/project.pbxproj:
827         * bindings/js/JSBindingsAllInOne.cpp:
828         * bindings/js/JSClientRectCustom.cpp: Removed.
829         * bindings/js/JSPerformanceTimingCustom.cpp: Removed.
830         * bindings/scripts/CodeGeneratorJS.pm:
831         (GenerateImplementation):
832         (GenerateSerializerFunction):
833         * bindings/scripts/IDLParser.pm:
834         (parseSerializerRest):
835         (parseSerializationPattern):
836         (parseSerializationAttributes):
837         (isSerializableAttribute):
838         (applyMemberList):
839         * bindings/scripts/test/JS/JSTestNode.cpp:
840         * bindings/scripts/test/JS/JSTestObj.cpp:
841         (WebCore::jsTestObjPrototypeFunctionToJSONCaller):
842         * bindings/scripts/test/JS/JSTestSerialization.cpp: Added.
843         * bindings/scripts/test/JS/JSTestSerialization.h: Added.
844         * bindings/scripts/test/TestObj.idl:
845         * bindings/scripts/test/TestSerialization.idl: Copied from Source/WebCore/dom/ClientRect.idl.
846         * dom/ClientRect.idl:
847         * page/PerformanceTiming.idl:
848
849 2016-10-15  Michael Catanzaro  <mcatanzaro@igalia.com>
850
851         [GTK] Restore user agent quirk for Yahoo
852         https://bugs.webkit.org/show_bug.cgi?id=163481
853
854         Reviewed by Carlos Garcia Campos.
855
856         finance.yahoo.com is sending a mobile version in response to our standard user agent.
857
858         * platform/gtk/UserAgentGtk.cpp:
859         (WebCore::urlRequiresMacintoshPlatform):
860
861 2016-10-15  Chris Dumez  <cdumez@apple.com>
862
863         Setting HTMLMediaElement.volume to NaN or Inf should throw a TypeError
864         https://bugs.webkit.org/show_bug.cgi?id=163472
865
866         Reviewed by Sam Weinig.
867
868         Setting HTMLMediaElement.volume to NaN or Inf should throw a TypeError:
869         - https://html.spec.whatwg.org/#dom-media-volume
870
871         This is because the attribute is of type double (not unrestricted double in the IDL).
872
873         Chrome and Firefox agree with the specification. WebKit throws an IndexSizeErr instead.
874
875         No new tests, rebaselined existing test.
876
877         * html/HTMLMediaElement.idl:
878
879 2016-10-15  Zalan Bujtas  <zalan@apple.com>
880
881         CounterNode::resetRenderers is so inefficient.
882         https://bugs.webkit.org/show_bug.cgi?id=163480
883
884         Reviewed by Simon Fraser.
885
886         CounterNode::resetRenderers() removes all the associated renderers from this CounterNode
887         and sets the dirty bit on them.
888         This patch does all that in a loop, instead of traversing the linked tree on each removal.
889
890         No change in functionality.
891
892         * rendering/CounterNode.cpp:
893         (WebCore::CounterNode::CounterNode):
894         (WebCore::CounterNode::~CounterNode):
895         (WebCore::CounterNode::nextInPreOrderAfterChildren):
896         (WebCore::CounterNode::lastDescendant):
897         (WebCore::CounterNode::addRenderer): These assertions do not seem super useful.
898         (WebCore::CounterNode::removeRenderer):
899         (WebCore::CounterNode::resetRenderers):
900         (WebCore::CounterNode::insertAfter):
901         (WebCore::CounterNode::removeChild):
902         * rendering/CounterNode.h:
903         * rendering/RenderCounter.cpp:
904         (WebCore::makeCounterNode):
905         (WebCore::RenderCounter::RenderCounter):
906         (WebCore::RenderCounter::~RenderCounter):
907         (WebCore::RenderCounter::originalText):
908         (WebCore::updateCounters):
909         (WebCore::RenderCounter::invalidate): Deleted.
910         * rendering/RenderCounter.h:
911
912 2016-10-15  Antoine Quint  <graouts@apple.com>
913
914         [Modern Media Controls] macOS inline controls
915         https://bugs.webkit.org/show_bug.cgi?id=163444
916         <rdar://problem/27989473>
917
918         Reviewed by Dean Jackson.
919
920         Introducing the new MacOSMediaControls and MacOSInlineMediaControls classes. MacOSMediaControls is a MediaControls subclass
921         that adds specific buttons to the macOS platform and sets the layout traits to be macOS. This class has a new subclass,
922         MacOSInlineMediaControls, which sets the layout traits to also include inline and implements custom layout to drop
923         controls as necessary as the width of the controls varies. It also shows the volume slider when the mute button is hovered.
924         
925         Tests: media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-buttons-styles.html
926                media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-constructor.html
927                media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-controls-bar-styles.html
928                media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-layout.html
929                media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-time-control-styles.html
930                media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-volume-slider-visibility.html
931                media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-volume-styles.html
932                media/modern-media-controls/macos-inline-media-controls/macos-inline-media-dropping-controls.html
933                media/modern-media-controls/macos-media-controls/macos-media-controls.html
934
935         * Modules/modern-media-controls/controls/macos-inline-media-controls.css: Added.
936         (.media-controls.mac.inline > .controls-bar):
937         (.media-controls.mac.inline > .controls-bar > *):
938         (.media-controls.mac.inline button):
939         (.media-controls.mac.inline button:active):
940         (.media-controls.mac.inline > .controls-bar button):
941         (.media-controls.mac.inline > .controls-bar,):
942         (.media-controls.mac.inline button.play-pause):
943         (.media-controls.mac.inline button.skip-back):
944         (.media-controls.mac.inline .scrubber.slider):
945         (.media-controls.mac.inline button.mute):
946         (.media-controls.mac.inline button.airplay):
947         (.media-controls.mac.inline button.pip):
948         (.media-controls.mac.inline button.tracks):
949         (.media-controls.mac.inline button.fullscreen):
950         (.media-controls.mac.inline .time-label):
951         (.media-controls.mac.inline .volume-slider-container):
952         (.media-controls.mac.inline .volume-slider-container:before):
953         (.media-controls.mac.inline .volume.slider):
954         * Modules/modern-media-controls/controls/macos-inline-media-controls.js: Added.
955         (MacOSInlineMediaControls.prototype.layout):
956         (MacOSInlineMediaControls.prototype.handleEvent):
957         * Modules/modern-media-controls/controls/macos-media-controls.js: Added.
958         (MacOSMediaControls):
959
960 2016-10-14  Antti Koivisto  <antti@apple.com>
961
962         100% CPU on homedepot.com page
963         https://bugs.webkit.org/show_bug.cgi?id=163452
964         <rdar://problem/28730708>
965
966         Reviewed by Simon Fraser.
967
968         The site has a keyframe animation on body. Currently this causes the animation to invalidate the
969         style of the entire document.
970
971         Animations use SyntheticStyleChange to invalidate elements when animation progresses and currently
972         that causes full subtree invalidation. However animation only ever affect individual elements and
973         the normal style resolution mechanism should be able to deal with things like inheritance as needed.
974
975         Test: fast/animation/animation-style-update-size.html
976
977         * dom/Document.cpp:
978         (WebCore::Document::recalcStyle):
979         * dom/Document.h:
980         (WebCore::Document::lastStyleUpdateSizeForTesting):
981
982             Testing support.
983
984         * style/StyleTreeResolver.cpp:
985         (WebCore::Style::TreeResolver::resolveElement):
986
987             Don't force subtree style resolution for SyntheticStyleChange.
988
989         * style/StyleUpdate.h:
990         (WebCore::Style::Update::size):
991         * testing/Internals.cpp:
992         (WebCore::Internals::lastStyleUpdateSize):
993         * testing/Internals.h:
994         * testing/Internals.idl:
995
996 2016-10-14  Chris Dumez  <cdumez@apple.com>
997
998         Setting HTMLMediaElement.muted to the same value should not fire a volume change event
999         https://bugs.webkit.org/show_bug.cgi?id=163474
1000
1001         Reviewed by Eric Carlson.
1002
1003         Setting HTMLMediaElement.muted to the same value should not fire a volume
1004         change event:
1005         - https://html.spec.whatwg.org/#dom-media-muted
1006
1007         Chrome and Firefox agree with the specification.
1008
1009         No new tests, rebaselined existing test.
1010
1011         * html/HTMLMediaElement.cpp:
1012         (WebCore::HTMLMediaElement::setMuted):
1013
1014 2016-10-14  Dean Jackson  <dino@apple.com>
1015
1016         Add Display P3 ColorSpace
1017         https://bugs.webkit.org/show_bug.cgi?id=162880
1018         <rdar://problem/28598564>
1019
1020         Reviewed by Sam Weinig.
1021
1022         Re-landing with a version that hopefully compiles on El Capitan.
1023
1024         Add a new ColorSpace for Display P3.
1025
1026         This will be tested once the Color class can create
1027         objects that reference other color spaces.
1028
1029         * platform/graphics/ColorSpace.h:
1030         * platform/graphics/cg/GraphicsContextCG.cpp:
1031         (WebCore::displayP3ColorSpaceRef):
1032         * platform/graphics/cg/GraphicsContextCG.h:
1033         (WebCore::cachedCGColorSpace):
1034
1035 2016-10-14  Brent Fulgham  <bfulgham@apple.com>
1036
1037         [Win][Direct2D] Minor cleanups
1038         https://bugs.webkit.org/show_bug.cgi?id=162953
1039
1040         Reviewed by Dean Jackson.
1041
1042         Code cleanup. No change in behavior.
1043
1044         * platform/graphics/win/ImageDecoderDirect2D.cpp:
1045         (WebCore::ImageDecoder::frameIsCompleteAtIndex):
1046         (WebCore::ImageDecoder::frameBytesAtIndex):
1047
1048 2016-10-14  Alex Christensen  <achristensen@webkit.org>
1049
1050         Fix CMake build.
1051
1052         * PlatformMac.cmake:
1053
1054 2016-10-14  Anders Carlsson  <andersca@apple.com>
1055
1056         Pass on networking settings to the PKPaymentRequest
1057         https://bugs.webkit.org/show_bug.cgi?id=163462
1058         rdar://problem/28567629
1059
1060         Reviewed by Dan Bernstein.
1061
1062         Add new SPI.
1063
1064         * platform/spi/cocoa/PassKitSPI.h:
1065
1066 2016-10-14  Dean Jackson  <dino@apple.com>
1067
1068         CSS parsing should use Color not RGBA32
1069         https://bugs.webkit.org/show_bug.cgi?id=163423
1070         <rdar://problem/28766903>
1071
1072         Reviewed by Simon Fraser.
1073
1074         Re-landing this after it was rolled out in https://trac.webkit.org/r207342.
1075
1076         In order to allow CSS to use the ExtendedColor variant of
1077         Color, we need to stop using RGBA32. This is a fairly big
1078         change that goes through all the places in the parser
1079         related to colors, and moves them from RGBA32 to Color.
1080
1081         No change in functionality, so covered by existing tests.
1082
1083         * WebCore.xcodeproj/project.pbxproj: Add the new ColorHash.h file.
1084
1085         * css/CSSPrimitiveValue.cpp: CSSPrimitiveValue now can hold a Color*
1086         rather than an unsigned int for colors.
1087         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
1088         (WebCore::CSSPrimitiveValue::cleanup):
1089         (WebCore::CSSPrimitiveValue::getRGBColorValue):
1090         (WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText):
1091         (WebCore::CSSPrimitiveValue::cloneForCSSOM):
1092         (WebCore::CSSPrimitiveValue::equals):
1093         * css/CSSPrimitiveValue.h: Move to Color* and also use some
1094         nullptrs.
1095         * css/CSSPrimitiveValueMappings.h:
1096         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Add a new inline
1097         constructor.
1098
1099         * css/CSSValuePool.cpp: Move to Color.
1100         (WebCore::CSSValuePool::CSSValuePool):
1101         (WebCore::CSSValuePool::createColorValue):
1102         * css/CSSValuePool.h: Change the ColorValueCache to a new type.
1103
1104         * css/StyleResolver.cpp: Move to Color.
1105         (WebCore::StyleResolver::colorFromPrimitiveValue):
1106         * css/parser/CSSParser.cpp:
1107         (WebCore::parseColorValue):
1108         (WebCore::CSSParser::parseColor):
1109         (WebCore::CSSParser::parseColorFromString):
1110         (WebCore::CSSParser::parseSystemColor):
1111         (WebCore::fastParseColorInternal):
1112         (WebCore::CSSParser::fastParseColor):
1113         (WebCore::CSSParser::parseColorFromValue):
1114         * css/parser/CSSParser.h:
1115         * css/parser/CSSParserFastPaths.cpp:
1116         (WebCore::fastParseColorInternal):
1117         (WebCore::CSSParserFastPaths::parseColor):
1118         * css/parser/CSSPropertyParserHelpers.cpp:
1119         (WebCore::CSSPropertyParserHelpers::consumeColor):
1120         * css/parser/SVGCSSParser.cpp:
1121         (WebCore::CSSParser::parseSVGValue):
1122         (WebCore::CSSParser::parseSVGPaint):
1123         (WebCore::CSSParser::parseSVGColor):
1124         * editing/EditingStyle.cpp:
1125         (WebCore::cssValueToColor):
1126         (WebCore::textColorFromStyle):
1127         (WebCore::backgroundColorFromStyle):
1128         (WebCore::rgbaBackgroundColorInEffect):
1129         (WebCore::EditingStyle::prepareToApplyAt):
1130         (WebCore::isTransparentColorValue):
1131         (WebCore::cssValueToRGBA): Deleted.
1132         * editing/cocoa/HTMLConverter.mm:
1133         (HTMLConverterCaches::colorPropertyValueForNode):
1134         * html/HTMLBodyElement.cpp:
1135         (WebCore::HTMLBodyElement::parseAttribute):
1136         * html/canvas/CanvasGradient.cpp:
1137         (WebCore::CanvasGradient::addColorStop):
1138         * html/canvas/CanvasRenderingContext2D.cpp: Ditto, but leave a FIXME to
1139         remind myself to come back when colorWithOverrideAlpha has been updated.
1140         (WebCore::CanvasRenderingContext2D::setStrokeStyle):
1141         (WebCore::CanvasRenderingContext2D::setFillStyle):
1142         (WebCore::CanvasRenderingContext2D::setShadowColor):
1143         (WebCore::CanvasRenderingContext2D::setShadow):
1144         * html/canvas/CanvasStyle.cpp:
1145         (WebCore::isCurrentColorString):
1146         (WebCore::parseColor):
1147         (WebCore::currentColor):
1148         (WebCore::parseColorOrCurrentColor):
1149         (WebCore::CanvasStyle::createFromString):
1150         (WebCore::CanvasStyle::createFromStringWithOverrideAlpha):
1151         * html/canvas/CanvasStyle.h:
1152         * svg/SVGColor.cpp:
1153         (WebCore::SVGColor::colorFromRGBColorString):
1154
1155         * platform/graphics/Color.h: Add new constructors for the special
1156         empty and deleted Color values used in HashTables.
1157         (WebCore::Color::Color):
1158         (WebCore::Color::isHashTableDeletedValue):
1159         (WebCore::Color::asUint64): New accessor to get the raw uint64_t value.
1160
1161         * platform/graphics/ColorHash.h: Added. Implement the traits for a Color HashTable.
1162         (WTF::ColorHash::hash):
1163         (WTF::ColorHash::equal):
1164         (WTF::HashTraits<WebCore::Color>::emptyValue):
1165         (WTF::HashTraits<WebCore::Color>::constructDeletedValue):
1166         (WTF::HashTraits<WebCore::Color>::isDeletedValue):
1167
1168 2016-10-14  Brent Fulgham  <bfulgham@apple.com>
1169
1170         [Win][Direct2D] Implement basic SVG support
1171         https://bugs.webkit.org/show_bug.cgi?id=163349
1172
1173         Reviewed by Brent Fulgham.
1174
1175         Direct2D needs access to the target graphics context when generating bitmap
1176         images so that it can properly match pixel format and other settings.
1177
1178         Add implementations for a number of drawing primitives used in the SVG
1179         test cases. Correct some differences between CG and Direct2D for drawing
1180         different primitives.
1181
1182         No new tests. Tested by existing 'svg' tests.
1183
1184         * platform/graphics/BitmapImage.cpp:
1185        (WebCore::BitmapImage::frameImageAtIndex): Take optional target graphics
1186        context. Also pass the graphics context to the image decoder.
1187        (WebCore::BitmapImage::nativeImage): Accept an optional target context.
1188        (WebCore::BitmapImage::nativeImageForCurrentFrame): Ditto.
1189        (WebCore::BitmapImage::draw): Pass target graphics context to the
1190        'frameImageAtIndex' method.
1191         * platform/graphics/BitmapImage.h:
1192         * platform/graphics/Image.h:
1193         * platform/graphics/ImageBuffer.cpp:
1194         (WebCore::ImageBuffer::create): Moved from header. Add create function that
1195         takes an optional GraphicsContext argument.
1196         * platform/graphics/ImageBuffer.h:
1197         * platform/graphics/ImageFrameCache.cpp: Add missing include needed to build
1198         under Direct2D.
1199         * platform/graphics/ImageSource.cpp:
1200         (WebCore::ImageSource::setDecoderTargetContext): Added.
1201         (WebCore::ImageSource::setRenderTarget): Deleted.
1202         * platform/graphics/ImageSource.h:
1203         * platform/graphics/Pattern.h:
1204         * platform/graphics/win/GraphicsContextDirect2D.cpp:
1205         (WebCore::GraphicsContextPlatformPrivate::endDraw): Log error state instead of crashing
1206         each time.
1207         (WebCore::GraphicsContext::drawEllipse): Ellipses are defined in D2D as a center, an
1208         X-radius, and a Y-radius.
1209         (WebCore::GraphicsContext::applyStrokePattern):
1210         (WebCore::GraphicsContext::applyFillPattern):
1211         (WebCore::GraphicsContext::clearRect): Use 'Clear' function if possible. Don't clear
1212         anything if the clear rect is outside the drawing area.
1213         (WebCore::GraphicsContext::strokeRect): Provide implementation (needed by SVG).
1214         (WebCore::GraphicsContext::platformFillEllipse): Ellipses are defined in D2D as
1215         a center, an X-radius, and a Y-radius.
1216         (WebCore::GraphicsContext::platformStrokeEllipse): Ditto.
1217         * platform/graphics/win/ImageBufferDirect2D.cpp:
1218         (WebCore::ImageBuffer::createCompatibleBuffer): Accept optional GraphicsContext argument.
1219         (WebCore::ImageBuffer::ImageBuffer): Ditto.
1220         * platform/graphics/win/ImageDecoderDirect2D.cpp:
1221         (WebCore::ImageDecoder::setTargetContext): Renamed from 'setRenderTarget'.
1222         (WebCore::ImageDecoder::createFrameImageAtIndex): Take optional GraphicsContext argument.
1223         (WebCore::ImageDecoder::setRenderTarget): Deleted.
1224         * platform/graphics/win/ImageDecoderDirect2D.h:
1225         * platform/graphics/win/ImageDirect2D.cpp:
1226         (WebCore::BitmapImage::setRenderTarget): Deleted.
1227         * platform/graphics/win/NativeImageDirect2D.cpp: Add missing include.
1228         * platform/graphics/win/PatternDirect2D.cpp: 
1229         (WebCore::Pattern::createPlatformPattern): Revise for new signature.
1230         * rendering/FilterEffectRenderer.cpp:
1231         (WebCore::FilterEffectRenderer::allocateBackingStoreIfNeeded): Pass GraphicsContext
1232         to ImageBuffer constructor.
1233         (WebCore::FilterEffectRendererHelper::beginFilterEffect): Pass target context to
1234         filter when allocating backing store.
1235         * rendering/FilterEffectRenderer.h: Add GraphicsContext as argument to constructor.
1236         * rendering/RenderLayer.cpp:
1237         (WebCore::RenderLayer::hasFilterThatIsPainting): Supply GraphicsContext argument when
1238         building new FilterEffectRenderer and helper.
1239         (WebCore::RenderLayer::setupFilters): Ditto.
1240         * svg/graphics/SVGImage.cpp:
1241         (WebCore::SVGImage::nativeImageForCurrentFrame): Revise to take optional GraphicsContext
1242         argument.
1243         (WebCore::SVGImage::nativeImage): Ditto.
1244         * svg/graphics/SVGImage.h:
1245         * svg/graphics/SVGImageForContainer.cpp:
1246         (WebCore::SVGImageForContainer::nativeImageForCurrentFrame): Ditto.
1247         * svg/graphics/SVGImageForContainer.h:
1248
1249 2016-10-14  Chris Dumez  <cdumez@apple.com>
1250
1251         Unreviewed, rolling out r207319.
1252
1253         Regressed Dromaeo and may have caused crashes under
1254         GuardMalloc (rdar://problem/28780835)
1255
1256         Reverted changeset:
1257
1258         "[Web IDL] Add support for [SameObject] extended attribute"
1259         https://bugs.webkit.org/show_bug.cgi?id=163414
1260         http://trac.webkit.org/changeset/207319
1261
1262 2016-10-14  Anders Carlsson  <andersca@apple.com>
1263
1264         Clean up BackForwardClient
1265         https://bugs.webkit.org/show_bug.cgi?id=163454
1266
1267         Reviewed by Sam Weinig.
1268
1269         Remove iOS specific member functions that are only used from WebKit.
1270
1271         * history/BackForwardClient.h:
1272         * loader/EmptyClients.cpp:
1273
1274 2016-10-13  Anders Carlsson  <andersca@apple.com>
1275
1276         Move BackForwardList from WebCore to WebKitLegacy
1277         https://bugs.webkit.org/show_bug.cgi?id=163418
1278
1279         Reviewed by Tim Horton.
1280
1281         * CMakeLists.txt:
1282         * WebCore.xcodeproj/project.pbxproj:
1283         * history/BackForwardController.cpp:
1284         (WebCore::BackForwardController::BackForwardController):
1285         * history/BackForwardController.h:
1286         * loader/EmptyClients.cpp:
1287         (WebCore::fillWithEmptyClients):
1288         * page/Page.cpp:
1289         (WebCore::Page::Page):
1290
1291 2016-10-14  Manuel Rego Casasnovas  <rego@igalia.com>
1292
1293         [css-grid] Changing the argument on fit-content() doesn't cause the grid to be relayout
1294         https://bugs.webkit.org/show_bug.cgi?id=163434
1295
1296         Reviewed by Sergio Villar Senin.
1297
1298         When fit-content() was implemented a new attribute
1299         m_fitContentTrackBreadth was added to GridTrackSize.
1300         However we forgot to include it in the == operator implementation,
1301         so we were missing the changes on that value.
1302
1303         Now if you change the argument of a fit-content() track,
1304         the track size is properly recomputed.
1305
1306         Test: fast/css-grid-layout/grid-change-fit-content-argument.html
1307
1308         * rendering/style/GridTrackSize.h:
1309         (WebCore::GridTrackSize::operator==): Check m_fitContentTrackBreadth.
1310
1311 2016-10-14  Commit Queue  <commit-queue@webkit.org>
1312
1313         Unreviewed, rolling out r207317.
1314         https://bugs.webkit.org/show_bug.cgi?id=163448
1315
1316         This change caused an existing LayoutTest to fail on all
1317         platforms (Requested by ryanhaddad on #webkit).
1318
1319         Reverted changeset:
1320
1321         "CSS parsing should use Color not RGBA32"
1322         https://bugs.webkit.org/show_bug.cgi?id=163423
1323         http://trac.webkit.org/changeset/207317
1324
1325 2016-10-14  Antti Koivisto  <antti@apple.com>
1326
1327         Share inline stylesheets between shadow trees
1328         https://bugs.webkit.org/show_bug.cgi?id=163353
1329
1330         Reviewed by Ryosuke Niwa and Andreas Kling.
1331
1332         If shadow trees have identical inline stylesheets the data structures can be shared.
1333         In future this will also allow sharing style resolvers.
1334
1335         * css/CSSStyleSheet.cpp:
1336         (WebCore::CSSStyleSheet::createInline):
1337
1338             Move StyleSheetContents construction to the client.
1339
1340         * css/parser/CSSParserMode.h:
1341         (WebCore::CSSParserContextHash::hash):
1342         (WebCore::CSSParserContextHash::equal):
1343         (WTF::HashTraits<WebCore::CSSParserContext>::constructDeletedValue):
1344         (WTF::HashTraits<WebCore::CSSParserContext>::isDeletedValue):
1345         (WTF::HashTraits<WebCore::CSSParserContext>::emptyValue):
1346
1347             Make CSSParserContext hashable.
1348
1349         * dom/ExtensionStyleSheets.cpp:
1350         (WebCore::createExtensionsStyleSheet):
1351         (WebCore::ExtensionStyleSheets::pageUserSheet):
1352         (WebCore::ExtensionStyleSheets::updateInjectedStyleSheetCache):
1353
1354             Don't use CSSStyleSheet::createInline, these are not really inline stylesheets.
1355             Code cleanups.
1356
1357         * dom/InlineStyleSheetOwner.cpp:
1358         (WebCore::parserContextForForElement):
1359         (WebCore::makeInlineStyleSheetCacheKey):
1360         (WebCore::inlineStyleSheetCache):
1361
1362             Implement a simple cache for sharing stylesheets with identical text and context.
1363
1364         (WebCore::InlineStyleSheetOwner::createSheet):
1365         (WebCore::InlineStyleSheetOwner::clearCache):
1366         * dom/InlineStyleSheetOwner.h:
1367         * platform/MemoryPressureHandler.cpp:
1368         (WebCore::MemoryPressureHandler::releaseNoncriticalMemory):
1369
1370 2016-10-14  Chris Dumez  <cdumez@apple.com>
1371
1372         [Mac] Allow throttling of background tabs that have media elements with no audible audio
1373         https://bugs.webkit.org/show_bug.cgi?id=163402
1374         <rdar://problem/28056151>
1375
1376         Reviewed by Gavin Barraclough.
1377
1378         Allow throttling of background tabs that have media elements with no audible audio.
1379         We were taking an media assertion from the PageThrottler as soon as there was a
1380         media element playing on the page. This prevented throttling of background tabs
1381         even if those media elements had no audible audio, which was unfortunate.
1382
1383         We now have more fine-grained rules for when HTMLMediaElement should take an
1384         assertion. I also added release logging to help debug such issues in the
1385         future.
1386
1387         * html/HTMLMediaElement.cpp:
1388         (WebCore::HTMLMediaElement::setMuted):
1389         (WebCore::HTMLMediaElement::updateVolume):
1390         (WebCore::HTMLMediaElement::updatePlayState):
1391         (WebCore::HTMLMediaElement::updateAudioAssertionState):
1392         (WebCore::HTMLMediaElement::effectiveMuted): Deleted.
1393         * html/HTMLMediaElement.h:
1394
1395 2016-10-14  Romain Bellessort  <romain.bellessort@crf.canon.fr>
1396
1397         [Readable Streams API] Cleanup patch, fix small inconsistencies
1398         https://bugs.webkit.org/show_bug.cgi?id=163329
1399
1400         Reviewed by Youenn Fablet.
1401
1402         Cleanup patch, fixed 3 small inconsistences between implementation and spec.
1403
1404         No change in behaviour.
1405
1406         * Modules/streams/ReadableStream.idl: Added optional parameter in getReader.
1407         * Modules/streams/ReadableStreamDefaultController.js:
1408         (error): Call readableStreamDefaultControllerError instead of readableStreamError.
1409         * Modules/streams/ReadableStreamInternals.js: Added missing ASSERT in readableStreamDefaultControllerCallPullIfNeeded.
1410
1411 2016-10-14  Youenn Fablet  <youenn@apple.com>
1412
1413         http://trac.webkit.org/changeset/207330 broke Mac Windows build
1414         https://bugs.webkit.org/show_bug.cgi?id=163442
1415
1416         Unreviewed.
1417
1418         * platform/network/cf/ResourceRequestCFNet.cpp:
1419         (WebCore::toPlatformRequestCachePolicy): Do not explicitly use CFURLRequestCachePolicy enumeration values.
1420
1421 2016-10-14  Zan Dobersek  <zdobersek@igalia.com>
1422
1423         [Cairo] GraphicsContext3D::ImageExtractor fails to extract images
1424         https://bugs.webkit.org/show_bug.cgi?id=163439
1425
1426         Reviewed by Carlos Garcia Campos.
1427
1428         In the Cairo implementation of GraphicsContext3D::ImageExtractor,
1429         don't check for frame completeness at index 0. This information
1430         is now cached only after the frame for that index is decoded and
1431         marked as completed, which is done after this check.
1432
1433         Becuase of this the current check forces extractImage() to return
1434         early and abort WebGL texture uploads from image sources.
1435
1436         This bug was most likely exposed after the refactoring in r206481.
1437         https://trac.webkit.org/changeset/206481
1438
1439         * platform/graphics/cairo/GraphicsContext3DCairo.cpp:
1440         (WebCore::GraphicsContext3D::ImageExtractor::extractImage):
1441
1442 2016-10-14  Youenn Fablet  <youenn@apple.com>
1443
1444         MediaResourceLoader should use CachedResource::ressourceError to do CORS checks
1445         https://bugs.webkit.org/show_bug.cgi?id=163279
1446
1447         Reviewed by Darin Adler.
1448
1449         Covered by existing tests.
1450
1451         * loader/MediaResourceLoader.cpp:
1452         (WebCore::MediaResource::responseReceived): Making use of CachedResource::ressourceError to detect CORS failures.
1453         * loader/cache/CachedResourceLoader.cpp:
1454         (WebCore::CachedResourceLoader::shouldUpdateCachedResourceWithCurrentRequest): Activating loader options checks
1455         before reusing the resource.
1456         (WebCore::isResourceSuitableForDirectReuse): Disabling direct reuse of MediaResource since reuse of raw
1457         resources does not work yet for media resources.
1458
1459 2016-10-14  Youenn Fablet  <youenn@apple.com>
1460
1461         Make NetworkCache aware of fetch cache mode
1462         https://bugs.webkit.org/show_bug.cgi?id=163332
1463
1464         Reviewed by Antti Koivisto.
1465
1466         Tests: imported/w3c/web-platform-tests/fetch/api/request/request-cache-default-conditional.html
1467                imported/w3c/web-platform-tests/fetch/api/request/request-cache-default.html
1468                imported/w3c/web-platform-tests/fetch/api/request/request-cache-force-cache.html
1469                imported/w3c/web-platform-tests/fetch/api/request/request-cache-no-cache.html
1470                imported/w3c/web-platform-tests/fetch/api/request/request-cache-no-store.html
1471                imported/w3c/web-platform-tests/fetch/api/request/request-cache-only-if-cached.html
1472                imported/w3c/web-platform-tests/fetch/api/request/request-cache-reload.html
1473
1474         * loader/cache/CachedResourceLoader.cpp:
1475         (WebCore::updateRequestAccordingCacheMode): Setting request cache policy according cache mode.
1476         Basically, these two are about the same.
1477         (WebCore::CachedResourceLoader::determineRevalidationPolicy): Making use of cache policy instead of cache mode.
1478         * platform/network/ResourceRequestBase.h: Adding new cache policies, aligned with fetch cache modes.
1479         * platform/network/cf/ResourceRequestCFNet.cpp:
1480         (WebCore::toPlatformRequestCachePolicy): If policy is not supported by CFNetwork, fallback to ReloadIgnoringCacheData.
1481         This is the best approximate we might find.
1482         (WebCore::ResourceRequest::doUpdatePlatformHTTPBody):
1483         (WebCore::ResourceRequest::doUpdateResourceRequest): Only updating cache policy, if cache policy is the default.
1484         * platform/network/cf/ResourceRequestCFNet.h:
1485         * platform/network/cocoa/ResourceRequestCocoa.mm: Doing the same modifications as for ResourceRequestCFNet.
1486         (WebCore::ResourceRequest::doUpdateResourceRequest):
1487         (WebCore::toPlatformRequestCachePolicy):
1488         (WebCore::ResourceRequest::doUpdatePlatformRequest):
1489
1490 2016-10-13  Youenn Fablet  <youenn@apple.com>
1491
1492         Binding generated code for private operations should assert for casted-this checks
1493         https://bugs.webkit.org/show_bug.cgi?id=163326
1494
1495         Reviewed by Darin Adler.
1496
1497         Covered by existing tests.
1498
1499         Private operations are not exposed to user scripts and are only called by built-in scripts or other WebKit-controlled code.
1500         The call sites already ensure that the caller is of the right type so there is no need to do that work twice.
1501
1502         Introducing a casted-this-error Assert mode for casted-this checks, which may be reused for other binding generated code.
1503         Updated binding generator to use that mode for private operations.
1504
1505         * bindings/js/JSDOMBinding.h:
1506         (WebCore::BindingCaller::callPromiseOperation):
1507         (WebCore::BindingCaller::callOperation):
1508         * bindings/scripts/CodeGeneratorJS.pm:
1509         (GenerateImplementation):
1510         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
1511         (WebCore::jsTestGlobalObjectInstanceFunctionTestPrivateFunction):
1512         * bindings/scripts/test/JS/JSTestObj.cpp:
1513         (WebCore::jsTestObjPrototypeFunctionPrivateMethod):
1514
1515 2016-10-13  Carlos Garcia Campos  <cgarcia@igalia.com>
1516
1517         WebView and WebPage URLs not updated after URL is modified by InjectedBundlePageResourceLoadClient::willSendRequestForFrame
1518         https://bugs.webkit.org/show_bug.cgi?id=146306
1519
1520         Reviewed by Darin Adler.
1521
1522         Notify about the provisional URL change when new request set for main resource load in DocumentLoader has a
1523         different URL than the previous one.
1524
1525         * loader/DocumentLoader.cpp:
1526         (WebCore::DocumentLoader::setRequest):
1527
1528 2016-10-13  Youenn Fablet  <youenn@apple.com>
1529
1530         Update serializer and iterator binding generated code
1531         https://bugs.webkit.org/show_bug.cgi?id=163325
1532
1533         Reviewed by Darin Adler.
1534
1535         No change of behavior.
1536         Covered by existing tests and rebased binding generated code.
1537
1538         Making use of BindingCaller::callOperation within serializer and iterator operations.
1539         Refactored serializer code to use direct attribute getters.
1540
1541         * bindings/js/JSDOMIterator.h:
1542         (WebCore::iteratorCreate):
1543         (WebCore::iteratorForEach):
1544         * bindings/scripts/CodeGeneratorJS.pm:
1545         (GenerateSerializerFunction):
1546         (GenerateImplementationIterableFunctions):
1547         * bindings/scripts/test/JS/JSTestIterable.cpp:
1548         (WebCore::jsTestIterablePrototypeFunctionSymbolIteratorCaller):
1549         (WebCore::jsTestIterablePrototypeFunctionSymbolIterator):
1550         (WebCore::jsTestIterablePrototypeFunctionEntriesCaller):
1551         (WebCore::jsTestIterablePrototypeFunctionEntries):
1552         (WebCore::jsTestIterablePrototypeFunctionKeysCaller):
1553         (WebCore::jsTestIterablePrototypeFunctionKeys):
1554         (WebCore::jsTestIterablePrototypeFunctionValuesCaller):
1555         (WebCore::jsTestIterablePrototypeFunctionValues):
1556         (WebCore::jsTestIterablePrototypeFunctionForEachCaller):
1557         (WebCore::jsTestIterablePrototypeFunctionForEach):
1558         * bindings/scripts/test/JS/JSTestNode.cpp:
1559         (WebCore::jsTestNodePrototypeFunctionSymbolIteratorCaller):
1560         (WebCore::jsTestNodePrototypeFunctionSymbolIterator):
1561         (WebCore::jsTestNodePrototypeFunctionEntriesCaller):
1562         (WebCore::jsTestNodePrototypeFunctionEntries):
1563         (WebCore::jsTestNodePrototypeFunctionKeysCaller):
1564         (WebCore::jsTestNodePrototypeFunctionKeys):
1565         (WebCore::jsTestNodePrototypeFunctionValuesCaller):
1566         (WebCore::jsTestNodePrototypeFunctionValues):
1567         (WebCore::jsTestNodePrototypeFunctionForEachCaller):
1568         (WebCore::jsTestNodePrototypeFunctionForEach):
1569         (WebCore::jsTestNodePrototypeFunctionToJSON):
1570         * bindings/scripts/test/JS/JSTestObj.cpp:
1571         (WebCore::jsTestObjPrototypeFunctionToJSON):
1572
1573 2016-10-13  Alex Christensen  <achristensen@webkit.org>
1574
1575         Fix API test after r207318.
1576         https://bugs.webkit.org/show_bug.cgi?id=162951
1577
1578         This fixes the API test WebKit2.PendingAPIRequestURL which asserted when trying to hash a null String.
1579
1580         * loader/DocumentLoader.cpp:
1581         (WebCore::isRemoteWebArchive):
1582         If the mimeType is a null String, it is not in the set webArchiveMIMETypes, so return false instead of hashing it.
1583
1584 2016-10-13  Alex Christensen  <achristensen@webkit.org>
1585
1586         Hosts of URLs with non-special schemes should be case-sensitive, and non-ASCII characters in such hosts should be punycode-encoded
1587         https://bugs.webkit.org/show_bug.cgi?id=163413
1588
1589         Reviewed by Tim Horton.
1590
1591         This retains compatibility with the canonicalization Chrome, Firefox, and Safari with uppercase characters
1592         in the hosts of URLs with unrecognized schemes.  Safari treats such characters as the host, while Firefox
1593         and Chrome treat such characters as part of the path, starting with the "//" after the ':'
1594         Behavior of non-ASCII characters is inconsistent, and since we need to have a host, we should punycode-encode
1595         the host to be consistent with special schemes because percent-encoding hosts sometimes is inconsistent.
1596         
1597         This solution was proposed to the spec in https://github.com/whatwg/url/issues/148
1598
1599         Covered by updated API and layout tests.
1600
1601         * platform/URLParser.cpp:
1602         (WebCore::URLParser::parse):
1603         (WebCore::URLParser::percentDecode):
1604         (WebCore::URLParser::domainToASCII):
1605         (WebCore::URLParser::hasInvalidDomainCharacter):
1606         (WebCore::URLParser::parseHostAndPort):
1607         (WebCore::URLParser::formURLDecode):
1608         (WebCore::percentDecode): Deleted.
1609         (WebCore::domainToASCII): Deleted.
1610         (WebCore::hasInvalidDomainCharacter): Deleted.
1611         (WebCore::formURLDecode): Deleted.
1612         * platform/URLParser.h:
1613
1614 2016-10-13  Chris Dumez  <cdumez@apple.com>
1615
1616         [Web IDL] Add support for [SameObject] extended attribute
1617         https://bugs.webkit.org/show_bug.cgi?id=163414
1618
1619         Reviewed by Darin Adler.
1620
1621         Add support for [SameObject] Web IDL extended attribute:
1622         - https://heycam.github.io/webidl/#SameObject
1623
1624         Start using it on DOM / HTML attributes where the specification
1625         mandates it.
1626
1627         Test: js/dom/SameObject-support.html
1628
1629         * bindings/scripts/CodeGeneratorJS.pm:
1630         (ShouldCacheAttribute):
1631         (GenerateHeader):
1632         (GenerateImplementation):
1633         * bindings/scripts/IDLAttributes.txt:
1634         * dom/DataTransfer.idl:
1635         * dom/Document.idl:
1636         * dom/Element.idl:
1637         * dom/MutationRecord.idl:
1638         * dom/Node.idl:
1639         * dom/NodeIterator.idl:
1640         * dom/ParentNode.idl:
1641         * dom/TreeWalker.idl:
1642         * html/HTMLAnchorElement.idl:
1643         * html/HTMLAreaElement.idl:
1644         * html/HTMLButtonElement.idl:
1645         * html/HTMLDataListElement.idl:
1646         * html/HTMLDocument.idl:
1647         * html/HTMLElement.idl:
1648         * html/HTMLFieldSetElement.idl:
1649         * html/HTMLFormElement.idl:
1650         * html/HTMLIFrameElement.idl:
1651         * html/HTMLInputElement.idl:
1652         * html/HTMLKeygenElement.idl:
1653         * html/HTMLLinkElement.idl:
1654         * html/HTMLMapElement.idl:
1655         * html/HTMLMediaElement.idl:
1656         * html/HTMLMeterElement.idl:
1657         * html/HTMLOutputElement.idl:
1658         * html/HTMLProgressElement.idl:
1659         * html/HTMLSelectElement.idl:
1660         * html/HTMLTableElement.idl:
1661         * html/HTMLTableRowElement.idl:
1662         * html/HTMLTableSectionElement.idl:
1663         * html/HTMLTextAreaElement.idl:
1664         * page/Location.idl:
1665         * page/Navigator.idl:
1666
1667 2016-10-13  Andy Estes  <aestes@apple.com>
1668
1669         [iOS] Support Web Archive previews generated by QuickLook
1670         https://bugs.webkit.org/show_bug.cgi?id=162951
1671         <rdar://problem/28607920>
1672
1673         Reviewed by Brady Eidson.
1674
1675         QuickLook might generate a Web Archive preview for some resource types, but WebKit would
1676         refuse to load it due to the prohibition on loading remote Web Archives. Even though the
1677         original resource might be from a remote origin, the QuickLook-generated preview is a
1678         trusted local resource, so allow it to be loaded.
1679
1680         No test possible.
1681
1682         * loader/DocumentLoader.cpp:
1683         (WebCore::isRemoteWebArchive): Added. Moved the remote web archive check from
1684         continueAfterContentPolicy() to here, and added a check for responses containing the
1685         QuickLook preview protocol.
1686         (WebCore::DocumentLoader::continueAfterContentPolicy): Called isRemoteWebArchive().
1687
1688 2016-10-13  Dean Jackson  <dino@apple.com>
1689
1690         CSS parsing should use Color not RGBA32
1691         https://bugs.webkit.org/show_bug.cgi?id=163423
1692         <rdar://problem/28766903>
1693
1694         Reviewed by Simon Fraser.
1695
1696         In order to allow CSS to use the ExtendedColor variant of
1697         Color, we need to stop using RGBA32. This is a fairly big
1698         change that goes through all the places in the parser
1699         related to colors, and moves them from RGBA32 to Color.
1700
1701         No change in functionality, so covered by existing tests.
1702
1703         * WebCore.xcodeproj/project.pbxproj: Add the new ColorHash.h file.
1704
1705         * css/CSSPrimitiveValue.cpp: CSSPrimitiveValue now can hold a Color*
1706         rather than an unsigned int for colors.
1707         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
1708         (WebCore::CSSPrimitiveValue::cleanup):
1709         (WebCore::CSSPrimitiveValue::getRGBColorValue):
1710         (WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText):
1711         (WebCore::CSSPrimitiveValue::cloneForCSSOM):
1712         (WebCore::CSSPrimitiveValue::equals):
1713         * css/CSSPrimitiveValue.h: Move to Color* and also use some
1714         nullptrs.
1715         * css/CSSPrimitiveValueMappings.h:
1716         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Add a new inline
1717         constructor.
1718
1719         * css/CSSValuePool.cpp: Move to Color.
1720         (WebCore::CSSValuePool::CSSValuePool):
1721         (WebCore::CSSValuePool::createColorValue):
1722         * css/CSSValuePool.h: Change the ColorValueCache to a new type.
1723
1724         * css/StyleResolver.cpp: Move to Color.
1725         (WebCore::StyleResolver::colorFromPrimitiveValue):
1726         * css/parser/CSSParser.cpp:
1727         (WebCore::parseColorValue):
1728         (WebCore::CSSParser::parseColor):
1729         (WebCore::CSSParser::parseColorFromString):
1730         (WebCore::CSSParser::parseSystemColor):
1731         (WebCore::fastParseColorInternal):
1732         (WebCore::CSSParser::fastParseColor):
1733         (WebCore::CSSParser::parseColorFromValue):
1734         * css/parser/CSSParser.h:
1735         * css/parser/CSSParserFastPaths.cpp:
1736         (WebCore::fastParseColorInternal):
1737         (WebCore::CSSParserFastPaths::parseColor):
1738         * css/parser/CSSPropertyParserHelpers.cpp:
1739         (WebCore::CSSPropertyParserHelpers::consumeColor):
1740         * css/parser/SVGCSSParser.cpp:
1741         (WebCore::CSSParser::parseSVGValue):
1742         (WebCore::CSSParser::parseSVGPaint):
1743         (WebCore::CSSParser::parseSVGColor):
1744         * editing/EditingStyle.cpp:
1745         (WebCore::cssValueToColor):
1746         (WebCore::textColorFromStyle):
1747         (WebCore::backgroundColorFromStyle):
1748         (WebCore::rgbaBackgroundColorInEffect):
1749         (WebCore::EditingStyle::prepareToApplyAt):
1750         (WebCore::isTransparentColorValue):
1751         (WebCore::cssValueToRGBA): Deleted.
1752         * editing/cocoa/HTMLConverter.mm:
1753         (HTMLConverterCaches::colorPropertyValueForNode):
1754         * html/HTMLBodyElement.cpp:
1755         (WebCore::HTMLBodyElement::parseAttribute):
1756         * html/canvas/CanvasGradient.cpp:
1757         (WebCore::CanvasGradient::addColorStop):
1758         * html/canvas/CanvasRenderingContext2D.cpp: Ditto, but leave a FIXME to
1759         remind myself to come back when colorWithOverrideAlpha has been updated.
1760         (WebCore::CanvasRenderingContext2D::setStrokeStyle):
1761         (WebCore::CanvasRenderingContext2D::setFillStyle):
1762         (WebCore::CanvasRenderingContext2D::setShadowColor):
1763         (WebCore::CanvasRenderingContext2D::setShadow):
1764         * html/canvas/CanvasStyle.cpp:
1765         (WebCore::isCurrentColorString):
1766         (WebCore::parseColor):
1767         (WebCore::currentColor):
1768         (WebCore::parseColorOrCurrentColor):
1769         (WebCore::CanvasStyle::createFromString):
1770         (WebCore::CanvasStyle::createFromStringWithOverrideAlpha):
1771         * html/canvas/CanvasStyle.h:
1772         * svg/SVGColor.cpp:
1773         (WebCore::SVGColor::colorFromRGBColorString):
1774
1775         * platform/graphics/Color.h: Add new constructors for the special
1776         empty and deleted Color values used in HashTables.
1777         (WebCore::Color::Color):
1778         (WebCore::Color::isHashTableDeletedValue):
1779         (WebCore::Color::asUint64): New accessor to get the raw uint64_t value.
1780
1781         * platform/graphics/ColorHash.h: Added. Implement the traits for a Color HashTable.
1782         (WTF::ColorHash::hash):
1783         (WTF::ColorHash::equal):
1784         (WTF::HashTraits<WebCore::Color>::emptyValue):
1785         (WTF::HashTraits<WebCore::Color>::constructDeletedValue):
1786         (WTF::HashTraits<WebCore::Color>::isDeletedValue):
1787
1788 2016-10-13  Nan Wang  <n_wang@apple.com>
1789
1790         AX: [Mac] better accessibility support for Summary elements
1791         https://bugs.webkit.org/show_bug.cgi?id=163367
1792         <rdar://problem/28745010>
1793
1794         Reviewed by Chris Fleizach.
1795
1796         Exposed summary elements as AXButton and used the text node's content
1797         as AXTitle. Also exposed the details parent's expanded status on the summary
1798         element, so that users would see it as a collapsed/expanded button.
1799
1800         Changes are covered in the modified tests.
1801
1802         * accessibility/AccessibilityObject.cpp:
1803         (WebCore::AccessibilityObject::parentObjectUnignored):
1804         (WebCore::AccessibilityObject::scrollViewAncestor):
1805         (WebCore::AccessibilityObject::headingElementForNode):
1806         (WebCore::AccessibilityObject::matchedParent):
1807         (WebCore::AccessibilityObject::isDescendantOfObject):
1808         (WebCore::AccessibilityObject::isInsideARIALiveRegion):
1809         (WebCore::AccessibilityObject::elementAccessibilityHitTest):
1810         (WebCore::AccessibilityObject::isExpanded):
1811         (WebCore::AccessibilityObject::isARIAHidden):
1812         (WebCore::AccessibilityObject::focusableAncestor):
1813         (WebCore::AccessibilityObject::editableAncestor):
1814         * accessibility/AccessibilityObject.h:
1815         (WebCore::AccessibilityObject::isSummary):
1816         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1817         (-[WebAccessibilityObjectWrapper _accessibilityListAncestor]):
1818         (-[WebAccessibilityObjectWrapper _accessibilityLandmarkAncestor]):
1819         (-[WebAccessibilityObjectWrapper _accessibilityTableAncestor]):
1820         (-[WebAccessibilityObjectWrapper _accessibilityFieldsetAncestor]):
1821         (-[WebAccessibilityObjectWrapper tableCellParent]):
1822         (-[WebAccessibilityObjectWrapper tableParent]):
1823         (-[WebAccessibilityObjectWrapper convertPointToScreenSpace:]):
1824         (-[WebAccessibilityObjectWrapper convertRectToScreenSpace:]):
1825         (-[WebAccessibilityObjectWrapper detailParentForSummaryObject:]):
1826         (-[WebAccessibilityObjectWrapper detailParentForObject:]):
1827         (matchedParent): Deleted.
1828         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1829         (-[WebAccessibilityObjectWrapper additionalAccessibilityAttributeNames]):
1830         (createAccessibilityRoleMap):
1831         (-[WebAccessibilityObjectWrapper roleDescription]):
1832         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
1833
1834 2016-10-13  Zalan Bujtas  <zalan@apple.com>
1835
1836         [Clean RenderTree] LayoutTests/imported/blink/fast/table/crash-bad-child-table-continuation.html fails.
1837         https://bugs.webkit.org/show_bug.cgi?id=163399
1838
1839         Reviewed by David Hyatt.
1840
1841         When we try to insert a renderer before a child whose direct parent is a (anonymus) RenderTable, continuation logic
1842         should dismiss the RenderTable as the parent and find a more appropriate ancestor.
1843         RenderTables assumes a certain descendant tree structure which might not be available in the continuation.
1844
1845         Will be testable with webkit.org/b/162834
1846
1847         * rendering/RenderInline.cpp:
1848         (WebCore::canUseAsParentForContinuation):
1849         (WebCore::RenderInline::addChildToContinuation):
1850
1851 2016-10-13  Alex Christensen  <achristensen@webkit.org>
1852
1853         Disable URLParser for non-Safari iOS and Mac apps for now
1854         https://bugs.webkit.org/show_bug.cgi?id=163397
1855
1856         Reviewed by Tim Horton.
1857
1858         r207268 was an awful hack, and it was insufficient.
1859         Disable the URLParser for other apps for now.  Hopefully we can enable it everywhere soon.
1860
1861         No change in behavior for testing infrastructure.  
1862         Old URLs were well tested before making the switch, and nothing has changed for them.
1863
1864         * platform/URLParser.cpp:
1865         (WebCore::URLParser::parse):
1866         (WebCore::URLParser::parseHostAndPort):
1867         (WebCore::URLParser::setEnabled):
1868         (WebCore::URLParser::enabled):
1869         * platform/URLParser.h:
1870
1871 2016-10-13  Chris Dumez  <cdumez@apple.com>
1872
1873         Rename [ConstructorTemplate=*] to [LegacyConstructorTemplate=*]
1874         https://bugs.webkit.org/show_bug.cgi?id=163390
1875
1876         Reviewed by Darin Adler.
1877
1878         Rename [ConstructorTemplate=*] to [LegacyConstructorTemplate=*] as the
1879         modern way of doing this is to use a constructor that takes in a
1880         dictionary. I am working on getting rid of this extended attribute
1881         entirely but the remaining uses require better support for union types.
1882
1883         * Modules/applepay/ApplePayValidateMerchantEvent.idl:
1884         * Modules/indexeddb/IDBVersionChangeEvent.idl:
1885         * Modules/mediastream/RTCTrackEvent.idl:
1886         * bindings/scripts/CodeGenerator.pm:
1887         (IsConstructorTemplate):
1888         * bindings/scripts/CodeGeneratorJS.pm:
1889         (GenerateConstructorDefinition):
1890         (IsConstructable):
1891         * bindings/scripts/IDLAttributes.txt:
1892         * dom/Event.idl:
1893         * dom/ProgressEvent.idl:
1894         * dom/UIEvent.idl:
1895         * html/track/TrackEvent.idl:
1896
1897 2016-10-13  Ryan Haddad  <ryanhaddad@apple.com>
1898
1899         Unreviewed, rolling out r207297.
1900
1901         This change broke the iOS build.
1902
1903         Reverted changeset:
1904
1905         "Disable URLParser for non-Safari iOS and Mac apps for now"
1906         https://bugs.webkit.org/show_bug.cgi?id=163397
1907         http://trac.webkit.org/changeset/207297
1908
1909 2016-10-13  Anders Carlsson  <andersca@apple.com>
1910
1911         Get rid of the HistoryItemVector typedef
1912         https://bugs.webkit.org/show_bug.cgi?id=163398
1913
1914         Reviewed by Beth Dakin.
1915
1916         Expand the HistoryitemVector typedef instead to make it more clear what types we are dealing with.
1917
1918         * history/BackForwardList.cpp:
1919         (WebCore::BackForwardList::backListWithLimit):
1920         (WebCore::BackForwardList::forwardListWithLimit):
1921         (WebCore::BackForwardList::entries):
1922         * history/BackForwardList.h:
1923         * history/HistoryItem.cpp:
1924         (WebCore::HistoryItem::children):
1925         * history/HistoryItem.h:
1926         * loader/HistoryController.cpp:
1927         (WebCore::HistoryController::currentFramesMatchItem):
1928
1929 2016-10-13  Antoine Quint  <graouts@apple.com>
1930
1931         [Modern Media Controls] MediaControls base class
1932         https://bugs.webkit.org/show_bug.cgi?id=163387
1933         <rdar://problem/28753955>
1934
1935         Reviewed by Dean Jackson.
1936
1937         Introducing the new MediaControls class which will serve as a basis for all media controls.
1938         We will introduce specific MediaControls subclasses for macOS inline, macOS fullscreen and
1939         iOS inline in future patches.
1940
1941         Tests: media/modern-media-controls/media-controls/media-controls-constructor.html
1942                media/modern-media-controls/media-controls/media-controls-placard.html
1943                media/modern-media-controls/media-controls/media-controls-start-button.html
1944
1945         * Modules/modern-media-controls/controls/media-controls.css: Added.
1946         (.media-controls,):
1947         * Modules/modern-media-controls/controls/media-controls.js: Added.
1948         (MediaControls.):
1949         (MediaControls.prototype.get showsStartButton):
1950         (MediaControls.prototype.set showsStartButton):
1951         (MediaControls.prototype.get showsPlacard):
1952         (MediaControls.prototype.showPlacard):
1953         (MediaControls.prototype.hidePlacard):
1954
1955 2016-10-13  Alex Christensen  <achristensen@webkit.org>
1956
1957         Disable URLParser for non-Safari iOS and Mac apps for now
1958         https://bugs.webkit.org/show_bug.cgi?id=163397
1959
1960         Reviewed by Tim Horton.
1961
1962         r207268 was an awful hack, and it was insufficient.
1963         Disable the URLParser for other apps for now.  Hopefully we can enable it everywhere soon.
1964
1965         No change in behavior for testing infrastructure.  
1966         Old URLs were well tested before making the switch, and nothing has changed for them.
1967
1968         * platform/URLParser.cpp:
1969         (WebCore::URLParser::parse):
1970         (WebCore::URLParser::parseHostAndPort):
1971         (WebCore::URLParser::setEnabled):
1972         (WebCore::URLParser::enabled):
1973         * platform/URLParser.h:
1974
1975 2016-10-13  Antoine Quint  <graouts@apple.com>
1976
1977         [Modern Media Controls] TimeControl and TimeLabel
1978         https://bugs.webkit.org/show_bug.cgi?id=163356
1979         <rdar://problem/28741376>
1980
1981         Reviewed by Dean Jackson.
1982
1983         We introduce the TimeControl and TimeLabel classes. A TimeControl object
1984         provides two TimeLabels, one for the elapsed time, one for the remaining
1985         time, and a Scrubber in between them. Depending on a TimeControl's width,
1986         it will adjust its layout such that the scrubber takes all the available
1987         space between the labels, and can indicate whether it's large enough to
1988         meet the minimal required width to show the scrubber, such that a container
1989         node may decide not to show the TimeControl at all.
1990
1991         TimeLabel nodes simply show an integer time value in miliseconds in a
1992         nicely formatted way.
1993
1994         Tests: media/modern-media-controls/time-control/time-control.html
1995                media/modern-media-controls/time-label/time-label.html
1996
1997         * Modules/modern-media-controls/controls/time-control.js: Added.
1998         (TimeControl.prototype.get width):
1999         (TimeControl.prototype.set width):
2000         (TimeControl.prototype.get isSufficientlyWide):
2001         * Modules/modern-media-controls/controls/time-label.css: Added.
2002         (.time-label):
2003         * Modules/modern-media-controls/controls/time-label.js: Added.
2004         (TimeLabel.prototype.get value):
2005         (TimeLabel.prototype.set value):
2006         (TimeLabel.prototype.commitProperty):
2007         (TimeLabel.prototype._formattedTime):
2008
2009 2016-10-13  Jer Noble  <jer.noble@apple.com>
2010
2011         CRASH at WebCore::SourceBuffer::removeCodedFrames + 37
2012         https://bugs.webkit.org/show_bug.cgi?id=163336
2013
2014         Reviewed by Alex Christensen.
2015
2016         Test: media/media-source/media-source-remove-crash.html
2017
2018         A null-deref crash can occur if a SourceBuffer is removed from a MediaSource after
2019         SourceBuffer.remove() is called, but before the removeTimer is fired.
2020
2021         * Modules/mediasource/SourceBuffer.cpp:
2022         (WebCore::SourceBuffer::removeTimerFired):
2023
2024 2016-10-13  Michael Catanzaro  <mcatanzaro@igalia.com>
2025
2026         [SOUP] SHOULD NEVER BE REACHED ../../Source/WebCore/platform/URL.cpp(1291) : void WebCore::URL::parse(const WTF::String&)
2027         https://bugs.webkit.org/show_bug.cgi?id=163392
2028
2029         Reviewed by Alex Christensen.
2030
2031         Fix the URL constructor to work with URLParser.
2032
2033         * platform/soup/URLSoup.cpp:
2034         (WebCore::URL::URL):
2035
2036 2016-10-13  Ryan Haddad  <ryanhaddad@apple.com>
2037
2038         Unreviewed, rolling out r207286.
2039
2040         Caused LayoutTest http/tests/misc/acid3.html to fail.
2041
2042         Reverted changeset:
2043
2044         "Share inline stylesheets between shadow trees"
2045         https://bugs.webkit.org/show_bug.cgi?id=163353
2046         http://trac.webkit.org/changeset/207286
2047
2048 2016-10-13  Sergio Villar Senin  <svillar@igalia.com>
2049
2050         [css-grid] Use min-size instead of min-content contribution for intrinsic maximums resolution
2051         https://bugs.webkit.org/show_bug.cgi?id=163283
2052
2053         Reviewed by Manuel Rego Casasnovas.
2054
2055         This was recently modified in the specs
2056         https://hg.csswg.org/drafts/diff/575fb847e29d/css-grid/Overview.bs. Specifically this is
2057         addressing the last one. It used to be "min-content contribution" but now it says "min-size
2058         contribution".
2059
2060         * rendering/RenderGrid.cpp:
2061         (WebCore::RenderGrid::currentItemSizeForTrackSizeComputationPhase):
2062
2063 2016-10-11  Sergio Villar Senin  <svillar@igalia.com>
2064
2065         [css-grid] Fix intrinsic maximums resolution with fit-content and auto
2066         https://bugs.webkit.org/show_bug.cgi?id=163282
2067
2068         Reviewed by Manuel Rego Casasnovas.
2069
2070         The step 2.5 in section 12.5 https://drafts.csswg.org/css-grid/#algo-content of the specs,
2071         details how to sizes tracks with intrinsic max track sizing functions.
2072
2073         Not so long ago there were only two max track sizing functions min-content and max-content
2074         (auto was always resolved to max-content). However there were some recent changes that force
2075         us to consider 2 new values: auto (which is not internally translated to max-content
2076         although it still works the same) and specially the newly added fit-content.
2077
2078         Some of the new test cases are commented due to bug http://wkb.ug/163283.
2079
2080         Test: fast/css-grid-layout/grid-intrinsic-maximums.html
2081
2082         * rendering/RenderGrid.cpp:
2083         (WebCore::RenderGrid::shouldProcessTrackForTrackSizeComputationPhase):
2084         * rendering/style/GridTrackSize.h:
2085         (WebCore::GridTrackSize::cacheMinMaxTrackBreadthTypes):
2086         (WebCore::GridTrackSize::hasIntrinsicMinTrackBreadth):
2087         (WebCore::GridTrackSize::hasIntrinsicMaxTrackBreadth):
2088         (WebCore::GridTrackSize::hasAutoOrMinContentMinTrackBreadthAndIntrinsicMaxTrackBreadth):
2089
2090 2016-10-13  Miguel Gomez  <magomez@igalia.com>
2091
2092         [GTK] Video playback doesn't work properly with accelerated compositing disabled
2093         https://bugs.webkit.org/show_bug.cgi?id=163386
2094
2095         Reviewed by Carlos Garcia Campos.
2096
2097         Trigger a repaint of the player when a new frame arrives and accelerated compositing is disabled.
2098
2099         Covered by existent tests.
2100
2101         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2102         (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
2103
2104 2016-10-13  Antti Koivisto  <antti@apple.com>
2105
2106         Share inline stylesheets between shadow trees
2107         https://bugs.webkit.org/show_bug.cgi?id=163353
2108
2109         Reviewed by Ryosuke Niwa and Andreas Kling.
2110
2111         If shadow trees have identical inline stylesheets the data structures can be shared.
2112         In future this will also allow sharing style resolvers.
2113
2114         * css/parser/CSSParserMode.h:
2115         (WebCore::CSSParserContextHash::hash):
2116         (WebCore::CSSParserContextHash::equal):
2117         (WTF::HashTraits<WebCore::CSSParserContext>::constructDeletedValue):
2118         (WTF::HashTraits<WebCore::CSSParserContext>::isDeletedValue):
2119         (WTF::HashTraits<WebCore::CSSParserContext>::emptyValue):
2120
2121             Make CSSParserContext hashable.
2122
2123         * dom/InlineStyleSheetOwner.cpp:
2124         (WebCore::makeInlineStyleSheetCacheKey):
2125         (WebCore::inlineStyleSheetCache):
2126
2127             Implement a simple cache for sharing stylesheets with identical text and context.
2128
2129         (WebCore::InlineStyleSheetOwner::createSheet):
2130         (WebCore::InlineStyleSheetOwner::clearCache):
2131         * dom/InlineStyleSheetOwner.h:
2132         * platform/MemoryPressureHandler.cpp:
2133         (WebCore::MemoryPressureHandler::releaseNoncriticalMemory):
2134
2135 2016-10-13  Antti Koivisto  <antti@apple.com>
2136
2137         Revert patch landed with wrong commit message.
2138
2139 2016-10-12  Per Arne Vollan  <pvollan@apple.com>
2140
2141         [Win] Encode function pointers.
2142         https://bugs.webkit.org/show_bug.cgi?id=163331
2143
2144         Reviewed by Brent Fulgham.
2145
2146         We should encode stored function pointers.
2147
2148         * platform/win/SoftLinking.h:
2149
2150 2016-10-13  Youenn Fablet  <youenn@apple.com>
2151
2152         Remove CachedResourceRequest::mutableResourceRequest
2153         https://bugs.webkit.org/show_bug.cgi?id=163277
2154
2155         Reviewed by Sam Weinig.
2156
2157         No change of behavior.
2158
2159         Removing CachedResourceRequest::mutableResourceRequest requires call sites to either update the ResourceRequest
2160         before creating the CachedResourceRequest or to add methods at CachedResourceRequest.
2161
2162         Adding CachedResourceRequest::releaseResourceRequest for CachedResource constructor.
2163
2164         Most new CachedResourceRequest methods are used by CachedResourceLoader which is passed a CachedResourceRequest.
2165         This allows code in CachedResourceLoader to be easier to read.
2166
2167         * css/CSSImageSetValue.cpp:
2168         (WebCore::CSSImageSetValue::loadBestFitImage):
2169         * css/CSSImageValue.cpp:
2170         (WebCore::CSSImageValue::loadImage):
2171         * dom/ScriptElement.cpp:
2172         (WebCore::ScriptElement::requestScriptWithCache):
2173         * loader/CrossOriginAccessControl.cpp:
2174         (WebCore::createAccessControlPreflightRequest):
2175         * loader/CrossOriginAccessControl.h:
2176         * loader/CrossOriginPreflightChecker.cpp:
2177         (WebCore::CrossOriginPreflightChecker::startPreflight):
2178         (WebCore::CrossOriginPreflightChecker::doPreflight):
2179         * loader/DocumentThreadableLoader.cpp:
2180         (WebCore::DocumentThreadableLoader::loadRequest):
2181         * loader/MediaResourceLoader.cpp:
2182         (WebCore::MediaResourceLoader::requestResource):
2183         * loader/cache/CachedResource.cpp:
2184         (WebCore::CachedResource::CachedResource):
2185         * loader/cache/CachedResourceLoader.cpp:
2186         (WebCore::CachedResourceLoader::requestImage):
2187         (WebCore::CachedResourceLoader::requestUserCSSStyleSheet):
2188         (WebCore::CachedResourceLoader::prepareFetch):
2189         (WebCore::CachedResourceLoader::updateHTTPRequestHeaders):
2190         (WebCore::CachedResourceLoader::requestResource):
2191         (WebCore::acceptHeaderValueFromType): Deleted.
2192         (WebCore::updateRequestAccordingCacheMode): Deleted.
2193         * loader/cache/CachedResourceRequest.cpp:
2194         (WebCore::CachedResourceRequest::setAsPotentiallyCrossOrigin):
2195         (WebCore::CachedResourceRequest::updateForAccessControl):
2196         (WebCore::CachedResourceRequest::upgradeInsecureRequestIfNeeded):
2197         (WebCore::CachedResourceRequest::setDomainForCachePartition):
2198         (WebCore::acceptHeaderValueFromType):
2199         (WebCore::CachedResourceRequest::setAcceptHeaderIfNone):
2200         (WebCore::CachedResourceRequest::updateAccordingCacheMode):
2201         (WebCore::CachedResourceRequest::removeFragmentIdentifierIfNeeded):
2202         (WebCore::CachedResourceRequest::applyBlockedStatus):
2203         * loader/cache/CachedResourceRequest.h:
2204         (WebCore::CachedResourceRequest::releaseResourceRequest):
2205         (WebCore::CachedResourceRequest::setCachingPolicy):
2206         (WebCore::CachedResourceRequest::mutableResourceRequest): Deleted.
2207         (WebCore::CachedResourceRequest::setCacheModeToNoStore): Deleted.
2208         * loader/icon/IconLoader.cpp:
2209         (WebCore::IconLoader::startLoading):
2210         * platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp:
2211         (WebCore::WebCoreAVCFResourceLoader::startLoading):
2212         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
2213         (WebCore::WebCoreAVFResourceLoader::startLoading):
2214
2215 2016-10-13  Antti Koivisto  <antti@apple.com>
2216
2217         Support scoped style for user agent shadow trees
2218         https://bugs.webkit.org/show_bug.cgi?id=163212
2219         <rdar://problem/28715318>
2220
2221         Reviewed by Ryosuke Niwa and Andreas Kling.
2222
2223         This patch adds support for user agent shadow trees that have scoped style. This means
2224         that the shadows can be styled via <style> elements contained in the tree instead of
2225         using pseudo elements on the global UA sheet. Since the style is scoped it can use
2226         normal id and class selectors.
2227
2228         Elements in the shadow tree can still be exposed for author styling if needed by giving
2229         them pseudo ids
2230
2231         The patch also uses the new mechanism for the <meter> element.
2232
2233         The mechanism is not optimized yet, each shadow tree gets its own copy of style-related data
2234         structures. This can be improved later.
2235
2236         * CMakeLists.txt:
2237         * DerivedSources.make:
2238         * WebCore.xcodeproj/project.pbxproj:
2239         * css/ElementRuleCollector.cpp:
2240         (WebCore::MatchRequest::MatchRequest):
2241         (WebCore::ElementRuleCollector::addMatchedRule):
2242         (WebCore::ElementRuleCollector::matchAuthorShadowPseudoElementRules):
2243
2244             Make treeContextOrdinal an int so we can use negative ordinals. This is used to allow author pseudo
2245             elements from earlier tree context to win over the shadow tree (matching CSS scoping spec language).
2246
2247         * css/ElementRuleCollector.h:
2248         * css/StyleResolver.cpp:
2249         (WebCore::StyleResolver::MatchResult::addMatchedProperties):
2250         (WebCore::StyleResolver::CascadedProperties::addImportantMatches):
2251         * css/StyleResolver.h:
2252         * css/html.css:
2253         (meter::-webkit-meter-inner-element): Deleted.
2254         (meter::-webkit-meter-bar): Deleted.
2255         (meter::-webkit-meter-optimum-value): Deleted.
2256         (meter::-webkit-meter-suboptimum-value): Deleted.
2257         (meter::-webkit-meter-even-less-good-value): Deleted.
2258
2259             Remove meter pseudo elements from the UA sheet.
2260
2261         * html/HTMLMeterElement.cpp:
2262         (WebCore::HTMLMeterElement::childShouldCreateRenderer):
2263
2264             Don't create shadow renderers when we have appearance (are using RenderMeter).
2265
2266         (WebCore::setValueClass):
2267
2268             Move this logic here from MeterShadowElement.cpp.
2269             Set both class and pseudo id. The latter is needed to keep author styling working.
2270
2271         (WebCore::HTMLMeterElement::didElementStateChange):
2272         (WebCore::HTMLMeterElement::renderMeter):
2273
2274             RenderMeter is now only instantiated when appearance is enabled.
2275
2276         (WebCore::HTMLMeterElement::didAddUserAgentShadowRoot):
2277
2278             Build the shadow tree out of <div>s instead of special shadow elements.
2279
2280         * html/HTMLMeterElement.h:
2281         * html/shadow/MeterShadowElement.cpp: Removed.
2282         * html/shadow/MeterShadowElement.h: Removed.
2283
2284             Not needed anymore.
2285
2286         * html/shadow/meterElementShadow.css: Added.
2287         (div#inner):
2288         (div#bar):
2289         (div#value):
2290         (div#value.optimum):
2291         (div#value.suboptimum):
2292         (div#value.even-less-good):
2293
2294             Stylesheet for meter element shadow tree using normal id and class selectors.
2295
2296         * style/StyleScope.cpp:
2297         (WebCore::Style::Scope::shouldUseSharedUserAgentShadowTreeStyleResolver):
2298
2299             Switch to per-scope style resolver for UA shadow trees if there is stylesheets in the tree.
2300
2301         (WebCore::Style::Scope::resolver):
2302         (WebCore::Style::Scope::resolverIfExists):
2303         * style/StyleScope.h:
2304
2305 2016-10-12  Chris Dumez  <cdumez@apple.com>
2306
2307         [Web IDL] Drop support for legacy [ConstructorConditional=*]
2308         https://bugs.webkit.org/show_bug.cgi?id=163368
2309
2310         Reviewed by Ryosuke Niwa.
2311
2312         Drop support for legacy [ConstructorConditional=*] webkit-specific IDL
2313         extended attribute. This was introduced to disable DOM4 event
2314         constructors at compile time. However, nowadays, those constructors are
2315         enabled everywhere.
2316
2317         * Configurations/FeatureDefines.xcconfig:
2318         * bindings/scripts/CodeGenerator.pm:
2319         (GenerateConstructorConditionalString): Deleted.
2320         * bindings/scripts/CodeGeneratorJS.pm:
2321         (GenerateConstructorHelperMethods):
2322         * bindings/scripts/IDLAttributes.txt:
2323         * bindings/scripts/test/JS/JSTestInterface.cpp:
2324         (WebCore::JSTestInterfaceConstructor::getConstructData): Deleted.
2325         * bindings/scripts/test/TestInterface.idl:
2326         * dom/UIEvent.idl:
2327
2328 2016-10-12  Chris Dumez  <cdumez@apple.com>
2329
2330         The bindings generator should provide a better error message when it does not find a dictionary definition
2331         https://bugs.webkit.org/show_bug.cgi?id=163377
2332
2333         Reviewed by Ryosuke Niwa.
2334
2335         The bindings generator should provide a better error message when it does
2336         not find a dictionary definition.
2337
2338         * bindings/scripts/CodeGenerator.pm:
2339         (GetDictionaryByName):
2340         * bindings/scripts/CodeGeneratorJS.pm:
2341         (assert):
2342         (GenerateDictionaryImplementationContent):
2343         (GenerateHeader):
2344         (GenerateDictionaryHeader):
2345
2346 2016-10-12  Chris Dumez  <cdumez@apple.com>
2347
2348         Update WebKitMediaKeyMessageEvent / WebKitMediaKeyNeededEvent to stop using legacy [ConstructorTemplate=Event]
2349         https://bugs.webkit.org/show_bug.cgi?id=163369
2350
2351         Reviewed by Ryosuke Niwa.
2352
2353         Update WebKitMediaKeyMessageEvent / WebKitMediaKeyNeededEvent to stop
2354         using legacy [ConstructorTemplate=Event] and use regular constructors
2355         instead.
2356
2357         This also adds support for having dictionary members that are typed
2358         arrays because this was needed.
2359
2360         Test: fast/events/webkit-media-key-events-constructor.html
2361
2362         * Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.cpp:
2363         (WebCore::WebKitMediaKeyMessageEvent::WebKitMediaKeyMessageEvent):
2364         * Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.h:
2365         (WebCore::WebKitMediaKeyMessageEvent::create):
2366         (WebCore::WebKitMediaKeyMessageEvent::createForBindings): Deleted.
2367         * Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.idl:
2368         * Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.cpp:
2369         (WebCore::WebKitMediaKeyNeededEvent::WebKitMediaKeyNeededEvent):
2370         * Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.h:
2371         (WebCore::WebKitMediaKeyNeededEvent::create):
2372         (WebCore::WebKitMediaKeyNeededEvent::createForBindings): Deleted.
2373         * Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.idl:
2374         * bindings/js/JSDOMConvert.h:
2375         (WebCore::Converter<IDLInterface<JSC::GenericTypedArrayView<Adaptor>>>::convert):
2376         * bindings/scripts/CodeGeneratorJS.pm:
2377         (GenerateDefaultValue):
2378         * dom/InputEvent.cpp:
2379         (WebCore::InputEvent::InputEvent):
2380         * dom/InputEvent.h:
2381         * dom/InputEvent.idl:
2382
2383 2016-10-12  Chris Dumez  <cdumez@apple.com>
2384
2385         Update HTMLSelectElement::recalcListItems() to ignore nested optgroup elements
2386         https://bugs.webkit.org/show_bug.cgi?id=163358
2387
2388         Reviewed by Kent Tamura.
2389
2390         Update HTMLSelectElement::recalcListItems() to ignore nested optgroup elements.
2391         As per the specification, we only want optgroup elements that are direct
2392         children of the select element. This also matches the behavior of Chrome.
2393
2394         Test: fast/dom/HTMLSelectElement/nested-optgroup.html
2395
2396         * html/HTMLSelectElement.cpp:
2397         (WebCore::HTMLSelectElement::recalcListItems):
2398
2399 2016-10-12  Zalan Bujtas  <zalan@apple.com>
2400
2401         RenderRubyRun should not mark child renderers dirty at the end of layout.
2402         https://bugs.webkit.org/show_bug.cgi?id=163359
2403         <rdar://problem/28711840>
2404
2405         Reviewed by David Hyatt.
2406
2407         The current layout logic does not support marking renderers dirty for subsequent layouts.
2408         Layout needs to exit with a clean tree.
2409         Should relayoutChild be insufficient, we could also mark the base/text dirty for the justified content.
2410
2411         Test: fast/ruby/rubyrun-has-bad-child.html
2412
2413         * rendering/RenderBlockLineLayout.cpp:
2414         (WebCore::RenderBlockFlow::updateRubyForJustifiedText):
2415         * rendering/RenderRubyRun.cpp:
2416         (WebCore::RenderRubyRun::layout):
2417         (WebCore::RenderRubyRun::layoutBlock):
2418         * rendering/RenderRubyRun.h:
2419
2420 2016-10-12  Simon Fraser  <simon.fraser@apple.com>
2421
2422         Crash when using megaplan.ru
2423         https://bugs.webkit.org/show_bug.cgi?id=163276
2424         rdar://problem/28446672
2425
2426         Reviewed by Sam Weinig.
2427
2428         Make sure we allocate enough space in the vector of CGPoints that we use for path building.
2429
2430         Test: css3/masking/large-clip-path.html
2431
2432         * platform/graphics/cg/PathCG.cpp:
2433         (WebCore::Path::polygonPathFromPoints):
2434
2435 2016-10-12  Alex Christensen  <achristensen@webkit.org>
2436
2437         Fix out-of-bounds reading in URLParser when parsing improperly percent-encoded values
2438         https://bugs.webkit.org/show_bug.cgi?id=163376
2439
2440         Reviewed by Saam Barati.
2441
2442         Covered by new API tests, which used to crash under asan.
2443
2444         * platform/URLParser.cpp:
2445         (WebCore::percentDecode):
2446         If you subtract 2 from size_t's smaller than 2, you're gonna have a bad time.
2447
2448 2016-10-12  Alex Christensen  <achristensen@webkit.org>
2449
2450         Mail needs nonspecial URLs to keep case in host and not have slash after host
2451         https://bugs.webkit.org/show_bug.cgi?id=163373
2452
2453         Reviewed by Saam Barati.
2454         
2455         Mail uses urls like scheme://HoSt which were not changed when canonicalized 
2456         before enabling the URLParser but now are canonicalized to scheme://host/
2457         I manually verified this fixes the issue.
2458         This should be reverted once Mail will accept modern canonicalized URLs.
2459
2460         * platform/URLParser.cpp:
2461         (WebCore::URLParser::parse):
2462         (WebCore::URLParser::parseHostAndPort):
2463         * platform/URLParser.h:
2464         If the application is mail and the scheme is nonspecial, don't make the host lower case and don't add a slash after the host.
2465
2466 2016-10-11  Dean Jackson  <dino@apple.com>
2467
2468         Add preliminary support for extended colors to WebCore::Color
2469         https://bugs.webkit.org/show_bug.cgi?id=162878
2470         <rdar://problem/28596413>
2471
2472         Reviewed by Darin Adler.
2473
2474         Add an ExtendedColor class that will hold the data necessary
2475         for wider-than-sRGB (and more precise) colors. In order to
2476         avoid increasing the size of Color, implement a tagged
2477         pointer that is either referencing an ExtendedColor, or
2478         is a 64-bit number with the top 32-bits being the RGBA, and
2479         the bottom 2 bits indicating an invalid RGBA or a valid RGBA,
2480         plus the tag.
2481
2482         Add copy constructors and operator= so that the new Color objects
2483         are correctly copied.
2484
2485         There isn't yet a way to create an ExtendedColor. That's coming
2486         in a followup patch (and will require changes to the CSS parser).
2487
2488         Covered by existing tests, and new API tests in Color.
2489
2490         * CMakeLists.txt:
2491         * WebCore.xcodeproj/project.pbxproj: Add new files.
2492
2493         * platform/graphics/Color.cpp: Update everything to use m_rgbaAndFlags
2494         instead of m_color + m_valid.
2495         (WebCore::Color::Color):
2496         (WebCore::Color::~Color):
2497         (WebCore::Color::operator=):
2498         (WebCore::Color::nameForRenderTreeAsText):
2499         (WebCore::Color::setNamedColor):
2500         (WebCore::Color::light):
2501         (WebCore::Color::dark):
2502         (WebCore::Color::setValid):
2503         (WebCore::Color::setExtended):
2504         (WebCore::Color::isExtended):
2505         (WebCore::Color::asExtended):
2506         * platform/graphics/Color.h: Implement the tagged union.
2507         (WebCore::Color::Color):
2508         (WebCore::Color::isValid):
2509         (WebCore::Color::red):
2510         (WebCore::Color::green):
2511         (WebCore::Color::blue):
2512         (WebCore::Color::alpha):
2513         (WebCore::Color::rgb):
2514         (WebCore::Color::setRGB):
2515         (WebCore::operator==):
2516
2517         * platform/graphics/ExtendedColor.cpp: New file. Holds floating point
2518         red, green, blue and alpha, plus a color space.
2519         (WebCore::ExtendedColor::create):
2520         (WebCore::ExtendedColor::~ExtendedColor):
2521         (WebCore::ExtendedColor::ref):
2522         (WebCore::ExtendedColor::deref):
2523         * platform/graphics/ExtendedColor.h:
2524         (WebCore::ExtendedColor::red):
2525         (WebCore::ExtendedColor::green):
2526         (WebCore::ExtendedColor::blue):
2527         (WebCore::ExtendedColor::alpha):
2528         (WebCore::ExtendedColor::colorSpace):
2529         (WebCore::ExtendedColor::ExtendedColor):
2530
2531         * platform/graphics/cg/ColorCG.cpp: Update the constructors for
2532         the platform specific color classes.
2533         (WebCore::Color::Color):
2534         * platform/graphics/gtk/ColorGtk.cpp:
2535         (WebCore::Color::Color):
2536         * platform/graphics/win/ColorDirect2D.cpp:
2537         (WebCore::Color::Color):
2538
2539         * rendering/RenderEmbeddedObject.cpp: Use NeverDestroyed.
2540         (WebCore::replacementTextRoundedRectPressedColor):
2541         (WebCore::replacementTextRoundedRectColor):
2542         (WebCore::replacementTextColor):
2543         (WebCore::unavailablePluginBorderColor):
2544
2545         * rendering/RenderFrameSet.cpp: Ditto.
2546         (WebCore::borderStartEdgeColor):
2547         (WebCore::borderEndEdgeColor):
2548         (WebCore::borderFillColor):
2549
2550         * rendering/RenderTableCell.cpp: This grows in size slightly
2551         because it can no longer pack bits.
2552
2553 2016-10-12  Antoine Quint  <graouts@apple.com>
2554
2555         [Modern Media Controls] Sliders: scrubber and volume
2556         https://bugs.webkit.org/show_bug.cgi?id=163328
2557         <rdar://problem/28733838>
2558
2559         Reviewed by Dean Jackson.
2560
2561         We add a new Slider class that provides a custom slider backed by an
2562         invisible <input type="range"> element and a fill underlay to provide
2563         a custom color between the left edge of the slider and the slider thumb.
2564         As the slider's value changes, a UI delegate receives messages to track
2565         such changes.
2566
2567         Tests: media/modern-media-controls/scrubber/scrubber.html
2568                media/modern-media-controls/slider/slider-constructor.html
2569                media/modern-media-controls/slider/slider-fill.html
2570                media/modern-media-controls/slider/slider-styles.html
2571                media/modern-media-controls/volume-slider/volume-slider-value.html
2572                media/modern-media-controls/volume-slider/volume-slider.html
2573
2574         * Modules/modern-media-controls/controls/scrubber.css: Added.
2575         (.scrubber.slider > input::-webkit-slider-thumb):
2576         * Modules/modern-media-controls/controls/scrubber.js: Added.
2577         (Scrubber):
2578         * Modules/modern-media-controls/controls/slider.css: Added.
2579         (.slider):
2580         (.slider > input,):
2581         (.slider > .fill):
2582         (.slider > input):
2583         (.slider > input::-webkit-slider-thumb):
2584         * Modules/modern-media-controls/controls/slider.js: Added.
2585         (Slider.prototype.get value):
2586         (Slider.prototype.set value):
2587         (Slider.prototype.get width):
2588         (Slider.prototype.set width):
2589         (Slider.prototype.handleEvent):
2590         (Slider.prototype.commitProperty):
2591         (Slider.prototype._handleInputEvent):
2592         (Slider.prototype._handleChangeEvent):
2593         (Slider.prototype._updateFill):
2594         * Modules/modern-media-controls/controls/volume-slider.css: Added.
2595         (.volume.slider > input::-webkit-slider-thumb):
2596         * Modules/modern-media-controls/controls/volume-slider.js: Added.
2597         (VolumeSlider):
2598
2599 2016-10-12  Wenson Hsieh  <wenson_hsieh@apple.com>
2600
2601         Add experimental support for the "formatForeColor" inputType
2602         https://bugs.webkit.org/show_bug.cgi?id=163348
2603         <rdar://problem/28739334>
2604
2605         Reviewed by Ryosuke Niwa.
2606
2607         Adds support for the "formatForeColor" attribute. This patch introduces a simple hook in Editor.cpp to extract
2608         data for an input event from an EditingStyle when performing an editing action.
2609
2610         Test: fast/events/input-events-forecolor-data.html
2611
2612         * editing/EditCommand.cpp:
2613         (WebCore::inputTypeNameForEditingAction):
2614         * editing/Editor.cpp:
2615         (WebCore::inputEventDataForEditingStyleAndAction):
2616
2617         Added a new static helper to compute the data attribute of an InputEvent when handling a style change.
2618
2619         (WebCore::Editor::computeAndSetTypingStyle):
2620
2621 2016-10-12  Chris Dumez  <cdumez@apple.com>
2622
2623         [Web IDL] Generated bindings include the wrong header when ImplementedAs is used on a dictionary
2624         https://bugs.webkit.org/show_bug.cgi?id=163352
2625
2626         Reviewed by Ryosuke Niwa.
2627
2628         Generated bindings include the wrong header when ImplementedAs is used
2629         on a dictionary.
2630
2631         * bindings/scripts/CodeGeneratorJS.pm:
2632         (GenerateDictionaryHeader):
2633         * bindings/scripts/test/JS/JSTestObj.cpp:
2634         (WebCore::jsTestObjPrototypeFunctionOperationWithExternalDictionaryParameterCaller):
2635         * bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
2636         (WebCore::convertDictionary<DictionaryImplName>):
2637         (WebCore::convertDictionary<TestStandaloneDictionary>): Deleted.
2638         * bindings/scripts/test/JS/JSTestStandaloneDictionary.h:
2639         * bindings/scripts/test/TestStandaloneDictionary.idl:
2640
2641 2016-10-12  Yusuke Suzuki  <utatane.tea@gmail.com>
2642
2643         [DOMJIT][JSC] Explore the way to embed nodeType into JSC::JSType in WebCore
2644         https://bugs.webkit.org/show_bug.cgi?id=163245
2645
2646         Reviewed by Filip Pizlo.
2647
2648         Node.nodeType accessor is so frequently called. For example, jQuery's $ function uses
2649         this to distinguish DOM objects from the other JS objects. So every time you call `$(dom)`,
2650         nodeType accessor is called. In addition to that, jQuery's prev, next, parent etc. also uses
2651         this `nodeType`. And Ember.js also uses it. And ... So this function is super critical for DOM
2652         performance.
2653
2654         The challenge is that there is no room for putting NodeType into C++ Node class. Node class
2655         has a 32bit field to store some data. However, these bits are already exhausted. Extending
2656         Node class is unacceptable since it significantly enlarges memory consumption of WebKit (Node
2657         is everywhere!). Unfortunately, current Node::nodeType is implemented as a virtual function
2658         even though this function is frequently called from JS world.
2659
2660         Interestingly, we already store some duplicate data in JSObject, JSC::JSType. WebCore already
2661         extends it with JSElementType, JSNodeType, and JSDocumentWrapperType. And these types are
2662         corresponding to specific NodeTypes. For example, JSElementType should have ELEMENT_NODE type.
2663
2664         This patch further extends this JSC::JSType in WebCore side safely. We embed NodeType bits into
2665         JSC::JSType. This design offers significantly faster nodeType implementation. Furthermore, it
2666         makes DOMJIT easy for nodeType accessor.
2667
2668         Even without the IC change[1], Dromaeo dom-query shows 8 - 10% improvement,
2669         1452.96 runs/s vs 1578.56 runs/s. We can expect that this improvement will be applied to the
2670         other benchmarks / real applications when the IC change is landed.
2671
2672         [1]: https://bugs.webkit.org/show_bug.cgi?id=163226
2673
2674         * WebCore.xcodeproj/project.pbxproj:
2675         * bindings/js/JSDOMWrapper.h:
2676         * bindings/js/JSNodeCustom.h:
2677         (WebCore::JSNode::nodeType):
2678         * bindings/scripts/CodeGeneratorJS.pm:
2679         (GetJSTypeForNode):
2680         (GenerateHeader):
2681         * dom/Node.idl:
2682         * dom/NodeConstants.h: Copied from Source/JavaScriptCore/domjit/DOMJITGetterSetter.h.
2683         * domjit/JSNodeDOMJIT.cpp:
2684         (WebCore::createCallDOMForOffsetAccess):
2685         (WebCore::NodeFirstChildDOMJIT::callDOM):
2686         (WebCore::NodeLastChildDOMJIT::callDOM):
2687         (WebCore::NodeNextSiblingDOMJIT::callDOM):
2688         (WebCore::NodePreviousSiblingDOMJIT::callDOM):
2689         (WebCore::NodeParentNodeDOMJIT::callDOM):
2690         (WebCore::NodeNodeTypeDOMJIT::checkDOM):
2691         (WebCore::NodeNodeTypeDOMJIT::callDOM):
2692
2693 2016-10-12  Chris Dumez  <cdumez@apple.com>
2694
2695         Update more events to stop using legacy [ConstructorTemplate=Event]
2696         https://bugs.webkit.org/show_bug.cgi?id=163339
2697
2698         Reviewed by Ryosuke Niwa.
2699
2700         Update more events to stop using legacy [ConstructorTemplate=Event]
2701         and use regular constructors instead.
2702
2703         No new tests, updated existing tests.
2704
2705         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
2706         (WebCore::convertDictionary<TestEventConstructor::Init>):
2707         (WebCore::JSTestEventConstructorConstructor::construct):
2708         (WebCore::JSTestEventConstructorConstructor::prototypeForStructure):
2709         (WebCore::JSTestEventConstructor::JSTestEventConstructor):
2710         (WebCore::JSTestEventConstructor::createPrototype):
2711         (WebCore::JSTestEventConstructorPrototype::create): Deleted.
2712         (WebCore::JSTestEventConstructorPrototype::createStructure): Deleted.
2713         (WebCore::JSTestEventConstructorPrototype::JSTestEventConstructorPrototype): Deleted.
2714         (WebCore::setJSTestEventConstructorConstructor): Deleted.
2715         (WebCore::JSTestEventConstructor::getConstructor): Deleted.
2716         * bindings/scripts/test/JS/JSTestEventConstructor.h:
2717         (WebCore::JSTestEventConstructor::wrapped):
2718         (WebCore::JSTestEventConstructor::create): Deleted.
2719         (WebCore::toJS): Deleted.
2720         (WebCore::toJSNewlyCreated): Deleted.
2721         * bindings/scripts/test/TestEventConstructor.idl:
2722         * css/CSSFontFaceLoadEvent.cpp:
2723         (WebCore::CSSFontFaceLoadEvent::CSSFontFaceLoadEvent):
2724         * css/CSSFontFaceLoadEvent.h:
2725         * css/CSSFontFaceLoadEvent.idl:
2726         * html/canvas/WebGLContextEvent.cpp:
2727         (WebCore::WebGLContextEvent::WebGLContextEvent):
2728         * html/canvas/WebGLContextEvent.h:
2729         * html/canvas/WebGLContextEvent.idl:
2730         * storage/StorageEvent.cpp:
2731         (WebCore::StorageEvent::create):
2732         (WebCore::StorageEvent::StorageEvent):
2733         * storage/StorageEvent.h:
2734         * storage/StorageEvent.idl:
2735
2736 2016-10-12  Andreas Kling  <akling@apple.com>
2737
2738         Make Document::existingAXObjectCache() fast with accessibility disabled.
2739         <https://webkit.org/b/163347>
2740
2741         Reviewed by Antti Koivisto.
2742
2743         Instruments says we were spending 2.3% of Dromaeo/dom-modify.html in this function,
2744         traversing ancestors. Track whether we've ever had a cache, and use that knowledge
2745         to return early if possible.
2746
2747         * dom/Document.cpp:
2748         (WebCore::Document::existingAXObjectCache):
2749         (WebCore::Document::axObjectCache):
2750
2751 2016-10-12  Jeremy Huddleston Sequoia  <jeremyhu@apple.com>
2752
2753         [SOUP] trunk r207192 fails to compile due to missing std::function being unavailable (missing #include <functional>)
2754         https://bugs.webkit.org/show_bug.cgi?id=163340
2755
2756         Reviewed by Michael Catanzaro.
2757
2758         * platform/network/soup/SoupNetworkSession.h: Add missing #include <functional>
2759
2760 2016-10-12  Brent Fulgham  <bfulgham@apple.com>
2761
2762         [WebGL] Revise vertex array attribute checks to account for lazy memory allocation.
2763         https://bugs.webkit.org/show_bug.cgi?id=163149
2764         <rdar://problem/28629774>
2765
2766         Reviewed by Dean Jackson.
2767
2768         Tested by fast/canvas/webgl/webgl-drawarrays-crash-2.html
2769
2770         * html/canvas/WebGLRenderingContextBase.cpp:
2771         (WebCore::WebGLRenderingContextBase::validateVertexAttributes):
2772
2773 2016-10-12  Wenson Hsieh  <wenson_hsieh@apple.com>
2774
2775         Now playing media sessions are always cleared for the active foreground tab
2776         https://bugs.webkit.org/show_bug.cgi?id=163310
2777         <rdar://problem/28573301>
2778
2779         Reviewed by Jer Noble.
2780
2781         Currently, we clear out Now Playing info whenever we set the visibility of Now Playing controls to Never. This
2782         is incorrect, as the Now Playing session needs to still be active (just not visible) in this state. Instead, we
2783         should not be taking the active/foregrounded-ness of a media session for Now Playing into account in
2784         MediaElementSession::canShowControlsManager so that even if a media session is in the active/foreground tab, we
2785         will update the Now Playing session with the latest info. However, when setting the visibility, we now check
2786         and see if the session allows Now Playing visibility, and set the Now Playing visibility to Always or Never
2787         depending on the answer.
2788
2789         Tweaked existing unit tests in NowPlayingControlsTests.
2790
2791         * html/MediaElementSession.cpp:
2792         (WebCore::MediaElementSession::canShowControlsManager):
2793         (WebCore::MediaElementSession::allowsNowPlayingControlsVisibility):
2794         (WebCore::MediaElementSession::pageAllowsNowPlayingControls): Deleted.
2795         * html/MediaElementSession.h:
2796         * platform/audio/PlatformMediaSession.h:
2797         (WebCore::PlatformMediaSession::allowsNowPlayingControlsVisibility):
2798         * platform/audio/mac/MediaSessionManagerMac.mm:
2799         (WebCore::MediaSessionManagerMac::updateNowPlayingInfo):
2800
2801 2016-10-12  Zalan Bujtas  <zalan@apple.com>
2802
2803         Refactor LineLayoutState's float box handling.
2804         https://bugs.webkit.org/show_bug.cgi?id=163286
2805
2806         Reviewed by David Hyatt.
2807         
2808         We keep track of float boxes both per line (RootInlineBox::m_floats) and
2809         per flow block (LineLayoutState::m_floats) during layout.
2810         As we lay out the lines and iterate through RootInlineBox::m_floats, we
2811         increment LineLayoutState::m_floatIndex. This LineLayoutState::m_floatIndex is
2812         later used to find the matching float box in the per-block-flow float list.
2813         This logic works fine as long as the lists and the index manipulation are tightly coded.
2814         However due to the complexity of the line/float layout code, this is no longer the case.
2815
2816         This patch makes float box handling more secure by changing this index based setup
2817         to a list iterator. It helps to eliminate potential vector overflow issues.
2818
2819         LineLayoutState::FloatList (new class) keeps track of all the floats for the block flow.
2820         It groups the float box related functions/members and provides an iterator interface to ensure safer
2821         syncing between this and the line based floats.
2822
2823         No change in functionality.
2824
2825         * rendering/RenderBlockFlow.h:
2826         * rendering/RenderBlockLineLayout.cpp:
2827         (WebCore::RenderBlockFlow::appendFloatingObjectToLastLine):
2828         (WebCore::repaintDirtyFloats):
2829         (WebCore::RenderBlockFlow::layoutRunsAndFloats):
2830         (WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):
2831         (WebCore::RenderBlockFlow::linkToEndLineIfNeeded):
2832         (WebCore::RenderBlockFlow::layoutLineBoxes):
2833         (WebCore::RenderBlockFlow::checkFloatInCleanLine):
2834         (WebCore::RenderBlockFlow::determineStartPosition):
2835         (WebCore::RenderBlockFlow::determineEndPosition):
2836         (WebCore::RenderBlockFlow::repaintDirtyFloats): Deleted.
2837         (WebCore::RenderBlockFlow::checkFloatsInCleanLine): Deleted.
2838         * rendering/line/LineLayoutState.h:
2839         (WebCore::FloatWithRect::create):
2840         (WebCore::FloatWithRect::renderer):
2841         (WebCore::FloatWithRect::rect):
2842         (WebCore::FloatWithRect::everHadLayout):
2843         (WebCore::FloatWithRect::adjustRect):
2844         (WebCore::FloatWithRect::FloatWithRect):
2845         (WebCore::LineLayoutState::FloatList::append):
2846         (WebCore::LineLayoutState::FloatList::setLastFloat):
2847         (WebCore::LineLayoutState::FloatList::lastFloat):
2848         (WebCore::LineLayoutState::FloatList::setLastCleanFloat):
2849         (WebCore::LineLayoutState::FloatList::lastCleanFloat):
2850         (WebCore::LineLayoutState::FloatList::floatWithRect):
2851         (WebCore::LineLayoutState::FloatList::begin):
2852         (WebCore::LineLayoutState::FloatList::end):
2853         (WebCore::LineLayoutState::FloatList::find):
2854         (WebCore::LineLayoutState::FloatList::isEmpty):
2855         (WebCore::LineLayoutState::LineLayoutState):
2856         (WebCore::LineLayoutState::floatList):
2857         (WebCore::LineLayoutState::lastFloat): Deleted.
2858         (WebCore::LineLayoutState::setLastFloat): Deleted.
2859         (WebCore::LineLayoutState::floats): Deleted.
2860         (WebCore::LineLayoutState::floatIndex): Deleted.
2861         (WebCore::LineLayoutState::setFloatIndex): Deleted.
2862
2863 2016-10-12  Said Abou-Hallawa  <sabouhallawa@apple.com>
2864
2865         Unreviewed, fix Windows build break after r207182.
2866
2867         * platform/graphics/cg/ImageDecoderCG.cpp:
2868
2869 2016-10-12  Chris Dumez  <cdumez@apple.com>
2870
2871         Update remaining DOM events to stop using legacy [ConstructorTemplate=Event]
2872         https://bugs.webkit.org/show_bug.cgi?id=163319
2873
2874         Reviewed by Darin Adler.
2875
2876         Update remaining DOM events to stop using legacy [ConstructorTemplate=Event]
2877         and use regular constructors instead.
2878
2879         No new tests, updated existing tests.
2880
2881         * dom/AutocompleteErrorEvent.h:
2882         * dom/AutocompleteErrorEvent.idl:
2883         * dom/BeforeLoadEvent.h:
2884         * dom/BeforeLoadEvent.idl:
2885         * dom/CompositionEvent.cpp:
2886         (WebCore::CompositionEvent::CompositionEvent):
2887         * dom/CompositionEvent.h:
2888         * dom/CompositionEvent.idl:
2889         * dom/ErrorEvent.cpp:
2890         (WebCore::ErrorEvent::ErrorEvent):
2891         * dom/ErrorEvent.h:
2892         * dom/ErrorEvent.idl:
2893         * dom/FocusEvent.cpp:
2894         (WebCore::FocusEvent::FocusEvent):
2895         * dom/FocusEvent.h:
2896         * dom/FocusEvent.idl:
2897         * dom/HashChangeEvent.h:
2898         * dom/HashChangeEvent.idl:
2899         * dom/OverflowEvent.cpp:
2900         (WebCore::OverflowEvent::OverflowEvent):
2901         * dom/OverflowEvent.h:
2902         * dom/OverflowEvent.idl:
2903         * dom/PageTransitionEvent.cpp:
2904         (WebCore::PageTransitionEvent::PageTransitionEvent):
2905         * dom/PageTransitionEvent.h:
2906         * dom/PageTransitionEvent.idl:
2907         * dom/PopStateEvent.cpp:
2908         (WebCore::PopStateEvent::PopStateEvent):
2909         (WebCore::PopStateEvent::create):
2910         * dom/PopStateEvent.h:
2911         * dom/PopStateEvent.idl:
2912         * dom/SecurityPolicyViolationEvent.h:
2913         * dom/SecurityPolicyViolationEvent.idl:
2914         * dom/TouchEvent.cpp:
2915         (WebCore::TouchEvent::TouchEvent):
2916         * dom/TouchEvent.h:
2917         * dom/TouchEvent.idl:
2918         * dom/TransitionEvent.cpp:
2919         (WebCore::TransitionEvent::TransitionEvent):
2920         * dom/TransitionEvent.h:
2921         * dom/TransitionEvent.idl:
2922         * dom/WebKitAnimationEvent.cpp:
2923         (WebCore::WebKitAnimationEvent::WebKitAnimationEvent):
2924         * dom/WebKitAnimationEvent.h:
2925         * dom/WebKitAnimationEvent.idl:
2926         * dom/WebKitTransitionEvent.cpp:
2927         (WebCore::WebKitTransitionEvent::WebKitTransitionEvent):
2928         * dom/WebKitTransitionEvent.h:
2929         * dom/WebKitTransitionEvent.idl:
2930
2931 2016-10-12  Chris Dumez  <cdumez@apple.com>
2932
2933         Stop using PassRefPtr in platform/efl
2934         https://bugs.webkit.org/show_bug.cgi?id=163321
2935
2936         Reviewed by Laszlo Gombos.
2937
2938         Stop using PassRefPtr in platform/efl.
2939
2940         * platform/efl/BatteryProviderEfl.cpp:
2941         (WebCore::batteryProperties):
2942         (WebCore::BatteryProviderEfl::setBatteryStatus):
2943         (WebCore::BatteryProviderEfl::dispatchEvent):
2944         * platform/efl/BatteryProviderEfl.h:
2945         * platform/efl/BatteryProviderEflClient.h:
2946         * platform/efl/PlatformSpeechSynthesisProviderEfl.cpp:
2947         (WebCore::PlatformSpeechSynthesisProviderEfl::voiceName):
2948         (WebCore::PlatformSpeechSynthesisProviderEfl::speak):
2949         * platform/efl/PlatformSpeechSynthesisProviderEfl.h:
2950
2951 2016-10-12  Youenn Fablet  <youenn@apple.com>
2952
2953         Attribute setter binding generated code should use more references
2954         https://bugs.webkit.org/show_bug.cgi?id=163275
2955
2956         Reviewed by Alex Christensen.
2957
2958         No change of behavior.
2959
2960         * bindings/scripts/CodeGeneratorJS.pm:
2961         (JSValueToNative):
2962         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
2963         * bindings/scripts/test/JS/JSTestInterface.cpp:
2964         * bindings/scripts/test/JS/JSTestNode.cpp:
2965         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
2966         * bindings/scripts/test/JS/JSTestObj.cpp:
2967         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
2968         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
2969
2970 2016-10-11  Youenn Fablet  <youenn@apple.com>
2971
2972         Refactor binding generated casted-this checks for methods
2973         https://bugs.webkit.org/show_bug.cgi?id=163198
2974
2975         Reviewed by Darin Adler.
2976
2977         Covered by existing tests and binding rebased tests..
2978
2979         Introducing BindingCaller::callMethod and callPromiseMethod to encapsulate casted-this checks for methods.
2980         This is supported for all methods except seralizer and iterators methods.
2981
2982         Introduced castForMethod similarly to castForAttribute.
2983         Moved this from static methods of JSClass to static methods of BindingCaller<JSClass>
2984         This allows removing the corresponding declarations from JSClass header file.
2985
2986         Note the difference of handling thisValue between the two in case of CustomProxyToJSObject.
2987         This should be made more consistent.
2988
2989         In case of bad casted this check, CustomProxyToJSObject objects will throw a TypeError with an error message like other methods.
2990         Before the patch, a TypeError without error message was thrown.
2991
2992         EventTarget being different, added a specialization of BindingCaller for it.
2993         This allows also removing some binding generated code dedicated to EventTarget.
2994         A similar approach might also be done for CustomProxyToJSObject objects to further simplify the binding generator.
2995
2996
2997         * bindings/js/JSDOMBinding.cpp:
2998         (WebCore::rejectPromiseWithThisTypeError):
2999         * bindings/js/JSDOMBinding.h:
3000         (WebCore::BindingCaller::callPromiseMethod):
3001         (WebCore::BindingCaller::callMethod):
3002         * bindings/js/JSEventTargetCustom.h:
3003         (WebCore::BindingCaller<JSEventTarget>::callMethod):
3004         * bindings/scripts/CodeGeneratorJS.pm:
3005         (GenerateHeader):
3006         (GenerateImplementation):
3007         (GenerateFunctionCastedThis): Deleted.
3008         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
3009         * bindings/scripts/test/JS/JSTestActiveDOMObject.h:
3010         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
3011         * bindings/scripts/test/JS/JSTestCustomNamedGetter.h:
3012         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
3013         * bindings/scripts/test/JS/JSTestEventTarget.h:
3014         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
3015         * bindings/scripts/test/JS/JSTestGlobalObject.h:
3016         * bindings/scripts/test/JS/JSTestInterface.cpp:
3017         * bindings/scripts/test/JS/JSTestInterface.h:
3018         * bindings/scripts/test/JS/JSTestIterable.cpp:
3019         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
3020         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.h:
3021         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
3022         * bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
3023         * bindings/scripts/test/JS/JSTestNode.cpp:
3024         * bindings/scripts/test/JS/JSTestNode.h:
3025         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
3026         * bindings/scripts/test/JS/JSTestNondeterministic.h:
3027         * bindings/scripts/test/JS/JSTestObj.cpp:
3028         * bindings/scripts/test/JS/JSTestObj.h:
3029         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
3030         * bindings/scripts/test/JS/JSTestOverrideBuiltins.h:
3031         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
3032         * bindings/scripts/test/JS/JSTestTypedefs.h:
3033
3034 2016-10-11  Youenn Fablet  <youenn@apple.com>
3035
3036         MediaResourceLoader::requestResource should take a ResourceRequest&& as input
3037         https://bugs.webkit.org/show_bug.cgi?id=160397
3038
3039         Reviewed by Alex Christensen.
3040
3041         No change in behavior.
3042
3043         * loader/MediaResourceLoader.cpp:
3044         (WebCore::MediaResourceLoader::requestResource): Passing a ResourceRequest&& as input parameter.
3045         * loader/MediaResourceLoader.h:
3046         * platform/graphics/PlatformMediaResourceLoader.h: Ditto.
3047         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
3048         (webKitWebSrcStart): Creating an extra copy since MediaResourceLoader::requestResource expects a Resourcerequest&&.
3049
3050 2016-10-11  Chris Dumez  <cdumez@apple.com>
3051
3052         Update AnimationEvent to stop using legacy [ConstructorTemplate=Event]
3053         https://bugs.webkit.org/show_bug.cgi?id=163312
3054
3055         Reviewed by Ryosuke Niwa.
3056
3057         Update AnimationEvent to stop using legacy [ConstructorTemplate=Event]
3058         and use a regular constructor as in the specification:
3059         - https://drafts.csswg.org/css-animations/#interface-animationevent
3060
3061         * dom/AnimationEvent.cpp:
3062         (WebCore::AnimationEvent::AnimationEvent):
3063         * dom/AnimationEvent.h:
3064         * dom/AnimationEvent.idl:
3065
3066 2016-10-11  Chris Dumez  <cdumez@apple.com>
3067
3068         Update DeviceProximityEvent to stop using legacy [ConstructorTemplate=Event]
3069         https://bugs.webkit.org/show_bug.cgi?id=163311
3070
3071         Reviewed by Ryosuke Niwa.
3072
3073         Update DeviceProximityEvent to stop using legacy [ConstructorTemplate=Event]
3074         and use a regular constructor instead, as in the specification:
3075         - https://www.w3.org/TR/2015/WD-proximity-20150903/#deviceproximityevent-interface
3076
3077         * Modules/proximity/DeviceProximityEvent.cpp:
3078         (WebCore::DeviceProximityEvent::DeviceProximityEvent):
3079         * Modules/proximity/DeviceProximityEvent.h:
3080         (WebCore::DeviceProximityEvent::create):
3081         (WebCore::DeviceProximityEventInit::DeviceProximityEventInit): Deleted.
3082         * Modules/proximity/DeviceProximityEvent.idl:
3083
3084 2016-10-11  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
3085
3086         Unreviewed, EFL build fix because of r207173.
3087
3088         * testing/InternalSettings.cpp:
3089         (WebCore::InternalSettings::forcedPrefersReducedMotionValue):
3090
3091 2016-10-11  Said Abou-Hallawa  <sabouhallawa@apple.com>
3092
3093         [CG] Add the option to immediately decode an image frame and control its memory caching
3094         https://bugs.webkit.org/show_bug.cgi?id=163298
3095
3096         Reviewed by Simon Fraser.
3097
3098         This patch fixes two things. (1) An option is added to immediately decode an
3099         image frame. This can be done by adding kCGImageSourceShouldCacheImmediately
3100         to the ImageSource options dictionary. (2) BitmapImage should also control
3101         when the image frame is actually deleted from memory. This can be done by
3102         calling CGImageSourceCreateThumbnailAtIndex(). CG does not keep a reference
3103         to the returned CGImageRef.
3104
3105         * platform/graphics/ImageFrame.h: Adding the DecodingMode enum class.
3106         Ideally this should be a member of ImageDecoder class. But since we
3107         have three header files for ImageDecoder, this can be added here till
3108         the three files combined in one header file.
3109
3110         * platform/graphics/ImageFrameCache.cpp:
3111         (WebCore::ImageFrameCache::setRenderTarget): Deleted.
3112         * platform/graphics/ImageFrameCache.h:
3113         * platform/graphics/ImageSource.cpp:
3114         (WebCore::ImageSource::setRenderTarget):
3115         * platform/graphics/ImageSource.h:
3116         (WebCore::ImageSource::setRenderTarget): Deleted.
3117         Unrelated change. The native image decoder is available from the ImageSource.
3118         ImageSource::setTarget() does not need not to get it through ImageFrameCache.
3119         
3120         * platform/graphics/cg/ImageDecoderCG.cpp:
3121         (WebCore::createImageSourceOptions): Clean this function by using CFMutableDictionary.
3122         (WebCore::imageSourceOptions): Cache two default ImageSource options and create new
3123         ones for the non default cases.
3124
3125         (WebCore::ImageDecoder::createFrameImageAtIndex): Use the appropriate ImageSource function
3126
3127         * platform/graphics/cg/ImageDecoderCG.h:
3128         * platform/graphics/win/ImageDecoderDirect2D.cpp:
3129         (WebCore::ImageDecoder::createFrameImageAtIndex):
3130         * platform/graphics/win/ImageDecoderDirect2D.h:
3131         * platform/image-decoders/ImageDecoder.cpp:
3132         (WebCore::ImageDecoder::createFrameImageAtIndex):
3133         * platform/image-decoders/ImageDecoder.h:
3134          Change functions' signature to include a DecodingMode argument.
3135
3136 2016-10-11  Chris Dumez  <cdumez@apple.com>
3137
3138         select.options may return too many option elements
3139         https://bugs.webkit.org/show_bug.cgi?id=163296
3140
3141         Reviewed by Ryosuke Niwa.
3142
3143         select.options may return too many option elements. We're only supposed
3144         to return the option element children of the select element, and the
3145         option element children of all the optgroup element children of the
3146         select element, in tree order:
3147         - https://html.spec.whatwg.org/#dom-select-options
3148         - https://html.spec.whatwg.org/#concept-select-option-list
3149
3150         Firefox and Chrome agrees with the specification. However, WebKit was
3151         returning all the option elements that are descendants of the select
3152         element.
3153
3154         Test: imported/w3c/web-platform-tests/html/infrastructure/common-dom-interfaces/collections/htmloptionscollection.html
3155
3156         * html/HTMLOptionsCollection.h:
3157
3158 2016-10-11  Alex Christensen  <achristensen@webkit.org>
3159
3160         Fix assertion when creating first WebCore::URL from non-main thread after r207162
3161         https://bugs.webkit.org/show_bug.cgi?id=163304
3162
3163         Reviewed by Filip Pizlo.
3164
3165         This fixes assertions when running UserContentWorld.NormalWorld API tests.
3166
3167         * platform/text/TextEncodingRegistry.cpp:
3168         (WebCore::buildBaseTextCodecMaps):
3169         (WebCore::atomicCanonicalTextEncodingName):
3170         The new URLParser requires a TextEncoding& in its constructor, which defaults to UTF8Encoding.
3171         When creating the first TextEncoding in a process, it calls buildBaseTextCodecMaps which asserts
3172         it's on the main thread because it initializes static variables.  Since we are getting a lock right 
3173         after this call anyway, just put this function call inside the lock.
3174
3175 2016-10-11  Dean Jackson  <dino@apple.com>
3176
3177         color-gamut media query shouldn't ASSERT on invalid values
3178         https://bugs.webkit.org/show_bug.cgi?id=163303
3179         <rdar://problem/28724566>
3180
3181         Reviewed by Simon Fraser.
3182
3183         Remove the ASSERT_NOT_REACHED in the evaluation, since it
3184         can be hit when there is a valid CSS keyword that is not
3185         expected in the query.
3186
3187         Updated fast/media/mq-color-gamut.html
3188
3189         * css/MediaQueryEvaluator.cpp:
3190         (WebCore::colorGamutEvaluate):
3191
3192 2016-10-11  Chris Dumez  <cdumez@apple.com>
3193
3194         Update MediaStream events to stop using legacy [ConstructorTemplate=Event]
3195         https://bugs.webkit.org/show_bug.cgi?id=163289
3196
3197         Reviewed by Sam Weinig.
3198
3199         Update MediaStream events to stop using legacy [ConstructorTemplate=Event]
3200         and use regular constructors instead.
3201
3202         * Modules/mediastream/MediaStreamEvent.cpp:
3203         (WebCore::MediaStreamEvent::create):
3204         (WebCore::MediaStreamEvent::MediaStreamEvent):
3205         * Modules/mediastream/MediaStreamEvent.h:
3206         * Modules/mediastream/MediaStreamEvent.idl:
3207         * Modules/mediastream/MediaStreamTrackEvent.cpp:
3208         (WebCore::MediaStreamTrackEvent::create):
3209         (WebCore::MediaStreamTrackEvent::MediaStreamTrackEvent):
3210         * Modules/mediastream/MediaStreamTrackEvent.h:
3211         * Modules/mediastream/MediaStreamTrackEvent.idl:
3212         * Modules/mediastream/OverconstrainedErrorEvent.h:
3213         (WebCore::OverconstrainedErrorEvent::create):
3214         (WebCore::OverconstrainedErrorEvent::OverconstrainedErrorEvent):
3215         (WebCore::OverconstrainedErrorEvent::~OverconstrainedErrorEvent): Deleted.
3216         * Modules/mediastream/OverconstrainedErrorEvent.idl:
3217         * Modules/mediastream/RTCDTMFToneChangeEvent.cpp:
3218         (WebCore::RTCDTMFToneChangeEvent::create):
3219         (WebCore::RTCDTMFToneChangeEvent::RTCDTMFToneChangeEvent):
3220         * Modules/mediastream/RTCDTMFToneChangeEvent.h:
3221         * Modules/mediastream/RTCDTMFToneChangeEvent.idl:
3222         * Modules/mediastream/RTCTrackEvent.cpp:
3223         (WebCore::RTCTrackEvent::create):
3224         (WebCore::RTCTrackEvent::RTCTrackEvent):
3225         * Modules/mediastream/RTCTrackEvent.h:
3226         * Modules/mediastream/RTCTrackEvent.idl:
3227
3228 2016-10-11  Chris Dumez  <cdumez@apple.com>
3229
3230         Update UIRequestEvent to stop using legacy [ConstructorTemplate=Event]
3231         https://bugs.webkit.org/show_bug.cgi?id=163288
3232
3233         Reviewed by Darin Adler.
3234
3235         Update UIRequestEvent to stop using legacy [ConstructorTemplate=Event]
3236         and use a constructor as in the specification:
3237         - https://dvcs.w3.org/hg/IndieUI/raw-file/default/src/indie-ui-events.html#UIRequestEvent
3238
3239         * Modules/indieui/UIRequestEvent.cpp:
3240         (WebCore::UIRequestEvent::create):
3241         (WebCore::UIRequestEvent::UIRequestEvent):
3242         (WebCore::UIRequestEvent::createForBindings): Deleted.
3243         * Modules/indieui/UIRequestEvent.h:
3244         * Modules/indieui/UIRequestEvent.idl:
3245
3246 2016-10-11  Dean Jackson  <dino@apple.com>
3247
3248         Implement prefers-reduced-motion media query
3249         https://bugs.webkit.org/show_bug.cgi?id=163250
3250         <rdar://problem/28704129>
3251
3252         Reviewed by Simon Fraser.
3253
3254         Implement the prefers-reduced-motion media query, as
3255         described in https://github.com/w3c/csswg-drafts/issues/442.
3256
3257         Tests: fast/media/mq-prefers-reduced-motion-forced-value.html
3258                fast/media/mq-prefers-reduced-motion.html
3259
3260         * Configurations/WebCoreTestSupport.xcconfig: Link against AppKit and UIKit.
3261
3262         * css/CSSValueKeywords.in: New keyword for "reduce".
3263
3264         * css/MediaFeatureNames.h: Add prefers-reduced-motion.
3265         * css/MediaQueryEvaluator.cpp:
3266         (WebCore::prefersReducedMotionEvaluate):
3267         * css/MediaQueryExp.cpp:
3268         (WebCore::featureWithValidIdent):
3269         (WebCore::isFeatureValidWithoutValue):
3270
3271         * platform/Theme.h: New API to detect the system accessibility settings.
3272         (WebCore::Theme::userPrefersReducedMotion):
3273         * platform/ios/ThemeIOS.h:
3274         * platform/ios/ThemeIOS.mm:
3275         (WebCore::ThemeIOS::userPrefersReducedMotion):
3276         * platform/mac/ThemeMac.h:
3277         * platform/mac/ThemeMac.mm:
3278         (WebCore::ThemeMac::userPrefersReducedMotion):
3279
3280         * testing/Internals.cpp: Expose the same API to internals, so that
3281         a test can examine the value too.
3282         (WebCore::Internals::userPrefersReducedMotion):
3283         * testing/Internals.h:
3284         * testing/Internals.idl:
3285         * testing/Internals.mm:
3286         (WebCore::Internals::userPrefersReducedMotion):
3287
3288         * page/Settings.h: New setting to override the system value...
3289         * page/Settings.in:
3290
3291         * testing/InternalSettings.cpp: ... plumbed through internals.
3292         (WebCore::InternalSettings::Backup::Backup):
3293         (WebCore::InternalSettings::Backup::restoreTo):
3294         (WebCore::InternalSettings::forcedPrefersReducedMotionValue):
3295         (WebCore::InternalSettings::setForcedPrefersReducedMotionValue):
3296         * testing/InternalSettings.h:
3297         * testing/InternalSettings.idl:
3298         * testing/Internals.cpp:
3299         (WebCore::Internals::userPrefersReducedMotion):
3300         * testing/Internals.h:
3301         * testing/Internals.idl:
3302         * testing/Internals.mm:
3303         (WebCore::Internals::userPrefersReducedMotion):
3304
3305
3306 2016-10-10  Ryosuke Niwa  <rniwa@webkit.org>
3307
3308         Annotate DOM API with CEReactions
3309         https://bugs.webkit.org/show_bug.cgi?id=163268
3310
3311         Reviewed by Darin Adler.
3312
3313         Added CEReactions IDL attribute to APIs defined in https://dom.spec.whatwg.org.
3314
3315         No new tests since existing tests cover the code change.
3316         Added a dedicated code generation test: JSTestCEReactions.idl and TestCEReactionsStringifier.idl.
3317
3318         * bindings/scripts/CodeGeneratorJS.pm:
3319         (GenerateImplementation): Generate CustomElementReactionStack in attribute setters. In the case of PutForwards,
3320         check the extended attributes of the target attribute's stringifier.
3321         * bindings/scripts/test/JS/JSTestCEReactions.cpp: Added.
3322         * bindings/scripts/test/JS/JSTestCEReactions.h: Added.
3323         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp: Added.
3324         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.h: Added.
3325         * bindings/scripts/test/JS/JSTestObj.cpp:
3326         (WebCore::jsTestObjPrototypeFunctionMethodWithNeedsCustomElementReactionStack): Deleted.
3327         * bindings/scripts/test/TestCEReactions.idl: Added.
3328         * bindings/scripts/test/TestCEReactionsStringifier.idl: Added.
3329         * bindings/scripts/test/TestObj.idl:
3330         * dom/Attr.idl:
3331         * dom/ChildNode.idl:
3332         * dom/Document.idl:
3333         * dom/Element.idl:
3334         * dom/NamedNodeMap.idl:
3335         * dom/Node.idl:
3336         * dom/ParentNode.idl:
3337         * dom/Range.idl:
3338         * html/DOMTokenList.idl:
3339
3340 2016-10-11  Chris Dumez  <cdumez@apple.com>
3341
3342         Update CloseEvent to stop using legacy [ConstructorTemplate=Event]
3343         https://bugs.webkit.org/show_bug.cgi?id=163293
3344
3345         Reviewed by Darin Adler.
3346
3347         Update CloseEvent to stop using legacy [ConstructorTemplate=Event] and
3348         use a regular constructor as in the specification:
3349         - https://html.spec.whatwg.org/multipage/comms.html#the-closeevent-interfaces
3350
3351         No new tests, updated existing test.
3352
3353         * Modules/websockets/CloseEvent.h:
3354         (WebCore::CloseEvent::create):
3355         (WebCore::CloseEvent::CloseEvent):
3356         * Modules/websockets/CloseEvent.idl:
3357
3358 2016-10-11  Yusuke Suzuki  <utatane.tea@gmail.com>
3359
3360         [DOMJIT] DOMJIT::Patchpoint should have a way to receive constant folded arguments
3361         https://bugs.webkit.org/show_bug.cgi?id=163224
3362
3363         Reviewed by Filip Pizlo.
3364
3365         * domjit/DOMJITHelpers.h:
3366         (WebCore::DOMJITHelpers::toWrapper):
3367         * domjit/JSNodeDOMJIT.cpp:
3368         (WebCore::createCallDOMForOffsetAccess):
3369
3370 2016-10-11  Alex Christensen  <achristensen@webkit.org>
3371
3372         Enable URLParser by default
3373         https://bugs.webkit.org/show_bug.cgi?id=162660
3374         <rdar://28601706>
3375
3376         Reviewed by Sam Weinig.
3377
3378         Covered by updates to many LayoutTests.
3379
3380         * platform/URLParser.cpp:
3381         Make the default value true for URLParser::enabled.
3382         This is the most impactful and well-documented one-line change I've ever written.
3383
3384 2016-10-11  Daniel Bates  <dabates@apple.com>
3385
3386         [iOS] REGRESSION (r197953): User gesture required to load video in iOS 9-built apps
3387         https://bugs.webkit.org/show_bug.cgi?id=163244
3388         <rdar://problem/27250015>
3389
3390         Reviewed by Jer Noble.
3391
3392         Adds a new setting to toggle requiring a user gesture to load a video (enabled by default).
3393         Disable this setting for apps built against iOS 9 or earlier.
3394
3395         Tests: media/loadedmetadata-fires-without-user-gesture-when-setRequiresUserGestureToLoadVideo-false.html
3396                media/require-user-gesture-to-load-video.html
3397
3398         * html/HTMLMediaElement.cpp:
3399         (WebCore::HTMLMediaElement::HTMLMediaElement): Only require a user gesture to load a video
3400         when Settings::requiresUserGestureToLoadVideo() is true.
3401         * page/Settings.cpp: Enable setting requiresUserGestureToLoadVideo by default.
3402         * page/Settings.in: Add setting, requiresUserGestureToLoadVideo.
3403
3404 2016-10-11  Sam Weinig  <sam@webkit.org>
3405
3406         Fix the iOS build.
3407
3408         * bindings/js/JSDOMConvert.h:
3409
3410 2016-10-11  Daniel Bates  <dabates@apple.com>
3411
3412         [iOS] Sandbox QuickLook previews
3413         https://bugs.webkit.org/show_bug.cgi?id=163240
3414         <rdar://problem/25961633>
3415
3416         Fix bad merge following r207151.
3417
3418         * platform/network/cf/ResourceResponse.h: Define m_isQuickLook.
3419
3420 2016-10-11  Daniel Bates  <dabates@apple.com>
3421
3422         [iOS] Sandbox QuickLook previews
3423         https://bugs.webkit.org/show_bug.cgi?id=163240
3424         <rdar://problem/25961633>
3425
3426         Reviewed by Brent Fulgham.
3427
3428         Use a unique origin for- and limit the capabilities of- QuickLook previews.
3429
3430         Tests: http/tests/quicklook/at-import-stylesheet-blocked.html
3431                http/tests/quicklook/base-url-blocked.html
3432                http/tests/quicklook/cross-origin-iframe-blocked.html
3433                http/tests/quicklook/csp-header-ignored.html
3434                http/tests/quicklook/document-domain-is-empty-string.html
3435                http/tests/quicklook/external-stylesheet-blocked.html
3436                http/tests/quicklook/hide-referer-on-navigation.html
3437                http/tests/quicklook/submit-form-blocked.html
3438                http/tests/quicklook/top-navigation-blocked.html
3439
3440         * dom/Document.cpp:
3441         (WebCore::Document::processHttpEquiv): Call ContentSecurityPolicy::didReceiveHeader().
3442         (WebCore::Document::processReferrerPolicy): Do not process referrer policy for QuickLook previews.
3443         (WebCore::Document::initSecurityContext): Apply sandbox for QuickLook previews.
3444         (WebCore::Document::shouldEnforceQuickLookSandbox): Added.
3445         (WebCore::Document::applyQuickLookSandbox): Added.
3446         * dom/Document.h:
3447         * page/csp/ContentSecurityPolicy.h: Change accessibility of didReceiveHeader() from private to public.
3448         (WebCore::ContentSecurityPolicy::processHTTPEquiv): Deleted.
3449         * platform/network/cf/ResourceResponse.h:
3450         (WebCore::ResourceResponse::isQuickLook): Added.
3451         (WebCore::ResourceResponse::setIsQuickLook): Added.
3452         * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:
3453         (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveResponse): Modified to mark
3454         resource response as a QuickLook preview, if appropriate. Also remove the name of the first argument
3455         and the need to use UNUSED_PARAM(connection) as we no longer make use of the first argument
3456         following r207151.
3457         * platform/network/ios/QuickLook.mm:
3458         (-[WebResourceLoaderQuickLookDelegate _sendDidReceiveResponseIfNecessary]): Ditto.
3459         * platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
3460         (-[WebCoreResourceHandleAsDelegate connection:didReceiveResponse:]): Ditto. Fix style nits,
3461         including renaming the function argument "r" to "resource" to better describe its purpose.
3462
3463 2016-10-11  Alex Christensen  <achristensen@webkit.org>
3464
3465         Fix bindings tests after r207150.
3466
3467         * bindings/scripts/test/JS/JSTestObj.cpp:
3468         (WebCore::convertDictionary<TestObj::Dictionary>):
3469
3470 2016-10-11  Alex Christensen  <achristensen@webkit.org>
3471
3472         URLParser should percent-encode non-ASCII and non-printable characters in fragment
3473         https://bugs.webkit.org/show_bug.cgi?id=163287
3474
3475         Reviewed by Brady Eidson.
3476
3477         Based on discussion in https://github.com/whatwg/url/issues/150
3478         If that discussion decides to keep the spec as-is (which keeps non-ASCII characters in the fragment
3479         to match IE and Edge's behavior, which Chrome has followed for special schemes) then we can revert
3480         this change later after enabling the URL parser.  Making this change keeps behavior matching Safari
3481         and Firefox, as well as Chrome's handling of non-special schemes, such as data URLs.
3482
3483         Covered by updated API tests.
3484
3485         * platform/URLParser.cpp:
3486         (WebCore::URLParser::appendToASCIIBuffer):
3487         (WebCore::URLParser::copyURLPartsUntil):
3488         (WebCore::URLParser::syntaxViolation):
3489         (WebCore::URLParser::currentPosition):
3490         (WebCore::URLParser::parse):
3491         (WebCore::URLParser::fragmentSyntaxViolation): Deleted.
3492         * platform/URLParser.h:
3493         No more non-ASCII characters in canonicalized URLs.
3494
3495 2016-10-11  Alex Christensen  <achristensen@webkit.org>
3496
3497         Remove dead networking code
3498         https://bugs.webkit.org/show_bug.cgi?id=163263
3499
3500         Reviewed by Daniel Bates.
3501
3502         There are no more Cocoa platforms using CFURLConnection.
3503         USE(CFNETWORK) is being replaced by USE(CFURLCONNECTION) and it is only used on the AppleWin port.
3504
3505         No change in behavior.
3506
3507         * WebCore.xcodeproj/project.pbxproj:
3508         * WebCorePrefix.h:
3509         * loader/DocumentLoader.h:
3510         * loader/EmptyClients.h:
3511         * loader/FrameLoaderClient.h:
3512         * loader/ResourceLoader.cpp:
3513         (WebCore::ResourceLoader::didReceiveAuthenticationChallenge):
3514         * loader/ResourceLoader.h:
3515         * loader/SubresourceLoader.h:
3516         * loader/cf/ResourceLoaderCFNet.cpp:
3517         * loader/cocoa/SubresourceLoaderCocoa.mm:
3518         (WebCore::SubresourceLoader::willCacheResponse): Deleted.
3519         * loader/mac/DocumentLoaderMac.cpp:
3520         * loader/mac/ResourceLoaderMac.mm:
3521         (WebCore::ResourceLoader::willCacheResponse): Deleted.
3522         * page/mac/PageMac.mm:
3523         (WebCore::Page::platformInitialize):
3524         (WebCore::Page::addSchedulePair):
3525         (WebCore::Page::removeSchedulePair):
3526         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3527         (WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForResponseToAuthenticationChallenge):
3528         (WebCore::WebCoreNSURLAuthenticationChallengeClient::create): Deleted.
3529         (WebCore::WebCoreNSURLAuthenticationChallengeClient::WebCoreNSURLAuthenticationChallengeClient): Deleted.
3530         * platform/mac/WebCoreSystemInterface.h:
3531         * platform/network/NetworkStorageSession.h:
3532         * platform/network/ProtectionSpace.h:
3533         * platform/network/ProtectionSpaceBase.cpp:
3534         * platform/network/ResourceHandle.cpp:
3535         * platform/network/ResourceHandle.h:
3536         * platform/network/ResourceHandleClient.cpp:
3537         * platform/network/ResourceHandleClient.h:
3538         (WebCore::ResourceHandleClient::willCacheResponse):
3539         (WebCore::ResourceHandleClient::shouldCacheResponse):
3540         * platform/network/ResourceHandleInternal.h:
3541         (WebCore::ResourceHandleInternal::ResourceHandleInternal):
3542         * platform/network/ResourceRequestBase.cpp:
3543         * platform/network/cf/AuthenticationCF.cpp:
3544         (WebCore::AuthenticationChallenge::AuthenticationChallenge):
3545         (WebCore::createCF):
3546         (WebCore::core):
3547         * platform/network/cf/AuthenticationCF.h:
3548         * platform/network/cf/AuthenticationChallenge.h:
3549         * platform/network/cf/CookieJarCFNet.cpp:
3550         * platform/network/cf/CredentialStorageCFNet.cpp:
3551         (WebCore::CredentialStorage::getFromPersistentStorage):
3552         (WebCore::CredentialStorage::saveToPersistentStorage): Deleted.
3553         * platform/network/cf/LoaderRunLoopCF.cpp:
3554         * platform/network/cf/LoaderRunLoopCF.h:
3555         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
3556         (WebCore::NetworkStorageSession::cookieStorage):
3557         * platform/network/cf/ProtectionSpaceCFNet.cpp:
3558         * platform/network/cf/ProtectionSpaceCFNet.h:
3559         * platform/network/cf/ResourceError.h:
3560         * platform/network/cf/ResourceErrorCF.cpp:
3561         * platform/network/cf/ResourceHandleCFNet.cpp:
3562         (WebCore::shouldSniffConnectionProperty):
3563         (WebCore::ResourceHandle::createCFURLConnection):
3564         (WebCore::ResourceHandle::start):
3565         (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
3566         (WebCore::ResourceHandle::tryHandlePasswordBasedAuthentication):
3567         (WebCore::ResourceHandle::receivedCredential):
3568         (WebCore::ResourceHandle::schedule): Deleted.
3569         (WebCore::ResourceHandle::unschedule): Deleted.
3570         * platform/network/cf/ResourceHandleCFURLConnectionDelegate.cpp:
3571         * platform/network/cf/ResourceHandleCFURLConnectionDelegate.h:
3572         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
3573         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::setupRequest):
3574         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse):
3575         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::canRespondToProtectionSpace):
3576         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.h:
3577         * platform/network/cf/ResourceRequest.h:
3578         (WebCore::ResourceRequest::encodingRequiresPlatformData):
3579         * platform/network/cf/ResourceRequestCFNet.cpp:
3580         (WebCore::findCFURLRequestCopyContentDispositionEncodingFallbackArrayFunction):
3581         (WebCore::ResourceRequest::doUpdatePlatformRequest):
3582         (WebCore::ResourceRequest::doUpdatePlatformHTTPBody):
3583         (WebCore::ResourceRequest::doUpdateResourceRequest):
3584         (WebCore::ResourceRequest::setStorageSession):
3585         (WebCore::findCFURLRequestSetContentDispositionEncodingFallbackArrayFunction): Deleted.
3586         * platform/network/cf/ResourceRequestCFNet.h:
3587         * platform/network/cf/ResourceResponse.h:
3588         (WebCore::ResourceResponse::ResourceResponse):
3589         * platform/network/cf/ResourceResponseCFNet.cpp:
3590         (WebCore::ResourceResponse::cfURLResponse):
3591         (WebCore::ResourceResponse::platformCertificateInfo):
3592         * platform/network/cf/SynchronousLoaderClientCFNet.cpp:
3593         * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:
3594         (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::setupRequest):
3595         (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::setupConnectionScheduling):
3596         (WebCore::adjustMIMETypeIfNecessary):
3597         (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveResponse):
3598         (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::willCacheResponse):
3599         (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::canRespondToProtectionSpace):
3600         * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.h:
3601         * platform/network/cocoa/CredentialCocoa.h:
3602         * platform/network/cocoa/CredentialCocoa.mm:
3603         (WebCore::Credential::Credential): Deleted.
3604         (WebCore::Credential::cfCredential): Deleted.
3605         * platform/network/cocoa/ProtectionSpaceCocoa.h:
3606         * platform/network/cocoa/ProtectionSpaceCocoa.mm:
3607         (WebCore::ProtectionSpace::ProtectionSpace): Deleted.
3608         (WebCore::ProtectionSpace::cfSpace): Deleted.
3609         * platform/network/cocoa/ResourceRequestCocoa.mm:
3610         (WebCore::ResourceRequest::nsURLRequest):
3611         * platform/network/cocoa/ResourceResponseCocoa.mm:
3612         (WebCore::ResourceResponse::platformCertificateInfo):
3613         (WebCore::ResourceResponse::nsURLResponse): Deleted.
3614         (WebCore::ResourceResponse::ResourceResponse): Deleted.
3615         * platform/network/ios/QuickLook.h:
3616         * platform/network/ios/QuickLook.mm:
3617         (-[WebQuickLookHandleAsDelegate initWithConnectionDelegate:]): Deleted.
3618         (-[WebQuickLookHandleAsDelegate connection:didReceiveDataArray:]): Deleted.
3619         (-[WebQuickLookHandleAsDelegate connection:didReceiveData:lengthReceived:]): Deleted.
3620         (-[WebQuickLookHandleAsDelegate connectionDidFinishLoading:]): Deleted.
3621         (-[WebQuickLookHandleAsDelegate connection:didFailWithError:]): Deleted.
3622         (-[WebQuickLookHandleAsDelegate detachHandle]): Deleted.
3623         (WebCore::QuickLookHandle::create): Deleted.
3624         (WebCore::QuickLookHandle::cfResponse): Deleted.
3625         * platform/network/ios/ResourceHandleIOS.mm: Removed.
3626         * platform/network/ios/ResourceRequestIOS.mm: Removed.
3627         * platform/network/mac/AuthenticationMac.mm:
3628         (-[WebCoreAuthenticationClientAsChallengeSender setCFChallenge:]): Deleted.
3629         (-[WebCoreAuthenticationClientAsChallengeSender cfChallenge]): Deleted.
3630         (WebCore::core): Deleted.
3631         (WebCore::mac): Deleted.
3632         * platform/network/mac/CookieJarMac.mm:
3633         (WebCore::setCookiesFromDOM):
3634         (WebCore::cookieStorage):
3635         (WebCore::addCookie):
3636         * platform/network/mac/CredentialStorageMac.mm:
3637         * platform/network/mac/FormDataStreamMac.h:
3638         * platform/network/mac/FormDataStreamMac.mm:
3639         * platform/network/mac/ResourceErrorMac.mm:
3640         (NSErrorFromCFError): Deleted.
3641         (WebCore::ResourceError::ResourceError): Deleted.
3642         (WebCore::ResourceError::nsError): Deleted.
3643         (WebCore::ResourceError::operator NSError *): Deleted.
3644         * platform/network/mac/ResourceHandleMac.mm:
3645         (WebCore::ResourceHandle::continueWillCacheResponse):
3646         (WebCore::ResourceHandle::getConnectionTimingData): Deleted.
3647         * platform/network/mac/ResourceRequestMac.mm: Removed.
3648         * platform/network/mac/SynchronousLoaderClient.mm:
3649         (WebCore::SynchronousLoaderClient::platformBadResponseError):
3650         * platform/network/mac/WebCoreResourceHandleAsDelegate.h:
3651         * platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
3652         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.h:
3653         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
3654         * platform/network/mac/WebCoreURLResponse.mm:
3655         (WebCore::synthesizeRedirectResponseIfNecessary):
3656         * platform/win/TemporaryLinkStubs.cpp:
3657         * testing/js/WebCoreTestSupportPrefix.h:
3658
3659 2016-10-10  Sam Weinig  <sam@webkit.org>
3660
3661         Use IDLTypes in more places
3662         https://bugs.webkit.org/show_bug.cgi?id=163247
3663
3664         Reviewed by Darin Adler.
3665
3666         Switch JS -> Native type conversions to use convert<IDLType>(...) rather
3667         than convert<NativeType>(...). This allows us to differentiate things like
3668         conversion from JSValue to DOMString vs. JSValue to USVString which have different
3669         rules.
3670
3671         * bindings/generic/IDLTypes.h:
3672         Add predicate for integer types.
3673
3674         * bindings/js/IDBBindingUtilities.cpp:
3675         (WebCore::idbKeyPathFromValue):
3676         * bindings/js/JSApplePaySessionCustom.cpp:
3677         (WebCore::JSApplePaySession::completeShippingMethodSelection):
3678         (WebCore::JSApplePaySession::completeShippingContactSelection):
3679         * bindings/js/JSCryptoAlgorithmDictionary.cpp:
3680         (WebCore::createAesKeyGenParams):
3681         (WebCore::createRsaKeyGenParams):
3682         * bindings/js/JSCustomElementRegistryCustom.cpp:
3683         (WebCore::JSCustomElementRegistry::define):
3684         * bindings/js/JSDocumentCustom.cpp:
3685         (WebCore::JSDocument::getCSSCanvasContext):
3686         * bindings/js/JSMockContentFilterSettingsCustom.cpp:
3687         (WebCore::JSMockContentFilterSettings::setDecisionPoint):
3688         (WebCore::toDecision):
3689         * bindings/js/JSNodeFilterCustom.cpp:
3690         (WebCore::JSNodeFilter::acceptNode):
3691         Switch to new convert<IDLType> style.
3692
3693         * bindings/js/JSDOMBinding.h:
3694         (WebCore::toRefPtrNativeArray): Deleted.
3695         (WebCore::toNativeArray): Deleted.
3696         These can now be called as convert<IDLSequence<IDLInterface<T>>> and convert<IDLType> respectively.
3697
3698         * bindings/js/JSDOMConvert.h:
3699         (WebCore::Converter<IDLNullable<T>>::convert):
3700         (WebCore::Converter<IDLBoolean>::convert):
3701         (WebCore::Converter<IDLInterface<T>>::convert):
3702         (WebCore::Converter<IDLByte>::convert):
3703         (WebCore::Converter<IDLOctet>::convert):
3704         (WebCore::Converter<IDLShort>::convert):
3705         (WebCore::Converter<IDLUnsignedShort>::convert):
3706         (WebCore::Converter<IDLLong>::convert):
3707         (WebCore::Converter<IDLUnsignedLong>::convert):
3708         (WebCore::Converter<IDLLongLong>::convert):
3709         (WebCore::Converter<IDLUnsignedLongLong>::convert):
3710         (WebCore::Converter<IDLFloat>::convert):
3711         (WebCore::Converter<IDLUnrestrictedFloat>::convert):
3712         (WebCore::Converter<IDLDouble>::convert):
3713         (WebCore::Converter<IDLUnrestrictedDouble>::convert):
3714         (WebCore::Converter<IDLDOMString>::convert):
3715         (WebCore::Converter<IDLUSVString>::convert):
3716         (WebCore::Detail::ArrayConverter::convert):
3717         (WebCore::Converter<IDLSequence<T>>::convert):
3718         (WebCore::Converter<IDLFrozenArray<T>>::convert):
3719         (WebCore::Converter<IDLDictionary<T>>::convert):
3720         (WebCore::Converter<IDLEnumeration<T>>::convert):
3721         (WebCore::Detail::VariadicConverterBase::convert):
3722         (WebCore::Detail::VariadicConverterBase<IDLInterface<T>>::convert):
3723         (WebCore::convertVariadicArguments):
3724         (WebCore::convertWrapperType): Deleted.
3725         (WebCore::convertWrapperTypeSequence): Deleted.
3726         (WebCore::Converter<bool>::convert): Deleted.
3727         (WebCore::Converter<String>::convert): Deleted.
3728         (WebCore::Converter<Vector<T>>::convert): Deleted.
3729         (WebCore::Converter<int8_t>::convert): Deleted.
3730         (WebCore::Converter<uint8_t>::convert): Deleted.
3731         (WebCore::Converter<int16_t>::convert): Deleted.
3732         (WebCore::Converter<uint16_t>::convert): Deleted.
3733         (WebCore::Converter<int32_t>::convert): Deleted.
3734         (WebCore::Converter<uint32_t>::convert): Deleted.
3735         (WebCore::Converter<int64_t>::convert): Deleted.
3736         (WebCore::Converter<uint64_t>::convert): Deleted.
3737         Switch Converter to be specialized on IDLTypes. Add support for IDLNullable, IDLSequence, and IDLFrozenArray.
3738
3739         * bindings/scripts/CodeGenerator.pm:
3740         (GetFlattenedMemberTypes): Deleted.
3741         (GetNumberOfNullableMemberTypes): Deleted.
3742         (GetIDLUnionMemberTypes): Deleted.
3743         (GetBaseIDLType): Deleted.
3744         (GetIDLType): Deleted.
3745         Move IDLType conversion logic to CodeGeneratorJS so it can use GetEnumerationClassName and GetDictionaryClassName.
3746
3747         * bindings/scripts/CodeGeneratorJS.pm:
3748         (AddToImplIncludesForIDLType):
3749         Add support for sequences, FrozenArrays and external dictionaries.
3750
3751         (GenerateEnumerationsImplementationContent):
3752         (GenerateEnumerationsHeaderContent):
3753         Change the name of parse<enum> and convert<enum> to parseEnumeration<enum> and convertEnumeration<enum>
3754         to make them more consistent with dictionary conversion specialization and not interfere with the convert
3755         function specialization.
3756
3757         (GenerateDictionaryImplementationContent):
3758         Simplify by using convert<IDLType>.
3759
3760         (GetFlattenedMemberTypes):
3761         (GetNumberOfNullableMemberTypes):
3762         (GetIDLUnionMemberTypes):
3763         (GetBaseIDLType):
3764         (GetIDLType):
3765         Moved from CodeGenerator.pm
3766
3767         (IsHandledByDOMConvert):
3768         (JSValueToNative):
3769         Start switching JSValueToNative over to using convert<IDLType>. Use IsHandledByDOMConvert as a predicate
3770         for what is supported.
3771
3772         * bindings/scripts/IDLParser.pm:
3773         (applyTypedefs):
3774         (cloneType):
3775         (applyTypedefsForSignature):
3776         (parseTypedef):
3777         (parseOperationOrIterator):
3778         (parseSpecialOperation):
3779         Make typedefs work with aggregate types (unions, sequences and FrozenArrays).
3780
3781         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
3782         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
3783         * bindings/scripts/test/JS/JSTestObj.cpp:
3784         * bindings/scripts/test/JS/JSTestObj.h:
3785         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
3786         * bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
3787         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
3788         Update test results.
3789
3790         * bindings/scripts/test/TestTypedefs.idl:
3791         Add additional tests for typedefs that use unions and sequences.
3792
3793         * testing/InternalSettings.idl:
3794         Change the name of a parameter to avoid a name collision.
3795
3796 2016-10-11  Konstantin Tokarev  <annulen@yandex.ru>
3797
3798         Fixed compilation with !ENABLE(SVG_FONTS)
3799         https://bugs.webkit.org/show_bug.cgi?id=163281
3800
3801         Reviewed by Csaba Osztrogonác.
3802
3803         No new tests needed.
3804
3805         * loader/cache/CachedResourceLoader.cpp:
3806         (WebCore::CachedResourceLoader::shouldUpdateCachedResourceWithCurrentRequest):
3807
3808 2016-10-11  Brent Fulgham  <bfulgham@apple.com>
3809
3810         Unreviewed build fix after r207140.
3811
3812         * PlatformAppleWin.cmake: Add missing compile file.
3813
3814 2016-10-10  Brent Fulgham  <bfulgham@apple.com>
3815
3816         [Win][Direct2D] Add initial Pattern handling implementation
3817         https://bugs.webkit.org/show_bug.cgi?id=163270
3818
3819         Reviewed by Simon Fraser.
3820
3821         Provide an implemenation of Patterns for Direct2D.
3822
3823         No new tests. Covered by fast/borders/border-image-01.html and others.
3824
3825         * platform/graphics/GraphicsContext.h:
3826         * platform/graphics/Pattern.h: Add D2D definitions.
3827         * platform/graphics/win/GraphicsContextDirect2D.cpp:
3828         (WebCore::GraphicsContext::solidStrokeBrush): Use a more generic return type.
3829         (WebCore::GraphicsContext::solidFillBrush): Ditto.
3830         (WebCore::GraphicsContext::patternStrokeBrush): Added.
3831         (WebCore::GraphicsContext::patternFillBrush): Added.
3832         (WebCore::GraphicsContext::drawPattern): Provide D2D implementation.
3833         (WebCore::GraphicsContext::applyStrokePattern): Ditto.
3834         (WebCore::GraphicsContext::applyFillPattern): Ditto.
3835         (WebCore::GraphicsContext::drawPath): Use stroke pattern if available.
3836         (WebCore::GraphicsContext::fillPath): Use fill pattern if available.
3837         (WebCore::GraphicsContext::strokePath): Use stroke pattern if available.
3838         (WebCore::GraphicsContext::fillRect): Use fill pattern if available.
3839         * platform/graphics/win/GraphicsContextPlatformPrivateDirect2D.h:
3840         * platform/graphics/win/PatternDirect2D.cpp: Added.
3841
3842 2016-10-11  Per Arne Vollan  <pvollan@apple.com>
3843
3844         [Win] Compile fix.
3845         https://bugs.webkit.org/show_bug.cgi?id=163272
3846
3847         Reviewed by Brent Fulgham.
3848
3849         When compiling with older SDKs, some CoreText symbols are redefined.
3850         This patch checks if the relevant CoreText header file has been
3851         included before defining the symbol.
3852
3853         * platform/spi/win/CoreTextSPIWin.h:
3854
3855 2016-10-11  Antoine Quint  <graouts@apple.com>
3856
3857         [Modern Media Controls] Buttons container
3858         https://bugs.webkit.org/show_bug.cgi?id=163238
3859         <rdar://problem/28701864>
3860
3861         Reviewed by Dean Jackson.
3862
3863         We add a new ButtonsContainer class which contains a group of Button objects
3864         and positions them based on the provided padding and margin between buttons.
3865         Buttons that aren't enabled or marked as dropped are not added to the tree of
3866         LayoutNodes, and thus the DOM.
3867
3868         Additionally, we fix a few issues we found while working on tests for ButtonsContainer
3869         where LayoutNodes would schedule layout callbacks even when they would not do any work
3870         during the layout callback due to not resetting the `needsLayout` flag to false and
3871         removing any scheduled tasks when a layout was completed.
3872
3873         Finally, we fix a few style issues that had not been caught so far and an unused
3874         `size` property on IconButton.
3875
3876         Tests: media/modern-media-controls/buttons-container/buttons-container-buttons-property.html
3877                media/modern-media-controls/buttons-container/buttons-container-constructor.html
3878                media/modern-media-controls/buttons-container/buttons-container-layout.html
3879
3880         * Modules/modern-media-controls/controls/airplay-button.js:
3881         (AirplayButton.prototype.set on):
3882         (AirplayButton):
3883         * Modules/modern-media-controls/controls/buttons-container.css:
3884         (.buttons-container):
3885         * Modules/modern-media-controls/controls/buttons-container.js:
3886         (ButtonsContainer.prototype.get buttons):
3887         (ButtonsContainer.prototype.set buttons):
3888         (ButtonsContainer.prototype.layout):
3889         * Modules/modern-media-controls/controls/icon-button.js:
3890         * Modules/modern-media-controls/controls/layout-node.js:
3891         (LayoutNode.prototype.set needsLayout):
3892         (LayoutNode.prototype.markDirtyProperty):
3893         (LayoutNode.prototype._markNodeManipulation):
3894         (LayoutNode.prototype._updateDirtyState):
3895         (performScheduledLayout):
3896         (elementFromString):
3897         * Modules/modern-media-controls/controls/scheduler.js:
3898         (const.scheduler.new.prototype.unscheduleLayout):
3899
3900 2016-10-11  Youenn Fablet  <youenn@apple.com>
3901
3902         [Fetch API] Support Request cache mode
3903         https://bugs.webkit.org/show_bug.cgi?id=162281
3904
3905         Reviewed by Alex Christensen.
3906
3907         Covered by updated test.
3908
3909         Added support for only-if-cached mode at Request level.
3910
3911         Added support for cache mode at CachedResourceLoader, by setting HTTP headers and ResourceRequest cache policy
3912         based on https://fetch.spec.whatwg.org/#concept-request-cache-mode and https://fetch.spec.whatwg.org/#http-network-or-cache-fetch.
3913
3914         Disabled default cache policy computation (done in FrameLoader) when cache mode is different from the default.
3915         Activated no-store cache mode for EventSource as per https://html.spec.whatwg.org/#the-eventsource-interface.
3916
3917         * Modules/fetch/FetchRequest.cpp:
3918         (WebCore::setCache): Adding support for only-if-cached.
3919         (WebCore::buildOptions): Throw if only-if-cached and fetch mode is not same-origin.
3920         * loader/FetchOptions.h: Adding support for only-if-cached.
3921         * loader/FrameLoader.cpp:
3922         (WebCore::FrameLoader::defaultRequestCachingPolicy): Introduced to ease readability.
3923         (WebCore::FrameLoader::addExtraFieldsToRequest): Updating cache policy only if request has the default cache policy.
3924         This allows bypassing the default behavior for fetch cache mode different from "default".
3925         * loader/FrameLoader.h:
3926         * loader/cache/CachedResourceLoader.cpp:
3927         (WebCore::updateRequestAccordingCacheMode): Introduced to set headers and request cache policy according fetch cache mode.
3928         (WebCore::CachedResourceLoader::requestResource):
3929         (WebCore::CachedResourceLoader::loadResource):
3930         (WebCore::CachedResourceLoader::determineRevalidationPolicy): Ensure bypassing the memory cache in no-store and reload cases.
3931         We reload in case of cache mode=reload to refresh the meory cache entry.
3932         * loader/cache/CachedResourceRequest.h:
3933         (WebCore::CachedResourceRequest::setCacheModeToNoStore):
3934         * page/EventSource.cpp:
3935         (WebCore::EventSource::connect): Use no-store cache mode as per https://html.spec.whatwg.org/#the-eventsource-interface.
3936         * platform/network/HTTPHeaderMap.cpp:
3937         (WebCore::HTTPHeaderMap::addIfNotPresent): Helper routine.
3938         * platform/network/HTTPHeaderMap.h:
3939         * platform/network/HTTPHeaderValues.cpp:
3940         * platform/network/HTTPHeaderValues.h:
3941         * platform/network/ResourceRequestBase.cpp:
3942         (WebCore::ResourceRequestBase::addHTTPHeaderFieldIfNotPresent):
3943         (WebCore::ResourceRequestBase::addHTTPHeaderField):
3944         (WebCore::ResourceRequestBase::hasHTTPHeaderField):
3945         * platform/network/ResourceRequestBase.h:
3946
3947 2016-10-10  Antti Koivisto  <antti@apple.com>
3948
3949         Stop copying author shadow pseudo rules into shadow tree style resolver
3950         https://bugs.webkit.org/show_bug.cgi?id=163232
3951
3952         Reviewed by Darin Adler.
3953
3954         * css/ElementRuleCollector.cpp:
3955         (WebCore::ElementRuleCollector::collectMatchingRules):
3956         (WebCore::ElementRuleCollector::matchAuthorRules):
3957         (WebCore::ElementRuleCollector::matchAuthorShadowPseudoElementRules):
3958
3959             If we are resolving a user agent shadow tree also look up pseudo element rules from the host scope author sheet.
3960             This is needed to keep web exposed ::-webkit-foo pseudo elements working.
3961
3962         (WebCore::ElementRuleCollector::collectMatchingShadowPseudoElementRules):
3963
3964             Factor to a function.
3965
3966         * css/ElementRuleCollector.h:
3967         * css/RuleSet.cpp:
3968         (WebCore::RuleSet::copyShadowPseudoElementRulesFrom): Deleted.
3969         * css/RuleSet.h:
3970         * dom/Document.cpp:
3971         (WebCore::Document::userAgentShadowTreeStyleResolver):
3972         * style/StyleScope.cpp:
3973         (WebCore::Style::Scope::updateStyleResolver):
3974
3975             No need to awkwardly copy these rules anymore.
3976
3977 2016-10-11  Chris Dumez  <cdumez@apple.com>
3978
3979         Update IDBVersionChangeEvent to stop using legacy [ConstructorTemplate=Event]
3980         https://bugs.webkit.org/show_bug.cgi?id=163266
3981
3982         Reviewed by Darin Adler.
3983
3984         Update IDBVersionChangeEvent to stop using legacy [ConstructorTemplate=Event]
3985         and use a regular constructor instead, as in the specification:
3986         - http://w3c.github.io/IndexedDB/#request-idbversionchangeevent
3987
3988         This patch also fixes a bug where the IDBVersionChangeEvent was ignoring the
3989         EventInit dictionary members passed by the JavaScript (e.g. bubbles).
3990
3991         No new tests, updated existing test.
3992
3993         * Modules/indexeddb/IDBVersionChangeEvent.cpp:
3994         (WebCore::IDBVersionChangeEvent::IDBVersionChangeEvent):
3995         * Modules/indexeddb/IDBVersionChangeEvent.h:
3996         * Modules/indexeddb/IDBVersionChangeEvent.idl:
3997         * bindings/js/JSDOMConvert.h:
3998         (WebCore::convertNullable):
3999         (WebCore::convert): Deleted.
4000         * bindings/scripts/CodeGeneratorJS.pm:
4001         (GenerateDefaultValue):
4002         (GenerateDictionaryImplementationContent):
4003         * bindings/scripts/test/JS/JSTestObj.cpp:
4004         (WebCore::convertDictionary<TestObj::Dictionary>):
4005         * bindings/scripts/test/TestObj.idl:
4006
4007 2016-10-11  Chris Dumez  <cdumez@apple.com>
4008
4009         Update WebKitPlaybackTargetAvailabilityEvent to stop using legacy [ConstructorTemplate=Event]
4010         https://bugs.webkit.org/show_bug.cgi?id=163265
4011
4012         Reviewed by Darin Adler.
4013
4014         Update WebKitPlaybackTargetAvailabilityEvent to stop using legacy
4015         [ConstructorTemplate=Event] and use a regular constructor instead.
4016
4017         * Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.cpp:
4018         (WebCore::WebKitPlaybackTargetAvailabilityEvent::WebKitPlaybackTargetAvailabilityEvent):
4019         * Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.h:
4020         (WebCore::WebKitPlaybackTargetAvailabilityEvent::createForBindings):
4021         (WebCore::WebKitPlaybackTargetAvailabilityEvent::~WebKitPlaybackTargetAvailabilityEvent): Deleted.
4022         * Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.idl:
4023
4024 2016-10-10  Zan Dobersek  <zdobersek@igalia.com>
4025
4026         Add ENABLE_ENCRYPTED_MEDIA configuration option
4027         https://bugs.webkit.org/show_bug.cgi?id=163219