1 2016-12-09 Antoine Quint <graouts@apple.com>
3 [Modern Media Controls] Implement the pageScaleFactor property
4 https://bugs.webkit.org/show_bug.cgi?id=165660
6 Reviewed by Dean Jackson.
8 We implement the pageScaleFactor property on MediaController. This property is set
9 by the HTMLMediaElement when the page scale factor changes, and we only choose to handle
10 it on iOS by setting controlsDependOnPageScaleFactor to true on the MediaControlsHost.
12 To do so, we now size the media controls by multiplying the layout size of the media by
13 the page scale factor, and apply an inverse CSS zoom on the media controls themselves.
15 Test: media/modern-media-controls/media-controller/media-controller-scale-factor.html
17 * Modules/modern-media-controls/controls/media-controls.css:
18 (.media-controls-container,):
19 * Modules/modern-media-controls/controls/media-controls.js:
20 (MediaControls.prototype.get scaleFactor):
21 (MediaControls.prototype.set scaleFactor):
22 (MediaControls.prototype.commitProperty):
23 * Modules/modern-media-controls/media/media-controller.js:
25 (MediaController.prototype.set pageScaleFactor):
26 (MediaController.prototype._updateControlsSize):
27 * html/HTMLMediaElement.cpp:
28 (WebCore::controllerJSValue):
29 (WebCore::HTMLMediaElement::setControllerJSProperty):
31 We no longer hit a JSC assertion when trying to set the pageScaleFactor property before
32 the JS controller was actually created.
34 2016-12-09 Daniel Bates <dabates@apple.com>
36 Attempt to fix the Mac CMake build following <http://trac.webkit.org/changeset/209549>
37 (https://bugs.webkit.org/show_bug.cgi?id=165572)
39 Add directory html/canvas to the list of forwarding headers directories so that
40 the Legacy WebKit Objective-C DOM binding DOMHTMLCanvasElement.mm can ultimately
41 include header WebGLContextAttributes.h.
45 2016-12-09 Brady Eidson <beidson@apple.com>
47 LinkIconCollector refactoring.
48 https://bugs.webkit.org/show_bug.cgi?id=165657
50 Reviewed by Dean Jackson.
52 No new tests (Refactor, no behavior change)
54 * WebCore.xcodeproj/project.pbxproj:
56 * html/LinkIconCollector.cpp:
58 (WebCore::compareIcons):
59 * html/LinkIconCollector.h:
61 * platform/LinkIcon.h: Move outside of LinkIconCollector for future expandability.
63 2016-12-09 Ryan Haddad <ryanhaddad@apple.com>
65 Unreviewed, rolling out r209574.
67 This change broke the Windows build.
71 "[WebIDL] Remove custom bindings for Geolocation"
72 https://bugs.webkit.org/show_bug.cgi?id=165625
73 http://trac.webkit.org/changeset/209574
75 2016-12-09 Ryosuke Niwa <rniwa@webkit.org>
77 Custom Elements from a different document are not customized when created with innerHTML
78 https://bugs.webkit.org/show_bug.cgi?id=165617
80 Reviewed by Antti Koivisto.
82 The bug was caused by a superflous null check on window in createHTMLElementOrFindCustomElementInterface.
83 Removed the nullcheck to fix the bug.
85 Test: fast/custom-elements/adopting-from-frameless-document.html
87 * html/parser/HTMLConstructionSite.cpp:
88 (WebCore::HTMLConstructionSite::createHTMLElementOrFindCustomElementInterface):
90 2016-12-09 Daniel Bates <dabates@apple.com>
92 [CSP] Policy of window opener not applied to about:blank window
93 https://bugs.webkit.org/show_bug.cgi?id=165531
94 <rdar://problem/29426639>
96 Reviewed by Brent Fulgham.
98 Fixes an issue where the content security policy of the opener document was not applied to
99 an about:blank window.
101 An about:blank window inherits its security origin from its opener document. It should also
102 copy (inherit) the ContentSecurityPolicy from its opener document. When copying the ContentSecurityPolicy
103 state from the opener document to the about:blank document we must take care to avoid copying
104 any upgrade-insecure-request directive because new windows should not inherit it by definition.
105 With respect to upgrade-insecure-requests, new windows should only inherit the insecure navigation set
106 from their opener document.
108 Test: http/tests/security/contentSecurityPolicy/image-blocked-in-about-blank-window.html
111 (WebCore::Document::initContentSecurityPolicy): Copy the ContentSecurityPolicy state from the
112 owner document to this document when it inherits its security origin from its owner. An about:blank
113 window is one example of a document that inherits its security origin from its owner.
114 * loader/WorkerThreadableLoader.cpp:
115 (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge): Call ContentSecurityPolicy::copyUpgradeInsecureRequestStateFrom()
116 to copy the upgrade insecure requests state from the owner document to the worker now that
117 ContentSecurityPolicy::copyStateFrom() no longer does this.
118 * page/csp/ContentSecurityPolicy.cpp:
119 (WebCore::ContentSecurityPolicy::copyStateFrom): Do not copy the upgrade insecure request state.
120 Callers are now responsible for calling ContentSecurityPolicy::copyUpgradeInsecureRequestStateFrom()
122 * page/csp/ContentSecurityPolicyDirectiveList.cpp:
123 (WebCore::ContentSecurityPolicyDirectiveList::parse): Ignore directive upgrade-insecure-requests when
124 inheriting ContentSecurityPolicy state as this directive as the Upgrade Insecure Requests feature has
125 its own inheritance semantics that differ from the semantics of copying a ContentSecurityPolicy object.
126 * xml/XSLTProcessor.cpp:
127 (WebCore::XSLTProcessor::createDocumentFromSource): Call ContentSecurityPolicy::copyUpgradeInsecureRequestStateFrom()
128 to copy the upgrade insecure requests state from the original document to the transformed document now
129 that ContentSecurityPolicy::copyStateFrom() no longer does this.
131 2016-12-09 Antoine Quint <graouts@apple.com>
133 [Modern Media Controls] Remaining time label first appears way to the left
134 https://bugs.webkit.org/show_bug.cgi?id=165637
136 Reviewed by Dean Jackson.
138 We would sometimes see the remaining time label be laid out in an incorrect position
139 when a video would start playing. This happened because the time label was being committed
140 from a previous value before, in the same frame, we would call the layout() function
141 of MacOSInlineMediaControls. This would set the newly computed location for the
142 remaining time label, but because we would reset the list of dirty properties after
143 calling all layout functions, the new value set in MacOSInlineMediaControls.layout()
144 would be disregarded and the wrong, committed value would persist until it was reset
145 in a much later frame.
147 We now correctly clear the list of dirty nodes before laying them out, giving all nodes
148 a chance to become dirty again during layout, and updated again in the next frame.
150 Test: media/modern-media-controls/layout-node/node-made-dirty-during-layout.html
152 * Modules/modern-media-controls/controls/layout-node.js:
153 (performScheduledLayout):
155 2016-12-09 Per Arne Vollan <pvollan@apple.com>
157 Fix compile errors on Windows when building with .proj files.
159 Unreviewed build fix.
163 * platform/graphics/win/IntPointWin.cpp:
164 * platform/graphics/win/IntRectWin.cpp:
165 * platform/graphics/win/IntSizeWin.cpp:
167 2016-12-09 Csaba Osztrogonác <ossy@webkit.org>
169 Unreviewed buildfix after r209570.
171 * bindings/js/JSDOMGlobalObject.cpp:
172 (WebCore::JSDOMGlobalObject::addBuiltinGlobals):
174 2016-12-01 Sergio Villar Senin <svillar@igalia.com>
176 [css-grid] Pass Grid as argument to items' placement methods
177 https://bugs.webkit.org/show_bug.cgi?id=165250
179 Reviewed by Darin Adler.
181 In order to constify computeIntrinsicLogicalWidths() it is required to constify
182 placeItemsOnGrid() first, which is the base method of the grid items' positioning logic. The
183 first step is to constify all the methods invoked by the latter, which basically means to
184 pass the Grid as argument to all of them instead of directly using the m_grid attribute from
185 RenderGrid. As this is an intermediate step, a new const_cast<> was required in the
186 intrinsic size computation. However it will be promptly removed after the const-ification of
189 After this, only the methods used by the track sizing algorithm will directly access
190 m_grid. All those would get a reference to the Grid via GridSizingData, but that's a matter
191 of a follow up patch.
193 Apart from that, m_gridIsDirty was removed because it was always too confusing. It was
194 replaced by Grid's m_needsItemsPlacement which is much more concise. The clearGrid() call
195 was indeed only forcing a new placement of the grid items.
197 No new tests as this is a refactoring.
199 * rendering/RenderGrid.cpp:
200 (WebCore::RenderGrid::Grid::setNeedsItemsPlacement): New method to flag the Grid whenever
201 grid items' placement algorithm needs to be run.
202 (WebCore::RenderGrid::canPerformSimplifiedLayout):
203 (WebCore::RenderGrid::layoutBlock):
204 (WebCore::RenderGrid::computeIntrinsicLogicalWidths):
205 (WebCore::RenderGrid::computeEmptyTracksForAutoRepeat):
206 (WebCore::RenderGrid::placeItemsOnGrid):
207 (WebCore::RenderGrid::populateExplicitGridAndOrderIterator): Constified. Got Grid as
209 (WebCore::RenderGrid::createEmptyGridAreaAtSpecifiedPositionsOutsideGrid): Ditto.
210 (WebCore::RenderGrid::placeSpecifiedMajorAxisItemsOnGrid): Ditto.
211 (WebCore::RenderGrid::placeAutoMajorAxisItemsOnGrid): Ditto.
212 (WebCore::RenderGrid::placeAutoMajorAxisItemOnGrid): Ditto.
213 (WebCore::RenderGrid::clearGrid):
214 (WebCore::RenderGrid::offsetAndBreadthForPositionedChild):
215 (WebCore::RenderGrid::numTracks):
216 * rendering/RenderGrid.h:
218 2016-12-09 Gavin Barraclough <barraclough@apple.com>
220 Revert - Add _WKIconLoadingDelegate SPI
221 https://bugs.webkit.org/show_bug.cgi?id=164894
223 Unreviewed rollout due to performance regression.
225 * WebCore.xcodeproj/project.pbxproj:
227 (WebCore::Document::implicitClose):
228 * html/LinkIconCollector.cpp:
230 (WebCore::compareIcons):
231 * html/LinkIconCollector.h:
232 * loader/DocumentLoader.cpp:
233 (WebCore::DocumentLoader::startIconLoading): Deleted.
234 (WebCore::DocumentLoader::didGetLoadDecisionForIcon): Deleted.
235 (WebCore::DocumentLoader::finishedLoadingIcon): Deleted.
236 * loader/DocumentLoader.h:
237 * loader/FrameLoaderClient.h:
238 * loader/icon/IconLoader.cpp:
239 (WebCore::IconLoader::IconLoader):
240 (WebCore::IconLoader::startLoading):
241 (WebCore::IconLoader::notifyFinished):
242 * loader/icon/IconLoader.h:
243 * platform/LinkIcon.h: Removed.
245 2016-12-08 Jiewen Tan <jiewen_tan@apple.com>
247 [WebCrypto] Remove NoInterfaceObject attribute from SubtleCrypto Interface
248 https://bugs.webkit.org/show_bug.cgi?id=165629
249 <rdar://problem/29586203>
251 Reviewed by Chris Dumez.
253 Covered by existing tests.
255 * crypto/SubtleCrypto.idl:
257 2016-12-08 Keith Rollin <krollin@apple.com>
259 FileHandle::printf doesn't build on Windows
260 https://bugs.webkit.org/show_bug.cgi?id=165642
262 Reviewed by Ryosuke Niwa.
264 Fix the build -- vasprintf does not exist on Windows, so make
265 FileHandle::printf a no-op on that platform.
267 No new tests -- affected facility is currently only used in testing
268 code and is not user reachable.
270 * platform/FileHandle.cpp:
271 (WebCore::FileHandle::printf):
273 2016-12-08 Antoine Quint <graouts@apple.com>
275 [Modern Media Controls] Exiting fullscreen with paused media shows the start button
276 https://bugs.webkit.org/show_bug.cgi?id=165640
278 Reviewed by Dean Jackson.
280 Like all supporting objects, the StartSupport instance gets recreated when creating controls
281 for new layout traits, which happens when going from fullscreen to inline. Due to this, the
282 "_isPlayed" property is not longer set to true, even if the media has played prior to being
283 paused in fullscreen. We now also check the media's played range to identify whether media
286 * Modules/modern-media-controls/media/start-support.js:
287 (StartSupport.prototype._shouldShowStartButton):
290 2016-12-08 Myles C. Maxfield <mmaxfield@apple.com>
292 ASSERTION FAILED: locale in WebCore::lastHyphenLocation
293 https://bugs.webkit.org/show_bug.cgi?id=164182
295 Reviewed by Zalan Bujtas.
297 Our hyphenation code assumes the locale is in a small set of known locales.
298 However, web content can put whatever string it wants in the locale field.
300 Test: fast/text/hyphenation-unknown-locale.html
302 * platform/text/cf/HyphenationCF.cpp:
303 (WebCore::lastHyphenLocation):
304 * rendering/RenderText.cpp:
305 (WebCore::maxWordFragmentWidth): When computing the minimum preferred width of
306 an element, we want to know the size of the widest nonbreakable unit. When
307 hyphenation is enabled, we have to measure the width of each fragment of each
308 word (where "fragment" is determined by a substring between two successive
309 hyphenation points, appended with a hyphen character). A hyphenation point at
310 string offset 0 is irrelevant for this purpose, because it would lead to an
311 empty fragment. Therefore, skip this situation.
313 2016-12-08 David Kilzer <ddkilzer@apple.com>
315 Always check the return value of pthread_key_create()
316 <https://webkit.org/b/165274>
318 Reviewed by Darin Adler.
320 * platform/ios/wak/WebCoreThread.mm:
321 (InitThreadContextKey): Call CRASH() if pthread_key_create()
322 returns an error. The error code will be stored in a register
323 available in a crash log, so no need to log the value
326 2016-12-08 Alex Christensen <achristensen@webkit.org>
328 Reduce PassRefPtr use in platform/graphics
329 https://bugs.webkit.org/show_bug.cgi?id=165636
331 Reviewed by Dean Jackson.
333 No change in behavior.
335 * platform/graphics/GraphicsContext3D.h:
336 * platform/graphics/mac/DisplayRefreshMonitorMac.h:
337 (WebCore::DisplayRefreshMonitorMac::create):
338 * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
339 (WebCore::GraphicsContext3D::createForCurrentGLContext):
340 (WebCore::GraphicsContext3D::paintRenderingResultsToImageData):
342 2016-12-08 Keith Rollin <krollin@apple.com>
344 Move FileHandle to WebCore FileHandle.h
345 https://bugs.webkit.org/show_bug.cgi?id=165562
347 Reviewed by Alex Christensen.
349 Add FileHandle, a small wrapper around FileSystem facilities to manage
350 the lifetime of an open file and give the facilities a C++ interface.
352 No new tests -- affected facility is currently only used in testing
353 code and is not user reachable.
356 * WebCore.xcodeproj/project.pbxproj:
357 * platform/FileHandle.cpp: Added.
358 (WebCore::FileHandle::FileHandle):
359 (WebCore::FileHandle::~FileHandle):
360 (WebCore::FileHandle::operator=):
361 (WebCore::FileHandle::operator bool):
362 (WebCore::FileHandle::open):
363 (WebCore::FileHandle::read):
364 (WebCore::FileHandle::write):
365 (WebCore::FileHandle::printf):
366 (WebCore::FileHandle::close):
367 * platform/FileHandle.h: Added.
369 2016-12-07 Ryosuke Niwa <rniwa@webkit.org>
371 ASSERTION FAILED: m_items.isEmpty() in CustomElementReactionQueue destructor
372 https://bugs.webkit.org/show_bug.cgi?id=162029
373 <rdar://problem/28945851>
375 Reviewed by Chris Dumez.
377 The bug was caused by Document::removedLastRef enqueuing disconnectedCallback during a tear down.
378 Don't enqueue a disconnectedCallback while a document is getting torn down since that should not be
379 observable to author scripts. The connected, adopted, and attributeChanged callbacks are immune from
380 this problem since they don't happen during a document destruction.
382 Note that this was also the case prior to this patch since the disconnectedCallback would have been
383 added to the current CustomElementReactionQueue which will be destructed without invoking callbacks
384 (or hit a release assertion added in r208785 and r209426 for now).
386 Tests: fast/custom-elements/disconnected-callback-in-detached-iframe.html
387 fast/custom-elements/element-queue-during-document-destruction.html
389 * dom/CustomElementReactionQueue.cpp:
390 (WebCore::CustomElementReactionQueue::enqueueConnectedCallbackIfNeeded): Added an assertion that
391 document's refCount hasn't reached zero yet.
392 (WebCore::CustomElementReactionQueue::enqueueDisconnectedCallbackIfNeeded): Fixed the bug.
393 (WebCore::CustomElementReactionQueue::enqueueAdoptedCallbackIfNeeded): Added the same assertion.
394 (WebCore::CustomElementReactionQueue::enqueueAttributeChangedCallbackIfNeeded): Ditto.
396 2016-12-08 Daniel Bates <dabates@apple.com>
398 Add Strict Mixed Content Checking and Upgrade Insecure Requests to WebKit Feature Status dashboard
399 https://bugs.webkit.org/show_bug.cgi?id=165635
401 Rubber-stamped by Ryosuke Niwa.
405 2016-12-08 Daniel Bates <dabates@apple.com>
407 Implement Strict Mixed Content Checking
408 https://bugs.webkit.org/show_bug.cgi?id=165438
409 <rdar://problem/26103867>
411 Reviewed by Brent Fulgham and Andy Estes.
413 Add support for the CSP directive block-all-mixed-content to enable strict mixed content checking
414 as per <https://www.w3.org/TR/2016/CR-mixed-content-20160802/#strict-checking> (2 August 2016).
416 Currently WebKit only blocks blockable content as such content can contaminate the security origin
417 that loaded it. Optionally-blockable content, including images, would be allowed to load as mixed
418 content. When strict mixed content checking is enabled all mixed content is blocked. That is, both
419 blockable and optionally-blockable content will be blocked. A web site can opt into strict mixed
420 content checking by adding the directive block-all-mixed-content to their content security policy.
422 Tests: http/tests/security/contentSecurityPolicy/block-all-mixed-content/data-url-iframe-in-main-frame.html
423 http/tests/security/contentSecurityPolicy/block-all-mixed-content/duplicate-directive.html
424 http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-css-in-iframe-report-only.html
425 http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-css-in-iframe.html
426 http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-css-in-main-frame.html
427 http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-iframe-in-iframe.html
428 http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-iframe-in-main-frame.html
429 http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-image-in-blob-url-iframe-in-iframe.html
430 http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-image-in-iframe-with-enforced-and-report-policies.html
431 http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-image-in-iframe-with-inherited-policy.html
432 http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-image-in-iframe.html
433 http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-image-in-javascript-url-iframe-in-iframe.html
434 http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-image-in-main-frame.html
435 http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-image-in-xslt-document-in-iframe-with-inherited-policy.html
436 http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-plugin-in-iframe.html
437 http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-plugin-in-main-frame.html
438 http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-script-in-iframe-with-inherited-policy.html
439 http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-script-in-iframe.html
440 http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-script-in-main-frame.html
441 http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-xhr-asynchronous-in-iframe.html
442 http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-xhr-asynchronous-in-main-frame.html
443 http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-xhr-synchronous-in-iframe.html
444 http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-xhr-synchronous-in-main-frame.html
445 http/tests/security/contentSecurityPolicy/block-all-mixed-content/secure-image-after-upgrade-in-iframe.html
446 http/tests/security/contentSecurityPolicy/block-all-mixed-content/secure-image-after-upgrade-redirect-in-iframe.html
449 (WebCore::Document::initSecurityContext): Inherit strict mixed content checking mode from parent document.
450 * dom/SecurityContext.h:
451 (WebCore::SecurityContext::isStrictMixedContentMode): Added.
452 (WebCore::SecurityContext::setStrictMixedContentMode): Added.
453 * loader/DocumentLoader.cpp:
454 (WebCore::DocumentLoader::willSendRequest): Check mixed content policy with respect to the current frame.
455 The document in the current frame may have opted into strict mixed content checking or inherited it from
457 * loader/DocumentWriter.cpp:
458 (WebCore::DocumentWriter::begin): Inherit the strict mixed content checking mode from the owner document
459 when loading a JavaScript URL in a frame (e.g. <iframe src="javascript:...">) because such URLs inherit
460 the security origin of their parent document.
461 * loader/MixedContentChecker.cpp:
462 (WebCore::MixedContentChecker::canDisplayInsecureContent): Check the content security policy of the document
463 and the strict mixed content checking mode bit on the document (in that order) to determine if we are in
464 strict mode. Block display of insecure content when in strict mode. Modified to take enum AlwaysDisplayInNonStrictMode (defaults
465 to AlwaysDisplayInNonStrictMode::No) as to whether to allow our current relaxed behavior of displaying insecure
466 content in non-strict mode.
467 (WebCore::MixedContentChecker::canRunInsecureContent): Check the content security policy of the document
468 and the strict mixed content checking mode bit on the document (in that order) to determine if we are in
469 strict mode. Block running of insecure content when in strict mode.
470 * loader/MixedContentChecker.h:
471 * loader/cache/CachedResourceLoader.cpp:
472 (WebCore::CachedResourceLoader::checkInsecureContent): Always check mixed content policy with respect to
473 the current frame. The document in the current frame may have opted into strict mixed content checking or
474 inherited it from its parent document. Also renamed a local variable f to frame to better describe its
476 * page/csp/ContentSecurityPolicy.cpp:
477 (WebCore::ContentSecurityPolicy::allowRunningOrDisplayingInsecureContent): Added. Iterate through all the
478 policies and report violations with respect to policies that have directive block-all-mixed-content.
479 (WebCore::ContentSecurityPolicy::didReceiveHeader): Move logic to set eval() error message from here...
480 (WebCore::ContentSecurityPolicy::applyPolicyToScriptExecutionContext): ...to here so that we only perform
481 it once we are ready to apply the CSP policy to the script execution context. Additionally, enable
482 strict mixed content checking on the script execution context if applicable.
483 (WebCore::ContentSecurityPolicy::reportViolation): Added overrides that take a string and a directive list
484 object (ContentSecurityPolicyDirectiveList) for the effective violated directive and its associated directive
485 list, respectively. We make use of these overrides so as to support reporting block-all-mixed-content
486 violations, which are not implemented using a ContentSecurityPolicyDirective object as it seemed sufficient
487 to implement it as a boolean on ContentSecurityPolicyDirectiveList.
488 * page/csp/ContentSecurityPolicy.h:
489 * page/csp/ContentSecurityPolicyDirectiveList.cpp:
490 (WebCore::ContentSecurityPolicyDirectiveList::setBlockAllMixedContentEnabled): Added.
491 (WebCore::ContentSecurityPolicyDirectiveList::addDirective): Parse the directive block-all-mixed-content.
492 * page/csp/ContentSecurityPolicyDirectiveList.h:
493 (WebCore::ContentSecurityPolicyDirectiveList::hasBlockAllMixedContentDirective): Added.
494 * page/csp/ContentSecurityPolicyDirectiveNames.cpp:
495 * page/csp/ContentSecurityPolicyDirectiveNames.h: Add constant for "block-all-mixed-content".
497 2016-12-08 Sam Weinig <sam@webkit.org>
499 [WebIDL] Remove custom bindings for Geolocation
500 https://bugs.webkit.org/show_bug.cgi?id=165625
502 Reviewed by Alex Christensen.
505 * DerivedSources.cpp:
506 * DerivedSources.make:
507 * WebCore.xcodeproj/project.pbxproj:
508 * bindings/js/JSBindingsAllInOne.cpp:
511 * Modules/geolocation/GeoNotifier.cpp:
512 (WebCore::GeoNotifier::GeoNotifier):
513 (WebCore::GeoNotifier::hasZeroTimeout):
514 (WebCore::GeoNotifier::startTimerIfNeeded):
515 * Modules/geolocation/GeoNotifier.h:
516 (WebCore::GeoNotifier::create):
517 (WebCore::GeoNotifier::options):
518 Update to store PositionOptions as a value, and pass the PositionCallback
519 as a Ref, rather than a RefPtr, since it is not optional.
521 * Modules/geolocation/Geolocation.cpp:
522 (WebCore::createGeoposition):
523 Use auto, to get the good type for Coordinates (Ref).
525 (WebCore::Geolocation::getCurrentPosition):
526 (WebCore::Geolocation::watchPosition):
527 (WebCore::Geolocation::haveSuitableCachedPosition):
528 (WebCore::Geolocation::startUpdating):
529 * Modules/geolocation/Geolocation.h:
530 Update to pass PositionOptions itself now that it is a plain struct.
532 * Modules/geolocation/Geolocation.idl:
533 Remove [Custom] extended attribute and add FIXME about nullable annotation.
535 * Modules/geolocation/Geoposition.h:
536 Pass/store Coordinates as a Ref.
538 * Modules/geolocation/PositionOptions.h:
539 Convert to be a simple struct.
541 * Modules/geolocation/PositionOptions.idl:
544 * bindings/js/JSGeolocationCustom.cpp:
547 2016-12-08 Alex Christensen <achristensen@webkit.org>
549 REGRESSION (URL parser): Relative URLs aren’t resolved correctly when the base URL is an applewebdata: URL
550 https://bugs.webkit.org/show_bug.cgi?id=165621
552 Reviewed by Dan Bernstein.
554 Covered by new API tests.
556 * platform/URLParser.cpp:
557 (WebCore::URLParser::parse):
558 URLs with nonspecial schemes and no slash after the host get no slash as the path to maintain compatibility with all browsers.
559 This was proposed to the URL spec in https://github.com/whatwg/url/issues/148
560 When such as URL is used as a base URL with a relative path, in order to maintain compatibility with URL::parse we need to prepend
561 a slash to the path. For completeness I added tests with a relative path, a relative query, a relative fragment, and a relative empty string,
562 and because the fate of the spec is unclear in this case, I decided to maintain compatibility with URL::parse in all these cases.
564 2016-12-06 Filip Pizlo <fpizlo@apple.com>
566 Concurrent GC should be stable enough to land enabled on X86_64
567 https://bugs.webkit.org/show_bug.cgi?id=164990
569 Reviewed by Geoffrey Garen.
571 Made WebCore down with concurrent marking by adding some locking and adapting to some new API.
573 This has new test modes in run-sjc-stress-tests. Also, the way that LayoutTests run is already
576 * ForwardingHeaders/heap/DeleteAllCodeEffort.h: Added.
577 * ForwardingHeaders/heap/LockDuringMarking.h: Added.
578 * bindings/js/GCController.cpp:
579 (WebCore::GCController::deleteAllCode):
580 (WebCore::GCController::deleteAllLinkedCode):
581 * bindings/js/GCController.h:
582 * bindings/js/JSDOMBinding.cpp:
583 (WebCore::getCachedDOMStructure):
584 (WebCore::cacheDOMStructure):
585 * bindings/js/JSDOMGlobalObject.cpp:
586 (WebCore::JSDOMGlobalObject::addBuiltinGlobals):
587 (WebCore::JSDOMGlobalObject::visitChildren):
588 * bindings/js/JSDOMGlobalObject.h:
589 (WebCore::getDOMConstructor):
590 * bindings/js/JSDOMPromise.cpp:
591 (WebCore::DeferredPromise::DeferredPromise):
592 (WebCore::DeferredPromise::clear):
593 * bindings/js/JSXPathResultCustom.cpp:
594 (WebCore::JSXPathResult::visitAdditionalChildren):
595 * dom/EventListenerMap.cpp:
596 (WebCore::EventListenerMap::clear):
597 (WebCore::EventListenerMap::replace):
598 (WebCore::EventListenerMap::add):
599 (WebCore::EventListenerMap::remove):
600 (WebCore::EventListenerMap::find):
601 (WebCore::EventListenerMap::removeFirstEventListenerCreatedFromMarkup):
602 (WebCore::EventListenerMap::copyEventListenersNotCreatedFromMarkupToTarget):
603 (WebCore::EventListenerIterator::EventListenerIterator):
604 * dom/EventListenerMap.h:
605 (WebCore::EventListenerMap::lock):
606 * dom/EventTarget.cpp:
607 (WebCore::EventTarget::visitJSEventListeners):
609 (WebCore::EventTarget::visitJSEventListeners): Deleted.
611 (WebCore::Node::eventTargetDataConcurrently):
612 (WebCore::Node::ensureEventTargetData):
613 (WebCore::Node::clearEventTargetData):
615 * page/MemoryRelease.cpp:
616 (WebCore::releaseCriticalMemory):
617 * page/cocoa/MemoryReleaseCocoa.mm:
618 (WebCore::jettisonExpensiveObjectsOnTopLevelNavigation):
619 (WebCore::registerMemoryReleaseNotifyCallbacks):
621 2016-12-08 Dave Hyatt <hyatt@apple.com>
623 [CSS Parser] Add strict checking for right parens to selector functions like :matches, :not etc.
624 https://bugs.webkit.org/show_bug.cgi?id=165624
626 Reviewed by Dean Jackson.
628 Unskipped fast/selectors/invalid-functional-pseudo-class.html.
630 * css/parser/CSSSelectorParser.cpp:
631 (WebCore::CSSSelectorParser::consumePseudo):
632 Bail if we don't actually consume a right parenthesis.
634 2016-12-08 Jeremy Jones <jeremyj@apple.com>
636 Exit fullscreen on escape key down, not up.
637 https://bugs.webkit.org/show_bug.cgi?id=165618
638 rdar://problem/29581688
640 This problem was introduced by https://bugs.webkit.org/show_bug.cgi?id=165416
641 The fix to only exit fullscreen on key down, not key up.
643 Reviewed by Jer Noble.
645 * page/EventHandler.cpp:
646 (WebCore::EventHandler::keyEvent):
648 2016-12-08 Dave Hyatt <hyatt@apple.com>
650 [CSS Parser] Unskip background parsing tests
651 https://bugs.webkit.org/show_bug.cgi?id=165619
653 Reviewed by Zalan Bujtas.
655 Change background-position so that the origin being set is tracked
656 on a per-x/y basis instead of as a single boolean. The single boolean
657 caused lousy computed style dumping, since we would switch into verbose
658 mode for both x and y, even if only one of them had a pair set for it.
660 * css/CSSComputedStyleDeclaration.cpp:
661 (WebCore::createPositionListForLayer):
662 * css/StyleBuilderConverter.h:
663 (WebCore::StyleBuilderConverter::convertPositionComponent):
664 * rendering/style/FillLayer.cpp:
665 (WebCore::FillLayer::FillLayer):
666 (WebCore::FillLayer::operator=):
667 (WebCore::FillLayer::fillUnsetProperties):
668 * rendering/style/FillLayer.h:
669 (WebCore::FillLayer::isBackgroundXOriginSet):
670 (WebCore::FillLayer::isBackgroundYOriginSet):
671 (WebCore::FillLayer::setBackgroundXOrigin):
672 (WebCore::FillLayer::setBackgroundYOrigin):
673 (WebCore::FillLayer::clearXPosition):
674 (WebCore::FillLayer::clearYPosition):
675 (WebCore::FillLayer::isBackgroundOriginSet): Deleted.
677 2016-12-08 Jeremy Jones <jeremyj@apple.com>
679 pointer lock should exit when a js alert is shown
680 https://bugs.webkit.org/show_bug.cgi?id=165423
681 rdar://problem/29430803
683 Reviewed by Jer Noble.
685 Test: pointer-lock/lock-lost-on-alert.html
687 * page/DOMWindow.cpp:
688 (WebCore::DOMWindow::alert):
689 (WebCore::DOMWindow::confirm):
690 (WebCore::DOMWindow::prompt):
692 2016-12-07 Sam Weinig <sam@webkit.org>
694 [WebIDL] WebGLContextAttributes should be a dictionary
695 https://bugs.webkit.org/show_bug.cgi?id=165572
697 Reviewed by Dean Jackson.
700 * WebCore.xcodeproj/project.pbxproj:
703 * bindings/js/JSHTMLCanvasElementCustom.cpp:
704 (WebCore::JSHTMLCanvasElement::getContext):
705 (WebCore::attributesFor3DContext): Deleted.
706 Re-work getContext to use JSDOMConvert and use the WebGLContextAttributes dictionary.
708 * bindings/scripts/CodeGeneratorJS.pm:
709 (NativeToJSValueDOMConvertNeedsState):
710 (NativeToJSValueDOMConvertNeedsGlobalObject):
711 Add missing inclusion of dictionaries.
713 * html/HTMLCanvasElement.cpp:
714 (WebCore::maxActivePixelMemory):
715 (WebCore::HTMLCanvasElement::getContext):
716 (WebCore::HTMLCanvasElement::is2dType):
717 (WebCore::HTMLCanvasElement::getContext2d):
718 (WebCore::shouldEnableWebGL):
719 (WebCore::HTMLCanvasElement::is3dType):
720 (WebCore::HTMLCanvasElement::getContextWebGL):
721 * html/HTMLCanvasElement.h:
722 Refactor context creation of 2d and WebGL contexts into their own functions. Make the
723 WebGL one take a WebGLContextAttributes struct.
725 * html/HTMLCanvasElement.idl:
726 No functionality change. Make IDL match the latest spec.
728 * html/canvas/CanvasContextAttributes.cpp: Removed.
729 * html/canvas/CanvasContextAttributes.h: Removed.
730 Remove unneeded base class.
732 * html/canvas/WebGLContextAttributes.cpp: Removed.
733 * html/canvas/WebGLContextAttributes.h:
734 Instead of a class, we can use a type alias of GraphicsContext3D::Attributes for
735 WebGLContextAttributes.
737 * html/canvas/WebGLContextAttributes.idl:
738 Convert to a dictionary.
740 * html/canvas/WebGL2RenderingContext.cpp:
741 * html/canvas/WebGL2RenderingContext.h:
742 * html/canvas/WebGLRenderingContextBase.cpp:
743 (WebCore::WebGLRenderingContextBase::create):
744 (WebCore::WebGLRenderingContextBase::WebGLRenderingContextBase):
745 (WebCore::WebGLRenderingContextBase::clearIfComposited):
746 (WebCore::WebGLRenderingContextBase::getContextAttributes):
747 (WebCore::WebGLRenderingContextBase::applyStencilTest):
748 * html/canvas/WebGLRenderingContextBase.h:
749 Update to WebGLContextAttributes by value, since it is a simple struct now. Update getContextAttributes
750 to return a std::optional<WebGLContextAttributes>.
752 * html/canvas/WebGLRenderingContextBase.idl:
753 Make getContextAttributes return a nullable WebGLContextAttributes, as per spec.
755 * platform/graphics/GraphicsContext3D.h:
756 Sort attributes into categories, one that match WebGLContextAttributes, and the remainder.
758 2016-12-08 Zalan Bujtas <zalan@apple.com>
760 Do not create multicolumn context for certain type of renderers.
761 https://bugs.webkit.org/show_bug.cgi?id=135601
762 <rdar://problem/27686300>
764 Reviewed by David Hyatt.
766 Certain type of renderers including forms should not initialize multicolumn context for
767 their inner (shadow) content. It just does not makes sense and is inline with what other browsers do.
769 Test: fast/multicol/no-multicol-for-textareas.html
771 * rendering/RenderBlockFlow.cpp:
772 (WebCore::RenderBlockFlow::willCreateColumns):
773 (WebCore::RenderBlockFlow::requiresColumns):
774 * rendering/RenderBlockFlow.h:
776 2016-12-08 Dave Hyatt <hyatt@apple.com>
778 [CSS Parser] REGRESSION: Values of 0 should not be allowed for -webkit-aspect-ratio
779 https://bugs.webkit.org/show_bug.cgi?id=165607
781 Reviewed by Simon Fraser.
783 Unskipped fast/css/aspect-ratio-parsing-tests.html.
785 * css/parser/CSSPropertyParser.cpp:
786 (WebCore::consumeWebkitAspectRatio):
787 Don't allow 0 as either the left or right value of the ratio.
789 2016-12-08 Antti Koivisto <antti@apple.com>
791 ::after and ::before don't work on :host
792 https://bugs.webkit.org/show_bug.cgi?id=164675
793 <rdar://problem/29231874>
795 Reviewed by Andreas Kling.
797 We didn't allow combining :host with any other selectors. Pseudo elements should be allowed.
799 Test: fast/shadow-dom/shadow-host-with-before-after.html
801 * css/ElementRuleCollector.cpp:
802 (WebCore::ElementRuleCollector::matchAuthorRules):
804 Allow pseudo element matching.
806 (WebCore::ElementRuleCollector::matchHostPseudoClassRules):
808 Use the normal collectMatchingRulesForList path instead of a direct call to SelectorChecker::matchHostPseudoClass.
809 This path supports pseudo elements.
811 Pass the information that we are matching :host rules with m_isMatchingHostPseudoClass bit
812 similarly to how this is done with slots.
814 (WebCore::ElementRuleCollector::ruleMatches):
815 * css/ElementRuleCollector.h:
818 Collect :host rules similarly to other rules.
820 (WebCore::RuleSet::addRule):
821 * css/SelectorChecker.cpp:
823 Rename didMoveToShadowHost->mayMatchHostPseudoClass for clarity.
825 (WebCore::SelectorChecker::match):
827 Enable :host matching in the current context immediately if needed.
829 (WebCore::SelectorChecker::matchHostPseudoClass):
831 The check for illegal combinations with :host is now done in checkOne().
833 (WebCore::localContextForParent):
834 (WebCore::SelectorChecker::checkOne):
836 In context where :host matches nothing else can match, except pseudo elements.
838 * css/SelectorChecker.h:
840 2016-12-08 Alex Christensen <achristensen@webkit.org>
845 Add PerformanceLoggingCocoa.mm after r209181.
847 2016-12-08 Per Arne Vollan <pvollan@apple.com>
849 [Win] Some versions of Cygwin Perl generate incorrect C++ code.
850 https://bugs.webkit.org/show_bug.cgi?id=165524
851 rdar://problem/29508043
853 Reviewed by Daniel Bates.
855 Perl strings with variables seems to be handled differently, depending on which version of
856 Cygwin Perl you are running. To make sure they are handled identically, specify variables
857 in strings as "${var}" instead of "$var".
859 * bindings/scripts/CodeGeneratorJS.pm:
861 (GenerateImplementation):
863 2016-12-08 Alex Christensen <achristensen@webkit.org>
865 Fix EFL build after r209526
866 https://bugs.webkit.org/show_bug.cgi?id=165594
868 * css/parser/CSSPropertyParserHelpers.cpp:
869 (WebCore::CSSPropertyParserHelpers::consumePositiveIntegerRaw):
870 nullptr is being automatically converted to false everywhere but EFL.
871 It should be false. This function returns a bool.
873 2016-12-07 Dave Hyatt <hyatt@apple.com>
875 REGRESSION: font shorthand parsing is broken
876 https://bugs.webkit.org/show_bug.cgi?id=165594
878 Reviewed by Zalan Bujtas.
880 Unskipping fast/css/font-calculated-value.html.
882 * css/parser/CSSPropertyParser.cpp:
883 (WebCore::consumeFontWeight):
884 The new parser did not support calc() in the font-weight property.
885 In order to support a positive integer, add new functions to consume
886 and handle positive integers without making a CSSPrimitiveValue out of
887 the number. These correspond to consumeNumberRaw but are limited to positive
890 (WebCore::CSSPropertyParser::consumeFont):
891 The implicit bool was incorrectly set to true when properties were
892 defined because releaseNonNull() cleared the variables being null
893 checked. Add separate booleans to avoid this.
895 * css/parser/CSSPropertyParserHelpers.cpp:
896 (WebCore::CSSPropertyParserHelpers::CalcParser::consumePositiveIntegerRaw):
897 (WebCore::CSSPropertyParserHelpers::consumePositiveIntegerRaw):
898 * css/parser/CSSPropertyParserHelpers.h:
899 Add the new helpers that consume positive integers without creating
900 CSSPrimitiveValues out of them.
902 2016-12-07 Jeremy Jones <jeremyj@apple.com>
904 Exit pointer lock when page goes into page cache.
905 https://bugs.webkit.org/show_bug.cgi?id=165425
906 rdar://problem/29430834
908 Reviewed by Jer Noble.
910 Test: pointer-lock/lock-lost-on-navigation.html
912 Cancel pointer lock when page goes into page cache and add methods to Internals
916 (WebCore::Document::setPageCacheState):
917 * page/PointerLockController.h:
918 * testing/Internals.cpp:
919 (WebCore::Internals::pageHasPendingPointerLock):
920 (WebCore::Internals::pageHasPointerLock):
921 * testing/Internals.h:
922 * testing/Internals.idl:
924 2016-12-07 Antoine Quint <graouts@apple.com>
926 [Modern Media Controls] Tracks panel does not display in the right location in fullscreen and cannot be dismissed
927 https://bugs.webkit.org/show_bug.cgi?id=165575
929 Reviewed by Dean Jackson.
931 We position the tracks panel programmatically based on the current bounds of the fullscreen button in fullscreen.
932 This allows for the tracks panel to be shown in the right spot even after dragging the controls bar. We also use
933 the fullscreen media controls as the target for tracking "mousedown" events when the tracks panel is shown in a
934 fullscreen presentation.
936 Tests: media/modern-media-controls/tracks-support/tracks-support-show-panel-after-dragging-controls.html
937 media/modern-media-controls/tracks-support/tracks-support-show-panel-fullscreen.html
939 * Modules/modern-media-controls/controls/macos-fullscreen-media-controls.css:
940 (.media-controls.mac.fullscreen .scrubber):
941 (.media-controls.mac.fullscreen .tracks-panel): Deleted.
942 * Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js:
943 (MacOSFullscreenMediaControls.prototype.showTracksPanel):
944 * Modules/modern-media-controls/controls/tracks-panel.js:
945 (TracksPanel.prototype.presentInParent):
946 (TracksPanel.prototype.hide):
947 (TracksPanel.prototype.get bottomY):
948 (TracksPanel.prototype.set bottomY):
949 (TracksPanel.prototype.commitProperty):
950 (TracksPanel.prototype._mousedownTarget):
952 2016-12-07 Antoine Quint <graouts@apple.com>
954 [Modern Media Controls] Use a small picture-in-picture button in fullscreen
955 https://bugs.webkit.org/show_bug.cgi?id=165587
957 Reviewed by Dean Jackson.
959 Use a newer, smaller asset for picture-in-picture in fullscreen.
961 * Modules/modern-media-controls/controls/icon-service.js:
962 * Modules/modern-media-controls/images/macOS/pip-in-fullscreen@1x.png: Added.
963 * Modules/modern-media-controls/images/macOS/pip-in-fullscreen@2x.png: Added.
965 2016-12-07 Dean Jackson <dino@apple.com>
967 Remove runtime toggle for pointer-lock
968 https://bugs.webkit.org/show_bug.cgi?id=165577
969 <rdar://problems/29566996>
973 Remove any runtime calls to check if pointer-lock is enabled. It's
974 either compiled in or out.
976 Covered by existing tests.
978 * bindings/generic/RuntimeEnabledFeatures.h:
979 (WebCore::RuntimeEnabledFeatures::setPointerLockEnabled): Deleted.
980 (WebCore::RuntimeEnabledFeatures::pointerLockEnabled): Deleted.
984 * page/PointerLockController.cpp:
985 (WebCore::PointerLockController::requestPointerLock):
986 (WebCore::PointerLockController::requestPointerUnlock):
987 (WebCore::PointerLockController::requestPointerUnlockAndForceCursorVisible):
989 2016-12-07 John Wilander <wilander@apple.com>
991 Allow commas in Accept, Accept-Language, and Content-Language request headers for simple CORS
992 https://bugs.webkit.org/show_bug.cgi?id=165566
993 <rdar://problem/29560983>
995 Reviewed by Alex Christensen.
997 Updated the existing tests.
999 * platform/network/HTTPParsers.cpp:
1000 (WebCore::isValidAcceptHeaderValue):
1001 Now also accepts ','.
1002 (WebCore::isValidLanguageHeaderValue):
1005 2016-12-07 Dave Hyatt <hyatt@apple.com>
1007 [CSS Parser] Stop skipping tests in the css3 LayoutTests subdirectory
1008 https://bugs.webkit.org/show_bug.cgi?id=165574
1010 Reviewed by Dean Jackson.
1012 * css/CSSGroupingRule.cpp:
1013 (WebCore::CSSGroupingRule::insertRule):
1014 The old parser didn't support the creation of @namespace rules in the
1015 CSS OM, but the new parser does. We need to ensure that just like for
1016 @import rules, that the insertion of a @namespace rule inside a
1017 @supports rule is not allowed. This test passed in the old parser because
1018 the rule just didn't get created, but in the new parser, we need to
1019 add a check along with the @import rule check to ensure it isn't allowed.
1021 2016-12-07 Antoine Quint <graouts@apple.com>
1023 [Modern Media Controls] Remove aspect ratio button
1024 https://bugs.webkit.org/show_bug.cgi?id=165571
1026 Reviewed by Dean Jackson.
1028 Since we do not have a way to toggle letterboxing on an HTMLMediaElement, we remove the
1029 corresponding button in the media controls.
1031 * Modules/modern-media-controls/controls/aspect-ratio-button.js: Removed.
1032 * Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js:
1033 * Modules/modern-media-controls/js-files:
1035 2016-12-07 Jeremy Jones <jeremyj@apple.com>
1037 One esc to exit fullscreen and pointer lock
1038 https://bugs.webkit.org/show_bug.cgi?id=165416
1039 rdar://problem/29430711
1041 Reviewed by Jer Noble.
1043 Test: pointer-lock/lock-lost-on-esc-in-fullscreen.html
1045 When handling escape, also exit fullscreen on escape.
1046 This also means that escape can exit fullscreen in TestRunner.
1048 * page/EventHandler.cpp:
1049 (WebCore::EventHandler::keyEvent):
1051 2016-12-07 Yusuke Suzuki <utatane.tea@gmail.com>
1053 [JSC] Drop translate phase in module loader
1054 https://bugs.webkit.org/show_bug.cgi?id=164861
1056 Reviewed by Saam Barati.
1058 * bindings/js/JSDOMWindowBase.cpp:
1059 * bindings/js/JSWorkerGlobalScopeBase.cpp:
1061 2016-12-07 Keith Rollin <krollin@apple.com>
1063 Network event record/replay
1064 https://bugs.webkit.org/show_bug.cgi?id=164527
1065 <rdar://problem/29168157>
1067 Reviewed by Alex Christensen.
1069 Export parseURLEncodedForm.
1071 No new tests -- no functionality added, changed, or removed.
1073 * platform/URLParser.h:
1075 2016-12-07 Dave Hyatt <hyatt@apple.com>
1077 [CSS Parser] Consolidate string/ident/url serialization functions
1078 https://bugs.webkit.org/show_bug.cgi?id=165552
1080 Reviewed by Zalan Bujtas.
1082 Right now CSSParser has string, ident and url serialization functions
1083 called quoteCSStringIfNeeded (which actually serializes both strings and
1084 identifiers), as well as quoteCSSURLIfNeeded.
1086 CSSMarkup already has serialization functions that exist outside of the
1087 CSSParser and that handle serialization of strings, idents and URLs. This
1088 patch eliminates the CSSParser functions and consolidates all of the
1089 serialization to use CSSMarkup's functions.
1091 Note that we are not spec-compliant at all here, and so I had to amend
1092 the functions to support our non-spec-compliant serialization. The goal
1093 of this patch is consolidation and not to fix our broken serialization.
1095 Notable changes include parameterizing string serialization so that
1096 both single and double quotes are supported, since in the existing code
1097 we're sometimes spec-compliant (CSSSelectors) and sometimes not
1098 (CSSPrimitiveValue).
1100 We also overload CSS_STRING primitive value type and have it act as both
1101 a string and a custom identifier. This is lame, since the parser should
1102 have made two different types of objects instead, but since our parser
1103 doesn't do that yet, I added a serializeAsStringOrCustomIdent that
1104 preserves our old behavior of "quote the string only if needed." In this
1105 case what that really meant was "Try to guess that we were originally a
1106 custom ident and leave off quotes if so." This function will go away
1107 once we properly create CSSStringValues and CSSCustomIdentValues instead
1108 of turning the latter into strings.
1110 * css/CSSBasicShapes.cpp:
1111 (WebCore::buildPathString):
1112 * css/CSSImageValue.cpp:
1113 (WebCore::CSSImageValue::customCSSText):
1114 * css/CSSMarkup.cpp:
1115 (WebCore::isCSSTokenizerURL):
1116 (WebCore::serializeString):
1117 (WebCore::serializeURL):
1118 (WebCore::serializeAsStringOrCustomIdent):
1119 (WebCore::serializeURI): Deleted.
1121 * css/CSSPrimitiveValue.cpp:
1122 (WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText):
1123 * css/CSSSelector.cpp:
1124 (WebCore::CSSSelector::selectorText):
1125 * css/parser/CSSParser.cpp:
1126 (WebCore::isCSSTokenizerIdent): Deleted.
1127 (WebCore::isCSSTokenizerURL): Deleted.
1128 (WebCore::quoteCSSStringInternal): Deleted.
1129 (WebCore::quoteCSSString): Deleted.
1130 (WebCore::quoteCSSStringIfNeeded): Deleted.
1131 (WebCore::quoteCSSURLIfNeeded): Deleted.
1132 * css/parser/CSSParser.h:
1133 * html/HTMLElement.cpp:
1134 (WebCore::HTMLElement::mapLanguageAttributeToLocale):
1136 2016-12-07 Dean Jackson <dino@apple.com>
1138 Expose internal API to detect media documents
1139 https://bugs.webkit.org/show_bug.cgi?id=165559
1140 <rdar://problems/29564054>
1142 Reviewed by Antoine Quint.
1144 Expose via MediaControlsHost whether or not we're in
1147 Since MediaControlsHost is only exposed to our
1148 internal controls, it's not possible to test this
1149 directly. However, a subsequent test for media documents
1150 with audio-only content will cover this change.
1152 * Modules/mediacontrols/MediaControlsHost.cpp: Add isInMediaDocument and put const on
1153 various methods that should have it.
1154 (WebCore::MediaControlsHost::captionDisplayMode):
1155 (WebCore::MediaControlsHost::supportsFullscreen):
1156 (WebCore::MediaControlsHost::isVideoLayerInline):
1157 (WebCore::MediaControlsHost::isInMediaDocument):
1158 * Modules/mediacontrols/MediaControlsHost.h:
1159 * Modules/mediacontrols/MediaControlsHost.idl: Add isInMediaDocument.
1161 2016-12-07 Zalan Bujtas <zalan@apple.com>
1163 ASSERTION FAILED: count >= 1 in WebCore::RenderMultiColumnSet::columnCount
1164 https://bugs.webkit.org/show_bug.cgi?id=136365
1165 <rdar://problem/27686727>
1167 Reviewed by Simon Fraser.
1169 Margin value overflow ends up confusing the column count computing logic.
1171 Test: fast/multicol/assert-on-column-count-when-zoomed-in.html
1173 * css/StyleResolver.cpp:
1174 (WebCore::addIntrinsicMargins):
1176 2016-12-07 Ryosuke Niwa <rniwa@webkit.org>
1178 document.caretRangeFromPoint doesn't retarget the resultant Range correctly.
1179 https://bugs.webkit.org/show_bug.cgi?id=165146
1181 Reviewed by Sam Weinig.
1183 The bug was caused by caretRangeFromPoint not retargeting the resultant Range correctly.
1184 Namely, it's possible for RenderObject::positionForPoint to move across shadow boundary
1185 even if node was identically equal to ancestorInThisScope(node).
1187 Fixed the bug by directly retargeting the range's container node and its offset as done
1188 for elementFromPoint in r206795.
1190 Test: fast/shadow-dom/caret-range-from-point-in-shadow-tree.html
1193 (WebCore::Document::caretRangeFromPoint):
1195 2016-12-07 Antoine Quint <graouts@apple.com>
1197 [Modern Media Controls] Entering fullscreen and returning to inline shows fullscreen controls
1198 https://bugs.webkit.org/show_bug.cgi?id=165536
1200 Reviewed by Tim Horton.
1202 We regressed when we implemented the fix for webkit.org/b/165494 and we started to rely solely
1203 on the "webkitpresentationmodechanged" event to identify presention mode changes. As it turns out,
1204 when the "webkitpresentationmodechanged" event is dispatched when exiting fullscreen and returning
1205 to the inline presentation mode, querying the "webkitPresentationMode" property says "inline" while
1206 "webkitDisplayingFullscreen" still returns true (raised as webkit.org/b/165538).
1208 We now use the "webkitPresentationMode" property when that property is supported and we're using the
1209 "webkitpresentationmodechanged" event, and we use the "webkitDisplayingFullscreen" property otherwise.
1211 Test: media/modern-media-controls/media-controller/media-controller-inline-to-fullscreen-to-inline.html
1213 * Modules/modern-media-controls/media/media-controller.js:
1214 (MediaController.prototype.get layoutTraits):
1216 2016-12-07 Wenson Hsieh <wenson_hsieh@apple.com>
1218 Scroll position jumps to the origin when scrolling without momentum at the end of a scroll snapping container
1219 https://bugs.webkit.org/show_bug.cgi?id=165474
1220 <rdar://problem/29534305>
1222 Reviewed by Simon Fraser.
1224 When initializing an AppKit _NSScrollingMomentumCalculator, if the initial and target positions are the same and
1225 the initial velocity is (0, 0), the momentum calculator will output (0, 0) as the animated scroll position when
1226 animating. This causes the scroll position to jump to the top left in some cases when scrolling in scroll snap
1227 containers. To fix this, we teach the ScrollingMomentumCalculatorMac to return an animation duration of 0 and
1228 an animated scroll position equal to the final scroll position when this is the case.
1230 Test: tiled-drawing/scrolling/scroll-snap/scrolling-jumps-to-top.html
1232 * page/scrolling/mac/ScrollingMomentumCalculatorMac.h:
1233 * page/scrolling/mac/ScrollingMomentumCalculatorMac.mm:
1234 (WebCore::ScrollingMomentumCalculatorMac::ScrollingMomentumCalculatorMac):
1235 (WebCore::ScrollingMomentumCalculatorMac::scrollOffsetAfterElapsedTime):
1236 (WebCore::ScrollingMomentumCalculatorMac::animationDuration):
1238 2016-12-07 Nan Wang <n_wang@apple.com>
1240 AX: menu type toolbar should be mapped correctly on Mac
1241 https://bugs.webkit.org/show_bug.cgi?id=165537
1243 Reviewed by Chris Fleizach.
1245 The menu tag with a toolbar type should have the corresponding role.
1247 Test: accessibility/mac/menu-type-toolbar.html
1249 * accessibility/AccessibilityRenderObject.cpp:
1250 (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
1252 2016-12-07 Wenson Hsieh <wenson_hsieh@apple.com>
1254 Add a new project for recording and playing back editing commands in editable web content
1255 https://bugs.webkit.org/show_bug.cgi?id=165114
1256 <rdar://problem/29408135>
1258 Reviewed by Beth Dakin.
1260 Adds new scripts used to record and play back editing, as well as a new Xcode Copy files phase that pushes these
1261 scripts to the internal system directory when installing. See the Tools ChangeLog and individual comments below
1262 for more details. Covered by 3 new unit tests in the EditingHistory project.
1264 * InternalScripts/DumpEditingHistory.js: Added.
1265 (beginProcessingTopLevelUpdate):
1266 (endProcessingTopLevelUpdate):
1267 (appendDOMUpdatesFromRecords):
1268 (appendSelectionUpdateIfNecessary):
1270 Adds new entries into the top-level list of DOM updates captured when editing. Respectively, these are input
1271 events and selection changes.
1273 (EditingHistory.getEditingHistoryAsJSONString):
1274 * InternalScripts/EditingHistoryUtil.js: Added.
1275 (prototype._scramble):
1276 (prototype.applyToText):
1277 (prototype.applyToFilename):
1278 (prototype._scrambedNumberIndexForCode):
1279 (prototype._scrambedLowercaseIndexForCode):
1280 (prototype._scrambedUppercaseIndexForCode):
1282 Naive implementation of an obfuscator. Currently, this only affects alphanumeric characters. Obfuscation is off
1283 by default, but can be toggled on in JavaScript.
1285 (elementFromMarkdown):
1287 (GlobalNodeMap.prototype.nodesForGUIDs):
1288 (GlobalNodeMap.prototype.guidsForTNodes):
1289 (GlobalNodeMap.prototype.nodeForGUID):
1290 (GlobalNodeMap.prototype.guidForNode):
1291 (GlobalNodeMap.prototype.hasGUIDForNode):
1292 (GlobalNodeMap.prototype.nodes):
1293 (GlobalNodeMap.prototype.toObject):
1294 (GlobalNodeMap.fromObject):
1295 (GlobalNodeMap.dataForNode):
1296 (GlobalNodeMap.elementFromTagName):
1297 (GlobalNodeMap.nodeAttributesToObject):
1298 (GlobalNodeMap.prototype.descriptionHTMLForGUID):
1299 (GlobalNodeMap.prototype.descriptionHTMLForNode):
1301 The GlobalNodeMap keeps track of every node that has appeared in the DOM, assigning each node a globally unique
1302 identifier (GUID). This GUID is used when reconstructing the DOM, as well as unapplying or applying editing.
1305 (SelectionState.prototype.isEqual):
1306 (SelectionState.prototype.applyToSelection):
1307 (SelectionState.fromSelection):
1308 (SelectionState.prototype.toObject):
1309 (SelectionState.fromObject):
1311 Represents a snapshot of the Selection state (determined by getSelection()).
1314 (DOMUpdate.prototype.apply):
1315 (DOMUpdate.prototype.unapply):
1316 (DOMUpdate.prototype.targetNode):
1317 (DOMUpdate.prototype.detailsElement):
1319 (DOMUpdate.fromRecords):
1321 A DOMUpdate is an abstract object representing a change in the DOM that may be applied and unapplied. These are
1322 also serializable as hashes, which may then be converted to JSON when generating editing history data.
1325 (ChildListUpdate.prototype.apply):
1326 (ChildListUpdate.prototype.unapply):
1327 (ChildListUpdate.prototype._nextSibling):
1328 (ChildListUpdate.prototype._removedNodes):
1329 (ChildListUpdate.prototype._addedNodes):
1330 (ChildListUpdate.prototype.toObject):
1331 (ChildListUpdate.prototype.detailsElement):
1332 (ChildListUpdate.fromObject):
1334 These three update types correspond to the three types of DOM mutations. These may appear as top-level updates
1335 if they are not captured during an input event, but for the majority of user-input-driven changes, they will be
1336 children of an input event.
1338 (CharacterDataUpdate):
1339 (CharacterDataUpdate.prototype.apply):
1340 (CharacterDataUpdate.prototype.unapply):
1341 (CharacterDataUpdate.prototype.detailsElement):
1342 (CharacterDataUpdate.prototype.toObject):
1343 (CharacterDataUpdate.fromObject):
1345 (AttributeUpdate.prototype.apply):
1346 (AttributeUpdate.prototype.unapply):
1347 (AttributeUpdate.prototype.detailsElement):
1348 (AttributeUpdate.prototype.toObject):
1349 (AttributeUpdate.fromObject):
1351 (SelectionUpdate.prototype.apply):
1352 (SelectionUpdate.prototype.unapply):
1353 (SelectionUpdate.prototype.toObject):
1354 (SelectionUpdate.fromObject):
1355 (SelectionUpdate.prototype._rangeDescriptionHTML):
1356 (SelectionUpdate.prototype._anchorDescriptionHTML):
1357 (SelectionUpdate.prototype._focusDescriptionHTML):
1358 (SelectionUpdate.prototype.detailsElement):
1360 Represents a change in the Selection. While no changes to the DOM structure occur as a result of a
1361 SelectionUpdate, the information contained in these updates is used to determine where the selection should be
1362 when rewinding or playing back the editing history.
1365 (InputEventUpdate.prototype._obfuscatedData):
1366 (InputEventUpdate.prototype.apply):
1367 (InputEventUpdate.prototype.unapply):
1368 (InputEventUpdate.prototype.toObject):
1369 (InputEventUpdate.fromObject):
1370 (InputEventUpdate.prototype.detailsElement):
1372 Represents an update due to user input, which consists of some number of child DOM mutation updates.
1374 * WebCore.xcodeproj/project.pbxproj:
1376 2016-12-07 Jer Noble <jer.noble@apple.com>
1378 ASSERT crash while running media-source/mediasource-activesourcebuffers.html under Stress GC bot.
1379 https://bugs.webkit.org/show_bug.cgi?id=165514
1381 Reviewed by Eric Carlson.
1383 If a track associated with MSE is disabled after a SourceBuffer begins parsing a queued
1384 append operation, SourceBuffer can get into a state where it asks SourceBufferPrivateAVFObjC
1385 if it is ready to accept data for that disabled track. This causes an ASSERT_NOT_REACHED in
1386 isReadyForMoreData().
1388 However, this seems to be a valid condition; we can safely just return "false" from
1389 isReadyForMoreSamples() (and also bail from notifyClientWhenReadyForMoreSamples()) when asked
1390 about a disabled track.
1392 * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1393 (WebCore::SourceBufferPrivateAVFObjC::isReadyForMoreSamples):
1394 (WebCore::SourceBufferPrivateAVFObjC::notifyClientWhenReadyForMoreSamples):
1396 2016-12-07 Dave Hyatt <hyatt@apple.com>
1398 [CSS Parser] Eliminate the Scope class and fold it into CSSTokenizer
1399 https://bugs.webkit.org/show_bug.cgi?id=165532
1401 Reviewed by Dean Jackson.
1403 The Scope class, nested inside CSSTokenizer, is both poorly named and serves
1404 no purpose. It's especially weird that it was the entry point into tokenization
1405 instead of CSSTokenizer.
1407 Eliminate the class, fold its members and functions into CSSTokenizer, and have
1408 callers just make a CSSTokenizer instead.
1410 * css/parser/CSSParser.cpp:
1411 (WebCore::CSSParser::parseSupportsCondition):
1412 (WebCore::CSSParser::parseSelector):
1413 * css/parser/CSSParserImpl.cpp:
1414 (WebCore::CSSParserImpl::parseValue):
1415 (WebCore::CSSParserImpl::parseCustomPropertyValue):
1416 (WebCore::CSSParserImpl::parseInlineStyleDeclaration):
1417 (WebCore::CSSParserImpl::parseDeclarationList):
1418 (WebCore::CSSParserImpl::parseRule):
1419 (WebCore::CSSParserImpl::parseStyleSheet):
1420 (WebCore::CSSParserImpl::parseKeyframeKeyList):
1421 (WebCore::CSSParserImpl::parseDeclarationListForInspector):
1422 (WebCore::CSSParserImpl::parseStyleSheetForInspector):
1423 * css/parser/CSSTokenizer.cpp:
1424 (WebCore::CSSTokenizer::CSSTokenizer):
1425 (WebCore::CSSTokenizer::tokenRange):
1426 (WebCore::CSSTokenizer::tokenCount):
1427 (WebCore::CSSTokenizer::registerString):
1428 (WebCore::CSSTokenizer::Scope::Scope): Deleted.
1429 (WebCore::CSSTokenizer::Scope::tokenRange): Deleted.
1430 (WebCore::CSSTokenizer::Scope::tokenCount): Deleted.
1431 * css/parser/CSSTokenizer.h:
1432 (WebCore::CSSTokenizer::Scope::storeString): Deleted.
1433 * css/parser/CSSTokenizerInputStream.cpp:
1434 (WebCore::CSSTokenizerInputStream::CSSTokenizerInputStream):
1435 * css/parser/CSSTokenizerInputStream.h:
1436 * css/parser/MediaQueryParser.cpp:
1437 (WebCore::MediaQueryParser::parseMediaQuerySet):
1438 * css/parser/SizesAttributeParser.cpp:
1439 (WebCore::SizesAttributeParser::SizesAttributeParser):
1441 2016-12-07 Joseph Pecoraro <pecoraro@apple.com>
1443 Web Inspector: Remove unused and mostly untested Page domain commands and events
1444 https://bugs.webkit.org/show_bug.cgi?id=165507
1446 Reviewed by Brian Burg.
1448 Remove any code associated with the commands/events being removed.
1450 * inspector/DOMPatchSupport.cpp:
1451 * inspector/DOMPatchSupport.h:
1452 * inspector/InspectorClient.h:
1453 (WebCore::InspectorClient::handleJavaScriptDialog): Deleted.
1454 * inspector/InspectorInstrumentation.cpp:
1455 (WebCore::InspectorInstrumentation::scriptsEnabledImpl): Deleted.
1456 (WebCore::InspectorInstrumentation::willRunJavaScriptDialogImpl): Deleted.
1457 (WebCore::InspectorInstrumentation::didRunJavaScriptDialogImpl): Deleted.
1458 * inspector/InspectorInstrumentation.h:
1459 (WebCore::InspectorInstrumentation::scriptsEnabled): Deleted.
1460 (WebCore::InspectorInstrumentation::willRunJavaScriptDialog): Deleted.
1461 (WebCore::InspectorInstrumentation::didRunJavaScriptDialog): Deleted.
1462 * inspector/InspectorPageAgent.cpp:
1463 (WebCore::InspectorPageAgent::disable):
1464 (WebCore::InspectorPageAgent::didClearWindowObjectInWorld):
1465 (WebCore::InspectorPageAgent::didPaint):
1466 (WebCore::InspectorPageAgent::buildObjectForFrame):
1467 (WebCore::InspectorPageAgent::archive):
1468 (WebCore::createXHRTextDecoder): Deleted.
1469 (WebCore::InspectorPageAgent::getScriptExecutionStatus): Deleted.
1470 (WebCore::InspectorPageAgent::setScriptExecutionDisabled): Deleted.
1471 (WebCore::InspectorPageAgent::willRunJavaScriptDialog): Deleted.
1472 (WebCore::InspectorPageAgent::didRunJavaScriptDialog): Deleted.
1473 (WebCore::InspectorPageAgent::scriptsEnabled): Deleted.
1474 (WebCore::InspectorPageAgent::handleJavaScriptDialog): Deleted.
1475 * inspector/InspectorPageAgent.h:
1477 (WebCore::Chrome::runBeforeUnloadConfirmPanel):
1478 (WebCore::Chrome::runJavaScriptAlert):
1479 (WebCore::Chrome::runJavaScriptConfirm):
1480 (WebCore::Chrome::runJavaScriptPrompt):
1481 * page/Settings.cpp:
1482 (WebCore::Settings::setScriptEnabled):
1484 2016-12-07 Jer Noble <jer.noble@apple.com>
1486 [pointer-lock] Cursor should become visible when exiting pointer-lock via ESC key.
1487 https://bugs.webkit.org/show_bug.cgi?id=165377
1489 Reviewed by Eric Carlson.
1491 Follow up to previous patch; clear the m_forceCursorVisibleUponUnlock flag upon losing
1492 pointer lock, so that subsequent unlocks don't erroneously cause the cursor to become
1495 * page/PointerLockController.cpp:
1496 (WebCore::PointerLockController::didLosePointerLock):
1498 2016-12-06 Geoffrey Garen <ggaren@apple.com>
1500 performance.now() should truncate to 100us
1501 https://bugs.webkit.org/show_bug.cgi?id=165503
1502 <rdar://problem/29544531>
1504 Reviewed by Mark Lam.
1506 * page/Performance.cpp:
1507 (WebCore::Performance::reduceTimeResolution):
1509 2016-12-07 Dave Hyatt <hyatt@apple.com>
1511 [CSS Parser] Turn back on a bunch of layout tests
1512 https://bugs.webkit.org/show_bug.cgi?id=165529
1514 Reviewed by Zalan Bujtas.
1516 Fixes fast/css/transform-origin-parsing.html.
1518 * css/parser/CSSPropertyParser.cpp:
1519 (WebCore::CSSPropertyParser::consumeTransformOrigin):
1520 The implicit check was relying on a null check of the z value, but
1521 we called releaseNonNull on it already. This meant all z properties were
1522 marked as implicit incorrectly. Fix by storing whether or not we had a z
1523 value in a local variable.
1525 2016-12-07 Andreas Kling <akling@apple.com>
1527 [iOS] Remove bitrotted FrameLoader attempt to limit page caching under memory pressure.
1528 <https://webkit.org/b/165527>
1530 Reviewed by Antti Koivisto.
1532 This code no longer does anything, as the page cache is hard capped
1533 at 0 entries while under memory pressure.
1535 * loader/FrameLoader.cpp:
1536 (WebCore::FrameLoader::commitProvisionalLoad):
1538 2016-12-06 Antoine Quint <graouts@apple.com>
1540 [Modern Media Controls] Use tap and pinch gestures on iOS
1541 https://bugs.webkit.org/show_bug.cgi?id=165518
1543 Reviewed by Dean Jackson.
1545 We now use touch events to identify taps and pinches on media controls to respond immediately
1546 to user interaction on buttons and enter fullscreen when pinching out.
1548 * Modules/modern-media-controls/controls/button.css:
1550 * Modules/modern-media-controls/controls/button.js:
1552 (Button.prototype.handleEvent):
1553 (Button.prototype.gestureRecognizerStateDidChange):
1554 (Button.prototype._notifyDelegateOfActivation):
1555 (Button.prototype._handleUIEvent): Deleted.
1556 * Modules/modern-media-controls/controls/controls-bar.js:
1557 (ControlsBar.prototype.set fadesWhileIdle):
1558 (ControlsBar.prototype.gestureRecognizerStateDidChange):
1559 * Modules/modern-media-controls/controls/icon-button.js:
1560 (IconButton.prototype._updateImage):
1562 * Modules/modern-media-controls/controls/ios-inline-media-controls.js:
1563 (IOSInlineMediaControls.prototype.gestureRecognizerStateDidChange):
1564 * Modules/modern-media-controls/gesture-recognizers/gesture-recognizer.js: Added.
1565 (GestureRecognizer):
1566 (GestureRecognizer.prototype.get state):
1567 (GestureRecognizer.prototype.set state):
1568 (GestureRecognizer.prototype.get target):
1569 (GestureRecognizer.prototype.set target):
1570 (GestureRecognizer.prototype.get numberOfTouches):
1571 (GestureRecognizer.prototype.get enabled):
1572 (GestureRecognizer.prototype.set enabled):
1573 (GestureRecognizer.prototype.reset):
1574 (GestureRecognizer.prototype.locationInElement):
1575 (GestureRecognizer.prototype.locationInClient):
1576 (GestureRecognizer.prototype.locationOfTouchInElement):
1577 (GestureRecognizer.prototype.touchesBegan):
1578 (GestureRecognizer.prototype.touchesMoved):
1579 (GestureRecognizer.prototype.touchesEnded):
1580 (GestureRecognizer.prototype.touchesCancelled):
1581 (GestureRecognizer.prototype.gestureBegan):
1582 (GestureRecognizer.prototype.gestureChanged):
1583 (GestureRecognizer.prototype.gestureEnded):
1584 (GestureRecognizer.prototype.enterPossibleState):
1585 (GestureRecognizer.prototype.enterBeganState):
1586 (GestureRecognizer.prototype.enterEndedState):
1587 (GestureRecognizer.prototype.enterCancelledState):
1588 (GestureRecognizer.prototype.enterFailedState):
1589 (GestureRecognizer.prototype.enterChangedState):
1590 (GestureRecognizer.prototype.enterRecognizedState):
1591 (GestureRecognizer.prototype.handleEvent):
1592 (GestureRecognizer.prototype._initRecognizer):
1593 (GestureRecognizer.prototype._updateBaseListeners):
1594 (GestureRecognizer.prototype._removeTrackingListeners):
1595 (GestureRecognizer.prototype._updateTargetTouches):
1596 (GestureRecognizer.prototype._updateKeyboardModifiers):
1597 * Modules/modern-media-controls/gesture-recognizers/pinch.js: Added.
1598 (PinchGestureRecognizer):
1599 (PinchGestureRecognizer.prototype.get velocity):
1600 (PinchGestureRecognizer.prototype.touchesBegan):
1601 (PinchGestureRecognizer.prototype.touchesMoved):
1602 (PinchGestureRecognizer.prototype.touchesEnded):
1603 (PinchGestureRecognizer.prototype.gestureBegan):
1604 (PinchGestureRecognizer.prototype.gestureChanged):
1605 (PinchGestureRecognizer.prototype.gestureEnded):
1606 (PinchGestureRecognizer.prototype.reset):
1607 (PinchGestureRecognizer.prototype._recordGesture):
1608 (PinchGestureRecognizer.prototype._updateStateWithEvent):
1609 (PinchGestureRecognizer.prototype._distance):
1610 * Modules/modern-media-controls/gesture-recognizers/tap.js: Added.
1611 (TapGestureRecognizer):
1612 (TapGestureRecognizer.prototype.touchesBegan):
1613 (TapGestureRecognizer.prototype.touchesMoved):
1614 (TapGestureRecognizer.prototype.touchesEnded):
1615 (TapGestureRecognizer.prototype.reset):
1616 (TapGestureRecognizer.prototype.locationInElement):
1617 (TapGestureRecognizer.prototype.locationInClient):
1618 (TapGestureRecognizer.prototype._clearTimer):
1619 (TapGestureRecognizer.prototype._rewindTimer):
1620 (TapGestureRecognizer.prototype._timerFired):
1621 * Modules/modern-media-controls/js-files:
1622 * Modules/modern-media-controls/media/airplay-support.js:
1623 (AirplaySupport.prototype.buttonWasClicked): Deleted.
1624 * Modules/modern-media-controls/media/controls-visibility-support.js:
1625 (ControlsVisibilitySupport):
1626 (ControlsVisibilitySupport.prototype.handleEvent):
1627 (ControlsVisibilitySupport.prototype.syncControl): Deleted.
1628 * Modules/modern-media-controls/media/fullscreen-support.js:
1629 (FullscreenSupport):
1630 (FullscreenSupport.prototype.iOSInlineMediaControlsRecognizedPinchInGesture):
1631 (FullscreenSupport.prototype.buttonWasClicked): Deleted.
1632 * Modules/modern-media-controls/media/media-controller-support.js:
1633 (MediaControllerSupport):
1634 (MediaControllerSupport.prototype.handleEvent):
1635 (MediaControllerSupport.prototype.buttonWasClicked): Deleted.
1636 * Modules/modern-media-controls/media/mute-support.js:
1637 (MuteSupport.prototype.buttonWasClicked): Deleted.
1638 * Modules/modern-media-controls/media/pip-support.js:
1639 (PiPSupport.prototype.buttonWasClicked): Deleted.
1640 * Modules/modern-media-controls/media/playback-support.js:
1641 (PlaybackSupport.prototype.buttonWasClicked): Deleted.
1642 * Modules/modern-media-controls/media/skip-back-support.js:
1643 (SkipBackSupport.prototype.buttonWasClicked): Deleted.
1644 * Modules/modern-media-controls/media/start-support.js:
1645 (StartSupport.prototype.buttonWasClicked): Deleted.
1646 * Modules/modern-media-controls/media/tracks-support.js:
1647 (TracksSupport.prototype.buttonWasClicked): Deleted.
1649 2016-12-06 Dean Jackson <dino@apple.com>
1651 Apply styling to media documents with modern controls
1652 https://bugs.webkit.org/show_bug.cgi?id=165499
1653 <rdar://problems/29543847>
1655 Reviewed by Antoine Quint.
1657 Forgot to commit most of the changes in MediaDocument.cpp :(
1659 * html/MediaDocument.cpp:
1660 (WebCore::MediaDocumentParser::createDocumentStructure):
1662 2016-12-06 Simon Fraser <simon.fraser@apple.com>
1664 Two tiled drawing tests failing with visual viewports enabled.
1665 https://bugs.webkit.org/show_bug.cgi?id=165489
1667 Reviewed by Dean Jackson.
1669 computeLayoutViewportOrigin() gets called for iframes when the layout viewport
1670 is zero-sized, but the visual viewport is non-zero. It doesn't really make sense
1671 to compute a layout viewport when the visual viewport is larger than the layout
1672 viewport, but if this happens just anchor the layout viewport at the origin
1673 of the visual viewport.
1675 * page/FrameView.cpp:
1676 (WebCore::FrameView::computeLayoutViewportOrigin):
1678 2016-12-04 Darin Adler <darin@apple.com>
1680 Remove various stray uses of WebCore::Dictionary
1681 https://bugs.webkit.org/show_bug.cgi?id=165358
1683 Reviewed by Sam Weinig.
1685 I discovered three completely unused classes in the MediaStream code:
1686 MediaTrackConstraint, MediaTrackConstraintSet, and MediaTrackConstraints.
1687 While there is some chance we may implement these at some point, they are
1688 likely to be dictionaries or some other kind of data structure rather than
1689 clases, and there is no reason to keep the current classes.
1691 * CMakeLists.txt: Removed MediaTrackConstraint, MediaTrackConstraintSet,
1692 and MediaTrackConstraints.
1693 * DerivedSources.cpp: Ditto.
1694 * DerivedSources.make: Ditto.
1696 * Modules/indexeddb/IDBDatabase.h: Removed include of Dictionary.h.
1697 * Modules/indexeddb/IDBObjectStore.cpp: Added include of HeapInlines.h.
1698 * Modules/indexeddb/IDBRequest.cpp: Added include of StrongInlines.h.
1699 * Modules/indexeddb/IDBTransaction.cpp: Added include of SerializedScriptValue.h.
1701 * Modules/mediastream/MediaStreamTrack.cpp:
1702 (WebCore::MediaStreamTrack::getConstraints): Deleted.
1703 This function is implemented entirely in the bindings layer.
1704 * Modules/mediastream/MediaStreamTrack.h: Removed getConstraints.
1706 * Modules/mediastream/MediaTrackConstraint.cpp: Removed.
1707 * Modules/mediastream/MediaTrackConstraint.h: Removed.
1708 * Modules/mediastream/MediaTrackConstraint.idl: Removed.
1709 * Modules/mediastream/MediaTrackConstraintSet.cpp: Removed.
1710 * Modules/mediastream/MediaTrackConstraintSet.h: Removed.
1711 * Modules/mediastream/MediaTrackConstraintSet.idl: Removed.
1712 * Modules/mediastream/MediaTrackConstraints.cpp: Removed.
1713 * Modules/mediastream/MediaTrackConstraints.h: Removed.
1714 * Modules/mediastream/MediaTrackConstraints.idl: Removed.
1716 * Modules/mediastream/NavigatorUserMedia.idl: Use the type names from the latest
1717 getUserMedia specification for the arguments to webkitGetUserMedia; not sure they
1718 are precisely correct for this legacy function, but since this is a JSBuiltin,
1719 it's all ignored anyway. Just important not to call anything "Dictionary".
1721 * WebCore.xcodeproj/project.pbxproj: Removed MediaTrackConstraint, MediaTrackConstraintSet,
1722 and MediaTrackConstraints.
1724 * bindings/js/JSApplePaySessionCustom.cpp:
1725 (WebCore::JSApplePaySession::completeShippingMethodSelection): Use uncheckedArgument, since
1726 the code explicitly checks the number of arguments.
1727 (WebCore::JSApplePaySession::completeShippingContactSelection): Ditto.
1728 (WebCore::JSApplePaySession::completePaymentMethodSelection): Ditto.
1730 * bindings/js/JSFontFaceCustom.cpp: Removed include of Dictionary.h.
1731 * dom/Document.cpp: Ditto.
1732 * dom/Element.cpp: Ditto.
1734 * dom/Element.h: Removed forward declaration of Dictionary.
1736 2016-12-06 Wenson Hsieh <wenson_hsieh@apple.com>
1738 After preventing a beforeinput event, an input event is fired when formatting rich text
1739 https://bugs.webkit.org/show_bug.cgi?id=165435
1740 <rdar://problem/29522314>
1742 Reviewed by Ryosuke Niwa.
1744 This regressed after I refactored some input event event dispatch logic when formatting text in r208461.
1745 I moved the logic for dispatching input events when applying styles into Editor::applyStyle, but left out an
1746 early return after firing the beforeinput event if the default behavior was prevented, which caused us to
1747 continue on and dispatch an input event. The fix is to bail from applyStyle if default was prevented.
1749 Augmented an existing layout test to cover this case.
1751 * editing/Editor.cpp:
1752 (WebCore::Editor::applyStyle):
1753 (WebCore::Editor::applyParagraphStyle):
1755 2016-12-06 Antoine Quint <graouts@apple.com>
1757 [Modern Media Controls] Instantiate iOS media controls
1758 https://bugs.webkit.org/show_bug.cgi?id=165498
1760 Reviewed by Dean Jackson.
1762 Add support for the modern media controls runtime flags in RenderThemeIOS and, when instantiating iOS controls,
1763 return an IOSInlineMediaControls class.
1765 * Modules/modern-media-controls/media/media-controller.js:
1766 (MediaController.prototype._controlsClass):
1768 * rendering/RenderThemeIOS.h:
1769 * rendering/RenderThemeIOS.mm:
1770 (WebCore::RenderThemeIOS::mediaControlsStyleSheet):
1771 (WebCore::RenderThemeIOS::mediaControlsScript):
1772 (WebCore::RenderThemeIOS::mediaControlsBase64StringForIconAndPlatform):
1774 2016-12-06 Dean Jackson <dino@apple.com>
1776 Apply styling to media documents with modern controls
1777 https://bugs.webkit.org/show_bug.cgi?id=165499
1778 <rdar://problems/29543847>
1780 Reviewed by Antoine Quint.
1782 Existing MediaDocuments got styling from the injected style
1783 sheet, which had rules for such documents. The modern media controls
1784 use a scoped style rule, so we can't touch the document style. Instead,
1785 inline the style directly from MediaDocument.
1787 Test: media/modern-media-controls/media-documents/background-color-and-centering.html
1789 * html/MediaDocument.cpp:
1790 (WebCore::MediaDocumentParser::createDocumentStructure):
1792 2016-12-06 Zalan Bujtas <zalan@apple.com>
1794 Move RenderElement::rendererForRootBackground to RenderView.
1795 https://bugs.webkit.org/show_bug.cgi?id=165454
1797 Reviewed by Simon Fraser.
1799 Currently RenderElement::rendererForRootBackground can only be called on document element's renderer.
1800 This patch removes this limitation and moves the functionality from RenderElement to RenderView.
1802 No change in functionality.
1804 * page/FrameView.cpp:
1805 (WebCore::FrameView::calculateExtendedBackgroundMode):
1806 * rendering/RenderBox.cpp:
1807 (WebCore::RenderBox::paintRootBoxFillLayers):
1808 * rendering/RenderElement.cpp:
1809 (WebCore::RenderElement::rendererForRootBackground): Deleted.
1810 * rendering/RenderElement.h:
1811 * rendering/RenderLayerBacking.cpp:
1812 (WebCore::RenderLayerBacking::rendererBackgroundColor):
1813 * rendering/RenderView.cpp:
1814 (WebCore::RenderView::rendererForRootBackground):
1815 (WebCore::rendererObscuresBackground):
1816 (WebCore::RenderView::paintBoxDecorations):
1817 (WebCore::RenderView::rootBackgroundIsEntirelyFixed):
1818 * rendering/RenderView.h:
1820 2016-12-05 Jiewen Tan <jiewen_tan@apple.com>
1822 [Part 1 of 2] Add support for SPKI format while doing SubtleCrypto.importKey/exportKey
1823 https://bugs.webkit.org/show_bug.cgi?id=129978
1824 <rdar://problem/21799829>
1826 This is part 1 of Bug 129978. In this patch, it adds the SPKI format support for
1827 SubtleCrypto.importKey/exportKey. Currently support algorithms are RSAES-PKCS1-v1_5,
1828 RSASSA-PKCS1-v1_5 and RSA-OAEP.
1830 Reviewed by Brent Fulgham.
1832 Tests: crypto/subtle/rsa-import-jwk-key-export-spki-key.html
1833 crypto/subtle/rsa-import-spki-key-export-jwk-key.html
1834 crypto/subtle/rsa-import-spki-key-export-spki-key.html
1835 crypto/subtle/rsa-import-spki-small-key.html
1836 crypto/subtle/rsa-oaep-generate-export-key-spki.html
1837 crypto/subtle/rsa-oaep-import-spki-key.html
1838 crypto/subtle/rsaes-pkcs1-v1_5-generate-export-key-spki.html
1839 crypto/subtle/rsaes-pkcs1-v1_5-import-spki-key.html
1840 crypto/subtle/rsassa-pkcs1-v1_5-generate-export-key-spki.html
1841 crypto/subtle/rsassa-pkcs1-v1_5-import-spki-key.html
1842 crypto/workers/subtle/rsa-export-spki-key.html
1843 crypto/workers/subtle/rsa-import-spki-key.html
1845 * bindings/js/JSSubtleCryptoCustom.cpp:
1846 (WebCore::toKeyData):
1847 * crypto/CommonCryptoUtilities.h:
1848 * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
1849 (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::importKey):
1850 (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::exportKey):
1851 * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
1852 (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::importKey):
1853 (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::exportKey):
1854 * crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
1855 (WebCore::CryptoAlgorithmRSA_OAEP::importKey):
1856 (WebCore::CryptoAlgorithmRSA_OAEP::exportKey):
1857 * crypto/gnutls/CryptoKeyRSAGnuTLS.cpp:
1858 (WebCore::CryptoKeyRSA::importSpki):
1859 (WebCore::CryptoKeyRSA::exportSpki):
1860 * crypto/keys/CryptoKeyRSA.h:
1861 * crypto/mac/CryptoKeyRSAMac.cpp:
1862 (WebCore::bytesUsedToEncodedLength):
1863 (WebCore::bytesNeededForEncodedLength):
1864 (WebCore::addEncodedASN1Length):
1865 (WebCore::CryptoKeyRSA::importSpki):
1866 (WebCore::CryptoKeyRSA::exportSpki):
1868 2016-12-06 Simon Fraser <simon.fraser@apple.com>
1870 Fix editing text flakiness introduced in r209411
1871 https://bugs.webkit.org/show_bug.cgi?id=165500
1873 Reviewed by Dean Jackson.
1875 The "insideFixed" out param was left uninitialized sometimes. This affected FrameSelection's
1876 m_caretInsidePositionFixed, which caused problems in these tests.
1878 Tested by editing tests in WK1.
1880 * editing/htmlediting.cpp:
1881 (WebCore::absoluteBoundsForLocalCaretRect):
1883 2016-12-06 Alexey Proskuryakov <ap@apple.com>
1885 Correct SDKROOT values in xcconfig files
1886 https://bugs.webkit.org/show_bug.cgi?id=165487
1887 rdar://problem/29539209
1889 Reviewed by Dan Bernstein.
1891 Fix suggested by Dan Bernstein.
1893 * Configurations/DebugRelease.xcconfig:
1895 2016-12-06 Saam Barati <sbarati@apple.com>
1897 Remove old Wasm object model
1898 https://bugs.webkit.org/show_bug.cgi?id=165481
1900 Reviewed by Keith Miller and Mark Lam.
1902 * testing/Internals.cpp:
1903 (WebCore::Internals::parserMetaData):
1905 2016-12-06 Antoine Quint <graouts@apple.com>
1907 [Modern Media Controls] Media controls use the fullscreen layout after going from inline to fullscreen to PiP to inline
1908 https://bugs.webkit.org/show_bug.cgi?id=165494
1910 Reviewed by Dean Jackson.
1912 We would only call _updateControlsIfNeeded() when entering or leaving fullscreen, so we going from fullscreen to PiP to
1913 inline would retain fullscreen controls since we would not check for the event that indicates we went back from PiP to
1914 inline. On platforms that support it, we listen to the "webkitpresentationmodechanged" event
1915 to update the controls, and only "webkitfullscreenchange" on others (ie. Yosemite).
1917 Test: media/modern-media-controls/media-controller/media-controller-inline-to-fullscreen-to-pip-to-inline.html
1919 * Modules/modern-media-controls/media/media-controller.js:
1921 (MediaController.prototype.handleEvent):
1922 (MediaController.prototype._returnMediaLayerToInlineIfNeeded):
1924 2016-12-06 Antoine Quint <graouts@apple.com>
1926 [Modern Media Controls] Rendering issues with controls bar when captions are on
1927 https://bugs.webkit.org/show_bug.cgi?id=165390
1929 Reviewed by Dean Jackson.
1931 We would face some layout issues with captions due to RenderImage::layoutShadowControls()
1932 expecting a single RenderBox in the media controls shadow root, which was the case with
1933 legacy media controls, but no longer the case with modern media controls. We now host
1934 both the captions and the media controls elements under a single container, and add
1935 an asertion in RenderImage to check that a single RenderBox child exists.
1937 Test: media/modern-media-controls/media-controller/media-controller-single-container.html
1939 * Modules/modern-media-controls/controls/media-controls.css:
1940 (.media-controls-container):
1941 (.media-controls-container,):
1942 (.media-controls-container > *):
1944 * Modules/modern-media-controls/controls/text-tracks.css:
1945 (video::-webkit-media-text-track-container):
1946 * Modules/modern-media-controls/media/media-controller.js:
1948 (MediaController.prototype._updateControlsIfNeeded):
1949 * rendering/RenderImage.cpp:
1950 (WebCore::RenderImage::layoutShadowControls):
1952 2016-12-06 Antoine Quint <graouts@apple.com>
1954 [Modern Media Controls] Automatically hide the controls bar when the mouse is idle
1955 https://bugs.webkit.org/show_bug.cgi?id=165492
1957 Reviewed by Dean Jackson.
1959 We now automatically hide the controls bar. When the media is no longer paused, the controls remain
1960 visible for 4 seconds, regardless of where the mouse pointer is located. When the user mouses over the
1961 media, the controls become visible and automatically hide 4 seconds after the last time the user has
1962 moved his mouse over the media. When the user mouses out of the media, the controls automatically hide.
1963 When the mouse is over the controls bar, it remains visible. When the media is paused, the controls bar
1964 remain visible regardless of the mouse position.
1966 Tests: media/modern-media-controls/media-controller/media-controller-auto-hide-mouse-enter-and-mouse-leave.html
1967 media/modern-media-controls/media-controller/media-controller-auto-hide-mouse-enter-over-controls-bar.html
1968 media/modern-media-controls/media-controller/media-controller-auto-hide-mouse-leave-after-play.html
1969 media/modern-media-controls/media-controller/media-controller-auto-hide-pause.html
1970 media/modern-media-controls/media-controller/media-controller-auto-hide-rewind-with-mouse-enter.html
1971 media/modern-media-controls/media-controller/media-controller-auto-hide.html
1973 * Modules/modern-media-controls/controls/controls-bar.css: Added.
1975 (.controls-bar.faded):
1976 * Modules/modern-media-controls/controls/controls-bar.js:
1977 (ControlsBar.prototype.get userInteractionEnabled):
1978 (ControlsBar.prototype.set userInteractionEnabled):
1979 (ControlsBar.prototype.get fadesWhileIdle):
1980 (ControlsBar.prototype.set fadesWhileIdle):
1981 (ControlsBar.prototype.get visible):
1982 (ControlsBar.prototype.set visible):
1983 (ControlsBar.prototype.get faded):
1984 (ControlsBar.prototype.set faded):
1985 (ControlsBar.prototype.handleEvent):
1986 (ControlsBar.prototype.commitProperty):
1987 (ControlsBar.prototype._cancelAutoHideTimer):
1988 (ControlsBar.prototype._rewindAutoHideTimer):
1989 (ControlsBar.prototype._autoHideTimerFired):
1990 * Modules/modern-media-controls/controls/media-controls.js:
1991 * Modules/modern-media-controls/media/controls-visibility-support.js:
1992 (ControlsVisibilitySupport.prototype.get mediaEvents):
1993 (ControlsVisibilitySupport.prototype.syncControl):
1994 (ControlsVisibilitySupport):
1995 * Modules/modern-media-controls/media/media-controller.js:
1996 (MediaController.prototype._updateControlsIfNeeded):
1998 2016-12-06 Zalan Bujtas <zalan@apple.com>
2000 Can not select whole line when using flexbox
2001 https://bugs.webkit.org/show_bug.cgi?id=165299
2003 Reviewed by David Hyatt.
2005 RootInlineBox::selectionTopAdjustedForPrecedingBlock assumes that the preceding block is
2006 always above the current line. However in certain layout contexts (flex as an example) the block before
2007 could just be on the same line as the current one.
2009 This patch checks if we actually need to adjust the selection top to avoid vertical selection overlap.
2011 Test: fast/flexbox/flexbox-fail-to-select-same-line.html
2013 * rendering/RenderBlock.cpp:
2014 (WebCore::RenderBlock::blockBeforeWithinSelectionRoot): Deleted.
2015 * rendering/RenderBlock.h:
2016 * rendering/RootInlineBox.cpp:
2017 (WebCore::blockBeforeWithinSelectionRoot):
2018 (WebCore::RootInlineBox::selectionTopAdjustedForPrecedingBlock):
2020 2016-12-06 Ryosuke Niwa <rniwa@webkit.org>
2022 Add more assertions to ElementQueue diagnose a bug
2023 https://bugs.webkit.org/show_bug.cgi?id=164814
2025 Reviewed by Alexey Proskuryakov.
2027 Set m_invoking in release builds now that assertions are also run in release builds.
2029 * dom/CustomElementReactionQueue.cpp:
2030 (WebCore::CustomElementReactionStack::ElementQueue::invokeAll):
2032 2016-12-06 Jer Noble <jer.noble@apple.com>
2034 YouTube sometimes pauses when switching tabs
2035 https://bugs.webkit.org/show_bug.cgi?id=165468
2037 Reviewed by Eric Carlson.
2039 Test: media/media-session-restrictions.html
2041 The bitfield which represents the restrictions for "VideoAudio" media type was unititialized,
2042 leading to what was effectively a random set of restrictions at runtime.
2044 * platform/audio/PlatformMediaSessionManager.cpp:
2045 (WebCore::PlatformMediaSessionManager::resetRestrictions):
2046 * testing/Internals.cpp:
2047 (WebCore::mediaTypeFromString):
2048 (WebCore::Internals::setMediaSessionRestrictions):
2049 (WebCore::Internals::mediaSessionRestrictions):
2050 * testing/Internals.h:
2051 * testing/Internals.idl:
2053 2016-12-06 Mark Lam <mark.lam@apple.com>
2055 Introduce the concept of Immutable Prototype Exotic Objects to comply with the spec.
2056 https://bugs.webkit.org/show_bug.cgi?id=165227
2057 <rdar://problem/29442665>
2059 Reviewed by Saam Barati.
2061 Make all objects in window.__proto__'s prototype chain immutable prototype exotic
2062 objects. This gives us roughly equivalent behavior to other browsers.
2064 Firefox's behavior differ slightly in that Firefox will fail any attempted
2065 assignment their __proto__, while the immutable prototype exotic objects will
2066 only fail if the assignment is of a different value. See
2067 https://tc39.github.io/ecma262/#sec-immutable-prototype-exotic-objects.
2069 Chrome differs in that assignment to window.__proto__ is also handled like an
2070 immutable prototype exotic object. Instead we adhere to the current HTML spec
2071 that says that the assignment should fail unconditionally. See
2072 https://html.spec.whatwg.org/#the-windowproxy-exotic-object and
2073 https://html.spec.whatwg.org/#windowproxy-setprototypeof.
2075 If the HTML spec is changed to make the WindowProxy and Location objects into
2076 immutable prototype exotic objects later, we can update to match the spec then.
2078 Test: js/prototype-assignment.html
2080 * bindings/js/JSDOMWindowProperties.h:
2081 * bindings/scripts/CodeGeneratorJS.pm:
2083 (GeneratePrototypeDeclaration):
2084 * bindings/scripts/IDLAttributes.txt:
2085 * dom/EventTarget.idl:
2086 * page/DOMWindow.idl:
2088 2016-12-06 Andreas Kling <akling@apple.com>
2090 [Cocoa] Add some memory usage related information to sysdiagnose state dumps
2091 <https://webkit.org/b/165375>
2092 <rdar://problem/29057243>
2094 Reviewed by Darin Adler.
2096 Follow-up to address two more review comments.
2098 * page/PerformanceLogging.cpp:
2099 (WebCore::PerformanceLogging::javaScriptObjectCounts): Use WTFMove() when returning the
2100 HashCountedSet to avoid making an extra copy.
2102 2016-12-06 Dave Hyatt <hyatt@apple.com>
2104 REGRESSION (Safari 10): Scrolling not working inside height 100% table
2105 https://bugs.webkit.org/show_bug.cgi?id=164366
2106 <rdar://problem/29095535>
2108 Reviewed by Zalan Bujtas.
2110 Added fast/table/overflow-percent-height-regression.html
2112 * rendering/RenderBox.cpp:
2113 (WebCore::RenderBox::computePercentageLogicalHeight):
2114 This patch wasn't merged correctly from Blink. The value returned needed
2117 2016-12-06 Sam Weinig <sam@webkit.org>
2119 REGRESSION: media/track LayoutTests are flaky failures
2120 https://bugs.webkit.org/show_bug.cgi?id=165432
2122 Reviewed by Antoine Quint.
2124 RenderThemeMac was caching the media controls script / style sheets
2125 and not being invalidated when the RuntimeEnabledFeatures changed. So,
2126 we can just cache both.
2128 * bindings/generic/RuntimeEnabledFeatures.h:
2129 Initialize m_areModernMediaControlsEnabled to false.
2131 * rendering/RenderThemeMac.h:
2132 * rendering/RenderThemeMac.mm:
2133 (WebCore::RenderThemeMac::mediaControlsStyleSheet):
2134 (WebCore::RenderThemeMac::mediaControlsScript):
2135 Have separate caches for the modern and legacy media control scripts/style sheets.
2137 2016-12-06 Sam Weinig <sam@webkit.org>
2139 DumpRenderTree crashed in com.apple.WebCore: WebCore::MockMediaEndpoint::generateDtlsInfo const + 23
2140 https://bugs.webkit.org/show_bug.cgi?id=165486
2141 <rdar://problem/29149588>
2143 Reviewed by Tim Horton.
2145 The MockMediaEndpoint can be destroyed before the task created in MockMediaEndpoint::generateDtlsInfo()
2146 gets a chance to run, so guard it with a weak pointer.
2148 * platform/mock/MockMediaEndpoint.cpp:
2149 (WebCore::MockMediaEndpoint::MockMediaEndpoint):
2150 (WebCore::MockMediaEndpoint::generateDtlsInfo):
2151 * platform/mock/MockMediaEndpoint.h:
2153 2016-12-06 Chris Dumez <cdumez@apple.com>
2155 Add HTML interactive form validation blacklist for some WebKit-specific sites
2156 https://bugs.webkit.org/show_bug.cgi?id=165470
2157 <rdar://problem/29509424>
2159 Reviewed by Simon Fraser.
2161 Add HTML interactive form validation blacklist for some WebKit-specific sites
2162 expecting our old behavior, until they get a chance to be updated.
2164 * html/HTMLFormElement.cpp:
2165 (WebCore::isURLBlacklistedForInteractiveFormValidation):
2166 (WebCore::HTMLFormElement::prepareForSubmission):
2168 2016-12-06 Chris Dumez <cdumez@apple.com>
2170 Unreviewed, rollout r209050.
2172 This change may impact other popovers than the HTML validation one.
2173 The previous code is safer.
2175 * platform/ValidationBubble.h:
2176 * platform/ios/ValidationBubbleIOS.mm:
2177 (-[WebValidationBubbleDelegate adaptivePresentationStyleForPresentationController:traitCollection:]):
2178 (WebCore::ValidationBubble::setAnchorRect):
2179 * platform/spi/ios/UIKitSPI.h:
2181 2016-12-05 Simon Fraser <simon.fraser@apple.com>
2183 Improve the behavior of scroll-into-view when the target is inside position:fixed
2184 https://bugs.webkit.org/show_bug.cgi?id=165354
2186 Reviewed by Zalan Bujtas.
2188 The existing RenderLayer::scrollRectToVisible() code paid no heed to whether the
2189 target was inside position:fixed, resulting in unwanted scrolls.
2191 Fix this by plumbing through from the call sites a "insideFixed" flag which we get
2192 when we call localToAbsolute(), and use this flag to avoid scrolling at all if
2195 If zoomed and we're focussing something inside position:fixed, and if visual viewports
2196 are enabled, we can compute the visual viewport required to reveal the target rect,
2197 which gives us the ideal scroll position.
2199 Fix a bug on non-iOS platforms when zoomed, which is to scale the viewRect since
2200 frameView.visibleContentRect() gives an unscaled rect on those platforms.
2202 Not all callers of scrollRectToVisible() are fixed, but those that are not will get
2203 the current behavior.
2205 Tests: fast/overflow/scroll-anchor-in-position-fixed.html
2206 fast/visual-viewport/zoomed-scroll-into-view-fixed.html
2207 fast/visual-viewport/zoomed-scroll-to-anchor-in-position-fixed.html
2210 (WebCore::Element::scrollIntoView):
2211 (WebCore::Element::scrollIntoViewIfNeeded):
2212 (WebCore::Element::scrollIntoViewIfNotVisible):
2213 (WebCore::Element::updateFocusAppearance):
2214 * editing/FrameSelection.cpp:
2215 (WebCore::FrameSelection::FrameSelection):
2216 (WebCore::FrameSelection::absoluteCaretBounds):
2217 (WebCore::FrameSelection::recomputeCaretRect):
2218 (WebCore::FrameSelection::revealSelection):
2219 * editing/FrameSelection.h:
2220 * editing/VisiblePosition.cpp:
2221 (WebCore::VisiblePosition::absoluteCaretBounds):
2222 * editing/VisiblePosition.h:
2223 * editing/htmlediting.cpp:
2224 (WebCore::absoluteBoundsForLocalCaretRect):
2225 * editing/htmlediting.h:
2226 * page/FrameView.cpp:
2227 (WebCore::FrameView::scrollElementToRect):
2228 (WebCore::FrameView::scrollToAnchor):
2229 * page/PrintContext.cpp:
2230 (WebCore::PrintContext::outputLinkedDestinations):
2231 * rendering/RenderElement.cpp:
2232 (WebCore::RenderElement::getLeadingCorner):
2233 (WebCore::RenderElement::getTrailingCorner):
2234 (WebCore::RenderElement::absoluteAnchorRect):
2235 (WebCore::RenderElement::anchorRect): Deleted.
2236 * rendering/RenderElement.h:
2237 * rendering/RenderLayer.cpp:
2238 (WebCore::RenderLayer::scrollRectToVisible):
2239 (WebCore::RenderLayer::getRectToExpose):
2240 (WebCore::RenderLayer::autoscroll):
2241 * rendering/RenderLayer.h:
2242 * rendering/RenderObject.cpp:
2243 (WebCore::RenderObject::scrollRectToVisible):
2244 * rendering/RenderObject.h:
2246 2016-12-06 Myles C. Maxfield <mmaxfield@apple.com>
2248 [Cocoa] REGRESSION(r205396): Intermediate CTRuns with initial advances get double counted when glyph origins are enabled
2249 https://bugs.webkit.org/show_bug.cgi?id=165084
2251 Reviewed by Simon Fraser.
2253 When glyph origins are not enabled, an intermediate CTRun's initial advance is simply added
2254 to the previous glyph's advance. However, when glyph origins are enabled, this shouldn't
2257 Test: fast/text/initial-advance-in-intermediate-run-complex.html
2259 * platform/graphics/mac/ComplexTextController.cpp:
2260 (WebCore::ComplexTextController::adjustGlyphsAndAdvances):
2262 2016-12-06 Simon Fraser <simon.fraser@apple.com>
2264 Enable visual viewports by default on Mac, and iOS Wk2
2265 https://bugs.webkit.org/show_bug.cgi?id=165452
2267 Reviewed by Zalan Bujtas.
2269 Some tests revealed an issue where, during scrollbar updates, the visual viewport would be
2270 15px wider than the layout viewport, which results in the layout viewport shifting 15px to the
2271 right. Prevent this by disallowing viewport updates during the AdjustViewSize phase; we'll
2272 be called again in postLayoutTasks.
2274 * page/FrameView.cpp:
2275 (WebCore::FrameView::updateLayoutViewport):
2277 2016-12-06 Daniel Bates <dabates@apple.com>
2279 Cleanup: Rename some HTTP 0.9-specific functions to conform to WebKit Code Style Guidelines
2280 https://bugs.webkit.org/show_bug.cgi?id=165451
2282 Reviewed by Alex Christensen.
2284 Rename Document::shouldEnforceHTTP0_9Sandbox() and ResourceResponseBase::isHttpVersion0_9()
2285 to Document::shouldEnforceHTTP09Sandbox() and ResourceResponseBase::isHTTP09, respectively,
2286 to conform to the WebKit Code Style Guidelines.
2289 (WebCore::Document::initSecurityContext):
2290 (WebCore::Document::shouldEnforceHTTP09Sandbox): Renamed; formerly named shouldEnforceHTTP0_9Sandbox
2292 * platform/network/ResourceHandle.cpp:
2293 (WebCore::ResourceHandle::didReceiveResponse):
2294 * platform/network/ResourceResponseBase.cpp:
2295 (WebCore::ResourceResponseBase::isHTTP09): Renamed; formerly named isHttpVersion0_9.
2296 * platform/network/ResourceResponseBase.h:
2298 2016-12-06 Daniel Bates <dabates@apple.com>
2300 Use Vector::uncheckedAppend() in more places
2301 https://bugs.webkit.org/show_bug.cgi?id=164952
2303 Reviewed by Darin Adler.
2305 We can use Vector::uncheckedAppend() whenever the number of items that will be appended
2306 to a vector is equal to or less than its capacity. Using Vector::uncheckedAppend() is
2307 more efficient than Vector::append() as it avoids checking the capacity of the vector
2308 before appending a value to the end of it.
2310 * bindings/js/SerializedScriptValue.cpp:
2311 (WebCore::SerializedScriptValue::SerializedScriptValue):
2312 * contentextensions/DFABytecodeCompiler.cpp:
2313 (WebCore::ContentExtensions::DFABytecodeCompiler::extractJumpTable):
2314 * contentextensions/DFAMinimizer.cpp:
2315 * css/StyleProperties.cpp:
2316 (WebCore::StyleProperties::copyPropertiesInSet): Use Vector::uncheckedAppend() and inline
2317 the assignment of the temporary variable value into the if condition to limit its scope
2318 as it is referenced exactly once in the loop body.
2319 * css/StyleRule.cpp:
2320 (WebCore::StyleRuleGroup::StyleRuleGroup): Use Vector::uncheckedAppend() and write for-loop
2321 using a C++11 range-based for-loop.
2322 * css/parser/CSSParserValues.cpp:
2323 (WebCore::CSSParserSelector::setLangArgumentList):
2324 * cssjit/SelectorCompiler.cpp:
2325 (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthLastChildOf):
2326 * dom/DocumentMarkerController.cpp:
2327 (WebCore::updateRenderedRectsForMarker):
2328 * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
2329 (WebCore::convertToLayoutUnits):
2330 * platform/audio/AudioBus.cpp:
2331 (WebCore::AudioBus::AudioBus):
2332 * platform/graphics/FontCache.cpp:
2333 (WebCore::FontCache::purgeInactiveFontData):
2334 * platform/graphics/PathUtilities.cpp:
2335 (WebCore::polygonsForRect):
2336 * platform/mediastream/CaptureDeviceManager.cpp:
2337 (CaptureDeviceManager::bestSourcesForTypeAndConstraints):
2338 * platform/mediastream/RealtimeMediaSource.cpp:
2339 (WebCore::RealtimeMediaSource::fitnessDistance):
2340 * platform/network/cf/FormDataStreamCFNet.cpp:
2341 (WebCore::formCreate):
2343 2016-12-04 Darin Adler <darin@apple.com>
2345 Use ASCIICType more, and improve it a little bit
2346 https://bugs.webkit.org/show_bug.cgi?id=165360
2348 Reviewed by Sam Weinig.
2350 * css/CSSGrammar.y.in: Use isASCIIDigit.
2352 * css/parser/CSSParser.cpp:
2353 (WebCore::CSSParser::parseFontFaceUnicodeRange): Use isASCIIHexDigit and
2355 (WebCore::isEqualToCSSIdentifier): Use isASCIILower.
2356 * html/FormController.cpp:
2357 (WebCore::isNotFormControlTypeCharacter): Use isASCIILower.
2358 * html/parser/CSSPreloadScanner.cpp:
2359 (WebCore::CSSPreloadScanner::tokenize): Use isASCIIAlpha.
2360 * platform/Decimal.cpp:
2361 (WebCore::Decimal::fromString): Use isASCIIDigit.
2362 * platform/FileSystem.cpp:
2363 (WebCore::decodeFromFilename): Use isASCIIHexDigit and toASCIIHexValue.
2365 (WebCore::isLetterMatchIgnoringCase): Deleted.
2366 (WebCore::isSchemeCharacterMatchIgnoringCase): Deleted.
2367 (WebCore::assertProtocolIsGood): Use isASCIIUpper.
2368 (WebCore::URL::protocolIs): Use isASCIIAlphaCaselessEqual.
2369 (WebCore::URL::parse): Ditto.
2370 (WebCore::protocolIs): Ditto.
2371 (WebCore::protocolIsInHTTPFamily): Ditto.
2372 * platform/URLParser.cpp:
2373 (WeCore::URLParser::parseIPv4Piece): Use isASCIIDigit.
2375 * platform/mac/WebCoreNSURLExtras.mm:
2376 (WebCore::isRussianDomainNameCharacter): Use isASCIIDigit.
2377 (WebCore::allCharactersAllowedByTLDRules): Ditto.
2378 (WebCore::dataWithUserTypedString): Use upperNibbleToASCIIHexDigit and
2379 lowerNibbleToASCIIHexDigit.
2380 (WebCore::dataForURLComponentType): Ditto.
2381 (WebCore::createStringWithEscapedUnsafeCharacters): Ditto.
2382 (WebCore::userVisibleString): Use isASCIIHexDigit, toASCIIHexValue,
2383 upperNibbleToASCIIHexDigit, and lowerNibbleToASCIIHexDigit.
2384 (WebCore::isUserVisibleURL): Use isASCIIHexDigit and toASCIIHexValue.
2386 * platform/network/FormDataBuilder.cpp:
2387 (WebCore::FormDataBuilder::encodeStringAsFormData): Use isASCIIAlphanumeric.
2389 * rendering/mathml/RenderMathMLToken.cpp:
2390 (WebCore::mathVariant): Use isASCIIUpper, isASCIILower, and isASCIIDigit.
2392 * svg/SVGParserUtilities.cpp:
2393 (WebCore::genericParseNumber): Use isASCIIDigit.
2394 * svg/SVGPathStringSource.cpp:
2395 (WebCore::nextCommandHelper): Ditto.
2396 * xml/XPathParser.cpp:
2397 (WebCore::XPath::Parser::lexNumber): Ditto.
2398 (WebCore::XPath::Parser::nextTokenInternal): Ditto.
2400 2016-12-06 Ryan Haddad <ryanhaddad@apple.com>
2402 Rebaseline bindings tests after r209390.
2404 Unreviewed test gardening.
2406 * bindings/scripts/test/JS/JSTestObj.cpp:
2407 (WebCore::convertDictionaryToJS):
2408 * bindings/scripts/test/JS/JSTestObj.h:
2410 2016-12-06 Tim Horton <timothy_horton@apple.com>
2412 PDF markup/annotations visible in Mail on macOS but not on iOS
2413 https://bugs.webkit.org/show_bug.cgi?id=165444
2414 <rdar://problem/28942896>
2416 Reviewed by Simon Fraser.
2418 No new tests, but enabled an existing test for this feature.
2420 * platform/graphics/cg/PDFDocumentImage.cpp:
2421 (WebCore::PDFDocumentImage::drawPDFPage):
2422 * platform/spi/cg/CoreGraphicsSPI.h:
2423 Make use of CGContextDrawPDFPageWithAnnotations where available,
2424 to paint the page with annotations.
2426 2016-12-06 Dave Hyatt <hyatt@apple.com>
2428 [CSS Parser] Turn on the new CSS parser
2429 https://bugs.webkit.org/show_bug.cgi?id=165213
2431 Reviewed by Zalan Bujtas.
2435 2016-12-06 Dan Bernstein <mitz@apple.com>
2437 Tried to fix the USE(APPLE_INTERNAL_SDK) build after r209385.
2439 * platform/spi/cocoa/NSTouchBarSPI.h:
2441 2016-12-05 Jer Noble <jer.noble@apple.com>
2443 [pointer-lock] Cursor should become visible when exiting pointer-lock via ESC key.
2444 https://bugs.webkit.org/show_bug.cgi?id=165377
2446 Reviewed by Darin Adler.
2448 Introduce the concept of "force cursor to become visible" when requesting the pointer be
2449 unlocked. ESC events will cause the pointer to become visible, while normal key events
2452 * page/EventHandler.cpp:
2453 (WebCore::EventHandler::keyEvent):
2454 * page/PointerLockController.cpp:
2455 (WebCore::PointerLockController::requestPointerUnlock):
2456 (WebCore::PointerLockController::requestPointerUnlockAndForceCursorVisible):
2457 (WebCore::PointerLockController::documentDetached):
2458 (WebCore::PointerLockController::didLosePointerLock):
2459 * page/PointerLockController.h:
2461 Drive-by fix: apply Darin's feedback to existing functions:
2464 (WebCore::Document::prepareForDestruction):
2466 (WebCore::Element::removedFrom):
2467 * page/PointerLockController.cpp:
2468 (WebCore::PointerLockController::elementRemoved):
2469 (WebCore::PointerLockController::documentDetached):
2472 2016-12-06 Sam Weinig <sam@webkit.org>
2474 [WebIDL] Add support for converting dictionaries to JS
2475 https://bugs.webkit.org/show_bug.cgi?id=165367
2477 Reviewed by Darin Adler and Alex Christensen.
2479 - Adds support for converting dictionary types to JSValues via JSDOMConvert.
2480 - Adopts that functionality to correct the CryptoKeyPair implementation, which
2481 is supposed to be a dictionary.
2482 (While doing this, I also update places that were passing both a CryptoKey
2483 and CryptoKeyPair to use a Variant, since they always only wanted one.)
2484 - Re-works DOMPromise and DeferredPromise to be based on JSDOMConvert and IDLTypes.
2487 * PlatformEfl.cmake:
2488 * PlatformGTK.cmake:
2489 * PlatformMac.cmake:
2490 * WebCore.xcodeproj/project.pbxproj:
2491 Remove JSCryptoKeyPairCustom.cpp and CryptoKeyPair.cpp.
2493 * Modules/encryptedmedia/legacy/WebKitMediaKeys.cpp:
2494 * Modules/mediasource/MediaSource.cpp:
2495 * Modules/mediasource/SourceBuffer.cpp:
2496 * bindings/js/JSMediaDevicesCustom.cpp:
2497 * html/MediaController.cpp:
2498 * html/track/TextTrack.cpp:
2499 Add some missing includes.
2501 * Modules/applepay/ApplePaySession.cpp:
2502 (WebCore::ApplePaySession::canMakePaymentsWithActiveCard):
2503 (WebCore::ApplePaySession::openPaymentSetup):
2504 * Modules/fetch/FetchBody.cpp:
2505 (WebCore::FetchBody::text):
2506 (WebCore::FetchBody::consume):
2507 (WebCore::FetchBody::loadingFailed):
2508 * Modules/fetch/FetchBodyConsumer.cpp:
2509 (WebCore::FetchBodyConsumer::resolveWithData):
2510 (WebCore::FetchBodyConsumer::resolve):
2511 * Modules/fetch/FetchBodyOwner.cpp:
2512 (WebCore::FetchBodyOwner::blob):
2513 (WebCore::FetchBodyOwner::formData):
2514 (WebCore::FetchBodyOwner::text):
2515 * Modules/fetch/FetchResponse.h:
2516 * Modules/mediastream/MediaDevices.h:
2517 * Modules/mediastream/MediaEndpointPeerConnection.cpp:
2518 (WebCore::MediaEndpointPeerConnection::replaceTrack):
2519 (WebCore::MediaEndpointPeerConnection::replaceTrackTask):
2520 * Modules/mediastream/MediaEndpointPeerConnection.h:
2521 * Modules/mediastream/MediaStreamTrack.cpp:
2522 (WebCore::MediaStreamTrack::applyConstraints):
2523 * Modules/mediastream/PeerConnectionBackend.cpp:
2524 (WebCore::PeerConnectionBackend::setLocalDescription):
2525 (WebCore::PeerConnectionBackend::setRemoteDescription):
2526 (WebCore::PeerConnectionBackend::addIceCandidate):
2527 * Modules/mediastream/PeerConnectionBackend.h:
2528 * Modules/mediastream/RTCPeerConnection.cpp:
2529 (WebCore::RTCPeerConnection::queuedSetLocalDescription):
2530 (WebCore::RTCPeerConnection::queuedSetRemoteDescription):
2531 (WebCore::RTCPeerConnection::queuedAddIceCandidate):
2532 (WebCore::RTCPeerConnection::replaceTrack):
2533 * Modules/mediastream/RTCPeerConnection.h:
2534 * Modules/mediastream/RTCRtpSender.cpp:
2535 (WebCore::RTCRtpSender::replaceTrack):
2536 * Modules/mediastream/RTCRtpSender.h:
2537 * Modules/mediastream/UserMediaRequest.cpp:
2538 (WebCore::UserMediaRequest::deny):
2539 * Modules/webaudio/AudioContext.cpp:
2540 (WebCore::AudioContext::suspend):
2541 (WebCore::AudioContext::resume):
2542 * bindings/js/JSCustomElementRegistryCustom.cpp:
2543 (WebCore::whenDefinedPromise):
2544 * bindings/js/ScriptModuleLoader.cpp:
2545 (WebCore::ScriptModuleLoader::resolve):
2546 (WebCore::ScriptModuleLoader::notifyFinished):
2548 * css/FontFaceSet.cpp:
2549 (WebCore::FontFaceSet::load):
2550 * css/FontFaceSet.h:
2551 * dom/CustomElementRegistry.cpp:
2552 (WebCore::CustomElementRegistry::addElementDefinition):
2553 * html/HTMLMediaElement.cpp:
2554 (WebCore::HTMLMediaElement::rejectPendingPlayPromises):
2555 * html/HTMLMediaElement.h:
2556 Update to use new IDLType based promises.
2558 * bindings/generic/IDLTypes.h:
2559 Add a new type, ParameterType, to use as the parameter to
2560 DOMPromise/DeferredPromise.
2562 * bindings/js/JSCryptoKeyPairCustom.cpp:
2565 * bindings/js/JSDOMConvert.h:
2566 (WebCore::JSConverter<IDLDictionary<T>>::convert):
2567 Add JSConverter specialization for IDLDictionary. Have it simply forward to a generated
2568 convertDictionaryToJS function, following the convention set in place by IDLEnumeration.
2570 * bindings/js/JSDOMPromise.cpp:
2571 * bindings/js/JSDOMPromise.h:
2572 Re-write to be based on IDLTypes and JSDOMConvert, simplifying the implementation.
2574 * bindings/js/JSSubtleCryptoCustom.cpp:
2575 * bindings/js/JSWebKitSubtleCryptoCustom.cpp:
2576 Update for variant based KeyOrKeyPair.
2578 * bindings/scripts/CodeGeneratorJS.pm:
2579 (GenerateDictionaryHeaderContent):
2580 (GenerateDictionaryImplementationContent):
2581 Add generation of the convertDictionaryToJS function. I made it require the JSGenerateToJSObject
2582 extended attribute for now, as the majority of dictionaries do not need this code generated for them.
2584 * bindings/scripts/test/JS/JSTestObj.cpp:
2585 (WebCore::convertDictionaryToJS):
2586 * bindings/scripts/test/JS/JSTestObj.h:
2587 * bindings/scripts/test/TestObj.idl:
2588 Add JSGenerateToJSObject to a dictionary to test generation in bindings tests.
2590 * crypto/CryptoAlgorithm.h:
2591 Change KeyOrKeyPairCallback to take a Variant<RefPtr<CryptoKey>, CryptoKeyPair>, rather
2592 than two separate arguments.
2594 * crypto/CryptoKeyPair.cpp:
2597 * crypto/CryptoKeyPair.h:
2598 Convert to a struct.
2600 * crypto/CryptoKeyPair.idl:
2601 Convert to a dictionary.
2603 * crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
2604 (WebCore::CryptoAlgorithmAES_CBC::generateKey):
2605 * crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
2606 (WebCore::CryptoAlgorithmAES_KW::generateKey):
2607 * crypto/algorithms/CryptoAlgorithmHMAC.cpp:
2608 (WebCore::CryptoAlgorithmHMAC::generateKey):
2609 * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
2610 (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::generateKey):
2611 * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
2612 (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::generateKey):
2613 * crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
2614 (WebCore::CryptoAlgorithmRSA_OAEP::generateKey):
2615 * crypto/keys/CryptoKeyRSA.h:
2616 * crypto/mac/CryptoKeyRSAMac.cpp:
2617 (WebCore::CryptoKeyRSA::generatePair):
2618 Update for new signature of KeyOrKeyPairCallback.
2620 2016-12-05 Dave Hyatt <hyatt@apple.com>
2622 [CSS Parser] Reject invalid hex colors on the fast path
2623 https://bugs.webkit.org/show_bug.cgi?id=165461
2625 Reviewed by Zalan Bujtas.
2627 * css/parser/CSSParserFastPaths.cpp:
2628 (WebCore::fastParseColorInternal):
2629 Make sure to check for success. There was even a FIXME in the code about this!
2630 Matches our old parser's behavior.
2632 2016-12-05 Antoine Quint <graouts@apple.com>
2634 [Modern Media Controls] Controls bar in fullscreen cannot be dragged
2635 https://bugs.webkit.org/show_bug.cgi?id=165448
2637 Reviewed by Simon Fraser.
2639 We weren't listening to mousemove and mouseup events on the right event target, window in the context
2640 of a fullscreen shadow root makes no sense. We now listen to those events on the media controls, which
2641 we size to fit the whole of the media element's bounds. We then apply a transform to the controls bar
2642 to apply the dragging distance.
2644 Test: media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-drag.html
2646 * Modules/modern-media-controls/controls/controls-bar.js:
2647 (ControlsBar.prototype.get translation):
2648 (ControlsBar.prototype.set translation):
2649 (ControlsBar.prototype.commitProperty):
2650 (ControlsBar): Deleted.
2651 * Modules/modern-media-controls/controls/macos-fullscreen-media-controls.css:
2652 (.media-controls.mac.fullscreen):
2653 (.media-controls.mac.fullscreen > .controls-bar):
2654 * Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js:
2655 (MacOSFullscreenMediaControls.prototype._handleMousedown):
2656 (MacOSFullscreenMediaControls.prototype._handleMousemove):
2657 (MacOSFullscreenMediaControls.prototype._handleMouseup):
2659 2016-12-05 Dave Hyatt <hyatt@apple.com>
2661 [CSS Parser] Allow calc in SVG attributes
2662 https://bugs.webkit.org/show_bug.cgi?id=165459
2664 Reviewed by Zalan Bujtas.
2666 * css/parser/CSSPropertyParserHelpers.cpp:
2667 (WebCore::CSSPropertyParserHelpers::consumeLength):
2669 2016-12-05 Brady Eidson <beidson@apple.com>
2671 Build fix followup to r209379:
2673 STP 19 fails to launch on 16B255
2674 https://bugs.webkit.org/show_bug.cgi?id=165388
2676 rdar://problem/29514476
2678 Rubberstamped by Tim Horton.
2680 No new tests (No behavior change).
2682 * platform/spi/cocoa/NSTouchBarSPI.h: Strategically relocate NS_ASSUME_NONNULL* macros.
2684 2016-12-05 Dave Hyatt <hyatt@apple.com>
2686 [CSS Parser] Make sure the SVGPaint URI and currentColor style still paints using the URI
2687 https://bugs.webkit.org/show_bug.cgi?id=165457
2689 Reviewed by Zalan Bujtas.
2691 * rendering/svg/SVGResources.cpp:
2692 (WebCore::paintingResourceFromSVGPaint):
2693 Add support for this paint type. The old parser doesn't use it.
2695 2016-12-05 Dave Hyatt <hyatt@apple.com>
2697 [CSS Parser] Fix dashboard region parsing
2698 https://bugs.webkit.org/show_bug.cgi?id=165456
2700 Reviewed by Zalan Bujtas.
2702 * css/parser/CSSPropertyParser.cpp:
2703 (WebCore::consumeWebkitDashboardRegion):
2704 Make sure to reject whitespace by itself as well as unclosed dashboard-region functions.
2706 2016-12-05 Dave Hyatt <hyatt@apple.com>
2708 [CSS Parser] Properly reject large numeric values
2709 https://bugs.webkit.org/show_bug.cgi?id=165455
2711 Reviewed by Zalan Bujtas.
2713 The new parser clamped numeric values in both the slow and fast paths to the max
2714 and min float values. The old parser simply allowed the values to be inf, and then
2715 had std::isinf checks to reject.
2717 Blink rejects also even though it clamps, but I could not discern the mechanism by
2718 which they did so. Therefore I am changing the new parser to exactly match the old
2719 parser. Numeric values are no longer clamped, but instead are allowed to be inf, and
2720 isinf checks now exist in the new parser in the same places they do in the old parser.
2722 * css/parser/CSSParserFastPaths.cpp:
2723 (WebCore::parseSimpleLength):
2724 (WebCore::parseSimpleLengthValue):
2725 * css/parser/CSSParserToken.cpp:
2726 (WebCore::CSSParserToken::CSSParserToken):
2727 * css/parser/CSSPropertyParserHelpers.cpp:
2728 (WebCore::CSSPropertyParserHelpers::consumeLength):
2729 (WebCore::CSSPropertyParserHelpers::consumePercent):
2731 2016-12-05 Ricky Mondello <rmondello@apple.com>
2733 STP 19 fails to launch on 16B255
2734 https://bugs.webkit.org/show_bug.cgi?id=165388
2736 rdar://problem/29514476
2738 Reviewed by Tim Horton.
2740 * platform/spi/cocoa/NSTouchBarSPI.h: Re-declare the SPI symbols as weak. The cited crash itself is for a
2741 symbol we weren't handling here, but is part of the same group. Re-declare all four of these symbols to
2744 2016-12-05 Antoine Quint <graouts@apple.com>
2746 ERROR: post-layout: dirty renderer(s) - Encountered with LayoutTest media/modern-media-controls/media-controller/media-controller-fullscreen-ltr.html
2747 https://bugs.webkit.org/show_bug.cgi?id=165312
2749 Reviewed by Simon Fraser.
2751 Reverting part of the code added in https://bugs.webkit.org/show_bug.cgi?id=165287 that triggered
2752 an assertion. We go back to removing previous media controls as we add new ones when the fullscreen
2753 status changes, and simply hide the controls during the animated transition using a CSS pseudo-class.
2754 This also fixes an issue where we wouldn't have removed the previous controls should we have entered
2755 fullscreen in a different way than clicking on the fullscreen button in the media controls.
2757 We restore testing coverage that was fixed due to this assertion.
2759 * Modules/modern-media-controls/controls/media-controls.css:
2760 (:host(:-webkit-animating-full-screen-transition) .media-controls):
2761 * Modules/modern-media-controls/controls/media-controls.js:
2762 (MediaControls.prototype.fadeIn):
2763 (MediaControls.prototype.presentInElement): Deleted.
2764 * Modules/modern-media-controls/media/fullscreen-support.js:
2765 (FullscreenSupport.prototype.buttonWasClicked):
2766 * Modules/modern-media-controls/media/media-controller.js:
2767 (MediaController.prototype._updateControlsIfNeeded):
2769 2016-12-05 Dean Jackson <dino@apple.com>
2771 MediaDocuments crash with modern media controls
2772 https://bugs.webkit.org/show_bug.cgi?id=165446
2773 <rdar://problem/29524959>
2775 Reviewed by Antoine Quint.
2777 The modern media controls inject a <style> element into
2778 the document, which exposed a bug when used in MediaDocuments.
2779 Such documents were not getting a charset, and the hash table
2780 for the CSSParserContexts was crashing.
2782 Test: media/modern-media-controls/media-documents/insert-style-should-not-crash.html
2784 * css/parser/CSSParserMode.h: Guard against an empty charset.
2785 (WebCore::CSSParserContextHash::hash):
2786 * dom/InlineStyleSheetOwner.cpp: Ask for the charset with fallback.
2787 (WebCore::parserContextForElement):
2789 2016-12-05 Dave Hyatt <hyatt@apple.com>
2791 [CSS Parser] shape-rendering supports crispEdges rather than crisp-edges
2792 https://bugs.webkit.org/show_bug.cgi?id=165443
2794 Reviewed by Tim Horton.
2796 * css/parser/CSSParserFastPaths.cpp:
2797 (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
2799 2016-12-05 Dave Hyatt <hyatt@apple.com>
2801 [CSS Parser] Support setting of custom properties from the CSS OM
2802 https://bugs.webkit.org/show_bug.cgi?id=165442
2804 Reviewed by Tim Horton.
2806 * css/parser/CSSParser.cpp:
2807 (WebCore::CSSParser::parseCustomPropertyValue):
2808 Call in to a new function in CSSParserImpl that can handle
2809 custom property parsing.
2811 * css/parser/CSSParserImpl.cpp:
2812 (WebCore::CSSParserImpl::parseCustomPropertyValue):
2813 New function that is similar to parseValue, but handling custom
2816 (WebCore::CSSParserImpl::consumeDeclaration):
2817 (WebCore::CSSParserImpl::consumeCustomPropertyValue):
2818 (WebCore::CSSParserImpl::consumeVariableValue): Deleted.
2819 * css/parser/CSSParserImpl.h:
2820 Rename consumeVariableValue to consumeCustomPropertyValue, since that
2821 is more clear. consumeVariableValue sounds like you might be resolving
2822 a variable reference rather than parsing a custom property's value.
2824 2016-12-05 Tim Horton <timothy_horton@apple.com>
2826 Adopt CAMachPort-as-layer-contents
2827 https://bugs.webkit.org/show_bug.cgi?id=141687
2828 <rdar://problem/19393233>
2830 Reviewed by Darin Adler.
2832 No new tests, just a performance bump.
2834 * platform/spi/cocoa/QuartzCoreSPI.h:
2837 2016-12-05 Dave Hyatt <hyatt@apple.com>
2839 [CSS Parser] calcs on column-width that resolve to 0 should be discarded
2840 https://bugs.webkit.org/show_bug.cgi?id=165439
2842 Reviewed by Dean Jackson.
2844 * css/parser/CSSPropertyParser.cpp:
2845 (WebCore::consumeColumnWidth):
2847 2016-12-05 Dean Jackson <dino@apple.com>
2849 pointer lock needs to be feature detectable
2850 https://bugs.webkit.org/show_bug.cgi?id=165426
2851 <rdar://problem/29486715>
2853 Reviewed by Antoine Quint.
2855 Annotate the public-facing API for pointer-lock, so
2856 that it is hidden when not available.
2858 Also move the Setting to a RuntimeEnabledFeature, since
2859 pointer-lock is exposed from WebKit as a feature.
2861 Tests: pointer-lock/pointerlock-interface-disabled.html
2862 pointer-lock/pointerlock-interface.html
2864 * bindings/generic/RuntimeEnabledFeatures.h:
2865 (WebCore::RuntimeEnabledFeatures::setPointerLockEnabled):
2866 (WebCore::RuntimeEnabledFeatures::pointerLockEnabled):
2869 * page/PointerLockController.cpp:
2870 (WebCore::PointerLockController::requestPointerLock):
2871 (WebCore::PointerLockController::requestPointerUnlock):
2874 2016-12-05 Keith Rollin <krollin@apple.com>
2876 Reduce number of platformMemoryUsage calls
2877 https://bugs.webkit.org/show_bug.cgi?id=164375
2879 Reviewed by Darin Adler.
2881 Removed the calls to WTF::releaseFastMallocFreeMemory (it's already
2882 called elsewhere in the free-all-memory pipeline) and
2883 malloc_zone_pressure_relief (it should be called by the OS on its own
2886 No new tests -- no new or changed features.
2888 * platform/cocoa/MemoryPressureHandlerCocoa.mm:
2889 (WebCore::MemoryPressureHandler::ReliefLogger::platformMemoryUsage):
2891 2016-12-05 Dave Hyatt <hyatt@apple.com>
2893 [CSS Parser] Leave the Animation type alone when the property is invalid
2894 https://bugs.webkit.org/show_bug.cgi?id=165418
2896 Reviewed by Dean Jackson.
2898 * css/CSSToStyleMap.cpp:
2899 (WebCore::CSSToStyleMap::mapAnimationProperty):
2901 2016-12-05 Antti Koivisto <antti@apple.com>
2903 keyframes do not work when defined inside a style in a shadowRoot
2904 https://bugs.webkit.org/show_bug.cgi?id=164608
2905 <rdar://problem/29210251>
2907 Reviewed by Darin Adler.
2909 With :host and ::slotted rules a keyframe animation affecting an element can be
2910 defined in a style scope different from the element's own scope. Style resolver
2911 loses the scope information when building the RenderStyle so there is no way
2912 to find out the correct scope.
2914 Fix by passing style scope through to style builder and including a scope association
2915 with the animation name. Find the correct scope when resolving keyframes.
2917 Test: fast/shadow-dom/shadow-host-animation.html
2919 * css/CSSToStyleMap.cpp:
2920 (WebCore::CSSToStyleMap::mapAnimationName):
2922 Include scope with the name.
2924 * css/ElementRuleCollector.cpp:
2925 (WebCore::MatchRequest::MatchRequest):
2926 (WebCore::ElementRuleCollector::addMatchedRule):
2927 (WebCore::ElementRuleCollector::sortAndTransferMatchedRules):
2928 (WebCore::ElementRuleCollector::matchAuthorRules):
2929 (WebCore::ElementRuleCollector::matchAuthorShadowPseudoElementRules):
2930 (WebCore::ElementRuleCollector::matchHostPseudoClassRules):
2931 (WebCore::ElementRuleCollector::matchSlottedPseudoElementRules):
2932 (WebCore::ElementRuleCollector::collectMatchingRulesForList):
2934 Replace treeContextOrdinal int with Style::ScopeOrdinal enum carrying the same information.
2935 Simplify the code removing unnecessary use of MatchRequest struct.
2937 (WebCore::compareRules):
2938 * css/ElementRuleCollector.h:
2939 * css/StyleResolver.cpp:
2940 (WebCore::StyleResolver::MatchResult::addMatchedProperties):
2941 (WebCore::StyleResolver::CascadedProperties::setPropertyInternal):
2942 (WebCore::StyleResolver::CascadedProperties::set):
2943 (WebCore::StyleResolver::CascadedProperties::setDeferred):
2945 Pass styleScopeOrdinal through the cascade mechanism
2947 (WebCore::cascadeLevelForIndex):
2948 (WebCore::StyleResolver::CascadedProperties::addMatch):
2949 (WebCore::StyleResolver::CascadedProperties::addImportantMatches):
2950 (WebCore::StyleResolver::CascadedProperties::Property::apply):
2952 Set styleScopeOrdinal in State when applying style.
2954 (WebCore::StyleResolver::CascadedProperties::addStyleProperties): Deleted.
2956 Move the code to the only caller.
2958 * css/StyleResolver.h:
2959 (WebCore::StyleResolver::State::styleScopeOrdinal):
2960 (WebCore::StyleResolver::State::setStyleScopeOrdinal):
2961 * page/animation/CompositeAnimation.cpp:
2962 (WebCore::KeyframeAnimation::KeyframeAnimation):
2963 (WebCore::KeyframeAnimation::resolveKeyframeStyles):
2965 Find the correct scope for resolving keyframes based on the scope ordinal.
2967 * platform/animation/Animation.cpp:
2968 * platform/animation/Animation.h:
2970 Add m_nameStyleScopeOrdinal that tells the scope where the name is defined.
2972 * style/StyleScope.cpp:
2973 (WebCore::Style::Scope::forOrdinal):
2975 Find the scope for ordinal.
2977 * style/StyleScope.h:
2979 Define ScopeOrdinal types.
2981 (WebCore::Style::operator++):
2983 2016-12-05 Dave Hyatt <hyatt@apple.com>
2985 [CSS Parser] Support glyph-orientation-horizontal and glyph-orientation-vertical
2986 https://bugs.webkit.org/show_bug.cgi?id=165414
2988 Reviewed by Zalan Bujtas.
2990 * css/parser/CSSPropertyParser.cpp:
2991 (WebCore::consumeGlyphOrientation):
2992 (WebCore::CSSPropertyParser::parseSingleValue):
2993 Add support for the glyph-orientation-horizontal and glyph-orientation-vertical
2994 properties. They take an angle and allow unitless values.
2996 * css/parser/CSSPropertyParserHelpers.cpp:
2997 (WebCore::CSSPropertyParserHelpers::consumeAngle):
2998 Fix a bug in the handling of unitless values for angles. Make sure to
2999 actually pass in the value instead of always doing 0. Blink does not
3000 accept unitless values for angles at all, so this is another difference
3001 to investigate for SVG in the future.
3003 2016-12-05 Ryan Haddad <ryanhaddad@apple.com>
3005 Unreviewed, rolling out r209299.
3007 This change appears to have caused LayoutTest failures on
3012 "Improve the behavior of scroll-into-view when the target is
3013 inside position:fixed"
3014 https://bugs.webkit.org/show_bug.cgi?id=165354
3015 http://trac.webkit.org/changeset/209299
3017 2016-12-05 Andreas Kling <akling@apple.com>
3019 [Cocoa] Add some memory usage related information to sysdiagnose state dumps
3020 <https://webkit.org/b/165375>
3021 <rdar://problem/29057243>
3023 Reviewed by Darin Adler.
3025 Add a flag to memoryUsageStatistics() to allow gathering of slightly more expensive information.
3026 This mode is used when capturing a state dump for sysdiagnose.
3028 The more expensive information added in this patch relates to information about live objects
3029 and memory on the JavaScript heap.
3031 * WebCore.xcodeproj/project.pbxproj:
3032 * page/PerformanceLogging.cpp:
3033 (WebCore::PerformanceLogging::memoryUsageStatistics):
3034 (WebCore::PerformanceLogging::javaScriptObjectCounts):
3035 (WebCore::PerformanceLogging::didReachPointOfInterest):
3036 * page/PerformanceLogging.h:
3038 2016-12-05 Dave Hyatt <hyatt@apple.com>
3040 [CSS Parser] Make sure the transform fast path uses WebKitCSSTransformValue
3041 https://bugs.webkit.org/show_bug.cgi?id=165399
3043 Reviewed by Dean Jackson.
3045 * css/parser/CSSParserFastPaths.cpp:
3046 (WebCore::parseTransformTranslateArguments):
3047 (WebCore::parseTransformNumberArguments):
3048 (WebCore::parseSimpleTransformValue):
3049 (WebCore::parseSimpleTransformList):
3051 2016-12-05 Dave Hyatt <hyatt@apple.com>
3053 [CSS Parser] Fix calc() with -webkit-line-clamp
3054 https://bugs.webkit.org/show_bug.cgi?id=165398
3056 Reviewed by Zalan Bujtas.
3058 Remove the aggressive token type checking up front, since it was causing calc() to not
3061 * css/parser/CSSPropertyParser.cpp:
3062 (WebCore::consumeLineClamp):
3064 2016-12-05 Dave Hyatt <hyatt@apple.com>
3066 [CSS Parser] Support -webkit-text-decoration
3067 https://bugs.webkit.org/show_bug.cgi?id=165391
3069 Reviewed by Dean Jackson.
3071 * css/parser/CSSPropertyParser.cpp:
3072 (WebCore::CSSPropertyParser::parseShorthand):
3074 2016-12-05 Beth Dakin <bdakin@apple.com>
3076 STP 19 fails to launch on 16B255
3077 https://bugs.webkit.org/show_bug.cgi?id=165388
3079 rdar://problem/29514476
3081 Rubber-stamped by Brady Eidson.
3083 * platform/spi/cocoa/NSTouchBarSPI.h:
3085 2016-12-05 Beth Dakin <bdakin@apple.com>
3087 STP 19 fails to launch on 16B255
3088 https://bugs.webkit.org/show_bug.cgi?id=165388
3090 rdar://problem/29514476
3092 Reviewed by Tim Horton.
3095 * platform/spi/cocoa/NSTouchBarSPI.h:
3097 2016-12-05 Dave Hyatt <hyatt@apple.com>
3099 [CSS Parser] Support the 'alphabetic' keyword for text-underline-position
3100 https://bugs.webkit.org/show_bug.cgi?id=165387
3102 Reviewed by Simon Fraser.
3104 Fixes fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-underline-position.html
3106 * css/parser/CSSPropertyParser.cpp:
3107 (WebCore::CSSPropertyParser::parseSingleValue):
3109 2016-12-05 Dave Hyatt <hyatt@apple.com>
3111 [CSS Parser] Fix assert when unknown properties are encountered.
3112 https://bugs.webkit.org/show_bug.cgi?id=165385
3114 Reviewed by Zalan Bujtas.
3116 * css/CSSToStyleMap.cpp:
3117 (WebCore::CSSToStyleMap::mapAnimationProperty):
3119 2016-12-05 Dave Hyatt <hyatt@apple.com>
3121 [CSS Parser] Fix rx and ry parsing
3122 https://bugs.webkit.org/show_bug.cgi?id=165383
3124 Reviewed by Dean Jackson.
3126 * css/parser/CSSParserFastPaths.cpp:
3127 (WebCore::isSimpleLengthPropertyID):
3128 rx and ry can be negative in the slow path, so make sure they can be negative in the
3131 * css/parser/CSSPropertyParser.cpp:
3132 (WebCore::consumeRxOrRy):
3133 Disallow auto as a value since we are not equipped to handle it, and it's not clear if it's
3136 2016-12-05 Konstantin Tokarev <annulen@yandex.ru>
3138 Add __STDC_FORMAT_MACROS before inttypes.h is included
3139 https://bugs.webkit.org/show_bug.cgi?id=165374
3141 We need formatting macros like PRIu64 to be available in all places where
3142 inttypes.h header is used. All these usages get inttypes.h definitions
3143 via wtf/Assertions.h header, except SQLiteFileSystem.cpp where formatting
3144 macros are not used anymore since r185129.
3146 This patch fixes multiple build errors with MinGW and reduces number of
3147 independent __STDC_FORMAT_MACROS uses in the code base.
3149 Reviewed by Darin Adler.
3151 No new tests needed.
3153 * platform/sql/SQLiteFileSystem.cpp: Removed unused inttypes.h
3156 2016-12-05 Dave Hyatt <hyatt@apple.com>
3158 [CSS Parser] Properly fail on bad values for -webkit-clip-path
3159 https://bugs.webkit.org/show_bug.cgi?id=165382
3161 Reviewed by Dean Jackson.
3163 * css/parser/CSSPropertyParser.cpp:
3164 (WebCore::consumeBasicShapeOrBox):
3166 2016-12-05 Dave Hyatt <hyatt@apple.com>
3168 [CSS Parser] The page-break-* properties are only keyword props for old parser.
3169 https://bugs.webkit.org/show_bug.cgi?id=165381
3171 Reviewed by Dean Jackson.
3173 * css/parser/CSSParser.cpp:
3174 (WebCore::isKeywordPropertyID):
3175 * css/parser/CSSParserFastPaths.cpp:
3176 (WebCore::CSSParserFastPaths::isKeywordPropertyID):
3178 2016-12-05 Dave Hyatt <hyatt@apple.com>
3180 [CSS Parser] Don't use CSS_PARSER_INTEGER unit for resolved integer calcs.
3181 https://bugs.webkit.org/show_bug.cgi?id=165379
3183 Reviewed by Dean Jackson.
3185 * css/parser/CSSPropertyParserHelpers.cpp:
3186 (WebCore::CSSPropertyParserHelpers::CalcParser::consumeNumber):
3188 2016-12-05 Dave Hyatt <hyatt@apple.com>
3190 [CSS Parser] Add parseValue support to new parser. Use new parser for UA sheet too if useNewParser is set.
3191 https://bugs.webkit.org/show_bug.cgi?id=165376
3193 Reviewed by Zalan Bujtas.
3195 * css/StyleColor.cpp:
3196 (WebCore::StyleColor::isColorKeyword):
3197 Include system colors when using the fast parseValue path.
3199 * css/parser/CSSParser.cpp:
3200 (WebCore::CSSParser::setupParser):
3201 Add an assert to catch any code path using the old parser when the new parser flag is set.
3203 (WebCore::CSSParser::parseSheet):
3204 (WebCore::CSSParser::parseRule):
3205 (WebCore::CSSParser::parseKeyframeRule):
3206 (WebCore::CSSParser::parseSupportsCondition):
3207 (WebCore::CSSParser::parseValue):
3208 (WebCore::CSSParser::parseSelector):
3209 (WebCore::CSSParser::parseDeclaration):
3210 Patched to use the new parser in UASheetMode as well as other modes when the new parser flag
3211 is set. parseValue is patched to use the new parser's fast paths and to call into CSSParserImpl's
3214 * css/parser/CSSParserFastPaths.cpp:
3215 (WebCore::isSimpleLengthPropertyID):
3216 Support CSSPropertyShapeMargin in the fast path since the old parser did in its fast path.
3218 (WebCore::parseSimpleLengthValue):
3219 Don't ever return unitless numbers. If we accept a unitless number, convert the unit to PX still.
3221 (WebCore::CSSParserFastPaths::parseColor):
3222 Use the CSSValuePool when creating colors on the fast path.
3224 * css/parser/CSSParserImpl.cpp:
3225 (WebCore::CSSParserImpl::parseValue):
3226 * css/parser/CSSParserImpl.h:
3227 Change the return type to be compatible with the old parser's ParseResult flag.
3229 2016-12-05 Konstantin Tokarev <annulen@yandex.ru>
3231 Removed MediaPlayerPrivateTaskTimer
3232 https://bugs.webkit.org/show_bug.cgi?id=165373
3234 Reviewed by Sam Weinig.
3236 It is not used anywhere since QTSDK removal in r165476.
3238 No new tests needed.
3240 * platform/graphics/win/MediaPlayerPrivateTaskTimer.cpp: Removed.
3241 * platform/graphics/win/MediaPlayerPrivateTaskTimer.h: Removed.
3243 2016-12-04 Dave Hyatt <hyatt@apple.com>
3245 [CSS Parser] Eliminate in-place lowercasing in the parser.
3246 https://bugs.webkit.org/show_bug.cgi?id=165368
3248 Reviewed by Darin Adler.
3250 Replace the in-place lowercasing that the parser does with new
3251 mechanisms. In-place lowercasing ruins serialization and doesn't
3252 work on CSS parsed from static strings. It also has the side effect
3253 of mutating strings passed in from JavaScript like for querySelectorAll.
3255 For class/id selectors, we now check if the string is lowercase or not.
3256 If it contains uppercase ASCII characters, then we allocate the RareData
3257 for the selector. RareData now has two fields instead of one for the value,
3258 a matching value (all lowercase in quirks mode), and a serializing value (the
3259 original string). Because this is done at the CSSSelector level, the old
3260 parser has been patched as well for these cases.
3262 In addition, in-place lowercasing was done for pseudo-elements, for
3263 media query features, and for attr(). In all of these cases we do
3264 lowercase converting by first checking if it's needed. Serialization will
3265 not retain the original string in these cases, so we may want to revisit
3266 these cases in the future and apply a solution similar to what we did for
3269 * css/CSSGrammar.y.in:
3270 * css/CSSSelector.cpp:
3271 (WebCore::CSSSelector::createRareData):
3272 (WebCore::CSSSelector::selectorText):
3273 (WebCore::CSSSelector::RareData::RareData):
3274 (WebCore::CSSSelector::RareData::~RareData):
3275 * css/CSSSelector.h:
3276 (WebCore::CSSSelector::RareData::create):
3277 (WebCore::CSSSelector::setValue):
3278 (WebCore::CSSSelector::value):
3279 (WebCore::CSSSelector::serializingValue):
3280 * css/MediaQueryExp.cpp:
3281 (WebCore::MediaQueryExpression::MediaQueryExpression):
3282 * css/parser/CSSParserToken.cpp:
3283 (WebCore::convertToASCIILowercaseInPlace): Deleted.
3284 (WebCore::CSSParserToken::convertToASCIILowercaseInPlace): Deleted.
3285 * css/parser/CSSParserToken.h:
3286 * css/parser/CSSParserValues.h:
3287 (WebCore::CSSParserSelector::setValue):
3288 * css/parser/CSSPropertyParser.cpp:
3289 (WebCore::consumeAttr):
3290 * css/parser/CSSSelectorParser.cpp:
3291 (WebCore::CSSSelectorParser::consumeId):
3292 (WebCore::CSSSelectorParser::consumeClass):
3293 (WebCore::CSSSelectorParser::consumePseudo):
3294 * css/parser/MediaQueryParser.cpp:
3295 (WebCore::MediaQueryParser::readFeature):
3297 2016-12-04 Gyuyoung Kim <gyuyoung.kim@webkit.org>
3299 Fix a build break on EFL since r209303.
3301 Unreviewed build fix.
3303 * bindings/js/SerializedScriptValue.cpp:
3304 (WebCore::exceptionForSerializationFailure): Add a return in the end of function.
3306 2016-12-03 Dan Bernstein <mitz@apple.com>
3308 [Cocoa] Expose InjectedBundlePageEditorClient via the Objective-C bundle SPI
3309 https://bugs.webkit.org/show_bug.cgi?id=165276
3310 <rdar://problem/29467040>
3312 Reviewed by Darin Adler.
3314 * platform/ios/PlatformPasteboardIOS.mm:
3315 (WebCore::PlatformPasteboard::write): Make sure to put the client data on the pasteboard,
3316 like we do on macOS.
3318 2016-12-03 Dave Hyatt <hyatt@apple.com>
3320 [CSS Parser] Remove line numbers from StyleRule.
3321 https://bugs.webkit.org/show_bug.cgi?id=165361
3323 Reviewed by Simon Fraser.
3325 StyleRules have a concept of a source line that is eventually passed
3326 to the inspector. This was only ever used by normal rules, i.e., ones with
3327 selectors, and set to 0 for all other rules. This line was set to the line number
3328 at which the end of the selector text occurred.
3330 Because Inspector already computes the start and end range for the selector
3331 text, storing a source line on StyleRule ends up being redundant. This patch
3332 gets rid of the source line and uses the end line of the selector text
3335 * css/CSSGrammar.y.in:
3336 Remove the code that updates the last seen selector line.
3338 * css/CSSKeyframeRule.cpp:
3339 (WebCore::StyleKeyframe::StyleKeyframe):
3340 * css/CSSKeyframesRule.cpp:
3341 (WebCore::StyleRuleKeyframes::StyleRuleKeyframes):
3342 No longer need to pass in a 0 line number.
3344 * css/StyleRule.cpp:
3345 (WebCore::StyleRule::StyleRule):
3346 (WebCore::StyleRule::create):
3347 (WebCore::StyleRule::splitIntoMultipleRulesWithMaximumSelectorComponentCount):
3348 (WebCore::StyleRuleFontFace::StyleRuleFontFace):
3349 (WebCore::StyleRuleGroup::StyleRuleGroup):
3350 (WebCore::StyleRuleCharset::StyleRuleCharset):
3351 (WebCore::StyleRuleNamespace::StyleRuleNamespace):
3353 (WebCore::StyleRuleBase::StyleRuleBase):
3354 (WebCore::StyleRuleBase::sourceLine): Deleted.
3355 * css/StyleRuleImport.cpp:
3356 (WebCore::StyleRuleImport::StyleRuleImport):
3357 Remove m_sourceLine and change the create methods and constructors to not
3358 require a line number.
3360 * css/parser/CSSParser.cpp:
3361 (WebCore::CSSParser::createStyleRule):
3362 Line number no longer needed.
3364 (WebCore::CSSParser::updateLastSelectorLineAndPosition): Deleted.
3365 * css/parser/CSSParser.h:
3366 Got rid of the function that tracks and updates the last seen selector line.
3368 * css/parser/CSSParserImpl.cpp:
3369 (WebCore::CSSParserImpl::consumeStyleRule):
3370 Fix the rule creation in the new parser to not pass in a 0 line number.
3372 * inspector/InspectorStyleSheet.cpp:
3373 (WebCore::buildSourceRangeObject):
3374 (WebCore::InspectorStyleSheet::buildObjectForSelectorList):
3375 (WebCore::InspectorStyleSheet::buildObjectForRule):
3376 * inspector/InspectorStyleSheet.h:
3377 Patch the methods that build up the selector range to return the end line
3378 information for selector text so that it can be set as the source line
3379 for the rule (thus eliminating the need to store the line number on the style
3382 2016-12-02 Sam Weinig <sam@webkit.org>
3384 optional sequence values not handled correctly by binding generator
3385 https://bugs.webkit.org/show_bug.cgi?id=142562
3388 Remove non-standard postMessage overload
3389 https://bugs.webkit.org/show_bug.cgi?id=161911
3391 Wrong argument order in window.postMessage
3392 https://bugs.webkit.org/show_bug.cgi?id=63141
3394 Reviewed by Darin Adler.
3396 * WebCore.xcodeproj/project.pbxproj:
3397 Remove no longer needed files.
3399 * bindings/generic/IDLTypes.h:
3400 * bindings/js/JSDOMConvert.h:
3401 (WebCore::Converter<IDLObject>::convert):
3402 Add support for the WebIDL object type.
3404 * bindings/js/JSDOMBinding.cpp:
3405 (WebCore::createDOMException):
3406 Add support for throwing stack overflow errors.
3408 * bindings/js/JSDOMWindowCustom.cpp:
3409 (WebCore::handlePostMessage): Deleted.
3410 (WebCore::JSDOMWindow::postMessage): Deleted.
3411 * bindings/js/JSDedicatedWorkerGlobalScopeCustom.cpp: Removed.
3412 * bindings/js/JSMessagePortCustom.cpp:
3413 (WebCore::JSMessagePort::postMessage): Deleted.
3414 (WebCore::extractTransferables): Deleted.
3415 * bindings/js/JSMessagePortCustom.h: Removed.
3416 * bindings/js/JSWorkerCustom.cpp:
3417 (WebCore::JSWorker::postMessage): Deleted.
3418 Remove custom bindings for postMessage.
3420 * bindings/js/SerializedScriptValue.h:
3421 Switch to using enum class.
3423 * bindings/js/SerializedScriptValue.cpp:
3424 (WebCore::SerializedScriptValue::transferArrayBuffers):
3425 (WebCore::SerializedScriptValue::create):
3426 Add new create function that takes the transfer list, processes it, and returns
3427 MessagePorts and SerializedScriptValue / exception.
3429 (WebCore::CloneBase::throwStackOverflow): Deleted.
3430 (WebCore::CloneDeserializer::throwValidationError): Deleted.
3431 Remove uncalled functions.
3433 * bindings/scripts/CodeGenerator.pm:
3436 * bindings/scripts/CodeGeneratorJS.pm:
3437 (AddToIncludesForIDLType):
3439 Add support for the WebIDL 'object' type.
3441 * bindings/scripts/test/JS/JSTestObj.cpp:
3442 * bindings/scripts/test/TestObj.idl:
3443 Add tests for 'object'.
3445 * dom/ExceptionCode.h:
3446 Add two new ExceptionCodes:
3447 - ExistingExceptionError, to indicate that implementation code threw a JS exception.
3448 - StackOverflowError, to indicate that a stack overflow exception should be thrown.
3450 * dom/MessagePort.cpp:
3451 (WebCore::MessagePort::postMessage):
3452 * dom/MessagePort.h:
3453 * dom/MessagePort.idl:
3454 * page/DOMWindow.cpp:
3455 (WebCore::DOMWindow::postMessage):