1 2016-10-22 Chris Dumez <cdumez@apple.com>
3 WebGLRenderingContextBase.texImage2D() should use a union instead of overloading
4 https://bugs.webkit.org/show_bug.cgi?id=163856
6 Reviewed by Darin Adler.
8 WebGLRenderingContextBase.texImage2D() should use a union instead of overloading:
9 - https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14
11 * html/canvas/WebGLRenderingContextBase.cpp:
12 (WebCore::WebGLRenderingContextBase::texImage2D):
13 * html/canvas/WebGLRenderingContextBase.h:
14 * html/canvas/WebGLRenderingContextBase.idl:
16 2016-10-22 Antti Koivisto <antti@apple.com>
18 REGRESSION(r207669): Dromaeo/jslib-style-jquery.html regressed >20%
19 https://bugs.webkit.org/show_bug.cgi?id=163851
21 Reviewed by Darin Adler.
23 The test calls Scope::flushPendingUpdate a lot and nothing ever happens there.
25 Add a separate invalidity bit for descendant scopes and inline the fast path.
27 * style/StyleScope.cpp:
28 (WebCore::Style::Scope::flushPendingSelfUpdate):
29 (WebCore::Style::Scope::flushPendingDescendantUpdates):
30 (WebCore::Style::Scope::scheduleUpdate):
31 (WebCore::Style::Scope::flushPendingUpdate): Deleted.
33 (WebCore::Style::Scope::hasPendingUpdate):
34 (WebCore::Style::Scope::flushPendingUpdate):
36 2016-10-22 Darin Adler <darin@apple.com>
38 Move SVG from ExceptionCode to Exception
39 https://bugs.webkit.org/show_bug.cgi?id=163837
41 Reviewed by Chris Dumez.
43 * WebCore.xcodeproj/project.pbxproj: Added SVGGraphicsElement.idl.
45 * bindings/js/JSSVGLengthCustom.cpp:
46 (WebCore::JSSVGLength::value): Use toJSNumber.
47 (WebCore::JSSVGLength::setValue): Use propagateException.
48 (WebCore::JSSVGLength::convertToSpecifiedUnits): Ditto.
50 * bindings/scripts/CodeGeneratorJS.pm:
51 (GenerateImplementation): Properly handle SetterMayThrowException
52 in the special case for SVG setters.
54 * rendering/style/SVGRenderStyle.h:
55 (WebCore::SVGRenderStyle::initialBaselineShiftValue): Removed
56 ASSERT_NO_EXCEPTION, no longer needed.
57 (WebCore::SVGRenderStyle::initialKerning): Ditto.
59 * svg/SVGAltGlyphElement.cpp:
60 (WebCore::SVGAltGlyphElement::setGlyphRef): Use ExceptionOr.
61 (WebCore::SVGAltGlyphElement::setFormat): Ditto.
62 (WebCore::SVGAltGlyphElement::hasValidGlyphElements): Tweaked a bit.
63 * svg/SVGAltGlyphElement.h: Updated for above changes.
64 * svg/SVGAltGlyphElement.idl: Use non-legacy exceptions.
67 (WebCore::SVGAngle::valueAsString): Removed unneeded String globals.
68 (WebCore::parseAngleType): Rewrote to be simpler and more direct.
69 (WebCore::SVGAngle::setValueAsString): Use ExceptionOr.
70 (WebCore::SVGAngle::newValueSpecifiedUnits): Ditto.
71 (WebCore::SVGAngle::convertToSpecifiedUnits): Ditto.
72 * svg/SVGAngle.h: Updated for above changes. Initialized data members
73 here in the class definite and removed constructor; default now works.
74 * svg/SVGAngle.idl: Use non-legacy exceptions.
76 * svg/SVGAnimateElementBase.cpp:
77 (WebCore::SVGAnimateElementBase::calculateAnimatedValue): Update since
78 CalcMode is now an enum class.
79 * svg/SVGAnimateMotionElement.cpp:
80 (WebCore::SVGAnimateMotionElement::SVGAnimateMotionElement): Ditto.
82 * svg/SVGAnimateTransformElement.cpp:
83 (WebCore::SVGAnimateTransformElement::hasValidAttributeType): Update
84 since AttributeType is now an enum class.
86 * svg/SVGAnimatedAngle.cpp:
87 (WebCore::SVGAnimatedAngleAnimator::calculateDistance): Removed
88 ASSERT_NO_EXCEPTION, no longer needed.
90 * svg/SVGAnimatedBoolean.idl: Use non-legacy exception.
91 * svg/SVGAnimatedEnumeration.idl: Ditto.
92 * svg/SVGAnimatedInteger.idl: Ditto.
94 * svg/SVGAnimatedLength.cpp:
95 (WebCore::sharedSVGLength): Deleted.
96 (WebCore::SVGAnimatedLengthAnimator::addAnimatedTypes): Removed
97 ASSERT_NO_EXCEPTION, no longer needed.
98 (WebCore::parseLengthFromString): Ditto. Also rewrote to not use
99 a shared SVGLength; no benefit to doing that.
100 (WebCore::SVGAnimatedLengthAnimator::calculateAnimatedValue): Ditto.
101 * svg/SVGAnimatedLengthList.cpp:
102 (WebCore::SVGAnimatedLengthListAnimator::addAnimatedTypes): Ditto.
103 (WebCore::SVGAnimatedLengthListAnimator::calculateAnimatedValue): Ditto.
105 * svg/SVGAnimatedNumber.idl: Use non-legacy exception.
106 * svg/SVGAnimatedString.idl: Ditto.
108 * svg/SVGAnimatedType.cpp:
109 (WebCore::SVGAnimatedType::setValueAsString): Updated since
110 setValueAsString now uses ExceptionOr.
112 * svg/SVGAnimationElement.cpp:
113 (WebCore::SVGAnimationElement::SVGAnimationElement): Initialized scalars
114 in the class definition instead of here.
115 (WebCore::SVGAnimationElement::getSimpleDuration): Removed uneeded ExceptionCode&.
116 (WebCore::SVGAnimationElement::setCalcMode): Updated since CalcMode is now an enum class.
117 (WebCore::SVGAnimationElement::setAttributeType): Updated since AttributeType
118 is now an enum class.
119 (WebCore::SVGAnimationElement::shouldApplyAnimation): Ditto.
120 (WebCore::SVGAnimationElement::calculateKeyTimesForCalcModePaced): Ditto.
121 (WebCore::SVGAnimationElement::calculatePercentForSpline): Ditto.
122 (WebCore::SVGAnimationElement::calculatePercentFromKeyPoints): Ditto.
123 (WebCore::SVGAnimationElement::calculatePercentForFromTo): Ditto.
124 (WebCore::SVGAnimationElement::currentValuesFromKeyPoints): Ditto.
125 (WebCore::SVGAnimationElement::currentValuesForValuesAnimation): Ditto.
126 (WebCore::SVGAnimationElement::startedActiveInterval): Ditto.
127 (WebCore::SVGAnimationElement::updateAnimation): Ditto.
128 (WebCore::SVGAnimationElement::checkInvalidCSSAttributeType): Ditto.
130 * svg/SVGAnimationElement.h: Changed CalcMode into an enum class.
131 Updated for above changes.
133 * svg/SVGAnimationElement.idl: Removed MayThrowLegacyException from
137 (WebCore::SVGColor::SVGColor): Updated to take scalar in the straightforward
138 manner instead of constt SVGColorType&.
139 (WebCore::SVGColor::setRGBColor): Use ExceptionOr.
140 (WebCore::SVGColor::setRGBColorICCColor): Ditto.
141 (WebCore::SVGColor::setColor): Ditto.
142 * svg/SVGColor.h: Updated for above changes. Removed unneeded destructor.
143 * svg/SVGColor.idl: Use non-legacy exceptions.
145 * svg/SVGGlyphRefElement.cpp:
146 (WebCore::SVGGlyphRefElement::SVGGlyphRefElement): Initialize data members
147 in class definition, not here.
148 (WebCore::parseFloat): Added helper. Used in parseAttribute.
149 (WebCore::SVGGlyphRefElement::parseAttribute): Updated to use parseFloat helper.
150 (WebCore::SVGGlyphRefElement::glyphRef): Deleted.
151 (WebCore::SVGGlyphRefElement::setGlyphRef): Deleted.
152 (WebCore::SVGGlyphRefElement::setX): Removed unused Exception& argument.
153 (WebCore::SVGGlyphRefElement::setY): Ditto.
154 (WebCore::SVGGlyphRefElement::setDx): Ditto.
155 (WebCore::SVGGlyphRefElement::setDy): Ditto.
156 * svg/SVGGlyphRefElement.h: Updated for above changes.
157 * svg/SVGGlyphRefElement.idl: Use Reflect on glyphRef. Removed incorrect
158 SetterMayThrowLegacyException attributes for x, y, dx, and dy. Longer term
159 it might be nice to use [Reflect] on these too.
161 * svg/SVGGraphicsElement.idl: Use non-legacy exception.
164 (WebCore::parseLengthType): Changed argument type since caller does not
165 need to know how many characters are consumed.
166 (WebCore::SVGLength::SVGLength): Removed IGNORE_EXCEPTION and ASSERT_NO_EXCEPTION.
167 Also removed the copy constructor, letting the compiler generate the default.
168 (WebCore::SVGLength::setValueAsString): Use ExceptionOr.
169 (WebCore::SVGLength::construct): Updated since setValueAsString uses ExceptionOr.
170 (WebCore::SVGLength::value): Ditto.
171 (WebCore::SVGLength::valueForBindings): Use ExceptionOr. Also renamed to
172 disambiguate with the version used outside of bindings.
173 (WebCore::SVGLength::setValue): Use ExceptionOr.
174 (WebCore::SVGLength::newValueSpecifiedUnits): Ditto.
175 (WebCore::SVGLength::convertToSpecifiedUnits): Ditto.
176 (WebCore::SVGLength::fromCSSPrimitiveValue): Updated since newValueSpecifiedUnits
178 (WebCore::SVGLength::lengthModeForAnimatedLengthAttribute): Rewrote map generation
179 code to be more efficient and not unrolled. Only do one hash table lookup.
180 * svg/SVGLength.h: Updated for above changes.
181 * svg/SVGLength.idl: Use non-legacy exceptions.
183 * svg/SVGLengthContext.cpp:
184 (WebCore::SVGLengthContext::valueForLength): Update since function
186 (WebCore::SVGLengthContext::convertValueToUserUnits): Use ExceptionOr.
187 (WebCore::SVGLengthContext::convertValueFromUserUnits): Ditto.
188 (WebCore::SVGLengthContext::convertValueFromUserUnitsToPercentage): Ditto.
189 (WebCore::SVGLengthContext::convertValueFromPercentageToUserUnits): Ditto.
190 (WebCore::SVGLengthContext::convertValueFromUserUnitsToEMS): Ditto.
191 (WebCore::SVGLengthContext::convertValueFromEMSToUserUnits): Ditto.
192 (WebCore::SVGLengthContext::convertValueFromUserUnitsToEXS): Ditto.
193 (WebCore::SVGLengthContext::convertValueFromEXSToUserUnits): Ditto.
194 * svg/SVGLengthContext.h: Updatedfor above changes.
196 * svg/SVGLengthList.cpp:
197 (WebCore::SVGLengthList::parse): Updated since setValueAsString uses
199 * svg/SVGLengthList.h: Removed unneeded constructor.
200 * svg/SVGLengthList.idl: Use non-legacy exceptions.
202 * svg/SVGLocatable.cpp:
203 (WebCore::SVGLocatable::getTransformToElement): Use ExceptionOr.
204 * svg/SVGLocatable.h: Updated for above change.
206 * svg/SVGMarkerElement.h:
207 (WebCore::SVGPropertyTraits<SVGMarkerOrientType>::fromString):
208 Updated since setValueAsString uses ExceptionOr now.
210 * svg/SVGMatrix.h: Use ExceptionOr.
211 * svg/SVGMatrix.idl: Use non-legacy exceptions.
213 * svg/SVGNumberList.h: Removed unneeded constructor.
214 * svg/SVGNumberList.idl: Use non-legacy exceptions.
217 (WebCore::SVGPaint::setPaint): Use ExceptionOr.
218 * svg/SVGPaint.h: Updated for above chagne.
219 * svg/SVGPaint.idl: Use non-legacy exception.
221 * svg/SVGPathSegList.h: Tweaked a bit.
222 * svg/SVGPathSegList.idl: Use non-legacy exceptions.
224 * svg/SVGPointList.h: Removed unneeded constructor.
225 * svg/SVGPointList.idl: Use non-legacy exceptions.
227 * svg/SVGPreserveAspectRatio.cpp:
228 (WebCore::SVGPreserveAspectRatio::setAlign): Use ExceptionOr.
229 (WebCore::SVGPreserveAspectRatio::setMeetOrSlice): Ditto.
230 * svg/SVGPreserveAspectRatio.h: Updated for above changes.
231 * svg/SVGPreserveAspectRatio.idl: Use non-legacy exceptions.
233 * svg/SVGSVGElement.cpp:
234 (WebCore::SVGSVGElement::currentView): Pass a reference.
236 * svg/SVGStringList.h: Tweaked a bit.
237 * svg/SVGStringList.idl: Use non-legacy exceptions.
239 * svg/SVGStyleElement.cpp:
240 (WebCore::SVGStyleElement::setType): Removed unneeded ExceptionCode&.
241 (WebCore::SVGStyleElement::setMedia): Ditto.
242 (WebCore::SVGStyleElement::setTitle): Deleted.
243 * svg/SVGStyleElement.h: Updated for above changes, and made the title
244 function override be private.
245 * svg/SVGStyleElement.idl: Use Reflect for title. Removed unneeded
246 SetterMayThrowLegacyException on all attributes.
248 * svg/SVGTextContentElement.cpp:
249 (WebCore::SVGTextContentElement::textLengthAnimated): Removed
250 ASSERT_NO_EXCEPTION, won't work any more.
251 (WebCore::SVGTextContentElement::getSubStringLength): Use ExceptionOr.
252 Also remove redundant call to updateLayoutIgnorePendingStylesheets,
253 called by getNumberOfChars.
254 (WebCore::SVGTextContentElement::getStartPositionOfChar): Ditto.
255 (WebCore::SVGTextContentElement::getEndPositionOfChar): Ditto.
256 (WebCore::SVGTextContentElement::getExtentOfChar): Ditto.
257 (WebCore::SVGTextContentElement::getRotationOfChar): Ditto.
258 (WebCore::SVGTextContentElement::selectSubString): Ditto.
259 * svg/SVGTextContentElement.h: Updated for above changes.
260 * svg/SVGTextContentElement.idl: Use non-legacy exceptions.
262 * svg/SVGTransformList.h: Removed unneeded constructor.
263 * svg/SVGTransformList.idl: Use non-legacy exceptions.
265 * svg/SVGViewSpec.cpp:
266 (WebCore::SVGViewSpec::SVGViewSpec): Updated to take a reference.
267 (WebCore::SVGViewSpec::setZoomAndPan): Use ExceptionOr.
268 (WebCore::SVGViewSpec::setTransformString): Deleted.
269 (WebCore::SVGViewSpec::viewBoxString): Use m_viewBox directly.
270 (WebCore::SVGViewSpec::preserveAspectRatioString): Use
271 m_preserveAspectRatio directly.
272 (WebCore::SVGViewSpec::viewTarget): Use is<SVGElement>.
273 (WebCore::SVGViewSpec::lookupOrCreateViewBoxWrapper): Use
274 m_contextElement directly.
275 (WebCore::SVGViewSpec::lookupOrCreatePreserveAspectRatioWrapper):
277 (WebCore::SVGViewSpec::lookupOrCreateTransformWrapper): Ditto.
278 (WebCore::SVGViewSpec::parseViewSpec): Set m_viewTargetString directly.
279 * svg/SVGViewSpec.h: Updated for above changes. Removed unneeded virtual
280 destructor, unneeded using for ref/deref, unused functions including
281 setTransformString, setViewTargetString, non-exception setZoomAndPan,
282 contextElement, viewBoxBaseValue, and preserveAspectRatioBaseValue.
283 * svg/SVGViewSpec.idl: Use non-legacy exceptions. Also specify
284 ImplementationLacksVTable.
286 * svg/properties/SVGAnimatedEnumerationPropertyTearOff.h:
288 * svg/properties/SVGAnimatedStaticPropertyTearOff.h: Ditto.
289 * svg/properties/SVGListProperty.h: Ditto.
290 * svg/properties/SVGListPropertyTearOff.h: Ditto.
291 * svg/properties/SVGPathSegListPropertyTearOff.cpp:
292 (WebCore::SVGPathSegListPropertyTearOff::clear): Ditto.
293 (WebCore::SVGPathSegListPropertyTearOff::getItem): Ditto.
294 (WebCore::SVGPathSegListPropertyTearOff::replaceItem): Ditto.
295 (WebCore::SVGPathSegListPropertyTearOff::removeItem): Ditto.
296 * svg/properties/SVGPathSegListPropertyTearOff.h: Ditto.
297 * svg/properties/SVGPropertyTearOff.h: Ditto. Also added an overload
298 of create that knows how to deal with exceptions.
299 * svg/properties/SVGStaticListPropertyTearOff.h: Ditto.
300 * svg/properties/SVGTransformListPropertyTearOff.h: Ditto.
302 2016-10-22 Chris Dumez <cdumez@apple.com>
304 WebGLRenderingContextBase.bufferData() should use a union instead of overloading
305 https://bugs.webkit.org/show_bug.cgi?id=163795
307 Reviewed by Darin Adler.
309 WebGLRenderingContextBase.bufferData() / bufferSubData() should use a union
310 instead of overloading:
311 - https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14
313 No new tests, no web-exposed behavior change.
315 * bindings/js/JSDOMConvert.h:
316 (WebCore::Converter<IDLInterface<T>>::convert):
317 * bindings/scripts/CodeGeneratorJS.pm:
319 * bindings/scripts/test/JS/JSInterfaceName.h:
320 * bindings/scripts/test/JS/JSTestActiveDOMObject.h:
321 * bindings/scripts/test/JS/JSTestCEReactions.h:
322 * bindings/scripts/test/JS/JSTestCEReactionsStringifier.h:
323 * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.h:
324 * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h:
325 * bindings/scripts/test/JS/JSTestCustomNamedGetter.h:
326 * bindings/scripts/test/JS/JSTestEventConstructor.h:
327 * bindings/scripts/test/JS/JSTestEventTarget.h:
328 * bindings/scripts/test/JS/JSTestException.h:
329 * bindings/scripts/test/JS/JSTestGenerateIsReachable.h:
330 * bindings/scripts/test/JS/JSTestGlobalObject.h:
331 * bindings/scripts/test/JS/JSTestInterface.h:
332 * bindings/scripts/test/JS/JSTestIterable.h:
333 * bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
334 * bindings/scripts/test/JS/JSTestNamedConstructor.h:
335 * bindings/scripts/test/JS/JSTestNode.h:
336 * bindings/scripts/test/JS/JSTestNondeterministic.h:
337 * bindings/scripts/test/JS/JSTestObj.h:
338 * bindings/scripts/test/JS/JSTestOverloadedConstructors.h:
339 * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.h:
340 * bindings/scripts/test/JS/JSTestOverrideBuiltins.h:
341 * bindings/scripts/test/JS/JSTestSerialization.h:
342 * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
343 * bindings/scripts/test/JS/JSTestTypedefs.h:
344 * bindings/scripts/test/JS/JSattribute.h:
345 * bindings/scripts/test/JS/JSreadonly.h:
346 * html/canvas/WebGL2RenderingContext.cpp:
347 (WebCore::WebGL2RenderingContext::bufferData):
348 (WebCore::WebGL2RenderingContext::bufferSubData):
349 * html/canvas/WebGLRenderingContextBase.cpp:
350 (WebCore::WebGLRenderingContextBase::bufferData):
351 (WebCore::WebGLRenderingContextBase::bufferSubData):
352 * html/canvas/WebGLRenderingContextBase.h:
353 * html/canvas/WebGLRenderingContextBase.idl:
355 2016-10-22 Darin Adler <darin@apple.com>
357 [Cocoa] REGRESSION (r204508): Crash in init_WebCreateFragment when pasting (seen in multiple apps using legacy WebKit)
358 https://bugs.webkit.org/show_bug.cgi?id=163839
360 Reviewed by Dan Bernstein.
362 * editing/cocoa/EditorCocoa.mm: Use the appropriate SOFT_LINK macros to find
363 the WebKitLegacy platform in the correct location for iOS and macOS.
365 2016-10-22 Nael Ouedraogo <nael.ouedraogo@crf.canon.fr>
367 Bindings error message for missing required dictionary member should be more explicit
368 https://bugs.webkit.org/show_bug.cgi?id=163665
370 Reviewed by Darin Adler.
372 Add throwRequiredMemberTypeError function to throw a TypeError exception with an error
373 message indicating the missing required member.
375 No new test required, rebase existing tests.
377 * bindings/js/JSDOMBinding.cpp:
378 (WebCore::throwRequiredMemberTypeError):
379 * bindings/js/JSDOMBinding.h:
380 * bindings/scripts/CodeGeneratorJS.pm:
381 (GenerateDictionaryImplementationContent):
382 * bindings/scripts/test/JS/JSTestObj.cpp:
383 (WebCore::convertDictionary<TestObj::DictionaryThatShouldNotTolerateNull>):
385 2016-10-22 Ryosuke Niwa <rniwa@webkit.org>
387 Upgrading custom element should enqueue attributeChanged and connected callbacks
388 https://bugs.webkit.org/show_bug.cgi?id=163840
390 Reviewed by Darin Adler.
392 When upgrading a custom element, enqueue attributeChanged and connectedCallbacks as needed as specified
393 in step 3 and 4 of: https://html.spec.whatwg.org/multipage/scripting.html#concept-upgrade-an-element
395 Test: fast/custom-elements/upgrading-enqueue-reactions.html
397 * bindings/js/JSCustomElementInterface.cpp:
398 (WebCore::JSCustomElementInterface::upgradeElement): Enqueue
399 * dom/CustomElementReactionQueue.cpp:
400 (WebCore::CustomElementReactionQueueItem::invoke): Don't invoke callbacks when the custom element had
402 (WebCore::CustomElementReactionQueue::enqueuePostUpgradeReactions): Added.
403 (WebCore::CustomElementReactionQueue::invokeAll): Upgrading a custom element may enqueue more reactions.
404 Keep invoking reactions until the queue becomes empty.
405 * dom/CustomElementReactionQueue.h:
406 * dom/Range.idl: Added a forgotten CEReactions here.
408 2016-10-21 David Kilzer <ddkilzer@apple.com>
410 Bug 163762: IntSize::area() should used checked arithmetic
411 <https://webkit.org/b/163762>
413 Reviewed by Darin Adler.
415 No new tests since no change in nominal behavior.
417 * platform/graphics/IntSize.h:
418 (WebCore::IntSize::area): Change to return a
419 Checked<unsigned, T> value. Use WTF:: namespace to avoid
420 including another header.
422 * platform/graphics/IntRect.h:
423 (WebCore::IntRect::area): Ditto.
425 The remaining changes are to use the Checked<unsigned> return
426 value of IntSize::area() and IntRect::area() correctly in
427 context, in addition to items noted below.
429 * html/HTMLPlugInImageElement.cpp:
430 (WebCore::HTMLPlugInImageElement::isTopLevelFullPagePlugin):
431 Declare contentWidth and contentHeight as float values to
432 prevent overflow when computing the area, and to make the
433 inequality comparison in the return statement uses the same type
435 * html/ImageData.cpp:
436 (WebCore::ImageData::ImageData):
437 * html/MediaElementSession.cpp:
438 (WebCore::isElementRectMostlyInMainFrame):
439 * platform/graphics/ImageBackingStore.h:
440 (WebCore::ImageBackingStore::setSize): Restructure logic to
441 compute area only once.
442 (WebCore::ImageBackingStore::clear):
443 * platform/graphics/ImageFrame.h:
444 (WebCore::ImageFrame::frameBytes):
445 * platform/graphics/ImageSource.cpp:
446 (WebCore::ImageSource::maximumSubsamplingLevel):
447 * platform/graphics/ca/LayerPool.cpp:
448 (WebCore::LayerPool::backingStoreBytesForSize):
449 * platform/graphics/cg/ImageDecoderCG.cpp:
450 (WebCore::ImageDecoder::frameBytesAtIndex):
451 * platform/graphics/filters/FEGaussianBlur.cpp:
452 (WebCore::FEGaussianBlur::platformApplySoftware):
453 * platform/graphics/filters/FilterEffect.cpp:
454 (WebCore::FilterEffect::asUnmultipliedImage):
455 (WebCore::FilterEffect::asPremultipliedImage):
456 (WebCore::FilterEffect::copyUnmultipliedImage):
457 (WebCore::FilterEffect::copyPremultipliedImage):
458 (WebCore::FilterEffect::createUnmultipliedImageResult):
459 (WebCore::FilterEffect::createPremultipliedImageResult):
460 * platform/graphics/win/ImageBufferDataDirect2D.cpp:
461 (WebCore::ImageBufferData::getData): Update overflow check,
462 rename local variable to numBytes, and compute numBytes once.
463 * platform/graphics/win/ImageDecoderDirect2D.cpp:
464 (WebCore::ImageDecoder::frameBytesAtIndex):
465 * platform/image-decoders/ImageDecoder.cpp:
466 (WebCore::ImageDecoder::frameBytesAtIndex):
467 * platform/ios/LegacyTileLayerPool.mm:
468 (WebCore::LegacyTileLayerPool::bytesBackingLayerWithPixelSize):
469 * rendering/RenderLayerCompositor.cpp:
470 (WebCore::RenderLayerCompositor::requiresCompositingForCanvas):
471 * rendering/shapes/Shape.cpp:
472 (WebCore::Shape::createRasterShape):
474 2016-10-21 Gavin Barraclough <barraclough@apple.com>
476 WebPageProxy should not need PageActivityState
477 https://bugs.webkit.org/show_bug.cgi?id=163821
479 Reviewed by Geoff Garen.
481 The PageActivityState is currently plumbed back from WebCore up to the UI process, to
482 determine whether to enabled process suppression. However the information it contains
483 (whether a page load is ongoing, whether audio is playing) is already available via
484 other means. Remove this use of PageActivityState.
486 * html/HTMLMediaElement.cpp:
487 (WebCore::HTMLMediaElement::mediaState):
488 - Fix a bug in how we compute IsPlayingAudio - if the volume of the MediaElement is
489 set to zero, then audio is not playing (we were already checking muted).
490 * page/ChromeClient.h:
491 - removed setPageActivityState
493 (WebCore::Page::setPageActivityState): Deleted.
494 - setPageActivityState -> pageActivityStateChanged, remove call to ChromeClient
496 (WebCore::Page::pageActivityStateChanged):
497 - setPageActivityState -> pageActivityStateChanged
498 * page/PageThrottler.cpp:
499 (WebCore::PageThrottler::setActivityFlag):
500 - setPageActivityState -> pageActivityStateChanged
502 2016-10-21 Chris Dumez <cdumez@apple.com>
504 [Web ID] Overload resolution is wrong if one of the types is a nullable union
505 https://bugs.webkit.org/show_bug.cgi?id=163816
507 Reviewed by Alex Christensen.
509 Overload resolution was wrong if one of the types was a nullable union. This
510 is because we never considered the union type itself, only its subtypes.
511 Therefore, we checked if any of the union's subtypes were nullable but we
512 failed to check if the union itself was nullable.
515 - https://heycam.github.io/webidl/#es-overloads (Step 11.3.)
517 No new tests, extended bindings tests.
519 * bindings/scripts/CodeGeneratorJS.pm:
520 (GetOverloadThatMatchesIgnoringUnionSubtypes):
521 (GenerateOverloadedFunctionOrConstructor):
522 * bindings/scripts/test/JS/JSTestObj.cpp:
523 (WebCore::jsTestObjPrototypeFunctionOverloadWithNullableUnion1):
524 (WebCore::jsTestObjPrototypeFunctionOverloadWithNullableUnion1Caller):
525 (WebCore::jsTestObjPrototypeFunctionOverloadWithNullableUnion2):
526 (WebCore::jsTestObjPrototypeFunctionOverloadWithNullableUnion2Caller):
527 (WebCore::jsTestObjPrototypeFunctionOverloadWithNullableUnion):
528 (WebCore::jsTestObjPrototypeFunctionOverloadWithOptionalUnion1):
529 (WebCore::jsTestObjPrototypeFunctionOverloadWithOptionalUnion1Caller):
530 (WebCore::jsTestObjPrototypeFunctionOverloadWithOptionalUnion2):
531 (WebCore::jsTestObjPrototypeFunctionOverloadWithOptionalUnion2Caller):
532 (WebCore::jsTestObjPrototypeFunctionOverloadWithOptionalUnion):
533 * bindings/scripts/test/TestObj.idl:
535 2016-10-21 Eric Carlson <eric.carlson@apple.com>
537 [MediaStream] Dynamically generate media capture sandbox extensions
538 https://bugs.webkit.org/show_bug.cgi?id=154861
539 <rdar://problem/24909411>
541 Reviewed by Tim Horton.
543 No new tests, some of these changes are covered by existing tests and some can only be tested
544 with physical capture devices.
546 * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: AVSampleBufferAudioRenderer
547 and AVSampleBufferRenderSynchronizer are now declared in AVFoundationSPI.h.
549 * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
550 * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
551 (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::MediaPlayerPrivateMediaStreamAVFObjC): Initialize
552 AVSampleBufferRenderSynchronizer.
553 (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::isAvailable): Fail if AVSampleBufferRenderSynchronizer
555 (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueAudioSampleBufferFromTrack): Take a MediaSample&
556 instead of a PlatformSample&.
557 (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSampleBufferFromTrack): Ditto.
558 (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayer): Add the sample buffer display
559 later to the synchronizer.
560 (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::destroyLayer): Remove the sample buffer display
561 later from the synchronizer.
562 (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::play): Start the synchronizer.
563 (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::pause): Stash the current clock time in
564 m_pausedTime, but leave the clock running. Pause the synchronizer.
565 (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::currentMediaTime): Return the clock time
566 when playing, m_pausedTime time when paused because we leave the clock running forever.
567 (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::sampleBufferUpdated):
569 * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: AVSampleBufferAudioRenderer
570 is now declared in AVFoundationSPI.h.
572 * platform/spi/mac/AVFoundationSPI.h: Add AVSampleBufferAudioRenderer and AVSampleBufferRenderSynchronizer.
574 2016-10-21 Commit Queue <commit-queue@webkit.org>
576 Unreviewed, rolling out r207582.
577 https://bugs.webkit.org/show_bug.cgi?id=163819
579 Not quite ready rdar://problem/28897179 (Requested by
580 alexchristensen on #webkit).
584 "Re-enable URLParser for non-Safari Cocoa apps after r207321"
585 https://bugs.webkit.org/show_bug.cgi?id=163690
586 http://trac.webkit.org/changeset/207582
588 2016-10-21 Gavin Barraclough <barraclough@apple.com>
590 WebPage should take UserActivity directly for user input
591 https://bugs.webkit.org/show_bug.cgi?id=163813
593 Reviewed by Anders Carlsson.
595 When we receive mouse/keyboard events in a page, we want to prevent AppNap. We currently do so
596 via the PageThrottler. This patch is to just make the WebPage drive the UserActivity directly.
598 Two reasons to do so: (1) to cleanup & simplify for further refactoring. (2) The current code
599 isn't really achieving the desired effect. The page setting the flag in the throttler to get
600 the activity to be set is now a less effective way of achieving this goal, since the
601 PageActivityState bounces back across to the UI process & then messages back to the WebContent
602 process to take the UserActivity. These extra hops defeat the purpose of making sure the boost
603 from the initial message isn't lost.
605 * page/PageThrottler.cpp:
606 (WebCore::PageThrottler::PageThrottler):
607 (WebCore::m_userInputHysteresis): Deleted.
608 * page/PageThrottler.h:
609 (WebCore::PageThrottler::didReceiveUserInput): Deleted.
610 - removed PageActivityState::UserInputActivity, didReceiveUserInput, m_userInputHysteresis.
612 2016-10-21 Wenson Hsieh <wenson_hsieh@apple.com>
614 Support (insertFrom|deleteBy)Composition and (insert|delete)CompositionText inputTypes for InputEvents
615 https://bugs.webkit.org/show_bug.cgi?id=163460
616 <rdar://problem/28784142>
618 Reviewed by Darin Adler.
620 Adds basic support for the composition inputTypes in the InputEvent spec. See w3.org/TR/input-events,
621 github.com/w3c/input-events/issues/41 and github.com/w3c/input-events/issues/42 for more details. While input
622 events are fired in the correct order with respect to each other, additional work will be required to ensure
623 that input events are fired in the correct order with respect to composition(start|update|end) events and
624 textInput events. This is held off until the expected ordering of events is officially defined in the spec.
626 Tests: fast/events/before-input-events-prevent-insert-composition.html
627 fast/events/before-input-events-prevent-recomposition.html
628 fast/events/input-events-ime-composition.html
629 fast/events/input-events-ime-recomposition.html
631 * editing/CompositeEditCommand.cpp:
632 (WebCore::CompositeEditCommand::apply):
633 * editing/CompositeEditCommand.h:
634 (WebCore::CompositeEditCommand::isBeforeInputEventCancelable):
636 Adds a new virtual method hook for subclasses to mark their `beforeinput` events as non-cancelable (see
637 TypingCommand::isBeforeInputEventCancelable). By default, `beforeinput` events are cancelable.
639 * editing/EditAction.h:
641 Adds 4 new EditActions corresponding to the 4 composition-related inputTypes. These are:
642 EditActionTypingDeletePendingComposition => "deleteCompositionText"
643 EditActionTypingDeleteFinalComposition => "deleteByComposition"
644 EditActionTypingInsertPendingComposition => "insertCompositionText"
645 EditActionTypingInsertFinalComposition => "insertFromComposition"
647 * editing/EditCommand.cpp:
648 (WebCore::inputTypeNameForEditingAction):
649 * editing/Editor.cpp:
650 (WebCore::dispatchBeforeInputEvent):
651 (WebCore::dispatchBeforeInputEvents):
652 (WebCore::Editor::willApplyEditing):
653 (WebCore::Editor::insertTextWithoutSendingTextEvent):
654 (WebCore::Editor::setComposition):
656 In setComposition(text, mode), tweak the logic for committing a composition to always delete the selection
657 before inserting the final composition text. In setComposition(text, underlines, start, end), catch the case
658 where we're beginning to recompose an existing range in the DOM and delete the recomposed text first.
660 * editing/TypingCommand.cpp:
661 (WebCore::editActionForTypingCommand):
662 (WebCore::TypingCommand::TypingCommand):
663 (WebCore::TypingCommand::deleteSelection):
665 Adds a TextCompositionType parameter so that call sites (see Editor::setComposition) can indicate what state the
666 edited composition is in. This allows us to differentiate between deletion of finalized composition text in
667 preparation of recomposing a range in the DOM, and deletion of composition text that has not yet been committed
668 in preparation for inserting a finalized composition into the DOM.
670 (WebCore::TypingCommand::deleteKeyPressed):
671 (WebCore::TypingCommand::forwardDeleteKeyPressed):
672 (WebCore::TypingCommand::insertText):
673 (WebCore::TypingCommand::insertLineBreak):
674 (WebCore::TypingCommand::insertParagraphSeparatorInQuotedContent):
675 (WebCore::TypingCommand::insertParagraphSeparator):
676 (WebCore::TypingCommand::isBeforeInputEventCancelable):
677 (WebCore::TypingCommand::inputEventData):
678 (WebCore::TypingCommand::willAddTypingToOpenCommand):
679 * editing/TypingCommand.h:
681 2016-10-21 Dave Hyatt <hyatt@apple.com>
683 [CSS Parser] Make sure shadow user agent sheets parse in UASheetMode
684 https://bugs.webkit.org/show_bug.cgi?id=163810
686 Reviewed by Dean Jackson.
688 * dom/InlineStyleSheetOwner.cpp:
689 (WebCore::parserContextForElement):
690 (WebCore::makeInlineStyleSheetCacheKey):
691 (WebCore::InlineStyleSheetOwner::createSheet):
692 (WebCore::parserContextForForElement): Deleted.
694 2016-10-21 Jer Noble <jer.noble@apple.com>
696 YouTube stalls when seeking beyond buffered range
697 https://bugs.webkit.org/show_bug.cgi?id=162813
699 Reviewed by Eric Carlson.
701 When seeking a MediaPlayerPrivateMediaSourceAVFObjC, we will first seek the AVSampleBufferRenderSynchronizer,
702 flush and enqueue non-displaying frames, enqueue regular frames, then begin playback. The above stall will occur
703 when we enqueue so many non- displaying frames that the display layer is not ready for normal ones before
704 playback begins. Then, when the synchronizer attempts to synchronize the enqueued audio and video renderers, the
705 only available samples are back at the original media time, and so it "seeks" by updating the CMTimebase back to
706 the original media time, causing playback to appear "stalled". The overall solution is to "flush" the contents
707 of the renderers before the seek, so that the synchronizer doesn't reset the currentTime, and to only restart
708 the synchronizer when there are visible (or audible) samples available for display.
710 Breaking the fix down into sections:
712 = Don't enqueue too many non-displaying samples at once:
713 - Rename SourceBufferPrivate::flushAndEnqueueNonDisplayingSamples() to SourceBufferPrivate::flush(), and no longer
714 pass in an array of non-displaying samples.
715 - Add a new virtual method to MediaSample, createNonDisplayingCopy(), used by SourceBuffer to enqueue non-displaying
717 - in SourceBuffer::reenqueueMediaForTime(), use that new createNonDisplayingCopy() method to enqueue non-displaying
718 samples in the same queue as regular samples.
720 * Modules/mediasource/SourceBuffer.cpp:
721 (WebCore::SourceBuffer::provideMediaData):
722 (WebCore::SourceBuffer::reenqueueMediaForTime):
723 * platform/MediaSample.h:
724 (WebCore::MediaSample::isNonDisplaying):
725 * platform/graphics/SourceBufferPrivate.h:
726 (WebCore::SourceBufferPrivate::flush):
727 (WebCore::SourceBufferPrivate::flushAndEnqueueNonDisplayingSamples): Renamed -> flush().
728 * platform/graphics/avfoundation/MediaSampleAVFObjC.h:
729 * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:
730 (WebCore::CMSampleBufferIsNonDisplaying):
731 (WebCore::MediaSampleAVFObjC::flags):
732 (WebCore::MediaSampleAVFObjC::createNonDisplayingCopy):
733 * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
734 (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
735 (WebCore::SourceBufferPrivateAVFObjC::willSeek):
736 (WebCore::createNonDisplayingCopy): Moved to MediaSampleAVFObjC.
737 (WebCore::SourceBufferPrivateAVFObjC::flushAndEnqueueNonDisplayingSamples): Renamed -> flush().
738 * platform/mock/mediasource/MockBox.h:
739 * platform/mock/mediasource/MockSourceBufferPrivate.cpp:
740 (WebCore::MockMediaSample::flags):
741 (WebCore::MockMediaSample::createNonDisplayingCopy):
742 * platform/mock/mediasource/MockSourceBufferPrivate.h:
744 = Don't start playing until all renderers have visible/audible samples:
745 - SourceBufferPrivateAVFObjC will notify its associated MediaPlayerPrivateMediaSourceAVFObjC when
746 it flushes and receives visible/audible samples.
747 - The MediaPlayer will store audio renderers as keys to a HashMap which allows it to track which
748 have available samples.
749 - This requires changing all the places where we loop over the available renderers.
751 * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
752 (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
753 (WebCore::SourceBufferPrivateAVFObjC::enqueueSample):
754 (WebCore::SourceBufferPrivateAVFObjC::flush):
755 (WebCore::SourceBufferPrivateAVFObjC::willSeek):
756 * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
757 (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::allRenderersHaveAvailableSamples):
758 (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setHasAvailableVideoFrame): Deleted.
759 * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
760 (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC):
761 (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVolume):
762 (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setMuted):
763 (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setHasAvailableVideoFrame):
764 (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setHasAvailableAudioSample):
765 (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::updateAllRenderersHaveAvailableSamples):
766 (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::addAudioRenderer):
767 (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::removeAudioRenderer):
768 (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setPreservesPitch):
769 (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seeking):
770 (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::shouldBePlaying):
771 (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekInternal):
772 * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h:
773 * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
774 (WebCore::MediaSourcePrivateAVFObjC::willSeek):
775 * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
777 = Don't display new samples mid-seek.
778 - MediaSource should clear its m_pendingSeekTime ivar, which is used whyn SourceBuffer queries whether or not a
779 seek is pending, when instructing its SourceBuffers to seekToTime().
780 - This allows SourceBuffer to decline to enqueue new samples during a MediaSource seek operation.
782 * Modules/mediasource/MediaSource.cpp:
783 (WebCore::MediaSource::completeSeek):
785 2016-10-20 Dean Jackson <dino@apple.com>
787 SVG should not paint selection within a mask
788 https://bugs.webkit.org/show_bug.cgi?id=163772
789 <rdar://problem/28705129>
791 Reviewed by Simon Fraser.
793 When masking content, we shouldn't paint the text
794 selection as we are rendering into the masking
797 Test: svg/masking/mask-should-not-paint-selection.html
799 * rendering/PaintPhase.h: Add a new behavior - PaintBehaviorSkipSelectionHighlight.
800 * rendering/svg/SVGInlineTextBox.cpp:
801 (WebCore::SVGInlineTextBox::paint): Don't update the selectionStyle if
802 PaintBehaviorSkipSelectionHighlight is true.
803 * rendering/svg/SVGRenderingContext.cpp:
804 (WebCore::SVGRenderingContext::renderSubtreeToImageBuffer): Add PaintBehaviorSkipSelectionHighlight
807 2016-10-21 Chris Dumez <cdumez@apple.com>
809 [Web IDL] MediaControlsHost has invalid operation overloads
810 https://bugs.webkit.org/show_bug.cgi?id=163793
812 Reviewed by Darin Adler.
814 MediaControlsHost has invalid operation overloads:
815 - sortedTrackListForMenu()
816 - displayNameForTrack()
818 The parameter is nullable for both overloads which is not valid IDL.
820 - sortedTrackListForMenu(): The parameter is no longer nullable. This is a minor
821 behavior change and it should be safe since this is Apple-specific and only
822 called from mediaControlsApple.js which uses HTMLMediaElement.videoTracks and
823 HTMLMediaElement.audioTracks as input, both of which are not nullable.
824 Note that we could have also kept one of the parameters as nullable to not
825 change behavior but allowing null does not seem useful here.
826 - displayNameForTrack(): Use a union instead of overloading, no behavior change.
828 * Modules/mediacontrols/MediaControlsHost.cpp:
829 (WebCore::MediaControlsHost::sortedTrackListForMenu):
830 (WebCore::MediaControlsHost::displayNameForTrack):
831 * Modules/mediacontrols/MediaControlsHost.h:
832 * Modules/mediacontrols/MediaControlsHost.idl:
834 2016-10-21 Jeremy Jones <jeremyj@apple.com>
836 Implement basic pointer lock behavior for WebKit and WebKit2.
837 https://bugs.webkit.org/show_bug.cgi?id=162745
839 Reviewed by Simon Fraser.
841 When ENABLE_POINTER_LOCK is enabled, these tests now pass with DumpRenderTree.
842 LayoutTests/pointer-lock/lock-already-locked.html
843 LayoutTests/pointer-lock/lock-element-not-in-dom.html
844 LayoutTests/pointer-lock/locked-element-iframe-removed-from-dom.html
845 LayoutTests/pointer-lock/mouse-event-api.html
847 Export pointer lock symbols and cancel pointer lock on "escape".
849 * dom/Document.h: Export symbols.
850 * dom/Element.h: Export symbols.
851 * page/EventHandler.cpp:
852 (WebCore::EventHandler::keyEvent): Cancel pointer lock on "escape".
853 * page/PointerLockController.cpp: Add missing include.
854 * page/PointerLockController.h: Export symbols.
856 2016-10-21 Jer Noble <jer.noble@apple.com>
858 WebCore::PlatformMediaSession::stopSession + 13
859 https://bugs.webkit.org/show_bug.cgi?id=163799
861 Reviewed by Eric Carlson.
863 Because m_sessions can be mutated by removeSession() while iterating over m_sessions, and because
864 PlatformMediaSessions are not refcounted, it is not enough to copy m_sessions into a copied Vector
865 before iterating. Instead, wrap iteration of m_sessions in a convenience function, which sets an
866 iteration counter which, when cleared, removes all null entries from m_session. In parallel, modify
867 removeSession() to check this iteration counter, and replace the session with a null value rather
868 than mutating the m_sessions vector itself.
870 * platform/audio/PlatformMediaSessionManager.cpp:
871 (WebCore::PlatformMediaSessionManager::has):
872 (WebCore::PlatformMediaSessionManager::activeAudioSessionRequired):
873 (WebCore::PlatformMediaSessionManager::canProduceAudio):
874 (WebCore::PlatformMediaSessionManager::removeSession):
875 (WebCore::PlatformMediaSessionManager::sessionWillBeginPlayback):
876 (WebCore::PlatformMediaSessionManager::sessionWillEndPlayback):
877 (WebCore::PlatformMediaSessionManager::currentSessionsMatching):
878 (WebCore::PlatformMediaSessionManager::applicationWillEnterBackground):
879 (WebCore::PlatformMediaSessionManager::applicationDidEnterForeground):
880 (WebCore::PlatformMediaSessionManager::systemWillSleep):
881 (WebCore::PlatformMediaSessionManager::systemDidWake):
882 (WebCore::PlatformMediaSessionManager::stopAllMediaPlaybackForDocument):
883 (WebCore::PlatformMediaSessionManager::stopAllMediaPlaybackForProcess):
884 (WebCore::PlatformMediaSessionManager::forEachSession):
885 (WebCore::PlatformMediaSessionManager::anyOfSessions):
886 * platform/audio/PlatformMediaSessionManager.h:
888 2016-10-21 Darin Adler <darin@apple.com>
890 Move some more assorted classes from ExceptionCode to Exception
891 https://bugs.webkit.org/show_bug.cgi?id=163775
893 Reviewed by Chris Dumez.
895 * Modules/fetch/WorkerGlobalScopeFetch.cpp:
896 (WebCore::WorkerGlobalScopeFetch::fetch): Remove unnecessary calls to
897 WorkerGlobalScope::scriptExcutionObject, which just returns the scope itself.
899 * Modules/notifications/Notification.cpp: Added now-needed include.
900 * Modules/webdatabase/DOMWindowWebDatabase.cpp: Ditto.
902 * WebCore.xcodeproj/project.pbxproj: Added WindowOrWorkerGlobalScope.idl.
904 * bindings/js/JSDedicatedWorkerGlobalScopeCustom.cpp:
905 (WebCore::JSDedicatedWorkerGlobalScope::postMessage): Pass a reference instead
906 of a pointer to handlePostMessage.
907 * bindings/js/JSMessagePortCustom.cpp:
908 (WebCore::JSMessagePort::postMessage): Ditto.
910 * bindings/js/JSMessagePortCustom.h: Use pragma once. Change handlePostMessage
911 to take a reference to the object instead of a pointer, and also to use
912 propagateException since postMessage now uses ExceptionOr.
914 * bindings/js/JSWorkerCustom.cpp:
915 (WebCore::JSWorker::postMessage): Pass a reference instead of a pointer to
917 (WebCore::constructJSWorker): Use the version of toJSNewlyCreated that handles
918 propagating an exception from ExceptionOr.
920 * bindings/js/JSWorkerGlobalScopeCustom.cpp:
921 (WebCore::JSWorkerGlobalScope::visitAdditionalChildren): Use auto.
922 Remove unnecessary round trip through the scriptExecutionContext function.
923 (WebCore::JSWorkerGlobalScope::importScripts): Use reserveInitialCapacity and
924 uncheckedAppend to build up the vector of strings. Use propagateException
925 to deal with ExceptionOr result.
927 * dom/MessagePort.cpp:
928 (WebCore::MessagePort::MessagePort): Initialize boolean data members in the
929 class definition instead of here.
930 (WebCore::MessagePort::postMessage): Use ExceptionOr.
931 (WebCore::MessagePort::entangle): Use an rvalue reference.
932 (WebCore::MessagePort::dispatchMessages): Use ExceptionOr.
933 (WebCore::MessagePort::disentanglePorts): Ditto. Also use a more efficient
934 idiom that does half as much hashing as the old algorithm, and got rid an
935 unneeded local variable.
936 (WebCore::MessagePort::entanglePorts): Use an rvalue reference.
937 * dom/MessagePort.h: Updated for above changes.
939 * fileapi/FileReader.cpp:
940 (WebCore::FileReader::create): Use auto.
941 (WebCore::FileReader::FileReader): Initialize scalars in the class definition.
942 (WebCore::FileReader::~FileReader): Call cancel on the loader directly
943 instead of sharing code with the stop function.
944 (WebCore::FileReader::stop): Moved the body of the terminate function here.
945 (WebCore::FileReader::readAsArrayBuffer): Use ExceptionOr.
946 (WebCore::FileReader::readAsBinaryString): Ditto.
947 (WebCore::FileReader::readAsText): Ditto.
948 (WebCore::FileReader::readAsDataURL): Ditto.
949 (WebCore::FileReader::readInternal): Ditto. Also add a cast now that
950 we derive privately from FileReaderLoaderClient.
951 (WebCore::FileReader::abort): Call stop instead of terminate.
952 (WebCore::FileReader::terminate): Deleted. Moved code into stop.
953 (WebCore::FileReader::didReceiveData): Moved comment to where the constant is.
954 * fileapi/FileReader.h: Updated for above changes. Made more functions private
955 and used final instead of override.
956 * fileapi/FileReader.idl: Use non-legacy exceptions.
958 * fileapi/FileReaderSync.cpp:
959 (WebCore::FileReaderSync::readAsArrayBuffer): Use ExceptionOr.
960 (WebCore::FileReaderSync::readAsBinaryString): Ditto.
961 (WebCore::FileReaderSync::readAsText): Ditto.
962 (WebCore::FileReaderSync::readAsDataURL): Ditto.
963 (WebCore::FileReaderSync::startLoading): Ditto.
964 (WebCore::FileReaderSync::startLoadingString): Added. Helper to cut down on
965 repeated code in functions above.
966 * fileapi/FileReaderSync.h: Updated for above changes.
967 * fileapi/FileReaderSync.idl: Use non-legacy exceptions.
969 * page/Base64Utilities.cpp:
970 (WebCore::Base64Utilities::btoa): Use ExceptionOr.
971 (WebCore::Base64Utilities::atob): Ditto.
972 * page/Base64Utilities.h: Updated for above changes.
974 * page/DOMWindow.cpp:
975 (WebCore::DOMWindow::navigator): Pass a reference to the frame.
976 (WebCore::DOMWindow::postMessage): Use ExceptionOr when calling
977 MessagePort::disentanglePorts. Also udpated for changes to the
980 * page/Navigator.cpp:
981 (WebCore::Navigator::Navigator): Take a reference.
982 (WebCore::shouldHideFourDot): Ditto
983 (WebCore::Navigator::appVersion): Pass a reference.
984 (WebCore::Navigator::plugins): Return a reference.
985 (WebCore::Navigator::mimeTypes): Ditto.
986 * page/Navigator.h: Updated for above changes. Also marked the
987 class final and moved derivation from RefCounted to NavigatorBase.
989 * page/NavigatorBase.h: Addded derivation from RefCounted since
990 both derived classes want that, and the destructor is already virtual.
992 * page/WindowOrWorkerGlobalScope.idl: Use non-legacy exceptions.
994 * page/WorkerNavigator.cpp:
995 (WebCore::WorkerNavigator::~WorkerNavigator): Deleted.
997 * page/WorkerNavigator.h: Moved derivation from RefCounted to
998 NavigatorBase. Also marked class final.
1000 * workers/AbstractWorker.cpp:
1001 (WebCore::AbstractWorker::resolveURL): Use ExceptionOr.
1002 * workers/AbstractWorker.h: Updated for above changes.
1004 * workers/DedicatedWorkerGlobalScope.cpp:
1005 (WebCore::DedicatedWorkerGlobalScope::create): Use RefPtr&&
1006 instead of PassRefPtr.
1007 (WebCore::DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope):
1009 (WebCore::DedicatedWorkerGlobalScope::postMessage): Use ExceptionOr.
1010 (WebCore::DedicatedWorkerGlobalScope::importScripts): Ditto.
1011 * workers/DedicatedWorkerGlobalScope.h: Updated for above changes.
1012 * workers/DedicatedWorkerGlobalScope.idl: Use non-legacy exceptions.
1014 * workers/Worker.cpp:
1015 (WebCore::Worker::create): Use ExceptionOr.
1016 (WebCore::Worker::postMessage): Ditto.
1017 * workers/Worker.h: Updated for above changes.
1018 * workers/Worker.idl: Use non-legacy exception.
1020 * workers/WorkerGlobalScope.cpp:
1021 (WebCore::WorkerGlobalScope::WorkerGlobalScope): Moved initialization
1022 of m_closing to class definition.
1023 (WebCore::WorkerGlobalScope::~WorkerGlobalScope): Removed call to
1024 deleted notifyObserversOfStop function.
1025 (WebCore::WorkerGlobalScope::importScripts): Use ExceptionOr. Also use
1026 reserveInitialCapacity and uncheckedAppend to build a vector.
1027 (WebCore::WorkerGlobalScope::addConsoleMessage): Use an rvalue reference.
1028 Also moved the body of one of the addMessageToWorkerConsole overloads into
1029 one of the overloads of this function, and changed the other to call addMessage.
1030 (WebCore::WorkerGlobalScope::addMessage): Moved the body of the other
1031 addMessageToWorkerConsole here.
1032 (WebCore::WorkerGlobalScope::addMessageToWorkerConsole): Deleted.
1033 (WebCore::WorkerGlobalScope::Observer::Observer): Deleted.
1034 (WebCore::WorkerGlobalScope::Observer::~Observer): Deleted.
1035 (WebCore::WorkerGlobalScope::Observer::stopObserving): Deleted.
1036 (WebCore::WorkerGlobalScope::registerObserver): Deleted.
1037 (WebCore::WorkerGlobalScope::unregisterObserver): Deleted.
1038 (WebCore::WorkerGlobalScope::notifyObserversOfStop): Deleted.
1039 * workers/WorkerGlobalScope.h: Removed unneeded includes. Moved many virtual
1040 function overrides into the private section. Marked many functions final instead
1041 of just override. Removed unused Observer class and m_workerObservers set.
1043 * workers/WorkerThread.cpp:
1044 (WebCore::WorkerThread::stop): Removed call to deleted
1045 WorkerGlobalScope::notifyObserversOfStop function.
1047 2016-10-21 Antti Koivisto <antti@apple.com>
1049 Tighten ComputedStyleExtractor to use Element instead of Node
1050 https://bugs.webkit.org/show_bug.cgi?id=163798
1052 Reviewed by Andreas Kling.
1054 Also make its functions non-const as they may compute style.
1056 * css/CSSComputedStyleDeclaration.cpp:
1057 (WebCore::styleElementForNode):
1058 (WebCore::ComputedStyleExtractor::ComputedStyleExtractor):
1060 If we are called with a Node figure out the style Element in constructor.
1062 (WebCore::ComputedStyleExtractor::getFontSizeCSSValuePreferringKeyword):
1063 (WebCore::ComputedStyleExtractor::useFixedFontDefaultSize):
1064 (WebCore::ComputedStyleExtractor::styledElement):
1065 (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
1066 (WebCore::CSSComputedStyleDeclaration::copyProperties):
1067 (WebCore::elementOrItsAncestorNeedsStyleRecalc):
1069 Use composed tree iterator for increased correctness in shadow trees.
1071 (WebCore::updateStyleIfNeededForElement):
1072 (WebCore::computeRenderStyleForProperty):
1073 (WebCore::ComputedStyleExtractor::customPropertyValue):
1074 (WebCore::ComputedStyleExtractor::customPropertyText):
1075 (WebCore::ComputedStyleExtractor::propertyValue):
1076 (WebCore::CSSComputedStyleDeclaration::length):
1077 (WebCore::CSSComputedStyleDeclaration::item):
1078 (WebCore::ComputedStyleExtractor::propertyMatches):
1079 (WebCore::ComputedStyleExtractor::copyProperties):
1080 (WebCore::ComputedStyleExtractor::getCSSPropertyValuesForShorthandProperties):
1081 (WebCore::ComputedStyleExtractor::getCSSPropertyValuesForSidesShorthand):
1082 (WebCore::ComputedStyleExtractor::getCSSPropertyValuesForGridShorthand):
1083 (WebCore::ComputedStyleExtractor::copyPropertiesInSet):
1084 (WebCore::CSSComputedStyleDeclaration::getPropertyValue):
1085 (WebCore::ComputedStyleExtractor::getBackgroundShorthandValue):
1086 (WebCore::ComputedStyleExtractor::styledNode): Deleted.
1087 (WebCore::nodeOrItsAncestorNeedsStyleRecalc): Deleted.
1088 (WebCore::updateStyleIfNeededForNode): Deleted.
1089 * css/CSSComputedStyleDeclaration.h:
1090 * css/SVGCSSComputedStyleDeclaration.cpp:
1091 (WebCore::ComputedStyleExtractor::svgPropertyValue):
1092 * editing/EditingStyle.cpp:
1093 (WebCore::EditingStyle::removeEquivalentProperties):
1094 * editing/EditingStyle.h:
1096 2016-10-21 Chris Dumez <cdumez@apple.com>
1098 WebGL2RenderingContext.texSubImage3D() should use a union instead of overloading
1099 https://bugs.webkit.org/show_bug.cgi?id=163792
1101 Reviewed by Darin Adler.
1103 WebGL2RenderingContext.texSubImage3D() should use a union instead of overloading for
1104 - https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7 (for texSubImage3D)
1105 - https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14 (for TexImageSource)
1107 * html/canvas/WebGL2RenderingContext.cpp:
1108 (WebCore::WebGL2RenderingContext::texSubImage3D):
1109 * html/canvas/WebGL2RenderingContext.h:
1110 * html/canvas/WebGL2RenderingContext.idl:
1112 2016-10-21 Zalan Bujtas <zalan@apple.com>
1114 Do not mutate the render tree while collecting selection repaint rects.
1115 https://bugs.webkit.org/show_bug.cgi?id=163800
1116 <rdar://problem/28806886>
1118 Reviewed by David Hyatt.
1120 RenderListItem not only mutates the tree while in layout but it also uses
1121 the old descendant context to find the insertion point.
1122 This patch strictly ensures that we only do it while in layout and never
1123 in other cases such as collecting repaint rects.
1124 This gets redundant when webkit.org/b/163789 is fixed.
1126 Test: fast/lists/crash-when-list-marker-is-moved-during-selection.html
1128 * rendering/RenderListItem.cpp:
1129 (WebCore::RenderListItem::insertOrMoveMarkerRendererIfNeeded):
1131 2016-10-21 Dave Hyatt <hyatt@apple.com>
1133 [CSS Parser] Support horizontal-bt writing mode
1134 https://bugs.webkit.org/show_bug.cgi?id=163797
1136 Reviewed by Zalan Bujtas.
1138 * css/parser/CSSParserFastPaths.cpp:
1139 (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
1141 2016-10-20 Brent Fulgham <bfulgham@apple.com>
1143 [Win][Direct2D] Correct some memory leaks and other minor bugs
1144 https://bugs.webkit.org/show_bug.cgi?id=163769
1146 Reviewed by Alex Christensen.
1148 Several D2D handles were being leaked.
1150 Direct2D sometimes returns an infinite rect containing { -inf, -inf, FloatMax, FloatMax },
1151 sometimes { -FloatMax, -FloatMax, inf, inf }, and various combinations thereof. This caused
1152 most SVG drawing to decide no screen rect was contained in the "infinite rect" so nothing
1155 Tested by existing layout tests.
1157 * platform/graphics/GraphicsContext.h:
1158 * platform/graphics/win/FloatRectDirect2D.cpp:
1159 (WebCore::isInfiniteRect): Recognize various infinite rects in Windows.
1160 (WebCore::FloatRect::FloatRect): Convert a Windows infinite rect to the style
1161 we use inside WebKit.
1162 * platform/graphics/win/FontCascadeDirect2D.cpp:
1163 (WebCore::FontCascade::drawGlyphs): Use cached brushes if possible.
1164 * platform/graphics/win/GlyphPageTreeNodeDirect2D.cpp:
1165 (WebCore::GlyphPage::fill): Don't terminate on this error case.
1166 * platform/graphics/win/GradientDirect2D.cpp:
1167 (WebCore::Gradient::generateGradient): Don't leak gradients.
1168 * platform/graphics/win/GraphicsContextDirect2D.cpp:
1169 (WebCore::GraphicsContextPlatformPrivate::brushWithColor): Added.
1170 (WebCore::GraphicsContext::brushWithColor): Added.
1171 (WebCore::GraphicsContextPlatformPrivate::concatCTM): Perform transform multiplication
1172 in the right order (hint: it's not distributive).
1173 (WebCore::GraphicsContext::drawWithShadow): Use convenience method.
1174 (WebCore::GraphicsContext::fillRect): Ditto.
1175 (WebCore::GraphicsContext::platformFillRoundedRect): Ditto.
1176 (WebCore::GraphicsContext::clearRect): Ditto.
1177 (WebCore::GraphicsContext::setPlatformStrokeColor): Ditto.
1178 (WebCore::GraphicsContext::setPlatformFillColor): Ditto.
1179 * platform/graphics/win/PathDirect2D.cpp:
1180 (WebCore::Path::polygonPathFromPoints): No need to convert manually.
1181 (WebCore::Path::~Path): Don't leak ID2D1Geometry entities.
1182 (WebCore::Path::appendGeometry): Ditto.
1183 (WebCore::Path::createGeometryWithFillMode): Ditto.
1184 (WebCore::Path::Path): Ditto.
1185 (WebCore::Path::operator=): Ditto.
1186 (WebCore::Path::strokeBoundingRect): Provide an implementation.
1187 (WebCore::Path::addRect): No need for manual casting here.
1189 2016-10-21 Wenson Hsieh <wenson_hsieh@apple.com>
1191 Fix minor style issue in the signature of StaticRange::create
1192 https://bugs.webkit.org/show_bug.cgi?id=163786
1193 <rdar://problem/28853079>
1195 Reviewed by Alex Christensen.
1197 Change `Ref<WebCore::Node> &&` to `Ref<Node>&&`.
1199 * dom/StaticRange.cpp:
1200 (WebCore::StaticRange::create):
1202 2016-10-21 Dave Hyatt <hyatt@apple.com>
1204 [CSS Parser] Add support for -webkit-line-box-contain
1205 https://bugs.webkit.org/show_bug.cgi?id=163794
1207 Reviewed by Zalan Bujtas.
1209 * css/parser/CSSPropertyParser.cpp:
1210 (WebCore::consumeLineBoxContain):
1211 (WebCore::CSSPropertyParser::parseSingleValue):
1213 2016-10-21 Dave Hyatt <hyatt@apple.com>
1215 [CSS Parser] Add support for @-webkit-region rules
1216 https://bugs.webkit.org/show_bug.cgi?id=163787
1218 Reviewed by Zalan Bujtas.
1220 * css/StyleRule.cpp:
1221 (WebCore::StyleRuleRegion::StyleRuleRegion):
1223 * css/parser/CSSAtRuleID.cpp:
1224 (WebCore::cssAtRuleID):
1225 * css/parser/CSSAtRuleID.h:
1226 * css/parser/CSSParserImpl.cpp:
1227 (WebCore::CSSParserImpl::consumeAtRule):
1228 (WebCore::CSSParserImpl::consumePageRule):
1229 (WebCore::CSSParserImpl::consumeRegionRule):
1230 * css/parser/CSSParserImpl.h:
1232 2016-10-21 David Kilzer <ddkilzer@apple.com>
1234 Bug 163757: Use IntSize::unclampedArea() in PDFDocumentImage::updateCachedImageIfNeeded()
1235 <https://webkit.org/b/163757>
1237 Reviewed by Brent Fulgham.
1239 No new tests since there is no change in nominal behavior.
1241 * platform/graphics/cg/PDFDocumentImage.cpp:
1242 (WebCore::PDFDocumentImage::updateCachedImageIfNeeded): Use
1243 IntSize::unclampedArea() where manual calculations were used
1244 previously. Also gets rid of more safeCast<size_t>() use.
1246 2016-10-21 Chris Dumez <cdumez@apple.com>
1248 [Web IDL] Support unions in our overload resolution algorithm
1249 https://bugs.webkit.org/show_bug.cgi?id=163764
1251 Reviewed by Darin Adler.
1253 Support unions in our overload resolution algorithm as per:
1254 - https://heycam.github.io/webidl/#es-overloads
1255 - https://heycam.github.io/webidl/#dfn-distinguishable
1257 * bindings/scripts/CodeGeneratorJS.pm:
1258 (IsIDLTypeDistinguishableWithUnionForOverloadResolution):
1259 (AreTypesDistinguishableForOverloadResolution):
1260 (GetOverloadThatMatches):
1261 (GenerateOverloadedFunctionOrConstructor):
1262 * bindings/scripts/test/JS/JSTestObj.cpp:
1263 * bindings/scripts/test/TestObj.idl:
1265 2016-10-21 Chris Dumez <cdumez@apple.com>
1267 AudioNode.connect(): First parameter should not be nullable
1268 https://bugs.webkit.org/show_bug.cgi?id=163773
1270 Reviewed by Darin Adler.
1272 AudioNode.connect()'s first parameter should not be nullable:
1273 - https://webaudio.github.io/web-audio-api/#idl-def-AudioNode.
1275 We were throwing a SYNTAX_ERR when passing null, we now throw
1276 a TypeError instead.
1278 No new tests, updated existing test.
1280 * Modules/webaudio/AudioBasicInspectorNode.cpp:
1281 (WebCore::AudioBasicInspectorNode::connect):
1282 * Modules/webaudio/AudioBasicInspectorNode.h:
1283 * Modules/webaudio/AudioNode.cpp:
1284 (WebCore::AudioNode::connect):
1285 * Modules/webaudio/AudioNode.h:
1286 * Modules/webaudio/AudioNode.idl:
1288 2016-10-21 Wenson Hsieh <wenson_hsieh@apple.com>
1290 Implement InputEvent.getTargetRanges() for the input events spec
1291 https://bugs.webkit.org/show_bug.cgi?id=162947
1292 <rdar://problem/28853079>
1294 Reviewed by Darin Adler.
1296 Implements InputEvent.getTargetRanges(). See individual method changes below for more details. Adds a new hook
1297 for subclasses of CompositeEditCommand to vend a list of target StaticRanges when retrieving target ranges for
1298 an editing command on a contenteditable area.
1300 Tests: fast/events/before-input-delete-empty-list-target-ranges.html
1301 fast/events/before-input-delete-text-target-ranges.html
1302 fast/events/before-input-replace-text-target-ranges.html
1305 * DerivedSources.make:
1306 * WebCore.xcodeproj/project.pbxproj:
1308 Add StaticRange.idl, StaticRange.cpp and StaticRange.h.
1310 * bindings/generic/RuntimeEnabledFeatures.h:
1311 (WebCore::RuntimeEnabledFeatures::setInputEventsEnabled):
1312 (WebCore::RuntimeEnabledFeatures::inputEventsEnabled):
1314 Add a new runtime bindings flag for InputEvents and guard both InputEvent and StaticRange behind it.
1316 * dom/DOMAllInOne.cpp:
1317 * dom/InputEvent.cpp:
1318 (WebCore::InputEvent::InputEvent):
1320 * dom/InputEvent.idl:
1321 * dom/StaticRange.cpp: Copied from Source/WebCore/dom/InputEvent.cpp.
1322 (WebCore::StaticRange::StaticRange):
1323 (WebCore::StaticRange::create):
1324 (WebCore::StaticRange::createFromRange):
1326 Convenience method for creating a StaticRange from a Range's start/end container and offset.
1328 (WebCore::StaticRange::startContainer):
1329 (WebCore::StaticRange::endContainer):
1330 (WebCore::StaticRange::collapsed):
1331 * dom/StaticRange.h: Copied from Source/WebCore/dom/InputEvent.cpp.
1332 (WebCore::StaticRange::startOffset):
1333 (WebCore::StaticRange::endOffset):
1334 * dom/StaticRange.idl: Copied from Source/WebCore/editing/ReplaceRangeWithTextCommand.h.
1335 * editing/CompositeEditCommand.cpp:
1336 (WebCore::CompositeEditCommand::willApplyCommand):
1337 (WebCore::CompositeEditCommand::targetRanges):
1339 Virtual method that returns a list of target ranges which are associated with this command.
1341 (WebCore::CompositeEditCommand::targetRangesForBindings):
1343 Non-virtual method that calls the above targetRanges(). Takes whether or not the CompositeEditCommand is editing
1344 a textarea or plain text input into account.
1346 (WebCore::CompositeEditCommand::moveParagraphs):
1347 * editing/CompositeEditCommand.h:
1348 * editing/EditCommand.cpp:
1349 (WebCore::EditCommand::frame):
1350 * editing/EditCommand.h:
1351 (WebCore::EditCommand::document):
1352 * editing/Editor.cpp:
1353 (WebCore::dispatchBeforeInputEvent):
1354 (WebCore::dispatchInputEvent):
1355 (WebCore::dispatchBeforeInputEvents):
1357 Changed the `beforeinput` event dispatch to use the regular Node::dispatchEvent instead of dispatchScopedEvent.
1358 This is because if the page prevents the `beforeinput` event, we need to know immediately in order to bail from
1361 (WebCore::dispatchInputEvents):
1362 (WebCore::Editor::willApplyEditing):
1364 Added a list of static ranges as a parameter when calling on the Editor to dispatch `beforeinput` events.
1365 By default, this uses the composite edit command's targetRangesForBindings(), though it may be special cased
1366 by subclasses of CompositeEditCommand (see ReplaceRangeWithTextCommand, SpellingCorrectionCommand, and
1370 * editing/ReplaceRangeWithTextCommand.cpp:
1371 (WebCore::ReplaceRangeWithTextCommand::targetRanges):
1372 * editing/ReplaceRangeWithTextCommand.h:
1373 * editing/SpellingCorrectionCommand.cpp:
1374 (WebCore::SpellingCorrectionCommand::targetRanges):
1375 * editing/SpellingCorrectionCommand.h:
1376 * editing/TypingCommand.cpp:
1377 (WebCore::editActionIsDeleteByTyping):
1378 (WebCore::TypingCommand::shouldDeferWillApplyCommandUntilAddingTypingCommand):
1379 (WebCore::TypingCommand::willApplyCommand):
1380 (WebCore::TypingCommand::willAddTypingToOpenCommand):
1381 (WebCore::TypingCommand::deleteKeyPressed):
1382 (WebCore::TypingCommand::forwardDeleteKeyPressed):
1384 Moves the firing of the `beforeinput` until after the selection range to delete has been computed.
1386 * editing/TypingCommand.h:
1388 2016-10-21 Antti Koivisto <antti@apple.com>
1390 Style resolver should be updated lazily
1391 https://bugs.webkit.org/show_bug.cgi?id=163721
1393 Reviewed by Andreas Kling.
1395 Currently when stylesheets change in some way we generally update style resolvers and
1396 invalidate style immediately. We should do this lazily to avoid unnecessary work.
1398 Also improve naming of the stylesheet invalidation functions and use more optimal functions in some places.
1400 * css/CSSComputedStyleDeclaration.cpp:
1401 (WebCore::updateStyleIfNeededForNode):
1402 * css/CSSStyleSheet.cpp:
1403 (WebCore::CSSStyleSheet::didMutateRules):
1404 (WebCore::CSSStyleSheet::didMutate):
1405 (WebCore::CSSStyleSheet::setDisabled):
1406 * css/StyleResolver.cpp:
1407 (WebCore::StyleResolver::StyleResolver):
1409 Initialize root style font with null font selector.
1410 This avoids hitting a CSSFontSelector assert in fast/media/mq-relative-constraints-08.html where
1411 media query evaluation requires font information before it is ready.
1412 Exposed by increased laziness in this patch.
1415 (WebCore::Document::setContentLanguage):
1416 (WebCore::Document::updateLayoutIgnorePendingStylesheets):
1417 (WebCore::Document::isPageBoxVisible):
1418 (WebCore::Document::pageSizeAndMarginsInPixels):
1419 (WebCore::Document::processHttpEquiv):
1420 (WebCore::Document::setSelectedStylesheetSet):
1421 (WebCore::Document::didInsertInDocumentShadowRoot):
1422 (WebCore::Document::didRemoveInDocumentShadowRoot):
1424 (WebCore::Document::inDocumentShadowRoots):
1426 Track all shadow roots in the document. This allows us to find and flush style scopes cheaply.
1429 (WebCore::Element::computedStyle):
1430 * dom/ExtensionStyleSheets.cpp:
1431 (WebCore::ExtensionStyleSheets::ExtensionStyleSheets):
1432 (WebCore::ExtensionStyleSheets::clearPageUserSheet):
1433 (WebCore::ExtensionStyleSheets::updatePageUserSheet):
1434 (WebCore::ExtensionStyleSheets::invalidateInjectedStyleSheetCache):
1435 (WebCore::ExtensionStyleSheets::addUserStyleSheet):
1436 (WebCore::ExtensionStyleSheets::addAuthorStyleSheetForTesting):
1437 (WebCore::ExtensionStyleSheets::addDisplayNoneSelector):
1438 (WebCore::ExtensionStyleSheets::maybeAddContentExtensionSheet):
1439 (WebCore::ExtensionStyleSheets::styleResolverChangedTimerFired): Deleted.
1441 Since updates are now done lazily we don't need a special timer for extension stylesheets.
1443 * dom/ExtensionStyleSheets.h:
1444 * dom/ProcessingInstruction.cpp:
1445 (WebCore::ProcessingInstruction::checkStyleSheet):
1446 (WebCore::ProcessingInstruction::sheetLoaded):
1447 (WebCore::ProcessingInstruction::removedFrom):
1448 * dom/ShadowRoot.cpp:
1449 (WebCore::ShadowRoot::ShadowRoot):
1450 (WebCore::ShadowRoot::insertedInto):
1451 (WebCore::ShadowRoot::removedFrom):
1452 (WebCore::ShadowRoot::styleScope):
1454 * html/HTMLLinkElement.cpp:
1455 (WebCore::HTMLLinkElement::setDisabledState):
1456 (WebCore::HTMLLinkElement::parseAttribute):
1457 (WebCore::HTMLLinkElement::process):
1458 (WebCore::HTMLLinkElement::removePendingSheet):
1459 * html/HTMLStyleElement.cpp:
1460 (WebCore::HTMLStyleElement::parseAttribute):
1461 * inspector/InspectorCSSAgent.cpp:
1462 (WebCore::InspectorCSSAgent::createInspectorStyleSheetForDocument):
1463 (WebCore::InspectorCSSAgent::forcePseudoState):
1464 (WebCore::InspectorCSSAgent::resetPseudoStates):
1465 * inspector/InspectorPageAgent.cpp:
1466 (WebCore::InspectorPageAgent::setEmulatedMedia):
1468 (WebCore::Frame::setPrinting):
1469 * page/FrameView.cpp:
1470 (WebCore::FrameView::layout):
1471 (WebCore::FrameView::setPagination):
1472 (WebCore::FrameView::setViewportSizeForCSSViewportUnits):
1474 (WebCore::Page::setViewMode):
1475 (WebCore::Page::setNeedsRecalcStyleInAllFrames):
1476 (WebCore::Page::invalidateInjectedStyleSheetCacheInAllFrames):
1477 * style/StyleScope.cpp:
1478 (WebCore::Style::Scope::setPreferredStylesheetSetName):
1479 (WebCore::Style::Scope::setSelectedStylesheetSetName):
1480 (WebCore::Style::Scope::removePendingSheet):
1481 (WebCore::Style::Scope::removeStyleSheetCandidateNode):
1482 (WebCore::Style::Scope::activeStyleSheetsForInspector):
1483 (WebCore::Style::Scope::flushPendingUpdate):
1485 Also flush descendant shadow roots.
1487 (WebCore::Style::Scope::scheduleUpdate):
1488 (WebCore::Style::Scope::didChangeActiveStyleSheetCandidates):
1492 (WebCore::Style::Scope::didChangeStyleSheetContents):
1496 (WebCore::Style::Scope::didChangeStyleSheetEnvironment):
1498 Environment changes also affect author shadow roots.
1500 (WebCore::Style::Scope::styleSheetsForStyleSheetList):
1501 (WebCore::Style::Scope::scheduleActiveSetUpdate): Deleted.
1502 (WebCore::Style::Scope::didChangeCandidatesForActiveSet): Deleted.
1503 (WebCore::Style::Scope::didChangeContentsOrInterpretation): Deleted.
1505 Improved naming of these and split didChangeContentsOrInterpretation into two separate functions.
1507 * style/StyleScope.h:
1508 (WebCore::Style::Scope::styleSheetsForStyleSheetList): Deleted.
1509 (WebCore::Style::Scope::setPreferredStylesheetSetName): Deleted.
1510 (WebCore::Style::Scope::setSelectedStylesheetSetName): Deleted.
1511 * svg/SVGFontFaceElement.cpp:
1512 (WebCore::SVGFontFaceElement::rebuildFontFace):
1513 (WebCore::SVGFontFaceElement::removedFrom):
1514 * testing/Internals.cpp:
1515 (WebCore::Internals::resetToConsistentState):
1517 Ensure that cationsStyleSheetOverride really becomes empty. Some tests rely on not having suprise
1518 inserted stylesheets. Previously this was racy and the patch affected order of things.
1520 (WebCore::Internals::styleChangeType):
1521 * xml/XMLTreeViewer.cpp:
1522 (WebCore::XMLTreeViewer::transformDocumentToTreeView):
1523 * xml/parser/XMLDocumentParser.cpp:
1524 (WebCore::XMLDocumentParser::end):
1525 * xml/parser/XMLDocumentParserLibxml2.cpp:
1526 (WebCore::XMLDocumentParser::doEnd):
1528 2016-10-21 Xabier Rodriguez Calvar <calvaris@igalia.com> and Adam Bergkvist <adam.bergkvist@ericsson.com>
1530 WebRTC: [OpenWebRTC] Move SDPProcessorScriptResource(Gtk) to openwebrtc directory
1531 https://bugs.webkit.org/show_bug.cgi?id=163778
1533 Reviewed by Philippe Normand.
1535 Move SDPProcessorScriptResourceGtk from the platform gtk directory to the port generic
1536 openwebrtc directory to make it usable by other ports. Also drop the Gtk-suffix.
1538 No change of behavior.
1540 * PlatformGTK.cmake:
1541 * platform/mediastream/gtk/SDPProcessorScriptResourceGtk.cpp:
1542 (WebCore::SDPProcessorScriptResource::scriptString): Deleted.
1543 * platform/mediastream/openwebrtc/SDPProcessorScriptResource.cpp: Renamed from Source/WebCore/platform/mediastream/gtk/SDPProcessorScriptResourceGtk.cpp.
1544 (WebCore::SDPProcessorScriptResource::scriptString):
1546 2016-10-21 Miguel Gomez <magomez@igalia.com>
1548 [GTK] Several tests crashing on debug bot in (anonymous namespace)::MediaPlayerPrivateGStreamerBase::repaint
1549 https://bugs.webkit.org/show_bug.cgi?id=163511
1551 Reviewed by Carlos Garcia Campos.
1553 Perform the video repaint in the main thread when accelerated compositing is disabled. Added a new method to
1554 MediaPlayerClient to get whether accelerated compositing is enabled from the MediaPlayer. This is needed
1555 because mediaPlayerAcceleratedCompositingEnabled() will return false while HTMLMediaElement doesn't have a
1556 RenderVideo, even when accelerated compositing is enabled.
1558 Covered by existent tests.
1560 * html/HTMLMediaElement.cpp:
1561 (WebCore::HTMLMediaElement::mediaPlayerAcceleratedCompositingEnabled):
1562 * html/HTMLMediaElement.h:
1563 * platform/graphics/MediaPlayer.h:
1564 (WebCore::MediaPlayerClient::mediaPlayerAcceleratedCompositingEnabled):
1565 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1566 (WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase):
1567 (WebCore::MediaPlayerPrivateGStreamerBase::repaint):
1568 (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
1569 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
1571 2016-10-21 Adam Bergkvist <adam.bergkvist@ericsson.com>
1573 WebRTC: [GTK] Add MediaEndpointOwr - an OpenWebRTC WebRTC backend
1574 https://bugs.webkit.org/show_bug.cgi?id=163327
1576 Reviewed by Philippe Normand.
1578 Add MediaEndpointOwr which is a MediaEndpoint implementation (WebRTC backend) based on
1579 OpenWebRTC [1]. The WebRTC backend can be tested with a manual test. Automatic testing
1580 is still done with MockMediaEndpoint.
1582 [1] http://www.openwebrtc.org/
1584 Testing: Added manual test (webrtc-one-tab-p2p.html)
1587 * platform/GStreamer.cmake:
1588 * platform/mediastream/openwebrtc/MediaEndpointOwr.cpp: Added.
1589 (WebCore::createMediaEndpointOwr):
1590 (WebCore::MediaEndpointOwr::MediaEndpointOwr):
1591 (WebCore::MediaEndpointOwr::~MediaEndpointOwr):
1592 (WebCore::MediaEndpointOwr::setConfiguration):
1593 (WebCore::cryptoDataCallback):
1594 (WebCore::MediaEndpointOwr::generateDtlsInfo):
1595 (WebCore::MediaEndpointOwr::getDefaultAudioPayloads):
1596 (WebCore::MediaEndpointOwr::getDefaultVideoPayloads):
1597 (WebCore::payloadsContainType):
1598 (WebCore::MediaEndpointOwr::filterPayloads):
1599 (WebCore::MediaEndpointOwr::updateReceiveConfiguration):
1600 (WebCore::findRtxPayload):
1601 (WebCore::MediaEndpointOwr::updateSendConfiguration):
1602 (WebCore::MediaEndpointOwr::addRemoteCandidate):
1603 (WebCore::MediaEndpointOwr::replaceMutedRemoteSourceMid):
1604 (WebCore::MediaEndpointOwr::createMutedRemoteSource):
1605 (WebCore::MediaEndpointOwr::replaceSendSource):
1606 (WebCore::MediaEndpointOwr::stop):
1607 (WebCore::MediaEndpointOwr::transceiverIndexForSession):
1608 (WebCore::MediaEndpointOwr::sessionMid):
1609 (WebCore::MediaEndpointOwr::matchTransceiverByMid):
1610 (WebCore::MediaEndpointOwr::dispatchNewIceCandidate):
1611 (WebCore::MediaEndpointOwr::dispatchGatheringDone):
1612 (WebCore::MediaEndpointOwr::processIceTransportStateChange):
1613 (WebCore::MediaEndpointOwr::dispatchDtlsFingerprint):
1614 (WebCore::MediaEndpointOwr::unmuteRemoteSource):
1615 (WebCore::MediaEndpointOwr::prepareSession):
1616 (WebCore::MediaEndpointOwr::prepareMediaSession):
1617 (WebCore::parseHelperServerUrl):
1618 (WebCore::MediaEndpointOwr::ensureTransportAgentAndTransceivers):
1619 (WebCore::MediaEndpointOwr::internalAddRemoteCandidate):
1620 (WebCore::gotCandidate):
1621 (WebCore::candidateGatheringDone):
1622 (WebCore::iceConnectionStateChange):
1623 (WebCore::gotIncomingSource):
1624 * platform/mediastream/openwebrtc/MediaEndpointOwr.h: Added.
1625 (WebCore::OwrTransceiver::create):
1626 (WebCore::OwrTransceiver::~OwrTransceiver):
1627 (WebCore::OwrTransceiver::mid):
1628 (WebCore::OwrTransceiver::session):
1629 (WebCore::OwrTransceiver::owrIceState):
1630 (WebCore::OwrTransceiver::setOwrIceState):
1631 (WebCore::OwrTransceiver::gotEndOfRemoteCandidates):
1632 (WebCore::OwrTransceiver::markGotEndOfRemoteCandidates):
1633 (WebCore::OwrTransceiver::OwrTransceiver):
1634 * platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.h:
1635 (WebCore::RealtimeMediaSourceOwr::RealtimeMediaSourceOwr):
1636 (WebCore::RealtimeMediaSourceOwr::swapOutShallowSource):
1637 Add support for an initially muted source. This is used for early
1638 creation of remote sources.
1640 2016-10-21 Javier Fernandez <jfernandez@igalia.com>
1642 [css-grid] Content Alignment broken with indefinite sized grid container
1643 https://bugs.webkit.org/show_bug.cgi?id=163724
1645 Reviewed by Manuel Rego Casasnovas.
1647 The Grid Tracks sizing algorithm receives as parameter the
1648 available space to be used as space for tracks. We hold a variable
1649 to store the remaining free space for each dimension.
1651 When the grid container size is indefinite we can't compute the
1652 available free space after computing track sizes until such
1653 indefinite size is resolved.
1655 No new tests, just added some additional test cases.
1657 * rendering/RenderGrid.cpp:
1658 (WebCore::RenderGrid::layoutBlock): Compute freeSpace for Rows
1659 after doing layout and resolving the indefinite height.
1661 2016-10-21 Jer Noble <jer.noble@apple.com>
1663 CRASH in SourceBuffer::sourceBufferPrivateDidReceiveSample + 2169
1664 https://bugs.webkit.org/show_bug.cgi?id=163735
1666 Reviewed by Eric Carlson.
1668 Test: media/media-source/media-source-sample-wrong-track-id.html
1670 When SourceBuffer receives a sample in sourceBufferPrivateDidReceiveSample() containing
1671 a trackID not previously seen in an initialization segment, it creates a default TrackBuffer
1672 object to contain that track's samples. One of the fields in TrackBuffer, description, is
1673 normally filled out when an initialization segment is received, but with this default
1674 TrackBuffer, it's still null when it's checked later in sourceBufferPrivateDidReceiveSample().
1676 Rather than adding a null-check on trackBuffer.description, drop any sample that has a
1677 trackID which was not present during a previous initialization segment.
1679 * Modules/mediasource/SourceBuffer.cpp:
1680 (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
1682 2016-10-20 Carlos Garcia Campos <cgarcia@igalia.com>
1684 [GTK] Configures but fails to link with ENABLE_OPENGL=OFF
1685 https://bugs.webkit.org/show_bug.cgi?id=163449
1687 Reviewed by Michael Catanzaro.
1689 Only define sharingGLContext in PlatformDisplay if EGL or GLX are enabled.
1691 * platform/graphics/PlatformDisplay.cpp:
1692 * platform/graphics/PlatformDisplay.h:
1693 * platform/graphics/wayland/PlatformDisplayWayland.cpp:
1694 (WebCore::PlatformDisplayWayland::initialize):
1695 * platform/graphics/x11/PlatformDisplayX11.cpp:
1696 (WebCore::PlatformDisplayX11::~PlatformDisplayX11):
1698 2016-10-20 Filip Pizlo <fpizlo@apple.com>
1700 The tracking of the coarse-grain Heap state (allocating or not, collector or not, eden vs full) should respect the orthogonality between allocating and collecting
1701 https://bugs.webkit.org/show_bug.cgi?id=163738
1703 Reviewed by Geoffrey Garen.
1705 No new tests because no change in behavior.
1707 * bindings/js/GCController.cpp:
1708 (WebCore::GCController::garbageCollectNow):
1710 2016-10-20 Chris Dumez <cdumez@apple.com>
1712 [Bindings] Start using signature->idlType instead of signature->type in the overload resolution code
1713 https://bugs.webkit.org/show_bug.cgi?id=163767
1715 Reviewed by Darin Adler.
1717 Start using signature->idlType instead of signature->type in the overload resolution code
1718 to prepare for union type support.
1720 * bindings/scripts/CodeGeneratorJS.pm:
1721 (ComputeEffectiveOverloadSet):
1722 (AreTypesDistinguishableForOverloadResolution):
1723 (GetDistinguishingArgumentIndex):
1724 (GetOverloadThatMatches):
1725 (GenerateOverloadedFunctionOrConstructor):
1727 2016-10-20 Myles C. Maxfield <mmaxfield@apple.com>
1729 Implement WebGL2 bufferData() and bufferSubData() methods
1730 https://bugs.webkit.org/show_bug.cgi?id=163759
1732 Reviewed by Dean Jackson.
1734 These new overloads simply clip the input array buffer.
1736 Test: fast/canvas/webgl/bufferData-offset-length.html
1738 * html/canvas/WebGL2RenderingContext.cpp:
1739 (WebCore::WebGL2RenderingContext::bufferData):
1740 (WebCore::WebGL2RenderingContext::bufferSubData):
1741 * html/canvas/WebGL2RenderingContext.h:
1742 * html/canvas/WebGL2RenderingContext.idl:
1744 2016-10-20 Chris Dumez <cdumez@apple.com>
1746 "Download Linked File" context menu action should use 'download' attribute as suggested filename
1747 https://bugs.webkit.org/show_bug.cgi?id=163742
1748 <rdar://problem/28840734>
1750 Reviewed by Darin Adler.
1752 Add convenience method to HitTestResult to return the URL element's
1755 * rendering/HitTestResult.cpp:
1756 (WebCore::HitTestResult::URLElementDownloadAttribute):
1757 * rendering/HitTestResult.h:
1759 2016-10-20 Nan Wang <n_wang@apple.com>
1761 AX: VoiceOver is not detecting ARIA treeview if it contains role="presentation"
1762 https://bugs.webkit.org/show_bug.cgi?id=163763
1764 Reviewed by Chris Fleizach.
1766 Test: accessibility/mac/aria-tree-with-presentation-role.html
1768 Web authors sometimes use presentation role in the aria tree to hide elements. We should
1769 consider this a valid case if they specify tree items and groups correctly.
1771 * accessibility/AccessibilityNodeObject.cpp:
1772 (WebCore::AccessibilityNodeObject::hierarchicalLevel):
1773 * accessibility/AccessibilityTree.cpp:
1774 (WebCore::AccessibilityTree::nodeHasTreeItemChild):
1775 (WebCore::AccessibilityTree::isTreeValid):
1776 * accessibility/AccessibilityTree.h:
1778 2016-10-20 Myles C. Maxfield <mmaxfield@apple.com>
1780 Many WebGL functions which don't throw are marked as possibly throwing
1781 https://bugs.webkit.org/show_bug.cgi?id=163747
1783 Reviewed by Dean Jackson.
1785 Mechanically remove the exception code.
1787 No new tests because there is no behavior change.
1789 * bindings/js/JSWebGLRenderingContextBaseCustom.cpp:
1790 (WebCore::getObjectParameter):
1791 (WebCore::JSWebGLRenderingContextBase::getAttachedShaders):
1792 (WebCore::JSWebGLRenderingContextBase::getProgramParameter):
1793 (WebCore::JSWebGLRenderingContextBase::getShaderParameter):
1794 (WebCore::JSWebGLRenderingContextBase::getUniform):
1795 (WebCore::dataFunctionf):
1796 (WebCore::dataFunctioni):
1797 (WebCore::dataFunctionMatrix):
1798 * html/canvas/WebGL2RenderingContext.cpp:
1799 (WebCore::WebGL2RenderingContext::texSubImage2D):
1800 * html/canvas/WebGLRenderingContext.cpp:
1801 (WebCore::WebGLRenderingContext::texSubImage2D):
1802 * html/canvas/WebGLRenderingContextBase.cpp:
1803 (WebCore::WebGLRenderingContextBase::activeTexture):
1804 (WebCore::WebGLRenderingContextBase::attachShader):
1805 (WebCore::WebGLRenderingContextBase::bindAttribLocation):
1806 (WebCore::WebGLRenderingContextBase::bindBuffer):
1807 (WebCore::WebGLRenderingContextBase::bindFramebuffer):
1808 (WebCore::WebGLRenderingContextBase::bindRenderbuffer):
1809 (WebCore::WebGLRenderingContextBase::bindTexture):
1810 (WebCore::WebGLRenderingContextBase::bufferData):
1811 (WebCore::WebGLRenderingContextBase::bufferSubData):
1812 (WebCore::WebGLRenderingContextBase::compileShader):
1813 (WebCore::WebGLRenderingContextBase::createShader):
1814 (WebCore::WebGLRenderingContextBase::detachShader):
1815 (WebCore::WebGLRenderingContextBase::disableVertexAttribArray):
1816 (WebCore::WebGLRenderingContextBase::drawArrays):
1817 (WebCore::WebGLRenderingContextBase::drawElements):
1818 (WebCore::WebGLRenderingContextBase::enableVertexAttribArray):
1819 (WebCore::WebGLRenderingContextBase::framebufferRenderbuffer):
1820 (WebCore::WebGLRenderingContextBase::framebufferTexture2D):
1821 (WebCore::WebGLRenderingContextBase::getActiveAttrib):
1822 (WebCore::WebGLRenderingContextBase::getActiveUniform):
1823 (WebCore::WebGLRenderingContextBase::getAttachedShaders):
1824 (WebCore::WebGLRenderingContextBase::getBufferParameter):
1825 (WebCore::WebGLRenderingContextBase::getProgramParameter):
1826 (WebCore::WebGLRenderingContextBase::getProgramInfoLog):
1827 (WebCore::WebGLRenderingContextBase::getRenderbufferParameter):
1828 (WebCore::WebGLRenderingContextBase::getShaderParameter):
1829 (WebCore::WebGLRenderingContextBase::getShaderInfoLog):
1830 (WebCore::WebGLRenderingContextBase::getShaderPrecisionFormat):
1831 (WebCore::WebGLRenderingContextBase::getShaderSource):
1832 (WebCore::WebGLRenderingContextBase::getTexParameter):
1833 (WebCore::WebGLRenderingContextBase::getUniform):
1834 (WebCore::WebGLRenderingContextBase::getUniformLocation):
1835 (WebCore::WebGLRenderingContextBase::getVertexAttrib):
1836 (WebCore::WebGLRenderingContextBase::linkProgram):
1837 (WebCore::WebGLRenderingContextBase::readPixels):
1838 (WebCore::WebGLRenderingContextBase::shaderSource):
1839 (WebCore::WebGLRenderingContextBase::videoFrameToImage):
1840 (WebCore::WebGLRenderingContextBase::texImage2D):
1841 (WebCore::WebGLRenderingContextBase::uniform1f):
1842 (WebCore::WebGLRenderingContextBase::uniform1fv):
1843 (WebCore::WebGLRenderingContextBase::uniform1i):
1844 (WebCore::WebGLRenderingContextBase::uniform1iv):
1845 (WebCore::WebGLRenderingContextBase::uniform2f):
1846 (WebCore::WebGLRenderingContextBase::uniform2fv):
1847 (WebCore::WebGLRenderingContextBase::uniform2i):
1848 (WebCore::WebGLRenderingContextBase::uniform2iv):
1849 (WebCore::WebGLRenderingContextBase::uniform3f):
1850 (WebCore::WebGLRenderingContextBase::uniform3fv):
1851 (WebCore::WebGLRenderingContextBase::uniform3i):
1852 (WebCore::WebGLRenderingContextBase::uniform3iv):
1853 (WebCore::WebGLRenderingContextBase::uniform4f):
1854 (WebCore::WebGLRenderingContextBase::uniform4fv):
1855 (WebCore::WebGLRenderingContextBase::uniform4i):
1856 (WebCore::WebGLRenderingContextBase::uniform4iv):
1857 (WebCore::WebGLRenderingContextBase::uniformMatrix2fv):
1858 (WebCore::WebGLRenderingContextBase::uniformMatrix3fv):
1859 (WebCore::WebGLRenderingContextBase::uniformMatrix4fv):
1860 (WebCore::WebGLRenderingContextBase::useProgram):
1861 (WebCore::WebGLRenderingContextBase::validateProgram):
1862 (WebCore::WebGLRenderingContextBase::vertexAttribPointer):
1863 (WebCore::WebGLRenderingContextBase::restoreCurrentFramebuffer):
1864 (WebCore::WebGLRenderingContextBase::restoreCurrentTexture2D):
1865 * html/canvas/WebGLRenderingContextBase.h:
1866 * html/canvas/WebGLRenderingContextBase.idl:
1868 2016-10-19 Myles C. Maxfield <mmaxfield@apple.com>
1870 [macOS] [iOS] Disable variation fonts on macOS El Capitan and iOS 9
1871 https://bugs.webkit.org/show_bug.cgi?id=163374
1873 Reviewed by Darin Adler.
1875 Because of platform lack of support for variations in in-memory fonts,
1876 this feature should be disabled on the affected OSes.
1878 No tests because there is no behavior change (on the relevant platforms).
1880 * Configurations/FeatureDefines.xcconfig:
1882 2016-10-20 Brady Eidson <beidson@apple.com>
1884 IndexedDB 2.0: Support IDBObjectStore name assignment.
1885 <rdar://problem/28806931> and https://bugs.webkit.org/show_bug.cgi?id=163749
1887 Reviewed by Alex Christensen.
1889 Tests: storage/indexeddb/modern/objectstore-rename-1-private.html
1890 storage/indexeddb/modern/objectstore-rename-1.html
1892 Touches a *lot* of code sites, but none of them are particularly interesting.
1893 They are all just getting the new name spread out to all of the various objects that need it.
1895 * Modules/indexeddb/IDBDatabase.cpp:
1896 (WebCore::IDBDatabase::renameObjectStore):
1897 * Modules/indexeddb/IDBDatabase.h:
1899 * Modules/indexeddb/IDBObjectStore.cpp:
1900 (WebCore::IDBObjectStore::setName):
1901 * Modules/indexeddb/IDBObjectStore.h:
1902 * Modules/indexeddb/IDBObjectStore.idl:
1904 * Modules/indexeddb/IDBTransaction.cpp:
1905 (WebCore::IDBTransaction::renameObjectStore):
1906 (WebCore::IDBTransaction::renameObjectStoreOnServer):
1907 (WebCore::IDBTransaction::didRenameObjectStoreOnServer):
1908 * Modules/indexeddb/IDBTransaction.h:
1910 * Modules/indexeddb/client/IDBConnectionProxy.cpp:
1911 (WebCore::IDBClient::IDBConnectionProxy::renameObjectStore):
1912 * Modules/indexeddb/client/IDBConnectionProxy.h:
1914 * Modules/indexeddb/client/IDBConnectionToServer.cpp:
1915 (WebCore::IDBClient::IDBConnectionToServer::renameObjectStore):
1916 (WebCore::IDBClient::IDBConnectionToServer::didRenameObjectStore):
1917 * Modules/indexeddb/client/IDBConnectionToServer.h:
1918 * Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
1920 * Modules/indexeddb/server/IDBBackingStore.h:
1922 * Modules/indexeddb/server/IDBConnectionToClient.cpp:
1923 (WebCore::IDBServer::IDBConnectionToClient::didDeleteObjectStore):
1924 (WebCore::IDBServer::IDBConnectionToClient::didRenameObjectStore):
1925 * Modules/indexeddb/server/IDBConnectionToClient.h:
1926 * Modules/indexeddb/server/IDBConnectionToClientDelegate.h:
1928 * Modules/indexeddb/server/IDBServer.cpp:
1929 (WebCore::IDBServer::IDBServer::renameObjectStore):
1930 * Modules/indexeddb/server/IDBServer.h:
1932 * Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
1933 (WebCore::IDBServer::MemoryBackingStoreTransaction::objectStoreRenamed):
1934 (WebCore::IDBServer::MemoryBackingStoreTransaction::abort):
1935 * Modules/indexeddb/server/MemoryBackingStoreTransaction.h:
1937 * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
1938 (WebCore::IDBServer::MemoryIDBBackingStore::renameObjectStore):
1939 * Modules/indexeddb/server/MemoryIDBBackingStore.h:
1941 * Modules/indexeddb/server/MemoryObjectStore.h:
1942 (WebCore::IDBServer::MemoryObjectStore::rename):
1944 * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
1945 (WebCore::IDBServer::SQLiteIDBBackingStore::renameObjectStore):
1946 * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
1948 * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1949 (WebCore::IDBServer::UniqueIDBDatabase::renameObjectStore):
1950 (WebCore::IDBServer::UniqueIDBDatabase::performRenameObjectStore):
1951 (WebCore::IDBServer::UniqueIDBDatabase::didPerformRenameObjectStore):
1952 * Modules/indexeddb/server/UniqueIDBDatabase.h:
1954 * Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
1955 (WebCore::IDBServer::UniqueIDBDatabaseConnection::didRenameObjectStore):
1956 * Modules/indexeddb/server/UniqueIDBDatabaseConnection.h:
1958 * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
1959 (WebCore::IDBServer::UniqueIDBDatabaseTransaction::renameObjectStore):
1960 * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:
1962 * Modules/indexeddb/shared/IDBDatabaseInfo.cpp:
1963 (WebCore::IDBDatabaseInfo::renameObjectStore):
1964 * Modules/indexeddb/shared/IDBDatabaseInfo.h:
1966 * Modules/indexeddb/shared/IDBObjectStoreInfo.h:
1967 (WebCore::IDBObjectStoreInfo::rename):
1969 * Modules/indexeddb/shared/IDBResultData.cpp:
1970 (WebCore::IDBResultData::renameObjectStoreSuccess):
1971 * Modules/indexeddb/shared/IDBResultData.h:
1973 * Modules/indexeddb/shared/InProcessIDBServer.cpp:
1974 (WebCore::InProcessIDBServer::didRenameObjectStore):
1975 (WebCore::InProcessIDBServer::renameObjectStore):
1976 * Modules/indexeddb/shared/InProcessIDBServer.h:
1978 2016-10-20 Chris Dumez <cdumez@apple.com>
1980 Make table.deleteRow(-1) a no-op when there are no rows
1981 https://bugs.webkit.org/show_bug.cgi?id=163746
1983 Reviewed by Alex Christensen.
1985 Make table.deleteRow(-1) a no-op when there are no rows, instead of throwing:
1986 - https://github.com/whatwg/html/pull/1924
1988 This is more consistent with the behavior of tbody.deleteRow(-1) and
1989 tr.deleteCell(-1). This is also consistent with Gecko. Blink is doing the
1991 - https://codereview.chromium.org/2427963004/
1993 No new tests, updated existing tests.
1995 * html/HTMLTableElement.cpp:
1996 (WebCore::HTMLTableElement::deleteRow):
1998 2016-10-20 Dave Hyatt <hyatt@apple.com>
2000 [CSS Parser] Make sure to handle prefixed transform-style
2001 https://bugs.webkit.org/show_bug.cgi?id=163756
2003 Reviewed by Dean Jackson.
2005 * css/parser/CSSParserFastPaths.cpp:
2006 (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
2008 2016-10-20 Dave Hyatt <hyatt@apple.com>
2010 [CSS Parser] Fix crash when parsing -webkit-margin-collapse
2011 https://bugs.webkit.org/show_bug.cgi?id=163753
2013 Reviewed by Dean Jackson.
2015 * css/parser/CSSPropertyParser.cpp:
2016 (WebCore::CSSPropertyParser::parseShorthand):
2018 2016-10-20 Chris Dumez <cdumez@apple.com>
2020 Passing a number as the pixel parameter to texImage2D() doesn't thrown an exception
2021 https://bugs.webkit.org/show_bug.cgi?id=163715
2023 Reviewed by Darin Adler.
2025 Enable strict type checking for typed arrays in the bindings, similarly
2026 do what we do for other wrapper types, as per Web IDL.
2028 No new tests, updated existing tests.
2030 * bindings/scripts/CodeGeneratorJS.pm:
2031 (GenerateImplementation):
2032 (GenerateParametersCheck):
2034 2016-10-20 Myles C. Maxfield <mmaxfield@apple.com>
2036 Improve error message when passing a null ArrayBuffer to bufferData()
2037 https://bugs.webkit.org/show_bug.cgi?id=163745
2039 Reviewed by Dean Jackson.
2041 Test: fast/canvas/webgl/bufferData-nullable-array-buffer-view.html
2043 Update the idl file to accept a nullable ArrayBuffer, and throw
2044 the relevant error with a more helpful error string.
2046 * html/canvas/WebGLRenderingContextBase.cpp:
2047 (WebCore::WebGLRenderingContextBase::bufferData):
2048 * html/canvas/WebGLRenderingContextBase.h:
2049 * html/canvas/WebGLRenderingContextBase.idl:
2051 2016-10-20 Zalan Bujtas <zalan@apple.com>
2053 Stop searching for first-letter containers at multi-column boundary.
2054 https://bugs.webkit.org/show_bug.cgi?id=163739
2055 <rdar://problem/28810750>
2057 We should not cross the multi-column boundary while searching for the first-letter container.
2058 While moving first-letter renderers to a multi-column parent, it could result in finding the wrong
2059 container and end up adding a new wrapper under the original container (from where we are moving the renderers).
2061 Reviewed by David Hyatt.
2063 Test: fast/css-generated-content/first-letter-move-to-multicolumn-crash.html
2065 * rendering/RenderBoxModelObject.cpp:
2066 (WebCore::RenderBoxModelObject::moveChildrenTo):
2067 * rendering/RenderTextFragment.cpp:
2068 (WebCore::RenderTextFragment::blockForAccompanyingFirstLetter):
2070 2016-10-19 Dean Jackson <dino@apple.com>
2072 Support CSS Shapes Level 1 without a prefix
2073 https://bugs.webkit.org/show_bug.cgi?id=163709
2074 <rdar://problem/28859369>
2076 Reviewed by Myles Maxfield.
2078 Support the unprefixed form of CSS Shapes, now that
2081 We have a few failing tests:
2083 - Some image-based shaping failures, now skipped.
2084 https://bugs.webkit.org/show_bug.cgi?id=163706
2086 - Some false negatives, where my understanding
2087 of the CSS OM seems to suggest that the W3C tests
2089 https://bugs.webkit.org/show_bug.cgi?id=163708
2091 Tests: imported/w3c/csswg-test/css-shapes-1
2093 * css/CSSComputedStyleDeclaration.cpp:
2094 (WebCore::ComputedStyleExtractor::propertyValue):
2095 * css/CSSPropertyNames.in:
2096 * css/CSSValueKeywords.in:
2097 * css/parser/CSSParser.cpp:
2098 (WebCore::isSimpleLengthPropertyID):
2099 (WebCore::CSSParser::parseValue):
2100 * css/parser/CSSPropertyParser.cpp:
2101 (WebCore::CSSPropertyParser::parseSingleValue):
2102 * page/animation/CSSPropertyAnimation.cpp:
2103 (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
2105 2016-10-20 Dave Hyatt <hyatt@apple.com>
2107 [CSS Parser] Fix region, column and page break parsing
2108 https://bugs.webkit.org/show_bug.cgi?id=163743
2110 Reviewed by Simon Fraser.
2112 * css/parser/CSSParserFastPaths.cpp:
2113 (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
2114 Add the missing values for break support.
2116 * css/parser/CSSPropertyParser.cpp:
2117 (WebCore::isLegacyBreakProperty):
2118 (WebCore::CSSPropertyParser::parseValueStart):
2119 Add a special case for handling legacy break properties. Blink treats them like
2120 shorthands, but we can't do that without breaking the old parser, so for now
2121 we add a special case.
2123 (WebCore::mapFromPageBreakBetween):
2124 (WebCore::mapFromColumnBreakBetween):
2125 (WebCore::mapFromRegionBreakBetween):
2126 Updated to have the AvoidXXX values (where XXX is Column/Page/Region).
2128 (WebCore::CSSPropertyParser::parseShorthand):
2129 Remove the consumeLegacyBreak from the shorthand function, since we can't treat
2130 the legacy break properties as shorthands yet.
2132 2016-10-20 Sam Weinig <sam@webkit.org>
2134 Add convenience function that combines WTF::visit(...) with WTF::makeVisitor(...)
2135 https://bugs.webkit.org/show_bug.cgi?id=163713
2137 Reviewed by Dan Bernstein.
2139 Switch uses of WTF::visit to use WTF::switchOn.
2141 * dom/MessageEvent.cpp:
2142 (WebCore::MessageEvent::source):
2144 (WebCore::nodeSetPreTransformedFromNodeOrStringVector):
2145 (WebCore::Node::convertNodesOrStringsIntoNode):
2146 * html/HTMLSelectElement.cpp:
2147 (WebCore::HTMLSelectElement::add):
2148 * html/track/TrackEvent.cpp:
2149 (WebCore::TrackEvent::TrackEvent):
2150 * testing/TypeConversions.h:
2151 (WebCore::TypeConversions::typeConversionsDictionaryUnionType):
2153 2016-10-20 Dave Hyatt <hyatt@apple.com>
2155 [CSS Parser] Fix font family parsing and add CSS region property parsing
2156 https://bugs.webkit.org/show_bug.cgi?id=163741
2158 Reviewed by Zalan Bujtas.
2160 * css/parser/CSSParser.cpp:
2161 (WebCore::isKeywordPropertyID):
2162 (WebCore::parseKeywordValue):
2163 (WebCore::CSSParser::parseValue):
2164 Modify the old CSSParser to have its own keyword check, since keywords were
2165 incorrectly added to the new parser when this check was consolidated. Column
2166 and region breaks are considered keyword properties by the old parser, but
2167 not by the new parser, since the new parser special cases them and maps them
2168 into the generic break property.
2170 * css/parser/CSSParserFastPaths.cpp:
2171 (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
2172 (WebCore::CSSParserFastPaths::isKeywordPropertyID):
2173 Update for regions to make sure all the region properties are there. Remove the
2174 column and region break properties, since they're not supposed to be here in the
2177 * css/parser/CSSPropertyParser.cpp:
2178 (WebCore::consumeFamilyName):
2179 Fix font parsing to make font family values so that fonts work.
2181 (WebCore::consumeFlowProperty):
2182 Add a function for handling -webkit-flow-from and -webkit-flow-into.
2184 (WebCore::CSSPropertyParser::parseSingleValue):
2185 Add support for the region properties.
2187 (WebCore::mapFromRegionBreakBetween):
2188 (WebCore::mapFromColumnRegionOrPageBreakInside):
2189 (WebCore::mapFromLegacyBreakProperty):
2190 (WebCore::CSSPropertyParser::consumeLegacyBreakProperty):
2191 (WebCore::mapFromColumnOrPageBreakInside): Deleted.
2192 Update to handle the region break properties in the same way that column break
2193 properties are handled.
2195 2016-10-20 Jer Noble <jer.noble@apple.com>
2197 CRASH in WebCore::MediaSource::seekToTime + 185
2198 https://bugs.webkit.org/show_bug.cgi?id=163652
2200 Reviewed by Eric Carlson.
2202 Test: media/media-source/media-source-seek-detach-crash.html
2204 Add isClosed() checks (which are effectively m_private null-checks) everywhere m_private is
2205 dereferenced. The one place where m_private is cleared without setting the state to closed
2206 is stop(), so make stop() set the state to closed as well (without firing any events).
2208 * Modules/mediasource/MediaSource.cpp:
2209 (WebCore::MediaSource::seekToTime):
2210 (WebCore::MediaSource::completeSeek):
2211 (WebCore::MediaSource::monitorSourceBuffers):
2212 (WebCore::MediaSource::streamEndedWithError):
2213 (WebCore::MediaSource::stop):
2215 2016-10-20 Andreas Kling <akling@apple.com>
2217 Drop StyleResolver and SelectorQueryCache when entering PageCache.
2218 <https://webkit.org/b/154238>
2220 Reviewed by Antti Koivisto.
2222 Stop keeping these around for cached pages to save lots of memory.
2223 We can easily rebuild them if a cached navigation occurs, and this
2224 way we also don't need to worry about invalidating style for cached
2225 pages in all the right places.
2227 Restoring a cached page will now lead to a forced style recalc.
2228 We don't try to defer this (beyond a zero-timer) since it's going
2229 to happen anyway, and it's nicer to front-load the cost rather than
2230 stuttering on the first user content interaction.
2233 (WebCore::Document::setPageCacheState):
2234 * history/CachedPage.cpp:
2235 (WebCore::CachedPage::restore):
2236 (WebCore::CachedPage::clear):
2237 * history/CachedPage.h:
2238 (WebCore::CachedPage::markForVisitedLinkStyleRecalc): Deleted.
2239 (WebCore::CachedPage::markForFullStyleRecalc): Deleted.
2240 * history/PageCache.cpp:
2241 (WebCore::PageCache::markPagesForVisitedLinkStyleRecalc): Deleted.
2242 (WebCore::PageCache::markPagesForFullStyleRecalc): Deleted.
2243 * history/PageCache.h:
2245 (WebCore::Frame::setPageAndTextZoomFactors):
2247 (WebCore::Page::setViewScaleFactor):
2248 (WebCore::Page::setDeviceScaleFactor):
2249 (WebCore::Page::setPagination):
2250 (WebCore::Page::setPaginationLineGridEnabled):
2251 (WebCore::Page::setVisitedLinkStore):
2253 2016-10-20 Carlos Alberto Lopez Perez <clopez@igalia.com>
2255 [GTK] Build fix after r207616
2256 https://bugs.webkit.org/show_bug.cgi?id=163333
2258 Reviewed by Carlos Garcia Campos.
2260 EGL_PLATFORM_X11_KHR and EGL_PLATFORM_WAYLAND_KHR are not defined
2261 on the EGL headers shipped by Mesa 10.3 (shipped by Debian 8)
2263 * platform/graphics/wayland/PlatformDisplayWayland.cpp:
2264 (WebCore::PlatformDisplayWayland::initialize):
2265 * platform/graphics/x11/PlatformDisplayX11.cpp:
2266 (WebCore::PlatformDisplayX11::initializeEGLDisplay):
2268 2016-10-20 Fujii Hironori <Hironori.Fujii@sony.com>
2270 [CMake] CMake does not support the dep files for implicit dependency
2271 https://bugs.webkit.org/show_bug.cgi?id=161433
2273 Reviewed by Brent Fulgham.
2275 Created a Perl script to generate all IDL bindings for CMake.
2276 This script can regenerate outdated bindings by based on the
2277 supplemental dependency and dep files created by
2278 '--write-dependencies' switch of generate-bindings.pl.
2280 add_custom_target is used to invoke the script instead of
2281 add_custom_command because Ninja deletes all output files before
2282 executing the command in case of add_custom_command.
2284 USES_TERMINAL option of add_custom_target has two effects:
2285 1) Not buffering output of the command
2286 2) Invoking the command in the special Ninja pool which inhibits parallel build
2287 One needs to use CMake 3.2 or later to enable this feature.
2289 * CMakeLists.txt: Specified target names for
2290 GENERATE_BINDINGS. Added dependency for the targets.
2291 * bindings/scripts/generate-bindings-all.pl: Added.
2293 2016-10-20 Adam Jackson <ajax@redhat.com>
2295 Prefer eglGetPlatformDisplay to eglGetDisplay
2296 https://bugs.webkit.org/show_bug.cgi?id=163333
2298 Reviewed by Carlos Garcia Campos.
2300 eglGetDisplay forces the implementation to guess what kind of void* it's been handed. Different implementations
2301 do different things, in particular glvnd and Mesa behave differently. Fortunately there exists API to tell EGL
2302 what kind of display it is, so let's use it.
2304 * platform/graphics/wayland/PlatformDisplayWayland.cpp:
2305 (WebCore::PlatformDisplayWayland::initialize):
2306 * platform/graphics/x11/PlatformDisplayX11.cpp:
2307 (WebCore::PlatformDisplayX11::initializeEGLDisplay):
2309 2016-10-20 Carlos Garcia Campos <cgarcia@igalia.com>
2311 [GTK] Avoid including egl.h headers in internal headers
2312 https://bugs.webkit.org/show_bug.cgi?id=163722
2314 Reviewed by Žan Doberšek.
2316 egl.h includes eglplatform.h that decides the native types for the platform at compile time. However, we support
2317 to build with X11 and Wayland at the same time and decide what to use at runtime. Currently GLContext.h includes
2318 eglplatform.h after wayland-egl.h if Wayland is enabled. That means that the wayland native types are used by
2319 default from all cpp files including GLContext.h. It currently works in X11 because we cast the value anyway and
2320 for example EGLNativeWindowType is a pointer in Wayland that can be casted to unsigned long in X11 to represent
2321 the X Window. This is very fragile in any case, we should avoid adding egl headers in our headers and only
2322 include it in cpp files. But we also need to ensure we don't use X11 and Wayland in the same cpp file.
2324 * PlatformGTK.cmake:
2325 * platform/graphics/GLContext.cpp:
2326 (WebCore::GLContext::createContextForWindow):
2327 * platform/graphics/GLContext.h:
2328 * platform/graphics/egl/GLContextEGL.cpp:
2329 (WebCore::GLContextEGL::createWindowContext):
2330 (WebCore::GLContextEGL::createContext):
2331 (WebCore::GLContextEGL::~GLContextEGL):
2332 * platform/graphics/egl/GLContextEGL.h:
2333 * platform/graphics/egl/GLContextEGLWayland.cpp: Added.
2334 (WebCore::GLContextEGL::GLContextEGL):
2335 (WebCore::GLContextEGL::createWindowSurfaceWayland):
2336 (WebCore::GLContextEGL::createWaylandContext):
2337 (WebCore::GLContextEGL::destroyWaylandWindow):
2338 * platform/graphics/egl/GLContextEGLX11.cpp: Added.
2339 (WebCore::GLContextEGL::GLContextEGL):
2340 (WebCore::GLContextEGL::createWindowSurfaceX11):
2341 (WebCore::GLContextEGL::createPixmapContext):
2342 * platform/graphics/glx/GLContextGLX.cpp:
2343 (WebCore::GLContextGLX::createWindowContext):
2344 (WebCore::GLContextGLX::createContext):
2345 (WebCore::GLContextGLX::GLContextGLX):
2346 * platform/graphics/glx/GLContextGLX.h:
2347 * platform/graphics/wayland/PlatformDisplayWayland.cpp:
2348 * platform/graphics/x11/PlatformDisplayX11.cpp:
2350 2016-10-20 Carlos Garcia Campos <cgarcia@igalia.com>
2352 [GTK] Avoid strstr() when checking (E)GL extensions
2353 https://bugs.webkit.org/show_bug.cgi?id=161958
2355 Reviewed by Žan Doberšek.
2357 Add static method GLContext::isExtensionSupported() to properly search extenstions in the given extension
2358 list, and use it instead of strstr().
2360 * platform/graphics/GLContext.cpp:
2361 (WebCore::GLContext::isExtensionSupported):
2362 * platform/graphics/GLContext.h:
2363 * platform/graphics/egl/GLContextEGL.cpp:
2364 (WebCore::GLContextEGL::createSurfacelessContext):
2365 * platform/graphics/glx/GLContextGLX.cpp:
2366 (WebCore::hasSGISwapControlExtension):
2368 2016-10-20 Per Arne Vollan <pvollan@apple.com>
2370 [Win][Direct2D] Implement ImageBufferData::getData.
2371 https://bugs.webkit.org/show_bug.cgi?id=163668
2373 Reviewed by Brent Fulgham.
2375 Render data to a bitmap in system memory, which data can be read from.
2377 * platform/graphics/win/ImageBufferDataDirect2D.cpp:
2378 (WebCore::ImageBufferData::getData):
2379 * platform/graphics/win/ImageBufferDirect2D.cpp:
2380 (WebCore::ImageBuffer::ImageBuffer):
2382 2016-10-20 Carlos Garcia Campos <cgarcia@igalia.com>
2384 Wrong use of EGL_DEPTH_SIZE
2385 https://bugs.webkit.org/show_bug.cgi?id=155536
2387 Reviewed by Michael Catanzaro.
2389 What happens here is that the driver doesn't implement EGL_DEPTH_SIZE and the default value, which is 0, is
2390 returned. Then XCreatePixmap fails because 0 is not a valid depth. The thing is that even if EGL_DEPTH_SIZE or
2391 EGL_BUFFER_SIZE returned a valid depth, it still might not be supported by the default screen and XCreatePixmap
2392 can fail. What we need to ensure is that the depth we pass is compatible with the X display, not only with the
2393 EGL config, to avoid failures when creating the pixmap. So, we can use EGL_NATIVE_VISUAL_ID instead, and
2394 then ask X for the visual info for that id. If it isn't found then we just return before creating the pixmap,
2395 but if the visual is found then we can be sure that the depth of the visual will not make the pixmap creation
2396 fail. However, with the driver I'm using it doesn't matter how we create the pixmap that eglCreatePixmapSurface
2397 always fails, again with X errors that are fatal by default. Since the driver is not free, I assume it doesn't
2398 support eglCreatePixmapSurface or it's just buggy, so the only option we have here is trap the x errors and
2399 ignore them. It turns out that the X errors are not fatal in this case, because eglCreatePixmapSurface ends up
2400 returning a surface, and since these are offscreen contexts, it doesn't really matter if they contain an
2401 invalid pixmap, because we never do swap buffer on them, so just ignoring the X errors fixes the crashes and
2402 makes everythig work. This patch adds a helper class XErrorTrapper that allows to trap XErrors and decide what
2403 to do with them (ignore, warn or crash) or even not consider a particular set of errors as errors.
2405 * PlatformEfl.cmake: Add new file to compilation.
2406 * PlatformGTK.cmake: Ditto.
2407 * platform/graphics/egl/GLContextEGL.cpp:
2408 (WebCore::GLContextEGL::createPixmapContext): Use EGL_NATIVE_VISUAL_ID instead of EGL_DEPTH_SIZE to figure out
2409 the depth to be passed to XCreatePixmap. Also use the XErrorTrapper class to ignore all BadDrawable errors
2410 produced by eglCreatePixmapSurface() and only show a warning about all other X errors.
2411 * platform/graphics/x11/XErrorTrapper.cpp: Added.
2412 (WebCore::xErrorTrappersMap):
2413 (WebCore::XErrorTrapper::XErrorTrapper):
2414 (WebCore::XErrorTrapper::~XErrorTrapper):
2415 (WebCore::XErrorTrapper::errorCode):
2416 (WebCore::XErrorTrapper::errorEvent):
2417 * platform/graphics/x11/XErrorTrapper.h: Added.
2418 (WebCore::XErrorTrapper::XErrorTrapper):
2420 2016-10-20 Nael Ouedraogo <nael.ouedraogo@crf.canon.fr>
2422 WebRTC: The MediaStreamTrackEvent init dictionary needs a required track member
2423 https://bugs.webkit.org/show_bug.cgi?id=146232
2425 Update MediaStreamTrackEvent IDL as per specification.
2427 Reviewed by Darin Adler.
2429 No additional test required, rebase existings tests.
2431 * Modules/mediastream/MediaStreamTrackEvent.idl:
2433 2016-10-19 Antoine Quint <graouts@apple.com>
2435 [Modern Media Controls] Media Controller: mute support
2436 https://bugs.webkit.org/show_bug.cgi?id=163677
2437 <rdar://problem/28851582>
2439 Reviewed by Dean Jackson.
2441 We introduce the MuteSupport class which brings support for muting the media
2442 by clicking on the mute button in the media controls and correctly reflecting
2443 the media's muted state should the media be muted via the media API.
2445 Tests: media/modern-media-controls/mute-support/mute-support-button-click.html
2446 media/modern-media-controls/mute-support/mute-support-media-api.html
2447 media/modern-media-controls/mute-support/mute-support-muted.html
2449 * Modules/modern-media-controls/media/media-controller.js:
2451 * Modules/modern-media-controls/media/mute-support.js: Copied from Source/WebCore/Modules/modern-media-controls/media/media-controller.js.
2452 (MuteSupport.prototype.get control):
2453 (MuteSupport.prototype.get mediaEvents):
2454 (MuteSupport.prototype.buttonWasClicked):
2455 (MuteSupport.prototype.syncControl):
2457 * WebCore.xcodeproj/project.pbxproj:
2458 * rendering/RenderThemeMac.mm:
2459 (WebCore::RenderThemeMac::mediaControlsScript):
2461 2016-10-19 Alex Christensen <achristensen@webkit.org>
2464 https://bugs.webkit.org/show_bug.cgi?id=163675
2466 Reviewed by Brent Fulgham.
2468 This code is still useful for comparison with Windows. I'll remove it again soon.
2470 No new tests. No change in behavior.
2472 * WebCore.xcodeproj/project.pbxproj:
2474 * loader/DocumentLoader.h:
2475 * loader/EmptyClients.h:
2476 * loader/FrameLoaderClient.h:
2477 * loader/ResourceLoader.cpp:
2478 (WebCore::ResourceLoader::didReceiveAuthenticationChallenge):
2479 * loader/ResourceLoader.h:
2480 * loader/SubresourceLoader.h:
2481 * loader/cf/ResourceLoaderCFNet.cpp:
2482 * loader/cocoa/SubresourceLoaderCocoa.mm:
2483 (WebCore::SubresourceLoader::willCacheResponse):
2484 * loader/mac/DocumentLoaderMac.cpp:
2485 * loader/mac/ResourceLoaderMac.mm:
2486 (WebCore::ResourceLoader::willCacheResponse):
2487 * page/mac/PageMac.mm:
2488 (WebCore::Page::platformInitialize):
2489 (WebCore::Page::addSchedulePair):
2490 (WebCore::Page::removeSchedulePair):
2491 * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2492 (WebCore::WebCoreNSURLAuthenticationChallengeClient::create):
2493 (WebCore::WebCoreNSURLAuthenticationChallengeClient::WebCoreNSURLAuthenticationChallengeClient):
2494 (WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForResponseToAuthenticationChallenge):
2495 * platform/mac/WebCoreSystemInterface.h:
2496 * platform/network/NetworkStorageSession.h:
2497 * platform/network/ProtectionSpace.h:
2498 * platform/network/ProtectionSpaceBase.cpp:
2499 * platform/network/ResourceHandle.cpp:
2500 * platform/network/ResourceHandle.h:
2501 * platform/network/ResourceHandleClient.cpp:
2502 * platform/network/ResourceHandleClient.h:
2503 * platform/network/ResourceHandleInternal.h:
2504 (WebCore::ResourceHandleInternal::ResourceHandleInternal):
2505 * platform/network/ResourceRequestBase.cpp:
2506 * platform/network/cf/AuthenticationCF.cpp:
2507 (WebCore::AuthenticationChallenge::AuthenticationChallenge):
2508 (WebCore::AuthenticationChallenge::setAuthenticationClient): Deleted.
2509 (WebCore::AuthenticationChallenge::authenticationClient): Deleted.
2510 (WebCore::AuthenticationChallenge::platformCompare): Deleted.
2511 (WebCore::createCF): Deleted.
2512 (WebCore::core): Deleted.
2513 * platform/network/cf/AuthenticationCF.h:
2514 * platform/network/cf/AuthenticationChallenge.h:
2515 * platform/network/cf/CookieJarCFNet.cpp:
2516 * platform/network/cf/CredentialStorageCFNet.cpp:
2517 (WebCore::CredentialStorage::getFromPersistentStorage):
2518 (WebCore::CredentialStorage::saveToPersistentStorage):
2519 * platform/network/cf/LoaderRunLoopCF.cpp:
2520 * platform/network/cf/LoaderRunLoopCF.h:
2521 * platform/network/cf/NetworkStorageSessionCFNet.cpp:
2522 (WebCore::NetworkStorageSession::cookieStorage):
2523 * platform/network/cf/ProtectionSpaceCFNet.cpp:
2524 * platform/network/cf/ProtectionSpaceCFNet.h:
2525 * platform/network/cf/ResourceError.h:
2526 * platform/network/cf/ResourceErrorCF.cpp:
2527 * platform/network/cf/ResourceHandleCFNet.cpp:
2528 (WebCore::shouldSniffConnectionProperty):
2529 (WebCore::ResourceHandle::createCFURLConnection):
2530 (WebCore::ResourceHandle::start):
2531 (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
2532 (WebCore::ResourceHandle::tryHandlePasswordBasedAuthentication):
2533 (WebCore::ResourceHandle::receivedCredential):
2534 (WebCore::ResourceHandle::schedule):
2535 (WebCore::ResourceHandle::unschedule):
2536 * platform/network/cf/ResourceHandleCFURLConnectionDelegate.cpp:
2537 * platform/network/cf/ResourceHandleCFURLConnectionDelegate.h:
2538 * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
2539 (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::setupRequest):
2540 (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse):
2541 (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::canRespondToProtectionSpace):
2542 * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.h:
2543 * platform/network/cf/ResourceRequest.h:
2544 (WebCore::ResourceRequest::encodingRequiresPlatformData):
2545 * platform/network/cf/ResourceRequestCFNet.cpp:
2546 (WebCore::findCFURLRequestSetContentDispositionEncodingFallbackArrayFunction):
2547 (WebCore::findCFURLRequestCopyContentDispositionEncodingFallbackArrayFunction):
2548 (WebCore::ResourceRequest::doUpdatePlatformRequest):
2549 (WebCore::ResourceRequest::doUpdatePlatformHTTPBody):
2550 (WebCore::ResourceRequest::doUpdateResourceRequest):
2551 (WebCore::ResourceRequest::setStorageSession):
2552 * platform/network/cf/ResourceRequestCFNet.h:
2553 * platform/network/cf/ResourceResponse.h:
2554 * platform/network/cf/ResourceResponseCFNet.cpp:
2555 (WebCore::ResourceResponse::cfURLResponse):
2556 * platform/network/cf/SynchronousLoaderClientCFNet.cpp:
2557 * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:
2558 (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::setupRequest):
2559 (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::setupConnectionScheduling):
2560 (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveResponse):
2561 (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::willCacheResponse):
2562 (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::canRespondToProtectionSpace):
2563 * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.h:
2564 * platform/network/cocoa/CredentialCocoa.h:
2565 * platform/network/cocoa/CredentialCocoa.mm:
2566 (WebCore::Credential::Credential):
2567 (WebCore::Credential::cfCredential):
2568 * platform/network/cocoa/ProtectionSpaceCocoa.h:
2569 * platform/network/cocoa/ProtectionSpaceCocoa.mm:
2570 (WebCore::ProtectionSpace::ProtectionSpace):
2571 (WebCore::ProtectionSpace::cfSpace):
2572 * platform/network/cocoa/ResourceRequestCocoa.mm:
2573 (WebCore::ResourceRequest::nsURLRequest):
2574 * platform/network/cocoa/ResourceResponseCocoa.mm:
2575 (WebCore::ResourceResponse::platformCertificateInfo):
2576 (WebCore::ResourceResponse::nsURLResponse):
2577 (WebCore::ResourceResponse::ResourceResponse):
2578 * platform/network/ios/QuickLook.h:
2579 * platform/network/ios/QuickLook.mm:
2580 (-[WebQuickLookHandleAsDelegate initWithConnectionDelegate:]):
2581 (-[WebQuickLookHandleAsDelegate connection:didReceiveDataArray:]):
2582 (-[WebQuickLookHandleAsDelegate connection:didReceiveData:lengthReceived:]):
2583 (-[WebQuickLookHandleAsDelegate connectionDidFinishLoading:]):
2584 (-[WebQuickLookHandleAsDelegate connection:didFailWithError:]):
2585 (-[WebQuickLookHandleAsDelegate detachHandle]):
2586 (WebCore::QuickLookHandle::create):
2587 (WebCore::QuickLookHandle::cfResponse):
2588 * platform/network/mac/AuthenticationMac.mm:
2589 (-[WebCoreAuthenticationClientAsChallengeSender setCFChallenge:]):
2590 (-[WebCoreAuthenticationClientAsChallengeSender cfChallenge]):
2593 * platform/network/mac/CookieJarMac.mm:
2594 (WebCore::setCookiesFromDOM):
2595 (WebCore::addCookie):
2596 (WebCore::cookieStorage):
2597 * platform/network/mac/CredentialStorageMac.mm:
2598 * platform/network/mac/FormDataStreamMac.h:
2599 * platform/network/mac/FormDataStreamMac.mm:
2600 * platform/network/mac/ResourceErrorMac.mm:
2601 (NSErrorFromCFError):
2602 (WebCore::ResourceError::ResourceError):
2603 (WebCore::ResourceError::nsError):
2604 (WebCore::ResourceError::operator NSError *):
2605 * platform/network/mac/ResourceHandleMac.mm:
2606 (WebCore::ResourceHandle::getConnectionTimingData):
2607 * platform/network/mac/ResourceRequestMac.mm: Added.
2608 (WebCore::ResourceRequest::ResourceRequest):
2609 (WebCore::ResourceRequest::updateNSURLRequest):
2610 * platform/network/mac/SynchronousLoaderClient.mm:
2611 * platform/network/mac/WebCoreResourceHandleAsDelegate.h:
2612 * platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
2613 * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.h:
2614 * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
2615 * platform/network/mac/WebCoreURLResponse.mm:
2616 * platform/win/TemporaryLinkStubs.cpp:
2617 * testing/js/WebCoreTestSupportPrefix.h:
2619 2016-10-19 Jer Noble <jer.noble@apple.com>
2621 REGRESSION (r206025): All YouTube videos play with black bars on all four sides
2622 https://bugs.webkit.org/show_bug.cgi?id=163308
2624 Reviewed by Darin Adler.
2626 Test: media/media-source/media-source-resize.html
2628 After r206025, we do not fire resize events when the size change notification happens equal-
2629 to-or-before the current time, which can happen at the very beginning of a stream. Take care
2630 of this case by checking that the target time isn't actually in the past inside of
2631 sizeWillChangeAtTime(), and also always skip the boundary time observer when there was no
2632 previous size (such as after a flush due to a seek).
2634 * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
2635 * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
2636 (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::sizeWillChangeAtTime):
2637 (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setNaturalSize):
2638 * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
2639 (WebCore::SourceBufferPrivateAVFObjC::flushAndEnqueueNonDisplayingSamples):
2640 (WebCore::SourceBufferPrivateAVFObjC::enqueueSample):
2642 2016-10-19 Nan Wang <n_wang@apple.com>
2644 AX: [Mac] Mark element AXAPI should comform to specs
2645 https://bugs.webkit.org/show_bug.cgi?id=163707
2647 Reviewed by Chris Fleizach.
2649 Created a new role for mark elements on Mac and exposed the role
2652 Changes are covered in modified test expectaions.
2654 * English.lproj/Localizable.strings:
2655 * accessibility/AccessibilityObject.h:
2656 * accessibility/AccessibilityRenderObject.cpp:
2657 (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
2658 * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2659 (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
2660 * accessibility/mac/AccessibilityObjectMac.mm:
2661 (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject):
2662 * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2663 (createAccessibilityRoleMap):
2664 (-[WebAccessibilityObjectWrapper roleDescription]):
2665 * platform/LocalizedStrings.cpp:
2666 (WebCore::AXMarkText):
2667 * platform/LocalizedStrings.h:
2669 2016-10-19 Alex Christensen <achristensen@webkit.org>
2671 Re-enable URLParser for non-Safari Cocoa apps after r207321
2672 https://bugs.webkit.org/show_bug.cgi?id=163690
2674 Reviewed by Darin Adler.
2676 I disabled the URLParser for non-Safari applications in r207305
2677 to give me time to make URLParser more compatible, which I did in r207321
2679 Updated some API tests which will be investigated in
2680 https://bugs.webkit.org/show_bug.cgi?id=163127
2682 * platform/URLParser.cpp:
2683 (WebCore::URLParser::setEnabled):
2684 (WebCore::URLParser::enabled):
2685 * testing/js/WebCoreTestSupport.cpp:
2686 (WebCoreTestSupport::setURLParserEnabled): Deleted.
2687 * testing/js/WebCoreTestSupport.h:
2689 2016-10-19 Myles C. Maxfield <mmaxfield@apple.com>
2691 CSS font-variation-settings does not handle uppercase axis names in variable fonts
2692 https://bugs.webkit.org/show_bug.cgi?id=163546
2694 Reviewed by Dean Jackson.
2696 Remove the extra toASCIILower() call.
2698 Test: fast/text/variations/case-axis-names.html
2700 * css/parser/CSSParser.cpp:
2701 (WebCore::CSSParser::parseFontVariationTag):
2703 2016-10-19 Anders Carlsson <andersca@apple.com>
2705 Remove m_redirectURLs from HistoryItem
2706 https://bugs.webkit.org/show_bug.cgi?id=163704
2708 Reviewed by Dan Bernstein.
2710 * history/HistoryItem.cpp:
2711 (WebCore::HistoryItem::HistoryItem):
2712 (WebCore::HistoryItem::reset):
2713 * history/HistoryItem.h:
2715 2016-10-19 Joone Hur <joone.hur@intel.com>
2717 Add a plain space instead of between text nodes
2718 https://bugs.webkit.org/show_bug.cgi?id=123163
2720 Reviewed by Ryosuke Niwa.
2722 When we rebalance white spaces, can be added as space
2723 under some conditions. This patch adds a condition that the next
2724 sibling text node should not exist.
2726 No new tests, updated existing test.
2728 * editing/CompositeEditCommand.cpp:
2729 (WebCore::CompositeEditCommand::rebalanceWhitespaceOnTextSubstring):
2730 * editing/htmlediting.cpp:
2731 (WebCore::stringWithRebalancedWhitespace):
2732 * editing/htmlediting.h:
2734 2016-10-19 Sam Weinig <sam@webkit.org>
2736 Add support for sequences and dictionaries in unions
2737 https://bugs.webkit.org/show_bug.cgi?id=163695
2739 Reviewed by Chris Dumez.
2742 - Updated js/dom/webidl-type-mapping.html
2744 * bindings/generic/IDLTypes.h:
2745 Add additional helper predicates and fix formatting.
2747 * bindings/js/JSDOMBinding.h:
2748 Export hasIteratorMethod for use in testing.
2750 * bindings/js/JSDOMConvert.h:
2751 - Change return type of Converter<IDLDictionary<T>> to T, from Optional<T>.
2752 - Add support for unions conversion step 12 (parts 1-3).
2754 * bindings/scripts/CodeGeneratorJS.pm:
2755 (GenerateDefaultValue):
2756 Support complex default value computations for unions using the convert infrastructure.
2758 (GenerateParametersCheck):
2759 (GenerateConstructorDefinition):
2760 Remove incorrect .value() calls now that Converter<IDLDictionary<T>> returns T.
2762 * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
2763 * bindings/scripts/test/JS/JSTestObj.cpp:
2764 Update bindings test results.
2766 * testing/TypeConversions.h:
2767 (WebCore::TypeConversions::setTypeConversionsDictionary):
2768 (WebCore::TypeConversions::typeConversionsDictionaryLongValue):
2769 (WebCore::TypeConversions::typeConversionsDictionaryStringValue):
2770 (WebCore::TypeConversions::typeConversionsDictionarySequenceValue):
2771 (WebCore::TypeConversions::typeConversionsDictionaryUnionType):
2772 * testing/TypeConversions.idl:
2773 Add some complex types to allow testing IDL conversions from tests.
2775 2016-10-19 Ryosuke Niwa <rniwa@webkit.org>
2777 Annotate more DOM and HTML IDLs with CEReactions
2778 https://bugs.webkit.org/show_bug.cgi?id=163653
2780 Reviewed by Darin Adler.
2782 Added CEReactions to more IDL files.
2784 Test: fast/custom-elements/reactions-for-webkit-extensions.html
2786 * bindings/js/JSDOMStringMapCustom.cpp:
2787 (WebCore::JSDOMStringMap::deleteProperty): Instantiate CustomElementReactionStack, which is equivalent to
2788 adding CEReactions in IDL.
2789 (WebCore::JSDOMStringMap::putDelegate): Ditto.
2792 * html/HTMLElement.idl:
2793 * page/DOMSelection.idl:
2795 2016-10-19 Ryan Haddad <ryanhaddad@apple.com>
2797 Unreviewed, rolling out r207557.
2799 This change caused animations/font-variations tests to time
2800 out on pre-Sierra Macs.
2804 "[macOS] [iOS] Disable variation fonts on macOS El Capitan and
2806 https://bugs.webkit.org/show_bug.cgi?id=163374
2807 http://trac.webkit.org/changeset/207557
2809 2016-10-19 Dave Hyatt <hyatt@apple.com>
2811 [CSS Parser] Support -webkit-border-fit
2812 https://bugs.webkit.org/show_bug.cgi?id=163687
2814 Reviewed by Zalan Bujtas.
2816 Add support for -webkit-border-fit to isValidKeywordPropertyAndValue.
2818 * css/parser/CSSParserFastPaths.cpp:
2819 (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
2821 2016-10-19 Dave Hyatt <hyatt@apple.com>
2823 [CSS Parser] class and id parsing need to be case-insensitive in HTML quirks mode
2824 https://bugs.webkit.org/show_bug.cgi?id=163685
2826 Reviewed by Zalan Bujtas.
2828 Class and ID parsing should be case-insensitive in quirks mode. Apply the same hack
2829 that the old parser did and lowercase the class and ids in place.
2831 * css/parser/CSSSelectorParser.cpp:
2832 (WebCore::CSSSelectorParser::consumeId):
2833 (WebCore::CSSSelectorParser::consumeClass):
2835 2016-10-19 Nan Wang <n_wang@apple.com>
2837 AX: crash: com.apple.WebCore: WebCore::AccessibilityObject::findMatchingObjects + 600
2838 https://bugs.webkit.org/show_bug.cgi?id=163682
2840 Reviewed by Chris Fleizach.
2842 There's a null pointer crash when we ask for startObject->parentObjectUnignored() in
2843 AccessibilityObject::findMatchingObject. Added a null check for the startObject to fix that.
2845 Test: accessibility/mac/search-predicate-crash.html
2847 * accessibility/AccessibilityObject.cpp:
2848 (WebCore::AccessibilityObject::findMatchingObjects):
2850 2016-10-19 David Kilzer <ddkilzer@apple.com>
2852 Bug 163670: Refine assertions in WebCore::ImageData constructors
2853 <https://webkit.org/b/163670>
2854 <rdar://problem/27497338>
2856 Reviewed by Brent Fulgham.
2858 No new tests because there is no change in nominal behavior.
2860 * html/ImageData.cpp:
2861 (WebCore::ImageData::ImageData(const IntSize&)): Change to use
2862 ASSERT() since the worst-case scenario here is a nullptr deref.
2863 Switch to IntSize::area() to compute the area.
2864 (WebCore::ImageData::ImageData(const IntSize&, Ref<Uint8ClampedArray>&&)):
2865 Add ASSERT() identical to the previous constructor, and change
2866 ASSERT_WITH_SECURITY_IMPLICATION() to only fire when m_data is
2867 not nullptr and the length check fails. Switch to
2868 IntSize::area() to compute the area.
2870 2016-10-19 Myles C. Maxfield <mmaxfield@apple.com>
2872 [macOS] [iOS] Disable variation fonts on macOS El Capitan and iOS 9
2873 https://bugs.webkit.org/show_bug.cgi?id=163374
2875 Reviewed by Darin Adler.
2877 Because of platform lack of support for variations in in-memory fonts,
2878 this feature should be disabled on the affected OSes.
2880 No tests because there is no behavior change (on the relevant platforms).
2882 * Configurations/FeatureDefines.xcconfig:
2884 2016-10-19 Dave Hyatt <hyatt@apple.com>
2886 [CSS Parser] Fix background-position parsing
2887 https://bugs.webkit.org/show_bug.cgi?id=163681
2889 Reviewed by Dean Jackson.
2891 The new parser has a more efficient parsed representation of background positions. When
2892 background-position is "center" or when no length unit is specified for a dimension,
2893 then rather than creating a pair, the new parser makes a singleton primitive value.
2895 Patch the StyleBuilder code to handle this case, resolving center to (left,50%) or
2896 (top,50%) as appropriate and also handling top/left without any associated length.
2898 * css/CSSToStyleMap.cpp:
2899 (WebCore::CSSToStyleMap::mapFillXPosition):
2900 (WebCore::CSSToStyleMap::mapFillYPosition):
2902 2016-10-19 Antoine Quint <graouts@apple.com>
2904 [Modern Media Controls] Media Controller: click-to-start support
2905 https://bugs.webkit.org/show_bug.cgi?id=163659
2906 <rdar://problem/28845656>
2908 Reviewed by Dean Jackson.
2910 We introduce the MediaControllerSupport class which will allow a number of media controller
2911 features to be implemented by subclasses each devoted to implementing a specific subset of
2912 media controller features. With this bug, we add the correct behavior for click-to-start,
2913 only showing the start button under the right circumstances.
2915 A MediaController object indicates which media control to attach click event listeners to
2916 through the `control` property, and a list of media events it should register on the media
2917 element through the `mediaEvents` property. Then, as the user interacts with the specified
2918 control and the media, the Button delegation method `buttonWasClicked()` and the `syncControl()`
2919 methods are called to allow for the media state to be correctly set and represented in the
2920 media controls. Custom event handling for the specified events can also be achieved by
2921 subclassing the `handleEvent()` method.
2923 Tests: media/modern-media-controls/start-support/start-support-audio.html
2924 media/modern-media-controls/start-support/start-support-autoplay.html
2925 media/modern-media-controls/start-support/start-support-click-to-start.html
2926 media/modern-media-controls/start-support/start-support-error.html
2927 media/modern-media-controls/start-support/start-support-fullscreen.html
2928 media/modern-media-controls/start-support/start-support-manual-play.html
2929 media/modern-media-controls/start-support/start-support-no-source.html
2931 * Modules/modern-media-controls/media/media-controller-support.js: Added.
2932 (MediaControllerSupport):
2933 (MediaControllerSupport.prototype.get control):
2934 (MediaControllerSupport.prototype.get mediaEvents):
2935 (MediaControllerSupport.prototype.buttonWasClicked):
2936 (MediaControllerSupport.prototype.handleEvent):
2937 (MediaControllerSupport.prototype.syncControl):
2938 * Modules/modern-media-controls/media/media-controller.js:
2940 (MediaController.prototype.buttonWasClicked): Deleted.
2941 * Modules/modern-media-controls/media/start-support.js: Added.
2942 (StartSupport.prototype.get control):
2943 (StartSupport.prototype.get mediaEvents):
2944 (StartSupport.prototype.buttonWasClicked):
2945 (StartSupport.prototype.handleEvent):
2946 (StartSupport.prototype.syncControl):
2947 (StartSupport.prototype._shouldShowStartButton):
2950 2016-10-19 Aaron Chu <aaron_chu@apple.com>
2952 Web Inspector: AXI: expose computed tree node and heading level
2953 https://bugs.webkit.org/show_bug.cgi?id=130825
2954 <rdar://problem/16442349>
2956 Reviewed by Joseph Pecoraro.
2958 Exposing two new accessibility properties: Heading Level and Hierarchical Level.
2960 Updated Test: LayoutTest/inspector/dom/getAccessibilityPropertiesForNode.html
2962 * inspector/InspectorDOMAgent.cpp:
2963 (WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
2965 2016-10-19 Adam Bergkvist <adam.bergkvist@ericsson.com>
2967 WebRTC: Implement MediaEndpointPeerConnection::stop()
2968 https://bugs.webkit.org/show_bug.cgi?id=163660
2970 Reviewed by Philippe Normand.
2972 Make MediaEndpointPeerConnection::stop() stop its MediaEndpoint.
2974 Testing: This fix deals with cleanup and tearing down resources down in the platform layer
2975 and is not covered by automated tests. It is however observable in the manual test added
2976 in [1] where the remote videos should stop when the connections are closed.
2978 [1] http://webkit.org/b/163327
2980 * Modules/mediastream/MediaEndpointPeerConnection.cpp:
2981 (WebCore::MediaEndpointPeerConnection::stop):
2983 2016-10-19 Dave Hyatt <hyatt@apple.com>
2985 [CSS Parser] Fix -webkit-mask-box-image parsing
2986 https://bugs.webkit.org/show_bug.cgi?id=163676
2988 Reviewed by Dean Jackson.
2990 -webkit-mask-box-image is not a shorthand in our current code, so treat it the same as the legacy
2991 -webkit-border-image.
2993 * css/parser/CSSPropertyParser.cpp:
2994 (WebCore::CSSPropertyParser::parseSingleValue):
2995 (WebCore::CSSPropertyParser::parseShorthand):
2997 2016-10-19 Carlos Alberto Lopez Perez <clopez@igalia.com>
2999 [GTK][EFL] Build fix after r207543.
3000 https://bugs.webkit.org/show_bug.cgi?id=163671
3004 Fix typo on the filename of the included header:
3005 Mac filesystem is case insensitive, but Linux filesystems are case sensitive.
3007 * css/parser/CSSPropertyParser.cpp:
3009 2016-10-19 Zalan Bujtas <zalan@apple.com>
3011 Use anonymous table row for new child at RenderTableRow::addChild() if available.
3012 https://bugs.webkit.org/show_bug.cgi?id=163651
3013 <rdar://problem/28705022>
3015 Reviewed by David Hyatt.
3017 We should try to prevent the continuation siblings from getting separated and inserted into
3018 wrapper renderers. It makes finding these continuation siblings difficult.
3019 This patch adds a checks for anonymous table rows so that we could find a closer common ancestor of
3020 beforeChild/new child.
3022 Test: fast/table/crash-when-table-has-continuation-and-content-inserted.html
3024 * rendering/RenderObject.cpp:
3025 (WebCore::RenderObject::showRenderObject): Add continuation information.
3026 * rendering/RenderTableRow.cpp:
3027 (WebCore::RenderTableRow::addChild):
3029 2016-10-19 Joseph Pecoraro <pecoraro@apple.com>
3031 Cleanup WebCore/workers
3032 https://bugs.webkit.org/show_bug.cgi?id=163635
3034 Reviewed by Chris Dumez.
3037 Cleanup like pragma once, nullptr, remove stale includes, declarations.
3039 2016-10-19 Chris Dumez <cdumez@apple.com>
3041 MouseEvent's coordinates should be 0 for simulated clicks
3042 https://bugs.webkit.org/show_bug.cgi?id=163648
3044 Reviewed by Darin Adler.
3046 MouseEvent's coordinates should be 0 / 0 for simulated clicks triggered
3047 by JavaScript (i.e. via element.click()). This behavior matches Chrome
3050 WebKit was computing actual coordinates for the element which was
3051 expensive, especially because computing screenX / screenY required
3052 a synchronous IPC with the UI process.
3054 Test: fast/events/element-click-no-coords.html
3057 (WebCore::Element::dispatchSimulatedClick):
3058 * dom/SimulatedClick.cpp:
3059 (WebCore::simulateMouseEvent):
3060 (WebCore::simulateClick):
3061 * dom/SimulatedClick.h:
3062 * html/HTMLElement.cpp:
3063 (WebCore::HTMLElement::click):
3065 2016-10-19 Dave Hyatt <hyatt@apple.com>
3067 [CSS Parser] Fix transform parsing
3068 https://bugs.webkit.org/show_bug.cgi?id=163671
3070 Reviewed by Dean Jackson.
3072 The new parser turned function names into CSSValueIDs and made CSSFunctionValue store them. This
3073 meant it could be used to handle transform values, with the function name representing the
3074 transform operation efficiently as a CSSValueID.
3076 The old parser, however, creates WebKitCSSTransformValues. This value does not exist in the new
3077 parser. Rather than forcing the old and new parser over to CSSFunctionValues, I opted to
3078 just make the new parser build WebkitCSSTransformValues too.
3080 The main reason I did this is that WebkitCSSTransformValue is actually exposed to the Web via
3081 IDL. To be safe, I am not eliminating it (even though Blink has).
3083 * css/parser/CSSPropertyParser.cpp:
3084 (WebCore::consumeTranslate3d):
3085 (WebCore::consumeNumbers):
3086 (WebCore::consumePerspective):
3087 (WebCore::transformOperationForCSSValueID):
3088 (WebCore::consumeTransformValue):
3090 2016-10-19 Darin Adler <darin@apple.com>
3092 Move XPath from ExceptionCode to Exception
3093 https://bugs.webkit.org/show_bug.cgi?id=163656
3095 Reviewed by Chris Dumez.
3098 (WebCore::Document::createExpression): Use ExceptionOr.
3099 (WebCore::Document::createNSResolver): Return Ref.
3100 (WebCore::Document::evaluate): Use ExceptionOr.
3101 * dom/Document.h: Updated for above changes.
3102 * dom/Document.idl: Use non-legacy exceptions for the functions above.
3104 * inspector/InspectorNodeFinder.cpp:
3105 (WebCore::InspectorNodeFinder::searchUsingXPath): Call XPath functions
3108 * xml/DOMParser.cpp:
3109 (WebCore::DOMParser::DOMParser): Marked inline.
3110 (WebCore::DOMParser::create): Moved here from header.
3111 (WebCore::DOMParser::parseFromString): Use ExceptionOr.
3112 * xml/DOMParser.h: Updated for above changes.
3113 * xml/DOMParser.idl: Use non-legacy exception.
3115 * xml/XPathEvaluator.cpp:
3116 (WebCore::XPathEvaluator::createExpression): Use ExceptionOr.
3117 (WebCore::XPathEvaluator::evaluate): Ditto.
3118 * xml/XPathEvaluator.h: Updated for above changes.
3119 * xml/XPathEvaluator.idl: Use non-legacy exceptions.
3121 * xml/XPathExpression.cpp:
3122 (WebCore::XPathExpression::createExpression): Use ExceptionOr.
3123 (WebCore::XPathExpression::evaluate): Ditto.
3124 * xml/XPathExpression.h: Updated for above changes.
3125 * xml/XPathExpression.idl: Use non-legacy exceptions.
3127 * xml/XPathGrammar.y: Added include of XPathStep.h.
3129 * xml/XPathParser.cpp:
3130 (WebCore::XPath::Parser::Parser): Initialize three scalar data members
3131 in the class definition rather than here.
3132 (WebCore::XPath::Parser::parseStatement): Use ExceptionOr.
3133 * xml/XPathParser.h: Updated for above changes.
3135 * xml/XPathResult.cpp:
3136 (WebCore::XPathResult::XPathResult): Use a reference rather than a
3137 pointer for the document. Alao initialize two scalar data members
3138 in the class definition rather than here.
3139 (WebCore::XPathResult::convertTo): Use ExceptionOr.
3140 (WebCore::XPathResult::numberValue): Ditto.
3141 (WebCore::XPathResult::stringValue): Ditto.
3142 (WebCore::XPathResult::booleanValue): Ditto.
3143 (WebCore::XPathResult::singleNodeValue): Ditto.
3144 (WebCore::XPathResult::snapshotLength): Ditto.
3145 (WebCore::XPathResult::iterateNext): Ditto.
3146 (WebCore::XPathResult::snapshotItem): Ditto.
3147 * xml/XPathResult.h: Updated for the changes above.
3148 * xml/XPathResult.idl: Use non-legacy exceptions.
3150 2016-10-19 Nan Wang <n_wang@apple.com>
3152 AX: [Mac] Meter element should use AXValueDescription to descrbe the status of the value
3153 https://bugs.webkit.org/show_bug.cgi?id=163610
3155 Reviewed by Chris Fleizach.
3157 Exposed the goodness of the meter value in AXValueDescription.
3159 Test: accessibility/mac/meter-gauge-value-description.html
3161 * English.lproj/Localizable.strings:
3162 * accessibility/AccessibilityProgressIndicator.cpp:
3163 (WebCore::AccessibilityProgressIndicator::gaugeRegionValueDescription):
3164 * accessibility/AccessibilityProgressIndicator.h:
3165 * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3166 (-[WebAccessibilityObjectWrapper valueDescriptionForMeter]):
3167 (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
3168 * platform/LocalizedStrings.cpp:
3169 (WebCore::AXMeterGaugeRegionOptimumText):
3170 (WebCore::AXMeterGaugeRegionSuboptimalText):
3171 (WebCore::AXMeterGaugeRegionLessGoodText):
3172 * platform/LocalizedStrings.h:
3174 2016-10-19 Dave Hyatt <hyatt@apple.com>
3176 [CSS Parser] Fix named color parsing
3177 https://bugs.webkit.org/show_bug.cgi?id=163662
3179 Reviewed by Zalan Bujtas.
3181 Named color parsing in the old parser for extended colors relied on constructing a Color with the
3182 name and doing a lookup that way.
3184 The new parser allows the back end to hold a primitive identifier value for extended colors.
3186 StyleColor contains a helper function for looking up the correct color.
3188 This patch switches both the old and the new parsers over to the new StyleColor function.
3190 Also remove some asserts from the CSSSelectorList, since the new parser allows it to be empty and
3191 detects parsing failure that way.
3193 * css/CSSSelectorList.cpp:
3194 (WebCore::CSSSelectorList::CSSSelectorList):
3195 (WebCore::CSSSelectorList::operator=):
3196 * css/StyleColor.cpp:
3197 (WebCore::StyleColor::isColorKeyword):
3198 * css/StyleResolver.cpp:
3199 (WebCore::StyleResolver::colorFromPrimitiveValue):
3200 (WebCore::colorForCSSValue): Deleted.
3202 2016-10-19 Youenn Fablet <youenn@apple.com>
3204 Remove SecurityOrigin::taintsCanvas
3205 https://bugs.webkit.org/show_bug.cgi?id=163594
3207 Reviewed by Darin Adler.
3209 No change of behavior.
3211 * html/canvas/CanvasRenderingContext.cpp:
3212 (WebCore::CanvasRenderingContext::wouldTaintOrigin):
3213 * page/SecurityOrigin.cpp:
3214 (WebCore::SecurityOrigin::canReceiveDragData):
3215 (WebCore::SecurityOrigin::taintsCanvas): Deleted.
3216 * page/SecurityOrigin.h:
3218 2016-10-18 Dave Hyatt <hyatt@apple.com>
3220 [CSS Parser] Fix compound selector parsing.
3221 https://bugs.webkit.org/show_bug.cgi?id=163649
3223 Reviewed by Darin Adler.
3225 The new CSS parser is failing to handle compound selectors. The code has an assumption that the
3226 first value in the RelationType enum is SubSelector. This patch changes the enum to have the same
3227 name used in Blink, RelationType, and to make the ordering be exactly the same.
3229 * css/CSSSelector.h:
3230 (WebCore::CSSSelector::relation):
3231 (WebCore::CSSSelector::setRelation):
3232 * css/SelectorChecker.cpp:
3233 (WebCore::SelectorChecker::matchRecursively):
3234 (WebCore::canMatchHoverOrActiveInQuirksMode):
3235 (WebCore::SelectorChecker::determineLinkMatchType):
3236 * css/SelectorFilter.cpp:
3237 (WebCore::SelectorFilter::collectIdentifierHashes):
3238 * css/parser/CSSParserValues.cpp:
3239 (WebCore::CSSParserSelector::insertTagHistory):
3240 (WebCore::CSSParserSelector::appendTagHistory):
3241 * css/parser/CSSParserValues.h:
3242 (WebCore::CSSParserSelector::setRelation):
3243 * css/parser/CSSSelectorParser.cpp:
3244 (WebCore::CSSSelectorParser::consumeComplexSelector):
3245 (WebCore::CSSSelectorParser::consumeCombinator):
3246 * css/parser/CSSSelectorParser.h:
3247 * cssjit/SelectorCompiler.cpp:
3248 (WebCore::SelectorCompiler::fragmentRelationForSelectorRelation):
3249 (WebCore::SelectorCompiler::constructFragmentsInternal):
3251 2016-10-19 Javier Fernandez <jfernandez@igalia.com>
3253 Web Inspector: Debugger buttons positioned incorrectly, align-content default value is unexpected
3254 https://bugs.webkit.org/show_bug.cgi?id=163572
3256 Reviewed by Sergio Villar Senin.
3258 We only allow the new CSS Box Alignment syntax when the Grid Layout
3259 feature is enabled. Due to flexbox backward compatibility we have
3260 implemented a different code path for the style initial/default values
3261 assignment. However, we have incorrectly resolved both align-content
3262 and justify-content to 'flex-start' when grid layout is disabled.
3264 This patch changes the approach, so we set 'normal' (the value specified
3265 by the new syntax) for both properties, but using the values defined in
3266 the old syntax (Flexbox specification) at computed style resolution.
3268 Since 'stretch' is the default value for the align-content property, this
3269 issue implies that any flexbox line with an undefined height will be
3270 laid out incorrectly, if not explicitly set via CSS, because flex items
3271 can't use the available height, even though they use 'stretch' for their
3272 'align-self' properties.
3274 Test: css3/flexbox/flexbox-lines-must-be-stretched-by-default.html
3276 * css/CSSComputedStyleDeclaration.cpp:
3277 (WebCore::valueForContentPositionAndDistributionWithOverflowAlignment):
3278 (WebCore::ComputedStyleExtractor::propertyValue):
3279 * rendering/style/RenderStyle.h:
3280 (WebCore::RenderStyle::initialContentAlignment):
3282 2016-10-19 Carlos Alberto Lopez Perez <clopez@igalia.com>
3284 [GTK] REGRESSION(r207396) Build broken with Clang.
3285 https://bugs.webkit.org/show_bug.cgi?id=163599
3287 Suggested and reviewed by Darin Adler.
3289 * css/CSSPrimitiveValue.cpp:
3290 (WebCore::CSSPrimitiveValue::getStringValue):
3292 2016-10-19 Darin Adler <darin@apple.com>
3296 * page/PerformanceUserTiming.cpp: Add back class name; needed by some compiler versions.
3298 2016-10-19 Carlos Garcia Campos <cgarcia@igalia.com>
3300 Unreviewed. Fix the build after r207522.
3302 * page/PerformanceUserTiming.cpp: Include PerformanceTiming.h.
3304 2016-10-19 Carlos Garcia Campos <cgarcia@igalia.com>
3306 Unreviewed. Fix the build after r207519.
3309 IDL ATTRIBUTE CHECKER ERROR: Unknown IDL attribute [PassContext] is found at TestRunner.idl.
3311 Because PassContext was removed from IDLAttributes.txt in rr207519, but it's implemented by
3312 CodeGeneratorTestRunner.pm and used by TestRunner.idl.
3314 * bindings/scripts/IDLAttributes.txt: Bring back PassContext.
3316 2016-10-19 Carlos Garcia Campos <cgarcia@igalia.com>
3318 Unreviewed. Fix the build with GCC 4.9 after r207463.
3320 Add constructors to MediaConstraintsData.
3322 * Modules/mediastream/MediaConstraintsImpl.h:
3323 (WebCore::MediaConstraintsData::MediaConstraintsData):
3325 2016-10-19 Jer Noble <jer.noble@apple.com>
3327 [Mac][MSE] Movies with a 'mehd' box have a zero-duration
3328 https://bugs.webkit.org/show_bug.cgi?id=163641
3330 Reviewed by Darin Adler.
3332 Test: media/media-source/media-source-init-segment-duration.html
3334 The canonical (ISO/IEC 14496-12:2012) way to signal the duration of a fragmented media file is to add a
3335 'mehd' box to the 'mvex' container box specifying the duration of the fragment. Support this through the
3336 AVAsset -overallDurationHint property.
3338 * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
3339 (WebCore::SourceBufferPrivateAVFObjC::didParseStreamDataAsAsset):
3340 * platform/spi/mac/AVFoundationSPI.h:
3342 2016-10-18 Darin Adler <darin@apple.com>
3344 Move many miscellaneous classes from ExceptionCode to Exception
3345 https://bugs.webkit.org/show_bug.cgi?id=163645
3347 Reviewed by Ryosuke Niwa.
3349 * bindings/js/JSCryptoCustom.cpp:
3350 (WebCore::JSCrypto::getRandomValues): Use propagateException.
3351 * bindings/js/JSDOMWindowCustom.cpp:
3352 (WebCore::handlePostMessage): Ditto.
3353 (WebCore::JSDOMWindow::setTimeout): Use toJSNumber.
3354 (WebCore::JSDOMWindow::setInterval): Ditto.
3355 * bindings/js/JSStorageCustom.cpp:
3356 (WebCore::JSStorage::nameGetter): Use propagateException.
3357 (WebCore::JSStorage::deleteProperty): Ditto.
3358 (WebCore::JSStorage::getOwnPropertyNames): Ditto.
3359 (WebCore::JSStorage::putDelegate): Ditto.
3361 * loader/appcache/DOMApplicationCache.cpp:
3362 (WebCore::DOMApplicationCache::update): Use ExceptionOr.
3363 (WebCore::DOMApplicationCache::swapCache): Ditto.
3364 * loader/appcache/DOMApplicationCache.h: Update for above changes.
3365 * loader/appcache/DOMApplicationCache.idl: Use non-legacy exceptions.
3368 (WebCore::Crypto::getRandomValues): Use ExceptionOr.
3369 (WebCore::Crypto::webkitSubtle): Ditto.
3370 * page/Crypto.h: Updated for above changes.
3371 * page/Crypto.idl: Use non-legacy exceptions.
3373 * page/DOMWindow.cpp:
3374 (WebCore::DOMWindow::DOMWindow): Initialize many data members in
3375 the class definition instead of here.
3376 (WebCore::DOMWindow::page): Use nullptr.
3377 (WebCore::DOMWindow::screen): Ditto.
3378 (WebCore::DOMWindow::crypto): Ditto.
3379 (WebCore::DOMWindow::locationbar): Ditto.
3380 (WebCore::DOMWindow::menubar): Ditto.
3381 (WebCore::DOMWindow::personalbar): Ditto.
3382 (WebCore::DOMWindow::scrollbars): Ditto.
3383 (WebCore::DOMWindow::statusbar): Ditto.
3384 (WebCore::DOMWindow::toolbar): Ditto.
3385 (WebCore::DOMWindow::applicationCache): Ditto.
3386 (WebCore::DOMWindow::sessionStorage): Use ExceptionOr.
3387 (WebCore::DOMWindow::localStorage): Ditto.
3388 (WebCore::DOMWindow::postMessage): Ditto.
3389 (WebCore::DOMWindow::frameElement): Use nullptr.
3390 (WebCore::DOMWindow::self): Ditto.
3391 (WebCore::DOMWindow::opener): Ditto.
3392 (WebCore::DOMWindow::parent): Ditto.
3393 (WebCore::DOMWindow::top): Ditto.
3394 (WebCore::DOMWindow::getComputedStyle): Use Ref.
3395 (WebCore::DOMWindow::setTimeout): Use ExceptionOr.
3396 (WebCore::DOMWindow::setInterval): Ditto.
3397 (WebCore::didAddStorageEventListener): Use a reference instead of a
3398 pointer, and ignore return value instead of using IGNORE_EXCEPTION.
3399 (WebCore::DOMWindow::addEventListener): Pass reference to function above.
3400 (WebCore::DOMWindow::dispatchEvent): Use enum class version of PageStatus.
3401 * page/DOMWindow.h: Updated for changes above. Also changed indentatation.
3402 * page/DOMWindow.idl: Use non-legacy exceptions.
3404 * page/EventSource.cpp:
3405 (WebCore::EventSource::create): Use ExceptionOr.
3406 * page/EventSource.h: Updated for change above.
3407 * page/EventSource.idl: Use non-legacy exception.
3409 * page/Location.cpp:
3410 (WebCore::Location::setProtocol): Use ExceptionOr.
3411 * page/Location.h: Updated for change above.
3412 * page/Location.idl: Use non-legacy exception.
3414 * page/Performance.cpp:
3415 (WebCore::Performance::Performance): Remove unnecessary initialization of
3416 smart pointer to null, and moved initialization of m_resourceTimingBufferSize
3418 (WebCore::Performance::navigation): Made non-const and return a reference.
3419 (WebCore::Performance::timing): Ditto.
3420 (WebCore::Performance::addResourceTiming): Change LoadTiming argument to use
3421 a const& instead of passing in a copy.
3422 (WebCore::Performance::webkitMark): Use ExceptionOr and make_unique.
3423 (WebCore::Performance::webkitClearMarks): Ditto.
3424 (WebCore::Performance::webkitMeasure): Ditto.
3425 (WebCore::Performance::webkitClearMeasures): Ditto.
3426 (WebCore::Performance::reduceTimeResolution): Use std::floor.
3427 * page/Performance.h: Updated for above changes. Removed unneeded includes.
3428 Made more things private. Removed unneeded reference counting of UserTiming.
3429 * page/Performance.idl: Use non-legacy exceptions.
3431 * page/PerformanceUserTiming.cpp:
3432 (WebCore::restrictedMarkFunction): Removed unneeded class name.
3433 (WebCore::UserTiming::UserTiming): Take a reference instead of a pointer.
3434 (WebCore::UserTiming::mark): Use ExceptionOr.
3435 (WebCore::UserTiming::findExistingMarkStartTime): Ditto.
3436 (WebCore::UserTiming::measure): Ditto.
3437 (WebCore::getEntrySequenceByName): Simplified code using HashMap::get.
3438 * page/PerformanceUserTiming.h: Updated for above changes. Removed reference
3439 counting since this is a single-owner object.
3441 * page/UserMessageHandler.cpp:
3442 (WebCore::UserMessageHandler::postMessage): Use ExceptionOr.
3443 * page/UserMessageHandler.h: Updated for above change.
3444 * page/UserMessageHandler.idl: Use non-legacy exception.
3446 * storage/Storage.cpp:
3447 (WebCore::Storage::length): Use ExceptionOr.
3448 (WebCore::Storage::key): Ditto.
3449 (WebCore::Storage::getItem): Ditto.
3450 (WebCore::Storage::setItem): Ditto.
3451 (WebCore::Storage::removeItem): Ditto.
3452 (WebCore::Storage::clear): Ditto.
3453 (WebCore::Storage::contains): Ditto.
3454 * storage/Storage.h: Updated for above change.
3455 * storage/Storage.idl: Use non-legacy exceptions.
3457 * storage/StorageEventDispatcher.cpp:
3458 (WebCore::StorageEventDispatcher::dispatchSessionStorageEventsToFrames):
3459 Updated for ExceptionOr.
3460 (WebCore::StorageEventDispatcher::dispatchLocalStorageEventsToFrames): Ditto.
3462 2016-10-18 Darin Adler <darin@apple.com>
3464 Move internal testing classes from ExceptionCode to Exception
3465 https://bugs.webkit.org/show_bug.cgi?id=163553
3467 Reviewed by Ryosuke Niwa.
3469 * bindings/js/JSDOMBinding.h: Added toJSArray. Also exported a function that
3470 is now needed in the testing library.
3471 * bindings/scripts/CodeGeneratorJS.pm:
3472 (NativeToJSValue): Added code to handle the jsArray case with an exception.
3474 * css/parser/CSSPropertyParser.cpp: Fix #if to make code compile when
3475 CSS_SCROLL_SNAP is not enabled.
3478 (WebCore::Element::createShadowRoot): Changed return type to a raw pointer.
3479 There is no reason it needs to be a RefPtr.
3480 * dom/Element.h: Updated for above change.
3482 * svg/SVGPathStringBuilder.h: Exported class and made more public so it can
3483 be used in test code.
3485 * svg/SVGPathUtilities.cpp:
3486 (WebCore::pathIteratorForBuildingString): Deleted. Needed only for test code,
3487 so moved into there.
3488 (WebCore::buildStringFromPath): Deleted. Ditto.
3489 * svg/SVGPathUtilities.h: Removed buildStringFromPath.
3491 * testing/InternalSettings.cpp: Simplified the guard macro and used the all
3492 capitals style that our style guide prescribes for non-function-like macros.
3493 (WebCore::InternalSettings::create): Moved here, no longer inline Use m_page.
3494 (WebCore::InternalSettings::resetToConsistentState): Updated since settings
3495 returns a reference.
3496 (WebCore::InternalSettings::settings): Changed to return a reference and
3497 assert that m_page is not null; functions all check m_page for null first.
3498 (WebCore::InternalSettings::setTouchEventEmulationEnabled): Updated to use
3499 ExceptionOr, do an m_page check, and use settings that returns a reference.
3500 (WebCore::InternalSettings::setStandardFontFamily): Ditto.
3501 (WebCore::InternalSettings::setSerifFontFamily): Ditto.
3502 (WebCore::InternalSettings::setSansSerifFontFamily): Ditto.
3503 (WebCore::InternalSettings::setFixedFontFamily): Ditto.
3504 (WebCore::InternalSettings::setCursiveFontFamily): Ditto.
3505 (WebCore::InternalSettings::setFantasyFontFamily): Ditto.
3506 (WebCore::InternalSettings::setPictographFontFamily): Ditto.
3507 (WebCore::InternalSettings::setTextAutosizingEnabled): Ditto.
3508 (WebCore::InternalSettings::setTextAutosizingWindowSizeOverride): Ditto.
3509 (WebCore::InternalSettings::setMediaTypeOverride): Ditto.
3510 (WebCore::InternalSettings::setCanStartMedia): Ditto.
3511 (WebCore::InternalSettings::setAllowsAirPlayForMediaPlayback): Ditto.
3512 (WebCore::InternalSettings::setEditingBehavior): Ditto.
3513 (WebCore::InternalSettings::setShouldDisplayTrackKind): Ditto.
3514 (WebCore::InternalSettings::shouldDisplayTrackKind): Ditto.
3515 (WebCore::InternalSettings::setStorageBlockingPolicy): Ditto.
3516 (WebCore::InternalSettings::setPreferMIMETypeForImages): Ditto.
3517 (WebCore::InternalSettings::setImagesEnabled): Ditto.
3518 (WebCore::InternalSettings::setPDFImageCachingPolicy): Ditto.
3519 (WebCore::InternalSettings::setMinimumTimerInterval): Ditto.
3520 (WebCore::InternalSettings::setDefaultVideoPosterURL): Ditto.
3521 (WebCore::InternalSettings::setForcePendingWebGLPolicy): Ditto.
3522 (WebCore::InternalSettings::setTimeWithoutMouseMovementBeforeHidingControls): Ditto.
3523 (WebCore::InternalSettings::setUseLegacyBackgroundSizeShorthandBehavior): Ditto.
3524 (WebCore::InternalSettings::setAutoscrollForDragAndDropEnabled): Ditto.
3525 (WebCore::InternalSettings::setFontFallbackPrefersPictographs): Ditto.
3526 (WebCore::InternalSettings::setWebFontsAlwaysFallBack): Ditto.
3527 (WebCore::InternalSettings::setQuickTimePluginReplacementEnabled): Ditto.
3528 (WebCore::InternalSettings::setYouTubeFlashPluginReplacementEnabled): Ditto.
3529 (WebCore::InternalSettings::setBackgroundShouldExtendBeyondPage): Ditto.
3530 (WebCore::InternalSettings::setShouldConvertPositionStyleOnCopy): Ditto.
3531 (WebCore::InternalSettings::setScrollingTreeIncludesFrames): Ditto.
3532 (WebCore::InternalSettings::setAllowsInlineMediaPlayback): Ditto.
3533 (WebCore::InternalSettings::setAllowsInlineMediaPlaybackAfterFullscreen): Ditto.
3534 (WebCore::InternalSettings::setInlineMediaPlaybackRequiresPlaysInlineAttribute): Ditto.
3535 (WebCore::InternalSettings::setIndexedDBWorkersEnabled): Ditto.
3536 (WebCore::InternalSettings::userInterfaceDirectionPolicy): Ditto.
3537 (WebCore::InternalSettings::setUserInterfaceDirectionPolicy): Ditto.
3538 (WebCore::InternalSettings::systemLayoutDirection): Ditto.
3539 (WebCore::InternalSettings::setSystemLayoutDirection): Ditto.
3540 (WebCore::InternalSettings::variationFontsEnabled): Ditto.
3541 (WebCore::InternalSettings::setVariationFontsEnabled): Ditto.
3542 (WebCore::InternalSettings::forcedPrefersReducedMotionValue): Ditto.
3543 (WebCore::InternalSettings::setForcedPrefersReducedMotionValue): Ditto.
3544 * testing/InternalSettings.h: Updated for above changes. Also moved Backup to make
3545 it private instead of public.
3546 * testing/InternalSettings.idl: Use non-legacy execption. Also removed unneeded
3547 exception for setIndexedDBWorkersEnabled.
3549 * testing/Internals.cpp: Marked InspectorStubFrontend final and made everything private.
3550 (WebCore::Internals::setCanShowModalDialogOverride): Use ExceptionOr.
3551 (WebCore::Internals::lastSpatialNavigationCandidateCount): Ditto.
3552 (WebCore::Internals::animationsAreSuspended): Ditto.
3553 (WebCore::Internals::suspendAnimations): Ditto.
3554 (WebCore::Internals::resumeAnimations): Ditto.
3555 (WebCore::Internals::pauseAnimationAtTimeOnElement): Ditto.
3556 (WebCore::Internals::pauseAnimationAtTimeOnPseudoElement): Ditto.
3557 (WebCore::Internals::pauseTransitionAtTimeOnElement): Ditto.
3558 (WebCore::Internals::pauseTransitionAtTimeOnPseudoElement): Ditto.
3559 (WebCore::Internals::elementRenderTreeAsText): Ditto.
3560 (WebCore::Internals::ensureShadowRoot): Ditto.
3561 (WebCore::Internals::createShadowRoot): Ditto.
3562 (WebCore::Internals::shadowRootType): Ditto.
3563 (WebCore::Internals::isTimerThrottled): Ditto.
3564 (WebCore::Internals::formControlStateOfPreviousHistoryItem): Ditto.
3565 (WebCore::Internals::setFormControlStateOfPreviousHistoryItem): Ditto.
3566 (WebCore::Internals::absoluteCaretBounds): Ditto.
3567 (WebCore::Internals::inspectorHighlightRects): Ditto.
3568 (WebCore::Internals::inspectorHighlightObject): Ditto.
3569 (WebCore::Internals::markerCountForNode): Ditto.
3570 (WebCore::Internals::markerAt): Ditto.
3571 (WebCore::Internals::markerRangeForNode): Ditto.
3572 (WebCore::Internals::markerDescriptionForNode): Ditto.
3573 (WebCore::Internals::dumpMarkerRects): Ditto.
3574 (WebCore::Internals::setMarkedTextMatchesAreHighlighted): Ditto.
3575 (WebCore::Internals::setScrollViewPosition): Ditto.
3576 (WebCore::Internals::setViewBaseBackgroundColor): Ditto.
3577 (WebCore::Internals::setPagination): Ditto.
3578 (WebCore::Internals::setPaginationLineGridEnabled): Ditto.
3579 (WebCore::Internals::configurationForViewport): Ditto.
3580 (WebCore::Internals::wasLastChangeUserEdit): Ditto.
3581 (WebCore::Internals::scrollElementToRect): Ditto.
3582 (WebCore::Internals::autofillFieldName): Ditto.
3583 (WebCore::Internals::paintControlTints): Ditto.
3584 (WebCore::Internals::rangeForDictionaryLookupAtLocation): Ditto.
3585 (WebCore::Internals::setDelegatesScrolling): Ditto.
3586 (WebCore::Internals::lastSpellCheckRequestSequence): Ditto.
3587 (WebCore::Internals::lastSpellCheckProcessedSequence): Ditto.
3588 (WebCore::Internals::wheelEventHandlerCount): Ditto.
3589 (WebCore::Internals::touchEventHandlerCount): Ditto.
3590 (WebCore::Internals::nodesFromRect): Ditto.
3591 (WebCore::Internals::setBatteryStatus): Ditto.
3592 (WebCore::Internals::setDeviceProximity): Ditto.
3593 (WebCore::Internals::hasSpellingMarker): Ditto.
3594 (WebCore::Internals::hasAutocorrectedMarker): Ditto.
3595 (WebCore::Internals::handleAcceptedCandidate): Ditto.
3596 (WebCore::Internals::isOverwriteModeEnabled): Ditto.
3597 (WebCore::Internals::toggleOverwriteModeEnabled): Ditto.
3598 (WebCore::Internals::countMatchesForText): Ditto.
3599 (WebCore::Internals::countFindMatches): Ditto.
3600 (WebCore::Internals::setInspectorIsUnderTest): Ditto.
3601 (WebCore::Internals::hasGrammarMarker): Ditto.
3602 (WebCore::Internals::numberOfScrollableAreas): Ditto.
3603 (WebCore::Internals::isPageBoxVisible): Ditto.
3604 (WebCore::Internals::layerTreeAsText): Ditto.
3605 (WebCore::Internals::repaintRectsAsText): Ditto.
3606 (WebCore::Internals::scrollingStateTreeAsText): Ditto.
3607 (WebCore::Internals::mainThreadScrollingReasons): Ditto.
3608 (WebCore::Internals::nonFastScrollableRects): Ditto.
3609 (WebCore::Internals::setElementUsesDisplayListDrawing): Ditto.
3610 (WebCore::Internals::setElementTracksDisplayListReplay): Ditto.
3611 (WebCore::Internals::displayListForElement): Ditto.
3612 (WebCore::Internals::replayDisplayListForElement): Ditto.
3613 (WebCore::Internals::garbageCollectDocumentResources): Ditto.
3614 (WebCore::Internals::insertAuthorCSS): Ditto.
3615 (WebCore::Internals::insertUserCSS): Ditto.
3616 (WebCore::Internals::pageProperty): Ditto.
3617 (WebCore::Internals::pageSizeAndMarginsInPixels): Ditto.
3618 (WebCore::Internals::setPageScaleFactor): Ditto.
3619 (WebCore::Internals::setPageZoomFactor): Ditto.
3620 (WebCore::Internals::setTextZoomFactor): Ditto.
3621 (WebCore::Internals::setUseFixedLayout): Ditto.
3622 (WebCore::Internals::setFixedLayoutSize): Ditto.
3623 (WebCore::Internals::setViewExposedRect): Ditto.
3624 (WebCore::Internals::setHeaderHeight): Ditto.
3625 (WebCore::Internals::setFooterHeight): Ditto.
3626 (WebCore::Internals::setTopContentInset): Ditto.
3627 (WebCore::Internals::setApplicationCacheOriginQuota): Ditto.
3628 (WebCore::Internals::startTrackingRepaints): Ditto.
3629 (WebCore::Internals::stopTrackingRepaints): Ditto.
3630 (WebCore::Internals::startTrackingLayerFlushes): Ditto.
3631 (WebCore::Internals::layerFlushCount): Ditto.
3632 (WebCore::Internals::startTrackingStyleRecalcs): Ditto.
3633 (WebCore::Internals::styleRecalcCount): Ditto.
3634 (WebCore::Internals::startTrackingCompositingUpdates): Ditto.
3635 (WebCore::Internals::compositingUpdateCount): Ditto.
3636 (WebCore::Internals::updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks): Ditto.
3637 (WebCore::Internals::getCurrentCursorInfo): Ditto.
3638 (WebCore::Internals::mediaElementHasCharacteristic): Ditto.
3639 (WebCore::Internals::captionsStyleSheetOverride): Ditto.
3640 (WebCore::Internals::setCaptionsStyleSheetOverride): Ditto.
3641 (WebCore::Internals::setPrimaryAudioTrackLanguageOverride): Ditto.
3642 (WebCore::Internals::setCaptionDisplayMode): Ditto.
3643 (WebCore::Internals::selectionBounds): Ditto.
3644 (WebCore::Internals::isVibrating): Ditto.
3645 (WebCore::Internals::isPluginUnavailabilityIndicatorObscured): Ditto.
3646 (WebCore::Internals::beginMediaSessionInterruption): Ditto.
3647 (WebCore::Internals::setMediaSessionRestrictions): Ditto.
3648 (WebCore::Internals::postRemoteControlCommand): Ditto.
3649 (WebCore::Internals::setMockMediaPlaybackTargetPickerState): Ditto.
3650 (WebCore::Internals::installMockPageOverlay): Ditto.
3651 (WebCore::Internals::pageOverlayLayerTreeAsText): Ditto.
3652 (WebCore::Internals::scrollSnapOffsets): Ditto.
3653 (WebCore::Internals::pathStringWithShrinkWrappedRects): Moved the code that builds
3654 the path string in here for now since it's only used for this testing.
3655 (WebCore::Internals::resourceLoadStatisticsForOrigin): Take a const String&.
3657 * testing/Internals.h: Updated for above changes.
3658 * testing/Internals.idl: Use non-legacy exceptions.
3660 2016-10-18 Chris Dumez <cdumez@apple.com>
3662 [Web IDL] Drop webkit-specific extended attributes that are no longer useful
3663 https://bugs.webkit.org/show_bug.cgi?id=163643
3665 Reviewed by Ryosuke Niwa.
3667 Drop webkit-specific IDL extended attributes that are no longer useful:
3668 - [CustomReturn]: I believe this used to be for ObjC bindings. It has
3669 no impact in JS bindings.
3670 - [Deletable]: It only had an impact on static attributes and was only
3671 used on HTMLAllCollection.all, which is not static. I updated the
3672 bindings generator to so that static attributes are now configurable
3673 by default (unless marked as [Unforgeable], as per Web IDL [1]. This
3674 causes Notification.permission (This only static attribute we have)
3675 to become deletable. This behavior is consistent with the specification
3676 and with Chrome. I added test coverage for this.
3677 - [ImplementationNamespace]: Implemented but unused.
3678 - [PassContext]: Not implemented and unused.
3679 - [TypedArray=*]: Not implemented and unused.
3681 [1] https://heycam.github.io/webidl/#es-attributes
3683 Test: fast/notifications/notification-permisssion-deletable.html
3685 * bindings/scripts/CodeGeneratorJS.pm:
3686 (GetNamespaceForInterface):
3687 (GenerateImplementation):
3688 * bindings/scripts/IDLAttributes.txt:
3689 * bindings/scripts/test/JS/JSTestInterface.cpp:
3690 * bindings/scripts/test/JS/JSTestObj.cpp:
3691 * bindings/scripts/test/JS/JSTestTypedefs.cpp:
3693 * html/HTMLDocument.idl:
3695 2016-10-18 Sam Weinig <sam@webkit.org>
3697 Replace std::experimental::variant with WTF::Variant (or similar)
3698 https://bugs.webkit.org/show_bug.cgi?id=163626
3700 Reviewed by Chris Dumez.
3702 Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc.
3703 into the WTF namespace.
3705 * Modules/fetch/FetchBody.h:
3706 (WebCore::FetchBody::isBlob):
3707 (WebCore::FetchBody::isFormData):
3708 (WebCore::FetchBody::isArrayBuffer):
3709 (WebCore::FetchBody::isArrayBufferView):
3710 (WebCore::FetchBody::isURLSearchParams):
3711 (WebCore::FetchBody::isText):
3712 (WebCore::FetchBody::blobBody):
3713 (WebCore::FetchBody::formDataBody):
3714 (WebCore::FetchBody::arrayBufferBody):
3715 (WebCore::FetchBody::arrayBufferViewBody):
3716 (WebCore::FetchBody::textBody):
3717 (WebCore::FetchBody::urlSearchParamsBody):
3718 * bindings/generic/IDLTypes.h:
3719 * dom/ExceptionOr.h:
3720 (WebCore::ExceptionOr<ReturnType>::hasException):
3721 (WebCore::ExceptionOr<ReturnType>::releaseException):
3722 (WebCore::ExceptionOr<ReturnType>::releaseReturnValue):
3723 * dom/MessageEvent.cpp:
3724 (WebCore::MessageEvent::source):
3725 * dom/MessageEvent.h:
3727 (WebCore::nodeSetPreTransformedFromNodeOrStringVector):
3728 (WebCore::Node::convertNodesOrStringsIntoNode):
3730 * html/HTMLOptionsCollection.h:
3731 * html/HTMLSelectElement.cpp:
3732 (WebCore::HTMLSelectElement::add):
3733 * html/HTMLSelectElement.h:
3734 * html/track/TrackEvent.cpp:
3735 (WebCore::TrackEvent::TrackEvent):
3736 * html/track/TrackEvent.h:
3738 2016-10-18 Chris Dumez <cdumez@apple.com>
3740 Unreviewed, rebaseline bindings tests after Sam's r207505.
3742 * bindings/scripts/test/JS/JSTestCallback.cpp:
3743 (WebCore::JSTestCallback::callbackWithSerializedScriptValueParam):
3744 * bindings/scripts/test/JS/JSTestCallbackFunction.cpp:
3745 (WebCore::JSTestCallbackFunction::callbackWithSerializedScriptValueParam):
3746 * bindings/scripts/test/JS/JSTestObj.cpp:
3747 (WebCore::jsTestObjPrototypeFunctionSerializedValueCaller):
3748 * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
3749 (WebCore::jsTestSerializedScriptValueInterfaceValueGetter):
3750 (WebCore::jsTestSerializedScriptValueInterfaceReadonlyValueGetter):
3751 (WebCore::jsTestSerializedScriptValueInterfaceCachedValueGetter):
3752 (WebCore::jsTestSerializedScriptValueInterfaceCachedReadonlyValueGetter):
3753 (WebCore::setJSTestSerializedScriptValueInterfaceValueFunction):
3754 (WebCore::setJSTestSerializedScriptValueInterfaceCachedValueFunction):
3755 * bindings/scripts/test/JS/JSTestTypedefs.cpp:
3756 (WebCore::jsTestTypedefsImmutableSerializedScriptValueGetter):
3757 (WebCore::setJSTestTypedefsImmutableSerializedScriptValueFunction):
3759 2016-10-18 Chris Dumez <cdumez@apple.com>
3761 [Web IDL] Kill support for [LegacyConstructorTemplate=Event] / [LegacyInitializedByEventConstructor]
3762 https://bugs.webkit.org/show_bug.cgi?id=163630
3764 Reviewed by Darin Adler.
3766 Kill support for [LegacyConstructorTemplate=Event] / [LegacyInitializedByEventConstructor] in our
3767 IDL now that all our events use proper constructors instead.
3769 * bindings/scripts/CodeGenerator.pm:
3770 * bindings/scripts/CodeGeneratorJS.pm:
3772 (GenerateConstructorDefinition):
3773 (GenerateConstructorHelperMethods):
3775 * bindings/scripts/IDLAttributes.txt:
3777 (WebCore::Event::create):
3780 (WebCore::UIEvent::create):
3783 2016-10-18 Chris Dumez <cdumez@apple.com>
3785 Changing details.open should cause a toggle event to be fired asynchronously
3786 https://bugs.webkit.org/show_bug.cgi?id=163568
3788 Reviewed by Darin Adler.
3790 Changing details.open should cause a toggle event to be fired asynchronously:
3791 - https://html.spec.whatwg.org/#details-notification-task-steps
3793 Firefox and Chrome implement this, we don't.
3795 Test: imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-details-element/toggleEvent.html
3798 * dom/GlobalEventHandlers.idl:
3799 * html/HTMLAttributeNames.in:
3800 * html/HTMLDetailsElement.cpp:
3801 (WebCore::detailToggleEventSender):
3802 (WebCore::HTMLDetailsElement::~HTMLDetailsElement):
3803 (WebCore::HTMLDetailsElement::dispatchPendingEvent):
3804 (WebCore::HTMLDetailsElement::parseAttribute):
3805 * html/HTMLDetailsElement.h:
3806 * html/HTMLElement.cpp:
3807 (WebCore::HTMLElement::createEventHandlerNameMap):
3809 2016-10-18 Dave Hyatt <hyatt@apple.com>
3811 [CSS Parser] Enable basic parser testing.
3812 https://bugs.webkit.org/show_bug.cgi?id=163639
3814 Reviewed by Dean Jackson.
3816 * css/SelectorChecker.cpp:
3817 (WebCore::SelectorChecker::matchRecursively):
3818 Remove the ASSERT_NOT_REACHED on the new shadow selectors. We need to implement this
3819 eventually, but it's better to not assert on that for now.
3821 * css/parser/CSSParserValues.cpp:
3822 (WebCore::CSSParserSelector::isHostPseudoSelector):
3823 Make sure to check that we're a pseudoclass selector first, since otherwise we'll assert.
3825 * css/parser/CSSParserValues.h:
3826 (WebCore::CSSParserSelector::needsImplicitShadowCombinatorForMatching):
3827 Make sure to check that we're a pseudoelement selector first, since otherwise we'll assert.
3829 * css/parser/CSSPropertyParser.cpp:
3830 (WebCore::CSSPropertyParser::addExpandedPropertyForValue):
3831 copyRef is needed here, since a singleton value is being propagated to all the expanded shorthand properties.
3833 (WebCore::parseSingleShadow):
3834 (WebCore::CSSPropertyParser::consumeFont):
3835 Remove the font properties that aren't part of our shorthand. We will need to revisit this eventually as it seems
3836 some of the font properties should be reset as part of this shorthand but aren't.
3838 * css/parser/CSSPropertyParserHelpers.cpp:
3839 (WebCore::CSSPropertyParserHelpers::consumeInteger):
3840 Just return a number for now instead of the parser_integer type.
3842 * css/parser/CSSSelectorParser.cpp:
3843 (WebCore::CSSSelectorParser::consumePseudo):
3844 Clean this up so that it doesn't assert by making sure to add qualifying checks for the appropriate match type.
3846 2016-10-18 Ryosuke Niwa <rniwa@webkit.org>
3848 Update the comment for HTML Imports as there is now a proposal to use ES6 Modules for this.
3849 Also replace the contact by me since I'm most familiar with this feature.
3853 2016-10-18 Ryosuke Niwa <rniwa@webkit.org>
3855 Update the status of shadow DOM API to "Done" with a comment saying we're still fixing bugs.
3857 Also update my contact information since I'm no longer on Twitter.
3861 2016-10-18 Chris Dumez <cdumez@apple.com>
3863 Provide better form validation messages
3864 https://bugs.webkit.org/show_bug.cgi?id=163584
3866 Reviewed by Darin Adler.
3868 Provide better form validation messages that match more closely the ones
3869 from Chrome and Firefox.
3871 No new tests, updated existing tests.
3873 * English.lproj/Localizable.strings:
3874 * platform/LocalizedStrings.cpp:
3875 (WebCore::validationMessageValueMissingText):
3876 (WebCore::validationMessageValueMissingForCheckboxText):
3877 (WebCore::validationMessageValueMissingForFileText):
3878 (WebCore::validationMessageValueMissingForMultipleFileText):
3879 (WebCore::validationMessageValueMissingForRadioText):
3880 (WebCore::validationMessageValueMissingForSelectText):
3881 (WebCore::validationMessageTypeMismatchText):
3882 (WebCore::validationMessageTypeMismatchForEmailText):
3883 (WebCore::validationMessageTypeMismatchForMultipleEmailText):
3884 (WebCore::validationMessageTypeMismatchForURLText):
3885 (WebCore::validationMessagePatternMismatchText):
3886 (WebCore::validationMessageTooShortText):
3887 (WebCore::validationMessageTooLongText):
3888 (WebCore::validationMessageRangeUnderflowText):
3889 (WebCore::validationMessageRangeOverflowText):
3890 (WebCore::validationMessageStepMismatchText):
3891 (WebCore::validationMessageBadInputForNumberText):
3893 2016-10-18 Dave Hyatt <hyatt@apple.com>
3897 * css/parser/CSSPropertyParser.cpp:
3898 (WebCore::CSSPropertyParser::parseSingleValue):
3900 2016-10-18 Sam Weinig <sam@webkit.org>
3902 Simplify SerializedScriptValue, MessagePortArray and ArrayBufferArray to ease generation
3903 https://bugs.webkit.org/show_bug.cgi?id=163625
3905 Reviewed by Chris Dumez.
3907 - Replace uses of MessagePortArray (a.k.a. Vector<RefPtr<MessagePort>, 1>) with Vector<RefPtr<MessagePort>>.
3908 - Replace uses of ArrayBufferArray (a.k.a. Vector<RefPtr<ArrayBuffer>, 1>) with Vector<RefPtr<ArrayBuffer>>.
3909 - Add convenience functions to SerializedScriptValue to allow calling with fewer parameters.
3910 - Move MessagePorts and ArrayBuffers more where possible.
3912 * Modules/indexeddb/IDBObjectStore.cpp:
3913 (WebCore::IDBObjectStore::putOrAdd):
3914 * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
3915 (WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd):
3916 * bindings/js/IDBBindingUtilities.cpp:
3917 (WebCore::deserializeIDBValueToJSValue):
3918 * bindings/js/JSCustomEventCustom.cpp:
3919 (WebCore::JSCustomEvent::detail):
3920 * bindings/js/JSHistoryCustom.cpp:
3921 (WebCore::JSHistory::state):
3922 (WebCore::JSHistory::pushState):
3923 (WebCore::JSHistory::replaceState):
3924 * bindings/js/JSPopStateEventCustom.cpp:
3925 (WebCore::JSPopStateEvent::state):
3926 * dom/CustomEvent.cpp:
3927 (WebCore::CustomEvent::trySerializeDetail):
3928 * dom/ErrorEvent.cpp:
3929 (WebCore::ErrorEvent::sanitizedErrorValue):
3930 (WebCore::ErrorEvent::trySerializeError):
3931 * dom/PopStateEvent.cpp:
3932 (WebCore::PopStateEvent::trySerializeState):
3933 * page/DOMWindow.cpp:
3934 (WebCore::DOMWindow::postMessage):
3936 * workers/DedicatedWorkerGlobalScope.cpp:
3937 (WebCore::DedicatedWorkerGlobalScope::postMessage):
3938 * workers/DedicatedWorkerGlobalScope.h:
3939 * workers/Worker.cpp:
3940 (WebCore::Worker::postMessage):
3942 * bindings/js/JSDOMWindowCustom.cpp:
3943 (WebCore::handlePostMessage):
3944 * bindings/js/JSDictionary.cpp:
3945 (WebCore::JSDictionary::convertValue):
3946 * bindings/js/JSDictionary.h:
3947 Updated for new SerializedScriptValue interface/vector naming.
3949 * bindings/js/JSMessageEventCustom.cpp:
3950 (WebCore::handleInitMessageEvent):
3951 Update handleInitMessageEvent to check for exceptions and use convert for the MessagePort sequence.
3953 * bindings/js/JSMessagePortCustom.cpp:
3954 (WebCore::extractTransferables):
3955 (WebCore::fillMessagePortArray): Deleted.
3956 * bindings/js/JSMessagePortCustom.h:
3957 (WebCore::handlePostMessage):
3958 Rename fillMessagePortArray to extractTransferables to better express what it does.
3960 * bindings/js/SerializedScriptValue.cpp:
3961 (WebCore::CloneSerializer::serialize):
3962 (WebCore::CloneSerializer::CloneSerializer):
3963 (WebCore::CloneSerializer::fillTransferMap):
3964 (WebCore::CloneSerializer::dumpIfTerminal):
3965 (WebCore::CloneDeserializer::deserialize):
3966 (WebCore::CloneDeserializer::CloneDeserializer):
3967 (WebCore::CloneDeserializer::readTerminal):
3968 (WebCore::SerializedScriptValue::transferArrayBuffers):
3969 (WebCore::SerializedScriptValue::create):
3970 (WebCore::SerializedScriptValue::deserialize):
3971 * bindings/js/SerializedScriptValue.h: