1 2016-10-23 Antti Koivisto <antti@apple.com>
3 Avoid unnecessary full style resolution in getComputedStyle for non-inherited properties
4 https://bugs.webkit.org/show_bug.cgi?id=163875
6 Reviewed by Andreas Kling.
8 Test: fast/css/getComputedStyle/getComputedStyle-style-resolution.html
10 * css/CSSComputedStyleDeclaration.cpp:
11 (WebCore::hasValidStyleForProperty):
13 For non-inherited properties we don't need to update style even if some ancestor style is invalid
14 as long as explicit 'inherit' is not being used.
15 We still need to update if we find out that the whole subtree we are in is invalid.
17 (WebCore::updateStyleIfNeededForProperty):
21 (WebCore::ComputedStyleExtractor::customPropertyValue):
22 (WebCore::ComputedStyleExtractor::propertyValue):
23 (WebCore::CSSComputedStyleDeclaration::length):
24 (WebCore::elementOrItsAncestorNeedsStyleRecalc): Deleted.
25 (WebCore::updateStyleIfNeededForElement): Deleted.
26 * css/StyleResolver.cpp:
27 (WebCore::StyleResolver::colorFromPrimitiveValue):
29 Mark style as using explicit inheritance if 'currentcolor' value is used.
31 2016-10-24 Youenn Fablet <youenn@apple.com>
33 ASSERTION FAILED: canvas()->securityOrigin()->toString() == cachedImage.origin()->toString()
34 https://bugs.webkit.org/show_bug.cgi?id=163242
36 Reviewed by Darin Adler.
38 Test: http/tests/security/cross-origin-cached-images-canvas.html
40 We were previously on Origin HTTP header to check whether requests were made from different origins.
41 This is fine for CORS enabled requests but not for GET no CORS requests since they will not have any Origin header.
43 Now that CachedResource and CachedResourceRequest own their origin, it is best to use these directly.
45 * loader/cache/CachedResourceLoader.cpp:
46 (WebCore::isRequestMatchingResourceOrigin):
47 (WebCore::CachedResourceLoader::shouldUpdateCachedResourceWithCurrentRequest):
49 2016-10-24 Youenn Fablet <youenn@apple.com>
51 Remove CachedResource::passesSameOriginPolicyCheck
52 https://bugs.webkit.org/show_bug.cgi?id=163593
54 Reviewed by Andreas Kling.
56 No change of behavior.
58 Removing no-longer used code.
60 * loader/cache/CachedResource.cpp:
61 (WebCore::CachedResource::redirectReceived):
62 (WebCore::CachedResource::passesAccessControlCheck): Deleted.
63 (WebCore::CachedResource::passesSameOriginPolicyCheck): Deleted.
64 (WebCore::CachedResource::responseForSameOriginPolicyChecks): Deleted.
65 * loader/cache/CachedResource.h:
66 (WebCore::CachedResource::response):
68 2016-10-24 Youenn Fablet <youenn@apple.com>
70 Redirections should be upgraded if CSP policy says so
71 https://bugs.webkit.org/show_bug.cgi?id=163544
73 Reviewed by Darin Adler.
75 Test: http/tests/security/contentSecurityPolicy/upgrade-insecure-requests/basic-upgrade-after-redirect.https.html
77 Introducing CachedResourceLoader::updateRequestAfterRedirection to do the checks that CachedResourceLoader is doing
78 to the initial request, but for redirection requests.
80 Implemented URL upgrade according CSP policy, as specified by fetch algorithm.
81 Minor refactoring in CachedResourceRequest to share some code.
82 Fixing some constness issues.
84 * loader/SubresourceLoader.cpp:
85 (WebCore::SubresourceLoader::willSendRequestInternal):
86 * loader/cache/CachedResourceLoader.cpp:
87 (WebCore::CachedResourceLoader::allowedByContentSecurityPolicy):
88 (WebCore::CachedResourceLoader::canRequestAfterRedirection):
89 (WebCore::CachedResourceLoader::updateRequestAfterRedirection):
90 * loader/cache/CachedResourceLoader.h:
91 * loader/cache/CachedResourceRequest.cpp:
92 (WebCore::upgradeInsecureResourceRequestIfNeeded):
93 (WebCore::CachedResourceRequest::upgradeInsecureRequestIfNeeded):
94 * loader/cache/CachedResourceRequest.h:
96 2016-10-22 Sam Weinig <sam@webkit.org>
98 [WebIDL] Add IDLType based toJS conversion
99 https://bugs.webkit.org/show_bug.cgi?id=163861
101 Reviewed by Darin Adler.
103 Adds toJS<IDLType>() functions to be the new way of converting
104 from implementation types to JS types. These are implemented via
105 a similar mechanism to the convert<IDL>() functions, though specializations
106 of a JSConverter struct (rather than the Converter structs). This allows
107 us to support arbitrarily complex aggregate types easily (e.g. sequence<(Node or DOMString?)>).
109 * Modules/geolocation/Geoposition.idl:
111 Add typedef for DOMTimeStamp. Eventually, our IDLParser should do this for us, but
112 for now it allows us to simplify the type system.
114 * bindings/js/JSDOMBinding.h:
115 (WebCore::JSValueTraits::arrayJSValue): Deleted.
116 (WebCore::JSValueTraits<String>::arrayJSValue): Deleted.
117 (WebCore::JSValueTraits<double>::arrayJSValue): Deleted.
118 (WebCore::JSValueTraits<float>::arrayJSValue): Deleted.
119 (WebCore::jsArray): Deleted.
120 (WebCore::jsFrozenArray): Deleted.
121 (WebCore::NativeValueTraits<String>::nativeValue): Deleted.
122 (WebCore::NativeValueTraits<unsigned>::nativeValue): Deleted.
123 (WebCore::NativeValueTraits<float>::nativeValue): Deleted.
124 (WebCore::NativeValueTraits<double>::nativeValue): Deleted.
125 (WebCore::toNullableJSNumber): Deleted.
126 (WebCore::toJSArray): Deleted.
127 (WebCore::toJSBoolean): Deleted.
128 (WebCore::toJSNumber): Deleted.
129 (WebCore::toJSString): Deleted.
130 Remove many now-unneeded conversion functions.
132 * bindings/js/JSDOMConvert.h:
134 Add 5 primary toJS functions which take combinations of the following
135 arguments: ExecState, JSDOMGlobalObject, ThrowScope. All take the value
136 to be converted as well, except in the case of the throwScope ones, where
137 they take the value in an ExceptionOr<>.
139 To simplify the implementations of the JSConverter specializations, avoiding
140 the need for each one to implement their conversion up to 3 times (one for just
141 the value, one for the value and the ExecState, and one for the value, the ExecState
142 and the global object), each JSConverter instead specifies whether it's converter
143 needs an ExecState or global object via a static constexpr. We then use the
144 JSConverterOverloader template, to call the correct function. This can probably be
145 improved in the future, by inferring the number of arguments needed via SFINAE, but
146 this seemed like a more straightforward first cut.
148 (WebCore::JSConverter<IDLNullable<T>>::convert):
149 (WebCore::JSConverter<IDLBoolean>::convert):
150 (WebCore::JSConverter<IDLInterface<T>>::convert):
151 (WebCore::JSConverter<IDLAny>::convert):
152 (WebCore::JSConverter<IDLByte>::convert):
153 (WebCore::JSConverter<IDLOctet>::convert):
154 (WebCore::JSConverter<IDLShort>::convert):
155 (WebCore::JSConverter<IDLUnsignedShort>::convert):
156 (WebCore::JSConverter<IDLLong>::convert):
157 (WebCore::JSConverter<IDLUnsignedLong>::convert):
158 (WebCore::JSConverter<IDLLongLong>::convert):
159 (WebCore::JSConverter<IDLUnsignedLongLong>::convert):
160 (WebCore::JSConverter<IDLFloat>::convert):
161 (WebCore::JSConverter<IDLUnrestrictedFloat>::convert):
162 (WebCore::JSConverter<IDLDouble>::convert):
163 (WebCore::JSConverter<IDLUnrestrictedDouble>::convert):
164 (WebCore::JSConverter<IDLDOMString>::convert):
165 (WebCore::JSConverter<IDLUSVString>::convert):
166 (WebCore::JSConverter<IDLSequence<T>>::convert):
167 (WebCore::JSConverter<IDLFrozenArray<T>>::convert):
168 (WebCore::JSConverter<IDLEnumeration<T>>::convert):
169 (WebCore::JSConverter<IDLUnion<T...>>::convert):
170 There is slightly more duplication than I would have liked, for instance we have a
171 specialization for each numeric type, even though they are all the same, but that is
172 something that can be improved going forward.
174 (WebCore::Converter<IDLUnion<T...>>::convert)
175 Fix the normal IDLUnion converter to work with boolean types. This was caught by the
176 test case I added via TypeConversions.idl.
178 * bindings/js/JSDOMStringMapCustom.cpp:
179 (WebCore::JSDOMStringMap::getOwnPropertySlotDelegate):
180 * bindings/js/JSDOMWindowCustom.cpp:
181 (WebCore::JSDOMWindow::setTimeout):
182 (WebCore::JSDOMWindow::setInterval):
183 * bindings/js/JSDataTransferCustom.cpp:
184 (WebCore::JSDataTransfer::types):
185 * bindings/js/JSMediaStreamTrackCustom.cpp:
186 (WebCore::JSMediaStreamTrack::getCapabilities):
187 * bindings/js/JSMutationCallback.cpp:
188 (WebCore::JSMutationCallback::call):
189 * bindings/js/JSSVGLengthCustom.cpp:
190 (WebCore::JSSVGLength::value):
191 Switch to use new toJS<> functions.
193 * bindings/scripts/CodeGeneratorJS.pm:
194 (AddStringifierOperationIfNeeded):
195 Fix stringifier function signature to contain an idlType.
197 (GenerateEnumerationsHeaderContent):
198 Remove now unnecessary JSValueTraits specializations.
200 (JSValueToNativeIsHandledByDOMConvert):
201 Renamed from IsHandledByDOMConvert, since that name is now ambiguous.
204 Update for new name of IsHandledByDOMConvert.
206 (NativeToJSValueIsHandledByDOMConvert):
207 Predicate guarding what types currently work with the new conversion system.
209 (NativeToJSValueDOMConvertNeedsState):
210 Predicate for determining if the ExecState is needed in the conversion function.
212 (NativeToJSValueDOMConvertNeedsGlobalObject):
213 Predicate for determining if the global object is needed in the conversion function.
216 Move things around a little bit and start converting use the new toJS<> when possible.
218 * bindings/scripts/IDLParser.pm:
219 (parseAttributeOrOperationRest):
220 Fix a missing place where were not setting the idlType.
222 * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
223 * bindings/scripts/test/JS/JSTestCEReactions.cpp:
224 * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
225 * bindings/scripts/test/JS/JSTestCallback.cpp:
226 * bindings/scripts/test/JS/JSTestCallbackFunction.cpp:
227 * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
228 * bindings/scripts/test/JS/JSTestException.cpp:
229 * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
230 * bindings/scripts/test/JS/JSTestInterface.cpp:
231 * bindings/scripts/test/JS/JSTestNode.cpp:
232 * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
233 * bindings/scripts/test/JS/JSTestObj.cpp:
234 * bindings/scripts/test/JS/JSTestObj.h:
235 * bindings/scripts/test/JS/JSTestSerialization.cpp:
236 * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
237 * bindings/scripts/test/JS/JSTestTypedefs.cpp:
238 * bindings/scripts/test/JS/JSattribute.cpp:
241 * testing/TypeConversions.h:
242 (WebCore::TypeConversions::testUnion):
243 (WebCore::TypeConversions::setTestUnion):
244 (WebCore::TypeConversions::typeConversionsDictionarySequenceValue):
245 (WebCore::TypeConversions::typeConversionsDictionaryUnionValue):
246 * testing/TypeConversions.idl:
247 Add a testUnion attribute, now that we can return unions to JS.
249 2016-10-23 Zalan Bujtas <zalan@apple.com>
251 Unreviewed, rolling out r207727.
253 broke 15 selection test cases.
257 "Do not update selection rect on dirty lineboxes."
258 https://bugs.webkit.org/show_bug.cgi?id=163862
259 http://trac.webkit.org/changeset/207727
261 2016-10-23 Chris Dumez <cdumez@apple.com>
263 addEventListener() / removeEventListener() should use a union for last parameter
264 https://bugs.webkit.org/show_bug.cgi?id=163863
266 Reviewed by Darin Adler.
268 addEventListener() / removeEventListener() should use a union for last parameter:
269 - https://dom.spec.whatwg.org/#eventtarget
271 No new tests, no Web-exposed behavior change.
273 * bindings/js/JSDOMConvert.h:
274 * dom/EventTarget.cpp:
275 (WebCore::EventTarget::addEventListenerForBindings):
276 (WebCore::EventTarget::removeEventListenerForBindings):
278 * dom/EventTarget.idl:
280 2016-10-23 Zalan Bujtas <zalan@apple.com>
282 Do not update selection rect on dirty lineboxes.
283 https://bugs.webkit.org/show_bug.cgi?id=163862
284 <rdar://problem/28813156>
286 Reviewed by Simon Fraser.
288 In addition to checking whether the renderer needs layout, we also need to check if its preferred
289 width is clean and stop computing the selection rects, if needed (while adding a renderer to the tree,
290 there's a transition phase where the parent's preferred width dirty bit is already set, but it does
291 not yet need layout).
293 Tests: fast/css-generated-content/dynamic-first-letter-selection-clear-crash.html
295 * rendering/RenderObject.cpp:
296 (WebCore::RenderObject::canUpdateSelectionOnRootLineBoxes):
298 2016-10-22 Myles C. Maxfield <mmaxfield@apple.com>
300 ASSERTION FAILED: m_fonts in &WebCore::FontCascade::primaryFont
301 https://bugs.webkit.org/show_bug.cgi?id=163459
303 Reviewed by Darin Adler.
305 The CSS Units and Values spec states that font-relative units, when used
306 in the font-size property, are resolved against the parent element. When
307 calc() is specified, we were trying to resolve them against the current
308 element, which is impossible because of the circular dependency. Instead,
309 we should resolve against the parent style the same way as when calc()
312 Test: fast/text/font-size-calc.html
314 * css/StyleBuilderCustom.h:
315 (WebCore::StyleBuilderCustom::applyValueFontSize):
317 2016-10-22 Chris Dumez <cdumez@apple.com>
319 [Web IDL] Two types are distinguishable for overload resolution if at most one of the two includes a nullable type
320 https://bugs.webkit.org/show_bug.cgi?id=163791
322 Reviewed by Sam Weinig.
324 Update overload resolution in the bindings generator so that 2 nullable types
325 are no longer considered as distinguishable, as per Web IDL:
326 - https://heycam.github.io/webidl/#dfn-distinguishable
328 * bindings/scripts/CodeGeneratorJS.pm:
329 (AreTypesDistinguishableForOverloadResolution):
330 * bindings/scripts/test/JS/JSTestObj.cpp:
331 (WebCore::jsTestObjPrototypeFunctionOverloadWithNullableNonDistinguishingParameter1):
332 (WebCore::jsTestObjPrototypeFunctionOverloadWithNullableNonDistinguishingParameter1Caller):
333 (WebCore::jsTestObjPrototypeFunctionOverloadWithNullableNonDistinguishingParameter2):
334 (WebCore::jsTestObjPrototypeFunctionOverloadWithNullableNonDistinguishingParameter2Caller):
335 (WebCore::jsTestObjPrototypeFunctionOverloadWithNullableNonDistinguishingParameter):
336 * bindings/scripts/test/TestObj.idl:
338 2016-10-22 Chris Dumez <cdumez@apple.com>
340 WebGLRenderingContextBase.texSubImage2D() should use a union instead of overloading
341 https://bugs.webkit.org/show_bug.cgi?id=163859
343 Reviewed by Darin Adler.
345 WebGLRenderingContextBase.texSubImage2D() should use a union instead of overloading:
346 - https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14
348 No new tests, no Web-exposed behavior change.
350 * html/canvas/WebGL2RenderingContext.cpp:
351 (WebCore::WebGL2RenderingContext::texSubImage2D):
352 * html/canvas/WebGL2RenderingContext.h:
353 * html/canvas/WebGLRenderingContext.cpp:
354 (WebCore::WebGLRenderingContext::texSubImage2D):
355 * html/canvas/WebGLRenderingContext.h:
356 * html/canvas/WebGLRenderingContextBase.h:
357 * html/canvas/WebGLRenderingContextBase.idl:
359 2016-10-22 Dan Bernstein <mitz@apple.com>
361 Dynamically-added backdrop filter to clip-path'd element with 3D transform renders incorrectly (without clip)
362 https://bugs.webkit.org/show_bug.cgi?id=163497
364 Reviewed by Simon Fraser.
366 Test: css3/filters/backdrop/dynamic-with-clip-path.html
368 * platform/graphics/ca/GraphicsLayerCA.cpp:
369 (WebCore::GraphicsLayerCA::ensureStructuralLayer): Added MaskLayerChanged to
370 structuralLayerChangeFlags to ensure that the mask layer is updated.
372 2016-10-22 Simon Fraser <simon.fraser@apple.com>
374 Backdrop filter doesn't show if removed then re-added
375 https://bugs.webkit.org/show_bug.cgi?id=163860
377 Reviewed by Dan Bernstein.
379 When a backdrop filter is removed the re-added, updateBackdropFiltersRect() never
380 runs the second time because m_backdropFiltersRect doesn't change. However, we need
381 to run that code to size and position the newly re-created backdrop layer, so run
382 it explicitly if we just created the backdrop layer. This is similar to how
383 updateContentsImage() calls updateContentsRects().
385 Test: css3/filters/backdrop/add-remove-add-backdrop-filter.html
387 * platform/graphics/ca/GraphicsLayerCA.cpp:
388 (WebCore::GraphicsLayerCA::setBackdropFilters):
389 (WebCore::GraphicsLayerCA::updateBackdropFilters):
391 2016-10-22 Simon Fraser <simon.fraser@apple.com>
393 Fix repainting of slow repaint objects in WK1 when page scale is applied
394 https://bugs.webkit.org/show_bug.cgi?id=163854
396 Reviewed by Zalan Bujtas.
398 RenderObject::repaintSlowRepaintObject() always set the repaint container to the RenderView
399 if it was null. This is before the call to clippedOverflowRectForRepaint(). If that function
400 is called with a null repaintContainer, it maps the rect up through the RenderView's transform
401 (which represents page scale), which is what we want here. Passing the RenderView itself
402 stops the transform from being applied, which led to the bug.
404 WebKit2 doesn't suffer from this bug because containerForRepaint() always returns the
405 composited RenderView.
407 Test: fast/repaint/zoomed-fixed-background.html
409 * rendering/RenderObject.cpp:
410 (WebCore::RenderObject::repaintSlowRepaintObject):
412 2016-10-22 Darin Adler <darin@apple.com>
414 Move HTML canvas and tracks from ExceptionCode to Exception
415 https://bugs.webkit.org/show_bug.cgi?id=163853
417 Reviewed by Chris Dumez.
419 * WebCore.xcodeproj/project.pbxproj: Added CanvasPath.idl.
421 * bindings/js/JSWebGL2RenderingContextCustom.cpp: Tweaked a bit.
423 * bindings/js/JSWebGLRenderingContextBaseCustom.cpp:
424 (WebCore::JSWebGLRenderingContextBase::getExtension): Tweaked a bit.
425 (WebCore::JSWebGLRenderingContextBase::getFramebufferAttachmentParameter):
426 Removed unneeded exception handling.
427 (WebCore::JSWebGLRenderingContextBase::getParameter): Ditto.
428 (WebCore::JSWebGLRenderingContextBase::getProgramParameter): Ditto.
429 (WebCore::JSWebGLRenderingContextBase::getShaderParameter): Ditto.
430 (WebCore::JSWebGLRenderingContextBase::getSupportedExtensions): Use a
432 (WebCore::JSWebGLRenderingContextBase::getUniform): Removed unneeded
435 * html/HTMLCanvasElement.cpp:
436 (WebCore::HTMLCanvasElement::getContext): Pass a reference.
437 (WebCore::HTMLCanvasElement::reset): Use is<CanvasRenderingContext2D>.
438 (WebCore::HTMLCanvasElement::setUsesDisplayListDrawing): Ditto.
439 (WebCore::HTMLCanvasElement::setTracksDisplayListReplay) Ditto.:
440 (WebCore::HTMLCanvasElement::displayListAsText): Ditto.
441 (WebCore::HTMLCanvasElement::replayDisplayListAsText): Ditto.
442 (WebCore::HTMLCanvasElement::clearImageBuffer): Ditto.
444 * html/canvas/CanvasGradient.cpp:
445 (WebCore::CanvasGradient::CanvasGradient): Streamlined.
446 (WebCore::CanvasGradient::addColorStop): Use ExceptionOr.
447 * html/canvas/CanvasGradient.h: Updated for above changes.
448 * html/canvas/CanvasGradient.idl: Use non-legacy exception.
450 * html/canvas/CanvasPath.cpp:
451 (WebCore::CanvasPath::arcTo): Use ExceptionOr.
452 (WebCore::CanvasPath::arc): Ditto.
453 (WebCore::CanvasPath::ellipse): Ditto.
454 * html/canvas/CanvasPath.h: Updated for above changes.
455 * html/canvas/CanvasPath.idl: Use non-legacy exceptions.
457 * html/canvas/CanvasPattern.cpp:
458 (WebCore::CanvasPattern::create): Use Ref&&.
459 (WebCore::CanvasPattern::CanvasPattern): Ditto.
460 (WebCore::CanvasPattern::parseRepetitionType): Return a boolean
461 instead of using an ExceptionCode.
462 * html/canvas/CanvasPattern.h: Updated for above changes.
464 * html/canvas/CanvasRenderingContext.cpp:
465 (CanvasRenderingContext::wouldTaintOrigin): Reordered function so
466 that it's safe to call it on an image element without a cached
467 image, or a cached image without an underlying image.
469 * html/canvas/CanvasRenderingContext2D.cpp:
470 (WebCore::CanvasRenderingContext2D::CanvasRenderingContext2D):
472 (WebCore::CanvasRenderingContext2D::drawImage): Use ExceptionOr.
473 (WebCore::CanvasRenderingContext2D::drawImageFromRect): Ditto.
474 (WebCore::CanvasRenderingContext2D::createLinearGradient): Ditto.
475 (WebCore::CanvasRenderingContext2D::createRadialGradient): Ditto.
476 (WebCore::CanvasRenderingContext2D::createPattern): Ditto.
477 (WebCore::CanvasRenderingContext2D::createImageData): Ditto.
478 (WebCore::CanvasRenderingContext2D::getImageData): Ditto.
479 (WebCore::CanvasRenderingContext2D::webkitGetImageDataHD): Ditto.
480 (WebCore::CanvasRenderingContext2D::putImageData): Removed unneeded
481 ExceptionCode because this does not throw exceptions; the only one
482 was for non-finite numeric values but this is now handled by bindings.
483 (WebCore::CanvasRenderingContext2D::webkitPutImageDataHD): Ditto.
484 * html/canvas/CanvasRenderingContext2D.h: Updated for above.
485 * html/canvas/CanvasRenderingContext2D.idl: Use non-legacy exceptions
486 and removed exceptions entirely in other cases.
488 * html/canvas/OESVertexArrayObject.cpp:
489 (WebCore::OESVertexArrayObject::OESVertexArrayObject): Take a reference.
490 (WebCore::OESVertexArrayObject::~OESVertexArrayObject): Deleted.
491 (WebCore::OESVertexArrayObject::isVertexArrayOES): Use && instead of
492 multiple return statements.
493 (WebCore::OESVertexArrayObject::bindVertexArrayOES): Removed unneeded
494 ExceptionCode since this does not throw an exception.
495 * html/canvas/OESVertexArrayObject.h: Updated for above.
496 * html/canvas/OESVertexArrayObject.idl: Removed unneeded exception.
498 * html/canvas/WebGL2RenderingContext.cpp:
499 (WebCore::WebGL2RenderingContext::getFramebufferAttachmentParameter):
500 Removed unneeded ExceptionCode since this does not throw an exception.
501 (WebCore::WebGL2RenderingContext::texSubImage2DBase): Ditto.
502 (WebCore::WebGL2RenderingContext::texSubImage2DImpl): Ditto.
503 (WebCore::WebGL2RenderingContext::texSubImage2D): Removed unneeded
504 ExceptionCode for some overloads, for the others, use ExceptionOr
505 for the security exception. Moved security exception code here from
506 the validate functions.
507 (WebCore::WebGL2RenderingContext::validateTexFuncParameters): Removed
508 unneeded ExceptionCode.
509 (WebCore::WebGL2RenderingContext::getParameter): Ditto.
510 * html/canvas/WebGL2RenderingContext.h: Updated for above.
512 * html/canvas/WebGLRenderingContext.cpp:
513 (WebCore::WebGLRenderingContext::getExtension): Pass a reference.
514 (WebCore::WebGLRenderingContext::getFramebufferAttachmentParameter):
515 Remvoed unneeded ExceptionCode since this does not throw an exception.
516 (WebCore::WebGLRenderingContext::texSubImage2DBase): Ditto.
517 (WebCore::WebGLRenderingContext::texSubImage2DImpl): Ditto.
518 (WebCore::WebGLRenderingContext::texSubImage2D): Removed unneeded
519 ExceptionCode for some overloads, for the others, use ExceptionOr
520 for the security exception. Moved security exception code here from
521 the validate functions.
522 (WebCore::WebGLRenderingContext::getParameter): Removed unneeded
524 * html/canvas/WebGLRenderingContext.h: Updated for above changes.
526 * html/canvas/WebGLRenderingContextBase.cpp:
527 (WebCore::WebGLRenderingContextBase::texImage2DBase):
528 Remvoed unneeded ExceptionCode since this does not throw an exception.
529 (WebCore::WebGLRenderingContextBase::texImage2DImpl): Ditto.
530 (WebCore::WebGLRenderingContextBase::texImage2D): Removed unneeded
531 ExceptionCode for some overloads, for the others, use ExceptionOr
532 for the security exception. Moved security exception code here from
533 the validate functions.
534 (WebCore::WebGLRenderingContextBase::validateHTMLImageElement):
535 Moved the security exception out of here to the call sites.
536 (WebCore::WebGLRenderingContextBase::validateHTMLCanvasElement): Ditto.
537 (WebCore::WebGLRenderingContextBase::validateHTMLVideoElement): Ditto.
538 * html/canvas/WebGLRenderingContextBase.h: Updated for above changes.
539 * html/canvas/WebGLRenderingContextBase.idl: Use non-legacy exceptions
540 in some cases and no exceptions at all in many others.
542 * html/shadow/MediaControlElements.cpp:
543 (WebCore::MediaControlTextTrackContainerElement::updateDisplay):
544 Use a reference instead of a pointer.
546 * html/track/DataCue.h: Use pragma once.
547 * html/track/DataCue.idl: Use non-legacy exception for constructor
548 attribute, even though it is custom and so it has no effect.
550 * html/track/InbandDataTextTrack.cpp:
551 (WebCore::InbandDataTextTrack::create): Use RefPtr&&.
552 (WebCore::InbandDataTextTrack::InbandDataTextTrack): Ditto.
553 (WebCore::InbandDataTextTrack::addDataCue): Stop using
555 (WebCore::InbandDataTextTrack::removeDataCue): Stop using
557 (WebCore::InbandDataTextTrack::removeCue): Use ExceptionOr.
558 Also use remove instead of find/remove.
559 * html/track/InbandDataTextTrack.h: Updated for above changes.
561 * html/track/InbandGenericTextTrack.cpp:
562 (WebCore::GenericTextTrackCueMap::GenericTextTrackCueMap): Deleted.
563 (WebCore::GenericTextTrackCueMap::~GenericTextTrackCueMap): Deleted.
564 (WebCore::GenericTextTrackCueMap::add): Take references intead of
566 (WebCore::GenericTextTrackCueMap::find): Ditto. Also use get
568 (WebCore::GenericTextTrackCueMap::remove): Ditto. Also use take
569 instead of double hashing to both find and remove.
570 (WebCore::InbandGenericTextTrack::updateCueFromCueData): Stop using
571 IGNORE_EXCEPTION. Also got rid of code that is converting a double
572 to a long and then back to a double by using lround. Instead just
573 use std::round, which keeps it a double. But also, why does this need
575 (WebCore::InbandGenericTextTrack::addGenericCue): Updated to use
576 reference to work with m_cueMap.
577 (WebCore::InbandGenericTextTrack::updateGenericCue): Ditto.
578 (WebCore::InbandGenericTextTrack::removeGenericCue): Ditto.
579 (WebCore::InbandGenericTextTrack::removeCue): Use ExceptionOr.
580 (WebCore::InbandGenericTextTrack::newCuesParsed): Removed
582 * html/track/InbandGenericTextTrack.h: Updated for above changes.
584 * html/track/InbandWebVTTTextTrack.cpp:
585 (WebCore::InbandWebVTTTextTrack::newCuesParsed): Removed
588 * html/track/TextTrack.cpp:
589 (WebCore::TextTrack::addCue): Use ExcepctionOr.
590 (WebCore::TextTrack::removeCue): Ditto.
591 (WebCore::TextTrack::addRegion): Ditto.
592 (WebCore::TextTrack::removeRegion): Ditto.
593 * html/track/TextTrack.h: Updated for above changes.
594 * html/track/TextTrack.idl: Ditto.
596 * html/track/TextTrackCue.cpp:
597 (WebCore::TextTrackCue::cueShadowPseudoId): Moved this here
598 since it does not need to be inlined in the header.
599 (WebCore::TextTrackCue::~TextTrackCue): Deleted.
600 (WebCore::TextTrackCue::setStartTime): Removed ExceptionCode&
601 since the exceptions were for non-finite values, but this is
602 now handled by the bindings.
603 (WebCore::TextTrackCue::setEndTime): Ditto.
604 * html/track/TextTrackCue.h: Updated for the above.
605 * html/track/TextTrackCue.idl: Removed SetterMayThrowLegacyException
606 and made startTime and endTime be double rather than unrestricted double.
608 * html/track/TextTrackCueGeneric.cpp:
609 (WebCore::TextTrackCueGenericBoxElement::applyCSSProperties):
610 Use a reference instead of a pointer.
611 (WebCore::TextTrackCueGeneric::TextTrackCueGeneric): Initialize
612 m_defaultPosition in the class definition instead of here.
613 (WebCore::TextTrackCueGeneric::createDisplayTree): Return a Ref.
614 (WebCore::TextTrackCueGeneric::setLine): Use ExceptionOr.
615 (WebCore::TextTrackCueGeneric::setPosition): Ditto.
616 (WebCore::TextTrackCueGeneric::setFontSize): Updated since
617 displayTreeInternal() now returns a reference.
618 * html/track/TextTrackCueGeneric.h: Updated for above changes.
619 Also fixed some arguument types and made some more things private.
621 * html/track/VTTCue.cpp:
622 (WebCore::VTTCue::createDisplayTree): Return a Ref.
623 (WebCore::VTTCue::displayTreeInternal): Return a reference.
624 (WebCore::VTTCue::setVertical): Use ExceptionOr.
625 (WebCore::VTTCue::setLine): Ditto.
626 (WebCore::VTTCue::setPosition): Ditto.
627 (WebCore::VTTCue::setSize): Ditto.
628 (WebCore::VTTCue::setAlign): Ditto.
629 (WebCore::VTTCue::getDisplayTree): Return a reference.
630 (WebCore::VTTCue::removeDisplayTree): Updated since
631 displayTreeInternal returns a reference.
632 (WebCore::VTTCue::setFontSize): Ditto.
633 * html/track/VTTCue.h: Updated for the above.
634 * html/track/VTTCue.idl: Use non-legacy exceptions and also
637 * html/track/VTTRegion.cpp:
638 (WebCore::VTTRegion::VTTRegion): Moved default values all into
639 the class definition.
640 (WebCore::VTTRegion::setWidth): Removed the check for non-finite
641 since the bindings now handle that. Use ExcpetionOr.
642 (WebCore::VTTRegion::setHeight): Ditto.
643 (WebCore::VTTRegion::setRegionAnchorX): Ditto.
644 (WebCore::VTTRegion::setRegionAnchorY): Ditto.
645 (WebCore::VTTRegion::setViewportAnchorX): Ditto.
646 (WebCore::VTTRegion::setViewportAnchorY): Ditto.
647 (WebCore::upKeyword): Added. Shared by the code below.
648 (WebCore::VTTRegion::scroll): Rewrote to be simpler.
649 (WebCore::VTTRegion::setScroll): Rewrote to be simpler.
650 (WebCore::VTTRegion::updateParametersFromRegion): Read and
651 write data members directly to avoid awkward code that is otherwise
652 required just to copy from one object to the other. Also take a
653 const& instead of a pointer for the thing to update from.
654 (WebCore::VTTRegion::parseSettingValue): Use upKeyword.
655 (WebCore::VTTRegion::appendTextTrackCueBox): Take a Ref&&.
656 (WebCore::VTTRegion::getDisplayTree): Do the downcast to Document
657 here instead of using the helper function.
658 (WebCore::VTTRegion::prepareRegionDisplayTree): Ditto.
659 * html/track/VTTRegion.h: Updated for the above.
660 * html/track/VTTRegion.idl: Use non-legacy exceptions and also
661 use restricted dobules, not unrestricted.
663 2016-10-22 Chris Dumez <cdumez@apple.com>
665 WebGLRenderingContextBase.texImage2D() should use a union instead of overloading
666 https://bugs.webkit.org/show_bug.cgi?id=163856
668 Reviewed by Darin Adler.
670 WebGLRenderingContextBase.texImage2D() should use a union instead of overloading:
671 - https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14
673 * html/canvas/WebGLRenderingContextBase.cpp:
674 (WebCore::WebGLRenderingContextBase::texImage2D):
675 * html/canvas/WebGLRenderingContextBase.h:
676 * html/canvas/WebGLRenderingContextBase.idl:
678 2016-10-22 Antti Koivisto <antti@apple.com>
680 REGRESSION(r207669): Dromaeo/jslib-style-jquery.html regressed >20%
681 https://bugs.webkit.org/show_bug.cgi?id=163851
683 Reviewed by Darin Adler.
685 The test calls Scope::flushPendingUpdate a lot and nothing ever happens there.
687 Add a separate invalidity bit for descendant scopes and inline the fast path.
689 * style/StyleScope.cpp:
690 (WebCore::Style::Scope::flushPendingSelfUpdate):
691 (WebCore::Style::Scope::flushPendingDescendantUpdates):
692 (WebCore::Style::Scope::scheduleUpdate):
693 (WebCore::Style::Scope::flushPendingUpdate): Deleted.
694 * style/StyleScope.h:
695 (WebCore::Style::Scope::hasPendingUpdate):
696 (WebCore::Style::Scope::flushPendingUpdate):
698 2016-10-22 Darin Adler <darin@apple.com>
700 Move SVG from ExceptionCode to Exception
701 https://bugs.webkit.org/show_bug.cgi?id=163837
703 Reviewed by Chris Dumez.
705 * WebCore.xcodeproj/project.pbxproj: Added SVGGraphicsElement.idl.
707 * bindings/js/JSSVGLengthCustom.cpp:
708 (WebCore::JSSVGLength::value): Use toJSNumber.
709 (WebCore::JSSVGLength::setValue): Use propagateException.
710 (WebCore::JSSVGLength::convertToSpecifiedUnits): Ditto.
712 * bindings/scripts/CodeGeneratorJS.pm:
713 (GenerateImplementation): Properly handle SetterMayThrowException
714 in the special case for SVG setters.
716 * rendering/style/SVGRenderStyle.h:
717 (WebCore::SVGRenderStyle::initialBaselineShiftValue): Removed
718 ASSERT_NO_EXCEPTION, no longer needed.
719 (WebCore::SVGRenderStyle::initialKerning): Ditto.
721 * svg/SVGAltGlyphElement.cpp:
722 (WebCore::SVGAltGlyphElement::setGlyphRef): Use ExceptionOr.
723 (WebCore::SVGAltGlyphElement::setFormat): Ditto.
724 (WebCore::SVGAltGlyphElement::hasValidGlyphElements): Tweaked a bit.
725 * svg/SVGAltGlyphElement.h: Updated for above changes.
726 * svg/SVGAltGlyphElement.idl: Use non-legacy exceptions.
729 (WebCore::SVGAngle::valueAsString): Removed unneeded String globals.
730 (WebCore::parseAngleType): Rewrote to be simpler and more direct.
731 (WebCore::SVGAngle::setValueAsString): Use ExceptionOr.
732 (WebCore::SVGAngle::newValueSpecifiedUnits): Ditto.
733 (WebCore::SVGAngle::convertToSpecifiedUnits): Ditto.
734 * svg/SVGAngle.h: Updated for above changes. Initialized data members
735 here in the class definite and removed constructor; default now works.
736 * svg/SVGAngle.idl: Use non-legacy exceptions.
738 * svg/SVGAnimateElementBase.cpp:
739 (WebCore::SVGAnimateElementBase::calculateAnimatedValue): Update since
740 CalcMode is now an enum class.
741 * svg/SVGAnimateMotionElement.cpp:
742 (WebCore::SVGAnimateMotionElement::SVGAnimateMotionElement): Ditto.
744 * svg/SVGAnimateTransformElement.cpp:
745 (WebCore::SVGAnimateTransformElement::hasValidAttributeType): Update
746 since AttributeType is now an enum class.
748 * svg/SVGAnimatedAngle.cpp:
749 (WebCore::SVGAnimatedAngleAnimator::calculateDistance): Removed
750 ASSERT_NO_EXCEPTION, no longer needed.
752 * svg/SVGAnimatedBoolean.idl: Use non-legacy exception.
753 * svg/SVGAnimatedEnumeration.idl: Ditto.
754 * svg/SVGAnimatedInteger.idl: Ditto.
756 * svg/SVGAnimatedLength.cpp:
757 (WebCore::sharedSVGLength): Deleted.
758 (WebCore::SVGAnimatedLengthAnimator::addAnimatedTypes): Removed
759 ASSERT_NO_EXCEPTION, no longer needed.
760 (WebCore::parseLengthFromString): Ditto. Also rewrote to not use
761 a shared SVGLength; no benefit to doing that.
762 (WebCore::SVGAnimatedLengthAnimator::calculateAnimatedValue): Ditto.
763 * svg/SVGAnimatedLengthList.cpp:
764 (WebCore::SVGAnimatedLengthListAnimator::addAnimatedTypes): Ditto.
765 (WebCore::SVGAnimatedLengthListAnimator::calculateAnimatedValue): Ditto.
767 * svg/SVGAnimatedNumber.idl: Use non-legacy exception.
768 * svg/SVGAnimatedString.idl: Ditto.
770 * svg/SVGAnimatedType.cpp:
771 (WebCore::SVGAnimatedType::setValueAsString): Updated since
772 setValueAsString now uses ExceptionOr.
774 * svg/SVGAnimationElement.cpp:
775 (WebCore::SVGAnimationElement::SVGAnimationElement): Initialized scalars
776 in the class definition instead of here.
777 (WebCore::SVGAnimationElement::getSimpleDuration): Removed uneeded ExceptionCode&.
778 (WebCore::SVGAnimationElement::setCalcMode): Updated since CalcMode is now an enum class.
779 (WebCore::SVGAnimationElement::setAttributeType): Updated since AttributeType
780 is now an enum class.
781 (WebCore::SVGAnimationElement::shouldApplyAnimation): Ditto.
782 (WebCore::SVGAnimationElement::calculateKeyTimesForCalcModePaced): Ditto.
783 (WebCore::SVGAnimationElement::calculatePercentForSpline): Ditto.
784 (WebCore::SVGAnimationElement::calculatePercentFromKeyPoints): Ditto.
785 (WebCore::SVGAnimationElement::calculatePercentForFromTo): Ditto.
786 (WebCore::SVGAnimationElement::currentValuesFromKeyPoints): Ditto.
787 (WebCore::SVGAnimationElement::currentValuesForValuesAnimation): Ditto.
788 (WebCore::SVGAnimationElement::startedActiveInterval): Ditto.
789 (WebCore::SVGAnimationElement::updateAnimation): Ditto.
790 (WebCore::SVGAnimationElement::checkInvalidCSSAttributeType): Ditto.
792 * svg/SVGAnimationElement.h: Changed CalcMode into an enum class.
793 Updated for above changes.
795 * svg/SVGAnimationElement.idl: Removed MayThrowLegacyException from
799 (WebCore::SVGColor::SVGColor): Updated to take scalar in the straightforward
800 manner instead of constt SVGColorType&.
801 (WebCore::SVGColor::setRGBColor): Use ExceptionOr.
802 (WebCore::SVGColor::setRGBColorICCColor): Ditto.
803 (WebCore::SVGColor::setColor): Ditto.
804 * svg/SVGColor.h: Updated for above changes. Removed unneeded destructor.
805 * svg/SVGColor.idl: Use non-legacy exceptions.
807 * svg/SVGGlyphRefElement.cpp:
808 (WebCore::SVGGlyphRefElement::SVGGlyphRefElement): Initialize data members
809 in class definition, not here.
810 (WebCore::parseFloat): Added helper. Used in parseAttribute.
811 (WebCore::SVGGlyphRefElement::parseAttribute): Updated to use parseFloat helper.
812 (WebCore::SVGGlyphRefElement::glyphRef): Deleted.
813 (WebCore::SVGGlyphRefElement::setGlyphRef): Deleted.
814 (WebCore::SVGGlyphRefElement::setX): Removed unused Exception& argument.
815 (WebCore::SVGGlyphRefElement::setY): Ditto.
816 (WebCore::SVGGlyphRefElement::setDx): Ditto.
817 (WebCore::SVGGlyphRefElement::setDy): Ditto.
818 * svg/SVGGlyphRefElement.h: Updated for above changes.
819 * svg/SVGGlyphRefElement.idl: Use Reflect on glyphRef. Removed incorrect
820 SetterMayThrowLegacyException attributes for x, y, dx, and dy. Longer term
821 it might be nice to use [Reflect] on these too.
823 * svg/SVGGraphicsElement.idl: Use non-legacy exception.
826 (WebCore::parseLengthType): Changed argument type since caller does not
827 need to know how many characters are consumed.
828 (WebCore::SVGLength::SVGLength): Removed IGNORE_EXCEPTION and ASSERT_NO_EXCEPTION.
829 Also removed the copy constructor, letting the compiler generate the default.
830 (WebCore::SVGLength::setValueAsString): Use ExceptionOr.
831 (WebCore::SVGLength::construct): Updated since setValueAsString uses ExceptionOr.
832 (WebCore::SVGLength::value): Ditto.
833 (WebCore::SVGLength::valueForBindings): Use ExceptionOr. Also renamed to
834 disambiguate with the version used outside of bindings.
835 (WebCore::SVGLength::setValue): Use ExceptionOr.
836 (WebCore::SVGLength::newValueSpecifiedUnits): Ditto.
837 (WebCore::SVGLength::convertToSpecifiedUnits): Ditto.
838 (WebCore::SVGLength::fromCSSPrimitiveValue): Updated since newValueSpecifiedUnits
840 (WebCore::SVGLength::lengthModeForAnimatedLengthAttribute): Rewrote map generation
841 code to be more efficient and not unrolled. Only do one hash table lookup.
842 * svg/SVGLength.h: Updated for above changes.
843 * svg/SVGLength.idl: Use non-legacy exceptions.
845 * svg/SVGLengthContext.cpp:
846 (WebCore::SVGLengthContext::valueForLength): Update since function
848 (WebCore::SVGLengthContext::convertValueToUserUnits): Use ExceptionOr.
849 (WebCore::SVGLengthContext::convertValueFromUserUnits): Ditto.
850 (WebCore::SVGLengthContext::convertValueFromUserUnitsToPercentage): Ditto.
851 (WebCore::SVGLengthContext::convertValueFromPercentageToUserUnits): Ditto.
852 (WebCore::SVGLengthContext::convertValueFromUserUnitsToEMS): Ditto.
853 (WebCore::SVGLengthContext::convertValueFromEMSToUserUnits): Ditto.
854 (WebCore::SVGLengthContext::convertValueFromUserUnitsToEXS): Ditto.
855 (WebCore::SVGLengthContext::convertValueFromEXSToUserUnits): Ditto.
856 * svg/SVGLengthContext.h: Updatedfor above changes.
858 * svg/SVGLengthList.cpp:
859 (WebCore::SVGLengthList::parse): Updated since setValueAsString uses
861 * svg/SVGLengthList.h: Removed unneeded constructor.
862 * svg/SVGLengthList.idl: Use non-legacy exceptions.
864 * svg/SVGLocatable.cpp:
865 (WebCore::SVGLocatable::getTransformToElement): Use ExceptionOr.
866 * svg/SVGLocatable.h: Updated for above change.
868 * svg/SVGMarkerElement.h:
869 (WebCore::SVGPropertyTraits<SVGMarkerOrientType>::fromString):
870 Updated since setValueAsString uses ExceptionOr now.
872 * svg/SVGMatrix.h: Use ExceptionOr.
873 * svg/SVGMatrix.idl: Use non-legacy exceptions.
875 * svg/SVGNumberList.h: Removed unneeded constructor.
876 * svg/SVGNumberList.idl: Use non-legacy exceptions.
879 (WebCore::SVGPaint::setPaint): Use ExceptionOr.
880 * svg/SVGPaint.h: Updated for above chagne.
881 * svg/SVGPaint.idl: Use non-legacy exception.
883 * svg/SVGPathSegList.h: Tweaked a bit.
884 * svg/SVGPathSegList.idl: Use non-legacy exceptions.
886 * svg/SVGPointList.h: Removed unneeded constructor.
887 * svg/SVGPointList.idl: Use non-legacy exceptions.
889 * svg/SVGPreserveAspectRatio.cpp:
890 (WebCore::SVGPreserveAspectRatio::setAlign): Use ExceptionOr.
891 (WebCore::SVGPreserveAspectRatio::setMeetOrSlice): Ditto.
892 * svg/SVGPreserveAspectRatio.h: Updated for above changes.
893 * svg/SVGPreserveAspectRatio.idl: Use non-legacy exceptions.
895 * svg/SVGSVGElement.cpp:
896 (WebCore::SVGSVGElement::currentView): Pass a reference.
898 * svg/SVGStringList.h: Tweaked a bit.
899 * svg/SVGStringList.idl: Use non-legacy exceptions.
901 * svg/SVGStyleElement.cpp:
902 (WebCore::SVGStyleElement::setType): Removed unneeded ExceptionCode&.
903 (WebCore::SVGStyleElement::setMedia): Ditto.
904 (WebCore::SVGStyleElement::setTitle): Deleted.
905 * svg/SVGStyleElement.h: Updated for above changes, and made the title
906 function override be private.
907 * svg/SVGStyleElement.idl: Use Reflect for title. Removed unneeded
908 SetterMayThrowLegacyException on all attributes.
910 * svg/SVGTextContentElement.cpp:
911 (WebCore::SVGTextContentElement::textLengthAnimated): Removed
912 ASSERT_NO_EXCEPTION, won't work any more.
913 (WebCore::SVGTextContentElement::getSubStringLength): Use ExceptionOr.
914 Also remove redundant call to updateLayoutIgnorePendingStylesheets,
915 called by getNumberOfChars.
916 (WebCore::SVGTextContentElement::getStartPositionOfChar): Ditto.
917 (WebCore::SVGTextContentElement::getEndPositionOfChar): Ditto.
918 (WebCore::SVGTextContentElement::getExtentOfChar): Ditto.
919 (WebCore::SVGTextContentElement::getRotationOfChar): Ditto.
920 (WebCore::SVGTextContentElement::selectSubString): Ditto.
921 * svg/SVGTextContentElement.h: Updated for above changes.
922 * svg/SVGTextContentElement.idl: Use non-legacy exceptions.
924 * svg/SVGTransformList.h: Removed unneeded constructor.
925 * svg/SVGTransformList.idl: Use non-legacy exceptions.
927 * svg/SVGViewSpec.cpp:
928 (WebCore::SVGViewSpec::SVGViewSpec): Updated to take a reference.
929 (WebCore::SVGViewSpec::setZoomAndPan): Use ExceptionOr.
930 (WebCore::SVGViewSpec::setTransformString): Deleted.
931 (WebCore::SVGViewSpec::viewBoxString): Use m_viewBox directly.
932 (WebCore::SVGViewSpec::preserveAspectRatioString): Use
933 m_preserveAspectRatio directly.
934 (WebCore::SVGViewSpec::viewTarget): Use is<SVGElement>.
935 (WebCore::SVGViewSpec::lookupOrCreateViewBoxWrapper): Use
936 m_contextElement directly.
937 (WebCore::SVGViewSpec::lookupOrCreatePreserveAspectRatioWrapper):
939 (WebCore::SVGViewSpec::lookupOrCreateTransformWrapper): Ditto.
940 (WebCore::SVGViewSpec::parseViewSpec): Set m_viewTargetString directly.
941 * svg/SVGViewSpec.h: Updated for above changes. Removed unneeded virtual
942 destructor, unneeded using for ref/deref, unused functions including
943 setTransformString, setViewTargetString, non-exception setZoomAndPan,
944 contextElement, viewBoxBaseValue, and preserveAspectRatioBaseValue.
945 * svg/SVGViewSpec.idl: Use non-legacy exceptions. Also specify
946 ImplementationLacksVTable.
948 * svg/properties/SVGAnimatedEnumerationPropertyTearOff.h:
950 * svg/properties/SVGAnimatedStaticPropertyTearOff.h: Ditto.
951 * svg/properties/SVGListProperty.h: Ditto.
952 * svg/properties/SVGListPropertyTearOff.h: Ditto.
953 * svg/properties/SVGPathSegListPropertyTearOff.cpp:
954 (WebCore::SVGPathSegListPropertyTearOff::clear): Ditto.
955 (WebCore::SVGPathSegListPropertyTearOff::getItem): Ditto.
956 (WebCore::SVGPathSegListPropertyTearOff::replaceItem): Ditto.
957 (WebCore::SVGPathSegListPropertyTearOff::removeItem): Ditto.
958 * svg/properties/SVGPathSegListPropertyTearOff.h: Ditto.
959 * svg/properties/SVGPropertyTearOff.h: Ditto. Also added an overload
960 of create that knows how to deal with exceptions.
961 * svg/properties/SVGStaticListPropertyTearOff.h: Ditto.
962 * svg/properties/SVGTransformListPropertyTearOff.h: Ditto.
964 2016-10-22 Chris Dumez <cdumez@apple.com>
966 WebGLRenderingContextBase.bufferData() should use a union instead of overloading
967 https://bugs.webkit.org/show_bug.cgi?id=163795
969 Reviewed by Darin Adler.
971 WebGLRenderingContextBase.bufferData() / bufferSubData() should use a union
972 instead of overloading:
973 - https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14
975 No new tests, no web-exposed behavior change.
977 * bindings/js/JSDOMConvert.h:
978 (WebCore::Converter<IDLInterface<T>>::convert):
979 * bindings/scripts/CodeGeneratorJS.pm:
981 * bindings/scripts/test/JS/JSInterfaceName.h:
982 * bindings/scripts/test/JS/JSTestActiveDOMObject.h:
983 * bindings/scripts/test/JS/JSTestCEReactions.h:
984 * bindings/scripts/test/JS/JSTestCEReactionsStringifier.h:
985 * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.h:
986 * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h:
987 * bindings/scripts/test/JS/JSTestCustomNamedGetter.h:
988 * bindings/scripts/test/JS/JSTestEventConstructor.h:
989 * bindings/scripts/test/JS/JSTestEventTarget.h:
990 * bindings/scripts/test/JS/JSTestException.h:
991 * bindings/scripts/test/JS/JSTestGenerateIsReachable.h:
992 * bindings/scripts/test/JS/JSTestGlobalObject.h:
993 * bindings/scripts/test/JS/JSTestInterface.h:
994 * bindings/scripts/test/JS/JSTestIterable.h:
995 * bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
996 * bindings/scripts/test/JS/JSTestNamedConstructor.h:
997 * bindings/scripts/test/JS/JSTestNode.h:
998 * bindings/scripts/test/JS/JSTestNondeterministic.h:
999 * bindings/scripts/test/JS/JSTestObj.h:
1000 * bindings/scripts/test/JS/JSTestOverloadedConstructors.h:
1001 * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.h:
1002 * bindings/scripts/test/JS/JSTestOverrideBuiltins.h:
1003 * bindings/scripts/test/JS/JSTestSerialization.h:
1004 * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
1005 * bindings/scripts/test/JS/JSTestTypedefs.h:
1006 * bindings/scripts/test/JS/JSattribute.h:
1007 * bindings/scripts/test/JS/JSreadonly.h:
1008 * html/canvas/WebGL2RenderingContext.cpp:
1009 (WebCore::WebGL2RenderingContext::bufferData):
1010 (WebCore::WebGL2RenderingContext::bufferSubData):
1011 * html/canvas/WebGLRenderingContextBase.cpp:
1012 (WebCore::WebGLRenderingContextBase::bufferData):
1013 (WebCore::WebGLRenderingContextBase::bufferSubData):
1014 * html/canvas/WebGLRenderingContextBase.h:
1015 * html/canvas/WebGLRenderingContextBase.idl:
1017 2016-10-22 Darin Adler <darin@apple.com>
1019 [Cocoa] REGRESSION (r204508): Crash in init_WebCreateFragment when pasting (seen in multiple apps using legacy WebKit)
1020 https://bugs.webkit.org/show_bug.cgi?id=163839
1022 Reviewed by Dan Bernstein.
1024 * editing/cocoa/EditorCocoa.mm: Use the appropriate SOFT_LINK macros to find
1025 the WebKitLegacy platform in the correct location for iOS and macOS.
1027 2016-10-22 Nael Ouedraogo <nael.ouedraogo@crf.canon.fr>
1029 Bindings error message for missing required dictionary member should be more explicit
1030 https://bugs.webkit.org/show_bug.cgi?id=163665
1032 Reviewed by Darin Adler.
1034 Add throwRequiredMemberTypeError function to throw a TypeError exception with an error
1035 message indicating the missing required member.
1037 No new test required, rebase existing tests.
1039 * bindings/js/JSDOMBinding.cpp:
1040 (WebCore::throwRequiredMemberTypeError):
1041 * bindings/js/JSDOMBinding.h:
1042 * bindings/scripts/CodeGeneratorJS.pm:
1043 (GenerateDictionaryImplementationContent):
1044 * bindings/scripts/test/JS/JSTestObj.cpp:
1045 (WebCore::convertDictionary<TestObj::DictionaryThatShouldNotTolerateNull>):
1047 2016-10-22 Ryosuke Niwa <rniwa@webkit.org>
1049 Upgrading custom element should enqueue attributeChanged and connected callbacks
1050 https://bugs.webkit.org/show_bug.cgi?id=163840
1052 Reviewed by Darin Adler.
1054 When upgrading a custom element, enqueue attributeChanged and connectedCallbacks as needed as specified
1055 in step 3 and 4 of: https://html.spec.whatwg.org/multipage/scripting.html#concept-upgrade-an-element
1057 Test: fast/custom-elements/upgrading-enqueue-reactions.html
1059 * bindings/js/JSCustomElementInterface.cpp:
1060 (WebCore::JSCustomElementInterface::upgradeElement): Enqueue
1061 * dom/CustomElementReactionQueue.cpp:
1062 (WebCore::CustomElementReactionQueueItem::invoke): Don't invoke callbacks when the custom element had
1064 (WebCore::CustomElementReactionQueue::enqueuePostUpgradeReactions): Added.
1065 (WebCore::CustomElementReactionQueue::invokeAll): Upgrading a custom element may enqueue more reactions.
1066 Keep invoking reactions until the queue becomes empty.
1067 * dom/CustomElementReactionQueue.h:
1068 * dom/Range.idl: Added a forgotten CEReactions here.
1070 2016-10-21 David Kilzer <ddkilzer@apple.com>
1072 Bug 163762: IntSize::area() should used checked arithmetic
1073 <https://webkit.org/b/163762>
1075 Reviewed by Darin Adler.
1077 No new tests since no change in nominal behavior.
1079 * platform/graphics/IntSize.h:
1080 (WebCore::IntSize::area): Change to return a
1081 Checked<unsigned, T> value. Use WTF:: namespace to avoid
1082 including another header.
1084 * platform/graphics/IntRect.h:
1085 (WebCore::IntRect::area): Ditto.
1087 The remaining changes are to use the Checked<unsigned> return
1088 value of IntSize::area() and IntRect::area() correctly in
1089 context, in addition to items noted below.
1091 * html/HTMLPlugInImageElement.cpp:
1092 (WebCore::HTMLPlugInImageElement::isTopLevelFullPagePlugin):
1093 Declare contentWidth and contentHeight as float values to
1094 prevent overflow when computing the area, and to make the
1095 inequality comparison in the return statement uses the same type
1097 * html/ImageData.cpp:
1098 (WebCore::ImageData::ImageData):
1099 * html/MediaElementSession.cpp:
1100 (WebCore::isElementRectMostlyInMainFrame):
1101 * platform/graphics/ImageBackingStore.h:
1102 (WebCore::ImageBackingStore::setSize): Restructure logic to
1103 compute area only once.
1104 (WebCore::ImageBackingStore::clear):
1105 * platform/graphics/ImageFrame.h:
1106 (WebCore::ImageFrame::frameBytes):
1107 * platform/graphics/ImageSource.cpp:
1108 (WebCore::ImageSource::maximumSubsamplingLevel):
1109 * platform/graphics/ca/LayerPool.cpp:
1110 (WebCore::LayerPool::backingStoreBytesForSize):
1111 * platform/graphics/cg/ImageDecoderCG.cpp:
1112 (WebCore::ImageDecoder::frameBytesAtIndex):
1113 * platform/graphics/filters/FEGaussianBlur.cpp:
1114 (WebCore::FEGaussianBlur::platformApplySoftware):
1115 * platform/graphics/filters/FilterEffect.cpp:
1116 (WebCore::FilterEffect::asUnmultipliedImage):
1117 (WebCore::FilterEffect::asPremultipliedImage):
1118 (WebCore::FilterEffect::copyUnmultipliedImage):
1119 (WebCore::FilterEffect::copyPremultipliedImage):
1120 (WebCore::FilterEffect::createUnmultipliedImageResult):
1121 (WebCore::FilterEffect::createPremultipliedImageResult):
1122 * platform/graphics/win/ImageBufferDataDirect2D.cpp:
1123 (WebCore::ImageBufferData::getData): Update overflow check,
1124 rename local variable to numBytes, and compute numBytes once.
1125 * platform/graphics/win/ImageDecoderDirect2D.cpp:
1126 (WebCore::ImageDecoder::frameBytesAtIndex):
1127 * platform/image-decoders/ImageDecoder.cpp:
1128 (WebCore::ImageDecoder::frameBytesAtIndex):
1129 * platform/ios/LegacyTileLayerPool.mm:
1130 (WebCore::LegacyTileLayerPool::bytesBackingLayerWithPixelSize):
1131 * rendering/RenderLayerCompositor.cpp:
1132 (WebCore::RenderLayerCompositor::requiresCompositingForCanvas):
1133 * rendering/shapes/Shape.cpp:
1134 (WebCore::Shape::createRasterShape):
1136 2016-10-21 Gavin Barraclough <barraclough@apple.com>
1138 WebPageProxy should not need PageActivityState
1139 https://bugs.webkit.org/show_bug.cgi?id=163821
1141 Reviewed by Geoff Garen.
1143 The PageActivityState is currently plumbed back from WebCore up to the UI process, to
1144 determine whether to enabled process suppression. However the information it contains
1145 (whether a page load is ongoing, whether audio is playing) is already available via
1146 other means. Remove this use of PageActivityState.
1148 * html/HTMLMediaElement.cpp:
1149 (WebCore::HTMLMediaElement::mediaState):
1150 - Fix a bug in how we compute IsPlayingAudio - if the volume of the MediaElement is
1151 set to zero, then audio is not playing (we were already checking muted).
1152 * page/ChromeClient.h:
1153 - removed setPageActivityState
1155 (WebCore::Page::setPageActivityState): Deleted.
1156 - setPageActivityState -> pageActivityStateChanged, remove call to ChromeClient
1158 (WebCore::Page::pageActivityStateChanged):
1159 - setPageActivityState -> pageActivityStateChanged
1160 * page/PageThrottler.cpp:
1161 (WebCore::PageThrottler::setActivityFlag):
1162 - setPageActivityState -> pageActivityStateChanged
1164 2016-10-21 Chris Dumez <cdumez@apple.com>
1166 [Web ID] Overload resolution is wrong if one of the types is a nullable union
1167 https://bugs.webkit.org/show_bug.cgi?id=163816
1169 Reviewed by Alex Christensen.
1171 Overload resolution was wrong if one of the types was a nullable union. This
1172 is because we never considered the union type itself, only its subtypes.
1173 Therefore, we checked if any of the union's subtypes were nullable but we
1174 failed to check if the union itself was nullable.
1177 - https://heycam.github.io/webidl/#es-overloads (Step 11.3.)
1179 No new tests, extended bindings tests.
1181 * bindings/scripts/CodeGeneratorJS.pm:
1182 (GetOverloadThatMatchesIgnoringUnionSubtypes):
1183 (GenerateOverloadedFunctionOrConstructor):
1184 * bindings/scripts/test/JS/JSTestObj.cpp:
1185 (WebCore::jsTestObjPrototypeFunctionOverloadWithNullableUnion1):
1186 (WebCore::jsTestObjPrototypeFunctionOverloadWithNullableUnion1Caller):
1187 (WebCore::jsTestObjPrototypeFunctionOverloadWithNullableUnion2):
1188 (WebCore::jsTestObjPrototypeFunctionOverloadWithNullableUnion2Caller):
1189 (WebCore::jsTestObjPrototypeFunctionOverloadWithNullableUnion):
1190 (WebCore::jsTestObjPrototypeFunctionOverloadWithOptionalUnion1):
1191 (WebCore::jsTestObjPrototypeFunctionOverloadWithOptionalUnion1Caller):
1192 (WebCore::jsTestObjPrototypeFunctionOverloadWithOptionalUnion2):
1193 (WebCore::jsTestObjPrototypeFunctionOverloadWithOptionalUnion2Caller):
1194 (WebCore::jsTestObjPrototypeFunctionOverloadWithOptionalUnion):
1195 * bindings/scripts/test/TestObj.idl:
1197 2016-10-21 Eric Carlson <eric.carlson@apple.com>
1199 [MediaStream] Dynamically generate media capture sandbox extensions
1200 https://bugs.webkit.org/show_bug.cgi?id=154861
1201 <rdar://problem/24909411>
1203 Reviewed by Tim Horton.
1205 No new tests, some of these changes are covered by existing tests and some can only be tested
1206 with physical capture devices.
1208 * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: AVSampleBufferAudioRenderer
1209 and AVSampleBufferRenderSynchronizer are now declared in AVFoundationSPI.h.
1211 * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
1212 * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
1213 (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::MediaPlayerPrivateMediaStreamAVFObjC): Initialize
1214 AVSampleBufferRenderSynchronizer.
1215 (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::isAvailable): Fail if AVSampleBufferRenderSynchronizer
1217 (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueAudioSampleBufferFromTrack): Take a MediaSample&
1218 instead of a PlatformSample&.
1219 (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSampleBufferFromTrack): Ditto.
1220 (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayer): Add the sample buffer display
1221 later to the synchronizer.
1222 (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::destroyLayer): Remove the sample buffer display
1223 later from the synchronizer.
1224 (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::play): Start the synchronizer.
1225 (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::pause): Stash the current clock time in
1226 m_pausedTime, but leave the clock running. Pause the synchronizer.
1227 (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::currentMediaTime): Return the clock time
1228 when playing, m_pausedTime time when paused because we leave the clock running forever.
1229 (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::sampleBufferUpdated):
1231 * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: AVSampleBufferAudioRenderer
1232 is now declared in AVFoundationSPI.h.
1234 * platform/spi/mac/AVFoundationSPI.h: Add AVSampleBufferAudioRenderer and AVSampleBufferRenderSynchronizer.
1236 2016-10-21 Commit Queue <commit-queue@webkit.org>
1238 Unreviewed, rolling out r207582.
1239 https://bugs.webkit.org/show_bug.cgi?id=163819
1241 Not quite ready rdar://problem/28897179 (Requested by
1242 alexchristensen on #webkit).
1246 "Re-enable URLParser for non-Safari Cocoa apps after r207321"
1247 https://bugs.webkit.org/show_bug.cgi?id=163690
1248 http://trac.webkit.org/changeset/207582
1250 2016-10-21 Gavin Barraclough <barraclough@apple.com>
1252 WebPage should take UserActivity directly for user input
1253 https://bugs.webkit.org/show_bug.cgi?id=163813
1255 Reviewed by Anders Carlsson.
1257 When we receive mouse/keyboard events in a page, we want to prevent AppNap. We currently do so
1258 via the PageThrottler. This patch is to just make the WebPage drive the UserActivity directly.
1260 Two reasons to do so: (1) to cleanup & simplify for further refactoring. (2) The current code
1261 isn't really achieving the desired effect. The page setting the flag in the throttler to get
1262 the activity to be set is now a less effective way of achieving this goal, since the
1263 PageActivityState bounces back across to the UI process & then messages back to the WebContent
1264 process to take the UserActivity. These extra hops defeat the purpose of making sure the boost
1265 from the initial message isn't lost.
1267 * page/PageThrottler.cpp:
1268 (WebCore::PageThrottler::PageThrottler):
1269 (WebCore::m_userInputHysteresis): Deleted.
1270 * page/PageThrottler.h:
1271 (WebCore::PageThrottler::didReceiveUserInput): Deleted.
1272 - removed PageActivityState::UserInputActivity, didReceiveUserInput, m_userInputHysteresis.
1274 2016-10-21 Wenson Hsieh <wenson_hsieh@apple.com>
1276 Support (insertFrom|deleteBy)Composition and (insert|delete)CompositionText inputTypes for InputEvents
1277 https://bugs.webkit.org/show_bug.cgi?id=163460
1278 <rdar://problem/28784142>
1280 Reviewed by Darin Adler.
1282 Adds basic support for the composition inputTypes in the InputEvent spec. See w3.org/TR/input-events,
1283 github.com/w3c/input-events/issues/41 and github.com/w3c/input-events/issues/42 for more details. While input
1284 events are fired in the correct order with respect to each other, additional work will be required to ensure
1285 that input events are fired in the correct order with respect to composition(start|update|end) events and
1286 textInput events. This is held off until the expected ordering of events is officially defined in the spec.
1288 Tests: fast/events/before-input-events-prevent-insert-composition.html
1289 fast/events/before-input-events-prevent-recomposition.html
1290 fast/events/input-events-ime-composition.html
1291 fast/events/input-events-ime-recomposition.html
1293 * editing/CompositeEditCommand.cpp:
1294 (WebCore::CompositeEditCommand::apply):
1295 * editing/CompositeEditCommand.h:
1296 (WebCore::CompositeEditCommand::isBeforeInputEventCancelable):
1298 Adds a new virtual method hook for subclasses to mark their `beforeinput` events as non-cancelable (see
1299 TypingCommand::isBeforeInputEventCancelable). By default, `beforeinput` events are cancelable.
1301 * editing/EditAction.h:
1303 Adds 4 new EditActions corresponding to the 4 composition-related inputTypes. These are:
1304 EditActionTypingDeletePendingComposition => "deleteCompositionText"
1305 EditActionTypingDeleteFinalComposition => "deleteByComposition"
1306 EditActionTypingInsertPendingComposition => "insertCompositionText"
1307 EditActionTypingInsertFinalComposition => "insertFromComposition"
1309 * editing/EditCommand.cpp:
1310 (WebCore::inputTypeNameForEditingAction):
1311 * editing/Editor.cpp:
1312 (WebCore::dispatchBeforeInputEvent):
1313 (WebCore::dispatchBeforeInputEvents):
1314 (WebCore::Editor::willApplyEditing):
1315 (WebCore::Editor::insertTextWithoutSendingTextEvent):
1316 (WebCore::Editor::setComposition):
1318 In setComposition(text, mode), tweak the logic for committing a composition to always delete the selection
1319 before inserting the final composition text. In setComposition(text, underlines, start, end), catch the case
1320 where we're beginning to recompose an existing range in the DOM and delete the recomposed text first.
1322 * editing/TypingCommand.cpp:
1323 (WebCore::editActionForTypingCommand):
1324 (WebCore::TypingCommand::TypingCommand):
1325 (WebCore::TypingCommand::deleteSelection):
1327 Adds a TextCompositionType parameter so that call sites (see Editor::setComposition) can indicate what state the
1328 edited composition is in. This allows us to differentiate between deletion of finalized composition text in
1329 preparation of recomposing a range in the DOM, and deletion of composition text that has not yet been committed
1330 in preparation for inserting a finalized composition into the DOM.
1332 (WebCore::TypingCommand::deleteKeyPressed):
1333 (WebCore::TypingCommand::forwardDeleteKeyPressed):
1334 (WebCore::TypingCommand::insertText):
1335 (WebCore::TypingCommand::insertLineBreak):
1336 (WebCore::TypingCommand::insertParagraphSeparatorInQuotedContent):
1337 (WebCore::TypingCommand::insertParagraphSeparator):
1338 (WebCore::TypingCommand::isBeforeInputEventCancelable):
1339 (WebCore::TypingCommand::inputEventData):
1340 (WebCore::TypingCommand::willAddTypingToOpenCommand):
1341 * editing/TypingCommand.h:
1343 2016-10-21 Dave Hyatt <hyatt@apple.com>
1345 [CSS Parser] Make sure shadow user agent sheets parse in UASheetMode
1346 https://bugs.webkit.org/show_bug.cgi?id=163810
1348 Reviewed by Dean Jackson.
1350 * dom/InlineStyleSheetOwner.cpp:
1351 (WebCore::parserContextForElement):
1352 (WebCore::makeInlineStyleSheetCacheKey):
1353 (WebCore::InlineStyleSheetOwner::createSheet):
1354 (WebCore::parserContextForForElement): Deleted.
1356 2016-10-21 Jer Noble <jer.noble@apple.com>
1358 YouTube stalls when seeking beyond buffered range
1359 https://bugs.webkit.org/show_bug.cgi?id=162813
1361 Reviewed by Eric Carlson.
1363 When seeking a MediaPlayerPrivateMediaSourceAVFObjC, we will first seek the AVSampleBufferRenderSynchronizer,
1364 flush and enqueue non-displaying frames, enqueue regular frames, then begin playback. The above stall will occur
1365 when we enqueue so many non- displaying frames that the display layer is not ready for normal ones before
1366 playback begins. Then, when the synchronizer attempts to synchronize the enqueued audio and video renderers, the
1367 only available samples are back at the original media time, and so it "seeks" by updating the CMTimebase back to
1368 the original media time, causing playback to appear "stalled". The overall solution is to "flush" the contents
1369 of the renderers before the seek, so that the synchronizer doesn't reset the currentTime, and to only restart
1370 the synchronizer when there are visible (or audible) samples available for display.
1372 Breaking the fix down into sections:
1374 = Don't enqueue too many non-displaying samples at once:
1375 - Rename SourceBufferPrivate::flushAndEnqueueNonDisplayingSamples() to SourceBufferPrivate::flush(), and no longer
1376 pass in an array of non-displaying samples.
1377 - Add a new virtual method to MediaSample, createNonDisplayingCopy(), used by SourceBuffer to enqueue non-displaying
1379 - in SourceBuffer::reenqueueMediaForTime(), use that new createNonDisplayingCopy() method to enqueue non-displaying
1380 samples in the same queue as regular samples.
1382 * Modules/mediasource/SourceBuffer.cpp:
1383 (WebCore::SourceBuffer::provideMediaData):
1384 (WebCore::SourceBuffer::reenqueueMediaForTime):
1385 * platform/MediaSample.h:
1386 (WebCore::MediaSample::isNonDisplaying):
1387 * platform/graphics/SourceBufferPrivate.h:
1388 (WebCore::SourceBufferPrivate::flush):
1389 (WebCore::SourceBufferPrivate::flushAndEnqueueNonDisplayingSamples): Renamed -> flush().
1390 * platform/graphics/avfoundation/MediaSampleAVFObjC.h:
1391 * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:
1392 (WebCore::CMSampleBufferIsNonDisplaying):
1393 (WebCore::MediaSampleAVFObjC::flags):
1394 (WebCore::MediaSampleAVFObjC::createNonDisplayingCopy):
1395 * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1396 (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
1397 (WebCore::SourceBufferPrivateAVFObjC::willSeek):
1398 (WebCore::createNonDisplayingCopy): Moved to MediaSampleAVFObjC.
1399 (WebCore::SourceBufferPrivateAVFObjC::flushAndEnqueueNonDisplayingSamples): Renamed -> flush().
1400 * platform/mock/mediasource/MockBox.h:
1401 * platform/mock/mediasource/MockSourceBufferPrivate.cpp:
1402 (WebCore::MockMediaSample::flags):
1403 (WebCore::MockMediaSample::createNonDisplayingCopy):
1404 * platform/mock/mediasource/MockSourceBufferPrivate.h:
1406 = Don't start playing until all renderers have visible/audible samples:
1407 - SourceBufferPrivateAVFObjC will notify its associated MediaPlayerPrivateMediaSourceAVFObjC when
1408 it flushes and receives visible/audible samples.
1409 - The MediaPlayer will store audio renderers as keys to a HashMap which allows it to track which
1410 have available samples.
1411 - This requires changing all the places where we loop over the available renderers.
1413 * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1414 (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
1415 (WebCore::SourceBufferPrivateAVFObjC::enqueueSample):
1416 (WebCore::SourceBufferPrivateAVFObjC::flush):
1417 (WebCore::SourceBufferPrivateAVFObjC::willSeek):
1418 * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
1419 (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::allRenderersHaveAvailableSamples):
1420 (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setHasAvailableVideoFrame): Deleted.
1421 * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1422 (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC):
1423 (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVolume):
1424 (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setMuted):
1425 (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setHasAvailableVideoFrame):
1426 (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setHasAvailableAudioSample):
1427 (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::updateAllRenderersHaveAvailableSamples):
1428 (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::addAudioRenderer):
1429 (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::removeAudioRenderer):
1430 (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setPreservesPitch):
1431 (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seeking):
1432 (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::shouldBePlaying):
1433 (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekInternal):
1434 * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h:
1435 * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
1436 (WebCore::MediaSourcePrivateAVFObjC::willSeek):
1437 * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
1439 = Don't display new samples mid-seek.
1440 - MediaSource should clear its m_pendingSeekTime ivar, which is used whyn SourceBuffer queries whether or not a
1441 seek is pending, when instructing its SourceBuffers to seekToTime().
1442 - This allows SourceBuffer to decline to enqueue new samples during a MediaSource seek operation.
1444 * Modules/mediasource/MediaSource.cpp:
1445 (WebCore::MediaSource::completeSeek):
1447 2016-10-20 Dean Jackson <dino@apple.com>
1449 SVG should not paint selection within a mask
1450 https://bugs.webkit.org/show_bug.cgi?id=163772
1451 <rdar://problem/28705129>
1453 Reviewed by Simon Fraser.
1455 When masking content, we shouldn't paint the text
1456 selection as we are rendering into the masking
1459 Test: svg/masking/mask-should-not-paint-selection.html
1461 * rendering/PaintPhase.h: Add a new behavior - PaintBehaviorSkipSelectionHighlight.
1462 * rendering/svg/SVGInlineTextBox.cpp:
1463 (WebCore::SVGInlineTextBox::paint): Don't update the selectionStyle if
1464 PaintBehaviorSkipSelectionHighlight is true.
1465 * rendering/svg/SVGRenderingContext.cpp:
1466 (WebCore::SVGRenderingContext::renderSubtreeToImageBuffer): Add PaintBehaviorSkipSelectionHighlight
1469 2016-10-21 Chris Dumez <cdumez@apple.com>
1471 [Web IDL] MediaControlsHost has invalid operation overloads
1472 https://bugs.webkit.org/show_bug.cgi?id=163793
1474 Reviewed by Darin Adler.
1476 MediaControlsHost has invalid operation overloads:
1477 - sortedTrackListForMenu()
1478 - displayNameForTrack()
1480 The parameter is nullable for both overloads which is not valid IDL.
1482 - sortedTrackListForMenu(): The parameter is no longer nullable. This is a minor
1483 behavior change and it should be safe since this is Apple-specific and only
1484 called from mediaControlsApple.js which uses HTMLMediaElement.videoTracks and
1485 HTMLMediaElement.audioTracks as input, both of which are not nullable.
1486 Note that we could have also kept one of the parameters as nullable to not
1487 change behavior but allowing null does not seem useful here.
1488 - displayNameForTrack(): Use a union instead of overloading, no behavior change.
1490 * Modules/mediacontrols/MediaControlsHost.cpp:
1491 (WebCore::MediaControlsHost::sortedTrackListForMenu):
1492 (WebCore::MediaControlsHost::displayNameForTrack):
1493 * Modules/mediacontrols/MediaControlsHost.h:
1494 * Modules/mediacontrols/MediaControlsHost.idl:
1496 2016-10-21 Jeremy Jones <jeremyj@apple.com>
1498 Implement basic pointer lock behavior for WebKit and WebKit2.
1499 https://bugs.webkit.org/show_bug.cgi?id=162745
1501 Reviewed by Simon Fraser.
1503 When ENABLE_POINTER_LOCK is enabled, these tests now pass with DumpRenderTree.
1504 LayoutTests/pointer-lock/lock-already-locked.html
1505 LayoutTests/pointer-lock/lock-element-not-in-dom.html
1506 LayoutTests/pointer-lock/locked-element-iframe-removed-from-dom.html
1507 LayoutTests/pointer-lock/mouse-event-api.html
1509 Export pointer lock symbols and cancel pointer lock on "escape".
1511 * dom/Document.h: Export symbols.
1512 * dom/Element.h: Export symbols.
1513 * page/EventHandler.cpp:
1514 (WebCore::EventHandler::keyEvent): Cancel pointer lock on "escape".
1515 * page/PointerLockController.cpp: Add missing include.
1516 * page/PointerLockController.h: Export symbols.
1518 2016-10-21 Jer Noble <jer.noble@apple.com>
1520 WebCore::PlatformMediaSession::stopSession + 13
1521 https://bugs.webkit.org/show_bug.cgi?id=163799
1523 Reviewed by Eric Carlson.
1525 Because m_sessions can be mutated by removeSession() while iterating over m_sessions, and because
1526 PlatformMediaSessions are not refcounted, it is not enough to copy m_sessions into a copied Vector
1527 before iterating. Instead, wrap iteration of m_sessions in a convenience function, which sets an
1528 iteration counter which, when cleared, removes all null entries from m_session. In parallel, modify
1529 removeSession() to check this iteration counter, and replace the session with a null value rather
1530 than mutating the m_sessions vector itself.
1532 * platform/audio/PlatformMediaSessionManager.cpp:
1533 (WebCore::PlatformMediaSessionManager::has):
1534 (WebCore::PlatformMediaSessionManager::activeAudioSessionRequired):
1535 (WebCore::PlatformMediaSessionManager::canProduceAudio):
1536 (WebCore::PlatformMediaSessionManager::removeSession):
1537 (WebCore::PlatformMediaSessionManager::sessionWillBeginPlayback):
1538 (WebCore::PlatformMediaSessionManager::sessionWillEndPlayback):
1539 (WebCore::PlatformMediaSessionManager::currentSessionsMatching):
1540 (WebCore::PlatformMediaSessionManager::applicationWillEnterBackground):
1541 (WebCore::PlatformMediaSessionManager::applicationDidEnterForeground):
1542 (WebCore::PlatformMediaSessionManager::systemWillSleep):
1543 (WebCore::PlatformMediaSessionManager::systemDidWake):
1544 (WebCore::PlatformMediaSessionManager::stopAllMediaPlaybackForDocument):
1545 (WebCore::PlatformMediaSessionManager::stopAllMediaPlaybackForProcess):
1546 (WebCore::PlatformMediaSessionManager::forEachSession):
1547 (WebCore::PlatformMediaSessionManager::anyOfSessions):
1548 * platform/audio/PlatformMediaSessionManager.h:
1550 2016-10-21 Darin Adler <darin@apple.com>
1552 Move some more assorted classes from ExceptionCode to Exception
1553 https://bugs.webkit.org/show_bug.cgi?id=163775
1555 Reviewed by Chris Dumez.
1557 * Modules/fetch/WorkerGlobalScopeFetch.cpp:
1558 (WebCore::WorkerGlobalScopeFetch::fetch): Remove unnecessary calls to
1559 WorkerGlobalScope::scriptExcutionObject, which just returns the scope itself.
1561 * Modules/notifications/Notification.cpp: Added now-needed include.
1562 * Modules/webdatabase/DOMWindowWebDatabase.cpp: Ditto.
1564 * WebCore.xcodeproj/project.pbxproj: Added WindowOrWorkerGlobalScope.idl.
1566 * bindings/js/JSDedicatedWorkerGlobalScopeCustom.cpp:
1567 (WebCore::JSDedicatedWorkerGlobalScope::postMessage): Pass a reference instead
1568 of a pointer to handlePostMessage.
1569 * bindings/js/JSMessagePortCustom.cpp:
1570 (WebCore::JSMessagePort::postMessage): Ditto.
1572 * bindings/js/JSMessagePortCustom.h: Use pragma once. Change handlePostMessage
1573 to take a reference to the object instead of a pointer, and also to use
1574 propagateException since postMessage now uses ExceptionOr.
1576 * bindings/js/JSWorkerCustom.cpp:
1577 (WebCore::JSWorker::postMessage): Pass a reference instead of a pointer to
1579 (WebCore::constructJSWorker): Use the version of toJSNewlyCreated that handles
1580 propagating an exception from ExceptionOr.
1582 * bindings/js/JSWorkerGlobalScopeCustom.cpp:
1583 (WebCore::JSWorkerGlobalScope::visitAdditionalChildren): Use auto.
1584 Remove unnecessary round trip through the scriptExecutionContext function.
1585 (WebCore::JSWorkerGlobalScope::importScripts): Use reserveInitialCapacity and
1586 uncheckedAppend to build up the vector of strings. Use propagateException
1587 to deal with ExceptionOr result.
1589 * dom/MessagePort.cpp:
1590 (WebCore::MessagePort::MessagePort): Initialize boolean data members in the
1591 class definition instead of here.
1592 (WebCore::MessagePort::postMessage): Use ExceptionOr.
1593 (WebCore::MessagePort::entangle): Use an rvalue reference.
1594 (WebCore::MessagePort::dispatchMessages): Use ExceptionOr.
1595 (WebCore::MessagePort::disentanglePorts): Ditto. Also use a more efficient
1596 idiom that does half as much hashing as the old algorithm, and got rid an
1597 unneeded local variable.
1598 (WebCore::MessagePort::entanglePorts): Use an rvalue reference.
1599 * dom/MessagePort.h: Updated for above changes.
1601 * fileapi/FileReader.cpp:
1602 (WebCore::FileReader::create): Use auto.
1603 (WebCore::FileReader::FileReader): Initialize scalars in the class definition.
1604 (WebCore::FileReader::~FileReader): Call cancel on the loader directly
1605 instead of sharing code with the stop function.
1606 (WebCore::FileReader::stop): Moved the body of the terminate function here.
1607 (WebCore::FileReader::readAsArrayBuffer): Use ExceptionOr.
1608 (WebCore::FileReader::readAsBinaryString): Ditto.
1609 (WebCore::FileReader::readAsText): Ditto.
1610 (WebCore::FileReader::readAsDataURL): Ditto.
1611 (WebCore::FileReader::readInternal): Ditto. Also add a cast now that
1612 we derive privately from FileReaderLoaderClient.
1613 (WebCore::FileReader::abort): Call stop instead of terminate.
1614 (WebCore::FileReader::terminate): Deleted. Moved code into stop.
1615 (WebCore::FileReader::didReceiveData): Moved comment to where the constant is.
1616 * fileapi/FileReader.h: Updated for above changes. Made more functions private
1617 and used final instead of override.
1618 * fileapi/FileReader.idl: Use non-legacy exceptions.
1620 * fileapi/FileReaderSync.cpp:
1621 (WebCore::FileReaderSync::readAsArrayBuffer): Use ExceptionOr.
1622 (WebCore::FileReaderSync::readAsBinaryString): Ditto.
1623 (WebCore::FileReaderSync::readAsText): Ditto.
1624 (WebCore::FileReaderSync::readAsDataURL): Ditto.
1625 (WebCore::FileReaderSync::startLoading): Ditto.
1626 (WebCore::FileReaderSync::startLoadingString): Added. Helper to cut down on
1627 repeated code in functions above.
1628 * fileapi/FileReaderSync.h: Updated for above changes.
1629 * fileapi/FileReaderSync.idl: Use non-legacy exceptions.
1631 * page/Base64Utilities.cpp:
1632 (WebCore::Base64Utilities::btoa): Use ExceptionOr.
1633 (WebCore::Base64Utilities::atob): Ditto.
1634 * page/Base64Utilities.h: Updated for above changes.
1636 * page/DOMWindow.cpp:
1637 (WebCore::DOMWindow::navigator): Pass a reference to the frame.
1638 (WebCore::DOMWindow::postMessage): Use ExceptionOr when calling
1639 MessagePort::disentanglePorts. Also udpated for changes to the
1642 * page/Navigator.cpp:
1643 (WebCore::Navigator::Navigator): Take a reference.
1644 (WebCore::shouldHideFourDot): Ditto
1645 (WebCore::Navigator::appVersion): Pass a reference.
1646 (WebCore::Navigator::plugins): Return a reference.
1647 (WebCore::Navigator::mimeTypes): Ditto.
1648 * page/Navigator.h: Updated for above changes. Also marked the
1649 class final and moved derivation from RefCounted to NavigatorBase.
1651 * page/NavigatorBase.h: Addded derivation from RefCounted since
1652 both derived classes want that, and the destructor is already virtual.
1654 * page/WindowOrWorkerGlobalScope.idl: Use non-legacy exceptions.
1656 * page/WorkerNavigator.cpp:
1657 (WebCore::WorkerNavigator::~WorkerNavigator): Deleted.
1659 * page/WorkerNavigator.h: Moved derivation from RefCounted to
1660 NavigatorBase. Also marked class final.
1662 * workers/AbstractWorker.cpp:
1663 (WebCore::AbstractWorker::resolveURL): Use ExceptionOr.
1664 * workers/AbstractWorker.h: Updated for above changes.
1666 * workers/DedicatedWorkerGlobalScope.cpp:
1667 (WebCore::DedicatedWorkerGlobalScope::create): Use RefPtr&&
1668 instead of PassRefPtr.
1669 (WebCore::DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope):
1671 (WebCore::DedicatedWorkerGlobalScope::postMessage): Use ExceptionOr.
1672 (WebCore::DedicatedWorkerGlobalScope::importScripts): Ditto.
1673 * workers/DedicatedWorkerGlobalScope.h: Updated for above changes.
1674 * workers/DedicatedWorkerGlobalScope.idl: Use non-legacy exceptions.
1676 * workers/Worker.cpp:
1677 (WebCore::Worker::create): Use ExceptionOr.
1678 (WebCore::Worker::postMessage): Ditto.
1679 * workers/Worker.h: Updated for above changes.
1680 * workers/Worker.idl: Use non-legacy exception.
1682 * workers/WorkerGlobalScope.cpp:
1683 (WebCore::WorkerGlobalScope::WorkerGlobalScope): Moved initialization
1684 of m_closing to class definition.
1685 (WebCore::WorkerGlobalScope::~WorkerGlobalScope): Removed call to
1686 deleted notifyObserversOfStop function.
1687 (WebCore::WorkerGlobalScope::importScripts): Use ExceptionOr. Also use
1688 reserveInitialCapacity and uncheckedAppend to build a vector.
1689 (WebCore::WorkerGlobalScope::addConsoleMessage): Use an rvalue reference.
1690 Also moved the body of one of the addMessageToWorkerConsole overloads into
1691 one of the overloads of this function, and changed the other to call addMessage.
1692 (WebCore::WorkerGlobalScope::addMessage): Moved the body of the other
1693 addMessageToWorkerConsole here.
1694 (WebCore::WorkerGlobalScope::addMessageToWorkerConsole): Deleted.
1695 (WebCore::WorkerGlobalScope::Observer::Observer): Deleted.
1696 (WebCore::WorkerGlobalScope::Observer::~Observer): Deleted.
1697 (WebCore::WorkerGlobalScope::Observer::stopObserving): Deleted.
1698 (WebCore::WorkerGlobalScope::registerObserver): Deleted.
1699 (WebCore::WorkerGlobalScope::unregisterObserver): Deleted.
1700 (WebCore::WorkerGlobalScope::notifyObserversOfStop): Deleted.
1701 * workers/WorkerGlobalScope.h: Removed unneeded includes. Moved many virtual
1702 function overrides into the private section. Marked many functions final instead
1703 of just override. Removed unused Observer class and m_workerObservers set.
1705 * workers/WorkerThread.cpp:
1706 (WebCore::WorkerThread::stop): Removed call to deleted
1707 WorkerGlobalScope::notifyObserversOfStop function.
1709 2016-10-21 Antti Koivisto <antti@apple.com>
1711 Tighten ComputedStyleExtractor to use Element instead of Node
1712 https://bugs.webkit.org/show_bug.cgi?id=163798
1714 Reviewed by Andreas Kling.
1716 Also make its functions non-const as they may compute style.
1718 * css/CSSComputedStyleDeclaration.cpp:
1719 (WebCore::styleElementForNode):
1720 (WebCore::ComputedStyleExtractor::ComputedStyleExtractor):
1722 If we are called with a Node figure out the style Element in constructor.
1724 (WebCore::ComputedStyleExtractor::getFontSizeCSSValuePreferringKeyword):
1725 (WebCore::ComputedStyleExtractor::useFixedFontDefaultSize):
1726 (WebCore::ComputedStyleExtractor::styledElement):
1727 (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
1728 (WebCore::CSSComputedStyleDeclaration::copyProperties):
1729 (WebCore::elementOrItsAncestorNeedsStyleRecalc):
1731 Use composed tree iterator for increased correctness in shadow trees.
1733 (WebCore::updateStyleIfNeededForElement):
1734 (WebCore::computeRenderStyleForProperty):
1735 (WebCore::ComputedStyleExtractor::customPropertyValue):
1736 (WebCore::ComputedStyleExtractor::customPropertyText):
1737 (WebCore::ComputedStyleExtractor::propertyValue):
1738 (WebCore::CSSComputedStyleDeclaration::length):
1739 (WebCore::CSSComputedStyleDeclaration::item):
1740 (WebCore::ComputedStyleExtractor::propertyMatches):
1741 (WebCore::ComputedStyleExtractor::copyProperties):
1742 (WebCore::ComputedStyleExtractor::getCSSPropertyValuesForShorthandProperties):
1743 (WebCore::ComputedStyleExtractor::getCSSPropertyValuesForSidesShorthand):
1744 (WebCore::ComputedStyleExtractor::getCSSPropertyValuesForGridShorthand):
1745 (WebCore::ComputedStyleExtractor::copyPropertiesInSet):
1746 (WebCore::CSSComputedStyleDeclaration::getPropertyValue):
1747 (WebCore::ComputedStyleExtractor::getBackgroundShorthandValue):
1748 (WebCore::ComputedStyleExtractor::styledNode): Deleted.
1749 (WebCore::nodeOrItsAncestorNeedsStyleRecalc): Deleted.
1750 (WebCore::updateStyleIfNeededForNode): Deleted.
1751 * css/CSSComputedStyleDeclaration.h:
1752 * css/SVGCSSComputedStyleDeclaration.cpp:
1753 (WebCore::ComputedStyleExtractor::svgPropertyValue):
1754 * editing/EditingStyle.cpp:
1755 (WebCore::EditingStyle::removeEquivalentProperties):
1756 * editing/EditingStyle.h:
1758 2016-10-21 Chris Dumez <cdumez@apple.com>
1760 WebGL2RenderingContext.texSubImage3D() should use a union instead of overloading
1761 https://bugs.webkit.org/show_bug.cgi?id=163792
1763 Reviewed by Darin Adler.
1765 WebGL2RenderingContext.texSubImage3D() should use a union instead of overloading for
1766 - https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7 (for texSubImage3D)
1767 - https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14 (for TexImageSource)
1769 * html/canvas/WebGL2RenderingContext.cpp:
1770 (WebCore::WebGL2RenderingContext::texSubImage3D):
1771 * html/canvas/WebGL2RenderingContext.h:
1772 * html/canvas/WebGL2RenderingContext.idl:
1774 2016-10-21 Zalan Bujtas <zalan@apple.com>
1776 Do not mutate the render tree while collecting selection repaint rects.
1777 https://bugs.webkit.org/show_bug.cgi?id=163800
1778 <rdar://problem/28806886>
1780 Reviewed by David Hyatt.
1782 RenderListItem not only mutates the tree while in layout but it also uses
1783 the old descendant context to find the insertion point.
1784 This patch strictly ensures that we only do it while in layout and never
1785 in other cases such as collecting repaint rects.
1786 This gets redundant when webkit.org/b/163789 is fixed.
1788 Test: fast/lists/crash-when-list-marker-is-moved-during-selection.html
1790 * rendering/RenderListItem.cpp:
1791 (WebCore::RenderListItem::insertOrMoveMarkerRendererIfNeeded):
1793 2016-10-21 Dave Hyatt <hyatt@apple.com>
1795 [CSS Parser] Support horizontal-bt writing mode
1796 https://bugs.webkit.org/show_bug.cgi?id=163797
1798 Reviewed by Zalan Bujtas.
1800 * css/parser/CSSParserFastPaths.cpp:
1801 (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
1803 2016-10-20 Brent Fulgham <bfulgham@apple.com>
1805 [Win][Direct2D] Correct some memory leaks and other minor bugs
1806 https://bugs.webkit.org/show_bug.cgi?id=163769
1808 Reviewed by Alex Christensen.
1810 Several D2D handles were being leaked.
1812 Direct2D sometimes returns an infinite rect containing { -inf, -inf, FloatMax, FloatMax },
1813 sometimes { -FloatMax, -FloatMax, inf, inf }, and various combinations thereof. This caused
1814 most SVG drawing to decide no screen rect was contained in the "infinite rect" so nothing
1817 Tested by existing layout tests.
1819 * platform/graphics/GraphicsContext.h:
1820 * platform/graphics/win/FloatRectDirect2D.cpp:
1821 (WebCore::isInfiniteRect): Recognize various infinite rects in Windows.
1822 (WebCore::FloatRect::FloatRect): Convert a Windows infinite rect to the style
1823 we use inside WebKit.
1824 * platform/graphics/win/FontCascadeDirect2D.cpp:
1825 (WebCore::FontCascade::drawGlyphs): Use cached brushes if possible.
1826 * platform/graphics/win/GlyphPageTreeNodeDirect2D.cpp:
1827 (WebCore::GlyphPage::fill): Don't terminate on this error case.
1828 * platform/graphics/win/GradientDirect2D.cpp:
1829 (WebCore::Gradient::generateGradient): Don't leak gradients.
1830 * platform/graphics/win/GraphicsContextDirect2D.cpp:
1831 (WebCore::GraphicsContextPlatformPrivate::brushWithColor): Added.
1832 (WebCore::GraphicsContext::brushWithColor): Added.
1833 (WebCore::GraphicsContextPlatformPrivate::concatCTM): Perform transform multiplication
1834 in the right order (hint: it's not distributive).
1835 (WebCore::GraphicsContext::drawWithShadow): Use convenience method.
1836 (WebCore::GraphicsContext::fillRect): Ditto.
1837 (WebCore::GraphicsContext::platformFillRoundedRect): Ditto.
1838 (WebCore::GraphicsContext::clearRect): Ditto.
1839 (WebCore::GraphicsContext::setPlatformStrokeColor): Ditto.
1840 (WebCore::GraphicsContext::setPlatformFillColor): Ditto.
1841 * platform/graphics/win/PathDirect2D.cpp:
1842 (WebCore::Path::polygonPathFromPoints): No need to convert manually.
1843 (WebCore::Path::~Path): Don't leak ID2D1Geometry entities.
1844 (WebCore::Path::appendGeometry): Ditto.
1845 (WebCore::Path::createGeometryWithFillMode): Ditto.
1846 (WebCore::Path::Path): Ditto.
1847 (WebCore::Path::operator=): Ditto.
1848 (WebCore::Path::strokeBoundingRect): Provide an implementation.
1849 (WebCore::Path::addRect): No need for manual casting here.
1851 2016-10-21 Wenson Hsieh <wenson_hsieh@apple.com>
1853 Fix minor style issue in the signature of StaticRange::create
1854 https://bugs.webkit.org/show_bug.cgi?id=163786
1855 <rdar://problem/28853079>
1857 Reviewed by Alex Christensen.
1859 Change `Ref<WebCore::Node> &&` to `Ref<Node>&&`.
1861 * dom/StaticRange.cpp:
1862 (WebCore::StaticRange::create):
1864 2016-10-21 Dave Hyatt <hyatt@apple.com>
1866 [CSS Parser] Add support for -webkit-line-box-contain
1867 https://bugs.webkit.org/show_bug.cgi?id=163794
1869 Reviewed by Zalan Bujtas.
1871 * css/parser/CSSPropertyParser.cpp:
1872 (WebCore::consumeLineBoxContain):
1873 (WebCore::CSSPropertyParser::parseSingleValue):
1875 2016-10-21 Dave Hyatt <hyatt@apple.com>
1877 [CSS Parser] Add support for @-webkit-region rules
1878 https://bugs.webkit.org/show_bug.cgi?id=163787
1880 Reviewed by Zalan Bujtas.
1882 * css/StyleRule.cpp:
1883 (WebCore::StyleRuleRegion::StyleRuleRegion):
1885 * css/parser/CSSAtRuleID.cpp:
1886 (WebCore::cssAtRuleID):
1887 * css/parser/CSSAtRuleID.h:
1888 * css/parser/CSSParserImpl.cpp:
1889 (WebCore::CSSParserImpl::consumeAtRule):
1890 (WebCore::CSSParserImpl::consumePageRule):
1891 (WebCore::CSSParserImpl::consumeRegionRule):
1892 * css/parser/CSSParserImpl.h:
1894 2016-10-21 David Kilzer <ddkilzer@apple.com>
1896 Bug 163757: Use IntSize::unclampedArea() in PDFDocumentImage::updateCachedImageIfNeeded()
1897 <https://webkit.org/b/163757>
1899 Reviewed by Brent Fulgham.
1901 No new tests since there is no change in nominal behavior.
1903 * platform/graphics/cg/PDFDocumentImage.cpp:
1904 (WebCore::PDFDocumentImage::updateCachedImageIfNeeded): Use
1905 IntSize::unclampedArea() where manual calculations were used
1906 previously. Also gets rid of more safeCast<size_t>() use.
1908 2016-10-21 Chris Dumez <cdumez@apple.com>
1910 [Web IDL] Support unions in our overload resolution algorithm
1911 https://bugs.webkit.org/show_bug.cgi?id=163764
1913 Reviewed by Darin Adler.
1915 Support unions in our overload resolution algorithm as per:
1916 - https://heycam.github.io/webidl/#es-overloads
1917 - https://heycam.github.io/webidl/#dfn-distinguishable
1919 * bindings/scripts/CodeGeneratorJS.pm:
1920 (IsIDLTypeDistinguishableWithUnionForOverloadResolution):
1921 (AreTypesDistinguishableForOverloadResolution):
1922 (GetOverloadThatMatches):
1923 (GenerateOverloadedFunctionOrConstructor):
1924 * bindings/scripts/test/JS/JSTestObj.cpp:
1925 * bindings/scripts/test/TestObj.idl:
1927 2016-10-21 Chris Dumez <cdumez@apple.com>
1929 AudioNode.connect(): First parameter should not be nullable
1930 https://bugs.webkit.org/show_bug.cgi?id=163773
1932 Reviewed by Darin Adler.
1934 AudioNode.connect()'s first parameter should not be nullable:
1935 - https://webaudio.github.io/web-audio-api/#idl-def-AudioNode.
1937 We were throwing a SYNTAX_ERR when passing null, we now throw
1938 a TypeError instead.
1940 No new tests, updated existing test.
1942 * Modules/webaudio/AudioBasicInspectorNode.cpp:
1943 (WebCore::AudioBasicInspectorNode::connect):
1944 * Modules/webaudio/AudioBasicInspectorNode.h:
1945 * Modules/webaudio/AudioNode.cpp:
1946 (WebCore::AudioNode::connect):
1947 * Modules/webaudio/AudioNode.h:
1948 * Modules/webaudio/AudioNode.idl:
1950 2016-10-21 Wenson Hsieh <wenson_hsieh@apple.com>
1952 Implement InputEvent.getTargetRanges() for the input events spec
1953 https://bugs.webkit.org/show_bug.cgi?id=162947
1954 <rdar://problem/28853079>
1956 Reviewed by Darin Adler.
1958 Implements InputEvent.getTargetRanges(). See individual method changes below for more details. Adds a new hook
1959 for subclasses of CompositeEditCommand to vend a list of target StaticRanges when retrieving target ranges for
1960 an editing command on a contenteditable area.
1962 Tests: fast/events/before-input-delete-empty-list-target-ranges.html
1963 fast/events/before-input-delete-text-target-ranges.html
1964 fast/events/before-input-replace-text-target-ranges.html
1967 * DerivedSources.make:
1968 * WebCore.xcodeproj/project.pbxproj:
1970 Add StaticRange.idl, StaticRange.cpp and StaticRange.h.
1972 * bindings/generic/RuntimeEnabledFeatures.h:
1973 (WebCore::RuntimeEnabledFeatures::setInputEventsEnabled):
1974 (WebCore::RuntimeEnabledFeatures::inputEventsEnabled):
1976 Add a new runtime bindings flag for InputEvents and guard both InputEvent and StaticRange behind it.
1978 * dom/DOMAllInOne.cpp:
1979 * dom/InputEvent.cpp:
1980 (WebCore::InputEvent::InputEvent):
1982 * dom/InputEvent.idl:
1983 * dom/StaticRange.cpp: Copied from Source/WebCore/dom/InputEvent.cpp.
1984 (WebCore::StaticRange::StaticRange):
1985 (WebCore::StaticRange::create):
1986 (WebCore::StaticRange::createFromRange):
1988 Convenience method for creating a StaticRange from a Range's start/end container and offset.
1990 (WebCore::StaticRange::startContainer):
1991 (WebCore::StaticRange::endContainer):
1992 (WebCore::StaticRange::collapsed):
1993 * dom/StaticRange.h: Copied from Source/WebCore/dom/InputEvent.cpp.
1994 (WebCore::StaticRange::startOffset):
1995 (WebCore::StaticRange::endOffset):
1996 * dom/StaticRange.idl: Copied from Source/WebCore/editing/ReplaceRangeWithTextCommand.h.
1997 * editing/CompositeEditCommand.cpp:
1998 (WebCore::CompositeEditCommand::willApplyCommand):
1999 (WebCore::CompositeEditCommand::targetRanges):
2001 Virtual method that returns a list of target ranges which are associated with this command.
2003 (WebCore::CompositeEditCommand::targetRangesForBindings):
2005 Non-virtual method that calls the above targetRanges(). Takes whether or not the CompositeEditCommand is editing
2006 a textarea or plain text input into account.
2008 (WebCore::CompositeEditCommand::moveParagraphs):
2009 * editing/CompositeEditCommand.h:
2010 * editing/EditCommand.cpp:
2011 (WebCore::EditCommand::frame):
2012 * editing/EditCommand.h:
2013 (WebCore::EditCommand::document):
2014 * editing/Editor.cpp:
2015 (WebCore::dispatchBeforeInputEvent):
2016 (WebCore::dispatchInputEvent):
2017 (WebCore::dispatchBeforeInputEvents):
2019 Changed the `beforeinput` event dispatch to use the regular Node::dispatchEvent instead of dispatchScopedEvent.
2020 This is because if the page prevents the `beforeinput` event, we need to know immediately in order to bail from
2023 (WebCore::dispatchInputEvents):
2024 (WebCore::Editor::willApplyEditing):
2026 Added a list of static ranges as a parameter when calling on the Editor to dispatch `beforeinput` events.
2027 By default, this uses the composite edit command's targetRangesForBindings(), though it may be special cased
2028 by subclasses of CompositeEditCommand (see ReplaceRangeWithTextCommand, SpellingCorrectionCommand, and
2032 * editing/ReplaceRangeWithTextCommand.cpp:
2033 (WebCore::ReplaceRangeWithTextCommand::targetRanges):
2034 * editing/ReplaceRangeWithTextCommand.h:
2035 * editing/SpellingCorrectionCommand.cpp:
2036 (WebCore::SpellingCorrectionCommand::targetRanges):
2037 * editing/SpellingCorrectionCommand.h:
2038 * editing/TypingCommand.cpp:
2039 (WebCore::editActionIsDeleteByTyping):
2040 (WebCore::TypingCommand::shouldDeferWillApplyCommandUntilAddingTypingCommand):
2041 (WebCore::TypingCommand::willApplyCommand):
2042 (WebCore::TypingCommand::willAddTypingToOpenCommand):
2043 (WebCore::TypingCommand::deleteKeyPressed):
2044 (WebCore::TypingCommand::forwardDeleteKeyPressed):
2046 Moves the firing of the `beforeinput` until after the selection range to delete has been computed.
2048 * editing/TypingCommand.h:
2050 2016-10-21 Antti Koivisto <antti@apple.com>
2052 Style resolver should be updated lazily
2053 https://bugs.webkit.org/show_bug.cgi?id=163721
2055 Reviewed by Andreas Kling.
2057 Currently when stylesheets change in some way we generally update style resolvers and
2058 invalidate style immediately. We should do this lazily to avoid unnecessary work.
2060 Also improve naming of the stylesheet invalidation functions and use more optimal functions in some places.
2062 * css/CSSComputedStyleDeclaration.cpp:
2063 (WebCore::updateStyleIfNeededForNode):
2064 * css/CSSStyleSheet.cpp:
2065 (WebCore::CSSStyleSheet::didMutateRules):
2066 (WebCore::CSSStyleSheet::didMutate):
2067 (WebCore::CSSStyleSheet::setDisabled):
2068 * css/StyleResolver.cpp:
2069 (WebCore::StyleResolver::StyleResolver):
2071 Initialize root style font with null font selector.
2072 This avoids hitting a CSSFontSelector assert in fast/media/mq-relative-constraints-08.html where
2073 media query evaluation requires font information before it is ready.
2074 Exposed by increased laziness in this patch.
2077 (WebCore::Document::setContentLanguage):
2078 (WebCore::Document::updateLayoutIgnorePendingStylesheets):
2079 (WebCore::Document::isPageBoxVisible):
2080 (WebCore::Document::pageSizeAndMarginsInPixels):
2081 (WebCore::Document::processHttpEquiv):
2082 (WebCore::Document::setSelectedStylesheetSet):
2083 (WebCore::Document::didInsertInDocumentShadowRoot):
2084 (WebCore::Document::didRemoveInDocumentShadowRoot):
2086 (WebCore::Document::inDocumentShadowRoots):
2088 Track all shadow roots in the document. This allows us to find and flush style scopes cheaply.
2091 (WebCore::Element::computedStyle):
2092 * dom/ExtensionStyleSheets.cpp:
2093 (WebCore::ExtensionStyleSheets::ExtensionStyleSheets):
2094 (WebCore::ExtensionStyleSheets::clearPageUserSheet):
2095 (WebCore::ExtensionStyleSheets::updatePageUserSheet):
2096 (WebCore::ExtensionStyleSheets::invalidateInjectedStyleSheetCache):
2097 (WebCore::ExtensionStyleSheets::addUserStyleSheet):
2098 (WebCore::ExtensionStyleSheets::addAuthorStyleSheetForTesting):
2099 (WebCore::ExtensionStyleSheets::addDisplayNoneSelector):
2100 (WebCore::ExtensionStyleSheets::maybeAddContentExtensionSheet):
2101 (WebCore::ExtensionStyleSheets::styleResolverChangedTimerFired): Deleted.
2103 Since updates are now done lazily we don't need a special timer for extension stylesheets.
2105 * dom/ExtensionStyleSheets.h:
2106 * dom/ProcessingInstruction.cpp:
2107 (WebCore::ProcessingInstruction::checkStyleSheet):
2108 (WebCore::ProcessingInstruction::sheetLoaded):
2109 (WebCore::ProcessingInstruction::removedFrom):
2110 * dom/ShadowRoot.cpp:
2111 (WebCore::ShadowRoot::ShadowRoot):
2112 (WebCore::ShadowRoot::insertedInto):
2113 (WebCore::ShadowRoot::removedFrom):
2114 (WebCore::ShadowRoot::styleScope):
2116 * html/HTMLLinkElement.cpp:
2117 (WebCore::HTMLLinkElement::setDisabledState):
2118 (WebCore::HTMLLinkElement::parseAttribute):
2119 (WebCore::HTMLLinkElement::process):
2120 (WebCore::HTMLLinkElement::removePendingSheet):
2121 * html/HTMLStyleElement.cpp:
2122 (WebCore::HTMLStyleElement::parseAttribute):
2123 * inspector/InspectorCSSAgent.cpp:
2124 (WebCore::InspectorCSSAgent::createInspectorStyleSheetForDocument):
2125 (WebCore::InspectorCSSAgent::forcePseudoState):
2126 (WebCore::InspectorCSSAgent::resetPseudoStates):
2127 * inspector/InspectorPageAgent.cpp:
2128 (WebCore::InspectorPageAgent::setEmulatedMedia):
2130 (WebCore::Frame::setPrinting):
2131 * page/FrameView.cpp:
2132 (WebCore::FrameView::layout):
2133 (WebCore::FrameView::setPagination):
2134 (WebCore::FrameView::setViewportSizeForCSSViewportUnits):
2136 (WebCore::Page::setViewMode):
2137 (WebCore::Page::setNeedsRecalcStyleInAllFrames):
2138 (WebCore::Page::invalidateInjectedStyleSheetCacheInAllFrames):
2139 * style/StyleScope.cpp:
2140 (WebCore::Style::Scope::setPreferredStylesheetSetName):
2141 (WebCore::Style::Scope::setSelectedStylesheetSetName):
2142 (WebCore::Style::Scope::removePendingSheet):
2143 (WebCore::Style::Scope::removeStyleSheetCandidateNode):
2144 (WebCore::Style::Scope::activeStyleSheetsForInspector):
2145 (WebCore::Style::Scope::flushPendingUpdate):
2147 Also flush descendant shadow roots.
2149 (WebCore::Style::Scope::scheduleUpdate):
2150 (WebCore::Style::Scope::didChangeActiveStyleSheetCandidates):
2154 (WebCore::Style::Scope::didChangeStyleSheetContents):
2158 (WebCore::Style::Scope::didChangeStyleSheetEnvironment):
2160 Environment changes also affect author shadow roots.
2162 (WebCore::Style::Scope::styleSheetsForStyleSheetList):
2163 (WebCore::Style::Scope::scheduleActiveSetUpdate): Deleted.
2164 (WebCore::Style::Scope::didChangeCandidatesForActiveSet): Deleted.
2165 (WebCore::Style::Scope::didChangeContentsOrInterpretation): Deleted.
2167 Improved naming of these and split didChangeContentsOrInterpretation into two separate functions.
2169 * style/StyleScope.h:
2170 (WebCore::Style::Scope::styleSheetsForStyleSheetList): Deleted.
2171 (WebCore::Style::Scope::setPreferredStylesheetSetName): Deleted.
2172 (WebCore::Style::Scope::setSelectedStylesheetSetName): Deleted.
2173 * svg/SVGFontFaceElement.cpp:
2174 (WebCore::SVGFontFaceElement::rebuildFontFace):
2175 (WebCore::SVGFontFaceElement::removedFrom):
2176 * testing/Internals.cpp:
2177 (WebCore::Internals::resetToConsistentState):
2179 Ensure that cationsStyleSheetOverride really becomes empty. Some tests rely on not having suprise
2180 inserted stylesheets. Previously this was racy and the patch affected order of things.
2182 (WebCore::Internals::styleChangeType):
2183 * xml/XMLTreeViewer.cpp:
2184 (WebCore::XMLTreeViewer::transformDocumentToTreeView):
2185 * xml/parser/XMLDocumentParser.cpp:
2186 (WebCore::XMLDocumentParser::end):
2187 * xml/parser/XMLDocumentParserLibxml2.cpp:
2188 (WebCore::XMLDocumentParser::doEnd):
2190 2016-10-21 Xabier Rodriguez Calvar <calvaris@igalia.com> and Adam Bergkvist <adam.bergkvist@ericsson.com>
2192 WebRTC: [OpenWebRTC] Move SDPProcessorScriptResource(Gtk) to openwebrtc directory
2193 https://bugs.webkit.org/show_bug.cgi?id=163778
2195 Reviewed by Philippe Normand.
2197 Move SDPProcessorScriptResourceGtk from the platform gtk directory to the port generic
2198 openwebrtc directory to make it usable by other ports. Also drop the Gtk-suffix.
2200 No change of behavior.
2202 * PlatformGTK.cmake:
2203 * platform/mediastream/gtk/SDPProcessorScriptResourceGtk.cpp:
2204 (WebCore::SDPProcessorScriptResource::scriptString): Deleted.
2205 * platform/mediastream/openwebrtc/SDPProcessorScriptResource.cpp: Renamed from Source/WebCore/platform/mediastream/gtk/SDPProcessorScriptResourceGtk.cpp.
2206 (WebCore::SDPProcessorScriptResource::scriptString):
2208 2016-10-21 Miguel Gomez <magomez@igalia.com>
2210 [GTK] Several tests crashing on debug bot in (anonymous namespace)::MediaPlayerPrivateGStreamerBase::repaint
2211 https://bugs.webkit.org/show_bug.cgi?id=163511
2213 Reviewed by Carlos Garcia Campos.
2215 Perform the video repaint in the main thread when accelerated compositing is disabled. Added a new method to
2216 MediaPlayerClient to get whether accelerated compositing is enabled from the MediaPlayer. This is needed
2217 because mediaPlayerAcceleratedCompositingEnabled() will return false while HTMLMediaElement doesn't have a
2218 RenderVideo, even when accelerated compositing is enabled.
2220 Covered by existent tests.
2222 * html/HTMLMediaElement.cpp:
2223 (WebCore::HTMLMediaElement::mediaPlayerAcceleratedCompositingEnabled):
2224 * html/HTMLMediaElement.h:
2225 * platform/graphics/MediaPlayer.h:
2226 (WebCore::MediaPlayerClient::mediaPlayerAcceleratedCompositingEnabled):
2227 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2228 (WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase):
2229 (WebCore::MediaPlayerPrivateGStreamerBase::repaint):
2230 (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
2231 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
2233 2016-10-21 Adam Bergkvist <adam.bergkvist@ericsson.com>
2235 WebRTC: [GTK] Add MediaEndpointOwr - an OpenWebRTC WebRTC backend
2236 https://bugs.webkit.org/show_bug.cgi?id=163327
2238 Reviewed by Philippe Normand.
2240 Add MediaEndpointOwr which is a MediaEndpoint implementation (WebRTC backend) based on
2241 OpenWebRTC [1]. The WebRTC backend can be tested with a manual test. Automatic testing
2242 is still done with MockMediaEndpoint.
2244 [1] http://www.openwebrtc.org/
2246 Testing: Added manual test (webrtc-one-tab-p2p.html)
2249 * platform/GStreamer.cmake:
2250 * platform/mediastream/openwebrtc/MediaEndpointOwr.cpp: Added.
2251 (WebCore::createMediaEndpointOwr):
2252 (WebCore::MediaEndpointOwr::MediaEndpointOwr):
2253 (WebCore::MediaEndpointOwr::~MediaEndpointOwr):
2254 (WebCore::MediaEndpointOwr::setConfiguration):
2255 (WebCore::cryptoDataCallback):
2256 (WebCore::MediaEndpointOwr::generateDtlsInfo):
2257 (WebCore::MediaEndpointOwr::getDefaultAudioPayloads):
2258 (WebCore::MediaEndpointOwr::getDefaultVideoPayloads):
2259 (WebCore::payloadsContainType):
2260 (WebCore::MediaEndpointOwr::filterPayloads):
2261 (WebCore::MediaEndpointOwr::updateReceiveConfiguration):
2262 (WebCore::findRtxPayload):
2263 (WebCore::MediaEndpointOwr::updateSendConfiguration):
2264 (WebCore::MediaEndpointOwr::addRemoteCandidate):
2265 (WebCore::MediaEndpointOwr::replaceMutedRemoteSourceMid):
2266 (WebCore::MediaEndpointOwr::createMutedRemoteSource):
2267 (WebCore::MediaEndpointOwr::replaceSendSource):
2268 (WebCore::MediaEndpointOwr::stop):
2269 (WebCore::MediaEndpointOwr::transceiverIndexForSession):
2270 (WebCore::MediaEndpointOwr::sessionMid):
2271 (WebCore::MediaEndpointOwr::matchTransceiverByMid):
2272 (WebCore::MediaEndpointOwr::dispatchNewIceCandidate):
2273 (WebCore::MediaEndpointOwr::dispatchGatheringDone):
2274 (WebCore::MediaEndpointOwr::processIceTransportStateChange):
2275 (WebCore::MediaEndpointOwr::dispatchDtlsFingerprint):
2276 (WebCore::MediaEndpointOwr::unmuteRemoteSource):
2277 (WebCore::MediaEndpointOwr::prepareSession):
2278 (WebCore::MediaEndpointOwr::prepareMediaSession):
2279 (WebCore::parseHelperServerUrl):
2280 (WebCore::MediaEndpointOwr::ensureTransportAgentAndTransceivers):
2281 (WebCore::MediaEndpointOwr::internalAddRemoteCandidate):
2282 (WebCore::gotCandidate):
2283 (WebCore::candidateGatheringDone):
2284 (WebCore::iceConnectionStateChange):
2285 (WebCore::gotIncomingSource):
2286 * platform/mediastream/openwebrtc/MediaEndpointOwr.h: Added.
2287 (WebCore::OwrTransceiver::create):
2288 (WebCore::OwrTransceiver::~OwrTransceiver):
2289 (WebCore::OwrTransceiver::mid):
2290 (WebCore::OwrTransceiver::session):
2291 (WebCore::OwrTransceiver::owrIceState):
2292 (WebCore::OwrTransceiver::setOwrIceState):
2293 (WebCore::OwrTransceiver::gotEndOfRemoteCandidates):
2294 (WebCore::OwrTransceiver::markGotEndOfRemoteCandidates):
2295 (WebCore::OwrTransceiver::OwrTransceiver):
2296 * platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.h:
2297 (WebCore::RealtimeMediaSourceOwr::RealtimeMediaSourceOwr):
2298 (WebCore::RealtimeMediaSourceOwr::swapOutShallowSource):
2299 Add support for an initially muted source. This is used for early
2300 creation of remote sources.
2302 2016-10-21 Javier Fernandez <jfernandez@igalia.com>
2304 [css-grid] Content Alignment broken with indefinite sized grid container
2305 https://bugs.webkit.org/show_bug.cgi?id=163724
2307 Reviewed by Manuel Rego Casasnovas.
2309 The Grid Tracks sizing algorithm receives as parameter the
2310 available space to be used as space for tracks. We hold a variable
2311 to store the remaining free space for each dimension.
2313 When the grid container size is indefinite we can't compute the
2314 available free space after computing track sizes until such
2315 indefinite size is resolved.
2317 No new tests, just added some additional test cases.
2319 * rendering/RenderGrid.cpp:
2320 (WebCore::RenderGrid::layoutBlock): Compute freeSpace for Rows
2321 after doing layout and resolving the indefinite height.
2323 2016-10-21 Jer Noble <jer.noble@apple.com>
2325 CRASH in SourceBuffer::sourceBufferPrivateDidReceiveSample + 2169
2326 https://bugs.webkit.org/show_bug.cgi?id=163735
2328 Reviewed by Eric Carlson.
2330 Test: media/media-source/media-source-sample-wrong-track-id.html
2332 When SourceBuffer receives a sample in sourceBufferPrivateDidReceiveSample() containing
2333 a trackID not previously seen in an initialization segment, it creates a default TrackBuffer
2334 object to contain that track's samples. One of the fields in TrackBuffer, description, is
2335 normally filled out when an initialization segment is received, but with this default
2336 TrackBuffer, it's still null when it's checked later in sourceBufferPrivateDidReceiveSample().
2338 Rather than adding a null-check on trackBuffer.description, drop any sample that has a
2339 trackID which was not present during a previous initialization segment.
2341 * Modules/mediasource/SourceBuffer.cpp:
2342 (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
2344 2016-10-20 Carlos Garcia Campos <cgarcia@igalia.com>
2346 [GTK] Configures but fails to link with ENABLE_OPENGL=OFF
2347 https://bugs.webkit.org/show_bug.cgi?id=163449
2349 Reviewed by Michael Catanzaro.
2351 Only define sharingGLContext in PlatformDisplay if EGL or GLX are enabled.
2353 * platform/graphics/PlatformDisplay.cpp:
2354 * platform/graphics/PlatformDisplay.h:
2355 * platform/graphics/wayland/PlatformDisplayWayland.cpp:
2356 (WebCore::PlatformDisplayWayland::initialize):
2357 * platform/graphics/x11/PlatformDisplayX11.cpp:
2358 (WebCore::PlatformDisplayX11::~PlatformDisplayX11):
2360 2016-10-20 Filip Pizlo <fpizlo@apple.com>
2362 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
2363 https://bugs.webkit.org/show_bug.cgi?id=163738
2365 Reviewed by Geoffrey Garen.
2367 No new tests because no change in behavior.
2369 * bindings/js/GCController.cpp:
2370 (WebCore::GCController::garbageCollectNow):
2372 2016-10-20 Chris Dumez <cdumez@apple.com>
2374 [Bindings] Start using signature->idlType instead of signature->type in the overload resolution code
2375 https://bugs.webkit.org/show_bug.cgi?id=163767
2377 Reviewed by Darin Adler.
2379 Start using signature->idlType instead of signature->type in the overload resolution code
2380 to prepare for union type support.
2382 * bindings/scripts/CodeGeneratorJS.pm:
2383 (ComputeEffectiveOverloadSet):
2384 (AreTypesDistinguishableForOverloadResolution):
2385 (GetDistinguishingArgumentIndex):
2386 (GetOverloadThatMatches):
2387 (GenerateOverloadedFunctionOrConstructor):
2389 2016-10-20 Myles C. Maxfield <mmaxfield@apple.com>
2391 Implement WebGL2 bufferData() and bufferSubData() methods
2392 https://bugs.webkit.org/show_bug.cgi?id=163759
2394 Reviewed by Dean Jackson.
2396 These new overloads simply clip the input array buffer.
2398 Test: fast/canvas/webgl/bufferData-offset-length.html
2400 * html/canvas/WebGL2RenderingContext.cpp:
2401 (WebCore::WebGL2RenderingContext::bufferData):
2402 (WebCore::WebGL2RenderingContext::bufferSubData):
2403 * html/canvas/WebGL2RenderingContext.h:
2404 * html/canvas/WebGL2RenderingContext.idl:
2406 2016-10-20 Chris Dumez <cdumez@apple.com>
2408 "Download Linked File" context menu action should use 'download' attribute as suggested filename
2409 https://bugs.webkit.org/show_bug.cgi?id=163742
2410 <rdar://problem/28840734>
2412 Reviewed by Darin Adler.
2414 Add convenience method to HitTestResult to return the URL element's
2417 * rendering/HitTestResult.cpp:
2418 (WebCore::HitTestResult::URLElementDownloadAttribute):
2419 * rendering/HitTestResult.h:
2421 2016-10-20 Nan Wang <n_wang@apple.com>
2423 AX: VoiceOver is not detecting ARIA treeview if it contains role="presentation"
2424 https://bugs.webkit.org/show_bug.cgi?id=163763
2426 Reviewed by Chris Fleizach.
2428 Test: accessibility/mac/aria-tree-with-presentation-role.html
2430 Web authors sometimes use presentation role in the aria tree to hide elements. We should
2431 consider this a valid case if they specify tree items and groups correctly.
2433 * accessibility/AccessibilityNodeObject.cpp:
2434 (WebCore::AccessibilityNodeObject::hierarchicalLevel):
2435 * accessibility/AccessibilityTree.cpp:
2436 (WebCore::AccessibilityTree::nodeHasTreeItemChild):
2437 (WebCore::AccessibilityTree::isTreeValid):
2438 * accessibility/AccessibilityTree.h:
2440 2016-10-20 Myles C. Maxfield <mmaxfield@apple.com>
2442 Many WebGL functions which don't throw are marked as possibly throwing
2443 https://bugs.webkit.org/show_bug.cgi?id=163747
2445 Reviewed by Dean Jackson.
2447 Mechanically remove the exception code.
2449 No new tests because there is no behavior change.
2451 * bindings/js/JSWebGLRenderingContextBaseCustom.cpp:
2452 (WebCore::getObjectParameter):
2453 (WebCore::JSWebGLRenderingContextBase::getAttachedShaders):
2454 (WebCore::JSWebGLRenderingContextBase::getProgramParameter):
2455 (WebCore::JSWebGLRenderingContextBase::getShaderParameter):
2456 (WebCore::JSWebGLRenderingContextBase::getUniform):
2457 (WebCore::dataFunctionf):
2458 (WebCore::dataFunctioni):
2459 (WebCore::dataFunctionMatrix):
2460 * html/canvas/WebGL2RenderingContext.cpp:
2461 (WebCore::WebGL2RenderingContext::texSubImage2D):
2462 * html/canvas/WebGLRenderingContext.cpp:
2463 (WebCore::WebGLRenderingContext::texSubImage2D):
2464 * html/canvas/WebGLRenderingContextBase.cpp:
2465 (WebCore::WebGLRenderingContextBase::activeTexture):
2466 (WebCore::WebGLRenderingContextBase::attachShader):
2467 (WebCore::WebGLRenderingContextBase::bindAttribLocation):
2468 (WebCore::WebGLRenderingContextBase::bindBuffer):
2469 (WebCore::WebGLRenderingContextBase::bindFramebuffer):
2470 (WebCore::WebGLRenderingContextBase::bindRenderbuffer):
2471 (WebCore::WebGLRenderingContextBase::bindTexture):
2472 (WebCore::WebGLRenderingContextBase::bufferData):
2473 (WebCore::WebGLRenderingContextBase::bufferSubData):
2474 (WebCore::WebGLRenderingContextBase::compileShader):
2475 (WebCore::WebGLRenderingContextBase::createShader):
2476 (WebCore::WebGLRenderingContextBase::detachShader):
2477 (WebCore::WebGLRenderingContextBase::disableVertexAttribArray):
2478 (WebCore::WebGLRenderingContextBase::drawArrays):
2479 (WebCore::WebGLRenderingContextBase::drawElements):
2480 (WebCore::WebGLRenderingContextBase::enableVertexAttribArray):
2481 (WebCore::WebGLRenderingContextBase::framebufferRenderbuffer):
2482 (WebCore::WebGLRenderingContextBase::framebufferTexture2D):
2483 (WebCore::WebGLRenderingContextBase::getActiveAttrib):
2484 (WebCore::WebGLRenderingContextBase::getActiveUniform):
2485 (WebCore::WebGLRenderingContextBase::getAttachedShaders):
2486 (WebCore::WebGLRenderingContextBase::getBufferParameter):
2487 (WebCore::WebGLRenderingContextBase::getProgramParameter):
2488 (WebCore::WebGLRenderingContextBase::getProgramInfoLog):
2489 (WebCore::WebGLRenderingContextBase::getRenderbufferParameter):
2490 (WebCore::WebGLRenderingContextBase::getShaderParameter):
2491 (WebCore::WebGLRenderingContextBase::getShaderInfoLog):
2492 (WebCore::WebGLRenderingContextBase::getShaderPrecisionFormat):
2493 (WebCore::WebGLRenderingContextBase::getShaderSource):
2494 (WebCore::WebGLRenderingContextBase::getTexParameter):
2495 (WebCore::WebGLRenderingContextBase::getUniform):
2496 (WebCore::WebGLRenderingContextBase::getUniformLocation):
2497 (WebCore::WebGLRenderingContextBase::getVertexAttrib):
2498 (WebCore::WebGLRenderingContextBase::linkProgram):
2499 (WebCore::WebGLRenderingContextBase::readPixels):
2500 (WebCore::WebGLRenderingContextBase::shaderSource):
2501 (WebCore::WebGLRenderingContextBase::videoFrameToImage):
2502 (WebCore::WebGLRenderingContextBase::texImage2D):
2503 (WebCore::WebGLRenderingContextBase::uniform1f):
2504 (WebCore::WebGLRenderingContextBase::uniform1fv):
2505 (WebCore::WebGLRenderingContextBase::uniform1i):
2506 (WebCore::WebGLRenderingContextBase::uniform1iv):
2507 (WebCore::WebGLRenderingContextBase::uniform2f):
2508 (WebCore::WebGLRenderingContextBase::uniform2fv):
2509 (WebCore::WebGLRenderingContextBase::uniform2i):
2510 (WebCore::WebGLRenderingContextBase::uniform2iv):
2511 (WebCore::WebGLRenderingContextBase::uniform3f):
2512 (WebCore::WebGLRenderingContextBase::uniform3fv):
2513 (WebCore::WebGLRenderingContextBase::uniform3i):
2514 (WebCore::WebGLRenderingContextBase::uniform3iv):
2515 (WebCore::WebGLRenderingContextBase::uniform4f):
2516 (WebCore::WebGLRenderingContextBase::uniform4fv):
2517 (WebCore::WebGLRenderingContextBase::uniform4i):
2518 (WebCore::WebGLRenderingContextBase::uniform4iv):
2519 (WebCore::WebGLRenderingContextBase::uniformMatrix2fv):
2520 (WebCore::WebGLRenderingContextBase::uniformMatrix3fv):
2521 (WebCore::WebGLRenderingContextBase::uniformMatrix4fv):
2522 (WebCore::WebGLRenderingContextBase::useProgram):
2523 (WebCore::WebGLRenderingContextBase::validateProgram):
2524 (WebCore::WebGLRenderingContextBase::vertexAttribPointer):
2525 (WebCore::WebGLRenderingContextBase::restoreCurrentFramebuffer):
2526 (WebCore::WebGLRenderingContextBase::restoreCurrentTexture2D):
2527 * html/canvas/WebGLRenderingContextBase.h:
2528 * html/canvas/WebGLRenderingContextBase.idl:
2530 2016-10-19 Myles C. Maxfield <mmaxfield@apple.com>
2532 [macOS] [iOS] Disable variation fonts on macOS El Capitan and iOS 9
2533 https://bugs.webkit.org/show_bug.cgi?id=163374
2535 Reviewed by Darin Adler.
2537 Because of platform lack of support for variations in in-memory fonts,
2538 this feature should be disabled on the affected OSes.
2540 No tests because there is no behavior change (on the relevant platforms).
2542 * Configurations/FeatureDefines.xcconfig:
2544 2016-10-20 Brady Eidson <beidson@apple.com>
2546 IndexedDB 2.0: Support IDBObjectStore name assignment.
2547 <rdar://problem/28806931> and https://bugs.webkit.org/show_bug.cgi?id=163749
2549 Reviewed by Alex Christensen.
2551 Tests: storage/indexeddb/modern/objectstore-rename-1-private.html
2552 storage/indexeddb/modern/objectstore-rename-1.html
2554 Touches a *lot* of code sites, but none of them are particularly interesting.
2555 They are all just getting the new name spread out to all of the various objects that need it.
2557 * Modules/indexeddb/IDBDatabase.cpp:
2558 (WebCore::IDBDatabase::renameObjectStore):
2559 * Modules/indexeddb/IDBDatabase.h:
2561 * Modules/indexeddb/IDBObjectStore.cpp:
2562 (WebCore::IDBObjectStore::setName):
2563 * Modules/indexeddb/IDBObjectStore.h:
2564 * Modules/indexeddb/IDBObjectStore.idl:
2566 * Modules/indexeddb/IDBTransaction.cpp:
2567 (WebCore::IDBTransaction::renameObjectStore):
2568 (WebCore::IDBTransaction::renameObjectStoreOnServer):
2569 (WebCore::IDBTransaction::didRenameObjectStoreOnServer):
2570 * Modules/indexeddb/IDBTransaction.h:
2572 * Modules/indexeddb/client/IDBConnectionProxy.cpp:
2573 (WebCore::IDBClient::IDBConnectionProxy::renameObjectStore):
2574 * Modules/indexeddb/client/IDBConnectionProxy.h:
2576 * Modules/indexeddb/client/IDBConnectionToServer.cpp:
2577 (WebCore::IDBClient::IDBConnectionToServer::renameObjectStore):
2578 (WebCore::IDBClient::IDBConnectionToServer::didRenameObjectStore):
2579 * Modules/indexeddb/client/IDBConnectionToServer.h:
2580 * Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
2582 * Modules/indexeddb/server/IDBBackingStore.h:
2584 * Modules/indexeddb/server/IDBConnectionToClient.cpp:
2585 (WebCore::IDBServer::IDBConnectionToClient::didDeleteObjectStore):
2586 (WebCore::IDBServer::IDBConnectionToClient::didRenameObjectStore):
2587 * Modules/indexeddb/server/IDBConnectionToClient.h:
2588 * Modules/indexeddb/server/IDBConnectionToClientDelegate.h:
2590 * Modules/indexeddb/server/IDBServer.cpp:
2591 (WebCore::IDBServer::IDBServer::renameObjectStore):
2592 * Modules/indexeddb/server/IDBServer.h:
2594 * Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
2595 (WebCore::IDBServer::MemoryBackingStoreTransaction::objectStoreRenamed):
2596 (WebCore::IDBServer::MemoryBackingStoreTransaction::abort):
2597 * Modules/indexeddb/server/MemoryBackingStoreTransaction.h:
2599 * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
2600 (WebCore::IDBServer::MemoryIDBBackingStore::renameObjectStore):
2601 * Modules/indexeddb/server/MemoryIDBBackingStore.h:
2603 * Modules/indexeddb/server/MemoryObjectStore.h:
2604 (WebCore::IDBServer::MemoryObjectStore::rename):
2606 * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
2607 (WebCore::IDBServer::SQLiteIDBBackingStore::renameObjectStore):
2608 * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
2610 * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
2611 (WebCore::IDBServer::UniqueIDBDatabase::renameObjectStore):
2612 (WebCore::IDBServer::UniqueIDBDatabase::performRenameObjectStore):
2613 (WebCore::IDBServer::UniqueIDBDatabase::didPerformRenameObjectStore):
2614 * Modules/indexeddb/server/UniqueIDBDatabase.h:
2616 * Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
2617 (WebCore::IDBServer::UniqueIDBDatabaseConnection::didRenameObjectStore):
2618 * Modules/indexeddb/server/UniqueIDBDatabaseConnection.h:
2620 * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
2621 (WebCore::IDBServer::UniqueIDBDatabaseTransaction::renameObjectStore):
2622 * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:
2624 * Modules/indexeddb/shared/IDBDatabaseInfo.cpp:
2625 (WebCore::IDBDatabaseInfo::renameObjectStore):
2626 * Modules/indexeddb/shared/IDBDatabaseInfo.h:
2628 * Modules/indexeddb/shared/IDBObjectStoreInfo.h:
2629 (WebCore::IDBObjectStoreInfo::rename):
2631 * Modules/indexeddb/shared/IDBResultData.cpp:
2632 (WebCore::IDBResultData::renameObjectStoreSuccess):
2633 * Modules/indexeddb/shared/IDBResultData.h:
2635 * Modules/indexeddb/shared/InProcessIDBServer.cpp:
2636 (WebCore::InProcessIDBServer::didRenameObjectStore):
2637 (WebCore::InProcessIDBServer::renameObjectStore):
2638 * Modules/indexeddb/shared/InProcessIDBServer.h:
2640 2016-10-20 Chris Dumez <cdumez@apple.com>
2642 Make table.deleteRow(-1) a no-op when there are no rows
2643 https://bugs.webkit.org/show_bug.cgi?id=163746
2645 Reviewed by Alex Christensen.
2647 Make table.deleteRow(-1) a no-op when there are no rows, instead of throwing:
2648 - https://github.com/whatwg/html/pull/1924
2650 This is more consistent with the behavior of tbody.deleteRow(-1) and
2651 tr.deleteCell(-1). This is also consistent with Gecko. Blink is doing the
2653 - https://codereview.chromium.org/2427963004/
2655 No new tests, updated existing tests.
2657 * html/HTMLTableElement.cpp:
2658 (WebCore::HTMLTableElement::deleteRow):
2660 2016-10-20 Dave Hyatt <hyatt@apple.com>
2662 [CSS Parser] Make sure to handle prefixed transform-style
2663 https://bugs.webkit.org/show_bug.cgi?id=163756
2665 Reviewed by Dean Jackson.
2667 * css/parser/CSSParserFastPaths.cpp:
2668 (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
2670 2016-10-20 Dave Hyatt <hyatt@apple.com>
2672 [CSS Parser] Fix crash when parsing -webkit-margin-collapse
2673 https://bugs.webkit.org/show_bug.cgi?id=163753
2675 Reviewed by Dean Jackson.
2677 * css/parser/CSSPropertyParser.cpp:
2678 (WebCore::CSSPropertyParser::parseShorthand):
2680 2016-10-20 Chris Dumez <cdumez@apple.com>
2682 Passing a number as the pixel parameter to texImage2D() doesn't thrown an exception
2683 https://bugs.webkit.org/show_bug.cgi?id=163715
2685 Reviewed by Darin Adler.
2687 Enable strict type checking for typed arrays in the bindings, similarly
2688 do what we do for other wrapper types, as per Web IDL.
2690 No new tests, updated existing tests.
2692 * bindings/scripts/CodeGeneratorJS.pm:
2693 (GenerateImplementation):
2694 (GenerateParametersCheck):
2696 2016-10-20 Myles C. Maxfield <mmaxfield@apple.com>
2698 Improve error message when passing a null ArrayBuffer to bufferData()
2699 https://bugs.webkit.org/show_bug.cgi?id=163745
2701 Reviewed by Dean Jackson.
2703 Test: fast/canvas/webgl/bufferData-nullable-array-buffer-view.html
2705 Update the idl file to accept a nullable ArrayBuffer, and throw
2706 the relevant error with a more helpful error string.
2708 * html/canvas/WebGLRenderingContextBase.cpp:
2709 (WebCore::WebGLRenderingContextBase::bufferData):
2710 * html/canvas/WebGLRenderingContextBase.h:
2711 * html/canvas/WebGLRenderingContextBase.idl:
2713 2016-10-20 Zalan Bujtas <zalan@apple.com>
2715 Stop searching for first-letter containers at multi-column boundary.
2716 https://bugs.webkit.org/show_bug.cgi?id=163739
2717 <rdar://problem/28810750>
2719 We should not cross the multi-column boundary while searching for the first-letter container.
2720 While moving first-letter renderers to a multi-column parent, it could result in finding the wrong
2721 container and end up adding a new wrapper under the original container (from where we are moving the renderers).
2723 Reviewed by David Hyatt.
2725 Test: fast/css-generated-content/first-letter-move-to-multicolumn-crash.html
2727 * rendering/RenderBoxModelObject.cpp:
2728 (WebCore::RenderBoxModelObject::moveChildrenTo):
2729 * rendering/RenderTextFragment.cpp:
2730 (WebCore::RenderTextFragment::blockForAccompanyingFirstLetter):
2732 2016-10-19 Dean Jackson <dino@apple.com>
2734 Support CSS Shapes Level 1 without a prefix
2735 https://bugs.webkit.org/show_bug.cgi?id=163709
2736 <rdar://problem/28859369>
2738 Reviewed by Myles Maxfield.
2740 Support the unprefixed form of CSS Shapes, now that
2743 We have a few failing tests:
2745 - Some image-based shaping failures, now skipped.
2746 https://bugs.webkit.org/show_bug.cgi?id=163706
2748 - Some false negatives, where my understanding
2749 of the CSS OM seems to suggest that the W3C tests
2751 https://bugs.webkit.org/show_bug.cgi?id=163708
2753 Tests: imported/w3c/csswg-test/css-shapes-1
2755 * css/CSSComputedStyleDeclaration.cpp:
2756 (WebCore::ComputedStyleExtractor::propertyValue):
2757 * css/CSSPropertyNames.in:
2758 * css/CSSValueKeywords.in:
2759 * css/parser/CSSParser.cpp:
2760 (WebCore::isSimpleLengthPropertyID):
2761 (WebCore::CSSParser::parseValue):
2762 * css/parser/CSSPropertyParser.cpp:
2763 (WebCore::CSSPropertyParser::parseSingleValue):
2764 * page/animation/CSSPropertyAnimation.cpp:
2765 (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
2767 2016-10-20 Dave Hyatt <hyatt@apple.com>
2769 [CSS Parser] Fix region, column and page break parsing
2770 https://bugs.webkit.org/show_bug.cgi?id=163743
2772 Reviewed by Simon Fraser.
2774 * css/parser/CSSParserFastPaths.cpp:
2775 (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
2776 Add the missing values for break support.
2778 * css/parser/CSSPropertyParser.cpp:
2779 (WebCore::isLegacyBreakProperty):
2780 (WebCore::CSSPropertyParser::parseValueStart):
2781 Add a special case for handling legacy break properties. Blink treats them like
2782 shorthands, but we can't do that without breaking the old parser, so for now
2783 we add a special case.
2785 (WebCore::mapFromPageBreakBetween):
2786 (WebCore::mapFromColumnBreakBetween):
2787 (WebCore::mapFromRegionBreakBetween):
2788 Updated to have the AvoidXXX values (where XXX is Column/Page/Region).
2790 (WebCore::CSSPropertyParser::parseShorthand):
2791 Remove the consumeLegacyBreak from the shorthand function, since we can't treat
2792 the legacy break properties as shorthands yet.
2794 2016-10-20 Sam Weinig <sam@webkit.org>
2796 Add convenience function that combines WTF::visit(...) with WTF::makeVisitor(...)
2797 https://bugs.webkit.org/show_bug.cgi?id=163713
2799 Reviewed by Dan Bernstein.
2801 Switch uses of WTF::visit to use WTF::switchOn.
2803 * dom/MessageEvent.cpp:
2804 (WebCore::MessageEvent::source):
2806 (WebCore::nodeSetPreTransformedFromNodeOrStringVector):
2807 (WebCore::Node::convertNodesOrStringsIntoNode):
2808 * html/HTMLSelectElement.cpp:
2809 (WebCore::HTMLSelectElement::add):
2810 * html/track/TrackEvent.cpp:
2811 (WebCore::TrackEvent::TrackEvent):
2812 * testing/TypeConversions.h:
2813 (WebCore::TypeConversions::typeConversionsDictionaryUnionType):
2815 2016-10-20 Dave Hyatt <hyatt@apple.com>
2817 [CSS Parser] Fix font family parsing and add CSS region property parsing
2818 https://bugs.webkit.org/show_bug.cgi?id=163741
2820 Reviewed by Zalan Bujtas.
2822 * css/parser/CSSParser.cpp:
2823 (WebCore::isKeywordPropertyID):
2824 (WebCore::parseKeywordValue):
2825 (WebCore::CSSParser::parseValue):
2826 Modify the old CSSParser to have its own keyword check, since keywords were
2827 incorrectly added to the new parser when this check was consolidated. Column
2828 and region breaks are considered keyword properties by the old parser, but
2829 not by the new parser, since the new parser special cases them and maps them
2830 into the generic break property.
2832 * css/parser/CSSParserFastPaths.cpp:
2833 (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
2834 (WebCore::CSSParserFastPaths::isKeywordPropertyID):
2835 Update for regions to make sure all the region properties are there. Remove the
2836 column and region break properties, since they're not supposed to be here in the
2839 * css/parser/CSSPropertyParser.cpp:
2840 (WebCore::consumeFamilyName):
2841 Fix font parsing to make font family values so that fonts work.
2843 (WebCore::consumeFlowProperty):
2844 Add a function for handling -webkit-flow-from and -webkit-flow-into.
2846 (WebCore::CSSPropertyParser::parseSingleValue):
2847 Add support for the region properties.
2849 (WebCore::mapFromRegionBreakBetween):
2850 (WebCore::mapFromColumnRegionOrPageBreakInside):
2851 (WebCore::mapFromLegacyBreakProperty):
2852 (WebCore::CSSPropertyParser::consumeLegacyBreakProperty):
2853 (WebCore::mapFromColumnOrPageBreakInside): Deleted.
2854 Update to handle the region break properties in the same way that column break
2855 properties are handled.
2857 2016-10-20 Jer Noble <jer.noble@apple.com>
2859 CRASH in WebCore::MediaSource::seekToTime + 185
2860 https://bugs.webkit.org/show_bug.cgi?id=163652
2862 Reviewed by Eric Carlson.
2864 Test: media/media-source/media-source-seek-detach-crash.html
2866 Add isClosed() checks (which are effectively m_private null-checks) everywhere m_private is
2867 dereferenced. The one place where m_private is cleared without setting the state to closed
2868 is stop(), so make stop() set the state to closed as well (without firing any events).
2870 * Modules/mediasource/MediaSource.cpp:
2871 (WebCore::MediaSource::seekToTime):
2872 (WebCore::MediaSource::completeSeek):
2873 (WebCore::MediaSource::monitorSourceBuffers):
2874 (WebCore::MediaSource::streamEndedWithError):
2875 (WebCore::MediaSource::stop):
2877 2016-10-20 Andreas Kling <akling@apple.com>
2879 Drop StyleResolver and SelectorQueryCache when entering PageCache.
2880 <https://webkit.org/b/154238>
2882 Reviewed by Antti Koivisto.
2884 Stop keeping these around for cached pages to save lots of memory.
2885 We can easily rebuild them if a cached navigation occurs, and this
2886 way we also don't need to worry about invalidating style for cached
2887 pages in all the right places.
2889 Restoring a cached page will now lead to a forced style recalc.
2890 We don't try to defer this (beyond a zero-timer) since it's going
2891 to happen anyway, and it's nicer to front-load the cost rather than
2892 stuttering on the first user content interaction.
2895 (WebCore::Document::setPageCacheState):
2896 * history/CachedPage.cpp:
2897 (WebCore::CachedPage::restore):
2898 (WebCore::CachedPage::clear):
2899 * history/CachedPage.h:
2900 (WebCore::CachedPage::markForVisitedLinkStyleRecalc): Deleted.
2901 (WebCore::CachedPage::markForFullStyleRecalc): Deleted.
2902 * history/PageCache.cpp:
2903 (WebCore::PageCache::markPagesForVisitedLinkStyleRecalc): Deleted.
2904 (WebCore::PageCache::markPagesForFullStyleRecalc): Deleted.
2905 * history/PageCache.h:
2907 (WebCore::Frame::setPageAndTextZoomFactors):
2909 (WebCore::Page::setViewScaleFactor):
2910 (WebCore::Page::setDeviceScaleFactor):
2911 (WebCore::Page::setPagination):
2912 (WebCore::Page::setPaginationLineGridEnabled):
2913 (WebCore::Page::setVisitedLinkStore):
2915 2016-10-20 Carlos Alberto Lopez Perez <clopez@igalia.com>
2917 [GTK] Build fix after r207616
2918 https://bugs.webkit.org/show_bug.cgi?id=163333
2920 Reviewed by Carlos Garcia Campos.
2922 EGL_PLATFORM_X11_KHR and EGL_PLATFORM_WAYLAND_KHR are not defined
2923 on the EGL headers shipped by Mesa 10.3 (shipped by Debian 8)
2925 * platform/graphics/wayland/PlatformDisplayWayland.cpp:
2926 (WebCore::PlatformDisplayWayland::initialize):
2927 * platform/graphics/x11/PlatformDisplayX11.cpp:
2928 (WebCore::PlatformDisplayX11::initializeEGLDisplay):
2930 2016-10-20 Fujii Hironori <Hironori.Fujii@sony.com>
2932 [CMake] CMake does not support the dep files for implicit dependency
2933 https://bugs.webkit.org/show_bug.cgi?id=161433
2935 Reviewed by Brent Fulgham.
2937 Created a Perl script to generate all IDL bindings for CMake.
2938 This script can regenerate outdated bindings by based on the
2939 supplemental dependency and dep files created by
2940 '--write-dependencies' switch of generate-bindings.pl.
2942 add_custom_target is used to invoke the script instead of
2943 add_custom_command because Ninja deletes all output files before
2944 executing the command in case of add_custom_command.
2946 USES_TERMINAL option of add_custom_target has two effects:
2947 1) Not buffering output of the command
2948 2) Invoking the command in the special Ninja pool which inhibits parallel build
2949 One needs to use CMake 3.2 or later to enable this feature.
2951 * CMakeLists.txt: Specified target names for
2952 GENERATE_BINDINGS. Added dependency for the targets.
2953 * bindings/scripts/generate-bindings-all.pl: Added.
2955 2016-10-20 Adam Jackson <ajax@redhat.com>
2957 Prefer eglGetPlatformDisplay to eglGetDisplay
2958 https://bugs.webkit.org/show_bug.cgi?id=163333
2960 Reviewed by Carlos Garcia Campos.
2962 eglGetDisplay forces the implementation to guess what kind of void* it's been handed. Different implementations
2963 do different things, in particular glvnd and Mesa behave differently. Fortunately there exists API to tell EGL
2964 what kind of display it is, so let's use it.
2966 * platform/graphics/wayland/PlatformDisplayWayland.cpp:
2967 (WebCore::PlatformDisplayWayland::initialize):
2968 * platform/graphics/x11/PlatformDisplayX11.cpp:
2969 (WebCore::PlatformDisplayX11::initializeEGLDisplay):
2971 2016-10-20 Carlos Garcia Campos <cgarcia@igalia.com>
2973 [GTK] Avoid including egl.h headers in internal headers
2974 https://bugs.webkit.org/show_bug.cgi?id=163722
2976 Reviewed by Žan Doberšek.
2978 egl.h includes eglplatform.h that decides the native types for the platform at compile time. However, we support
2979 to build with X11 and Wayland at the same time and decide what to use at runtime. Currently GLContext.h includes
2980 eglplatform.h after wayland-egl.h if Wayland is enabled. That means that the wayland native types are used by
2981 default from all cpp files including GLContext.h. It currently works in X11 because we cast the value anyway and
2982 for example EGLNativeWindowType is a pointer in Wayland that can be casted to unsigned long in X11 to represent
2983 the X Window. This is very fragile in any case, we should avoid adding egl headers in our headers and only
2984 include it in cpp files. But we also need to ensure we don't use X11 and Wayland in the same cpp file.
2986 * PlatformGTK.cmake:
2987 * platform/graphics/GLContext.cpp:
2988 (WebCore::GLContext::createContextForWindow):
2989 * platform/graphics/GLContext.h:
2990 * platform/graphics/egl/GLContextEGL.cpp:
2991 (WebCore::GLContextEGL::createWindowContext):
2992 (WebCore::GLContextEGL::createContext):
2993 (WebCore::GLContextEGL::~GLContextEGL):
2994 * platform/graphics/egl/GLContextEGL.h:
2995 * platform/graphics/egl/GLContextEGLWayland.cpp: Added.
2996 (WebCore::GLContextEGL::GLContextEGL):
2997 (WebCore::GLContextEGL::createWindowSurfaceWayland):
2998 (WebCore::GLContextEGL::createWaylandContext):
2999 (WebCore::GLContextEGL::destroyWaylandWindow):
3000 * platform/graphics/egl/GLContextEGLX11.cpp: Added.
3001 (WebCore::GLContextEGL::GLContextEGL):
3002 (WebCore::GLContextEGL::createWindowSurfaceX11):
3003 (WebCore::GLContextEGL::createPixmapContext):
3004 * platform/graphics/glx/GLContextGLX.cpp:
3005 (WebCore::GLContextGLX::createWindowContext):
3006 (WebCore::GLContextGLX::createContext):
3007 (WebCore::GLContextGLX::GLContextGLX):
3008 * platform/graphics/glx/GLContextGLX.h:
3009 * platform/graphics/wayland/PlatformDisplayWayland.cpp:
3010 * platform/graphics/x11/PlatformDisplayX11.cpp:
3012 2016-10-20 Carlos Garcia Campos <cgarcia@igalia.com>
3014 [GTK] Avoid strstr() when checking (E)GL extensions
3015 https://bugs.webkit.org/show_bug.cgi?id=161958
3017 Reviewed by Žan Doberšek.
3019 Add static method GLContext::isExtensionSupported() to properly search extenstions in the given extension
3020 list, and use it instead of strstr().
3022 * platform/graphics/GLContext.cpp:
3023 (WebCore::GLContext::isExtensionSupported):
3024 * platform/graphics/GLContext.h:
3025 * platform/graphics/egl/GLContextEGL.cpp:
3026 (WebCore::GLContextEGL::createSurfacelessContext):
3027 * platform/graphics/glx/GLContextGLX.cpp:
3028 (WebCore::hasSGISwapControlExtension):
3030 2016-10-20 Per Arne Vollan <pvollan@apple.com>
3032 [Win][Direct2D] Implement ImageBufferData::getData.
3033 https://bugs.webkit.org/show_bug.cgi?id=163668
3035 Reviewed by Brent Fulgham.
3037 Render data to a bitmap in system memory, which data can be read from.
3039 * platform/graphics/win/ImageBufferDataDirect2D.cpp:
3040 (WebCore::ImageBufferData::getData):
3041 * platform/graphics/win/ImageBufferDirect2D.cpp:
3042 (WebCore::ImageBuffer::ImageBuffer):
3044 2016-10-20 Carlos Garcia Campos <cgarcia@igalia.com>
3046 Wrong use of EGL_DEPTH_SIZE
3047 https://bugs.webkit.org/show_bug.cgi?id=155536
3049 Reviewed by Michael Catanzaro.
3051 What happens here is that the driver doesn't implement EGL_DEPTH_SIZE and the default value, which is 0, is
3052 returned. Then XCreatePixmap fails because 0 is not a valid depth. The thing is that even if EGL_DEPTH_SIZE or
3053 EGL_BUFFER_SIZE returned a valid depth, it still might not be supported by the default screen and XCreatePixmap
3054 can fail. What we need to ensure is that the depth we pass is compatible with the X display, not only with the
3055 EGL config, to avoid failures when creating the pixmap. So, we can use EGL_NATIVE_VISUAL_ID instead, and
3056 then ask X for the visual info for that id. If it isn't found then we just return before creating the pixmap,
3057 but if the visual is found then we can be sure that the depth of the visual will not make the pixmap creation
3058 fail. However, with the driver I'm using it doesn't matter how we create the pixmap that eglCreatePixmapSurface
3059 always fails, again with X errors that are fatal by default. Since the driver is not free, I assume it doesn't
3060 support eglCreatePixmapSurface or it's just buggy, so the only option we have here is trap the x errors and
3061 ignore them. It turns out that the X errors are not fatal in this case, because eglCreatePixmapSurface ends up
3062 returning a surface, and since these are offscreen contexts, it doesn't really matter if they contain an
3063 invalid pixmap, because we never do swap buffer on them, so just ignoring the X errors fixes the crashes and
3064 makes everythig work. This patch adds a helper class XErrorTrapper that allows to trap XErrors and decide what
3065 to do with them (ignore, warn or crash) or even not consider a particular set of errors as errors.
3067 * PlatformEfl.cmake: Add new file to compilation.
3068 * PlatformGTK.cmake: Ditto.
3069 * platform/graphics/egl/GLContextEGL.cpp:
3070 (WebCore::GLContextEGL::createPixmapContext): Use EGL_NATIVE_VISUAL_ID instead of EGL_DEPTH_SIZE to figure out
3071 the depth to be passed to XCreatePixmap. Also use the XErrorTrapper class to ignore all BadDrawable errors
3072 produced by eglCreatePixmapSurface() and only show a warning about all other X errors.
3073 * platform/graphics/x11/XErrorTrapper.cpp: Added.
3074 (WebCore::xErrorTrappersMap):
3075 (WebCore::XErrorTrapper::XErrorTrapper):
3076 (WebCore::XErrorTrapper::~XErrorTrapper):
3077 (WebCore::XErrorTrapper::errorCode):
3078 (WebCore::XErrorTrapper::errorEvent):
3079 * platform/graphics/x11/XErrorTrapper.h: Added.
3080 (WebCore::XErrorTrapper::XErrorTrapper):
3082 2016-10-20 Nael Ouedraogo <nael.ouedraogo@crf.canon.fr>
3084 WebRTC: The MediaStreamTrackEvent init dictionary needs a required track member
3085 https://bugs.webkit.org/show_bug.cgi?id=146232
3087 Update MediaStreamTrackEvent IDL as per specification.
3089 Reviewed by Darin Adler.
3091 No additional test required, rebase existings tests.
3093 * Modules/mediastream/MediaStreamTrackEvent.idl:
3095 2016-10-19 Antoine Quint <graouts@apple.com>
3097 [Modern Media Controls] Media Controller: mute support
3098 https://bugs.webkit.org/show_bug.cgi?id=163677
3099 <rdar://problem/28851582>
3101 Reviewed by Dean Jackson.
3103 We introduce the MuteSupport class which brings support for muting the media
3104 by clicking on the mute button in the media controls and correctly reflecting
3105 the media's muted state should the media be muted via the media API.
3107 Tests: media/modern-media-controls/mute-support/mute-support-button-click.html
3108 media/modern-media-controls/mute-support/mute-support-media-api.html
3109 media/modern-media-controls/mute-support/mute-support-muted.html
3111 * Modules/modern-media-controls/media/media-controller.js:
3113 * Modules/modern-media-controls/media/mute-support.js: Copied from Source/WebCore/Modules/modern-media-controls/media/media-controller.js.
3114 (MuteSupport.prototype.get control):
3115 (MuteSupport.prototype.get mediaEvents):
3116 (MuteSupport.prototype.buttonWasClicked):
3117 (MuteSupport.prototype.syncControl):
3119 * WebCore.xcodeproj/project.pbxproj:
3120 * rendering/RenderThemeMac.mm:
3121 (WebCore::RenderThemeMac::mediaControlsScript):
3123 2016-10-19 Alex Christensen <achristensen@webkit.org>
3126 https://bugs.webkit.org/show_bug.cgi?id=163675
3128 Reviewed by Brent Fulgham.
3130 This code is still useful for comparison with Windows. I'll remove it again soon.
3132 No new tests. No change in behavior.
3134 * WebCore.xcodeproj/project.pbxproj:
3136 * loader/DocumentLoader.h:
3137 * loader/EmptyClients.h:
3138 * loader/FrameLoaderClient.h:
3139 * loader/ResourceLoader.cpp:
3140 (WebCore::ResourceLoader::didReceiveAuthenticationChallenge):
3141 * loader/ResourceLoader.h:
3142 * loader/SubresourceLoader.h:
3143 * loader/cf/ResourceLoaderCFNet.cpp:
3144 * loader/cocoa/SubresourceLoaderCocoa.mm:
3145 (WebCore::SubresourceLoader::willCacheResponse):
3146 * loader/mac/DocumentLoaderMac.cpp:
3147 * loader/mac/ResourceLoaderMac.mm:
3148 (WebCore::ResourceLoader::willCacheResponse):
3149 * page/mac/PageMac.mm:
3150 (WebCore::Page::platformInitialize):
3151 (WebCore::Page::addSchedulePair):
3152 (WebCore::Page::removeSchedulePair):
3153 * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3154 (WebCore::WebCoreNSURLAuthenticationChallengeClient::create):
3155 (WebCore::WebCoreNSURLAuthenticationChallengeClient::WebCoreNSURLAuthenticationChallengeClient):
3156 (WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForResponseToAuthenticationChallenge):
3157 * platform/mac/WebCoreSystemInterface.h:
3158 * platform/network/NetworkStorageSession.h:
3159 * platform/network/ProtectionSpace.h:
3160 * platform/network/ProtectionSpaceBase.cpp:
3161 * platform/network/ResourceHandle.cpp:
3162 * platform/network/ResourceHandle.h:
3163 * platform/network/ResourceHandleClient.cpp:
3164 * platform/network/ResourceHandleClient.h:
3165 * platform/network/ResourceHandleInternal.h:
3166 (WebCore::ResourceHandleInternal::ResourceHandleInternal):
3167 * platform/network/ResourceRequestBase.cpp:
3168 * platform/network/cf/AuthenticationCF.cpp:
3169 (WebCore::AuthenticationChallenge::AuthenticationChallenge):
3170 (WebCore::AuthenticationChallenge::setAuthenticationClient): Deleted.
3171 (WebCore::AuthenticationChallenge::authenticationClient): Deleted.
3172 (WebCore::AuthenticationChallenge::platformCompare): Deleted.
3173 (WebCore::createCF): Deleted.
3174 (WebCore::core): Deleted.
3175 * platform/network/cf/AuthenticationCF.h:
3176 * platform/network/cf/AuthenticationChallenge.h:
3177 * platform/network/cf/CookieJarCFNet.cpp:
3178 * platform/network/cf/CredentialStorageCFNet.cpp:
3179 (WebCore::CredentialStorage::getFromPersistentStorage):
3180 (WebCore::CredentialStorage::saveToPersistentStorage):
3181 * platform/network/cf/LoaderRunLoopCF.cpp:
3182 * platform/network/cf/LoaderRunLoopCF.h:
3183 * platform/network/cf/NetworkStorageSessionCFNet.cpp:
3184 (WebCore::NetworkStorageSession::cookieStorage):
3185 * platform/network/cf/ProtectionSpaceCFNet.cpp:
3186 * platform/network/cf/ProtectionSpaceCFNet.h:
3187 * platform/network/cf/ResourceError.h:
3188 * platform/network/cf/ResourceErrorCF.cpp:
3189 * platform/network/cf/ResourceHandleCFNet.cpp:
3190 (WebCore::shouldSniffConnectionProperty):
3191 (WebCore::ResourceHandle::createCFURLConnection):
3192 (WebCore::ResourceHandle::start):
3193 (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
3194 (WebCore::ResourceHandle::tryHandlePasswordBasedAuthentication):
3195 (WebCore::ResourceHandle::receivedCredential):
3196 (WebCore::ResourceHandle::schedule):
3197 (WebCore::ResourceHandle::unschedule):
3198 * platform/network/cf/ResourceHandleCFURLConnectionDelegate.cpp:
3199 * platform/network/cf/ResourceHandleCFURLConnectionDelegate.h:
3200 * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
3201 (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::setupRequest):
3202 (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse):
3203 (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::canRespondToProtectionSpace):
3204 * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.h:
3205 * platform/network/cf/ResourceRequest.h:
3206 (WebCore::ResourceRequest::encodingRequiresPlatformData):
3207 * platform/network/cf/ResourceRequestCFNet.cpp:
3208 (WebCore::findCFURLRequestSetContentDispositionEncodingFallbackArrayFunction):
3209 (WebCore::findCFURLRequestCopyContentDispositionEncodingFallbackArrayFunction):
3210 (WebCore::ResourceRequest::doUpdatePlatformRequest):
3211 (WebCore::ResourceRequest::doUpdatePlatformHTTPBody):
3212 (WebCore::ResourceRequest::doUpdateResourceRequest):
3213 (WebCore::ResourceRequest::setStorageSession):
3214 * platform/network/cf/ResourceRequestCFNet.h:
3215 * platform/network/cf/ResourceResponse.h:
3216 * platform/network/cf/ResourceResponseCFNet.cpp:
3217 (WebCore::ResourceResponse::cfURLResponse):
3218 * platform/network/cf/SynchronousLoaderClientCFNet.cpp:
3219 * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:
3220 (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::setupRequest):
3221 (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::setupConnectionScheduling):
3222 (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveResponse):
3223 (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::willCacheResponse):
3224 (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::canRespondToProtectionSpace):
3225 * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.h:
3226 * platform/network/cocoa/CredentialCocoa.h:
3227 * platform/network/cocoa/CredentialCocoa.mm:
3228 (WebCore::Credential::Credential):
3229 (WebCore::Credential::cfCredential):
3230 * platform/network/cocoa/ProtectionSpaceCocoa.h:
3231 * platform/network/cocoa/ProtectionSpaceCocoa.mm:
3232 (WebCore::ProtectionSpace::ProtectionSpace):
3233 (WebCore::ProtectionSpace::cfSpace):
3234 * platform/network/cocoa/ResourceRequestCocoa.mm:
3235 (WebCore::ResourceRequest::nsURLRequest):
3236 * platform/network/cocoa/ResourceResponseCocoa.mm:
3237 (WebCore::ResourceResponse::platformCertificateInfo):
3238 (WebCore::ResourceResponse::nsURLResponse):
3239 (WebCore::ResourceResponse::ResourceResponse):
3240 * platform/network/ios/QuickLook.h:
3241 * platform/network/ios/QuickLook.mm:
3242 (-[WebQuickLookHandleAsDelegate initWithConnectionDelegate:]):
3243 (-[WebQuickLookHandleAsDelegate connection:didReceiveDataArray:]):
3244 (-[WebQuickLookHandleAsDelegate connection:didReceiveData:lengthReceived:]):
3245 (-[WebQuickLookHandleAsDelegate connectionDidFinishLoading:]):
3246 (-[WebQuickLookHandleAsDelegate connection:didFailWithError:]):
3247 (-[WebQuickLookHandleAsDelegate detachHandle]):
3248 (WebCore::QuickLookHandle::create):
3249 (WebCore::QuickLookHandle::cfResponse):
3250 * platform/network/mac/AuthenticationMac.mm:
3251 (-[WebCoreAuthenticationClientAsChallengeSender setCFChallenge:]):
3252 (-[WebCoreAuthenticationClientAsChallengeSender cfChallenge]):
3255 * platform/network/mac/CookieJarMac.mm:
3256 (WebCore::setCookiesFromDOM):
3257 (WebCore::addCookie):
3258 (WebCore::cookieStorage):
3259 * platform/network/mac/CredentialStorageMac.mm:
3260 * platform/network/mac/FormDataStreamMac.h:
3261 * platform/network/mac/FormDataStreamMac.mm:
3262 * platform/network/mac/ResourceErrorMac.mm:
3263 (NSErrorFromCFError):
3264 (WebCore::ResourceError::ResourceError):
3265 (WebCore::ResourceError::nsError):
3266 (WebCore::ResourceError::operator NSError *):
3267 * platform/network/mac/ResourceHandleMac.mm:
3268 (WebCore::ResourceHandle::getConnectionTimingData):
3269 * platform/network/mac/ResourceRequestMac.mm: Added.
3270 (WebCore::ResourceRequest::ResourceRequest):
3271 (WebCore::ResourceRequest::updateNSURLRequest):
3272 * platform/network/mac/SynchronousLoaderClient.mm:
3273 * platform/network/mac/WebCoreResourceHandleAsDelegate.h:
3274 * platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
3275 * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.h:
3276 * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
3277 * platform/network/mac/WebCoreURLResponse.mm:
3278 * platform/win/TemporaryLinkStubs.cpp:
3279 * testing/js/WebCoreTestSupportPrefix.h:
3281 2016-10-19 Jer Noble <jer.noble@apple.com>
3283 REGRESSION (r206025): All YouTube videos play with black bars on all four sides
3284 https://bugs.webkit.org/show_bug.cgi?id=163308
3286 Reviewed by Darin Adler.
3288 Test: media/media-source/media-source-resize.html
3290 After r206025, we do not fire resize events when the size change notification happens equal-
3291 to-or-before the current time, which can happen at the very beginning of a stream. Take care
3292 of this case by checking that the target time isn't actually in the past inside of
3293 sizeWillChangeAtTime(), and also always skip the boundary time observer when there was no
3294 previous size (such as after a flush due to a seek).
3296 * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
3297 * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
3298 (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::sizeWillChangeAtTime):
3299 (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setNaturalSize):
3300 * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
3301 (WebCore::SourceBufferPrivateAVFObjC::flushAndEnqueueNonDisplayingSamples):
3302 (WebCore::SourceBufferPrivateAVFObjC::enqueueSample):
3304 2016-10-19 Nan Wang <n_wang@apple.com>
3306 AX: [Mac] Mark element AXAPI should comform to specs
3307 https://bugs.webkit.org/show_bug.cgi?id=163707
3309 Reviewed by Chris Fleizach.
3311 Created a new role for mark elements on Mac and exposed the role
3314 Changes are covered in modified test expectaions.
3316 * English.lproj/Localizable.strings:
3317 * accessibility/AccessibilityObject.h:
3318 * accessibility/AccessibilityRenderObject.cpp:
3319 (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
3320 * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
3321 (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
3322 * accessibility/mac/AccessibilityObjectMac.mm:
3323 (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject):
3324 * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3325 (createAccessibilityRoleMap):
3326 (-[WebAccessibilityObjectWrapper roleDescription]):
3327 * platform/LocalizedStrings.cpp:
3328 (WebCore::AXMarkText):
3329 * platform/LocalizedStrings.h:
3331 2016-10-19 Alex Christensen <achristensen@webkit.org>
3333 Re-enable URLParser for non-Safari Cocoa apps after r207321
3334 https://bugs.webkit.org/show_bug.cgi?id=163690
3336 Reviewed by Darin Adler.
3338 I disabled the URLParser for non-Safari applications in r207305
3339 to give me time to make URLParser more compatible, which I did in r207321
3341 Updated some API tests which will be investigated in
3342 https://bugs.webkit.org/show_bug.cgi?id=163127
3344 * platform/URLParser.cpp:
3345 (WebCore::URLParser::setEnabled):
3346 (WebCore::URLParser::enabled):
3347 * testing/js/WebCoreTestSupport.cpp:
3348 (WebCoreTestSupport::setURLParserEnabled): Deleted.
3349 * testing/js/WebCoreTestSupport.h:
3351 2016-10-19 Myles C. Maxfield <mmaxfield@apple.com>
3353 CSS font-variation-settings does not handle uppercase axis names in variable fonts
3354 https://bugs.webkit.org/show_bug.cgi?id=163546
3356 Reviewed by Dean Jackson.
3358 Remove the extra toASCIILower() call.
3360 Test: fast/text/variations/case-axis-names.html
3362 * css/parser/CSSParser.cpp:
3363 (WebCore::CSSParser::parseFontVariationTag):
3365 2016-10-19 Anders Carlsson <andersca@apple.com>
3367 Remove m_redirectURLs from HistoryItem
3368 https://bugs.webkit.org/show_bug.cgi?id=163704
3370 Reviewed by Dan Bernstein.
3372 * history/HistoryItem.cpp:
3373 (WebCore::HistoryItem::HistoryItem):
3374 (WebCore::HistoryItem::reset):
3375 * history/HistoryItem.h:
3377 2016-10-19 Joone Hur <joone.hur@intel.com>
3379 Add a plain space instead of between text nodes
3380 https://bugs.webkit.org/show_bug.cgi?id=123163
3382 Reviewed by Ryosuke Niwa.
3384 When we rebalance white spaces, can be added as space
3385 under some conditions. This patch adds a condition that the next
3386 sibling text node should not exist.
3388 No new tests, updated existing test.
3390 * editing/CompositeEditCommand.cpp:
3391 (WebCore::CompositeEditCommand::rebalanceWhitespaceOnTextSubstring):
3392 * editing/htmlediting.cpp:
3393 (WebCore::stringWithRebalancedWhitespace):
3394 * editing/htmlediting.h:
3396 2016-10-19 Sam Weinig <sam@webkit.org>