One esc to exit fullscreen and pointer lock
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2016-12-07  Jeremy Jones  <jeremyj@apple.com>
2
3         One esc to exit fullscreen and pointer lock
4         https://bugs.webkit.org/show_bug.cgi?id=165416
5         rdar://problem/29430711
6
7         Reviewed by Jer Noble.
8
9         Test: pointer-lock/lock-lost-on-esc-in-fullscreen.html
10
11         When handling escape, also exit fullscreen on escape.
12         This also means that escape can exit fullscreen in TestRunner.
13
14         * page/EventHandler.cpp:
15         (WebCore::EventHandler::keyEvent):
16
17 2016-12-07  Yusuke Suzuki  <utatane.tea@gmail.com>
18
19         [JSC] Drop translate phase in module loader
20         https://bugs.webkit.org/show_bug.cgi?id=164861
21
22         Reviewed by Saam Barati.
23
24         * bindings/js/JSDOMWindowBase.cpp:
25         * bindings/js/JSWorkerGlobalScopeBase.cpp:
26
27 2016-12-07  Keith Rollin  <krollin@apple.com>
28
29         Network event record/replay
30         https://bugs.webkit.org/show_bug.cgi?id=164527
31         <rdar://problem/29168157>
32
33         Reviewed by Alex Christensen.
34
35         Export parseURLEncodedForm.
36
37         No new tests -- no functionality added, changed, or removed.
38
39         * platform/URLParser.h:
40
41 2016-12-07  Dave Hyatt  <hyatt@apple.com>
42
43         [CSS Parser] Consolidate string/ident/url serialization functions
44         https://bugs.webkit.org/show_bug.cgi?id=165552
45
46         Reviewed by Zalan Bujtas.
47
48         Right now CSSParser has string, ident and url serialization functions
49         called quoteCSStringIfNeeded (which actually serializes both strings and
50         identifiers), as well as quoteCSSURLIfNeeded.
51
52         CSSMarkup already has serialization functions that exist outside of the
53         CSSParser and that handle serialization of strings, idents and URLs. This
54         patch eliminates the CSSParser functions and consolidates all of the
55         serialization to use CSSMarkup's functions.
56
57         Note that we are not spec-compliant at all here, and so I had to amend
58         the functions to support our non-spec-compliant serialization. The goal
59         of this patch is consolidation and not to fix our broken serialization.
60
61         Notable changes include parameterizing string serialization so that
62         both single and double quotes are supported, since in the existing code
63         we're sometimes spec-compliant (CSSSelectors) and sometimes not
64         (CSSPrimitiveValue).
65
66         We also overload CSS_STRING primitive value type and have it act as both
67         a string and a custom identifier. This is lame, since the parser should
68         have made two different types of objects instead, but since our parser
69         doesn't do that yet, I added a serializeAsStringOrCustomIdent that
70         preserves our old behavior of "quote the string only if needed." In this
71         case what that really meant was "Try to guess that we were originally a
72         custom ident and leave off quotes if so." This function will go away
73         once we properly create CSSStringValues and CSSCustomIdentValues instead
74         of turning the latter into strings.
75
76         * css/CSSBasicShapes.cpp:
77         (WebCore::buildPathString):
78         * css/CSSImageValue.cpp:
79         (WebCore::CSSImageValue::customCSSText):
80         * css/CSSMarkup.cpp:
81         (WebCore::isCSSTokenizerURL):
82         (WebCore::serializeString):
83         (WebCore::serializeURL):
84         (WebCore::serializeAsStringOrCustomIdent):
85         (WebCore::serializeURI): Deleted.
86         * css/CSSMarkup.h:
87         * css/CSSPrimitiveValue.cpp:
88         (WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText):
89         * css/CSSSelector.cpp:
90         (WebCore::CSSSelector::selectorText):
91         * css/parser/CSSParser.cpp:
92         (WebCore::isCSSTokenizerIdent): Deleted.
93         (WebCore::isCSSTokenizerURL): Deleted.
94         (WebCore::quoteCSSStringInternal): Deleted.
95         (WebCore::quoteCSSString): Deleted.
96         (WebCore::quoteCSSStringIfNeeded): Deleted.
97         (WebCore::quoteCSSURLIfNeeded): Deleted.
98         * css/parser/CSSParser.h:
99         * html/HTMLElement.cpp:
100         (WebCore::HTMLElement::mapLanguageAttributeToLocale):
101
102 2016-12-07  Dean Jackson  <dino@apple.com>
103
104         Expose internal API to detect media documents
105         https://bugs.webkit.org/show_bug.cgi?id=165559
106         <rdar://problems/29564054>
107
108         Reviewed by Antoine Quint.
109
110         Expose via MediaControlsHost whether or not we're in
111         a MediaDocument.
112
113         Since MediaControlsHost is only exposed to our
114         internal controls, it's not possible to test this
115         directly. However, a subsequent test for media documents
116         with audio-only content will cover this change.
117
118         * Modules/mediacontrols/MediaControlsHost.cpp: Add isInMediaDocument and put const on
119         various methods that should have it.
120         (WebCore::MediaControlsHost::captionDisplayMode):
121         (WebCore::MediaControlsHost::supportsFullscreen):
122         (WebCore::MediaControlsHost::isVideoLayerInline):
123         (WebCore::MediaControlsHost::isInMediaDocument):
124         * Modules/mediacontrols/MediaControlsHost.h:
125         * Modules/mediacontrols/MediaControlsHost.idl: Add isInMediaDocument.
126
127 2016-12-07  Zalan Bujtas  <zalan@apple.com>
128
129         ASSERTION FAILED: count >= 1 in WebCore::RenderMultiColumnSet::columnCount
130         https://bugs.webkit.org/show_bug.cgi?id=136365
131         <rdar://problem/27686727>
132
133         Reviewed by Simon Fraser.
134
135         Margin value overflow ends up confusing the column count computing logic.
136
137         Test: fast/multicol/assert-on-column-count-when-zoomed-in.html
138
139         * css/StyleResolver.cpp:
140         (WebCore::addIntrinsicMargins):
141
142 2016-12-07  Ryosuke Niwa  <rniwa@webkit.org>
143
144         document.caretRangeFromPoint doesn't retarget the resultant Range correctly.
145         https://bugs.webkit.org/show_bug.cgi?id=165146
146
147         Reviewed by Sam Weinig.
148
149         The bug was caused by caretRangeFromPoint not retargeting the resultant Range correctly.
150         Namely, it's possible for RenderObject::positionForPoint to move across shadow boundary
151         even if node was identically equal to ancestorInThisScope(node).
152
153         Fixed the bug by directly retargeting the range's container node and its offset as done
154         for elementFromPoint in r206795.
155
156         Test: fast/shadow-dom/caret-range-from-point-in-shadow-tree.html
157
158         * dom/Document.cpp:
159         (WebCore::Document::caretRangeFromPoint):
160
161 2016-12-07  Antoine Quint  <graouts@apple.com>
162
163         [Modern Media Controls] Entering fullscreen and returning to inline shows fullscreen controls
164         https://bugs.webkit.org/show_bug.cgi?id=165536
165
166         Reviewed by Tim Horton.
167
168         We regressed when we implemented the fix for webkit.org/b/165494 and we started to rely solely
169         on the "webkitpresentationmodechanged" event to identify presention mode changes. As it turns out,
170         when the "webkitpresentationmodechanged" event is dispatched when exiting fullscreen and returning
171         to the inline presentation mode, querying the "webkitPresentationMode" property says "inline" while
172         "webkitDisplayingFullscreen" still returns true (raised as webkit.org/b/165538).
173         
174         We now use the "webkitPresentationMode" property when that property is supported and we're using the
175         "webkitpresentationmodechanged" event, and we use the "webkitDisplayingFullscreen" property otherwise.
176
177         Test: media/modern-media-controls/media-controller/media-controller-inline-to-fullscreen-to-inline.html
178
179         * Modules/modern-media-controls/media/media-controller.js:
180         (MediaController.prototype.get layoutTraits):
181
182 2016-12-07  Wenson Hsieh  <wenson_hsieh@apple.com>
183
184         Scroll position jumps to the origin when scrolling without momentum at the end of a scroll snapping container
185         https://bugs.webkit.org/show_bug.cgi?id=165474
186         <rdar://problem/29534305>
187
188         Reviewed by Simon Fraser.
189
190         When initializing an AppKit _NSScrollingMomentumCalculator, if the initial and target positions are the same and
191         the initial velocity is (0, 0), the momentum calculator will output (0, 0) as the animated scroll position when
192         animating. This causes the scroll position to jump to the top left in some cases when scrolling in scroll snap
193         containers. To fix this, we teach the ScrollingMomentumCalculatorMac to return an animation duration of 0 and
194         an animated scroll position equal to the final scroll position when this is the case.
195
196         Test: tiled-drawing/scrolling/scroll-snap/scrolling-jumps-to-top.html
197
198         * page/scrolling/mac/ScrollingMomentumCalculatorMac.h:
199         * page/scrolling/mac/ScrollingMomentumCalculatorMac.mm:
200         (WebCore::ScrollingMomentumCalculatorMac::ScrollingMomentumCalculatorMac):
201         (WebCore::ScrollingMomentumCalculatorMac::scrollOffsetAfterElapsedTime):
202         (WebCore::ScrollingMomentumCalculatorMac::animationDuration):
203
204 2016-12-07  Nan Wang  <n_wang@apple.com>
205
206         AX: menu type toolbar should be mapped correctly on Mac
207         https://bugs.webkit.org/show_bug.cgi?id=165537
208
209         Reviewed by Chris Fleizach.
210
211         The menu tag with a toolbar type should have the corresponding role.
212
213         Test: accessibility/mac/menu-type-toolbar.html
214
215         * accessibility/AccessibilityRenderObject.cpp:
216         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
217
218 2016-12-07  Wenson Hsieh  <wenson_hsieh@apple.com>
219
220         Add a new project for recording and playing back editing commands in editable web content
221         https://bugs.webkit.org/show_bug.cgi?id=165114
222         <rdar://problem/29408135>
223
224         Reviewed by Beth Dakin.
225
226         Adds new scripts used to record and play back editing, as well as a new Xcode Copy files phase that pushes these
227         scripts to the internal system directory when installing. See the Tools ChangeLog and individual comments below
228         for more details. Covered by 3 new unit tests in the EditingHistory project.
229
230         * InternalScripts/DumpEditingHistory.js: Added.
231         (beginProcessingTopLevelUpdate):
232         (endProcessingTopLevelUpdate):
233         (appendDOMUpdatesFromRecords):
234         (appendSelectionUpdateIfNecessary):
235
236         Adds new entries into the top-level list of DOM updates captured when editing. Respectively, these are input
237         events and selection changes.
238
239         (EditingHistory.getEditingHistoryAsJSONString):
240         * InternalScripts/EditingHistoryUtil.js: Added.
241         (prototype._scramble):
242         (prototype.applyToText):
243         (prototype.applyToFilename):
244         (prototype._scrambedNumberIndexForCode):
245         (prototype._scrambedLowercaseIndexForCode):
246         (prototype._scrambedUppercaseIndexForCode):
247
248         Naive implementation of an obfuscator. Currently, this only affects alphanumeric characters. Obfuscation is off
249         by default, but can be toggled on in JavaScript.
250
251         (elementFromMarkdown):
252         (GlobalNodeMap):
253         (GlobalNodeMap.prototype.nodesForGUIDs):
254         (GlobalNodeMap.prototype.guidsForTNodes):
255         (GlobalNodeMap.prototype.nodeForGUID):
256         (GlobalNodeMap.prototype.guidForNode):
257         (GlobalNodeMap.prototype.hasGUIDForNode):
258         (GlobalNodeMap.prototype.nodes):
259         (GlobalNodeMap.prototype.toObject):
260         (GlobalNodeMap.fromObject):
261         (GlobalNodeMap.dataForNode):
262         (GlobalNodeMap.elementFromTagName):
263         (GlobalNodeMap.nodeAttributesToObject):
264         (GlobalNodeMap.prototype.descriptionHTMLForGUID):
265         (GlobalNodeMap.prototype.descriptionHTMLForNode):
266
267         The GlobalNodeMap keeps track of every node that has appeared in the DOM, assigning each node a globally unique
268         identifier (GUID). This GUID is used when reconstructing the DOM, as well as unapplying or applying editing.
269
270         (SelectionState):
271         (SelectionState.prototype.isEqual):
272         (SelectionState.prototype.applyToSelection):
273         (SelectionState.fromSelection):
274         (SelectionState.prototype.toObject):
275         (SelectionState.fromObject):
276
277         Represents a snapshot of the Selection state (determined by getSelection()).
278
279         (DOMUpdate):
280         (DOMUpdate.prototype.apply):
281         (DOMUpdate.prototype.unapply):
282         (DOMUpdate.prototype.targetNode):
283         (DOMUpdate.prototype.detailsElement):
284         (DOMUpdate.ofType):
285         (DOMUpdate.fromRecords):
286
287         A DOMUpdate is an abstract object representing a change in the DOM that may be applied and unapplied. These are
288         also serializable as hashes, which may then be converted to JSON when generating editing history data.
289
290         (ChildListUpdate):
291         (ChildListUpdate.prototype.apply):
292         (ChildListUpdate.prototype.unapply):
293         (ChildListUpdate.prototype._nextSibling):
294         (ChildListUpdate.prototype._removedNodes):
295         (ChildListUpdate.prototype._addedNodes):
296         (ChildListUpdate.prototype.toObject):
297         (ChildListUpdate.prototype.detailsElement):
298         (ChildListUpdate.fromObject):
299
300         These three update types correspond to the three types of DOM mutations. These may appear as top-level updates
301         if they are not captured during an input event, but for the majority of user-input-driven changes, they will be
302         children of an input event.
303
304         (CharacterDataUpdate):
305         (CharacterDataUpdate.prototype.apply):
306         (CharacterDataUpdate.prototype.unapply):
307         (CharacterDataUpdate.prototype.detailsElement):
308         (CharacterDataUpdate.prototype.toObject):
309         (CharacterDataUpdate.fromObject):
310         (AttributeUpdate):
311         (AttributeUpdate.prototype.apply):
312         (AttributeUpdate.prototype.unapply):
313         (AttributeUpdate.prototype.detailsElement):
314         (AttributeUpdate.prototype.toObject):
315         (AttributeUpdate.fromObject):
316         (SelectionUpdate):
317         (SelectionUpdate.prototype.apply):
318         (SelectionUpdate.prototype.unapply):
319         (SelectionUpdate.prototype.toObject):
320         (SelectionUpdate.fromObject):
321         (SelectionUpdate.prototype._rangeDescriptionHTML):
322         (SelectionUpdate.prototype._anchorDescriptionHTML):
323         (SelectionUpdate.prototype._focusDescriptionHTML):
324         (SelectionUpdate.prototype.detailsElement):
325
326         Represents a change in the Selection. While no changes to the DOM structure occur as a result of a
327         SelectionUpdate, the information contained in these updates is used to determine where the selection should be
328         when rewinding or playing back the editing history.
329
330         (InputEventUpdate):
331         (InputEventUpdate.prototype._obfuscatedData):
332         (InputEventUpdate.prototype.apply):
333         (InputEventUpdate.prototype.unapply):
334         (InputEventUpdate.prototype.toObject):
335         (InputEventUpdate.fromObject):
336         (InputEventUpdate.prototype.detailsElement):
337
338         Represents an update due to user input, which consists of some number of child DOM mutation updates.
339
340         * WebCore.xcodeproj/project.pbxproj:
341
342 2016-12-07  Jer Noble  <jer.noble@apple.com>
343
344         ASSERT crash while running media-source/mediasource-activesourcebuffers.html under Stress GC bot.
345         https://bugs.webkit.org/show_bug.cgi?id=165514
346
347         Reviewed by Eric Carlson.
348
349         If a track associated with MSE is disabled after a SourceBuffer begins parsing a queued
350         append operation, SourceBuffer can get into a state where it asks SourceBufferPrivateAVFObjC
351         if it is ready to accept data for that disabled track. This causes an ASSERT_NOT_REACHED in
352         isReadyForMoreData().
353
354         However, this seems to be a valid condition; we can safely just return "false" from
355         isReadyForMoreSamples() (and also bail from notifyClientWhenReadyForMoreSamples()) when asked
356         about a disabled track.
357
358         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
359         (WebCore::SourceBufferPrivateAVFObjC::isReadyForMoreSamples):
360         (WebCore::SourceBufferPrivateAVFObjC::notifyClientWhenReadyForMoreSamples):
361
362 2016-12-07  Dave Hyatt  <hyatt@apple.com>
363
364         [CSS Parser] Eliminate the Scope class and fold it into CSSTokenizer
365         https://bugs.webkit.org/show_bug.cgi?id=165532
366
367         Reviewed by Dean Jackson.
368
369         The Scope class, nested inside CSSTokenizer, is both poorly named and serves
370         no purpose. It's especially weird that it was the entry point into tokenization
371         instead of CSSTokenizer.
372
373         Eliminate the class, fold its members and functions into CSSTokenizer, and have
374         callers just make a CSSTokenizer instead.
375
376         * css/parser/CSSParser.cpp:
377         (WebCore::CSSParser::parseSupportsCondition):
378         (WebCore::CSSParser::parseSelector):
379         * css/parser/CSSParserImpl.cpp:
380         (WebCore::CSSParserImpl::parseValue):
381         (WebCore::CSSParserImpl::parseCustomPropertyValue):
382         (WebCore::CSSParserImpl::parseInlineStyleDeclaration):
383         (WebCore::CSSParserImpl::parseDeclarationList):
384         (WebCore::CSSParserImpl::parseRule):
385         (WebCore::CSSParserImpl::parseStyleSheet):
386         (WebCore::CSSParserImpl::parseKeyframeKeyList):
387         (WebCore::CSSParserImpl::parseDeclarationListForInspector):
388         (WebCore::CSSParserImpl::parseStyleSheetForInspector):
389         * css/parser/CSSTokenizer.cpp:
390         (WebCore::CSSTokenizer::CSSTokenizer):
391         (WebCore::CSSTokenizer::tokenRange):
392         (WebCore::CSSTokenizer::tokenCount):
393         (WebCore::CSSTokenizer::registerString):
394         (WebCore::CSSTokenizer::Scope::Scope): Deleted.
395         (WebCore::CSSTokenizer::Scope::tokenRange): Deleted.
396         (WebCore::CSSTokenizer::Scope::tokenCount): Deleted.
397         * css/parser/CSSTokenizer.h:
398         (WebCore::CSSTokenizer::Scope::storeString): Deleted.
399         * css/parser/CSSTokenizerInputStream.cpp:
400         (WebCore::CSSTokenizerInputStream::CSSTokenizerInputStream):
401         * css/parser/CSSTokenizerInputStream.h:
402         * css/parser/MediaQueryParser.cpp:
403         (WebCore::MediaQueryParser::parseMediaQuerySet):
404         * css/parser/SizesAttributeParser.cpp:
405         (WebCore::SizesAttributeParser::SizesAttributeParser):
406
407 2016-12-07  Joseph Pecoraro  <pecoraro@apple.com>
408
409         Web Inspector: Remove unused and mostly untested Page domain commands and events
410         https://bugs.webkit.org/show_bug.cgi?id=165507
411
412         Reviewed by Brian Burg.
413
414         Remove any code associated with the commands/events being removed.
415
416         * inspector/DOMPatchSupport.cpp:
417         * inspector/DOMPatchSupport.h:
418         * inspector/InspectorClient.h:
419         (WebCore::InspectorClient::handleJavaScriptDialog): Deleted.
420         * inspector/InspectorInstrumentation.cpp:
421         (WebCore::InspectorInstrumentation::scriptsEnabledImpl): Deleted.
422         (WebCore::InspectorInstrumentation::willRunJavaScriptDialogImpl): Deleted.
423         (WebCore::InspectorInstrumentation::didRunJavaScriptDialogImpl): Deleted.
424         * inspector/InspectorInstrumentation.h:
425         (WebCore::InspectorInstrumentation::scriptsEnabled): Deleted.
426         (WebCore::InspectorInstrumentation::willRunJavaScriptDialog): Deleted.
427         (WebCore::InspectorInstrumentation::didRunJavaScriptDialog): Deleted.
428         * inspector/InspectorPageAgent.cpp:
429         (WebCore::InspectorPageAgent::disable):
430         (WebCore::InspectorPageAgent::didClearWindowObjectInWorld):
431         (WebCore::InspectorPageAgent::didPaint):
432         (WebCore::InspectorPageAgent::buildObjectForFrame):
433         (WebCore::InspectorPageAgent::archive):
434         (WebCore::createXHRTextDecoder): Deleted.
435         (WebCore::InspectorPageAgent::getScriptExecutionStatus): Deleted.
436         (WebCore::InspectorPageAgent::setScriptExecutionDisabled): Deleted.
437         (WebCore::InspectorPageAgent::willRunJavaScriptDialog): Deleted.
438         (WebCore::InspectorPageAgent::didRunJavaScriptDialog): Deleted.
439         (WebCore::InspectorPageAgent::scriptsEnabled): Deleted.
440         (WebCore::InspectorPageAgent::handleJavaScriptDialog): Deleted.
441         * inspector/InspectorPageAgent.h:
442         * page/Chrome.cpp:
443         (WebCore::Chrome::runBeforeUnloadConfirmPanel):
444         (WebCore::Chrome::runJavaScriptAlert):
445         (WebCore::Chrome::runJavaScriptConfirm):
446         (WebCore::Chrome::runJavaScriptPrompt):
447         * page/Settings.cpp:
448         (WebCore::Settings::setScriptEnabled):
449
450 2016-12-07  Jer Noble  <jer.noble@apple.com>
451
452         [pointer-lock] Cursor should become visible when exiting pointer-lock via ESC key.
453         https://bugs.webkit.org/show_bug.cgi?id=165377
454
455         Reviewed by Eric Carlson.
456
457         Follow up to previous patch; clear the m_forceCursorVisibleUponUnlock flag upon losing
458         pointer lock, so that subsequent unlocks don't erroneously cause the cursor to become
459         visible. 
460
461         * page/PointerLockController.cpp:
462         (WebCore::PointerLockController::didLosePointerLock):
463
464 2016-12-06  Geoffrey Garen  <ggaren@apple.com>
465
466         performance.now() should truncate to 100us
467         https://bugs.webkit.org/show_bug.cgi?id=165503
468         <rdar://problem/29544531>
469
470         Reviewed by Mark Lam.
471
472         * page/Performance.cpp:
473         (WebCore::Performance::reduceTimeResolution):
474
475 2016-12-07  Dave Hyatt  <hyatt@apple.com>
476
477         [CSS Parser] Turn back on a bunch of layout tests
478         https://bugs.webkit.org/show_bug.cgi?id=165529
479
480         Reviewed by Zalan Bujtas.
481
482         Fixes fast/css/transform-origin-parsing.html.
483
484         * css/parser/CSSPropertyParser.cpp:
485         (WebCore::CSSPropertyParser::consumeTransformOrigin):
486         The implicit check was relying on a null check of the z value, but
487         we called releaseNonNull on it already. This meant all z properties were
488         marked as implicit incorrectly. Fix by storing whether or not we had a z
489         value in a local variable.
490
491 2016-12-07  Andreas Kling  <akling@apple.com>
492
493         [iOS] Remove bitrotted FrameLoader attempt to limit page caching under memory pressure.
494         <https://webkit.org/b/165527>
495
496         Reviewed by Antti Koivisto.
497
498         This code no longer does anything, as the page cache is hard capped
499         at 0 entries while under memory pressure.
500
501         * loader/FrameLoader.cpp:
502         (WebCore::FrameLoader::commitProvisionalLoad):
503
504 2016-12-06  Antoine Quint  <graouts@apple.com>
505
506         [Modern Media Controls] Use tap and pinch gestures on iOS
507         https://bugs.webkit.org/show_bug.cgi?id=165518
508
509         Reviewed by Dean Jackson.
510
511         We now use touch events to identify taps and pinches on media controls to respond immediately
512         to user interaction on buttons and enter fullscreen when pinching out.
513
514         * Modules/modern-media-controls/controls/button.css:
515         (button):
516         * Modules/modern-media-controls/controls/button.js:
517         (Button):
518         (Button.prototype.handleEvent):
519         (Button.prototype.gestureRecognizerStateDidChange):
520         (Button.prototype._notifyDelegateOfActivation):
521         (Button.prototype._handleUIEvent): Deleted.
522         * Modules/modern-media-controls/controls/controls-bar.js:
523         (ControlsBar.prototype.set fadesWhileIdle):
524         (ControlsBar.prototype.gestureRecognizerStateDidChange):
525         * Modules/modern-media-controls/controls/icon-button.js:
526         (IconButton.prototype._updateImage):
527         (IconButton):
528         * Modules/modern-media-controls/controls/ios-inline-media-controls.js:
529         (IOSInlineMediaControls.prototype.gestureRecognizerStateDidChange):
530         * Modules/modern-media-controls/gesture-recognizers/gesture-recognizer.js: Added.
531         (GestureRecognizer):
532         (GestureRecognizer.prototype.get state):
533         (GestureRecognizer.prototype.set state):
534         (GestureRecognizer.prototype.get target):
535         (GestureRecognizer.prototype.set target):
536         (GestureRecognizer.prototype.get numberOfTouches):
537         (GestureRecognizer.prototype.get enabled):
538         (GestureRecognizer.prototype.set enabled):
539         (GestureRecognizer.prototype.reset):
540         (GestureRecognizer.prototype.locationInElement):
541         (GestureRecognizer.prototype.locationInClient):
542         (GestureRecognizer.prototype.locationOfTouchInElement):
543         (GestureRecognizer.prototype.touchesBegan):
544         (GestureRecognizer.prototype.touchesMoved):
545         (GestureRecognizer.prototype.touchesEnded):
546         (GestureRecognizer.prototype.touchesCancelled):
547         (GestureRecognizer.prototype.gestureBegan):
548         (GestureRecognizer.prototype.gestureChanged):
549         (GestureRecognizer.prototype.gestureEnded):
550         (GestureRecognizer.prototype.enterPossibleState):
551         (GestureRecognizer.prototype.enterBeganState):
552         (GestureRecognizer.prototype.enterEndedState):
553         (GestureRecognizer.prototype.enterCancelledState):
554         (GestureRecognizer.prototype.enterFailedState):
555         (GestureRecognizer.prototype.enterChangedState):
556         (GestureRecognizer.prototype.enterRecognizedState):
557         (GestureRecognizer.prototype.handleEvent):
558         (GestureRecognizer.prototype._initRecognizer):
559         (GestureRecognizer.prototype._updateBaseListeners):
560         (GestureRecognizer.prototype._removeTrackingListeners):
561         (GestureRecognizer.prototype._updateTargetTouches):
562         (GestureRecognizer.prototype._updateKeyboardModifiers):
563         * Modules/modern-media-controls/gesture-recognizers/pinch.js: Added.
564         (PinchGestureRecognizer):
565         (PinchGestureRecognizer.prototype.get velocity):
566         (PinchGestureRecognizer.prototype.touchesBegan):
567         (PinchGestureRecognizer.prototype.touchesMoved):
568         (PinchGestureRecognizer.prototype.touchesEnded):
569         (PinchGestureRecognizer.prototype.gestureBegan):
570         (PinchGestureRecognizer.prototype.gestureChanged):
571         (PinchGestureRecognizer.prototype.gestureEnded):
572         (PinchGestureRecognizer.prototype.reset):
573         (PinchGestureRecognizer.prototype._recordGesture):
574         (PinchGestureRecognizer.prototype._updateStateWithEvent):
575         (PinchGestureRecognizer.prototype._distance):
576         * Modules/modern-media-controls/gesture-recognizers/tap.js: Added.
577         (TapGestureRecognizer):
578         (TapGestureRecognizer.prototype.touchesBegan):
579         (TapGestureRecognizer.prototype.touchesMoved):
580         (TapGestureRecognizer.prototype.touchesEnded):
581         (TapGestureRecognizer.prototype.reset):
582         (TapGestureRecognizer.prototype.locationInElement):
583         (TapGestureRecognizer.prototype.locationInClient):
584         (TapGestureRecognizer.prototype._clearTimer):
585         (TapGestureRecognizer.prototype._rewindTimer):
586         (TapGestureRecognizer.prototype._timerFired):
587         * Modules/modern-media-controls/js-files:
588         * Modules/modern-media-controls/media/airplay-support.js:
589         (AirplaySupport.prototype.buttonWasClicked): Deleted.
590         * Modules/modern-media-controls/media/controls-visibility-support.js:
591         (ControlsVisibilitySupport):
592         (ControlsVisibilitySupport.prototype.handleEvent):
593         (ControlsVisibilitySupport.prototype.syncControl): Deleted.
594         * Modules/modern-media-controls/media/fullscreen-support.js:
595         (FullscreenSupport):
596         (FullscreenSupport.prototype.iOSInlineMediaControlsRecognizedPinchInGesture):
597         (FullscreenSupport.prototype.buttonWasClicked): Deleted.
598         * Modules/modern-media-controls/media/media-controller-support.js:
599         (MediaControllerSupport):
600         (MediaControllerSupport.prototype.handleEvent):
601         (MediaControllerSupport.prototype.buttonWasClicked): Deleted.
602         * Modules/modern-media-controls/media/mute-support.js:
603         (MuteSupport.prototype.buttonWasClicked): Deleted.
604         * Modules/modern-media-controls/media/pip-support.js:
605         (PiPSupport.prototype.buttonWasClicked): Deleted.
606         * Modules/modern-media-controls/media/playback-support.js:
607         (PlaybackSupport.prototype.buttonWasClicked): Deleted.
608         * Modules/modern-media-controls/media/skip-back-support.js:
609         (SkipBackSupport.prototype.buttonWasClicked): Deleted.
610         * Modules/modern-media-controls/media/start-support.js:
611         (StartSupport.prototype.buttonWasClicked): Deleted.
612         * Modules/modern-media-controls/media/tracks-support.js:
613         (TracksSupport.prototype.buttonWasClicked): Deleted.
614
615 2016-12-06  Dean Jackson  <dino@apple.com>
616
617         Apply styling to media documents with modern controls
618         https://bugs.webkit.org/show_bug.cgi?id=165499
619         <rdar://problems/29543847>
620
621         Reviewed by Antoine Quint.
622
623         Forgot to commit most of the changes in MediaDocument.cpp :(
624
625         * html/MediaDocument.cpp:
626         (WebCore::MediaDocumentParser::createDocumentStructure):
627
628 2016-12-06  Simon Fraser  <simon.fraser@apple.com>
629
630         Two tiled drawing tests failing with visual viewports enabled.
631         https://bugs.webkit.org/show_bug.cgi?id=165489
632
633         Reviewed by Dean Jackson.
634
635         computeLayoutViewportOrigin() gets called for iframes when the layout viewport
636         is zero-sized, but the visual viewport is non-zero. It doesn't really make sense
637         to compute a layout viewport when the visual viewport is larger than the layout
638         viewport, but if this happens just anchor the layout viewport at the origin
639         of the visual viewport.
640
641         * page/FrameView.cpp:
642         (WebCore::FrameView::computeLayoutViewportOrigin):
643
644 2016-12-04  Darin Adler  <darin@apple.com>
645
646         Remove various stray uses of WebCore::Dictionary
647         https://bugs.webkit.org/show_bug.cgi?id=165358
648
649         Reviewed by Sam Weinig.
650
651         I discovered three completely unused classes in the MediaStream code:
652         MediaTrackConstraint, MediaTrackConstraintSet, and MediaTrackConstraints.
653         While there is some chance we may implement these at some point, they are
654         likely to be dictionaries or some other kind of data structure rather than
655         clases, and there is no reason to keep the current classes.
656
657         * CMakeLists.txt: Removed MediaTrackConstraint, MediaTrackConstraintSet,
658         and MediaTrackConstraints.
659         * DerivedSources.cpp: Ditto.
660         * DerivedSources.make: Ditto.
661
662         * Modules/indexeddb/IDBDatabase.h: Removed include of Dictionary.h.
663         * Modules/indexeddb/IDBObjectStore.cpp: Added include of HeapInlines.h.
664         * Modules/indexeddb/IDBRequest.cpp: Added include of StrongInlines.h.
665         * Modules/indexeddb/IDBTransaction.cpp: Added include of SerializedScriptValue.h.
666
667         * Modules/mediastream/MediaStreamTrack.cpp:
668         (WebCore::MediaStreamTrack::getConstraints): Deleted.
669         This function is implemented entirely in the bindings layer.
670         * Modules/mediastream/MediaStreamTrack.h: Removed getConstraints.
671
672         * Modules/mediastream/MediaTrackConstraint.cpp: Removed.
673         * Modules/mediastream/MediaTrackConstraint.h: Removed.
674         * Modules/mediastream/MediaTrackConstraint.idl: Removed.
675         * Modules/mediastream/MediaTrackConstraintSet.cpp: Removed.
676         * Modules/mediastream/MediaTrackConstraintSet.h: Removed.
677         * Modules/mediastream/MediaTrackConstraintSet.idl: Removed.
678         * Modules/mediastream/MediaTrackConstraints.cpp: Removed.
679         * Modules/mediastream/MediaTrackConstraints.h: Removed.
680         * Modules/mediastream/MediaTrackConstraints.idl: Removed.
681
682         * Modules/mediastream/NavigatorUserMedia.idl: Use the type names from the latest
683         getUserMedia specification for the arguments to webkitGetUserMedia; not sure they
684         are precisely correct for this legacy function, but since this is a JSBuiltin,
685         it's all ignored anyway. Just important not to call anything "Dictionary".
686
687         * WebCore.xcodeproj/project.pbxproj: Removed MediaTrackConstraint, MediaTrackConstraintSet,
688         and MediaTrackConstraints.
689
690         * bindings/js/JSApplePaySessionCustom.cpp:
691         (WebCore::JSApplePaySession::completeShippingMethodSelection): Use uncheckedArgument, since
692         the code explicitly checks the number of arguments.
693         (WebCore::JSApplePaySession::completeShippingContactSelection): Ditto.
694         (WebCore::JSApplePaySession::completePaymentMethodSelection): Ditto.
695
696         * bindings/js/JSFontFaceCustom.cpp: Removed include of Dictionary.h.
697         * dom/Document.cpp: Ditto.
698         * dom/Element.cpp: Ditto.
699
700         * dom/Element.h: Removed forward declaration of Dictionary.
701
702 2016-12-06  Wenson Hsieh  <wenson_hsieh@apple.com>
703
704         After preventing a beforeinput event, an input event is fired when formatting rich text
705         https://bugs.webkit.org/show_bug.cgi?id=165435
706         <rdar://problem/29522314>
707
708         Reviewed by Ryosuke Niwa.
709
710         This regressed after I refactored some input event event dispatch logic when formatting text in r208461.
711         I moved the logic for dispatching input events when applying styles into Editor::applyStyle, but left out an
712         early return after firing the beforeinput event if the default behavior was prevented, which caused us to
713         continue on and dispatch an input event. The fix is to bail from applyStyle if default was prevented.
714
715         Augmented an existing layout test to cover this case.
716
717         * editing/Editor.cpp:
718         (WebCore::Editor::applyStyle):
719         (WebCore::Editor::applyParagraphStyle):
720
721 2016-12-06  Antoine Quint  <graouts@apple.com>
722
723         [Modern Media Controls] Instantiate iOS media controls
724         https://bugs.webkit.org/show_bug.cgi?id=165498
725
726         Reviewed by Dean Jackson.
727
728         Add support for the modern media controls runtime flags in RenderThemeIOS and, when instantiating iOS controls,
729         return an IOSInlineMediaControls class.
730
731         * Modules/modern-media-controls/media/media-controller.js:
732         (MediaController.prototype._controlsClass):
733         (MediaController):
734         * rendering/RenderThemeIOS.h:
735         * rendering/RenderThemeIOS.mm:
736         (WebCore::RenderThemeIOS::mediaControlsStyleSheet):
737         (WebCore::RenderThemeIOS::mediaControlsScript):
738         (WebCore::RenderThemeIOS::mediaControlsBase64StringForIconAndPlatform):
739
740 2016-12-06  Dean Jackson  <dino@apple.com>
741
742         Apply styling to media documents with modern controls
743         https://bugs.webkit.org/show_bug.cgi?id=165499
744         <rdar://problems/29543847>
745
746         Reviewed by Antoine Quint.
747
748         Existing MediaDocuments got styling from the injected style
749         sheet, which had rules for such documents. The modern media controls
750         use a scoped style rule, so we can't touch the document style. Instead,
751         inline the style directly from MediaDocument.
752
753         Test: media/modern-media-controls/media-documents/background-color-and-centering.html
754
755         * html/MediaDocument.cpp:
756         (WebCore::MediaDocumentParser::createDocumentStructure):
757
758 2016-12-06  Zalan Bujtas  <zalan@apple.com>
759
760         Move RenderElement::rendererForRootBackground to RenderView.
761         https://bugs.webkit.org/show_bug.cgi?id=165454
762
763         Reviewed by Simon Fraser.
764
765         Currently RenderElement::rendererForRootBackground can only be called on document element's renderer.
766         This patch removes this limitation and moves the functionality from RenderElement to RenderView.
767
768         No change in functionality.
769
770         * page/FrameView.cpp:
771         (WebCore::FrameView::calculateExtendedBackgroundMode):
772         * rendering/RenderBox.cpp:
773         (WebCore::RenderBox::paintRootBoxFillLayers):
774         * rendering/RenderElement.cpp:
775         (WebCore::RenderElement::rendererForRootBackground): Deleted.
776         * rendering/RenderElement.h:
777         * rendering/RenderLayerBacking.cpp:
778         (WebCore::RenderLayerBacking::rendererBackgroundColor):
779         * rendering/RenderView.cpp:
780         (WebCore::RenderView::rendererForRootBackground):
781         (WebCore::rendererObscuresBackground):
782         (WebCore::RenderView::paintBoxDecorations):
783         (WebCore::RenderView::rootBackgroundIsEntirelyFixed):
784         * rendering/RenderView.h:
785
786 2016-12-05  Jiewen Tan  <jiewen_tan@apple.com>
787
788         [Part 1 of 2] Add support for SPKI format while doing SubtleCrypto.importKey/exportKey
789         https://bugs.webkit.org/show_bug.cgi?id=129978
790         <rdar://problem/21799829>
791
792         This is part 1 of Bug 129978. In this patch, it adds the SPKI format support for
793         SubtleCrypto.importKey/exportKey. Currently support algorithms are RSAES-PKCS1-v1_5,
794         RSASSA-PKCS1-v1_5 and RSA-OAEP.
795
796         Reviewed by Brent Fulgham.
797
798         Tests: crypto/subtle/rsa-import-jwk-key-export-spki-key.html
799                crypto/subtle/rsa-import-spki-key-export-jwk-key.html
800                crypto/subtle/rsa-import-spki-key-export-spki-key.html
801                crypto/subtle/rsa-import-spki-small-key.html
802                crypto/subtle/rsa-oaep-generate-export-key-spki.html
803                crypto/subtle/rsa-oaep-import-spki-key.html
804                crypto/subtle/rsaes-pkcs1-v1_5-generate-export-key-spki.html
805                crypto/subtle/rsaes-pkcs1-v1_5-import-spki-key.html
806                crypto/subtle/rsassa-pkcs1-v1_5-generate-export-key-spki.html
807                crypto/subtle/rsassa-pkcs1-v1_5-import-spki-key.html
808                crypto/workers/subtle/rsa-export-spki-key.html
809                crypto/workers/subtle/rsa-import-spki-key.html
810
811         * bindings/js/JSSubtleCryptoCustom.cpp:
812         (WebCore::toKeyData):
813         * crypto/CommonCryptoUtilities.h:
814         * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
815         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::importKey):
816         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::exportKey):
817         * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
818         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::importKey):
819         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::exportKey):
820         * crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
821         (WebCore::CryptoAlgorithmRSA_OAEP::importKey):
822         (WebCore::CryptoAlgorithmRSA_OAEP::exportKey):
823         * crypto/gnutls/CryptoKeyRSAGnuTLS.cpp:
824         (WebCore::CryptoKeyRSA::importSpki):
825         (WebCore::CryptoKeyRSA::exportSpki):
826         * crypto/keys/CryptoKeyRSA.h:
827         * crypto/mac/CryptoKeyRSAMac.cpp:
828         (WebCore::bytesUsedToEncodedLength):
829         (WebCore::bytesNeededForEncodedLength):
830         (WebCore::addEncodedASN1Length):
831         (WebCore::CryptoKeyRSA::importSpki):
832         (WebCore::CryptoKeyRSA::exportSpki):
833
834 2016-12-06  Simon Fraser  <simon.fraser@apple.com>
835
836         Fix editing text flakiness introduced in r209411
837         https://bugs.webkit.org/show_bug.cgi?id=165500
838
839         Reviewed by Dean Jackson.
840
841         The "insideFixed" out param was left uninitialized sometimes. This affected FrameSelection's 
842         m_caretInsidePositionFixed, which caused problems in these tests.
843
844         Tested by editing tests in WK1.
845
846         * editing/htmlediting.cpp:
847         (WebCore::absoluteBoundsForLocalCaretRect):
848
849 2016-12-06  Alexey Proskuryakov  <ap@apple.com>
850
851         Correct SDKROOT values in xcconfig files
852         https://bugs.webkit.org/show_bug.cgi?id=165487
853         rdar://problem/29539209
854
855         Reviewed by Dan Bernstein.
856
857         Fix suggested by Dan Bernstein.
858
859         * Configurations/DebugRelease.xcconfig:
860
861 2016-12-06  Saam Barati  <sbarati@apple.com>
862
863         Remove old Wasm object model
864         https://bugs.webkit.org/show_bug.cgi?id=165481
865
866         Reviewed by Keith Miller and Mark Lam.
867
868         * testing/Internals.cpp:
869         (WebCore::Internals::parserMetaData):
870
871 2016-12-06  Antoine Quint  <graouts@apple.com>
872
873         [Modern Media Controls] Media controls use the fullscreen layout after going from inline to fullscreen to PiP to inline
874         https://bugs.webkit.org/show_bug.cgi?id=165494
875
876         Reviewed by Dean Jackson.
877
878         We would only call _updateControlsIfNeeded() when entering or leaving fullscreen, so we going from fullscreen to PiP to
879         inline would retain fullscreen controls since we would not check for the event that indicates we went back from PiP to
880         inline. On platforms that support it, we listen to the "webkitpresentationmodechanged" event
881         to update the controls, and only "webkitfullscreenchange" on others (ie. Yosemite).
882
883         Test: media/modern-media-controls/media-controller/media-controller-inline-to-fullscreen-to-pip-to-inline.html
884
885         * Modules/modern-media-controls/media/media-controller.js:
886         (MediaController):
887         (MediaController.prototype.handleEvent):
888         (MediaController.prototype._returnMediaLayerToInlineIfNeeded):
889
890 2016-12-06  Antoine Quint  <graouts@apple.com>
891
892         [Modern Media Controls] Rendering issues with controls bar when captions are on
893         https://bugs.webkit.org/show_bug.cgi?id=165390
894
895         Reviewed by Dean Jackson.
896
897         We would face some layout issues with captions due to RenderImage::layoutShadowControls()
898         expecting a single RenderBox in the media controls shadow root, which was the case with
899         legacy media controls, but no longer the case with modern media controls. We now host
900         both the captions and the media controls elements under a single container, and add
901         an asertion in RenderImage to check that a single RenderBox child exists.
902
903         Test: media/modern-media-controls/media-controller/media-controller-single-container.html
904
905         * Modules/modern-media-controls/controls/media-controls.css:
906         (.media-controls-container):
907         (.media-controls-container,):
908         (.media-controls-container > *):
909         (.media-controls):
910         * Modules/modern-media-controls/controls/text-tracks.css:
911         (video::-webkit-media-text-track-container):
912         * Modules/modern-media-controls/media/media-controller.js:
913         (MediaController):
914         (MediaController.prototype._updateControlsIfNeeded):
915         * rendering/RenderImage.cpp:
916         (WebCore::RenderImage::layoutShadowControls):
917
918 2016-12-06  Antoine Quint  <graouts@apple.com>
919
920         [Modern Media Controls] Automatically hide the controls bar when the mouse is idle
921         https://bugs.webkit.org/show_bug.cgi?id=165492
922
923         Reviewed by Dean Jackson.
924
925         We now automatically hide the controls bar. When the media is no longer paused, the controls remain
926         visible for 4 seconds, regardless of where the mouse pointer is located. When the user mouses over the
927         media, the controls become visible and automatically hide 4 seconds after the last time the user has
928         moved his mouse over the media. When the user mouses out of the media, the controls automatically hide.
929         When the mouse is over the controls bar, it remains visible. When the media is paused, the controls bar
930         remain visible regardless of the mouse position.
931
932         Tests: media/modern-media-controls/media-controller/media-controller-auto-hide-mouse-enter-and-mouse-leave.html
933                media/modern-media-controls/media-controller/media-controller-auto-hide-mouse-enter-over-controls-bar.html
934                media/modern-media-controls/media-controller/media-controller-auto-hide-mouse-leave-after-play.html
935                media/modern-media-controls/media-controller/media-controller-auto-hide-pause.html
936                media/modern-media-controls/media-controller/media-controller-auto-hide-rewind-with-mouse-enter.html
937                media/modern-media-controls/media-controller/media-controller-auto-hide.html
938
939         * Modules/modern-media-controls/controls/controls-bar.css: Added.
940         (.controls-bar):
941         (.controls-bar.faded):
942         * Modules/modern-media-controls/controls/controls-bar.js:
943         (ControlsBar.prototype.get userInteractionEnabled):
944         (ControlsBar.prototype.set userInteractionEnabled):
945         (ControlsBar.prototype.get fadesWhileIdle):
946         (ControlsBar.prototype.set fadesWhileIdle):
947         (ControlsBar.prototype.get visible):
948         (ControlsBar.prototype.set visible):
949         (ControlsBar.prototype.get faded):
950         (ControlsBar.prototype.set faded):
951         (ControlsBar.prototype.handleEvent):
952         (ControlsBar.prototype.commitProperty):
953         (ControlsBar.prototype._cancelAutoHideTimer):
954         (ControlsBar.prototype._rewindAutoHideTimer):
955         (ControlsBar.prototype._autoHideTimerFired):
956         * Modules/modern-media-controls/controls/media-controls.js:
957         * Modules/modern-media-controls/media/controls-visibility-support.js:
958         (ControlsVisibilitySupport.prototype.get mediaEvents):
959         (ControlsVisibilitySupport.prototype.syncControl):
960         (ControlsVisibilitySupport):
961         * Modules/modern-media-controls/media/media-controller.js:
962         (MediaController.prototype._updateControlsIfNeeded):
963
964 2016-12-06  Zalan Bujtas  <zalan@apple.com>
965
966         Can not select whole line when using flexbox
967         https://bugs.webkit.org/show_bug.cgi?id=165299
968
969         Reviewed by David Hyatt.
970
971         RootInlineBox::selectionTopAdjustedForPrecedingBlock assumes that the preceding block is
972         always above the current line. However in certain layout contexts (flex as an example) the block before
973         could just be on the same line as the current one.
974
975         This patch checks if we actually need to adjust the selection top to avoid vertical selection overlap.
976
977         Test: fast/flexbox/flexbox-fail-to-select-same-line.html
978
979         * rendering/RenderBlock.cpp:
980         (WebCore::RenderBlock::blockBeforeWithinSelectionRoot): Deleted.
981         * rendering/RenderBlock.h:
982         * rendering/RootInlineBox.cpp:
983         (WebCore::blockBeforeWithinSelectionRoot):
984         (WebCore::RootInlineBox::selectionTopAdjustedForPrecedingBlock):
985
986 2016-12-06  Ryosuke Niwa  <rniwa@webkit.org>
987
988         Add more assertions to ElementQueue diagnose a bug
989         https://bugs.webkit.org/show_bug.cgi?id=164814
990
991         Reviewed by Alexey Proskuryakov.
992
993         Set m_invoking in release builds now that assertions are also run in release builds.
994
995         * dom/CustomElementReactionQueue.cpp:
996         (WebCore::CustomElementReactionStack::ElementQueue::invokeAll):
997
998 2016-12-06  Jer Noble  <jer.noble@apple.com>
999
1000         YouTube sometimes pauses when switching tabs
1001         https://bugs.webkit.org/show_bug.cgi?id=165468
1002
1003         Reviewed by Eric Carlson.
1004
1005         Test: media/media-session-restrictions.html
1006
1007         The bitfield which represents the restrictions for "VideoAudio" media type was unititialized,
1008         leading to what was effectively a random set of restrictions at runtime.
1009
1010         * platform/audio/PlatformMediaSessionManager.cpp:
1011         (WebCore::PlatformMediaSessionManager::resetRestrictions):
1012         * testing/Internals.cpp:
1013         (WebCore::mediaTypeFromString):
1014         (WebCore::Internals::setMediaSessionRestrictions):
1015         (WebCore::Internals::mediaSessionRestrictions):
1016         * testing/Internals.h:
1017         * testing/Internals.idl:
1018
1019 2016-12-06  Mark Lam  <mark.lam@apple.com>
1020
1021         Introduce the concept of Immutable Prototype Exotic Objects to comply with the spec.
1022         https://bugs.webkit.org/show_bug.cgi?id=165227
1023         <rdar://problem/29442665>
1024
1025         Reviewed by Saam Barati.
1026
1027         Make all objects in window.__proto__'s prototype chain immutable prototype exotic
1028         objects.  This gives us roughly equivalent behavior to other browsers.  
1029
1030         Firefox's behavior differ slightly in that Firefox will fail any attempted
1031         assignment their __proto__, while the immutable prototype exotic objects will
1032         only fail if the assignment is of a different value.  See
1033         https://tc39.github.io/ecma262/#sec-immutable-prototype-exotic-objects.
1034
1035         Chrome differs in that assignment to window.__proto__ is also handled like an
1036         immutable prototype exotic object.  Instead we adhere to the current HTML spec
1037         that says that the assignment should fail unconditionally.  See
1038         https://html.spec.whatwg.org/#the-windowproxy-exotic-object and
1039         https://html.spec.whatwg.org/#windowproxy-setprototypeof.
1040
1041         If the HTML spec is changed to make the WindowProxy and Location objects into
1042         immutable prototype exotic objects later, we can update to match the spec then.
1043
1044         Test: js/prototype-assignment.html
1045
1046         * bindings/js/JSDOMWindowProperties.h:
1047         * bindings/scripts/CodeGeneratorJS.pm:
1048         (GenerateHeader):
1049         (GeneratePrototypeDeclaration):
1050         * bindings/scripts/IDLAttributes.txt:
1051         * dom/EventTarget.idl:
1052         * page/DOMWindow.idl:
1053
1054 2016-12-06  Andreas Kling  <akling@apple.com>
1055
1056         [Cocoa] Add some memory usage related information to sysdiagnose state dumps
1057         <https://webkit.org/b/165375>
1058         <rdar://problem/29057243>
1059
1060         Reviewed by Darin Adler.
1061
1062         Follow-up to address two more review comments.
1063
1064         * page/PerformanceLogging.cpp:
1065         (WebCore::PerformanceLogging::javaScriptObjectCounts): Use WTFMove() when returning the
1066         HashCountedSet to avoid making an extra copy.
1067
1068 2016-12-06  Dave Hyatt  <hyatt@apple.com>
1069
1070         REGRESSION (Safari 10): Scrolling not working inside height 100% table
1071         https://bugs.webkit.org/show_bug.cgi?id=164366
1072         <rdar://problem/29095535>
1073
1074         Reviewed by Zalan Bujtas.
1075
1076         Added fast/table/overflow-percent-height-regression.html
1077
1078         * rendering/RenderBox.cpp:
1079         (WebCore::RenderBox::computePercentageLogicalHeight):
1080         This patch wasn't merged correctly from Blink. The value returned needed
1081         to be 0, not unset.
1082
1083 2016-12-06  Sam Weinig  <sam@webkit.org>
1084
1085         REGRESSION: media/track LayoutTests are flaky failures
1086         https://bugs.webkit.org/show_bug.cgi?id=165432
1087
1088         Reviewed by Antoine Quint.
1089
1090         RenderThemeMac was caching the media controls script / style sheets
1091         and not being invalidated when the RuntimeEnabledFeatures changed. So,
1092         we can just cache both.
1093
1094         * bindings/generic/RuntimeEnabledFeatures.h:
1095         Initialize m_areModernMediaControlsEnabled to false.
1096
1097         * rendering/RenderThemeMac.h:
1098         * rendering/RenderThemeMac.mm:
1099         (WebCore::RenderThemeMac::mediaControlsStyleSheet):
1100         (WebCore::RenderThemeMac::mediaControlsScript):
1101         Have separate caches for the modern and legacy media control scripts/style sheets.
1102
1103 2016-12-06  Sam Weinig  <sam@webkit.org>
1104
1105         DumpRenderTree crashed in com.apple.WebCore: WebCore::MockMediaEndpoint::generateDtlsInfo const + 23
1106         https://bugs.webkit.org/show_bug.cgi?id=165486
1107         <rdar://problem/29149588>
1108
1109         Reviewed by Tim Horton.
1110
1111         The MockMediaEndpoint can be destroyed before the task created in MockMediaEndpoint::generateDtlsInfo()
1112         gets a chance to run, so guard it with a weak pointer.
1113
1114         * platform/mock/MockMediaEndpoint.cpp:
1115         (WebCore::MockMediaEndpoint::MockMediaEndpoint):
1116         (WebCore::MockMediaEndpoint::generateDtlsInfo):
1117         * platform/mock/MockMediaEndpoint.h:
1118
1119 2016-12-06  Chris Dumez  <cdumez@apple.com>
1120
1121         Add HTML interactive form validation blacklist for some WebKit-specific sites
1122         https://bugs.webkit.org/show_bug.cgi?id=165470
1123         <rdar://problem/29509424>
1124
1125         Reviewed by Simon Fraser.
1126
1127         Add HTML interactive form validation blacklist for some WebKit-specific sites
1128         expecting our old behavior, until they get a chance to be updated.
1129
1130         * html/HTMLFormElement.cpp:
1131         (WebCore::isURLBlacklistedForInteractiveFormValidation):
1132         (WebCore::HTMLFormElement::prepareForSubmission):
1133
1134 2016-12-06  Chris Dumez  <cdumez@apple.com>
1135
1136         Unreviewed, rollout r209050.
1137
1138         This change may impact other popovers than the HTML validation one.
1139         The previous code is safer.
1140
1141         * platform/ValidationBubble.h:
1142         * platform/ios/ValidationBubbleIOS.mm:
1143         (-[WebValidationBubbleDelegate adaptivePresentationStyleForPresentationController:traitCollection:]):
1144         (WebCore::ValidationBubble::setAnchorRect):
1145         * platform/spi/ios/UIKitSPI.h:
1146
1147 2016-12-05  Simon Fraser  <simon.fraser@apple.com>
1148
1149         Improve the behavior of scroll-into-view when the target is inside position:fixed
1150         https://bugs.webkit.org/show_bug.cgi?id=165354
1151
1152         Reviewed by Zalan Bujtas.
1153         
1154         The existing RenderLayer::scrollRectToVisible() code paid no heed to whether the 
1155         target was inside position:fixed, resulting in unwanted scrolls.
1156         
1157         Fix this by plumbing through from the call sites a "insideFixed" flag which we get
1158         when we call localToAbsolute(), and use this flag to avoid scrolling at all if
1159         unzoomed.
1160         
1161         If zoomed and we're focussing something inside position:fixed, and if visual viewports
1162         are enabled, we can compute the visual viewport required to reveal the target rect,
1163         which gives us the ideal scroll position.
1164         
1165         Fix a bug on non-iOS platforms when zoomed, which is to scale the viewRect since
1166         frameView.visibleContentRect() gives an unscaled rect on those platforms.
1167         
1168         Not all callers of scrollRectToVisible() are fixed, but those that are not will get
1169         the current behavior.
1170
1171         Tests: fast/overflow/scroll-anchor-in-position-fixed.html
1172                fast/visual-viewport/zoomed-scroll-into-view-fixed.html
1173                fast/visual-viewport/zoomed-scroll-to-anchor-in-position-fixed.html
1174
1175         * dom/Element.cpp:
1176         (WebCore::Element::scrollIntoView):
1177         (WebCore::Element::scrollIntoViewIfNeeded):
1178         (WebCore::Element::scrollIntoViewIfNotVisible):
1179         (WebCore::Element::updateFocusAppearance):
1180         * editing/FrameSelection.cpp:
1181         (WebCore::FrameSelection::FrameSelection):
1182         (WebCore::FrameSelection::absoluteCaretBounds):
1183         (WebCore::FrameSelection::recomputeCaretRect):
1184         (WebCore::FrameSelection::revealSelection):
1185         * editing/FrameSelection.h:
1186         * editing/VisiblePosition.cpp:
1187         (WebCore::VisiblePosition::absoluteCaretBounds):
1188         * editing/VisiblePosition.h:
1189         * editing/htmlediting.cpp:
1190         (WebCore::absoluteBoundsForLocalCaretRect):
1191         * editing/htmlediting.h:
1192         * page/FrameView.cpp:
1193         (WebCore::FrameView::scrollElementToRect):
1194         (WebCore::FrameView::scrollToAnchor):
1195         * page/PrintContext.cpp:
1196         (WebCore::PrintContext::outputLinkedDestinations):
1197         * rendering/RenderElement.cpp:
1198         (WebCore::RenderElement::getLeadingCorner):
1199         (WebCore::RenderElement::getTrailingCorner):
1200         (WebCore::RenderElement::absoluteAnchorRect):
1201         (WebCore::RenderElement::anchorRect): Deleted.
1202         * rendering/RenderElement.h:
1203         * rendering/RenderLayer.cpp:
1204         (WebCore::RenderLayer::scrollRectToVisible):
1205         (WebCore::RenderLayer::getRectToExpose):
1206         (WebCore::RenderLayer::autoscroll):
1207         * rendering/RenderLayer.h:
1208         * rendering/RenderObject.cpp:
1209         (WebCore::RenderObject::scrollRectToVisible):
1210         * rendering/RenderObject.h:
1211
1212 2016-12-06  Myles C. Maxfield  <mmaxfield@apple.com>
1213
1214         [Cocoa] REGRESSION(r205396): Intermediate CTRuns with initial advances get double counted when glyph origins are enabled
1215         https://bugs.webkit.org/show_bug.cgi?id=165084
1216
1217         Reviewed by Simon Fraser.
1218
1219         When glyph origins are not enabled, an intermediate CTRun's initial advance is simply added
1220         to the previous glyph's advance. However, when glyph origins are enabled, this shouldn't
1221         occur.
1222
1223         Test: fast/text/initial-advance-in-intermediate-run-complex.html
1224
1225         * platform/graphics/mac/ComplexTextController.cpp:
1226         (WebCore::ComplexTextController::adjustGlyphsAndAdvances):
1227
1228 2016-12-06  Simon Fraser  <simon.fraser@apple.com>
1229
1230         Enable visual viewports by default on Mac, and iOS Wk2
1231         https://bugs.webkit.org/show_bug.cgi?id=165452
1232
1233         Reviewed by Zalan Bujtas.
1234
1235         Some tests revealed an issue where, during scrollbar updates, the visual viewport would be
1236         15px wider than the layout viewport, which results in the layout viewport shifting 15px to the
1237         right. Prevent this by disallowing viewport updates during the AdjustViewSize phase; we'll
1238         be called again in postLayoutTasks.
1239
1240         * page/FrameView.cpp:
1241         (WebCore::FrameView::updateLayoutViewport):
1242
1243 2016-12-06  Daniel Bates  <dabates@apple.com>
1244
1245         Cleanup: Rename some HTTP 0.9-specific functions to conform to WebKit Code Style Guidelines
1246         https://bugs.webkit.org/show_bug.cgi?id=165451
1247
1248         Reviewed by Alex Christensen.
1249
1250         Rename Document::shouldEnforceHTTP0_9Sandbox() and ResourceResponseBase::isHttpVersion0_9()
1251         to Document::shouldEnforceHTTP09Sandbox() and ResourceResponseBase::isHTTP09, respectively,
1252         to conform to the WebKit Code Style Guidelines.
1253
1254         * dom/Document.cpp:
1255         (WebCore::Document::initSecurityContext):
1256         (WebCore::Document::shouldEnforceHTTP09Sandbox): Renamed; formerly named shouldEnforceHTTP0_9Sandbox
1257         * dom/Document.h:
1258         * platform/network/ResourceHandle.cpp:
1259         (WebCore::ResourceHandle::didReceiveResponse):
1260         * platform/network/ResourceResponseBase.cpp:
1261         (WebCore::ResourceResponseBase::isHTTP09): Renamed; formerly named isHttpVersion0_9.
1262         * platform/network/ResourceResponseBase.h:
1263
1264 2016-12-06  Daniel Bates  <dabates@apple.com>
1265
1266         Use Vector::uncheckedAppend() in more places
1267         https://bugs.webkit.org/show_bug.cgi?id=164952
1268
1269         Reviewed by Darin Adler.
1270
1271         We can use Vector::uncheckedAppend() whenever the number of items that will be appended
1272         to a vector is equal to or less than its capacity. Using Vector::uncheckedAppend() is
1273         more efficient than Vector::append() as it avoids checking the capacity of the vector
1274         before appending a value to the end of it.
1275
1276         * bindings/js/SerializedScriptValue.cpp:
1277         (WebCore::SerializedScriptValue::SerializedScriptValue):
1278         * contentextensions/DFABytecodeCompiler.cpp:
1279         (WebCore::ContentExtensions::DFABytecodeCompiler::extractJumpTable):
1280         * contentextensions/DFAMinimizer.cpp:
1281         * css/StyleProperties.cpp:
1282         (WebCore::StyleProperties::copyPropertiesInSet): Use Vector::uncheckedAppend() and inline
1283         the assignment of the temporary variable value into the if condition to limit its scope
1284         as it is referenced exactly once in the loop body.
1285         * css/StyleRule.cpp:
1286         (WebCore::StyleRuleGroup::StyleRuleGroup): Use Vector::uncheckedAppend() and write for-loop
1287         using a C++11 range-based for-loop.
1288         * css/parser/CSSParserValues.cpp:
1289         (WebCore::CSSParserSelector::setLangArgumentList):
1290         * cssjit/SelectorCompiler.cpp:
1291         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthLastChildOf):
1292         * dom/DocumentMarkerController.cpp:
1293         (WebCore::updateRenderedRectsForMarker):
1294         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
1295         (WebCore::convertToLayoutUnits):
1296         * platform/audio/AudioBus.cpp:
1297         (WebCore::AudioBus::AudioBus):
1298         * platform/graphics/FontCache.cpp:
1299         (WebCore::FontCache::purgeInactiveFontData):
1300         * platform/graphics/PathUtilities.cpp:
1301         (WebCore::polygonsForRect):
1302         * platform/mediastream/CaptureDeviceManager.cpp:
1303         (CaptureDeviceManager::bestSourcesForTypeAndConstraints):
1304         * platform/mediastream/RealtimeMediaSource.cpp:
1305         (WebCore::RealtimeMediaSource::fitnessDistance):
1306         * platform/network/cf/FormDataStreamCFNet.cpp:
1307         (WebCore::formCreate):
1308
1309 2016-12-04  Darin Adler  <darin@apple.com>
1310
1311         Use ASCIICType more, and improve it a little bit
1312         https://bugs.webkit.org/show_bug.cgi?id=165360
1313
1314         Reviewed by Sam Weinig.
1315
1316         * css/CSSGrammar.y.in: Use isASCIIDigit.
1317
1318         * css/parser/CSSParser.cpp:
1319         (WebCore::CSSParser::parseFontFaceUnicodeRange): Use isASCIIHexDigit and
1320         toASCIIHexValue.
1321         (WebCore::isEqualToCSSIdentifier): Use isASCIILower.
1322         * html/FormController.cpp:
1323         (WebCore::isNotFormControlTypeCharacter): Use isASCIILower.
1324         * html/parser/CSSPreloadScanner.cpp:
1325         (WebCore::CSSPreloadScanner::tokenize): Use isASCIIAlpha.
1326         * platform/Decimal.cpp:
1327         (WebCore::Decimal::fromString): Use isASCIIDigit.
1328         * platform/FileSystem.cpp:
1329         (WebCore::decodeFromFilename): Use isASCIIHexDigit and toASCIIHexValue.
1330         * platform/URL.cpp:
1331         (WebCore::isLetterMatchIgnoringCase): Deleted.
1332         (WebCore::isSchemeCharacterMatchIgnoringCase): Deleted.
1333         (WebCore::assertProtocolIsGood): Use isASCIIUpper.
1334         (WebCore::URL::protocolIs): Use isASCIIAlphaCaselessEqual.
1335         (WebCore::URL::parse): Ditto.
1336         (WebCore::protocolIs): Ditto.
1337         (WebCore::protocolIsInHTTPFamily): Ditto.
1338         * platform/URLParser.cpp:
1339         (WeCore::URLParser::parseIPv4Piece): Use isASCIIDigit.
1340
1341         * platform/mac/WebCoreNSURLExtras.mm:
1342         (WebCore::isRussianDomainNameCharacter): Use isASCIIDigit.
1343         (WebCore::allCharactersAllowedByTLDRules): Ditto.
1344         (WebCore::dataWithUserTypedString): Use upperNibbleToASCIIHexDigit and
1345         lowerNibbleToASCIIHexDigit.
1346         (WebCore::dataForURLComponentType): Ditto.
1347         (WebCore::createStringWithEscapedUnsafeCharacters): Ditto.
1348         (WebCore::userVisibleString): Use isASCIIHexDigit, toASCIIHexValue,
1349         upperNibbleToASCIIHexDigit, and lowerNibbleToASCIIHexDigit.
1350         (WebCore::isUserVisibleURL): Use isASCIIHexDigit and toASCIIHexValue.
1351
1352         * platform/network/FormDataBuilder.cpp:
1353         (WebCore::FormDataBuilder::encodeStringAsFormData): Use isASCIIAlphanumeric.
1354
1355         * rendering/mathml/RenderMathMLToken.cpp:
1356         (WebCore::mathVariant): Use isASCIIUpper, isASCIILower, and isASCIIDigit.
1357
1358         * svg/SVGParserUtilities.cpp:
1359         (WebCore::genericParseNumber): Use isASCIIDigit.
1360         * svg/SVGPathStringSource.cpp:
1361         (WebCore::nextCommandHelper): Ditto.
1362         * xml/XPathParser.cpp:
1363         (WebCore::XPath::Parser::lexNumber): Ditto.
1364         (WebCore::XPath::Parser::nextTokenInternal): Ditto.
1365
1366 2016-12-06  Ryan Haddad  <ryanhaddad@apple.com>
1367
1368         Rebaseline bindings tests after r209390.
1369
1370         Unreviewed test gardening.
1371
1372         * bindings/scripts/test/JS/JSTestObj.cpp:
1373         (WebCore::convertDictionaryToJS):
1374         * bindings/scripts/test/JS/JSTestObj.h:
1375
1376 2016-12-06  Tim Horton  <timothy_horton@apple.com>
1377
1378         PDF markup/annotations visible in Mail on macOS but not on iOS
1379         https://bugs.webkit.org/show_bug.cgi?id=165444
1380         <rdar://problem/28942896>
1381
1382         Reviewed by Simon Fraser.
1383
1384         No new tests, but enabled an existing test for this feature.
1385
1386         * platform/graphics/cg/PDFDocumentImage.cpp:
1387         (WebCore::PDFDocumentImage::drawPDFPage):
1388         * platform/spi/cg/CoreGraphicsSPI.h:
1389         Make use of CGContextDrawPDFPageWithAnnotations where available,
1390         to paint the page with annotations.
1391
1392 2016-12-06  Dave Hyatt  <hyatt@apple.com>
1393
1394         [CSS Parser] Turn on the new CSS parser
1395         https://bugs.webkit.org/show_bug.cgi?id=165213
1396
1397         Reviewed by Zalan Bujtas.
1398
1399         * page/Settings.in:
1400
1401 2016-12-06  Dan Bernstein  <mitz@apple.com>
1402
1403         Tried to fix the USE(APPLE_INTERNAL_SDK) build after r209385.
1404
1405         * platform/spi/cocoa/NSTouchBarSPI.h:
1406
1407 2016-12-05  Jer Noble  <jer.noble@apple.com>
1408
1409         [pointer-lock] Cursor should become visible when exiting pointer-lock via ESC key.
1410         https://bugs.webkit.org/show_bug.cgi?id=165377
1411
1412         Reviewed by Darin Adler.
1413
1414         Introduce the concept of "force cursor to become visible" when requesting the pointer be
1415         unlocked.  ESC events will cause the pointer to become visible, while normal key events
1416         will not.
1417
1418         * page/EventHandler.cpp:
1419         (WebCore::EventHandler::keyEvent):
1420         * page/PointerLockController.cpp:
1421         (WebCore::PointerLockController::requestPointerUnlock):
1422         (WebCore::PointerLockController::requestPointerUnlockAndForceCursorVisible):
1423         (WebCore::PointerLockController::documentDetached):
1424         (WebCore::PointerLockController::didLosePointerLock):
1425         * page/PointerLockController.h:
1426
1427         Drive-by fix: apply Darin's feedback to existing functions:
1428
1429         * dom/Document.cpp:
1430         (WebCore::Document::prepareForDestruction):
1431         * dom/Element.cpp:
1432         (WebCore::Element::removedFrom):
1433         * page/PointerLockController.cpp:
1434         (WebCore::PointerLockController::elementRemoved):
1435         (WebCore::PointerLockController::documentDetached):
1436
1437
1438 2016-12-06  Sam Weinig  <sam@webkit.org>
1439
1440         [WebIDL] Add support for converting dictionaries to JS
1441         https://bugs.webkit.org/show_bug.cgi?id=165367
1442
1443         Reviewed by Darin Adler and Alex Christensen.
1444
1445         - Adds support for converting dictionary types to JSValues via JSDOMConvert.
1446         - Adopts that functionality to correct the CryptoKeyPair implementation, which
1447           is supposed to be a dictionary.
1448           (While doing this, I also update places that were passing both a CryptoKey 
1449           and CryptoKeyPair to use a Variant, since they always only wanted one.)
1450         - Re-works DOMPromise and DeferredPromise to be based on JSDOMConvert and IDLTypes.
1451
1452         * CMakeLists.txt:
1453         * PlatformEfl.cmake:
1454         * PlatformGTK.cmake:
1455         * PlatformMac.cmake:
1456         * WebCore.xcodeproj/project.pbxproj:
1457         Remove JSCryptoKeyPairCustom.cpp and CryptoKeyPair.cpp.
1458
1459         * Modules/encryptedmedia/legacy/WebKitMediaKeys.cpp:
1460         * Modules/mediasource/MediaSource.cpp:
1461         * Modules/mediasource/SourceBuffer.cpp:
1462         * bindings/js/JSMediaDevicesCustom.cpp:
1463         * html/MediaController.cpp:
1464         * html/track/TextTrack.cpp:
1465         Add some missing includes.
1466
1467         * Modules/applepay/ApplePaySession.cpp:
1468         (WebCore::ApplePaySession::canMakePaymentsWithActiveCard):
1469         (WebCore::ApplePaySession::openPaymentSetup):
1470         * Modules/fetch/FetchBody.cpp:
1471         (WebCore::FetchBody::text):
1472         (WebCore::FetchBody::consume):
1473         (WebCore::FetchBody::loadingFailed):
1474         * Modules/fetch/FetchBodyConsumer.cpp:
1475         (WebCore::FetchBodyConsumer::resolveWithData):
1476         (WebCore::FetchBodyConsumer::resolve):
1477         * Modules/fetch/FetchBodyOwner.cpp:
1478         (WebCore::FetchBodyOwner::blob):
1479         (WebCore::FetchBodyOwner::formData):
1480         (WebCore::FetchBodyOwner::text):
1481         * Modules/fetch/FetchResponse.h:
1482         * Modules/mediastream/MediaDevices.h:
1483         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
1484         (WebCore::MediaEndpointPeerConnection::replaceTrack):
1485         (WebCore::MediaEndpointPeerConnection::replaceTrackTask):
1486         * Modules/mediastream/MediaEndpointPeerConnection.h:
1487         * Modules/mediastream/MediaStreamTrack.cpp:
1488         (WebCore::MediaStreamTrack::applyConstraints):
1489         * Modules/mediastream/PeerConnectionBackend.cpp:
1490         (WebCore::PeerConnectionBackend::setLocalDescription):
1491         (WebCore::PeerConnectionBackend::setRemoteDescription):
1492         (WebCore::PeerConnectionBackend::addIceCandidate):
1493         * Modules/mediastream/PeerConnectionBackend.h:
1494         * Modules/mediastream/RTCPeerConnection.cpp:
1495         (WebCore::RTCPeerConnection::queuedSetLocalDescription):
1496         (WebCore::RTCPeerConnection::queuedSetRemoteDescription):
1497         (WebCore::RTCPeerConnection::queuedAddIceCandidate):
1498         (WebCore::RTCPeerConnection::replaceTrack):
1499         * Modules/mediastream/RTCPeerConnection.h:
1500         * Modules/mediastream/RTCRtpSender.cpp:
1501         (WebCore::RTCRtpSender::replaceTrack):
1502         * Modules/mediastream/RTCRtpSender.h:
1503         * Modules/mediastream/UserMediaRequest.cpp:
1504         (WebCore::UserMediaRequest::deny):
1505         * Modules/webaudio/AudioContext.cpp:
1506         (WebCore::AudioContext::suspend):
1507         (WebCore::AudioContext::resume):
1508         * bindings/js/JSCustomElementRegistryCustom.cpp:
1509         (WebCore::whenDefinedPromise):
1510         * bindings/js/ScriptModuleLoader.cpp:
1511         (WebCore::ScriptModuleLoader::resolve):
1512         (WebCore::ScriptModuleLoader::notifyFinished):
1513         * css/FontFace.h:
1514         * css/FontFaceSet.cpp:
1515         (WebCore::FontFaceSet::load):
1516         * css/FontFaceSet.h:
1517         * dom/CustomElementRegistry.cpp:
1518         (WebCore::CustomElementRegistry::addElementDefinition):
1519         * html/HTMLMediaElement.cpp:
1520         (WebCore::HTMLMediaElement::rejectPendingPlayPromises):
1521         * html/HTMLMediaElement.h:
1522         Update to use new IDLType based promises.
1523
1524         * bindings/generic/IDLTypes.h:
1525         Add a new type, ParameterType, to use as the parameter to 
1526         DOMPromise/DeferredPromise.
1527
1528         * bindings/js/JSCryptoKeyPairCustom.cpp:
1529         Removed.
1530
1531         * bindings/js/JSDOMConvert.h:
1532         (WebCore::JSConverter<IDLDictionary<T>>::convert):
1533         Add JSConverter specialization for IDLDictionary. Have it simply forward to a generated 
1534         convertDictionaryToJS function, following the convention set in place by IDLEnumeration.
1535
1536         * bindings/js/JSDOMPromise.cpp:
1537         * bindings/js/JSDOMPromise.h:
1538         Re-write to be based on IDLTypes and JSDOMConvert, simplifying the implementation.
1539
1540         * bindings/js/JSSubtleCryptoCustom.cpp:
1541         * bindings/js/JSWebKitSubtleCryptoCustom.cpp:
1542         Update for variant based KeyOrKeyPair.
1543
1544         * bindings/scripts/CodeGeneratorJS.pm:
1545         (GenerateDictionaryHeaderContent):
1546         (GenerateDictionaryImplementationContent):
1547         Add generation of the convertDictionaryToJS function. I made it require the JSGenerateToJSObject
1548         extended attribute for now, as the majority of dictionaries do not need this code generated for them.
1549
1550         * bindings/scripts/test/JS/JSTestObj.cpp:
1551         (WebCore::convertDictionaryToJS):
1552         * bindings/scripts/test/JS/JSTestObj.h:
1553         * bindings/scripts/test/TestObj.idl:
1554         Add JSGenerateToJSObject to a dictionary to test generation in bindings tests.
1555
1556         * crypto/CryptoAlgorithm.h:
1557         Change KeyOrKeyPairCallback to take a Variant<RefPtr<CryptoKey>, CryptoKeyPair>, rather
1558         than two separate arguments.
1559
1560         * crypto/CryptoKeyPair.cpp:
1561         Removed.
1562
1563         * crypto/CryptoKeyPair.h:
1564         Convert to a struct.
1565
1566         * crypto/CryptoKeyPair.idl:
1567         Convert to a dictionary.
1568
1569         * crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
1570         (WebCore::CryptoAlgorithmAES_CBC::generateKey):
1571         * crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
1572         (WebCore::CryptoAlgorithmAES_KW::generateKey):
1573         * crypto/algorithms/CryptoAlgorithmHMAC.cpp:
1574         (WebCore::CryptoAlgorithmHMAC::generateKey):
1575         * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
1576         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::generateKey):
1577         * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
1578         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::generateKey):
1579         * crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
1580         (WebCore::CryptoAlgorithmRSA_OAEP::generateKey):
1581         * crypto/keys/CryptoKeyRSA.h:
1582         * crypto/mac/CryptoKeyRSAMac.cpp:
1583         (WebCore::CryptoKeyRSA::generatePair):
1584         Update for new signature of KeyOrKeyPairCallback.
1585
1586 2016-12-05  Dave Hyatt  <hyatt@apple.com>
1587
1588         [CSS Parser] Reject invalid hex colors on the fast path
1589         https://bugs.webkit.org/show_bug.cgi?id=165461
1590
1591         Reviewed by Zalan Bujtas.
1592
1593         * css/parser/CSSParserFastPaths.cpp:
1594         (WebCore::fastParseColorInternal):
1595         Make sure to check for success. There was even a FIXME in the code about this!
1596         Matches our old parser's behavior.
1597
1598 2016-12-05  Antoine Quint  <graouts@apple.com>
1599
1600         [Modern Media Controls] Controls bar in fullscreen cannot be dragged
1601         https://bugs.webkit.org/show_bug.cgi?id=165448
1602
1603         Reviewed by Simon Fraser.
1604
1605         We weren't listening to mousemove and mouseup events on the right event target, window in the context
1606         of a fullscreen shadow root makes no sense. We now listen to those events on the media controls, which
1607         we size to fit the whole of the media element's bounds. We then apply a transform to the controls bar
1608         to apply the dragging distance.
1609
1610         Test: media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-drag.html
1611
1612         * Modules/modern-media-controls/controls/controls-bar.js:
1613         (ControlsBar.prototype.get translation):
1614         (ControlsBar.prototype.set translation):
1615         (ControlsBar.prototype.commitProperty):
1616         (ControlsBar): Deleted.
1617         * Modules/modern-media-controls/controls/macos-fullscreen-media-controls.css:
1618         (.media-controls.mac.fullscreen):
1619         (.media-controls.mac.fullscreen > .controls-bar):
1620         * Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js:
1621         (MacOSFullscreenMediaControls.prototype._handleMousedown):
1622         (MacOSFullscreenMediaControls.prototype._handleMousemove):
1623         (MacOSFullscreenMediaControls.prototype._handleMouseup):
1624
1625 2016-12-05  Dave Hyatt  <hyatt@apple.com>
1626
1627         [CSS Parser] Allow calc in SVG attributes
1628         https://bugs.webkit.org/show_bug.cgi?id=165459
1629
1630         Reviewed by Zalan Bujtas.
1631
1632         * css/parser/CSSPropertyParserHelpers.cpp:
1633         (WebCore::CSSPropertyParserHelpers::consumeLength):
1634
1635 2016-12-05  Brady Eidson  <beidson@apple.com>
1636
1637         Build fix followup to r209379:
1638
1639         STP 19 fails to launch on 16B255
1640         https://bugs.webkit.org/show_bug.cgi?id=165388
1641         -and corresponding-
1642         rdar://problem/29514476
1643
1644         Rubberstamped by Tim Horton.
1645
1646         No new tests (No behavior change).
1647
1648         * platform/spi/cocoa/NSTouchBarSPI.h: Strategically relocate NS_ASSUME_NONNULL* macros.
1649
1650 2016-12-05  Dave Hyatt  <hyatt@apple.com>
1651
1652         [CSS Parser] Make sure the SVGPaint URI and currentColor style still paints using the URI
1653         https://bugs.webkit.org/show_bug.cgi?id=165457
1654
1655         Reviewed by Zalan Bujtas.
1656
1657         * rendering/svg/SVGResources.cpp:
1658         (WebCore::paintingResourceFromSVGPaint):
1659         Add support for this paint type. The old parser doesn't use it.
1660
1661 2016-12-05  Dave Hyatt  <hyatt@apple.com>
1662
1663         [CSS Parser] Fix dashboard region parsing
1664         https://bugs.webkit.org/show_bug.cgi?id=165456
1665
1666         Reviewed by Zalan Bujtas.
1667
1668         * css/parser/CSSPropertyParser.cpp:
1669         (WebCore::consumeWebkitDashboardRegion):
1670         Make sure to reject whitespace by itself as well as unclosed dashboard-region functions.
1671
1672 2016-12-05  Dave Hyatt  <hyatt@apple.com>
1673
1674         [CSS Parser] Properly reject large numeric values
1675         https://bugs.webkit.org/show_bug.cgi?id=165455
1676
1677         Reviewed by Zalan Bujtas.
1678
1679         The new parser clamped numeric values in both the slow and fast paths to the max
1680         and min float values. The old parser simply allowed the values to be inf, and then
1681         had std::isinf checks to reject.
1682
1683         Blink rejects also even though it clamps, but I could not discern the mechanism by
1684         which they did so. Therefore I am changing the new parser to exactly match the old
1685         parser. Numeric values are no longer clamped, but instead are allowed to be inf, and
1686         isinf checks now exist in the new parser in the same places they do in the old parser.
1687
1688         * css/parser/CSSParserFastPaths.cpp:
1689         (WebCore::parseSimpleLength):
1690         (WebCore::parseSimpleLengthValue):
1691         * css/parser/CSSParserToken.cpp:
1692         (WebCore::CSSParserToken::CSSParserToken):
1693         * css/parser/CSSPropertyParserHelpers.cpp:
1694         (WebCore::CSSPropertyParserHelpers::consumeLength):
1695         (WebCore::CSSPropertyParserHelpers::consumePercent):
1696
1697 2016-12-05  Ricky Mondello  <rmondello@apple.com>
1698
1699         STP 19 fails to launch on 16B255
1700         https://bugs.webkit.org/show_bug.cgi?id=165388
1701         -and corresponding-
1702         rdar://problem/29514476
1703
1704         Reviewed by Tim Horton.
1705
1706         * platform/spi/cocoa/NSTouchBarSPI.h: Re-declare the SPI symbols as weak. The cited crash itself is for a
1707             symbol we weren't handling here, but is part of the same group. Re-declare all four of these symbols to
1708             be safe.
1709
1710 2016-12-05  Antoine Quint  <graouts@apple.com>
1711
1712         ERROR: post-layout: dirty renderer(s) - Encountered with LayoutTest media/modern-media-controls/media-controller/media-controller-fullscreen-ltr.html
1713         https://bugs.webkit.org/show_bug.cgi?id=165312
1714
1715         Reviewed by Simon Fraser.
1716
1717         Reverting part of the code added in https://bugs.webkit.org/show_bug.cgi?id=165287 that triggered
1718         an assertion. We go back to removing previous media controls as we add new ones when the fullscreen
1719         status changes, and simply hide the controls during the animated transition using a CSS pseudo-class.
1720         This also fixes an issue where we wouldn't have removed the previous controls should we have entered
1721         fullscreen in a different way than clicking on the fullscreen button in the media controls.
1722
1723         We restore testing coverage that was fixed due to this assertion.
1724
1725         * Modules/modern-media-controls/controls/media-controls.css:
1726         (:host(:-webkit-animating-full-screen-transition) .media-controls):
1727         * Modules/modern-media-controls/controls/media-controls.js:
1728         (MediaControls.prototype.fadeIn):
1729         (MediaControls.prototype.presentInElement): Deleted.
1730         * Modules/modern-media-controls/media/fullscreen-support.js:
1731         (FullscreenSupport.prototype.buttonWasClicked):
1732         * Modules/modern-media-controls/media/media-controller.js:
1733         (MediaController.prototype._updateControlsIfNeeded):
1734
1735 2016-12-05  Dean Jackson  <dino@apple.com>
1736
1737         MediaDocuments crash with modern media controls
1738         https://bugs.webkit.org/show_bug.cgi?id=165446
1739         <rdar://problem/29524959>
1740
1741         Reviewed by Antoine Quint.
1742
1743         The modern media controls inject a <style> element into
1744         the document, which exposed a bug when used in MediaDocuments.
1745         Such documents were not getting a charset, and the hash table
1746         for the CSSParserContexts was crashing.
1747
1748         Test: media/modern-media-controls/media-documents/insert-style-should-not-crash.html
1749
1750         * css/parser/CSSParserMode.h: Guard against an empty charset.
1751         (WebCore::CSSParserContextHash::hash):
1752         * dom/InlineStyleSheetOwner.cpp: Ask for the charset with fallback.
1753         (WebCore::parserContextForElement):
1754
1755 2016-12-05  Dave Hyatt  <hyatt@apple.com>
1756
1757         [CSS Parser] shape-rendering supports crispEdges rather than crisp-edges
1758         https://bugs.webkit.org/show_bug.cgi?id=165443
1759
1760         Reviewed by Tim Horton.
1761
1762         * css/parser/CSSParserFastPaths.cpp:
1763         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
1764
1765 2016-12-05  Dave Hyatt  <hyatt@apple.com>
1766
1767         [CSS Parser] Support setting of custom properties from the CSS OM
1768         https://bugs.webkit.org/show_bug.cgi?id=165442
1769
1770         Reviewed by Tim Horton.
1771
1772         * css/parser/CSSParser.cpp:
1773         (WebCore::CSSParser::parseCustomPropertyValue):
1774         Call in to a new function in CSSParserImpl that can handle
1775         custom property parsing.
1776
1777         * css/parser/CSSParserImpl.cpp:
1778         (WebCore::CSSParserImpl::parseCustomPropertyValue):
1779         New function that is similar to parseValue, but handling custom
1780         properties.
1781
1782         (WebCore::CSSParserImpl::consumeDeclaration):
1783         (WebCore::CSSParserImpl::consumeCustomPropertyValue):
1784         (WebCore::CSSParserImpl::consumeVariableValue): Deleted.
1785         * css/parser/CSSParserImpl.h:
1786         Rename consumeVariableValue to consumeCustomPropertyValue, since that
1787         is more clear. consumeVariableValue sounds like you might be resolving
1788         a variable reference rather than parsing a custom property's value.
1789
1790 2016-12-05  Tim Horton  <timothy_horton@apple.com>
1791
1792         Adopt CAMachPort-as-layer-contents
1793         https://bugs.webkit.org/show_bug.cgi?id=141687
1794         <rdar://problem/19393233>
1795
1796         Reviewed by Darin Adler.
1797
1798         No new tests, just a performance bump.
1799
1800         * platform/spi/cocoa/QuartzCoreSPI.h:
1801         Add some SPI.
1802
1803 2016-12-05  Dave Hyatt  <hyatt@apple.com>
1804
1805         [CSS Parser] calcs on column-width that resolve to 0 should be discarded
1806         https://bugs.webkit.org/show_bug.cgi?id=165439
1807
1808         Reviewed by Dean Jackson.
1809
1810         * css/parser/CSSPropertyParser.cpp:
1811         (WebCore::consumeColumnWidth):
1812
1813 2016-12-05  Dean Jackson  <dino@apple.com>
1814
1815         pointer lock needs to be feature detectable
1816         https://bugs.webkit.org/show_bug.cgi?id=165426
1817         <rdar://problem/29486715>
1818
1819         Reviewed by Antoine Quint.
1820
1821         Annotate the public-facing API for pointer-lock, so
1822         that it is hidden when not available.
1823
1824         Also move the Setting to a RuntimeEnabledFeature, since
1825         pointer-lock is exposed from WebKit as a feature.
1826
1827         Tests: pointer-lock/pointerlock-interface-disabled.html
1828                pointer-lock/pointerlock-interface.html
1829
1830         * bindings/generic/RuntimeEnabledFeatures.h:
1831         (WebCore::RuntimeEnabledFeatures::setPointerLockEnabled):
1832         (WebCore::RuntimeEnabledFeatures::pointerLockEnabled):
1833         * dom/Document.idl:
1834         * dom/Element.idl:
1835         * page/PointerLockController.cpp:
1836         (WebCore::PointerLockController::requestPointerLock):
1837         (WebCore::PointerLockController::requestPointerUnlock):
1838         * page/Settings.in:
1839
1840 2016-12-05  Keith Rollin  <krollin@apple.com>
1841
1842         Reduce number of platformMemoryUsage calls
1843         https://bugs.webkit.org/show_bug.cgi?id=164375
1844
1845         Reviewed by Darin Adler.
1846
1847         Removed the calls to WTF::releaseFastMallocFreeMemory (it's already
1848         called elsewhere in the free-all-memory pipeline) and
1849         malloc_zone_pressure_relief (it should be called by the OS on its own
1850         terms).
1851
1852         No new tests -- no new or changed features.
1853
1854         * platform/cocoa/MemoryPressureHandlerCocoa.mm:
1855         (WebCore::MemoryPressureHandler::ReliefLogger::platformMemoryUsage):
1856
1857 2016-12-05  Dave Hyatt  <hyatt@apple.com>
1858
1859         [CSS Parser] Leave the Animation type alone when the property is invalid
1860         https://bugs.webkit.org/show_bug.cgi?id=165418
1861
1862         Reviewed by Dean Jackson.
1863
1864         * css/CSSToStyleMap.cpp:
1865         (WebCore::CSSToStyleMap::mapAnimationProperty):
1866
1867 2016-12-05  Antti Koivisto  <antti@apple.com>
1868
1869         keyframes do not work when defined inside a style in a shadowRoot
1870         https://bugs.webkit.org/show_bug.cgi?id=164608
1871         <rdar://problem/29210251>
1872
1873         Reviewed by Darin Adler.
1874
1875         With :host and ::slotted rules a keyframe animation affecting an element can be
1876         defined in a style scope different from the element's own scope. Style resolver
1877         loses the scope information when building the RenderStyle so there is no way
1878         to find out the correct scope.
1879
1880         Fix by passing style scope through to style builder and including a scope association
1881         with the animation name. Find the correct scope when resolving keyframes.
1882
1883         Test: fast/shadow-dom/shadow-host-animation.html
1884
1885         * css/CSSToStyleMap.cpp:
1886         (WebCore::CSSToStyleMap::mapAnimationName):
1887
1888             Include scope with the name.
1889
1890         * css/ElementRuleCollector.cpp:
1891         (WebCore::MatchRequest::MatchRequest):
1892         (WebCore::ElementRuleCollector::addMatchedRule):
1893         (WebCore::ElementRuleCollector::sortAndTransferMatchedRules):
1894         (WebCore::ElementRuleCollector::matchAuthorRules):
1895         (WebCore::ElementRuleCollector::matchAuthorShadowPseudoElementRules):
1896         (WebCore::ElementRuleCollector::matchHostPseudoClassRules):
1897         (WebCore::ElementRuleCollector::matchSlottedPseudoElementRules):
1898         (WebCore::ElementRuleCollector::collectMatchingRulesForList):
1899
1900             Replace treeContextOrdinal int with Style::ScopeOrdinal enum carrying the same information.
1901             Simplify the code removing unnecessary use of MatchRequest struct.
1902
1903         (WebCore::compareRules):
1904         * css/ElementRuleCollector.h:
1905         * css/StyleResolver.cpp:
1906         (WebCore::StyleResolver::MatchResult::addMatchedProperties):
1907         (WebCore::StyleResolver::CascadedProperties::setPropertyInternal):
1908         (WebCore::StyleResolver::CascadedProperties::set):
1909         (WebCore::StyleResolver::CascadedProperties::setDeferred):
1910
1911             Pass styleScopeOrdinal through the cascade mechanism
1912
1913         (WebCore::cascadeLevelForIndex):
1914         (WebCore::StyleResolver::CascadedProperties::addMatch):
1915         (WebCore::StyleResolver::CascadedProperties::addImportantMatches):
1916         (WebCore::StyleResolver::CascadedProperties::Property::apply):
1917
1918             Set styleScopeOrdinal in State when applying style.
1919
1920         (WebCore::StyleResolver::CascadedProperties::addStyleProperties): Deleted.
1921
1922             Move the code to the only caller.
1923
1924         * css/StyleResolver.h:
1925         (WebCore::StyleResolver::State::styleScopeOrdinal):
1926         (WebCore::StyleResolver::State::setStyleScopeOrdinal):
1927         * page/animation/CompositeAnimation.cpp:
1928         (WebCore::KeyframeAnimation::KeyframeAnimation):
1929         (WebCore::KeyframeAnimation::resolveKeyframeStyles):
1930
1931             Find the correct scope for resolving keyframes based on the scope ordinal.
1932
1933         * platform/animation/Animation.cpp:
1934         * platform/animation/Animation.h:
1935
1936             Add m_nameStyleScopeOrdinal that tells the scope where the name is defined.
1937
1938         * style/StyleScope.cpp:
1939         (WebCore::Style::Scope::forOrdinal):
1940
1941             Find the scope for ordinal.
1942
1943         * style/StyleScope.h:
1944
1945             Define ScopeOrdinal types.
1946
1947         (WebCore::Style::operator++):
1948
1949 2016-12-05  Dave Hyatt  <hyatt@apple.com>
1950
1951         [CSS Parser] Support glyph-orientation-horizontal and glyph-orientation-vertical
1952         https://bugs.webkit.org/show_bug.cgi?id=165414
1953
1954         Reviewed by Zalan Bujtas.
1955
1956         * css/parser/CSSPropertyParser.cpp:
1957         (WebCore::consumeGlyphOrientation):
1958         (WebCore::CSSPropertyParser::parseSingleValue):
1959         Add support for the glyph-orientation-horizontal and glyph-orientation-vertical
1960         properties. They take an angle and allow unitless values.
1961
1962         * css/parser/CSSPropertyParserHelpers.cpp:
1963         (WebCore::CSSPropertyParserHelpers::consumeAngle):
1964         Fix a bug in the handling of unitless values for angles. Make sure to
1965         actually pass in the value instead of always doing 0. Blink does not
1966         accept unitless values for angles at all, so this is another difference
1967         to investigate for SVG in the future.
1968
1969 2016-12-05  Ryan Haddad  <ryanhaddad@apple.com>
1970
1971         Unreviewed, rolling out r209299.
1972
1973         This change appears to have caused LayoutTest failures on
1974         Sierra WK1.
1975
1976         Reverted changeset:
1977
1978         "Improve the behavior of scroll-into-view when the target is
1979         inside position:fixed"
1980         https://bugs.webkit.org/show_bug.cgi?id=165354
1981         http://trac.webkit.org/changeset/209299
1982
1983 2016-12-05  Andreas Kling  <akling@apple.com>
1984
1985         [Cocoa] Add some memory usage related information to sysdiagnose state dumps
1986         <https://webkit.org/b/165375>
1987         <rdar://problem/29057243>
1988
1989         Reviewed by Darin Adler.
1990
1991         Add a flag to memoryUsageStatistics() to allow gathering of slightly more expensive information.
1992         This mode is used when capturing a state dump for sysdiagnose.
1993
1994         The more expensive information added in this patch relates to information about live objects
1995         and memory on the JavaScript heap.
1996
1997         * WebCore.xcodeproj/project.pbxproj:
1998         * page/PerformanceLogging.cpp:
1999         (WebCore::PerformanceLogging::memoryUsageStatistics):
2000         (WebCore::PerformanceLogging::javaScriptObjectCounts):
2001         (WebCore::PerformanceLogging::didReachPointOfInterest):
2002         * page/PerformanceLogging.h:
2003
2004 2016-12-05  Dave Hyatt  <hyatt@apple.com>
2005
2006         [CSS Parser] Make sure the transform fast path uses WebKitCSSTransformValue
2007         https://bugs.webkit.org/show_bug.cgi?id=165399
2008
2009         Reviewed by Dean Jackson.
2010
2011         * css/parser/CSSParserFastPaths.cpp:
2012         (WebCore::parseTransformTranslateArguments):
2013         (WebCore::parseTransformNumberArguments):
2014         (WebCore::parseSimpleTransformValue):
2015         (WebCore::parseSimpleTransformList):
2016
2017 2016-12-05  Dave Hyatt  <hyatt@apple.com>
2018
2019         [CSS Parser] Fix calc() with -webkit-line-clamp
2020         https://bugs.webkit.org/show_bug.cgi?id=165398
2021
2022         Reviewed by Zalan Bujtas.
2023
2024         Remove the aggressive token type checking up front, since it was causing calc() to not
2025         be allowed.
2026
2027         * css/parser/CSSPropertyParser.cpp:
2028         (WebCore::consumeLineClamp):
2029
2030 2016-12-05  Dave Hyatt  <hyatt@apple.com>
2031
2032         [CSS Parser] Support -webkit-text-decoration
2033         https://bugs.webkit.org/show_bug.cgi?id=165391
2034
2035         Reviewed by Dean Jackson.
2036
2037         * css/parser/CSSPropertyParser.cpp:
2038         (WebCore::CSSPropertyParser::parseShorthand):
2039
2040 2016-12-05  Beth Dakin  <bdakin@apple.com>
2041
2042         STP 19 fails to launch on 16B255
2043         https://bugs.webkit.org/show_bug.cgi?id=165388
2044         -and corresponding-
2045         rdar://problem/29514476
2046
2047         Rubber-stamped by Brady Eidson. 
2048
2049         * platform/spi/cocoa/NSTouchBarSPI.h:
2050
2051 2016-12-05  Beth Dakin  <bdakin@apple.com>
2052
2053         STP 19 fails to launch on 16B255
2054         https://bugs.webkit.org/show_bug.cgi?id=165388
2055         -and corresponding-
2056         rdar://problem/29514476
2057
2058         Reviewed by Tim Horton.
2059
2060         Speculative fix.
2061         * platform/spi/cocoa/NSTouchBarSPI.h:
2062
2063 2016-12-05  Dave Hyatt  <hyatt@apple.com>
2064
2065         [CSS Parser] Support the 'alphabetic' keyword for text-underline-position
2066         https://bugs.webkit.org/show_bug.cgi?id=165387
2067
2068         Reviewed by Simon Fraser.
2069
2070         Fixes fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-underline-position.html
2071
2072         * css/parser/CSSPropertyParser.cpp:
2073         (WebCore::CSSPropertyParser::parseSingleValue):
2074
2075 2016-12-05  Dave Hyatt  <hyatt@apple.com>
2076
2077         [CSS Parser] Fix assert when unknown properties are encountered.
2078         https://bugs.webkit.org/show_bug.cgi?id=165385
2079
2080         Reviewed by Zalan Bujtas.
2081
2082         * css/CSSToStyleMap.cpp:
2083         (WebCore::CSSToStyleMap::mapAnimationProperty):
2084
2085 2016-12-05  Dave Hyatt  <hyatt@apple.com>
2086
2087         [CSS Parser] Fix rx and ry parsing
2088         https://bugs.webkit.org/show_bug.cgi?id=165383
2089
2090         Reviewed by Dean Jackson.
2091
2092         * css/parser/CSSParserFastPaths.cpp:
2093         (WebCore::isSimpleLengthPropertyID):
2094         rx and ry can be negative in the slow path, so make sure they can be negative in the
2095         fast path too.
2096
2097         * css/parser/CSSPropertyParser.cpp:
2098         (WebCore::consumeRxOrRy):
2099         Disallow auto as a value since we are not equipped to handle it, and it's not clear if it's
2100         even valid.
2101
2102 2016-12-05  Konstantin Tokarev  <annulen@yandex.ru>
2103
2104         Add __STDC_FORMAT_MACROS before inttypes.h is included
2105         https://bugs.webkit.org/show_bug.cgi?id=165374
2106
2107         We need formatting macros like PRIu64 to be available in all places where
2108         inttypes.h header is used. All these usages get inttypes.h definitions
2109         via wtf/Assertions.h header, except SQLiteFileSystem.cpp where formatting
2110         macros are not used anymore since r185129.
2111
2112         This patch fixes multiple build errors with MinGW and reduces number of
2113         independent __STDC_FORMAT_MACROS uses in the code base.
2114
2115         Reviewed by Darin Adler.
2116
2117         No new tests needed.
2118
2119         * platform/sql/SQLiteFileSystem.cpp: Removed unused inttypes.h
2120         inclusion.
2121
2122 2016-12-05  Dave Hyatt  <hyatt@apple.com>
2123
2124         [CSS Parser] Properly fail on bad values for -webkit-clip-path
2125         https://bugs.webkit.org/show_bug.cgi?id=165382
2126
2127         Reviewed by Dean Jackson.
2128
2129         * css/parser/CSSPropertyParser.cpp:
2130         (WebCore::consumeBasicShapeOrBox):
2131
2132 2016-12-05  Dave Hyatt  <hyatt@apple.com>
2133
2134         [CSS Parser] The page-break-* properties are only keyword props for old parser.
2135         https://bugs.webkit.org/show_bug.cgi?id=165381
2136
2137         Reviewed by Dean Jackson.
2138
2139         * css/parser/CSSParser.cpp:
2140         (WebCore::isKeywordPropertyID):
2141         * css/parser/CSSParserFastPaths.cpp:
2142         (WebCore::CSSParserFastPaths::isKeywordPropertyID):
2143
2144 2016-12-05  Dave Hyatt  <hyatt@apple.com>
2145
2146         [CSS Parser] Don't use CSS_PARSER_INTEGER unit for resolved integer calcs.
2147         https://bugs.webkit.org/show_bug.cgi?id=165379
2148
2149         Reviewed by Dean Jackson.
2150
2151         * css/parser/CSSPropertyParserHelpers.cpp:
2152         (WebCore::CSSPropertyParserHelpers::CalcParser::consumeNumber):
2153
2154 2016-12-05  Dave Hyatt  <hyatt@apple.com>
2155
2156         [CSS Parser] Add parseValue support to new parser. Use new parser for UA sheet too if useNewParser is set.
2157         https://bugs.webkit.org/show_bug.cgi?id=165376
2158
2159         Reviewed by Zalan Bujtas.
2160
2161         * css/StyleColor.cpp:
2162         (WebCore::StyleColor::isColorKeyword):
2163         Include system colors when using the fast parseValue path.
2164
2165         * css/parser/CSSParser.cpp:
2166         (WebCore::CSSParser::setupParser):
2167         Add an assert to catch any code path using the old parser when the new parser flag is set.
2168
2169         (WebCore::CSSParser::parseSheet):
2170         (WebCore::CSSParser::parseRule):
2171         (WebCore::CSSParser::parseKeyframeRule):
2172         (WebCore::CSSParser::parseSupportsCondition):
2173         (WebCore::CSSParser::parseValue):
2174         (WebCore::CSSParser::parseSelector):
2175         (WebCore::CSSParser::parseDeclaration):
2176         Patched to use the new parser in UASheetMode as well as other modes when the new parser flag
2177         is set. parseValue is patched to use the new parser's fast paths and to call into CSSParserImpl's
2178         parseValue.
2179
2180         * css/parser/CSSParserFastPaths.cpp:
2181         (WebCore::isSimpleLengthPropertyID):
2182         Support CSSPropertyShapeMargin in the fast path since the old parser did in its fast path.
2183
2184         (WebCore::parseSimpleLengthValue):
2185         Don't ever return unitless numbers. If we accept a unitless number, convert the unit to PX still.
2186
2187         (WebCore::CSSParserFastPaths::parseColor):
2188         Use the CSSValuePool when creating colors on the fast path.
2189
2190         * css/parser/CSSParserImpl.cpp:
2191         (WebCore::CSSParserImpl::parseValue):
2192         * css/parser/CSSParserImpl.h:
2193         Change the return type to be compatible with the old parser's ParseResult flag.
2194
2195 2016-12-05  Konstantin Tokarev  <annulen@yandex.ru>
2196
2197         Removed MediaPlayerPrivateTaskTimer
2198         https://bugs.webkit.org/show_bug.cgi?id=165373
2199
2200         Reviewed by Sam Weinig.
2201
2202         It is not used anywhere since QTSDK removal in r165476.
2203
2204         No new tests needed.
2205
2206         * platform/graphics/win/MediaPlayerPrivateTaskTimer.cpp: Removed.
2207         * platform/graphics/win/MediaPlayerPrivateTaskTimer.h: Removed.
2208
2209 2016-12-04  Dave Hyatt  <hyatt@apple.com>
2210
2211         [CSS Parser] Eliminate in-place lowercasing in the parser.
2212         https://bugs.webkit.org/show_bug.cgi?id=165368
2213
2214         Reviewed by Darin Adler.
2215
2216         Replace the in-place lowercasing that the parser does with new
2217         mechanisms. In-place lowercasing ruins serialization and doesn't
2218         work on CSS parsed from static strings. It also has the side effect
2219         of mutating strings passed in from JavaScript like for querySelectorAll.
2220
2221         For class/id selectors, we now check if the string is lowercase or not.
2222         If it contains uppercase ASCII characters, then we allocate the RareData
2223         for the selector. RareData now has two fields instead of one for the value,
2224         a matching value (all lowercase in quirks mode), and a serializing value (the
2225         original string). Because this is done at the CSSSelector level, the old
2226         parser has been patched as well for these cases.
2227
2228         In addition, in-place lowercasing was done for pseudo-elements, for
2229         media query features, and for attr(). In all of these cases we do
2230         lowercase converting by first checking if it's needed. Serialization will
2231         not retain the original string in these cases, so we may want to revisit
2232         these cases in the future and apply a solution similar to what we did for
2233         selectors.
2234
2235         * css/CSSGrammar.y.in:
2236         * css/CSSSelector.cpp:
2237         (WebCore::CSSSelector::createRareData):
2238         (WebCore::CSSSelector::selectorText):
2239         (WebCore::CSSSelector::RareData::RareData):
2240         (WebCore::CSSSelector::RareData::~RareData):
2241         * css/CSSSelector.h:
2242         (WebCore::CSSSelector::RareData::create):
2243         (WebCore::CSSSelector::setValue):
2244         (WebCore::CSSSelector::value):
2245         (WebCore::CSSSelector::serializingValue):
2246         * css/MediaQueryExp.cpp:
2247         (WebCore::MediaQueryExpression::MediaQueryExpression):
2248         * css/parser/CSSParserToken.cpp:
2249         (WebCore::convertToASCIILowercaseInPlace): Deleted.
2250         (WebCore::CSSParserToken::convertToASCIILowercaseInPlace): Deleted.
2251         * css/parser/CSSParserToken.h:
2252         * css/parser/CSSParserValues.h:
2253         (WebCore::CSSParserSelector::setValue):
2254         * css/parser/CSSPropertyParser.cpp:
2255         (WebCore::consumeAttr):
2256         * css/parser/CSSSelectorParser.cpp:
2257         (WebCore::CSSSelectorParser::consumeId):
2258         (WebCore::CSSSelectorParser::consumeClass):
2259         (WebCore::CSSSelectorParser::consumePseudo):
2260         * css/parser/MediaQueryParser.cpp:
2261         (WebCore::MediaQueryParser::readFeature):
2262
2263 2016-12-04  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
2264
2265         Fix a build break on EFL since r209303.
2266
2267         Unreviewed build fix.
2268
2269         * bindings/js/SerializedScriptValue.cpp:
2270         (WebCore::exceptionForSerializationFailure): Add a return in the end of function.
2271
2272 2016-12-03  Dan Bernstein  <mitz@apple.com>
2273
2274         [Cocoa] Expose InjectedBundlePageEditorClient via the Objective-C bundle SPI
2275         https://bugs.webkit.org/show_bug.cgi?id=165276
2276         <rdar://problem/29467040>
2277
2278         Reviewed by Darin Adler.
2279
2280         * platform/ios/PlatformPasteboardIOS.mm:
2281         (WebCore::PlatformPasteboard::write): Make sure to put the client data on the pasteboard,
2282           like we do on macOS.
2283
2284 2016-12-03  Dave Hyatt  <hyatt@apple.com>
2285
2286         [CSS Parser] Remove line numbers from StyleRule.
2287         https://bugs.webkit.org/show_bug.cgi?id=165361
2288
2289         Reviewed by Simon Fraser.
2290
2291         StyleRules have a concept of a source line that is eventually passed
2292         to the inspector. This was only ever used by normal rules, i.e., ones with
2293         selectors, and set to 0 for all other rules. This line was set to the line number
2294         at which the end of the selector text occurred.
2295
2296         Because Inspector already computes the start and end range for the selector
2297         text, storing a source line on StyleRule ends up being redundant. This patch
2298         gets rid of the source line and uses the end line of the selector text
2299         instead.
2300
2301         * css/CSSGrammar.y.in:
2302         Remove the code that updates the last seen selector line.
2303
2304         * css/CSSKeyframeRule.cpp:
2305         (WebCore::StyleKeyframe::StyleKeyframe):
2306         * css/CSSKeyframesRule.cpp:
2307         (WebCore::StyleRuleKeyframes::StyleRuleKeyframes):
2308         No longer need to pass in a 0 line number.
2309
2310         * css/StyleRule.cpp:
2311         (WebCore::StyleRule::StyleRule):
2312         (WebCore::StyleRule::create):
2313         (WebCore::StyleRule::splitIntoMultipleRulesWithMaximumSelectorComponentCount):
2314         (WebCore::StyleRuleFontFace::StyleRuleFontFace):
2315         (WebCore::StyleRuleGroup::StyleRuleGroup):
2316         (WebCore::StyleRuleCharset::StyleRuleCharset):
2317         (WebCore::StyleRuleNamespace::StyleRuleNamespace):
2318         * css/StyleRule.h:
2319         (WebCore::StyleRuleBase::StyleRuleBase):
2320         (WebCore::StyleRuleBase::sourceLine): Deleted.
2321         * css/StyleRuleImport.cpp:
2322         (WebCore::StyleRuleImport::StyleRuleImport):
2323         Remove m_sourceLine and change the create methods and constructors to not
2324         require a line number.
2325
2326         * css/parser/CSSParser.cpp:
2327         (WebCore::CSSParser::createStyleRule):
2328         Line number no longer needed.
2329
2330         (WebCore::CSSParser::updateLastSelectorLineAndPosition): Deleted.
2331         * css/parser/CSSParser.h:
2332         Got rid of the function that tracks and updates the last seen selector line.
2333
2334         * css/parser/CSSParserImpl.cpp:
2335         (WebCore::CSSParserImpl::consumeStyleRule):
2336         Fix the rule creation in the new parser to not pass in a 0 line number.
2337
2338         * inspector/InspectorStyleSheet.cpp:
2339         (WebCore::buildSourceRangeObject):
2340         (WebCore::InspectorStyleSheet::buildObjectForSelectorList):
2341         (WebCore::InspectorStyleSheet::buildObjectForRule):
2342         * inspector/InspectorStyleSheet.h:
2343         Patch the methods that build up the selector range to return the end line
2344         information for selector text so that it can be set as the source line
2345         for the rule (thus eliminating the need to store the line number on the style
2346         rule itself).
2347
2348 2016-12-02  Sam Weinig  <sam@webkit.org>
2349
2350         optional sequence values not handled correctly by binding generator
2351         https://bugs.webkit.org/show_bug.cgi?id=142562
2352
2353         Also fixes:
2354             Remove non-standard postMessage overload
2355             https://bugs.webkit.org/show_bug.cgi?id=161911
2356         and
2357             Wrong argument order in window.postMessage
2358             https://bugs.webkit.org/show_bug.cgi?id=63141
2359
2360         Reviewed by Darin Adler.
2361
2362         * WebCore.xcodeproj/project.pbxproj:
2363         Remove no longer needed files.
2364
2365         * bindings/generic/IDLTypes.h:
2366         * bindings/js/JSDOMConvert.h:
2367         (WebCore::Converter<IDLObject>::convert):
2368         Add support for the WebIDL object type.
2369
2370         * bindings/js/JSDOMBinding.cpp:
2371         (WebCore::createDOMException):
2372         Add support for throwing stack overflow errors.
2373
2374         * bindings/js/JSDOMWindowCustom.cpp:
2375         (WebCore::handlePostMessage): Deleted.
2376         (WebCore::JSDOMWindow::postMessage): Deleted.
2377         * bindings/js/JSDedicatedWorkerGlobalScopeCustom.cpp: Removed.
2378         * bindings/js/JSMessagePortCustom.cpp:
2379         (WebCore::JSMessagePort::postMessage): Deleted.
2380         (WebCore::extractTransferables): Deleted.
2381         * bindings/js/JSMessagePortCustom.h: Removed.
2382         * bindings/js/JSWorkerCustom.cpp:
2383         (WebCore::JSWorker::postMessage): Deleted.
2384         Remove custom bindings for postMessage.
2385
2386         * bindings/js/SerializedScriptValue.h:
2387         Switch to using enum class.
2388
2389         * bindings/js/SerializedScriptValue.cpp:
2390         (WebCore::SerializedScriptValue::transferArrayBuffers):
2391         (WebCore::SerializedScriptValue::create):
2392         Add new create function that takes the transfer list, processes it, and returns
2393         MessagePorts and SerializedScriptValue / exception.
2394
2395         (WebCore::CloneBase::throwStackOverflow): Deleted.
2396         (WebCore::CloneDeserializer::throwValidationError): Deleted.
2397         Remove uncalled functions.
2398
2399         * bindings/scripts/CodeGenerator.pm:
2400         (IsRefPtrType):
2401         (IsBuiltinType):
2402         * bindings/scripts/CodeGeneratorJS.pm:
2403         (AddToIncludesForIDLType):
2404         (GetBaseIDLType):
2405         Add support for the WebIDL 'object' type.
2406
2407         * bindings/scripts/test/JS/JSTestObj.cpp:
2408         * bindings/scripts/test/TestObj.idl:
2409         Add tests for 'object'.
2410
2411         * dom/ExceptionCode.h:
2412         Add two new ExceptionCodes:
2413           - ExistingExceptionError, to indicate that implementation code threw a JS exception.
2414           - StackOverflowError, to indicate that a stack overflow exception should be thrown.
2415
2416         * dom/MessagePort.cpp:
2417         (WebCore::MessagePort::postMessage):
2418         * dom/MessagePort.h:
2419         * dom/MessagePort.idl:
2420         * page/DOMWindow.cpp:
2421         (WebCore::DOMWindow::postMessage):
2422         * page/DOMWindow.h:
2423         * page/DOMWindow.idl:
2424         * workers/DedicatedWorkerGlobalScope.cpp:
2425         (WebCore::DedicatedWorkerGlobalScope::postMessage):
2426         * workers/DedicatedWorkerGlobalScope.h:
2427         * workers/DedicatedWorkerGlobalScope.idl:
2428         * workers/Worker.cpp:
2429         (WebCore::Worker::postMessage):
2430         * workers/Worker.h:
2431         * workers/Worker.idl:
2432         Update to call new SerializedScriptValue create function.
2433
2434 2016-12-03  Dave Hyatt  <hyatt@apple.com>
2435
2436         [CSS Parser] Support Dashboard Regions
2437         https://bugs.webkit.org/show_bug.cgi?id=165357
2438
2439         Reviewed by Daniel Bates.
2440
2441         * css/CSSValueKeywords.in:
2442         * css/parser/CSSPropertyParser.cpp:
2443         (WebCore::consumeWebkitDashboardRegion):
2444         (WebCore::CSSPropertyParser::parseSingleValue):
2445
2446 2016-12-02  Simon Fraser  <simon.fraser@apple.com>
2447
2448         Improve the behavior of scroll-into-view when the target is inside position:fixed
2449         https://bugs.webkit.org/show_bug.cgi?id=165354
2450
2451         Reviewed by Zalan Bujtas.
2452         
2453         The existing RenderLayer::scrollRectToVisible() code paid no heed to whether the 
2454         target was inside position:fixed, resulting in unwanted scrolls.
2455         
2456         Fix this by plumbing through from the call sites a "insideFixed" flag which we get
2457         when we call localToAbsolute(), and use this flag to avoid scrolling at all if
2458         unzoomed.
2459         
2460         If zoomed and we're focussing something inside position:fixed, and if visual viewports
2461         are enabled, we can compute the visual viewport required to reveal the target rect,
2462         which gives us the ideal scroll position.
2463         
2464         Fix a bug on non-iOS platforms when zoomed, which is to scale the viewRect since
2465         frameView.visibleContentRect() gives an unscaled rect on those platforms.
2466         
2467         Not all callers of scrollRectToVisible() are fixed, but those that are not will get
2468         the current behavior.
2469
2470         Tests: fast/overflow/scroll-anchor-in-position-fixed.html
2471                fast/visual-viewport/zoomed-scroll-into-view-fixed.html
2472                fast/visual-viewport/zoomed-scroll-to-anchor-in-position-fixed.html
2473
2474         * dom/Element.cpp:
2475         (WebCore::Element::scrollIntoView):
2476         (WebCore::Element::scrollIntoViewIfNeeded):
2477         (WebCore::Element::scrollIntoViewIfNotVisible):
2478         (WebCore::Element::updateFocusAppearance):
2479         * editing/FrameSelection.cpp:
2480         (WebCore::FrameSelection::FrameSelection):
2481         (WebCore::FrameSelection::absoluteCaretBounds):
2482         (WebCore::FrameSelection::recomputeCaretRect):
2483         (WebCore::FrameSelection::revealSelection):
2484         * editing/FrameSelection.h:
2485         * editing/VisiblePosition.cpp:
2486         (WebCore::VisiblePosition::absoluteCaretBounds):
2487         * editing/VisiblePosition.h:
2488         * editing/htmlediting.cpp:
2489         (WebCore::absoluteBoundsForLocalCaretRect):
2490         * editing/htmlediting.h:
2491         * page/FrameView.cpp:
2492         (WebCore::FrameView::scrollElementToRect):
2493         (WebCore::FrameView::scrollToAnchor):
2494         * page/PrintContext.cpp:
2495         (WebCore::PrintContext::outputLinkedDestinations):
2496         * rendering/RenderElement.cpp:
2497         (WebCore::RenderElement::getLeadingCorner):
2498         (WebCore::RenderElement::getTrailingCorner):
2499         (WebCore::RenderElement::absoluteAnchorRect):
2500         (WebCore::RenderElement::anchorRect): Renamed to absoluteAnchorRect().
2501         * rendering/RenderElement.h:
2502         * rendering/RenderLayer.cpp:
2503         (WebCore::RenderLayer::scrollRectToVisible):
2504         (WebCore::RenderLayer::getRectToExpose):
2505         (WebCore::RenderLayer::autoscroll):
2506         * rendering/RenderLayer.h:
2507         * rendering/RenderObject.cpp:
2508         (WebCore::RenderObject::scrollRectToVisible):
2509         * rendering/RenderObject.h:
2510
2511 2016-11-30  Simon Fraser  <simon.fraser@apple.com>
2512
2513         localToAbsolute() does incorrect conversion for elements inside position:fixed with zooming
2514         https://bugs.webkit.org/show_bug.cgi?id=165244
2515
2516         Reviewed by Zalan Bujtas.
2517         
2518         RenderView::mapLocalToContainer() and RenderView::mapAbsoluteToLocalPoint() handle the coordinate
2519         mapping through the RenderView's transform (when zoomed), and apply the scroll offset for position:fixed
2520         elements.
2521         
2522         They did this in the wrong order; "local to absolute" applied the zoom scale, and then adjusted for the scroll position,
2523         and "absolute to local" applied the scroll position and then the transform.
2524         
2525         However that scroll position adjustment should be in unzoomed coordinates, since it's accounting for the
2526         layout adjustment that position:fixed receives (which actually occurs via the localToAbsolute() call
2527         in RenderLayer's accumulateOffsetTowardsAncestor()). "local to absolute" should therefore apply the scroll
2528         adjustment first before the transform, and "absolute to local" the reverse.
2529         
2530         In both visual viewport mode, and legacy drifty fixed mode FrameView::scrollPositionForFixedPosition()
2531         returns a scroll offset that is unaffected by zoom, which is correct and confirms this change.
2532         
2533         [Confusingly, ScrollView scroll positions _are_ affected by zoom, as the entire document gets bigger.]
2534         
2535         RenderGeometryMap::mapToContainer(), which is an optimization on top of RenderView::mapLocalToContainer(),
2536         gets a similar fix.
2537         
2538         Test: fast/zooming/client-rect-in-fixed-zoomed.html
2539
2540         * rendering/RenderGeometryMap.cpp:
2541         (WebCore::RenderGeometryMap::mapToContainer):
2542         * rendering/RenderView.cpp:
2543         (WebCore::RenderView::mapLocalToContainer):
2544         (WebCore::RenderView::mapAbsoluteToLocalPoint):
2545
2546 2016-12-02  Simon Fraser  <simon.fraser@apple.com>
2547
2548         Put names on layers in release builds
2549         https://bugs.webkit.org/show_bug.cgi?id=165347
2550
2551         Reviewed by Tim Horton.
2552
2553         Put names on GraphicsLayers (and therefore CALayers) in release builds. Release names
2554         are a simpler, truncated version of debug names, with <tagname> id class names.
2555
2556         Non-primary layer names converted to lowercase and "layer" removed.
2557
2558         Fix comments that refer to gdb.
2559
2560         Use ENABLE(TREE_DEBUGGING) in more places.
2561
2562         * dom/Node.h:
2563         * dom/Position.h:
2564         * dom/Range.h:
2565         * editing/FrameSelection.h:
2566         * editing/VisiblePosition.h:
2567         * editing/VisibleSelection.h:
2568         * history/HistoryItem.h:
2569         * page/FrameTree.h:
2570         * platform/graphics/GraphicsLayer.h:
2571         * platform/graphics/ca/GraphicsLayerCA.cpp:
2572         (WebCore::GraphicsLayerCA::setName):
2573         (WebCore::GraphicsLayerCA::setContentsToSolidColor):
2574         (WebCore::GraphicsLayerCA::updateNames):
2575         (WebCore::GraphicsLayerCA::updateBackdropFilters):
2576         (WebCore::GraphicsLayerCA::updateContentsImage):
2577         (WebCore::GraphicsLayerCA::updateClippingStrategy):
2578         (WebCore::GraphicsLayerCA::updateContentsRects):
2579         (WebCore::GraphicsLayerCA::changeLayerTypeTo):
2580         * platform/graphics/ca/TileController.cpp:
2581         (WebCore::TileController::tileGridContainerLayerName):
2582         (WebCore::TileController::zoomedOutTileGridContainerLayerName):
2583         (WebCore::TileController::createTileLayer):
2584         * rendering/CounterNode.h:
2585         * rendering/InlineBox.h:
2586         * rendering/InlineFlowBox.h:
2587         * rendering/RenderCounter.h:
2588         * rendering/RenderLayer.cpp:
2589         (WebCore::RenderLayer::name):
2590         * rendering/RenderLayer.h:
2591         * rendering/RenderLayerBacking.cpp:
2592         (WebCore::RenderLayerBacking::createGraphicsLayer):
2593         (WebCore::RenderLayerBacking::createPrimaryGraphicsLayer):
2594         (WebCore::RenderLayerBacking::updateAncestorClippingLayer):
2595         (WebCore::RenderLayerBacking::updateDescendantClippingLayer):
2596         (WebCore::RenderLayerBacking::updateForegroundLayer):
2597         (WebCore::RenderLayerBacking::updateBackgroundLayer):
2598         (WebCore::RenderLayerBacking::updateMaskingLayer):
2599         (WebCore::RenderLayerBacking::updateChildClippingStrategy):
2600         (WebCore::RenderLayerBacking::updateScrollingLayers):
2601         * rendering/RenderLayerCompositor.cpp:
2602         (WebCore::RenderLayerCompositor::updateLayerForTopOverhangArea):
2603         (WebCore::RenderLayerCompositor::updateLayerForBottomOverhangArea):
2604         (WebCore::RenderLayerCompositor::updateLayerForHeader):
2605         (WebCore::RenderLayerCompositor::updateLayerForFooter):
2606         (WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
2607         (WebCore::RenderLayerCompositor::ensureRootLayer):
2608         * rendering/RenderObject.h:
2609
2610 2016-12-02  Antoine Quint  <graouts@apple.com>
2611
2612         [Modern Media Controls] Update the media controls size as the media element is resized
2613         https://bugs.webkit.org/show_bug.cgi?id=165346
2614
2615         Reviewed by Dean Jackson.
2616
2617         The "resize" event dispatched by HTMLMediaElement indicates a change in the media's
2618         intrinsic size, while the "resize" event dispatched by the HTMLMediaElement's ShadowRoot
2619         indicates that the layout size of the media element has changed. We now use the latter.
2620
2621         * Modules/modern-media-controls/media/media-controller.js:
2622         (MediaController):
2623         (MediaController.prototype.handleEvent):
2624
2625 2016-12-02  Andy Estes  <aestes@apple.com>
2626
2627         [Cocoa] Adopt the PRODUCT_BUNDLE_IDENTIFIER build setting
2628         https://bugs.webkit.org/show_bug.cgi?id=164492
2629
2630         Reviewed by Dan Bernstein.
2631
2632         * Configurations/WebCore.xcconfig: Set PRODUCT_BUNDLE_IDENTIFIER to
2633         com.apple.$(PRODUCT_NAME:rfc1034identifier).
2634         * Info.plist: Changed CFBundleIdentifier's value from com.apple.${PRODUCT_NAME} to
2635         ${PRODUCT_BUNDLE_IDENTIFIER}.
2636
2637 2016-12-02  Chris Dumez  <cdumez@apple.com>
2638
2639         HTML Interactive Form Validation popovers do not show in iOS WKWebViews
2640         https://bugs.webkit.org/show_bug.cgi?id=165340
2641         <rdar://problem/29489966>
2642
2643         Reviewed by Simon Fraser.
2644
2645         HTML Interactive Form Validation popovers do not show in iOS WKWebViews,
2646         only in MobileSafari. To address the issue try to find an appropriate
2647         UIViewController to present the popover when the client does not provide
2648         a presenting view controller.
2649
2650         * platform/ValidationBubble.h:
2651         * platform/ios/ValidationBubbleIOS.mm:
2652         (WebCore::fallbackViewController):
2653         (WebCore::ValidationBubble::setAnchorRect):
2654         * platform/spi/ios/UIKitSPI.h:
2655
2656 2016-12-02  Zalan Bujtas  <zalan@apple.com>
2657
2658         Remove redundant LayoutUnit conversions.
2659         https://bugs.webkit.org/show_bug.cgi?id=165338
2660
2661         Reviewed by Simon Fraser.
2662
2663         RenderBlockFlow::computeColumnCountAndWidth has some redundant LayoutUnti <-> unsigned conversions.
2664
2665         No change in functionality.
2666
2667         * rendering/RenderBlockFlow.cpp:
2668         (WebCore::RenderBlockFlow::computeColumnCountAndWidth):
2669
2670 2016-12-02  Antoine Quint  <graouts@apple.com>
2671
2672         [Modern Media Controls] Add rewind and fast-forward support
2673         https://bugs.webkit.org/show_bug.cgi?id=165294
2674
2675         Reviewed by Dean Jackson.
2676
2677         We implement support for rewinding and fast-forwarding the media by pressing dedicated
2678         buttons in fullscreen on macOS. We introduce a new SeekButton class that the existing
2679         RewindButton and ForwardButton classes now extend and which provides handling of
2680         "mousedown" and "mouseup" events to indicate that a button is being pressed to the
2681         UI delegate.
2682
2683         We also introduce a new SeekSupport class from which SeekBackwardSupport and
2684         SeekForwardSupport inherit to integrate with those controls and update the media
2685         time.
2686
2687         Tests: media/modern-media-controls/layout-node/layout-node-parent-of-type.html
2688                media/modern-media-controls/seek-backward-support/seek-backward-support.html
2689                media/modern-media-controls/seek-forward-support/seek-forward-support.html
2690
2691         * Modules/modern-media-controls/controls/forward-button.js:
2692         * Modules/modern-media-controls/controls/layout-node.js:
2693         (LayoutNode.prototype.parentOfType):
2694         * Modules/modern-media-controls/controls/rewind-button.js:
2695         * Modules/modern-media-controls/controls/seek-button.js: Added.
2696         (SeekButton):
2697         (SeekButton.prototype.handleEvent):
2698         (SeekButton.prototype._didStartPressing):
2699         (SeekButton.prototype._didStopPressing):
2700         (SeekButton.prototype._notifyDelegateOfPressingState):
2701         * Modules/modern-media-controls/js-files:
2702         * Modules/modern-media-controls/media/media-controller.js:
2703         (MediaController.prototype._updateControlsIfNeeded):
2704         * Modules/modern-media-controls/media/seek-backward-support.js: Added.
2705         (SeekBackwardSupport.prototype.get control):
2706         (SeekBackwardSupport.prototype.get multiplier):
2707         (SeekBackwardSupport):
2708         * Modules/modern-media-controls/media/seek-forward-support.js: Added.
2709         (SeekForwardSupport.prototype.get control):
2710         (SeekForwardSupport.prototype.get multiplier):
2711         (SeekForwardSupport):
2712         * Modules/modern-media-controls/media/seek-support.js: Added.
2713         (SeekSupport.prototype.get multiplier):
2714         (SeekSupport.prototype.buttonPressedStateDidChange):
2715         (SeekSupport.prototype._startSeeking):
2716         (SeekSupport.prototype._stopSeeking):
2717         (SeekSupport.prototype._seek):
2718         (SeekSupport):
2719         * WebCore.xcodeproj/project.pbxproj:
2720
2721 2016-12-02  Dave Hyatt  <hyatt@apple.com>
2722
2723         [CSS Parser] Need to set edit flags properly when user-modify/select are used.
2724         https://bugs.webkit.org/show_bug.cgi?id=165334
2725
2726         Reviewed by Dean Jackson.
2727
2728         The old parser calls parserSetUsesStyleBasedEditability on
2729         StyleSheetContents* from inside isValidKeywordPropertyAndValue. This
2730         is pretty lame, but we have to do the same in order to pass editing
2731         layout tests.
2732
2733         All of the functions below have been patched with the sole purpose of
2734         propagating StyleSheetContents* through to isValidKeywordPropertyAndValue
2735         in the new parser.
2736
2737         * css/parser/CSSParser.cpp:
2738         (WebCore::CSSParser::parseValueWithVariableReferences):
2739         * css/parser/CSSParser.h:
2740         * css/parser/CSSParserFastPaths.cpp:
2741         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
2742         (WebCore::parseKeywordValue):
2743         (WebCore::CSSParserFastPaths::maybeParseValue):
2744         * css/parser/CSSParserFastPaths.h:
2745         * css/parser/CSSParserImpl.cpp:
2746         (WebCore::CSSParserImpl::consumeDeclarationValue):
2747         * css/parser/CSSPropertyParser.cpp:
2748         (WebCore::CSSPropertyParser::CSSPropertyParser):
2749         (WebCore::CSSPropertyParser::parseValue):
2750         (WebCore::CSSPropertyParser::parseSingleValue):
2751         (WebCore::CSSPropertyParser::parseFontFaceDescriptor):
2752         (WebCore::CSSPropertyParser::consumeFont):
2753         (WebCore::CSSPropertyParser::parseShorthand):
2754         * css/parser/CSSPropertyParser.h:
2755
2756 2016-12-02  Beth Dakin  <bdakin@apple.com>
2757
2758         REGRESSION (r208802): TouchBar pause button doesn't work
2759         https://bugs.webkit.org/show_bug.cgi?id=165333
2760         -and corresponding-
2761         rdar://problem/29487187
2762
2763         Reviewed by Wenson Hsieh.
2764
2765         The previous code got this right by using self.playing. _playing was totally un-
2766         used, so this patch just removes it.
2767
2768         * platform/mac/WebPlaybackControlsManager.h:
2769         * platform/mac/WebPlaybackControlsManager.mm:
2770         (-[WebPlaybackControlsManager setPlaying:]):
2771
2772 2016-12-02  John Wilander  <wilander@apple.com>
2773
2774         Require preflight for non-standard CORS-safelisted request headers Accept, Accept-Language, and Content-Language
2775         https://bugs.webkit.org/show_bug.cgi?id=165178
2776         <rdar://problem/18792250>
2777
2778         Reviewed by Youenn Fablet.
2779
2780         Fetch currently only restricts the header Content-Type for simple requests:
2781         https://fetch.spec.whatwg.org/#cors-safelisted-request-header
2782
2783         This means simple CORS requests can send unexpected characters in Accept, 
2784         Accept-Language, and Content-Language header values.
2785
2786         RFC 7231 implies restrictions on these header values:
2787         - Accept https://tools.ietf.org/html/rfc7231#section-5.3.2
2788         - Accept-Language https://tools.ietf.org/html/rfc7231#section-5.3.5
2789         - Content-Language https://tools.ietf.org/html/rfc7231#section-3.1.3.2
2790
2791         As per discussions in the W3C WebAppSec group we should try to restrict 
2792         these header values to help protect servers that do not expect simple CORS 
2793         requests.
2794
2795         Non-standard, safelisted header values should trigger a preflight and require
2796         the headers to be whitelisted in the response's Access-Control-Allow-Headers.
2797         For Fetch in no-cors mode this change means non-standard header values are not
2798         allowed to be set.
2799
2800         Test: http/tests/xmlhttprequest/cors-non-standard-safelisted-headers-should-trigger-preflight.html
2801
2802         * loader/CrossOriginAccessControl.cpp:
2803         (WebCore::isSimpleCrossOriginAccessRequest):
2804             Now calls WebCore::isCrossOriginSafeRequestHeader() instead of
2805             WebCore::isOnAccessControlSimpleRequestHeaderWhitelist().
2806         (WebCore::isOnAccessControlSimpleRequestHeaderWhitelist): Deleted.
2807             It was a duplicate of WebCore::isCrossOriginSafeRequestHeader().
2808         * loader/CrossOriginAccessControl.h:
2809         * loader/CrossOriginPreflightResultCache.cpp:
2810         (WebCore::CrossOriginPreflightResultCacheItem::allowsCrossOriginHeaders):
2811             Now calls WebCore::isCrossOriginSafeRequestHeader() instead of
2812             WebCore::isOnAccessControlSimpleRequestHeaderWhitelist().
2813         * platform/network/HTTPParsers.cpp:
2814         (WebCore::isValidAcceptHeaderValue):
2815             Basic check that the characters are all ASCII alphanumeric, ' ', '*', '.',
2816             '/', ';', or '='.
2817         (WebCore::isValidLanguageHeaderValue):
2818             Basic check that the characters are all ASCII alphanumeric, ' ', '*', '-',
2819             '.', ';', or '='.
2820         (WebCore::isSimpleHeader):
2821             Removed duplicate code. Now calls WebCore::isCrossOriginSafeRequestHeader().
2822         (WebCore::isCrossOriginSafeRequestHeader):
2823             Now makes a call to WebCore::isValidAcceptHeaderValue() for Accept
2824             headers and WebCore::isValidLanguageHeaderValue() for Accept-Language
2825             and Content-Language headers.
2826         * platform/network/HTTPParsers.h:
2827
2828 2016-12-02  Zalan Bujtas  <zalan@apple.com>
2829
2830         ASSERTION FAILED: flowThread->regionInRange(region, startRegion, endRegion) in WebCore::RenderBox::borderBoxRectInRegion
2831         https://bugs.webkit.org/show_bug.cgi?id=152113
2832         <rdar://problem/27720221>
2833
2834         Reviewed by David Hyatt.
2835
2836         In a nested column context, do not process a spanner if it belongs to an inner column.
2837
2838         While populating a flow, we search for possible spanners and construct multicolumnsets accordingly.
2839         However due to the top-down nature of populating flows, a descendant spanner could belong to an inner
2840         flow which hasn't been populated yet.
2841         This patch checks if a potential spanner has an ancestor (which is also a descendant
2842         of the flow that we are populating -> nested) that will eventually create a flow context. 
2843
2844         Test: fast/multicol/assert-with-nested-columns-and-spanner.html
2845
2846         * rendering/RenderBlockFlow.cpp:
2847         (WebCore::RenderBlockFlow::computeColumnCountAndWidth):
2848         (WebCore::RenderBlockFlow::willCreateColumns):
2849         * rendering/RenderBlockFlow.h:
2850         * rendering/RenderMultiColumnFlowThread.cpp:
2851         (WebCore::isValidColumnSpanner):
2852
2853 2016-12-02  Dave Hyatt  <hyatt@apple.com>
2854
2855         [CSS Parser] Make sure the z-component of transform-origin can be implicit
2856         https://bugs.webkit.org/show_bug.cgi?id=165326
2857
2858         Reviewed by Tim Horton.
2859
2860         * css/parser/CSSPropertyParser.cpp:
2861         (WebCore::CSSPropertyParser::consumeTransformOrigin):
2862
2863 2016-12-02  Dave Hyatt  <hyatt@apple.com>
2864
2865         [CSS Parser] Fix :any/:host to allow pseudo-elements. Support -webkit-border-radius.
2866         https://bugs.webkit.org/show_bug.cgi?id=165323
2867
2868         Reviewed by Dean Jackson.
2869
2870         * css/parser/CSSPropertyParser.cpp:
2871         (WebCore::CSSPropertyParser::parseShorthand):
2872         * css/parser/CSSSelectorParser.cpp:
2873         (WebCore::CSSSelectorParser::consumePseudo):
2874
2875 2016-12-02  Chris Dumez  <cdumez@apple.com>
2876
2877         [iOS] Tapping on an HTML validation bubble should dismiss it
2878         https://bugs.webkit.org/show_bug.cgi?id=165122
2879         <rdar://problem/29429372>
2880
2881         Reviewed by Simon Fraser.
2882
2883         Tapping on an HTML validation bubble should dismiss it. Previously it did
2884         nothing.
2885
2886         No new tests, I tried writing one but the validation popover does not
2887         show in the simulator, only on device. I believe at least one reason is that
2888         _presentingViewControllerForWebView() is required and is currently not
2889         implemented by WKTR. I'll look into this issue separately.
2890
2891         * platform/ValidationBubble.h:
2892         * platform/ios/ValidationBubbleIOS.mm:
2893         (-[WebValidationBubbleTapRecognizer initWithPopoverController:withPopoverView:]):
2894         (-[WebValidationBubbleTapRecognizer dismissPopover]):
2895         (WebCore::ValidationBubble::ValidationBubble):
2896
2897 2016-12-02  Dave Hyatt  <hyatt@apple.com>
2898
2899         [CSS Parser] Add support for the SVG 'kerning' property
2900         https://bugs.webkit.org/show_bug.cgi?id=165315
2901
2902         Reviewed by Zalan Bujtas.
2903
2904         * css/parser/CSSPropertyParser.cpp:
2905         (WebCore::consumeKerning):
2906         (WebCore::CSSPropertyParser::parseSingleValue):
2907
2908 2016-12-02  Sam Weinig  <sam@webkit.org>
2909
2910         [WebIDL] Remove support for the 'Nondeterministic' extended attribute
2911         https://bugs.webkit.org/show_bug.cgi?id=165307
2912
2913         Reviewed by Chris Dumez.
2914
2915         We are not currently using the WebReplay functionality that the Nondeterministic
2916         extended attribute is intended to aide. If we come back to WebReplay in the future,
2917         we can bring it back.
2918
2919         * bindings/scripts/CodeGeneratorJS.pm:
2920         (GenerateImplementation):
2921         (GenerateImplementationFunctionCall):
2922         (GetNativeTypeForMemoization): Deleted.
2923         * bindings/scripts/IDLAttributes.txt:
2924         * bindings/scripts/test/JS/JSTestNondeterministic.cpp: Removed.
2925         * bindings/scripts/test/JS/JSTestNondeterministic.h: Removed.
2926         * bindings/scripts/test/TestNondeterministic.idl: Removed.
2927         * page/Navigator.idl:
2928         * page/Screen.idl:
2929
2930 2016-12-02  Dave Hyatt  <hyatt@apple.com>
2931
2932         [CSS Parser] Support the -webkit-letterpress value for text-decoration
2933         https://bugs.webkit.org/show_bug.cgi?id=165313
2934
2935         Reviewed by Dean Jackson.
2936
2937         * css/parser/CSSPropertyParser.cpp:
2938         (WebCore::consumeTextDecorationLine):
2939
2940 2016-12-02  Dave Hyatt  <hyatt@apple.com>
2941
2942         [CSS Parser] Fix the color-gamut media query evaluator
2943         https://bugs.webkit.org/show_bug.cgi?id=165309
2944
2945         Reviewed by Zalan Bujtas).
2946
2947         * css/MediaQueryEvaluator.cpp:
2948         (WebCore::colorGamutEvaluate):
2949         Unknown values should result in a failed match, not a successful match.
2950
2951 2016-12-02  Darin Adler  <darin@apple.com>
2952
2953         Remove use of WebCore::Dictionary in MediaSession
2954         https://bugs.webkit.org/show_bug.cgi?id=165296
2955
2956         Reviewed by Chris Dumez.
2957
2958         I am not exactly sure of the status of this code. When I enabled it to test my
2959         changes it did not compile until I fixed some things, and it's far out of date
2960         of the latest draft of the Media Session Standard. But despite that I updated it.
2961
2962         * DerivedSources.make: Removed a line that was breaking the build for some
2963         configurations, perhaps only for programmers from Apple, after r209198.
2964
2965         * Modules/mediasession/MediaSession.cpp:
2966         (WebCore::MediaSession::MediaSession): Fixed so it compiles.
2967         (WebCore::MediaSession::setMetadata): Changed argument to use a struct rather
2968         htan a WebCore::Dictionary.
2969         * Modules/mediasession/MediaSession.h: Added a Metadata struct, and used it.
2970         Also fixed the arguments to the constructor.
2971         * Modules/mediasession/MediaSession.idl: Added MediaMetadata and used it instead
2972         of Dictionary.
2973
2974 2016-12-02  Dave Hyatt  <hyatt@apple.com>
2975
2976         [CSS Parser] Make sure margin and font set the implicit flag properly
2977         https://bugs.webkit.org/show_bug.cgi?id=165306
2978
2979         Reviewed by Zalan Bujtas.
2980
2981         * css/parser/CSSPropertyParser.cpp:
2982         (WebCore::CSSPropertyParser::consumeFont):
2983         (WebCore::CSSPropertyParser::consume4Values):
2984
2985 2016-12-02  Dave Hyatt  <hyatt@apple.com>
2986
2987         [CSS Parser] Make sure the templatized consumeIdent uses CSSValuePool
2988         https://bugs.webkit.org/show_bug.cgi?id=165302
2989
2990         Reviewed by Zalan Bujtas.
2991
2992         * css/parser/CSSPropertyParserHelpers.h:
2993         (WebCore::CSSPropertyParserHelpers::consumeIdent):
2994
2995 2016-12-02  Dave Hyatt  <hyatt@apple.com>
2996
2997         [CSS Parser] Fix font-variant parsing 
2998         https://bugs.webkit.org/show_bug.cgi?id=165301
2999
3000         Reviewed by Zalan Bujtas.
3001
3002         * css/parser/CSSPropertyParser.cpp:
3003         (WebCore::consumeFontVariantEastAsian):
3004         (WebCore::CSSPropertyParser::consumeFontVariantShorthand):
3005         Fix a bug with font-variant-east-asian parsing where the id
3006         was getting improperly consumed even when it didn't match.
3007
3008 2016-12-02  Dave Hyatt  <hyatt@apple.com>
3009
3010         [CSS Parser] Fix animation property parsing
3011         https://bugs.webkit.org/show_bug.cgi?id=165305
3012
3013         Reviewed by Zalan Bujtas.
3014
3015         * css/parser/CSSPropertyParser.cpp:
3016         (WebCore::consumeAnimationPropertyList):
3017         Match the old parser by only creating a list for animation properties if there
3018         are two or more comma-separated values. Otherwise just return the CSSValue for
3019         the singleton without creating a list.
3020
3021 2016-12-02  Gustavo Sverzut Barbieri  <barbieri@profusion.mobi>
3022
3023         Fix build break when disabling some features.
3024         https://bugs.webkit.org/show_bug.cgi?id=165254
3025
3026         Reviewed by Michael Catanzaro.
3027
3028         If we disable SVG_FONTS or XSLT, then
3029         WebCore::CachedResource::isCORSSameOrigin() would have assertions
3030         on non-existent members. These should be isolated within "#if" as
3031         the other places.
3032
3033         If we're in DEVELOPER_MODE but did not provide
3034         TEST_HYPHENATAION_PATH, then we must mark UNUSED_PARAM() if we're
3035         not on GTK port (ie: EFL).
3036
3037         No new tests as this is a build fix.
3038
3039         * loader/cache/CachedResource.cpp:
3040         (WebCore::CachedResource::isCORSSameOrigin):
3041          - missing #if ENABLED(SVG_FONTS)
3042          - missing #if ENABLED(XSLT)
3043         * platform/text/hyphen/HyphenationLibHyphen.cpp:
3044         (WebCore::scanTestDictionariesDirectoryIfNecessary):
3045          - missing UNUSED_PARAM()
3046
3047
3048 2016-12-02  Miguel Gomez  <magomez@igalia.com>
3049
3050         [GTK] Use an OpenGL < 3.0 compliant way to request the OpenGL version
3051         https://bugs.webkit.org/show_bug.cgi?id=165253
3052
3053         Reviewed by Carlos Garcia Campos.
3054
3055         Use glGetString(GL_VERSION) to get the OpenGL version, as glGetIntegerv with GL_MAJOR_VERSION
3056         and GL_MINOR_VERSION is only supported from 3.0 on.
3057
3058         Covered by existent tests.
3059
3060         * platform/graphics/GLContext.cpp:
3061         (WebCore::GLContext::version):
3062
3063 2016-12-02  Alex Christensen  <achristensen@webkit.org>
3064
3065         Fix WinCairo build after r208997
3066         https://bugs.webkit.org/show_bug.cgi?id=165283
3067
3068         Reviewed by Carlos Garcia Campos.
3069
3070         * platform/graphics/GLContext.cpp:
3071         glGetIntegerv is defined in gl2.h.
3072         GL_MAJOR_VERSION is defined in gl3.h.
3073         These are not included in the WinCairo build.
3074
3075 2016-11-30  Darin Adler  <darin@apple.com>
3076
3077         Stop using WebCore::Dictionary in bindings for Fetch
3078         https://bugs.webkit.org/show_bug.cgi?id=165241
3079
3080         Reviewed by Chris Dumez.
3081
3082         * Modules/fetch/DOMWindowFetch.idl: Use RequestInit instead of Dictionary.
3083         No effect on code generated since this is a JSBuiltin.
3084
3085         * Modules/fetch/FetchRequest.cpp:
3086         (WebCore::setReferrerPolicy): Deleted. Bindings handle this now.
3087         (WebCore::setMode): Ditto.
3088         (WebCore::setCredentials): Ditto.
3089         (WebCore::setCache): Ditto.
3090         (WebCore::setRedirect): Ditto.
3091         (WebCore::setReferrer): Changed argument from Dictionary to String.
3092         (WebCore::buildOptions): Changed argument from Dictionary to FetchRequest::Init,
3093         and simplified the code accordingly.
3094         (WebCore::FetchRequest::initializeOptions): Ditto.
3095         (WebCore::FetchRequest::initializeWith): Ditto.
3096         * Modules/fetch/FetchRequest.h: Updated for above changes. Also added the Init struct.
3097
3098         * Modules/fetch/FetchRequest.idl: Added missing "only-if-cached" value to RequestCache.
3099         Added RequestInit dictionary and used it instead of Dictionary. Used more-specific string
3100         types for the method and referrer attributes; no effect at runtime, since the code for
3101         getters is the same for ByteString, USVString, and DOMString and these are read-only.
3102
3103         * Modules/fetch/WorkerGlobalScopeFetch.idl: Use RequestInit instead of Dictionary.
3104         No effect on code generated since this is a JSBuiltin.
3105
3106 2016-12-01  Jiewen Tan  <jiewen_tan@apple.com>
3107
3108         Add a runtime flag for SubtleCrypto
3109         https://bugs.webkit.org/show_bug.cgi?id=164982
3110
3111         Reviewed by Brent Fulgham.
3112
3113         * bindings/generic/RuntimeEnabledFeatures.h:
3114         (WebCore::RuntimeEnabledFeatures::setSubtleCryptoEnabled):
3115         (WebCore::RuntimeEnabledFeatures::subtleCryptoEnabled):
3116         * page/Crypto.idl:
3117
3118 2016-12-01  Saam Barati  <sbarati@apple.com>
3119
3120         Rename CallFrame::callee() to CallFrame::jsCallee()
3121         https://bugs.webkit.org/show_bug.cgi?id=165293
3122
3123         Reviewed by Keith Miller.
3124
3125         * bindings/js/JSDOMConstructor.h:
3126         (WebCore::JSBuiltinConstructor<JSClass>::construct):
3127         * bindings/js/JSDataCueCustom.cpp:
3128         (WebCore::constructJSDataCue):
3129         * bindings/js/JSHTMLAllCollectionCustom.cpp:
3130         (WebCore::callHTMLAllCollection):
3131         * bindings/js/JSHTMLElementCustom.cpp:
3132         (WebCore::constructJSHTMLElement):
3133         * bindings/js/JSImageConstructor.cpp:
3134         (WebCore::JSImageConstructor::construct):
3135         * bindings/js/JSMutationObserverCustom.cpp:
3136         (WebCore::constructJSMutationObserver):
3137         * bindings/js/JSPluginElementFunctions.cpp:
3138         (WebCore::callPlugin):
3139         * bindings/js/JSWorkerCustom.cpp:
3140         (WebCore::constructJSWorker):
3141         * bindings/scripts/CodeGeneratorJS.pm:
3142         (GenerateConstructorDefinition):
3143         * bindings/scripts/test/JS/JSFloat64Array.cpp:
3144         (WebCore::JSFloat64ArrayConstructor::constructJSFloat64Array):
3145         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
3146         (WebCore::JSTestEventConstructorConstructor::construct):
3147         * bindings/scripts/test/JS/JSTestInterface.cpp:
3148         (WebCore::JSTestInterfaceConstructor::construct):
3149         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
3150         (WebCore::JSTestNamedConstructorNamedConstructor::construct):
3151         * bindings/scripts/test/JS/JSTestNode.cpp:
3152         (WebCore::JSTestNodeConstructor::construct):
3153         * bindings/scripts/test/JS/JSTestObj.cpp:
3154         (WebCore::JSTestObjConstructor::construct):
3155         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
3156         (WebCore::constructJSTestOverloadedConstructors1):
3157         (WebCore::constructJSTestOverloadedConstructors2):
3158         (WebCore::constructJSTestOverloadedConstructors3):
3159         (WebCore::constructJSTestOverloadedConstructors4):
3160         (WebCore::constructJSTestOverloadedConstructors5):
3161         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
3162         (WebCore::constructJSTestOverloadedConstructorsWithSequence1):
3163         (WebCore::constructJSTestOverloadedConstructorsWithSequence2):
3164         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
3165         (WebCore::JSTestTypedefsConstructor::construct):
3166         * bridge/objc/objc_runtime.mm:
3167         (JSC::Bindings::callObjCFallbackObject):
3168         * bridge/runtime_method.cpp:
3169         (JSC::callRuntimeMethod):
3170         * bridge/runtime_object.cpp:
3171         (JSC::Bindings::callRuntimeObject):
3172         (JSC::Bindings::callRuntimeConstructor):
3173
3174 2016-12-01  Antoine Quint  <graouts@apple.com>
3175
3176         [Modern Media Controls] Fade controls in when entering and exiting fullscreen
3177         https://bugs.webkit.org/show_bug.cgi?id=165287
3178
3179         Reviewed by Dean Jackson.
3180
3181         Fade controls in when we enter and leave fullscreen.
3182
3183         Test: media/modern-media-controls/media-controller/media-controller-fade-controls-when-entering-fullscreen.html
3184
3185         * Modules/modern-media-controls/controls/media-controls.css:
3186         (.media-controls.fade-in):
3187         (@keyframes fade-in):
3188         (to):
3189         * Modules/modern-media-controls/controls/media-controls.js:
3190         (MediaControls.prototype.presentInElement):
3191         * Modules/modern-media-controls/media/fullscreen-support.js:
3192         (FullscreenSupport.prototype.buttonWasClicked):
3193         * Modules/modern-media-controls/media/media-controller.js:
3194         (MediaController.prototype._updateControlsIfNeeded):
3195
3196 2016-12-01  Antoine Quint  <graouts@apple.com>
3197
3198         [Modern Media Controls] Show and populate the tracks panel
3199         https://bugs.webkit.org/show_bug.cgi?id=165284
3200
3201         Reviewed by Dean Jackson.
3202
3203         We added a TracksPanel in https://bugs.webkit.org/show_bug.cgi?id=165239 which allows to
3204         show a list of media tracks and text tracks to choose from. We now show this panel when
3205         clicking on the tracks button in the controls bar and populate its content with the
3206         list of audio and text tracks for the media element. As an item is picked from the tracks
3207         panel, we toggle the represented track's enabled state and dismiss the panel.
3208
3209         We also pick up the text track container display mostly unchanged from current media controls.
3210
3211         Tests: media/modern-media-controls/tracks-support/tracks-support-click-track-in-panel.html
3212                media/modern-media-controls/tracks-support/tracks-support-show-and-populate-panel.html
3213
3214         * Modules/modern-media-controls/controls/macos-inline-media-controls.js:
3215         (MacOSInlineMediaControls.prototype.showTracksPanel):
3216         * Modules/modern-media-controls/controls/text-tracks.css: Added.
3217         (video::-webkit-media-text-track-container):
3218         (video::cue):
3219         (video::-webkit-media-text-track-display):
3220         (video::-webkit-media-text-track-display-backdrop):
3221         (video::cue(:future)):
3222         (video::-webkit-media-text-track-container b):
3223         (video::-webkit-media-text-track-container u):
3224         (video::-webkit-media-text-track-container i):
3225         (video::-webkit-media-text-track-container .hidden):
3226         * Modules/modern-media-controls/media/media-controller.js:
3227         (MediaController):
3228         * Modules/modern-media-controls/media/tracks-support.js:
3229         (TracksSupport):
3230         (TracksSupport.prototype.destroy):
3231         (TracksSupport.prototype.buttonWasClicked):
3232         (TracksSupport.prototype.tracksPanelNumberOfSections):
3233         (TracksSupport.prototype.tracksPanelTitleForSection):
3234         (TracksSupport.prototype.tracksPanelNumberOfTracksInSection):
3235         (TracksSupport.prototype.tracksPanelTitleForTrackInSection):
3236         (TracksSupport.prototype.tracksPanelIsTrackInSectionSelected):
3237         (TracksSupport.prototype.tracksPanelSelectionDidChange):
3238         (TracksSupport.prototype.syncControl):
3239         (TracksSupport.prototype._textTracks):
3240         (TracksSupport.prototype._audioTracks):
3241         (TracksSupport.prototype._canPickAudioTracks):
3242         (TracksSupport.prototype._canPickTextTracks):
3243         (TracksSupport.prototype._sortedTrackList):
3244
3245 2016-12-01  Brent Fulgham  <bfulgham@apple.com>
3246
3247         Rare crash when preparing to print
3248         https://bugs.webkit.org/show_bug.cgi?id=165280
3249         <rdar://problem/28240254>
3250
3251         Reviewed by Dean Jackson.
3252
3253         * page/Frame.cpp:
3254         (WebCore::Frame::setPrinting): Only manipulate the FrameView if it is non-null.
3255         (WebCore::Frame::documentAtPoint): Drive-by fix to change a 0 return to nullptr.
3256
3257 2016-12-01  Simon Fraser  <simon.fraser@apple.com>
3258
3259         Put an obvious debug border on layers with backdrop filters
3260         https://bugs.webkit.org/show_bug.cgi?id=165291
3261
3262         Reviewed by Tim Horton.
3263
3264         Put a wide magenta border on layers with backdrop filters, to highlight their performance impact.
3265         
3266         Change the "contents layer" color (used by WebGL, video etc) to blue.
3267         
3268         Make the clipping layer border slightly narrower.
3269
3270         * platform/graphics/GraphicsLayer.cpp:
3271         (WebCore::GraphicsLayer::getDebugBorderInfo):
3272         * platform/graphics/ca/GraphicsLayerCA.cpp:
3273         (WebCore::GraphicsLayerCA::setBackdropFilters):
3274
3275 2016-12-01  Brian Burg  <bburg@apple.com>
3276
3277         Fix the Windows Release build after r209198
3278         https://bugs.webkit.org/show_bug.cgi?id=165285
3279
3280         Unreviewed build fix.
3281
3282         * Modules/webdriver/NavigatorWebDriver.cpp:
3283         Brute force include all the inlines to work around a JSC issue.
3284
3285 2016-12-01  Dave Hyatt  <hyatt@apple.com>
3286
3287         [CSS Parser] Only allow a single font-family in @font-face
3288         https://bugs.webkit.org/show_bug.cgi?id=165278
3289
3290         Reviewed by Zalan Bujtas.
3291
3292         * css/parser/CSSPropertyParser.cpp:
3293         (WebCore::consumeFontFamilyDescriptor):
3294         (WebCore::CSSPropertyParser::parseFontFaceDescriptor):
3295
3296 2016-12-01  Beth Dakin  <bdakin@apple.com>
3297
3298         Blacklist Netflix for TouchBar support
3299         https://bugs.webkit.org/show_bug.cgi?id=165104
3300
3301         Rubber-stamped by Tim Horton.
3302
3303         Meant to not have the www. in the first case because that is covered by the second 
3304         case.
3305
3306         * html/HTMLMediaElement.cpp:
3307         (WebCore::needsPlaybackControlsManagerQuirk):
3308
3309 2016-12-01  Dave Hyatt  <hyatt@apple.com>
3310
3311         [CSS Parser] Support -webkit-overflow-scrolling: touch
3312         https://bugs.webkit.org/show_bug.cgi?id=165275
3313
3314         Reviewed by Zalan Bujtas.
3315
3316         * css/parser/CSSParserFastPaths.cpp:
3317         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
3318
3319 2016-12-01  Jiewen Tan  <jiewen_tan@apple.com>
3320
3321         Update SubtleCrypto::unwrapKey to match the latest spec
3322         https://bugs.webkit.org/show_bug.cgi?id=164747
3323         <rdar://problem/29258198>
3324
3325         Reviewed by Brent Fulgham.
3326
3327         This patch does following few things:
3328         1. It updates the SubtleCrypto::unwrapKey method to match the latest spec:
3329            https://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-unwrapKey.
3330            It also refers to the latest Editor's Draft to a certain degree:
3331            https://w3c.github.io/webcrypto/Overview.html#SubtleCrypto-method-unwrapKey.
3332         2. It implements unwrapKey operations of the following algorithms: AES-KW.
3333
3334         Tests: crypto/subtle/aes-cbc-import-key-unwrap-jwk-rsa-key-private.html
3335                crypto/subtle/aes-cbc-import-key-uwrap-jwk-rsa-key-public.html
3336                crypto/subtle/aes-kw-generate-key-wrap-key-unwrap-key.html
3337                crypto/subtle/aes-kw-import-key-unwrap-raw-key.html
3338                crypto/subtle/rsa-oaep-import-key-unwrap-jwk-oct-key.html
3339                crypto/subtle/unwrapKey-malformed-parameters.html
3340                crypto/workers/subtle/aes-cbc-import-key-unwrap-key.html
3341                crypto/workers/subtle/aes-kw-import-key-unwrap-key.html
3342                crypto/workers/subtle/rsa-oaep-import-key-unwrap-key.html
3343
3344         * bindings/js/JSSubtleCryptoCustom.cpp:
3345         (WebCore::normalizeCryptoAlgorithmParameters):
3346         (WebCore::jsSubtleCryptoFunctionWrapKeyPromise):
3347         Add some comments.
3348         (WebCore::jsSubtleCryptoFunctionUnwrapKeyPromise):
3349         (WebCore::JSSubtleCrypto::unwrapKey):
3350         * crypto/CryptoAlgorithm.cpp:
3351         (WebCore::CryptoAlgorithm::unwrapKey):
3352         * crypto/CryptoAlgorithm.h:
3353         * crypto/SubtleCrypto.idl:
3354         * crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
3355         (WebCore::CryptoAlgorithmAES_KW::unwrapKey):
3356         * crypto/algorithms/CryptoAlgorithmAES_KW.h:
3357         * crypto/gnutls/CryptoAlgorithmAES_KWGnuTLS.cpp:
3358         (WebCore::CryptoAlgorithmAES_KW::platformUnwrapKey):
3359         * crypto/mac/CryptoAlgorithmAES_KWMac.cpp:
3360         (WebCore::unwrapKeyAES_KW):
3361         (WebCore::CryptoAlgorithmAES_KW::platformUnwrapKey):
3362         (WebCore::CryptoAlgorithmAES_KW::platformDecrypt):
3363
3364 2016-12-01  Dave Hyatt  <hyatt@apple.com>
3365
3366         [CSS Parser] Fix font-variant parsing
3367         https://bugs.webkit.org/show_bug.cgi?id=165266
3368
3369         Reviewed by Dean Jackson.
3370
3371         * css/parser/CSSPropertyParser.cpp:
3372         (WebCore::consumeFontVariantEastAsian):
3373         (WebCore::consumeFontVariantAlternates):
3374         (WebCore::consumeFontVariantPosition):
3375         (WebCore::CSSPropertyParser::parseSingleValue):
3376         (WebCore::CSSPropertyParser::parseFontFaceDescriptor):
3377         (WebCore::CSSPropertyParser::consumeFontVariantShorthand):
3378         (WebCore::consumeFontVariantList): Deleted.
3379
3380 2016-12-01  Brian Burg  <bburg@apple.com>
3381
3382         Web Automation: expose navigator.webdriver if the page is controlled by automation
3383         https://bugs.webkit.org/show_bug.cgi?id=165245
3384         <rdar://problem/29449874>
3385
3386         Reviewed by Joseph Pecoraro.
3387
3388         Move the implementation into OpenSource. It's in Modules/webdriver/.
3389
3390         * CMakeLists.txt:
3391         * DerivedSources.make:
3392         Add new paths and files.
3393
3394         * Modules/webdriver/NavigatorWebDriver.cpp: Added.
3395         (WebCore::NavigatorWebDriver::NavigatorWebDriver):
3396         (WebCore::NavigatorWebDriver::~NavigatorWebDriver):
3397         (WebCore::NavigatorWebDriver::supplementName):
3398         (WebCore::NavigatorWebDriver::isControlledByAutomation):
3399         (WebCore::NavigatorWebDriver::from):
3400         (WebCore::JSNavigator::webdriver):
3401         * Modules/webdriver/NavigatorWebDriver.h: Added.
3402         * Modules/webdriver/NavigatorWebDriver.idl: Added.
3403         * WebCore.xcodeproj/project.pbxproj:
3404
3405 2016-12-01  Brady Eidson  <beidson@apple.com>
3406
3407         IndexedDB 2.0: Implement IDBObjectStore.getKey().
3408         https://bugs.webkit.org/show_bug.cgi?id=165256
3409
3410         Reviewed by Alex Christensen.
3411
3412         Tests: storage/indexeddb/modern/idbobjectstore-getkey-1-private.html
3413                storage/indexeddb/modern/idbobjectstore-getkey-1.html
3414
3415         * Modules/indexeddb/IDBObjectStore.cpp:
3416         (WebCore::IDBObjectStore::get):
3417         (WebCore::IDBObjectStore::getKey):
3418         * Modules/indexeddb/IDBObjectStore.h:
3419         * Modules/indexeddb/IDBObjectStore.idl:
3420
3421         * Modules/indexeddb/IDBRequest.cpp:
3422         (WebCore::IDBRequest::createObjectStoreGet):
3423         (WebCore::IDBRequest::IDBRequest):
3424         (WebCore::IDBRequest::requestedObjectStoreRecordType):
3425         * Modules/indexeddb/IDBRequest.h:
3426
3427         * Modules/indexeddb/IDBTransaction.cpp:
3428         (WebCore::IDBTransaction::requestGetRecord):
3429         (WebCore::IDBTransaction::requestIndexRecord):
3430         (WebCore::IDBTransaction::didGetRecordOnServer):
3431
3432         * Modules/indexeddb/IndexedDB.h:
3433
3434         * Modules/indexeddb/server/IDBBackingStore.h:
3435
3436         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
3437         (WebCore::IDBServer::MemoryIDBBackingStore::getRecord):
3438         * Modules/indexeddb/server/MemoryIDBBackingStore.h:
3439
3440         * Modules/indexeddb/server/MemoryObjectStore.h:
3441
3442         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
3443         (WebCore::IDBServer::SQLiteIDBBackingStore::getRecord):
3444         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
3445
3446         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
3447         (WebCore::IDBServer::UniqueIDBDatabase::getRecord):
3448         (WebCore::IDBServer::UniqueIDBDatabase::performGetRecord):
3449         * Modules/indexeddb/server/UniqueIDBDatabase.h:
3450
3451         * Modules/indexeddb/shared/IDBGetRecordData.cpp:
3452         (WebCore::IDBGetRecordData::isolatedCopy):
3453         * Modules/indexeddb/shared/IDBGetRecordData.h:
3454         (WebCore::IDBGetRecordData::encode):
3455         (WebCore::IDBGetRecordData::decode):
3456
3457 2016-12-01  Joseph Pecoraro  <pecoraro@apple.com>
3458
3459         Misc. cleanup in Modules/fetch
3460         https://bugs.webkit.org/show_bug.cgi?id=165240
3461
3462         Reviewed by Darin Adler.
3463
3464         * Modules/fetch/DOMWindowFetch.h:
3465         * Modules/fetch/FetchBody.cpp:
3466         * Modules/fetch/FetchBody.h:
3467         * Modules/fetch/FetchBodyConsumer.cpp:
3468         * Modules/fetch/FetchBodyOwner.cpp:
3469         * Modules/fetch/FetchBodyOwner.h:
3470         * Modules/fetch/FetchInternals.js:
3471         (consumeStream):
3472         * Modules/fetch/FetchLoader.cpp:
3473         * Modules/fetch/FetchResponse.h:
3474         Remove unnecessary includes and forward declarations.
3475
3476         * Modules/fetch/DOMWindowFetch.js:
3477         (fetch):
3478         * Modules/fetch/FetchResponse.js:
3479         (initializeFetchResponse):