Refactor binding generated casted-this checks
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2016-10-08  Youenn Fablet  <youenn@apple.com>
2
3         Refactor binding generated casted-this checks
4         https://bugs.webkit.org/show_bug.cgi?id=162677
5
6         Reviewed by Darin Adler.
7
8         No change of behavior.
9
10         Split the attribute getter function in two, one with the signature expected by JSCore and one used after casted-this checks.
11
12         The second function takes directly a JSXX object and returns a JSValue instead of an EncodedJSValue.
13         In the future, the second function should only take references.
14
15         Introducing BindingCaller as a way to templatize binding code used to cast thisValue with the desired JSXX value.
16         This allows implementing the first function using the second function as template parameter.
17
18         Introducing JSClass::castForAttribute as a way to encapsulate differences in the way to handle thisValue access.
19
20         * bindings/js/JSDOMBinding.h:
21         (WebCore::BindingCaller::attribute):
22         * bindings/scripts/CodeGeneratorJS.pm:
23         (GenerateHeader):
24         (GenerateImplementation):
25         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
26         * bindings/scripts/test/JS/JSTestActiveDOMObject.h:
27         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
28         * bindings/scripts/test/JS/JSTestEventConstructor.h:
29         * bindings/scripts/test/JS/JSTestException.cpp:
30         * bindings/scripts/test/JS/JSTestException.h:
31         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
32         * bindings/scripts/test/JS/JSTestInterface.cpp:
33         * bindings/scripts/test/JS/JSTestInterface.h:
34         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
35         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.h:
36         * bindings/scripts/test/JS/JSTestNode.cpp:
37         * bindings/scripts/test/JS/JSTestNode.h:
38         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
39         * bindings/scripts/test/JS/JSTestNondeterministic.h:
40         * bindings/scripts/test/JS/JSTestObj.cpp:
41         * bindings/scripts/test/JS/JSTestObj.h:
42         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
43         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
44         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
45         * bindings/scripts/test/JS/JSTestTypedefs.h:
46         * bindings/scripts/test/JS/JSattribute.cpp:
47         * bindings/scripts/test/JS/JSattribute.h:
48
49 2016-10-08  Enrique Ocaña González  <eocanha@igalia.com>
50
51         Missing include in MediaDescription
52         https://bugs.webkit.org/show_bug.cgi?id=162873
53
54         Reviewed by Xabier Rodriguez-Calvar.
55
56         Added missing header.
57
58         * platform/MediaDescription.h:
59
60 2016-10-08  Antti Koivisto  <antti@apple.com>
61
62         Move StyleResolver ownership from Document/ShadowRoot to Style::Scope
63         https://bugs.webkit.org/show_bug.cgi?id=163148
64
65         Reviewed by Andreas Kling.
66
67         Reduce duplication between Document and ShadowRoot.
68
69         * css/CSSComputedStyleDeclaration.cpp:
70         (WebCore::ComputedStyleExtractor::propertyValue):
71         * css/CSSStyleSheet.cpp:
72         (WebCore::CSSStyleSheet::didMutateRules):
73         * css/ElementRuleCollector.cpp:
74         (WebCore::ElementRuleCollector::matchHostPseudoClassRules):
75         (WebCore::ElementRuleCollector::matchSlottedPseudoElementRules):
76         * css/MediaQueryMatcher.cpp:
77         (WebCore::MediaQueryMatcher::documentElementUserAgentStyle):
78         * css/StyleMedia.cpp:
79         (WebCore::StyleMedia::matchMedium):
80         * css/parser/SizesAttributeParser.cpp:
81         (WebCore::SizesAttributeParser::mediaConditionMatches):
82         * dom/Document.cpp:
83         (WebCore::Document::~Document):
84         (WebCore::Document::childrenChanged):
85         (WebCore::Document::isPageBoxVisible):
86         (WebCore::Document::pageSizeAndMarginsInPixels):
87         (WebCore::Document::userAgentShadowTreeStyleResolver):
88         (WebCore::Document::fontsNeedUpdate):
89         (WebCore::Document::didClearStyleResolver):
90         (WebCore::Document::updateViewportUnitsOnResize):
91         (WebCore::Document::createStyleResolver): Deleted.
92         (WebCore::Document::clearStyleResolver): Deleted.
93         * dom/Document.h:
94         (WebCore::Document::styleResolverIfExists): Deleted.
95         (WebCore::Document::ensureStyleResolver): Deleted.
96         * dom/Element.cpp:
97         (WebCore::Element::styleResolver):
98         * dom/ShadowRoot.cpp:
99         (WebCore::ShadowRoot::styleResolver): Deleted.
100         (WebCore::ShadowRoot::styleResolverIfExists): Deleted.
101         (WebCore::ShadowRoot::resetStyleResolver): Deleted.
102         * dom/ShadowRoot.h:
103         * page/DOMWindow.cpp:
104         (WebCore::DOMWindow::getMatchedCSSRules):
105         * page/FrameView.cpp:
106         (WebCore::FrameView::layout):
107         * page/Page.cpp:
108         (WebCore::Page::updateStyleForAllPagesAfterGlobalChangeInEnvironment):
109         * page/PrintContext.cpp:
110         (WebCore::PrintContext::pageProperty):
111         * platform/MemoryPressureHandler.cpp:
112         (WebCore::MemoryPressureHandler::releaseCriticalMemory):
113         * style/AttributeChangeInvalidation.cpp:
114         (WebCore::Style::mayBeAffectedByHostStyle):
115         * style/ClassChangeInvalidation.cpp:
116         (WebCore::Style::mayBeAffectedByHostStyle):
117         * style/IdChangeInvalidation.cpp:
118         (WebCore::Style::mayBeAffectedByHostStyle):
119         * style/StyleScope.cpp:
120         (WebCore::Style::Scope::resolver):
121         (WebCore::Style::Scope::resolverIfExists):
122         (WebCore::Style::Scope::clearResolver):
123         (WebCore::Style::Scope::analyzeStyleSheetChange):
124         (WebCore::Style::Scope::updateActiveStyleSheets):
125         (WebCore::Style::Scope::updateStyleResolver):
126         (WebCore::Style::Scope::styleResolver): Deleted.
127         (WebCore::Style::Scope::styleResolverIfExists): Deleted.
128         * style/StyleScope.h:
129         * style/StyleSharingResolver.cpp:
130         (WebCore::Style::SharingResolver::resolve):
131         (WebCore::Style::SharingResolver::canShareStyleWithElement):
132         * style/StyleTreeResolver.cpp:
133         (WebCore::Style::TreeResolver::Scope::Scope):
134         (WebCore::Style::TreeResolver::resolve):
135
136 2016-10-07  Chris Dumez  <cdumez@apple.com>
137
138         window.navigator.language incorrectly returns all lowercase string
139         https://bugs.webkit.org/show_bug.cgi?id=163096
140
141         Reviewed by Darin Adler.
142
143         Update navigator.language so that it no longer returns an all lowercase
144         string (e.g. 'en-us' -> 'en-US'). This matches the behavior of other
145         browsers and the specification which indicate we should return a
146         BCP 47 language tag:
147         - https://html.spec.whatwg.org/#dom-navigator-language
148         - https://tools.ietf.org/html/bcp47
149
150         The other call sites relying on userPreferredLanguages() use case
151         insensitive comparison so they will not break.
152
153         No new tests, updated existing test.
154
155         * platform/Language.h:
156
157 2016-10-07  Wenson Hsieh  <wenson_hsieh@apple.com>
158
159         Support onbeforeinput event handling for the new InputEvent spec
160         https://bugs.webkit.org/show_bug.cgi?id=163021
161         <rdar://problem/28658073>
162
163         Reviewed by Darin Adler.
164
165         Adds support for parsing the onbeforeinput attribute, and for sending default-preventable
166         `beforeinput` InputEvents to the page. To do this, we introduce two new virtual methods:
167         willApplyCommand and didApplyCommand on the CompositeEditCommand that are called before and
168         after CompositeEditCommand::doApply, respectively. willApplyCommand indicates whether or not
169         the composite editor command should proceed with applying the command.
170
171         Tweaks existing layout tests and adds new tests.
172
173         Tests: fast/events/before-input-events-different-start-end-elements.html
174                fast/events/before-input-events-prevent-default-in-textfield.html
175                fast/events/before-input-events-prevent-default.html
176
177         * dom/Document.idl:
178         * dom/Element.idl:
179         * dom/EventNames.h:
180         * dom/Node.cpp:
181         (WebCore::Node::dispatchInputEvent):
182         (WebCore::Node::defaultEventHandler):
183
184         Currently, we fire input events in Node in response to dispatching a webkitEditableContentChangedEvent. After
185         some discussion, Ryosuke and I believe that it will be ok to instead directly dispatch the input event where we
186         would normally dispatch a webkitEditableContentChangedEvent.
187
188         * editing/CompositeEditCommand.cpp:
189         (WebCore::EditCommandComposition::unapply):
190         (WebCore::EditCommandComposition::reapply):
191
192         Added calls to Editor::willUnapplyEditing and Editor::willReapplyEditing.
193
194         (WebCore::CompositeEditCommand::willApplyCommand):
195         (WebCore::CompositeEditCommand::apply):
196         (WebCore::CompositeEditCommand::didApplyCommand):
197
198         Added new virtual functions, willApplyCommand and didApplyCommand, that surround a call to
199         CompositeEditCommand::doApply. By default, they call willApplyEditing and appliedEditing on the editor, but may
200         be overridden in special cases, such as in TypingCommand, where we invoke appliedEditing after adding a new
201         typing command to the last open command.
202
203         If willApplyCommand returns false, CompositeEditCommand::apply will bail and not proceed with the command.
204
205         * editing/CompositeEditCommand.h:
206         * editing/Editor.cpp:
207         (WebCore::dispatchBeforeInputEvent):
208         (WebCore::dispatchBeforeInputEvents):
209         (WebCore::dispatchInputEvents):
210         (WebCore::Editor::willApplyEditing):
211         (WebCore::Editor::appliedEditing):
212         (WebCore::Editor::willUnapplyEditing):
213         (WebCore::Editor::unappliedEditing):
214         (WebCore::Editor::willReapplyEditing):
215         (WebCore::Editor::reappliedEditing):
216         (WebCore::Editor::computeAndSetTypingStyle):
217         (WebCore::dispatchEditableContentChangedEvents): Deleted.
218         * editing/Editor.h:
219         * editing/TypingCommand.cpp:
220         (WebCore::TypingCommand::willApplyCommand):
221         (WebCore::TypingCommand::didApplyCommand):
222         (WebCore::TypingCommand::willAddTypingToOpenCommand):
223         (WebCore::TypingCommand::insertTextRunWithoutNewlines):
224         (WebCore::TypingCommand::insertLineBreak):
225         (WebCore::TypingCommand::insertParagraphSeparator):
226         (WebCore::TypingCommand::insertParagraphSeparatorInQuotedContent):
227         (WebCore::TypingCommand::deleteKeyPressed):
228         (WebCore::TypingCommand::forwardDeleteKeyPressed):
229         (WebCore::TypingCommand::deleteSelection):
230
231         These now invoke willAddTypingToOpenCommand before proceeding with creating the command and applying it. The
232         flow is now:
233             - willAddTypingToOpenCommand
234             - create and apply a new command
235             - typingAddedToOpenCommand
236
237         * editing/TypingCommand.h:
238         (WebCore::TypingCommand::preservesTypingStyle): Deleted.
239         (WebCore::TypingCommand::shouldRetainAutocorrectionIndicator): Deleted.
240         (WebCore::TypingCommand::setShouldRetainAutocorrectionIndicator): Deleted.
241         (WebCore::TypingCommand::shouldStopCaretBlinking): Deleted.
242         * html/HTMLAttributeNames.in:
243         * html/HTMLElement.cpp:
244         (WebCore::HTMLElement::createEventHandlerNameMap):
245
246 2016-10-07  Nan Wang  <n_wang@apple.com>
247
248         AX: <figcaption> should be AXTitleUIElement for other content inside the <figure>
249         https://bugs.webkit.org/show_bug.cgi?id=108996
250
251         Reviewed by Chris Fleizach.
252
253         Exposed the figcaption element to be the AXTitleUIElement for the figure element. And used
254         the figcaption's content as the accessible name of the figure. Also, updated the figure element's
255         role description on Mac.
256         Accessible name and description calculation for figure elements: 
257         https://w3c.github.io/html-aam/#figure-and-figcaption-elements
258
259         Test: accessibility/mac/figure-element.html
260
261         * English.lproj/Localizable.strings:
262         * accessibility/AccessibilityNodeObject.cpp:
263         (WebCore::AccessibilityNodeObject::captionForFigure):
264         (WebCore::AccessibilityNodeObject::alternativeText):
265         * accessibility/AccessibilityNodeObject.h:
266         * accessibility/AccessibilityObject.cpp:
267         (WebCore::AccessibilityObject::isFigure):
268         (WebCore::AccessibilityObject::isSuperscriptStyleGroup): Deleted.
269         * accessibility/AccessibilityObject.h:
270         * accessibility/AccessibilityRenderObject.cpp:
271         (WebCore::AccessibilityRenderObject::exposesTitleUIElement):
272         (WebCore::AccessibilityRenderObject::titleUIElement):
273         (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored):
274         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
275         (-[WebAccessibilityObjectWrapper roleDescription]):
276         * platform/LocalizedStrings.cpp:
277         (WebCore::AXFigureText):
278         * platform/LocalizedStrings.h:
279         * platform/efl/LocalizedStringsEfl.cpp:
280         (WebCore::AXFigureText):
281         * platform/gtk/LocalizedStringsGtk.cpp:
282         (WebCore::AXFigureText):
283
284 2016-10-07  Alex Christensen  <achristensen@webkit.org>
285
286         Non-special URL fragments should percent-encode non-ASCII characters
287         https://bugs.webkit.org/show_bug.cgi?id=163153
288
289         Reviewed by Tim Horton.
290
291         This is needed to keep compatibility with data URLs with non-ASCII characters after a '#'
292         which works in Chrome, Firefox, and Safari, while maintaining compatibility with Chrome, IE, and Edge
293         which keep non-ASCII characters in the fragments of special URLs.
294         This was proposed to the spec in https://github.com/whatwg/url/issues/150
295
296         Covered by new API tests.
297
298         * platform/URLParser.cpp:
299         (WebCore::URLParser::syntaxViolation):
300         Removed assertion because we now have fragments that need percent encoding but are all ASCII.
301         (WebCore::URLParser::fragmentSyntaxViolation):
302         (WebCore::URLParser::parse):
303
304 2016-10-07  Brent Fulgham  <bfulgham@apple.com>
305
306         EventHandler functions that need to guarantee event handler lifetime need to use Ref<Frame>
307         https://bugs.webkit.org/show_bug.cgi?id=98617
308         <rdar://problem/12778649>
309
310         Reviewed by Daniel Bates.
311
312         Improve stability by ensuring that the Frame holding an active EventHandler is kept
313         alive while in the process of handling events and executing JavaScript.
314
315         No new tests since there is no change in behavior.
316
317         * page/EventHandler.cpp:
318         (WebCore::EventHandler::handleMousePressEventSingleClick): Protect the Frame with a Ref<>.
319         (WebCore::EventHandler::handleMousePressEvent): Ditto.
320         (WebCore::EventHandler::handleMouseDraggedEvent): Ditto.
321         (WebCore::EventHandler::eventMayStartDrag): Ditto.
322         (WebCore::EventHandler::handleMouseReleaseEvent): Ditto.
323         (WebCore::EventHandler::hitTestResultAtPoint): Ditto.
324         (WebCore::EventHandler::scrollRecursively): Ditto.
325         (WebCore::EventHandler::logicalScrollRecursively): Ditto.
326         (WebCore::EventHandler::selectCursor): Ditto.
327         (WebCore::EventHandler::handleMouseDoubleClickEvent): Ditto.
328         (WebCore::EventHandler::mouseMoved): Ditto.
329         (WebCore::EventHandler::handleMouseMoveEvent): Ditto.
330         (WebCore::EventHandler::handleMouseForceEvent): Ditto.
331         (WebCore::EventHandler::dispatchDragEvent): Ditto.
332         (WebCore::EventHandler::updateDragAndDrop): Ditto.
333         (WebCore::EventHandler::cancelDragAndDrop): Ditto.
334         (WebCore::EventHandler::performDragAndDrop): Ditto.
335         (WebCore::EventHandler::prepareMouseEvent): Ditto.
336         (WebCore::EventHandler::updateMouseEventTargetNode): Ditto.
337         (WebCore::EventHandler::dispatchMouseEvent): Ditto.
338         (WebCore::EventHandler::platformCompleteWheelEvent): Ditto.
339         (WebCore::EventHandler::handleWheelEvent): Ditto.
340         (WebCore::EventHandler::defaultWheelEventHandler): Ditto.
341         (WebCore::EventHandler::sendContextMenuEvent): Ditto.
342         (WebCore::EventHandler::sendContextMenuEventForKey): Ditto.
343         (WebCore::EventHandler::hoverTimerFired): Ditto.
344         (WebCore::EventHandler::keyEvent): Ditto.
345         (WebCore::EventHandler::defaultKeyboardEventHandler): Ditto.
346         (WebCore::EventHandler::handleDrag): Ditto.
347         (WebCore::EventHandler::handleTextInputEvent): Ditto.
348         (WebCore::EventHandler::defaultSpaceEventHandler): Ditto.
349         (WebCore::EventHandler::defaultTabEventHandler): Ditto.
350         (WebCore::EventHandler::sendScrollEvent): Ditto.
351         (WebCore::EventHandler::handleTouchEvent): Ditto.
352         * page/ios/EventHandlerIOS.mm:
353         (WebCore::EventHandler::focusDocumentView): Ditto.
354         * page/mac/EventHandlerMac.mm:
355         (WebCore::EventHandler::platformCompleteWheelEvent): Ditto.
356
357 2016-10-07  Chris Dumez  <cdumez@apple.com>
358
359         Regression(r201970): productSub / vendor / vendorSub should not be exposed on WorkerNavigator
360         https://bugs.webkit.org/show_bug.cgi?id=163124
361
362         Reviewed by Ryosuke Niwa.
363
364         productSub / vendor / vendorSub should not be exposed on WorkerNavigator:
365         - https://html.spec.whatwg.org/#navigatorid
366
367         Test case:
368         - http://w3c-test.org/submissions/3881/html/webappapis/system-state-and-capabilities/the-navigator-object/NavigatorID.worker
369
370         Note that the specification also restricts NavigatorID's appCodeName and
371         product attributes to Window. However, it seems the HTML specification is
372         about to get updated so that these get exposed to workers:
373         - https://github.com/whatwg/html/pull/1870
374
375         No new tests, updated existing test.
376
377         * bindings/scripts/generate-bindings.pl:
378         (shouldPropertyBeExposed):
379         * page/NavigatorID.idl:
380
381 2016-10-07  Alex Christensen  <achristensen@webkit.org>
382
383         Disable URLParser logs by default in all builds
384         https://bugs.webkit.org/show_bug.cgi?id=163135
385
386         Reviewed by Brady Eidson.
387
388         In debug builds with the URLParser enabled, some tests time out because
389         parameters to generate log strings are being evaluated for each character of each URL
390         and then not being used if URLParser logs are disabled.  Generating these unused parameters
391         is too slow even for debug builds.  Let's only generate them if they are to be used.
392
393         No change in behaviour.
394
395         * platform/URLParser.cpp:
396         (WebCore::URLParser::parse):
397         (WebCore::URLParser::allValuesEqual):
398
399 2016-10-07  Andreas Kling  <akling@apple.com>
400
401         [WK2] didRemoveFrameFromHierarchy callback doesn't fire for subframes when evicting from PageCache.
402         <https://webkit.org/b/163098>
403         <rdar://problem/28663488>
404
405         Reviewed by Antti Koivisto.
406
407         Fix a bug where WK2 didRemoveFrameFromHierarchy callbacks wouldn't fire for subframes that were getting
408         kicked out of PageCache. The problem was happening because CachedFrame would disconnect the Frame from
409         its Page just before calling FrameLoader::detachViewsAndDocumentLoader() where the callbacks are fired.
410         Without a Page, the WebFrame on WK2 side can't find its WebPage, and so it can't fire its callbacks.
411
412         The fix is just to switch the order of those two lines.
413
414         This bug was causing frequent DOM and window object leaks in some clients *cough* Safari *cough* that
415         were relying on didRemoveFrameFromHierarchy to release their isolated worlds.
416
417         Test: WebKit2.DidRemoveFrameFromHiearchyInPageCache
418
419         * history/CachedFrame.cpp:
420         (WebCore::CachedFrame::destroy):
421
422 2016-10-07  Nan Wang  <n_wang@apple.com>
423
424         AX: AXRoleDescription for details and summary elements
425         https://bugs.webkit.org/show_bug.cgi?id=163094
426
427         Reviewed by Chris Fleizach.
428
429         details and summary elements should have AXRoleDescription that is consistent with other
430         elements that have custom AXSubRole.
431
432         Test: accessibility/mac/details-summary-role-description.html
433
434         * English.lproj/Localizable.strings:
435         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
436         (-[WebAccessibilityObjectWrapper roleDescription]):
437         * platform/LocalizedStrings.cpp:
438         (WebCore::AXDetailsText):
439         (WebCore::AXSummaryText):
440         * platform/LocalizedStrings.h:
441         * platform/efl/LocalizedStringsEfl.cpp:
442         (WebCore::AXDetailsText):
443         (WebCore::AXSummaryText):
444         * platform/gtk/LocalizedStringsGtk.cpp:
445         (WebCore::AXDetailsText):
446         (WebCore::AXSummaryText):
447
448 2016-10-07  Ryan Haddad  <ryanhaddad@apple.com>
449
450         Fix the Windows build after r206917.
451
452         Unreviewed build fix.
453
454         * dom/DOMAllInOne.cpp:
455
456 2016-10-07  Antti Koivisto  <antti@apple.com>
457
458         Rename AuthorStyleSheets to Style::Scope
459         https://bugs.webkit.org/show_bug.cgi?id=163108
460
461         Reviewed by Andreas Kling.
462
463         It represents the style scope in DOM.
464         Also move the file under style/.
465
466         * CMakeLists.txt:
467         * WebCore.xcodeproj/project.pbxproj:
468         * css/CSSStyleSheet.cpp:
469         (WebCore::CSSStyleSheet::styleSheetScope):
470         * css/CSSStyleSheet.h:
471         * css/InspectorCSSOMWrappers.cpp:
472         (WebCore::InspectorCSSOMWrappers::getWrapperForRuleInSheets):
473         * css/InspectorCSSOMWrappers.h:
474         * css/StyleSheetList.cpp:
475         (WebCore::StyleSheetList::styleSheets):
476         (WebCore::StyleSheetList::detachFromDocument):
477         * dom/AuthorStyleSheets.cpp: Removed.
478         * dom/AuthorStyleSheets.h: Removed.
479         * dom/Document.cpp:
480         (WebCore::Document::Document):
481         (WebCore::Document::setContentLanguage):
482         (WebCore::Document::recalcStyle):
483         (WebCore::Document::needsStyleRecalc):
484         (WebCore::Document::updateStyleIfNeeded):
485         (WebCore::Document::updateLayoutIgnorePendingStylesheets):
486         (WebCore::Document::createStyleResolver):
487         (WebCore::Document::didRemoveAllPendingStylesheet):
488         (WebCore::Document::usesStyleBasedEditability):
489         (WebCore::Document::processHttpEquiv):
490         (WebCore::Document::preferredStylesheetSet):
491         (WebCore::Document::selectedStylesheetSet):
492         (WebCore::Document::setSelectedStylesheetSet):
493         (WebCore::Document::haveStylesheetsLoaded):
494         * dom/Document.h:
495         (WebCore::Document::styleScope):
496         (WebCore::Document::authorStyleSheets): Deleted.
497         * dom/ExtensionStyleSheets.cpp:
498         (WebCore::ExtensionStyleSheets::clearPageUserSheet):
499         (WebCore::ExtensionStyleSheets::updatePageUserSheet):
500         (WebCore::ExtensionStyleSheets::invalidateInjectedStyleSheetCache):
501         (WebCore::ExtensionStyleSheets::addUserStyleSheet):
502         (WebCore::ExtensionStyleSheets::addAuthorStyleSheetForTesting):
503         (WebCore::ExtensionStyleSheets::styleResolverChangedTimerFired):
504         * dom/InlineStyleSheetOwner.cpp:
505         (WebCore::InlineStyleSheetOwner::insertedIntoDocument):
506         (WebCore::InlineStyleSheetOwner::removedFromDocument):
507         (WebCore::InlineStyleSheetOwner::clearDocumentData):
508         (WebCore::InlineStyleSheetOwner::createSheet):
509         (WebCore::InlineStyleSheetOwner::sheetLoaded):
510         (WebCore::InlineStyleSheetOwner::startLoadingDynamicSheet):
511         * dom/InlineStyleSheetOwner.h:
512         (WebCore::InlineStyleSheetOwner::styleScope):
513         (WebCore::InlineStyleSheetOwner::styleSheetScope): Deleted.
514         * dom/ProcessingInstruction.cpp:
515         (WebCore::ProcessingInstruction::~ProcessingInstruction):
516         (WebCore::ProcessingInstruction::checkStyleSheet):
517         (WebCore::ProcessingInstruction::sheetLoaded):
518         (WebCore::ProcessingInstruction::insertedInto):
519         (WebCore::ProcessingInstruction::removedFrom):
520         * dom/ShadowRoot.cpp:
521         (WebCore::ShadowRoot::styleResolver):
522         (WebCore::ShadowRoot::styleScope):
523         (WebCore::ShadowRoot::updateStyle):
524         (WebCore::ShadowRoot::authorStyleSheets): Deleted.
525         * dom/ShadowRoot.h:
526         * html/HTMLLinkElement.cpp:
527         (WebCore::HTMLLinkElement::~HTMLLinkElement):
528         (WebCore::HTMLLinkElement::setDisabledState):
529         (WebCore::HTMLLinkElement::parseAttribute):
530         (WebCore::HTMLLinkElement::process):
531         (WebCore::HTMLLinkElement::insertedInto):
532         (WebCore::HTMLLinkElement::removedFrom):
533         (WebCore::HTMLLinkElement::addPendingSheet):
534         (WebCore::HTMLLinkElement::removePendingSheet):
535         * html/HTMLStyleElement.cpp:
536         * inspector/InspectorCSSAgent.cpp:
537         (WebCore::InspectorCSSAgent::collectAllDocumentStyleSheets):
538         (WebCore::InspectorCSSAgent::forcePseudoState):
539         (WebCore::InspectorCSSAgent::buildObjectForRule):
540         (WebCore::InspectorCSSAgent::resetPseudoStates):
541         * inspector/InspectorPageAgent.cpp:
542         (WebCore::InspectorPageAgent::setEmulatedMedia):
543         * page/DOMWindow.cpp:
544         (WebCore::DOMWindow::getMatchedCSSRules):
545         * page/Frame.cpp:
546         (WebCore::Frame::setPrinting):
547         * page/FrameView.cpp:
548         (WebCore::FrameView::layout):
549         (WebCore::FrameView::setPagination):
550         (WebCore::FrameView::setViewportSizeForCSSViewportUnits):
551         * page/Page.cpp:
552         (WebCore::Page::setViewMode):
553         (WebCore::Page::setNeedsRecalcStyleInAllFrames):
554         (WebCore::Page::invalidateInjectedStyleSheetCacheInAllFrames):
555         * style/StyleScope.cpp: Copied from dom/AuthorStyleSheets.cpp.
556         (WebCore::Style::Scope::Scope):
557         (WebCore::Style::Scope::styleResolver):
558         (WebCore::Style::Scope::styleResolverIfExists):
559         (WebCore::Style::Scope::forNode):
560         (WebCore::Style::Scope::removePendingSheet):
561         (WebCore::Style::Scope::addStyleSheetCandidateNode):
562         (WebCore::Style::Scope::removeStyleSheetCandidateNode):
563         (WebCore::Style::Scope::collectActiveStyleSheets):
564         (WebCore::Style::Scope::analyzeStyleSheetChange):
565         (WebCore::Style::Scope::updateActiveStyleSheets):
566         (WebCore::Style::Scope::updateStyleResolver):
567         (WebCore::Style::Scope::activeStyleSheetsForInspector):
568         (WebCore::Style::Scope::activeStyleSheetsContains):
569         (WebCore::Style::Scope::flushPendingUpdate):
570         (WebCore::Style::Scope::clearPendingUpdate):
571         (WebCore::Style::Scope::scheduleActiveSetUpdate):
572         (WebCore::Style::Scope::didChangeCandidatesForActiveSet):
573         (WebCore::Style::Scope::didChangeContentsOrInterpretation):
574         (WebCore::Style::Scope::pendingUpdateTimerFired):
575         (WebCore::AuthorStyleSheets::AuthorStyleSheets): Deleted.
576         (WebCore::AuthorStyleSheets::styleResolver): Deleted.
577         (WebCore::AuthorStyleSheets::styleResolverIfExists): Deleted.
578         (WebCore::AuthorStyleSheets::forNode): Deleted.
579         (WebCore::AuthorStyleSheets::removePendingSheet): Deleted.
580         (WebCore::AuthorStyleSheets::addStyleSheetCandidateNode): Deleted.
581         (WebCore::AuthorStyleSheets::removeStyleSheetCandidateNode): Deleted.
582         (WebCore::AuthorStyleSheets::collectActiveStyleSheets): Deleted.
583         (WebCore::AuthorStyleSheets::analyzeStyleSheetChange): Deleted.
584         (WebCore::AuthorStyleSheets::updateActiveStyleSheets): Deleted.
585         (WebCore::AuthorStyleSheets::updateStyleResolver): Deleted.
586         (WebCore::AuthorStyleSheets::activeStyleSheetsForInspector): Deleted.
587         (WebCore::AuthorStyleSheets::activeStyleSheetsContains): Deleted.
588         (WebCore::AuthorStyleSheets::flushPendingUpdate): Deleted.
589         (WebCore::AuthorStyleSheets::clearPendingUpdate): Deleted.
590         (WebCore::AuthorStyleSheets::scheduleActiveSetUpdate): Deleted.
591         (WebCore::AuthorStyleSheets::didChangeCandidatesForActiveSet): Deleted.
592         (WebCore::AuthorStyleSheets::didChangeContentsOrInterpretation): Deleted.
593         (WebCore::AuthorStyleSheets::pendingUpdateTimerFired): Deleted.
594         * style/StyleScope.h: Copied from dom/AuthorStyleSheets.h.
595         * style/StyleTreeResolver.cpp:
596         * svg/SVGFontFaceElement.cpp:
597         (WebCore::SVGFontFaceElement::rebuildFontFace):
598         (WebCore::SVGFontFaceElement::removedFrom):
599         * xml/XMLTreeViewer.cpp:
600         (WebCore::XMLTreeViewer::transformDocumentToTreeView):
601         * xml/parser/XMLDocumentParser.cpp:
602         (WebCore::XMLDocumentParser::end):
603         * xml/parser/XMLDocumentParserLibxml2.cpp:
604         (WebCore::XMLDocumentParser::doEnd):
605
606 2016-10-07  Zalan Bujtas  <zalan@apple.com>
607
608         https://vuldb.com/?cvssv3.2012 takes long time to load.
609         https://bugs.webkit.org/show_bug.cgi?id=162994
610         <rdar://problem/28593746>
611
612         Reviewed by Darin Adler.
613
614         Stop visiting cousins when we hit the style sharing search threshold.
615
616         In addition to mistakenly ignoring the threshold at SharingResolver::findSibling(), we
617         continued on searching for cousin elements. 
618
619         Test: fast/selectors/slow-style-sharing-with-long-cousin-list.html
620
621         * style/StyleSharingResolver.cpp:
622         (WebCore::Style::SharingResolver::resolve):
623         (WebCore::Style::SharingResolver::findSibling):
624         (WebCore::Style::SharingResolver::locateCousinList):
625
626 2016-10-07  Romain Bellessort  <romain.bellessort@crf.canon.fr>
627
628         [Readable Streams API] Implement generic reader functions
629         https://bugs.webkit.org/show_bug.cgi?id=163003
630
631         Reviewed by Darin Adler.
632
633         Implements reader generic functions defined by spec in order to prepare BYOBReader integration.
634         Generic functions factorize some code that is used by both DefaultReader and BYOBReader.
635
636         No change in behaviour.
637
638         * Modules/streams/ReadableStreamDefaultReader.js:
639         (cancel): Rely on readableStreamReaderGenericCancel.
640         (releaseLock): Rely on readableStreamReaderGenericRelease.
641         * Modules/streams/ReadableStreamInternals.js:
642         (privateInitializeReadableStreamDefaultReader): Rely on readableStreamReaderGenericInitialize.
643         (readableStreamReaderGenericInitialize): Added.
644         (readableStreamReaderGenericCancel): Added.
645         (readableStreamReaderGenericRelease): Added.
646
647 2016-10-07  Adam Bergkvist  <adam.bergkvist@ericsson.com>
648
649         WebRTC: Misc gardening: Use typedefs consistently and remove unused code
650         https://bugs.webkit.org/show_bug.cgi?id=163104
651
652         Reviewed by Philippe Normand.
653
654         Miscellaneous WebRTC gardening. See file list below for details.
655
656         Testing: No change in behavior.
657
658         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
659         * Modules/mediastream/MediaEndpointPeerConnection.h:
660         Move NotImplemented include to cpp-file.
661         * platform/mediastream/MediaEndpoint.h:
662         Use MediaPayloadVector typedef (instead of Vector<RefPtr<MediaPayload>>).
663         * platform/mediastream/PeerMediaDescription.h:
664         (WebCore::PeerMediaDescription::source): Deleted.
665         (WebCore::PeerMediaDescription::setSource): Deleted.
666         Sources are passed to updateSendConfiguration() via a source map and not added to each
667         PeerMediaDescription anymore. Remove unused code.
668         * platform/mock/MockMediaEndpoint.cpp:
669         (WebCore::MockMediaEndpoint::getDefaultAudioPayloads):
670         (WebCore::MockMediaEndpoint::getDefaultVideoPayloads):
671         Use MediaPayloadVector typedef.
672         * platform/mock/MockMediaEndpoint.h:
673         Use MediaPayloadVector typedef.
674
675 2016-10-07  Gwang Yoon Hwang  <yoon@igalia.com>
676
677         [GTK] Remove unneeded creation of TextureMapperPlatformLayerProxy
678         https://bugs.webkit.org/show_bug.cgi?id=163101
679
680         Reviewed by Žan Doberšek.
681
682         Covered by existing tests.
683
684         * platform/graphics/cairo/ImageBufferCairo.cpp:
685         (WebCore::ImageBufferData::ImageBufferData): Modified not to create
686         TextureMapperPlatformLayerProxy if it is not created for the
687         accelerated 2d canvas.
688
689 2016-10-07  Fujii Hironori  <Hironori.Fujii@sony.com>
690
691         Use 'use lib $FindBin::Bin' to append Perl module include path
692         https://bugs.webkit.org/show_bug.cgi?id=162256
693
694         Reviewed by Carlos Garcia Campos.
695
696         Some Perl  scripts are needed to  be executed with '-I'  switch to
697         explicitly append Perl module include path.  Use 'use lib' as well
698         as other Perl scripts do.
699
700         * CMakeLists.txt: Removed '-I' options from invocation of Perl.
701         * DerivedSources.make: Ditto.
702         * bindings/scripts/generate-bindings.pl: Use 'use lib'.
703         * bindings/scripts/preprocess-idls.pl: Ditto.
704         * css/make-css-file-arrays.pl: Ditto.
705         * css/makegrammar.pl: Ditto.
706         * css/makeprop.pl: Ditto.
707         * css/makevalues.pl: Ditto.
708         * dom/make_dom_exceptions.pl: Ditto.
709         * dom/make_event_factory.pl: Ditto.
710         * dom/make_names.pl: Ditto.
711         * page/make_settings.pl: Ditto.
712
713 2016-10-07  Youenn Fablet  <youenn@apple.com>
714
715         Refactor CachedResourceClient::notifyFinished
716         https://bugs.webkit.org/show_bug.cgi?id=162060
717
718         Reviewed by Darin Adler.
719
720         No change of behavior.
721
722         Making CachedResourceClient and CachedRawResourceClient callbacks take CachedResource references and not pointers.
723         In most cases, the CachedResource parameter is only used for assertions.
724         Removing that parameter might be contemplated in the future.
725         The only real case is in RenderImage.
726
727         Removed the CachedResource parameter from ContentFilter methods as code was calling these methods with null values.
728
729         * dom/LoadableClassicScript.cpp:
730         (WebCore::LoadableClassicScript::notifyFinished):
731         * dom/LoadableClassicScript.h:
732         * html/HTMLImageLoader.cpp:
733         (WebCore::HTMLImageLoader::notifyFinished):
734         * html/HTMLImageLoader.h:
735         * loader/ContentFilter.cpp:
736         (WebCore::ContentFilter::continueAfterResponseReceived):
737         (WebCore::ContentFilter::continueAfterDataReceived):
738         (WebCore::ContentFilter::continueAfterNotifyFinished):
739         (WebCore::ContentFilter::deliverResourceData):
740         * loader/ContentFilter.h:
741         * loader/CrossOriginPreflightChecker.cpp:
742         (WebCore::CrossOriginPreflightChecker::notifyFinished):
743         * loader/CrossOriginPreflightChecker.h:
744         * loader/DocumentLoader.cpp:
745         (WebCore::DocumentLoader::notifyFinished):
746         (WebCore::DocumentLoader::handleSubstituteDataLoadNow):
747         (WebCore::DocumentLoader::redirectReceived):
748         (WebCore::DocumentLoader::responseReceived):
749         (WebCore::DocumentLoader::continueAfterContentPolicy):
750         (WebCore::DocumentLoader::dataReceived):
751         * loader/DocumentLoader.h:
752         * loader/DocumentThreadableLoader.cpp:
753         (WebCore::DocumentThreadableLoader::redirectReceived):
754         (WebCore::DocumentThreadableLoader::dataSent):
755         (WebCore::DocumentThreadableLoader::responseReceived):
756         (WebCore::DocumentThreadableLoader::dataReceived):
757         (WebCore::DocumentThreadableLoader::notifyFinished):
758         * loader/DocumentThreadableLoader.h:
759         * loader/ImageLoader.cpp:
760         (WebCore::ImageLoader::notifyFinished):
761         * loader/ImageLoader.h:
762         * loader/LinkLoader.cpp:
763         (WebCore::LinkLoader::triggerEvents):
764         (WebCore::LinkLoader::notifyFinished):
765         * loader/LinkLoader.h:
766         * loader/LinkPreloadResourceClients.cpp:
767         (WebCore::LinkPreloadResourceClient::triggerEvents):
768         * loader/LinkPreloadResourceClients.h:
769         * loader/MediaResourceLoader.cpp:
770         (WebCore::MediaResource::responseReceived):
771         (WebCore::MediaResource::shouldCacheResponse):
772         (WebCore::MediaResource::redirectReceived):
773         (WebCore::MediaResource::dataSent):
774         (WebCore::MediaResource::dataReceived):
775         (WebCore::MediaResource::notifyFinished):
776         (WebCore::MediaResource::getOrCreateReadBuffer):
777         * loader/MediaResourceLoader.h:
778         * loader/TextTrackLoader.cpp:
779         (WebCore::TextTrackLoader::processNewCueData):
780         (WebCore::TextTrackLoader::deprecatedDidReceiveCachedResource):
781         (WebCore::TextTrackLoader::notifyFinished):
782         * loader/TextTrackLoader.h:
783         * loader/cache/CachedRawResource.cpp:
784         (WebCore::CachedRawResource::notifyClientsDataWasReceived):
785         (WebCore::CachedRawResource::didAddClient):
786         (WebCore::CachedRawResource::redirectReceived):
787         (WebCore::CachedRawResource::responseReceived):
788         (WebCore::CachedRawResource::shouldCacheResponse):
789         (WebCore::CachedRawResource::didSendData):
790         * loader/cache/CachedRawResourceClient.h:
791         (WebCore::CachedRawResourceClient::dataSent):
792         (WebCore::CachedRawResourceClient::responseReceived):
793         (WebCore::CachedRawResourceClient::shouldCacheResponse):
794         (WebCore::CachedRawResourceClient::dataReceived):
795         (WebCore::CachedRawResourceClient::redirectReceived):
796         (WebCore::CachedRawResourceClient::getOrCreateReadBuffer):
797         * loader/cache/CachedResource.cpp:
798         (WebCore::CachedResource::checkNotify):
799         (WebCore::CachedResource::didAddClient):
800         * loader/cache/CachedResourceClient.h:
801         (WebCore::CachedResourceClient::notifyFinished):
802         (WebCore::CachedResourceClient::deprecatedDidReceiveCachedResource):
803         * loader/cache/CachedTextTrack.cpp:
804         (WebCore::CachedTextTrack::updateData):
805         * loader/icon/IconLoader.cpp:
806         (WebCore::IconLoader::notifyFinished):
807         * loader/icon/IconLoader.h:
808         * loader/soup/CachedRawResourceSoup.cpp:
809         * platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp:
810         (WebCore::WebCoreAVCFResourceLoader::responseReceived):
811         (WebCore::WebCoreAVCFResourceLoader::dataReceived):
812         (WebCore::WebCoreAVCFResourceLoader::notifyFinished):
813         (WebCore::WebCoreAVCFResourceLoader::fulfillRequestWithResource):
814         * platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.h:
815         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.h:
816         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
817         (WebCore::WebCoreAVFResourceLoader::responseReceived):
818         (WebCore::WebCoreAVFResourceLoader::dataReceived):
819         (WebCore::WebCoreAVFResourceLoader::notifyFinished):
820         (WebCore::WebCoreAVFResourceLoader::fulfillRequestWithResource):
821         * rendering/RenderImage.cpp:
822         (WebCore::RenderImage::notifyFinished):
823         * rendering/RenderImage.h:
824         * rendering/RenderLayerFilterInfo.cpp:
825         (WebCore::RenderLayer::FilterInfo::setRenderer):
826         (WebCore::RenderLayer::FilterInfo::notifyFinished):
827         * rendering/RenderLayerFilterInfo.h:
828         * svg/SVGFEImageElement.cpp:
829         (WebCore::SVGFEImageElement::notifyFinished):
830         * svg/SVGFEImageElement.h:
831         * svg/SVGUseElement.cpp:
832         (WebCore::SVGUseElement::notifyFinished):
833         * svg/SVGUseElement.h:
834         * xml/parser/XMLDocumentParser.cpp:
835         (WebCore::XMLDocumentParser::notifyFinished):
836         * xml/parser/XMLDocumentParser.h:
837
838 2016-10-06  Youenn Fablet  <youenn@apple.com>
839
840         CachedXSLStylesheet does not need to be updated according Origin/Fetch mode
841         https://bugs.webkit.org/show_bug.cgi?id=162389
842
843         Reviewed by Darin Adler.
844
845         No change of behavior.
846
847         Making clear that there is no reason to update cached XSLT resources according the origin, given that CORS is never checked and loading is always same-origin.
848
849         Renaming CachedResource::isClean to CachedResource::isCORSSameOrigin to better match spec terminology.
850         Updating HTMLLinkElement accordingly.
851
852         * html/HTMLLinkElement.cpp:
853         (WebCore::HTMLLinkElement::initializeStyleSheet):
854         * loader/cache/CachedResource.cpp:
855         (WebCore::CachedResource::isCORSSameOrigin): Ensuring that this method is not called for resource types for which CORS is not to be used.
856         (WebCore::CachedResource::isClean): Deleted.
857         * loader/cache/CachedResource.h:
858         * loader/cache/CachedResourceLoader.cpp:
859         (WebCore::CachedResourceLoader::shouldUpdateCachedResourceWithCurrentRequest):
860
861 2016-10-06  Youenn Fablet  <youenn@apple.com>
862
863         Add a place for common HTTP Header values
864         https://bugs.webkit.org/show_bug.cgi?id=163002
865
866         Reviewed by Alex Christensen.
867
868         No change of behavior.
869
870         Introducing HTTPHeaderValues with two Content-Type values.
871
872         * CMakeLists.txt:
873         * Modules/fetch/FetchBody.cpp:
874         (WebCore::FetchBody::extract):
875         * WebCore.xcodeproj/project.pbxproj:
876         * platform/network/HTTPHeaderValues.cpp: Added.
877         (WebCore::HTTPHeaderValues::TextPlainContentType):
878         (WebCore::HTTPHeaderValues::FormURLEncodedContentType):
879         * platform/network/HTTPHeaderValues.h: Added.
880         * xml/XMLHttpRequest.cpp:
881         (WebCore::XMLHttpRequest::send):
882
883 2016-10-06  Youenn Fablet  <youenn@apple.com>
884
885         CachedResourceRequest should not need to store defer and preload options
886         https://bugs.webkit.org/show_bug.cgi?id=163004
887
888         Reviewed by Alex Christensen.
889
890         No change of behavior.
891
892         Removing CachedResourceRequest defer and preload fields.
893         These fields are computed inside CachedResourceLoader instead.
894
895         Updated setting of priority from CachedResourceRequest to CachedResource.
896         Priority is set for any new resource (this covers all cases where no cached resource can be reused from the memory cache).
897         Priority is set for a cached resource if the request is not a preload request.
898
899         * loader/LinkLoader.cpp:
900         (WebCore::LinkLoader::preloadIfNeeded):
901         * loader/cache/CachedResource.cpp:
902         (WebCore::CachedResource::CachedResource):
903         * loader/cache/CachedResourceLoader.cpp:
904         (WebCore::CachedResourceLoader::requestImage):
905         (WebCore::CachedResourceLoader::canRequest):
906         (WebCore::CachedResourceLoader::requestResource):
907         (WebCore::CachedResourceLoader::determineRevalidationPolicy):
908         (WebCore::CachedResourceLoader::requestPreload):
909         * loader/cache/CachedResourceLoader.h:
910         * loader/cache/CachedResourceRequest.cpp:
911         (WebCore::CachedResourceRequest::CachedResourceRequest):
912         * loader/cache/CachedResourceRequest.h:
913         (WebCore::CachedResourceRequest::priority):
914         (WebCore::CachedResourceRequest::forPreload): Deleted.
915         (WebCore::CachedResourceRequest::setForPreload): Deleted.
916         (WebCore::CachedResourceRequest::defer): Deleted.
917         (WebCore::CachedResourceRequest::setDefer): Deleted.
918
919 2016-10-06  Myles C. Maxfield  <mmaxfield@apple.com>
920
921         Variation fonts don't affect glyph advances
922         https://bugs.webkit.org/show_bug.cgi?id=163093
923
924         Reviewed by Darin Adler.
925
926         Work around known bug <rdar://problem/28662086>. For variation fonts,
927         CTFontGetAdvancesForGlyphs() gives correct answers but
928         CTFontGetUnsummedAdvancesForGlyphsAndStyle() doesn't.
929
930         Test: fast/text/variations/advances.html
931
932         * platform/graphics/FontPlatformData.h:
933         (WebCore::FontPlatformData::hasVariations):
934         * platform/graphics/cocoa/FontCocoa.mm:
935         (WebCore::Font::platformWidthForGlyph):
936         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
937         (WebCore::FontPlatformData::FontPlatformData):
938
939 2016-10-06  Commit Queue  <commit-queue@webkit.org>
940
941         Unreviewed, rolling out r206713.
942         https://bugs.webkit.org/show_bug.cgi?id=163097
943
944         triggers apparent codegen bug on ARM 32-bit (Requested by smfr
945         on #webkit).
946
947         Reverted changeset:
948
949         "Support transitions/animations of background-position with
950         right/bottom-relative values"
951         https://bugs.webkit.org/show_bug.cgi?id=162048
952         http://trac.webkit.org/changeset/206713
953
954 2016-10-06  Daniel Bates  <dabates@apple.com>
955
956         Remove unused WebCore::contentDispositionType()
957         https://bugs.webkit.org/show_bug.cgi?id=163095
958
959         Reviewed by Alex Christensen.
960
961         The function WebCore::contentDispositionType() was only used by the Chromium and Qt ports
962         to parse the Content-Disposition HTTP header. Both of these ports have long since been
963         removed from the repository. We should remove WebCore::contentDispositionType().
964
965         * platform/network/HTTPParsers.cpp:
966         (WebCore::contentDispositionType): Deleted.
967         * platform/network/HTTPParsers.h:
968
969 2016-10-06  Ryosuke Niwa  <rniwa@webkit.org>
970
971         Upgrading and constructing element should always report exception instead of rethrowing
972         https://bugs.webkit.org/show_bug.cgi?id=162996
973
974         Reviewed by Darin Adler.
975
976         The latest HTML specification specifies that we must report exceptions thrown during element upgrades:
977         https://html.spec.whatwg.org/#upgrades
978
979         In addition, F2F during 2016 TPAC had a consensus that we should do the same for document.createElement:
980         https://github.com/w3c/webcomponents/issues/569
981
982         Since the HTML parser already reports the exception thrown during custom element construction as it does
983         not have any JS stack, these changes make exceptions thrown during upgrades and constructions.
984
985         In our implementation, this only reduces the code complexity as now we can push the logic to fallback
986         to HTMLUnknownElement into JSCustomElementInterface's constructElement, which has been renamed
987         to constructElementWithFallback, and eliminate ShouldClearException enum class entirely. Moreover,
988         constructElementWithFallback can now return Ref instead of RefPtr.
989
990         No new tests. Existing tests have been updated.
991
992         * bindings/js/JSCustomElementInterface.cpp:
993         (WebCore::JSCustomElementInterface::constructElementWithFallback): Create a HTMLUnknownElement if
994         an attempt to construct a custom element had failed in lieu of returning nullptr.
995         (WebCore::JSCustomElementInterface::tryToConstructCustomElement): Renamed from constructElement.
996         Always report exceptions (the same behavior as ShouldClearException::Clear).
997         (WebCore::JSCustomElementInterface::upgradeElement): Report exceptions instead of rethrowing.
998         * bindings/js/JSCustomElementInterface.h:
999         * dom/Document.cpp:
1000         (WebCore::createHTMLElementWithNameValidation):
1001         * html/parser/HTMLDocumentParser.cpp:
1002         (WebCore::HTMLDocumentParser::runScriptsForPausedTreeBuilder):
1003
1004 2016-10-06  Chris Dumez  <cdumez@apple.com>
1005
1006         Overwriting an attribute event listener can lead to wrong event listener firing order
1007         https://bugs.webkit.org/show_bug.cgi?id=163083
1008
1009         Reviewed by Darin Adler.
1010
1011         Overwriting an attribute event listener could lead to wrong event listener
1012         firing order in WebKit. This is because we were removing the old event
1013         listener and then appending the new one instead of actually *replacing*
1014         the old one.
1015
1016         No new tests, rebaselined existing tests.
1017
1018         * dom/EventListenerMap.cpp:
1019         (WebCore::EventListenerMap::replace):
1020         * dom/EventListenerMap.h:
1021         * dom/EventTarget.cpp:
1022         (WebCore::EventTarget::setAttributeEventListener):
1023         (WebCore::EventTarget::hasActiveEventListeners): Deleted.
1024         (WebCore::EventTarget::dispatchEventForBindings): Deleted.
1025         * dom/EventTarget.h:
1026
1027 2016-10-06  Alex Christensen  <achristensen@webkit.org>
1028
1029         URLParser: Non-ASCII characters in Non-UTF-8 encoded queries of relative URLs with ws, wss, or nonspecial schemes should be UTF-8 encoded
1030         https://bugs.webkit.org/show_bug.cgi?id=163089
1031
1032         Reviewed by Tim Horton.
1033
1034         This is a change similar to r206818 but with relative URLs.
1035         This matches the spec, URL::parse, and other browsers' behavior.
1036         Covered by new API tests for URLParser.
1037         This also fixes tests like http/tests/misc/url-in-utf32le.html when URLParser is enabled.
1038
1039         * platform/URL.cpp:
1040         (WebCore::URL::URL):
1041         Use the same encoding for the URL constructor whether or not the URLParser is enabled.
1042         * platform/URLParser.cpp:
1043         (WebCore::URLParser::copyURLPartsUntil):
1044         (WebCore::URLParser::parse):
1045         (WebCore::isSpecial): Deleted.
1046         * platform/URLParser.h:
1047         Use UTF-8 for non-special, ws, or wss schemes.
1048
1049 2016-10-06  Zalan Bujtas  <zalan@apple.com>
1050
1051         Add back ASSERT(!needsLayout) to RenderTableSection which is now valid
1052         https://bugs.webkit.org/show_bug.cgi?id=92954
1053         <rdar://problem/12147973>
1054
1055         Reviewed by Dan Bernstein.
1056
1057         LayoutTests pass fine now with this assert on.
1058
1059         Covered by existing tests.
1060
1061         * rendering/RenderTableSection.cpp:
1062         (WebCore::RenderTableSection::paint):
1063
1064 2016-10-06  Jiewen Tan  <jiewen_tan@apple.com>
1065
1066         Add a dummy SubtleCrypto interface
1067         https://bugs.webkit.org/show_bug.cgi?id=162992
1068         <rdar://problem/28643573>
1069
1070         Reviewed by Brent Fulgham.
1071
1072         Add a dummy SubtleCrypto interface and rename KeyPair to CryptoKeyPair.
1073
1074         Tests: crypto/subtle/gc-2.html
1075                crypto/subtle/gc-3.html
1076                crypto/subtle/gc.html
1077                crypto/webkitSubtle/aes-cbc-192-encrypt-decrypt.html
1078                crypto/webkitSubtle/aes-cbc-256-encrypt-decrypt.html
1079                crypto/webkitSubtle/aes-cbc-encrypt-decrypt-with-padding.html
1080                crypto/webkitSubtle/aes-cbc-encrypt-decrypt.html
1081                crypto/webkitSubtle/aes-cbc-generate-key.html
1082                crypto/webkitSubtle/aes-cbc-import-jwk.html
1083                crypto/webkitSubtle/aes-cbc-invalid-length.html
1084                crypto/webkitSubtle/aes-cbc-unwrap-failure.html
1085                crypto/webkitSubtle/aes-cbc-unwrap-rsa.html
1086                crypto/webkitSubtle/aes-cbc-wrap-rsa-non-extractable.html
1087                crypto/webkitSubtle/aes-cbc-wrap-rsa.html
1088                crypto/webkitSubtle/aes-cbc-wrong-key-class.html
1089                crypto/webkitSubtle/aes-export-key.html
1090                crypto/webkitSubtle/aes-kw-key-manipulation.html
1091                crypto/webkitSubtle/aes-kw-wrap-unwrap-aes.html
1092                crypto/webkitSubtle/aes-postMessage.html
1093                crypto/webkitSubtle/argument-conversion.html
1094                crypto/webkitSubtle/array-buffer-view-offset.html
1095                crypto/webkitSubtle/crypto-key-algorithm-gc.html
1096                crypto/webkitSubtle/crypto-key-usages-gc.html
1097                crypto/webkitSubtle/hmac-check-algorithm.html
1098                crypto/webkitSubtle/hmac-export-key.html
1099                crypto/webkitSubtle/hmac-generate-key.html
1100                crypto/webkitSubtle/hmac-import-jwk.html
1101                crypto/webkitSubtle/hmac-postMessage.html
1102                crypto/webkitSubtle/hmac-sign-verify-empty-key.html
1103                crypto/webkitSubtle/hmac-sign-verify.html
1104                crypto/webkitSubtle/import-jwk.html
1105                crypto/webkitSubtle/jwk-export-use-values.html
1106                crypto/webkitSubtle/jwk-import-use-values.html
1107                crypto/webkitSubtle/rsa-export-generated-keys.html
1108                crypto/webkitSubtle/rsa-export-key.html
1109                crypto/webkitSubtle/rsa-export-private-key.html
1110                crypto/webkitSubtle/rsa-indexeddb-non-exportable-private.html
1111                crypto/webkitSubtle/rsa-indexeddb-non-exportable.html
1112                crypto/webkitSubtle/rsa-indexeddb-private.html
1113                crypto/webkitSubtle/rsa-indexeddb.html
1114                crypto/webkitSubtle/rsa-oaep-generate-non-extractable-key.html
1115                crypto/webkitSubtle/rsa-oaep-key-manipulation.html
1116                crypto/webkitSubtle/rsa-oaep-plaintext-length.html
1117                crypto/webkitSubtle/rsa-oaep-wrap-unwrap-aes.html
1118                crypto/webkitSubtle/rsa-postMessage.html
1119                crypto/webkitSubtle/rsaes-pkcs1-v1_5-decrypt.html
1120                crypto/webkitSubtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes.html
1121                crypto/webkitSubtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent.html
1122                crypto/webkitSubtle/rsassa-pkcs1-v1_5-generate-key.html
1123                crypto/webkitSubtle/rsassa-pkcs1-v1_5-import-jwk-small-key.html
1124                crypto/webkitSubtle/rsassa-pkcs1-v1_5-import-jwk.html
1125                crypto/webkitSubtle/rsassa-pkcs1-v1_5-sign-verify.html
1126                crypto/webkitSubtle/sha-1.html
1127                crypto/webkitSubtle/sha-224.html
1128                crypto/webkitSubtle/sha-256.html
1129                crypto/webkitSubtle/sha-384.html
1130                crypto/webkitSubtle/sha-512.html
1131                crypto/webkitSubtle/unimplemented-unwrap-crash.html
1132                crypto/webkitSubtle/unwrapKey-check-usage.html
1133                crypto/webkitSubtle/wrapKey-check-usage.html
1134                crypto/workers/subtle/aes-postMessage-worker.html
1135                crypto/workers/subtle/gc-worker.html
1136                crypto/workers/subtle/hmac-postMessage-worker.html
1137                crypto/workers/subtle/hrsa-postMessage-worker.html
1138                crypto/workers/subtle/multiple-postMessage-worker.html
1139                crypto/workers/subtle/rsa-postMessage-worker.html
1140
1141         * CMakeLists.txt:
1142         * DerivedSources.cpp:
1143         * DerivedSources.make:
1144         * PlatformEfl.cmake:
1145         * PlatformGTK.cmake:
1146         * PlatformMac.cmake:
1147         * WebCore.xcodeproj/project.pbxproj:
1148         * crypto/CryptoKeyPair.idl:
1149         * crypto/SubtleCrypto.cpp:
1150         (WebCore::SubtleCrypto::SubtleCrypto):
1151         * crypto/SubtleCrypto.h:
1152         (WebCore::SubtleCrypto::create):
1153         * crypto/SubtleCrypto.idl: Added.
1154         * page/Crypto.cpp:
1155         (WebCore::Crypto::Crypto):
1156         (WebCore::Crypto::subtle):
1157         * page/Crypto.h:
1158         * page/Crypto.idl:
1159
1160 2016-10-06  Anders Carlsson  <andersca@apple.com>
1161
1162         Crash when ApplePaySession.completeMerchantValidation is not passed a dictionary
1163         https://bugs.webkit.org/show_bug.cgi?id=163074
1164         rdar://problem/27824842
1165
1166         Reviewed by Tim Horton.
1167
1168         Raise a type error on a null initializer object.
1169
1170         * Modules/applepay/ApplePaySession.cpp:
1171         (WebCore::ApplePaySession::completeMerchantValidation):
1172
1173 2016-10-06  Antti Koivisto  <antti@apple.com>
1174
1175         Mutating styleSheet in shadow tree doesn't update the style
1176         https://bugs.webkit.org/show_bug.cgi?id=162744
1177         <rdar://problem/28550588>
1178
1179         Reviewed by Ryosuke Niwa.
1180
1181         We weren't always invalidating the right AuthorStyleSheets (to be renamed) instance
1182         for the scope after mutations.
1183
1184         Test: fast/shadow-dom/mutating-stylesheet-in-shadow-tree.html
1185
1186         * css/CSSStyleSheet.cpp:
1187         (WebCore::CSSStyleSheet::didMutateRules):
1188         (WebCore::CSSStyleSheet::didMutate):
1189         (WebCore::CSSStyleSheet::clearOwnerNode):
1190         (WebCore::CSSStyleSheet::rootStyleSheet):
1191         (WebCore::CSSStyleSheet::ownerDocument):
1192         (WebCore::CSSStyleSheet::styleSheetScope):
1193
1194             Invalidate the right scope after stylesheet mutations.
1195
1196         * css/CSSStyleSheet.h:
1197         * dom/AuthorStyleSheets.cpp:
1198         (WebCore::AuthorStyleSheets::styleResolver):
1199         (WebCore::AuthorStyleSheets::styleResolverIfExists):
1200
1201             Take care to update the right style resolver.
1202
1203         (WebCore::AuthorStyleSheets::forNode):
1204         (WebCore::AuthorStyleSheets::removeStyleSheetCandidateNode):
1205
1206             Start the update timer so clients don't need to request update separately.
1207
1208         (WebCore::AuthorStyleSheets::analyzeStyleSheetChange):
1209         (WebCore::AuthorStyleSheets::updateActiveStyleSheets):
1210         (WebCore::AuthorStyleSheets::updateStyleResolver):
1211         * dom/AuthorStyleSheets.h:
1212         * dom/InlineStyleSheetOwner.cpp:
1213         (WebCore::InlineStyleSheetOwner::insertedIntoDocument):
1214
1215             Save the scope we were inserted into so removals can be done reliably.
1216
1217         (WebCore::InlineStyleSheetOwner::removedFromDocument):
1218
1219             Use and clear the saved scope.
1220             Remove didChangeCandidatesForActiveSet() as it is now done by removeStyleSheetCandidateNode() call.
1221
1222         (WebCore::InlineStyleSheetOwner::clearDocumentData):
1223         (WebCore::InlineStyleSheetOwner::createSheet):
1224         (WebCore::InlineStyleSheetOwner::sheetLoaded):
1225         (WebCore::InlineStyleSheetOwner::startLoadingDynamicSheet):
1226         (WebCore::authorStyleSheetsForElement): Deleted.
1227         * dom/InlineStyleSheetOwner.h:
1228         (WebCore::InlineStyleSheetOwner::styleSheetScope):
1229         * dom/ShadowRoot.cpp:
1230         (WebCore::ShadowRoot::styleResolverIfExists):
1231         * dom/ShadowRoot.h:
1232         * html/HTMLLinkElement.cpp:
1233         (WebCore::HTMLLinkElement::removedFrom):
1234
1235             Remove didChangeCandidatesForActiveSet() as it is now done by removeStyleSheetCandidateNode() call.
1236
1237         * html/HTMLStyleElement.cpp:
1238         (WebCore::HTMLStyleElement::~HTMLStyleElement):
1239         (WebCore::HTMLStyleElement::parseAttribute):
1240
1241             Fix a bug where we wouldn't create stylesheet if a style element was activated by removing a media attribute.
1242
1243         (WebCore::HTMLStyleElement::insertedInto):
1244         (WebCore::HTMLStyleElement::removedFrom):
1245         * page/DOMWindow.cpp:
1246         (WebCore::DOMWindow::getMatchedCSSRules):
1247         * svg/SVGStyleElement.cpp:
1248         (WebCore::SVGStyleElement::~SVGStyleElement):
1249         (WebCore::SVGStyleElement::insertedInto):
1250         (WebCore::SVGStyleElement::removedFrom):
1251
1252 2016-10-06  Alex Christensen  <achristensen@webkit.org>
1253
1254         Skip tabs and newlines between end of query and beginning of fragment in non-UTF-8-encoded URLs
1255         https://bugs.webkit.org/show_bug.cgi?id=163071
1256
1257         Reviewed by Tim Horton.
1258
1259         Covered by a new API test that would have asserted before this change.
1260
1261         * platform/URLParser.cpp:
1262         (WebCore::URLParser::encodeQuery):
1263         Skip tabs and newlines before asserting that we are at the end.
1264
1265 2016-10-06  Alex Christensen  <achristensen@webkit.org>
1266
1267         URLParser should parse file URLs with ports consistently
1268         https://bugs.webkit.org/show_bug.cgi?id=163075
1269
1270         Reviewed by Brady Eidson.
1271
1272         Covered by API tests.  We used to assert when parsing the newly tested URLs.
1273
1274         * platform/URLParser.cpp:
1275         (WebCore::URLParser::parse):
1276
1277 2016-10-06  Chris Dumez  <cdumez@apple.com>
1278
1279         [WebIDL] Add support for having dictionaries in their own IDL file
1280         https://bugs.webkit.org/show_bug.cgi?id=162912
1281
1282         Reviewed by Darin Adler.
1283
1284         Add support for having dictionaries in their own IDL file so that they
1285         can be shared by multiple interfaces.
1286
1287         Leverage this new support to merge Element::ScrollToOptions and
1288         DOMWindow::ScrollToOptions.
1289
1290         No new tests, extended bindings tests.
1291
1292         * CMakeLists.txt:
1293         * DerivedSources.cpp:
1294         * DerivedSources.make:
1295         * WebCore.xcodeproj/project.pbxproj:
1296         * bindings/scripts/CodeGenerator.pm:
1297         (ProcessDocument):
1298         (IDLFileForInterface):
1299         (GetDictionaryByName):
1300         (IsDictionaryType):
1301         (HasEnumImplementationNameOverride): Deleted.
1302         (GetEnumImplementationNameOverride): Deleted.
1303         * bindings/scripts/CodeGeneratorJS.pm:
1304         (GenerateDictionary):
1305         (GetEnumerationClassName):
1306         (GenerateEnumerationImplementationContent):
1307         (GenerateEnumerationHeaderContent):
1308         (GetDictionaryClassName):
1309         (GenerateDefaultValue):
1310         (GenerateDictionaryHeaderContent):
1311         (GenerateDictionariesHeaderContent):
1312         (GenerateDictionaryImplementationContent):
1313         (GenerateDictionariesImplementationContent):
1314         (GenerateHeader):
1315         (GenerateImplementation):
1316         (GenerateParametersCheck):
1317         (GenerateDictionaryHeader):
1318         (GenerateDictionaryImplementation):
1319         (GenerateCallbackHeader):
1320         (GenerateCallbackImplementation):
1321         (GetNativeType):
1322         (JSValueToNative):
1323         (GetNestedClassName): Deleted.
1324         (GenerateConversionRuleWithLeadingComma): Deleted.
1325         (addIterableProperties): Deleted.
1326         * bindings/scripts/preprocess-idls.pl:
1327         (containsInterfaceOrExceptionFromIDL):
1328         * bindings/scripts/test/JS/JSTestObj.cpp:
1329         (WebCore::jsTestObjPrototypeFunctionOperationWithExternalDictionaryParameter):
1330         (WebCore::jsTestObjPrototypeFunctionAttachShadowRoot): Deleted.
1331         * bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp: Added.
1332         (WebCore::convertDictionary<TestStandaloneDictionary>):
1333         * bindings/scripts/test/JS/JSTestStandaloneDictionary.h: Added.
1334         * bindings/scripts/test/TestObj.idl:
1335         * bindings/scripts/test/TestStandaloneDictionary.idl: Added.
1336         * dom/Element.h:
1337         * dom/Element.idl:
1338         * html/HTMLBodyElement.cpp:
1339         (WebCore::HTMLBodyElement::scrollTo):
1340         * page/DOMWindow.h:
1341         * page/DOMWindow.idl:
1342         * page/ScrollToOptions.h: Added.
1343         * page/ScrollToOptions.idl: Added.
1344
1345 2016-10-06  Brent Fulgham  <bfulgham@apple.com>
1346
1347         Unreviewed build fix.
1348
1349         * platform/graphics/Image.cpp: Add missing include
1350         for 'NotImplemented' when building under Direct2D.
1351
1352 2016-10-06  Brent Fulgham  <bfulgham@apple.com>
1353
1354         [Win][Direct2D] Add Direct2D CMake rules
1355         https://bugs.webkit.org/show_bug.cgi?id=162925
1356
1357         Reviewed by Brent Fulgham.
1358
1359         Modify PlatformAppleWin.cmake to conditionally build the CoreGraphics
1360         and CoreAnimation implementation, or the Direct2D files, depending
1361         on whether the USE_DIRECT2D macro is set in the CMake build options.
1362         By default it builds the normal CA/CG way.
1363
1364         Add a stub GraphicsLayer implementation for Direct2D.
1365
1366         No new tests because there is no change in our active ports.
1367
1368         * PlatformAppleWin.cmake: Conditionalize the build for CA/CG or
1369         Direct2D.
1370         * config.h: Make sure CA is turned of for Direct2D builds.
1371         * page/win/FrameWinDirect2D.cpp: Add missing include file.
1372         * platform/graphics/win/GraphicsLayerDirect2D.cpp: Added.
1373         * platform/graphics/win/GraphicsLayerDirect2D.h: Added.
1374
1375 2016-10-06  Yusuke Suzuki  <utatane.tea@gmail.com>
1376
1377         [WebCore][JSC] Use new @throwTypeError and @throwRangeError intrinsics
1378         https://bugs.webkit.org/show_bug.cgi?id=163001
1379
1380         Reviewed by Keith Miller.
1381
1382         Replace `throw new @XXXError(...)` to @throwXXXError intrinsic.
1383         It reduces the size of bytecode sequence and facilitate inlining.
1384
1385         No behavior change.
1386
1387         * Modules/fetch/FetchHeaders.js:
1388         (initializeFetchHeaders):
1389         * Modules/fetch/FetchInternals.js:
1390         (fillFetchHeaders):
1391         * Modules/fetch/FetchRequest.js:
1392         (initializeFetchRequest):
1393         * Modules/fetch/FetchResponse.js:
1394         (initializeFetchResponse):
1395         (clone):
1396         * Modules/mediastream/NavigatorUserMedia.js:
1397         (webkitGetUserMedia):
1398         * Modules/mediastream/RTCPeerConnection.js:
1399         (initializeRTCPeerConnection):
1400         (getLocalStreams):
1401         (getStreamById):
1402         (addStream):
1403         * Modules/streams/ReadableStream.js:
1404         (initializeReadableStream):
1405         (getReader):
1406         * Modules/streams/ReadableStreamDefaultController.js:
1407         (enqueue):
1408         (error):
1409         (close):
1410         * Modules/streams/ReadableStreamDefaultReader.js:
1411         (releaseLock):
1412         * Modules/streams/ReadableStreamInternals.js:
1413         (privateInitializeReadableStreamDefaultReader):
1414         (privateInitializeReadableStreamDefaultController):
1415         (doStructuredClone):
1416         (readableStreamError):
1417         * Modules/streams/StreamInternals.js:
1418         (validateAndNormalizeQueuingStrategy):
1419         (enqueueValueWithSize):
1420         * Modules/streams/WritableStream.js:
1421         (initializeWritableStream):
1422         (state):
1423         * xml/XMLHttpRequest.js:
1424         (response):
1425
1426 2016-10-06  John Wilander  <wilander@apple.com>
1427
1428         Update Resource Load Statistics
1429         https://bugs.webkit.org/show_bug.cgi?id=162811
1430
1431         Reviewed by Alex Christensen.
1432
1433         No new tests. The counting is based on top privately owned domains
1434         which currently is not supported by layout tests nor API tests.
1435
1436         * Modules/websockets/WebSocket.cpp:
1437         (WebCore::WebSocket::connect):
1438             Now captures statistics for web sockets too.
1439         * loader/FrameLoader.cpp:
1440         (WebCore::FrameLoader::loadResourceSynchronously):
1441         * loader/ResourceLoadObserver.cpp:
1442             Now captures statistics for synchronous XHR too.
1443         (WebCore::is3xxRedirect):
1444             Convenience function.
1445         (WebCore::ResourceLoadObserver::shouldLog):
1446             Convenience function.
1447         (WebCore::ResourceLoadObserver::logFrameNavigation):
1448             Updated to make use of new convenience functions.
1449         (WebCore::ResourceLoadObserver::logSubresourceLoading):
1450             Updated to make use of new convenience functions.
1451         (WebCore::ResourceLoadObserver::logWebSocketLoading):
1452             Added.
1453         (WebCore::ResourceLoadObserver::logUserInteraction):
1454             Updated to make use of new convenience functions.
1455         (WebCore::ResourceLoadObserver::primaryDomain):
1456             Now makes use of the Public Suffix list.
1457             Removed old custom parsing of primary domain.
1458         * loader/ResourceLoadObserver.h:
1459         * loader/ResourceLoadStatisticsStore.cpp:
1460         (WebCore::ResourceLoadStatisticsStore::prevalentResourceDomainsWithoutUserInteraction):
1461             Convenience function.
1462         (WebCore::ResourceLoadStatisticsStore::processStatistics): Deleted.
1463         * loader/ResourceLoadStatisticsStore.h:
1464         * loader/SubresourceLoader.cpp:
1465         (WebCore::SubresourceLoader::willSendRequestInternal):
1466             Moved logging call higher up and added a check for whether we
1467             are loading the main resource. The reason for moving it up is
1468             to capture the request before some data may be cleared out in
1469             redirect handling. We also want to capture failed CORS requests
1470             since they are sent and then cancelled on the way back.
1471
1472 2016-10-06  Adam Bergkvist  <adam.bergkvist@ericsson.com>
1473
1474         WebRTC: Add support for the iceconnectionstatechange event in MediaEndpointPeerConnection
1475         https://bugs.webkit.org/show_bug.cgi?id=162961
1476
1477         Reviewed by Eric Carlson.
1478
1479         Implement MediaEndpointPeerConnection's iceTransportStateChanged callback. When called, it
1480         updates the ICE transport state of the corresponding transceiver and determines if the
1481         RTCPeerConnection's aggregated iceConnectionState needs to be updated.
1482
1483         Update MediaEndpointMock's emulatePlatformEvent feature to support a new action:
1484         "step-ice-transport-states". When initiated, this action replays a predefined set of ICE
1485         transport state changes on a set of transceivers which can be observed via the
1486         iceTransportStateChanged (mentioned above).
1487
1488         Test: fast/mediastream/RTCPeerConnection-iceconnectionstatechange-event.html
1489
1490         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
1491         (WebCore::deriveAggregatedIceConnectionState):
1492         (WebCore::MediaEndpointPeerConnection::iceTransportStateChanged):
1493         * Modules/mediastream/MediaEndpointPeerConnection.h:
1494         * platform/mediastream/MediaEndpoint.h:
1495         (WebCore::MediaEndpointClient::~MediaEndpointClient):
1496         * platform/mock/MockMediaEndpoint.cpp:
1497         (WebCore::MockMediaEndpoint::MockMediaEndpoint):
1498         (WebCore::MockMediaEndpoint::emulatePlatformEvent):
1499         (WebCore::MockMediaEndpoint::stepIceTransportStates):
1500         (WebCore::MockMediaEndpoint::iceTransportTimerFired):
1501         * platform/mock/MockMediaEndpoint.h:
1502
1503 2016-10-06  Youenn Fablet  <youenn@apple.com>
1504
1505         CachedResource client handling methods should take reference
1506         https://bugs.webkit.org/show_bug.cgi?id=163014
1507
1508         Reviewed by Alex Christensen.
1509
1510         No change of behavior.
1511
1512         * bindings/js/CachedScriptSourceProvider.h:
1513         (WebCore::CachedScriptSourceProvider::~CachedScriptSourceProvider):
1514         (WebCore::CachedScriptSourceProvider::CachedScriptSourceProvider):
1515         * css/CSSCrossfadeValue.cpp:
1516         (WebCore::CSSCrossfadeValue::~CSSCrossfadeValue):
1517         (WebCore::CSSCrossfadeValue::loadSubimages):
1518         * css/CSSFilterImageValue.cpp:
1519         (WebCore::CSSFilterImageValue::~CSSFilterImageValue):
1520         (WebCore::CSSFilterImageValue::loadSubimages):
1521         * css/CSSFontFaceSource.cpp:
1522         (WebCore::CSSFontFaceSource::CSSFontFaceSource):
1523         (WebCore::CSSFontFaceSource::~CSSFontFaceSource):
1524         * css/StyleRuleImport.cpp:
1525         (WebCore::StyleRuleImport::~StyleRuleImport):
1526         (WebCore::StyleRuleImport::requestStyleSheet):
1527         * dom/DataTransfer.cpp:
1528         (WebCore::DragImageLoader::startLoading):
1529         (WebCore::DragImageLoader::stopLoading):
1530         * dom/LoadableClassicScript.cpp:
1531         (WebCore::LoadableClassicScript::create):
1532         (WebCore::LoadableClassicScript::~LoadableClassicScript):
1533         * dom/ProcessingInstruction.cpp:
1534         (WebCore::ProcessingInstruction::~ProcessingInstruction):
1535         (WebCore::ProcessingInstruction::checkStyleSheet):
1536         (WebCore::ProcessingInstruction::parseStyleSheet):
1537         * html/HTMLLinkElement.cpp:
1538         (WebCore::HTMLLinkElement::~HTMLLinkElement):
1539         (WebCore::HTMLLinkElement::process):
1540         * loader/CrossOriginPreflightChecker.cpp:
1541         (WebCore::CrossOriginPreflightChecker::~CrossOriginPreflightChecker):
1542         (WebCore::CrossOriginPreflightChecker::startPreflight):
1543         * loader/DocumentLoader.cpp:
1544         (WebCore::DocumentLoader::detachFromFrame):
1545         (WebCore::DocumentLoader::clearMainResource):
1546         (WebCore::DocumentLoader::becomeMainResourceClient):
1547         * loader/DocumentThreadableLoader.cpp:
1548         (WebCore::DocumentThreadableLoader::~DocumentThreadableLoader):
1549         (WebCore::DocumentThreadableLoader::clearResource):
1550         (WebCore::DocumentThreadableLoader::loadRequest):
1551         * loader/ImageLoader.cpp:
1552         (WebCore::ImageLoader::~ImageLoader):
1553         (WebCore::ImageLoader::clearImageWithoutConsideringPendingLoadEvent):
1554         (WebCore::ImageLoader::updateFromElement):
1555         (WebCore::ImageLoader::dispatchPendingBeforeLoadEvent):
1556         * loader/LinkLoader.cpp:
1557         (WebCore::LinkLoader::~LinkLoader):
1558         (WebCore::LinkLoader::notifyFinished):
1559         (WebCore::LinkLoader::loadLink):
1560         * loader/LinkPreloadResourceClients.h:
1561         (WebCore::LinkPreloadResourceClient::addResource):
1562         (WebCore::LinkPreloadResourceClient::clearResource):
1563         * loader/MediaResourceLoader.cpp:
1564         (WebCore::MediaResource::MediaResource):
1565         (WebCore::MediaResource::stop):
1566         * loader/TextTrackLoader.cpp:
1567         (WebCore::TextTrackLoader::~TextTrackLoader):
1568         (WebCore::TextTrackLoader::cancelLoad):
1569         (WebCore::TextTrackLoader::load):
1570         * loader/cache/CachedCSSStyleSheet.cpp:
1571         (WebCore::CachedCSSStyleSheet::didAddClient):
1572         * loader/cache/CachedCSSStyleSheet.h:
1573         * loader/cache/CachedFont.cpp:
1574         (WebCore::CachedFont::didAddClient):
1575         * loader/cache/CachedFont.h:
1576         * loader/cache/CachedImage.cpp:
1577         (WebCore::CachedImage::didAddClient):
1578         (WebCore::CachedImage::didRemoveClient):
1579         * loader/cache/CachedImage.h:
1580         * loader/cache/CachedRawResource.cpp:
1581         (WebCore::CachedRawResource::didAddClient):
1582         * loader/cache/CachedRawResource.h:
1583         * loader/cache/CachedResource.cpp:
1584         (WebCore::CachedResource::addClient):
1585         (WebCore::CachedResource::didAddClient):
1586         (WebCore::CachedResource::addClientToSet):
1587         (WebCore::CachedResource::removeClient):
1588         (WebCore::CachedResource::switchClientsToRevalidatedResource):
1589         (WebCore::CachedResource::Callback::timerFired):
1590         * loader/cache/CachedResource.h:
1591         (WebCore::CachedResource::hasClient):
1592         (WebCore::CachedResource::didRemoveClient):
1593         * loader/cache/CachedSVGDocumentReference.cpp:
1594         (WebCore::CachedSVGDocumentReference::~CachedSVGDocumentReference):
1595         (WebCore::CachedSVGDocumentReference::load):
1596         * loader/cache/CachedXSLStyleSheet.cpp:
1597         (WebCore::CachedXSLStyleSheet::didAddClient):
1598         * loader/cache/CachedXSLStyleSheet.h:
1599         * loader/cache/MemoryCache.cpp:
1600         (WebCore::MemoryCache::addImageToCache):
1601         (WebCore::MemoryCache::removeImageFromCache):
1602         * loader/icon/IconLoader.cpp:
1603         (WebCore::IconLoader::startLoading):
1604         (WebCore::IconLoader::stopLoading):
1605         * platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp:
1606         (WebCore::WebCoreAVCFResourceLoader::startLoading):
1607         (WebCore::WebCoreAVCFResourceLoader::stopLoading):
1608         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
1609         (WebCore::WebCoreAVFResourceLoader::startLoading):
1610         (WebCore::WebCoreAVFResourceLoader::stopLoading):
1611         * rendering/RenderImageResource.cpp:
1612         (WebCore::RenderImageResource::shutdown):
1613         (WebCore::RenderImageResource::setCachedImage):
1614         * rendering/RenderLayerFilterInfo.cpp:
1615         (WebCore::RenderLayer::FilterInfo::updateReferenceFilterClients):
1616         (WebCore::RenderLayer::FilterInfo::removeReferenceFilterClients):
1617         * rendering/style/StyleCachedImage.cpp:
1618         (WebCore::StyleCachedImage::addClient):
1619         (WebCore::StyleCachedImage::removeClient):
1620         * svg/SVGFEImageElement.cpp:
1621         (WebCore::SVGFEImageElement::clearResourceReferences):
1622         (WebCore::SVGFEImageElement::requestImageResource):
1623         * svg/SVGFontFaceUriElement.cpp:
1624         (WebCore::SVGFontFaceUriElement::~SVGFontFaceUriElement):
1625         (WebCore::SVGFontFaceUriElement::loadFont):
1626         * svg/SVGUseElement.cpp:
1627         (WebCore::SVGUseElement::~SVGUseElement):
1628         (WebCore::SVGUseElement::updateExternalDocument):
1629         * xml/XSLImportRule.cpp:
1630         (WebCore::XSLImportRule::~XSLImportRule):
1631         (WebCore::XSLImportRule::setXSLStyleSheet):
1632         (WebCore::XSLImportRule::loadSheet):
1633         * xml/parser/XMLDocumentParser.cpp:
1634         (WebCore::XMLDocumentParser::notifyFinished):
1635         * xml/parser/XMLDocumentParserLibxml2.cpp:
1636         (WebCore::XMLDocumentParser::~XMLDocumentParser):
1637         (WebCore::XMLDocumentParser::endElementNs):
1638
1639 2016-10-05  Philippe Normand  <pnormand@igalia.com>
1640
1641         [GStreamer][OWR] GL rendering support
1642         https://bugs.webkit.org/show_bug.cgi?id=162972
1643
1644         Reviewed by Žan Doberšek.
1645
1646         When GStreamer-GL is enabled the GL context needs to be properly passed
1647         to the GStreamer pipeline running within the OpenWebRTC video renderer.
1648         This is now supported using a new OpenWebRTC API that allows the
1649         renderer to request the context from the application using a callback
1650         registered within the renderer.
1651
1652         The player's GL context/display set-up was refactored to a new
1653         method, requestGLContext, which is used as callback for the
1654         OpenWebRTC request_context handler.
1655
1656         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1657         (WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage):
1658         (WebCore::MediaPlayerPrivateGStreamerBase::requestGLContext):
1659         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
1660         (WebCore::MediaPlayerPrivateGStreamerBase::gstGLContext):
1661         (WebCore::MediaPlayerPrivateGStreamerBase::gstGLDisplay):
1662         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.cpp:
1663         (WebCore::MediaPlayerPrivateGStreamerOwr::createVideoSink):
1664
1665 2016-10-06  Antoine Quint  <graouts@apple.com>
1666
1667         [Modern Media Controls] Icon service and the IconButton class
1668         https://bugs.webkit.org/show_bug.cgi?id=162970
1669         <rdar://problem/28631803>
1670
1671         Reviewed by Dean Jackson.
1672
1673         We introduce the new IconButton class to display buttons that show an icon
1674         in modern media controls. An IconButton uses a CSS mask-image to display the icon
1675         such that we may set the actual button color to any value by setting the element's
1676         background-color property.
1677
1678         Icons are obtained through the `iconService` singleton which knows how to load the
1679         right icon for the current layout traits and resolution. Icons loaded through the
1680         icon service are cached. In a later patch, we will be introducing functionality,
1681         through the MediaControlsHost, to load the icon from the WebCore bundle.
1682
1683         Tests: media/modern-media-controls/icon-button/icon-button-active-state.html
1684                media/modern-media-controls/icon-button/icon-button.html
1685                media/modern-media-controls/icon-service/icon-service.html
1686
1687         * Modules/modern-media-controls/controls/button.css:
1688         (button):
1689         * Modules/modern-media-controls/controls/icon-button.css: Copied from Source/WebCore/Modules/modern-media-controls/controls/button.css.
1690         (button.icon):
1691         (button.icon:active):
1692         * Modules/modern-media-controls/controls/icon-button.js: Added.
1693         (IconButton):
1694         (IconButton.prototype.get iconName):
1695         (IconButton.prototype.set iconName):
1696         (IconButton.prototype.handleEvent):
1697         (IconButton.prototype.layout):
1698         (IconButton.prototype._imageDidLoad):
1699         (IconButton.prototype._updateImage):
1700         * Modules/modern-media-controls/controls/icon-service.js: Copied from Source/WebCore/Modules/modern-media-controls/controls/layout-item.js.
1701         (const.iconService.new.IconService):
1702         (const.iconService.new.IconService.prototype.imageForIconNameAndLayoutTraits):
1703         (const.iconService.new.IconService.prototype.urlForIconNameAndLayoutTraits):
1704         * Modules/modern-media-controls/controls/layout-item.js:
1705         * Modules/modern-media-controls/images/iOS/pause@2x.png: Added.
1706         * Modules/modern-media-controls/images/iOS/pause@3x.png: Added.
1707         * Modules/modern-media-controls/images/iOS/start@2x.png: Added.
1708         * Modules/modern-media-controls/images/iOS/start@3x.png: Added.
1709         * Modules/modern-media-controls/images/macOS/pause-fullscreen@1x.png: Added.
1710         * Modules/modern-media-controls/images/macOS/pause-fullscreen@2x.png: Added.
1711         * Modules/modern-media-controls/images/macOS/pause@1x.png: Added.
1712         * Modules/modern-media-controls/images/macOS/pause@2x.png: Added.
1713         * Modules/modern-media-controls/images/macOS/start@1x.png: Added.
1714         * Modules/modern-media-controls/images/macOS/start@2x.png: Added.
1715
1716 2016-10-06  Miguel Gomez  <magomez@igalia.com>
1717
1718         [GTK] Fix build with GSTREAMER_GL enabled and ACCELERATED_2D_CANVAS disabled
1719         https://bugs.webkit.org/show_bug.cgi?id=163008
1720
1721         Reviewed by Carlos Garcia Campos.
1722
1723         Put functions using cairo-gl behind appropriate guards.
1724
1725         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1726         (WebCore::MediaPlayerPrivateGStreamerBase::paintToCairoSurface): Deleted.
1727         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
1728
1729 2016-10-06  Miguel Gomez  <magomez@igalia.com>
1730
1731         [GTK] Copying video textures to webgl should not depend on cairo-gl
1732         https://bugs.webkit.org/show_bug.cgi?id=162904
1733
1734         Reviewed by Žan Doberšek.
1735
1736         Perform the texture copy without using cairo-gl.
1737
1738         Covered by existent tests.
1739
1740         * platform/GStreamer.cmake:
1741         Add the new VideoTextureCopierGStreamer class to the build.
1742         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1743         (WebCore::MediaPlayerPrivateGStreamerBase::copyVideoTextureToPlatformTexture):
1744         Use VideoTextureCopierGStreamer to perform the copy.
1745         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
1746         Add a VideoTextureCopierGStreamer as a class attribute.
1747         * platform/graphics/gstreamer/VideoTextureCopierGStreamer.cpp: Added.
1748         (WebCore::VideoTextureCopierGStreamer::VideoTextureCopierGStreamer):
1749         (WebCore::VideoTextureCopierGStreamer::~VideoTextureCopierGStreamer):
1750         (WebCore::VideoTextureCopierGStreamer::updateTextureSpaceMatrix):
1751         Recalculates the matrix used as the texture coordinates transformation.
1752         (WebCore::VideoTextureCopierGStreamer::updateTransformationMatrix):
1753         Recalculates the matrices used as the vertices coordinates transformation.
1754         (WebCore::VideoTextureCopierGStreamer::copyVideoTextureToPlatformTexture):
1755         Performs the texture copy by using a shader that applies the rotation needed to follow
1756         the video orientation.
1757         * platform/graphics/gstreamer/VideoTextureCopierGStreamer.h: Added.
1758
1759 2016-10-06  Gwang Yoon Hwang  <yoon@igalia.com>
1760
1761         [GTK] Build fix for X11 and GStreamerGL after r183731
1762         https://bugs.webkit.org/show_bug.cgi?id=163000
1763
1764         Reviewed by Philippe Normand.
1765
1766         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1767         Include gstgldisplay_egl.h if platform uses EGL.
1768
1769 2016-10-06  Mario Sanchez Prada  <mario@endlessm.com>
1770
1771         [GStreamer] Can't play any video with GSTREAMER_GL enabled
1772         https://bugs.webkit.org/show_bug.cgi?id=162669
1773
1774         Reviewed by Philippe Normand.
1775
1776         Make sure an EGLDisplay type is passed when creating the GstGlDisplay
1777         for the EGL code path, instead of a native X11 display type, so
1778         that we get a valid GstGlDisplay as a result, not a dummy one.
1779
1780         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1781         (WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext):
1782
1783 2016-10-06  Youenn Fablet  <youenn@apple.com>
1784
1785         [Fetch API] Forbid redirection to non-HTTP(s) URL in non-navigation mode.
1786         https://bugs.webkit.org/show_bug.cgi?id=162785
1787
1788         Reviewed by Alex Christensen.
1789
1790         Covered by rebased and existing tests.
1791
1792         Ensuring non-HTTP redirection URLs are not followed at DocumentThreadableLoader level for fetch API only.
1793         This should be applied to all clients at some point, but there is still some uncertainty for data URLs.
1794
1795         Did some refactoring to better separate the case of security checks in case of regular request or redirected request.
1796         This allows in particular to handle more clearly the case of data URLs which are allowed in all modes for regular requests.
1797         But they are not allowed for same-origin redirected requests.
1798
1799         * WebCore.xcodeproj/project.pbxproj:
1800         * loader/DocumentThreadableLoader.cpp:
1801         (WebCore::reportRedirectionWithBadScheme): Reporting bad scheme redirection error.
1802         (WebCore::DocumentThreadableLoader::redirectReceived): Checking that redirection URLs are HTTP(s) in case of Fetch API.
1803         * loader/SubresourceLoader.cpp:
1804         (WebCore::SubresourceLoader::willSendRequestInternal):
1805         * loader/cache/CachedResourceLoader.cpp:
1806         (WebCore::CachedResourceLoader::requestImage):
1807         (WebCore::CachedResourceLoader::checkInsecureContent):
1808         (WebCore::CachedResourceLoader::allowedByContentSecurityPolicy):
1809         (WebCore::isSameOriginDataURL):
1810         (WebCore::CachedResourceLoader::canRequest):
1811         (WebCore::CachedResourceLoader::canRequestAfterRedirection):
1812         (WebCore::CachedResourceLoader::canRequestInContentDispositionAttachmentSandbox):
1813         (WebCore::CachedResourceLoader::requestResource):
1814         * loader/cache/CachedResourceLoader.h:
1815
1816 2016-10-06  Youenn Fablet  <youenn@apple.com>
1817
1818         [Fetch API] Use ReadableStream pull to transfer binary data to stream when application needs it
1819         https://bugs.webkit.org/show_bug.cgi?id=162892
1820
1821         Reviewed by Alex Christensen.
1822
1823         Covered by existing tests.
1824
1825         Before this patch, FetchResponse was never resolving the start promise.
1826         This way, it could enqueue data, error or close the stream whenever desired.
1827
1828         With this patch, FetchResponse will feed the stream when being asked to.
1829         This allows keeping the data in WebCore until the application needs it.
1830         This is only implemented for network data.
1831         For other data owned by response (blob, text...), data will be enqueued like previously as fast as possible.
1832
1833         Note that FetchResponse can enqueue/error/close the stream at any time since JSFetchResponse has a reference to the stream.
1834         And the stream has a reference to the controller.
1835
1836         In addition to transfer binary chunks to ReadableStream only when needed, WebCore is now aware of the data
1837         stored in the response, which may allow applying backpressure to the network source in the future.
1838
1839         * Modules/fetch/FetchResponse.cpp:
1840         (WebCore::FetchResponse::BodyLoader::didSucceed):
1841         (WebCore::FetchResponse::BodyLoader::didReceiveData): Enqueuing only if stream is pulling.
1842         Otherwise, storing in FetchBodyConsumer. If stream is pulling, we enqueue both buffered data and received chunk.
1843         (WebCore::FetchResponse::consumeBodyAsStream): Resolving pull promise if we enqueued some buffered data.
1844         (WebCore::FetchResponse::closeStream):
1845         (WebCore::FetchResponse::feedStream): If we have some buffered data, we enqueue it. If there is no loader, the stream can be closed.
1846         * Modules/fetch/FetchResponse.h:
1847         * Modules/fetch/FetchResponseSource.cpp:
1848         (WebCore::FetchResponseSource::doPull):
1849         (WebCore::FetchResponseSource::close):
1850         (WebCore::FetchResponseSource::error):
1851         * Modules/fetch/FetchResponseSource.h:
1852         * Modules/streams/ReadableStreamSource.h:
1853         (WebCore::ReadableStreamSource::isPulling): Renamed from isStarting.
1854         (WebCore::ReadableStreamSource::isStarting): Deleted.
1855
1856 2016-10-06  Adam Bergkvist  <adam.bergkvist@ericsson.com>
1857
1858         WebRTC: Add support for the icecandidate event in MediaEndpointPeerConnection
1859         https://bugs.webkit.org/show_bug.cgi?id=162957
1860
1861         Reviewed by Eric Carlson.
1862
1863         Implement MediaEndpointPeerConnection's gotIceCandidate and doneGatheringCandidates
1864         callbacks. These are used by the MediaEndpoint (WebRTC backend implementation) to
1865         notify about ICE events.
1866
1867         Add API to Internals to emulate WebRTC platform events, such as dispatching a set of ICE
1868         candidates followed by a gathering done indication. Initially, only a single action,
1869         "dispatch-fake-ice-candidates", is supported, but the intention is to extend the set of
1870         actions to support more test cases.
1871
1872         Test: fast/mediastream/RTCPeerConnection-icecandidate-event.html
1873
1874         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
1875         (WebCore::MediaEndpointPeerConnection::emulatePlatformEvent):
1876         (WebCore::MediaEndpointPeerConnection::gotIceCandidate):
1877         (WebCore::MediaEndpointPeerConnection::doneGatheringCandidates):
1878         * Modules/mediastream/MediaEndpointPeerConnection.h:
1879         * Modules/mediastream/PeerConnectionBackend.h:
1880         * Modules/mediastream/RTCIceTransport.h: Added.
1881         RTCIceCandidate will eventually be part of the JS API, but right now it's
1882         only used to keep track of the ICE states related to a RTCRtpTranscevier.
1883         (WebCore::RTCIceTransport::create):
1884         (WebCore::RTCIceTransport::~RTCIceTransport):
1885         (WebCore::RTCIceTransport::transportState):
1886         (WebCore::RTCIceTransport::setTransportState):
1887         (WebCore::RTCIceTransport::gatheringState):
1888         (WebCore::RTCIceTransport::setGatheringState):
1889         (WebCore::RTCIceTransport::RTCIceTransport):
1890         * Modules/mediastream/RTCPeerConnection.cpp:
1891         (WebCore::RTCPeerConnection::emulatePlatformEvent):
1892         * Modules/mediastream/RTCPeerConnection.h:
1893         * Modules/mediastream/RTCRtpTransceiver.cpp:
1894         (WebCore::RTCRtpTransceiver::RTCRtpTransceiver):
1895         * Modules/mediastream/RTCRtpTransceiver.h:
1896         (WebCore::RTCRtpTransceiver::iceTransport):
1897         * WebCore.xcodeproj/project.pbxproj:
1898         * platform/mediastream/MediaEndpoint.h:
1899         (WebCore::MediaEndpoint::emulatePlatformEvent):
1900         * platform/mediastream/PeerConnectionStates.h:
1901         * platform/mock/MockMediaEndpoint.cpp:
1902         (WebCore::MockMediaEndpoint::MockMediaEndpoint):
1903         (WebCore::MockMediaEndpoint::updateReceiveConfiguration):
1904         (WebCore::MockMediaEndpoint::emulatePlatformEvent):
1905         (WebCore::MockMediaEndpoint::dispatchFakeIceCandidates):
1906         (WebCore::MockMediaEndpoint::iceCandidateTimerFired):
1907         * platform/mock/MockMediaEndpoint.h:
1908         * testing/Internals.cpp:
1909         (WebCore::Internals::emulateRTCPeerConnectionPlatformEvent):
1910         Generic API to signal down to the WebRTC platform mock.
1911         * testing/Internals.h:
1912         * testing/Internals.idl:
1913
1914 2016-10-06  Nan Wang  <n_wang@apple.com>
1915
1916         AX:[Mac] Unable to edit text input, textarea fields in iframe using VO naivgation
1917         https://bugs.webkit.org/show_bug.cgi?id=162999
1918
1919         Reviewed by Chris Fleizach.
1920
1921         In WebKit1, the top web area setting the selection to an input element inside an iframe
1922         will make the input field not editable. The issue is that when the web area and the input element
1923         have different documents, the setSelection function in FrameSelection will set the selection on
1924         the input's frame and cause the caret to disappear. I fixed it by not setting the selection in such case.
1925
1926         Test: accessibility/mac/wk1-set-selected-text-marker-range-input-element.html
1927
1928         * accessibility/AccessibilityRenderObject.cpp:
1929         (WebCore::AccessibilityRenderObject::setSelectedVisiblePositionRange):
1930
1931 2016-10-05  Commit Queue  <commit-queue@webkit.org>
1932
1933         Unreviewed, rolling out r206845.
1934         https://bugs.webkit.org/show_bug.cgi?id=162998
1935
1936         broke el capitan build (Requested by alexchristensen on
1937         #webkit).
1938
1939         Reverted changeset:
1940
1941         "Add Display P3 ColorSpace"
1942         https://bugs.webkit.org/show_bug.cgi?id=162880
1943         http://trac.webkit.org/changeset/206845
1944
1945 2016-10-05  Youenn Fablet  <youenn@apple.com>
1946
1947         Reuse CodeGenerator::UpdateFile in Tools CodeGenerator
1948         https://bugs.webkit.org/show_bug.cgi?id=162960
1949
1950         Reviewed by Alex Christensen.
1951
1952         No change of behavior.
1953
1954         * bindings/scripts/CodeGenerator.pm:
1955         (UpdateFile): Adding FIXME to enable lazy writing when feasible.
1956
1957 2016-10-05  Michael Catanzaro  <mcatanzaro@igalia.com>
1958
1959         [SOUP] HostTLSCertificateSet should not use SHA-1 hashes to compare certificates
1960         https://bugs.webkit.org/show_bug.cgi?id=162965
1961
1962         Reviewed by Carlos Garcia Campos.
1963
1964         Use SHA-256 instead.
1965
1966         No new tests, covered by TestSSL.
1967
1968         * platform/network/soup/SoupNetworkSession.cpp:
1969         (WebCore::HostTLSCertificateSet::computeCertificateHash):
1970
1971 2016-10-05  Michael Catanzaro  <mcatanzaro@igalia.com>
1972
1973         [GTK] Bump Chrome version in Chrome user agent quirk
1974         https://bugs.webkit.org/show_bug.cgi?id=162984
1975
1976         Reviewed by Carlos Garcia Campos.
1977
1978         * platform/gtk/UserAgentGtk.cpp:
1979         (WebCore::buildUserAgentString):
1980
1981 2016-10-05  Dean Jackson  <dino@apple.com>
1982
1983         Add Display P3 ColorSpace
1984         https://bugs.webkit.org/show_bug.cgi?id=162880
1985         <rdar://problem/28598564>
1986
1987         Reviewed by Sam Weinig.
1988
1989         Add a new ColorSpace for Display P3.
1990
1991         This will be tested once the Color class can create
1992         objects that reference other color spaces.
1993
1994         * platform/graphics/ColorSpace.h:
1995         * platform/graphics/cg/GraphicsContextCG.cpp:
1996         (WebCore::displayP3ColorSpaceRef):
1997         * platform/graphics/cg/GraphicsContextCG.h:
1998         (WebCore::cachedCGColorSpace):
1999
2000 2016-10-05  Wenson Hsieh  <wenson_hsieh@apple.com>
2001
2002         Introduce InputEvent bindings in preparation for the input events spec
2003         https://bugs.webkit.org/show_bug.cgi?id=162954
2004
2005         Reviewed by Ryosuke Niwa.
2006
2007         Creates new bindings for InputEvent. Also introduces a runtime switch that allows Node to dispatch InputEvents
2008         rather than generic events of type 'input'. Adds a new test verifying that when the switch is enabled, inputs
2009         and contenteditable divs fire these new InputEvents on input. So far, only inputType is a part of the object
2010         prototype, since we will be implementing this first. getTargetRanges() will follow once the finer details of
2011         StaticRange are hashed out. See https://bugs.webkit.org/show_bug.cgi?id=162947 for more details.
2012
2013         Tests: fast/events/input-events-fired-when-typing.html
2014                fast/events/ios/input-events-fired-when-typing-in-contenteditable.html
2015
2016         * CMakeLists.txt:
2017         * DerivedSources.cpp:
2018         * DerivedSources.make:
2019         * WebCore.xcodeproj/project.pbxproj:
2020         * dom/DOMAllInOne.cpp:
2021         * dom/Event.cpp:
2022         (WebCore::Event::composed):
2023         (WebCore::Event::isInputEvent):
2024         * dom/Event.h:
2025         * dom/EventNames.in:
2026         * dom/InputEvent.cpp: Added.
2027         (WebCore::InputEvent::InputEvent):
2028         * dom/InputEvent.h: Added.
2029         * dom/InputEvent.idl: Added.
2030         * dom/Node.cpp:
2031         (WebCore::Node::dispatchInputEvent):
2032         (WebCore::Node::defaultEventHandler):
2033         * dom/Node.h:
2034         * editing/Editor.cpp:
2035         (WebCore::Editor::setBaseWritingDirection):
2036         * html/HTMLFormControlElement.cpp:
2037         (WebCore::HTMLFormControlElement::dispatchFormControlInputEvent):
2038         * html/HTMLInputElement.cpp:
2039         (WebCore::HTMLInputElement::setEditingValue):
2040         (WebCore::HTMLInputElement::setValueFromRenderer):
2041         * html/HTMLSelectElement.cpp:
2042         (WebCore::HTMLSelectElement::listBoxOnChange):
2043         (WebCore::HTMLSelectElement::dispatchChangeEventForMenuList):
2044         * html/shadow/MediaControlElements.cpp:
2045         (WebCore::MediaControlTimelineElement::defaultEventHandler):
2046         * page/Settings.in:
2047         * testing/InternalSettings.cpp:
2048         (WebCore::InternalSettings::Backup::Backup):
2049         (WebCore::InternalSettings::Backup::restoreTo):
2050         * testing/InternalSettings.h:
2051         * testing/InternalSettings.idl:
2052
2053 2016-10-05  Alex Christensen  <achristensen@webkit.org>
2054
2055         URLParser should parse IPv4 addresses as the last two pieces of an IPv6 address
2056         https://bugs.webkit.org/show_bug.cgi?id=162991
2057
2058         Reviewed by Saam Barati.
2059
2060         The last 32 bits of an IPv6 address can be written in the form of an IPv4 address,
2061         but the syntax is stricter than if it were just an IPv4 address.  There must be 4 pieces,
2062         and each piece must be decimal (no octal or hex allowed).  These should serialize to
2063         regular hex IPv6 addresses.
2064
2065         Covered by new API tests.
2066
2067         * platform/URLParser.cpp:
2068         (WebCore::URLParser::parseIPv4Piece):
2069         (WebCore::URLParser::parseIPv4Host):
2070         (WebCore::URLParser::parseIPv4PieceInsideIPv6):
2071         (WebCore::URLParser::parseIPv4AddressInsideIPv6):
2072         (WebCore::URLParser::parseIPv6Host):
2073         (WebCore::URLParser::parseIPv4Number): Deleted.
2074         * platform/URLParser.h:
2075
2076 2016-10-05  Myles C. Maxfield  <mmaxfield@apple.com>
2077
2078         Put variation fonts work behind a compile-time flag
2079         https://bugs.webkit.org/show_bug.cgi?id=162949
2080
2081         Reviewed by Simon Fraser.
2082
2083         No new tests because there is no behavior change.
2084
2085         * Configurations/FeatureDefines.xcconfig:
2086         * css/CSSComputedStyleDeclaration.cpp:
2087         (WebCore::ComputedStyleExtractor::propertyValue):
2088         * css/CSSFontVariationValue.cpp:
2089         * css/CSSFontVariationValue.h:
2090         * css/CSSPropertyNames.in:
2091         * css/CSSValue.cpp:
2092         (WebCore::CSSValue::equals):
2093         (WebCore::CSSValue::cssText):
2094         (WebCore::CSSValue::destroy):
2095         * css/CSSValue.h:
2096         (WebCore::CSSValue::isFontFeatureValue): Deleted.
2097         (WebCore::CSSValue::isFontVariationValue): Deleted.
2098         * css/StyleBuilderConverter.h:
2099         (WebCore::StyleBuilderConverter::convertFontVariationSettings): Deleted.
2100         * css/StyleBuilderCustom.h:
2101         (WebCore::StyleBuilderCustom::applyInheritFontFeatureSettings): Deleted.
2102         (WebCore::StyleBuilderCustom::applyInheritFontVariationSettings): Deleted.
2103         * css/parser/CSSParser.cpp:
2104         (WebCore::CSSParserContext::CSSParserContext):
2105         (WebCore::operator==):
2106         (WebCore::CSSParser::parseValue):
2107         (WebCore::CSSParser::parseFontVariationSettings): Deleted.
2108         * css/parser/CSSParserMode.h:
2109         * page/Settings.in:
2110         * page/animation/CSSPropertyAnimation.cpp:
2111         (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
2112         (WebCore::blendFunc): Deleted.
2113         * platform/graphics/FontCache.h:
2114         (WebCore::FontDescriptionKey::FontDescriptionKey):
2115         (WebCore::FontDescriptionKey::operator==):
2116         (WebCore::FontDescriptionKey::computeHash):
2117         * platform/graphics/FontDescription.cpp:
2118         * platform/graphics/FontDescription.h:
2119         (WebCore::FontDescription::operator==):
2120         (WebCore::FontDescription::setFeatureSettings): Deleted.
2121         (WebCore::FontDescription::setVariationSettings): Deleted.
2122         * platform/graphics/FontTaggedSettings.cpp:
2123         (WebCore::operator<<): Deleted.
2124         * platform/graphics/FontTaggedSettings.h:
2125         (WebCore::FontVariationSettings::isEmpty):
2126         * platform/graphics/cocoa/FontCacheCoreText.cpp:
2127         (WebCore::preparePlatformFont):
2128         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
2129         (WebCore::cascadeToLastResortAndVariationsFontDescriptor):
2130         * rendering/style/RenderStyle.cpp:
2131         (WebCore::RenderStyle::setFontVariationSettings): Deleted.
2132         * rendering/style/RenderStyle.h:
2133         (WebCore::RenderStyle::fontVariationSettings): Deleted.
2134         * testing/InternalSettings.cpp:
2135         (WebCore::InternalSettings::Backup::Backup):
2136         (WebCore::InternalSettings::Backup::restoreTo):
2137         (WebCore::InternalSettings::variationFontsEnabled):
2138         (WebCore::InternalSettings::setVariationFontsEnabled):
2139         * testing/InternalSettings.h:
2140
2141 2016-10-05  Brent Fulgham  <bfulgham@apple.com>
2142
2143         Unreviewed build fix after r206830
2144
2145         * platform/graphics/win/FontPlatformDataWin.cpp: Add missing include
2146         when building with Direct2D.
2147
2148 2016-10-05  Brent Fulgham  <bfulgham@apple.com>
2149
2150         [Win][Direct2D] Disable some CoreGraphics and CoreAnimation-based logic when building for D2D
2151         https://bugs.webkit.org/show_bug.cgi?id=162977
2152
2153         Reviewed by Alex Christensen.
2154
2155         Currently the Direct2D implementation does not support some of the accelerated compositing
2156         features that require CoreAnimation. During this bring-up, we want to disable these routines
2157         so that we can build and run in (mostly) unaccelerated drawing.
2158
2159         This patch mostly consists of adding "#if USE(CG)" and "#if USE(CA)" to files that are
2160         specific to those implementations.
2161
2162         This change should have no impact on non-Direct2D ports.
2163
2164         No change in behavior for active ports.
2165
2166         * config.h: Turn of CG when building in Direct2D.
2167         * css/CSSFontFaceSource.cpp:
2168         * loader/cache/CachedFont.cpp:
2169         * loader/cache/CachedSVGFont.cpp:
2170         * page/CaptionUserPreferencesMediaAF.cpp:
2171         * page/win/FrameCGWin.cpp:
2172         * page/win/FrameDirect2D.cpp: Added.
2173         * platform/graphics/Font.cpp:
2174         * platform/graphics/FontCache.cpp:
2175         * platform/graphics/FontPlatformData.cpp:
2176         * platform/graphics/GraphicsContext.h:
2177         * platform/graphics/Image.cpp:
2178         * platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.cpp:
2179         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
2180         * platform/graphics/ca/GraphicsLayerCA.cpp:
2181         * platform/graphics/ca/PlatformCALayer.cpp:
2182         * platform/graphics/ca/TileController.cpp:
2183         * platform/graphics/ca/TileGrid.cpp:
2184         * platform/graphics/ca/TileGrid.h:
2185         * platform/graphics/ca/win/CACFLayerTreeHost.cpp:
2186         * platform/graphics/ca/win/LayerChangesFlusher.cpp:
2187         * platform/graphics/ca/win/PlatformCAAnimationWin.cpp:
2188         * platform/graphics/ca/win/PlatformCAAnimationWin.h:
2189         * platform/graphics/ca/win/PlatformCAFiltersWin.cpp:
2190         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
2191         * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
2192         * platform/graphics/ca/win/WKCACFViewLayerTreeHost.cpp:
2193         * platform/graphics/ca/win/WebTiledBackingLayerWin.cpp:
2194         * platform/graphics/cg/GradientCG.cpp:
2195         * platform/graphics/cg/GraphicsContextCG.cpp:
2196         * platform/graphics/cg/ImageBufferCG.cpp:
2197         * platform/graphics/cg/ImageBufferDataCG.cpp:
2198         * platform/graphics/cg/PDFDocumentImage.cpp:
2199         * platform/graphics/cg/PatternCG.cpp:
2200         * platform/graphics/cg/SubimageCacheWithTimer.cpp:
2201         * platform/graphics/win/FontCGWin.cpp:
2202         * platform/graphics/win/FontPlatformDataCGWin.cpp:
2203         * platform/graphics/win/GlyphPageTreeNodeCGWin.cpp:
2204         * platform/graphics/win/GlyphPageTreeNodeDirect2D.cpp:
2205         * platform/graphics/win/GradientDirect2D.cpp:
2206         * platform/graphics/win/PathDirect2D.cpp: Fix a few build problems I didn't notice
2207         while building without Direct2D active.
2208         * platform/graphics/win/SimpleFontDataCGWin.cpp:
2209         * platform/graphics/win/SimpleFontDataWin.cpp:
2210         * platform/win/DragImageCGWin.cpp:
2211         * platform/win/DragImageDirect2D.cpp: Added.
2212         * rendering/RenderMediaControls.cpp:
2213
2214 2016-10-05  Chris Dumez  <cdumez@apple.com>
2215
2216         KeyboardEvent.getModifierState() should support "CapsLock" modifier
2217         https://bugs.webkit.org/show_bug.cgi?id=162861
2218
2219         Reviewed by Darin Adler.
2220
2221         Add support for "CapsLock" modifier on Mac / iOS for KeyboardEvent's
2222         getModifierState() API, as per:
2223         - https://w3c.github.io/uievents/#dom-keyboardevent-getmodifierstate
2224
2225         No new tests, updated existing test.
2226
2227         * dom/KeyboardEvent.cpp:
2228         (WebCore::KeyboardEvent::KeyboardEvent):
2229         (WebCore::KeyboardEvent::getModifierState):
2230         * dom/KeyboardEvent.h:
2231         * platform/PlatformEvent.h:
2232         * platform/ios/PlatformEventFactoryIOS.mm:
2233         (WebCore::modifiersForEvent):
2234         * platform/mac/PlatformEventFactoryMac.mm:
2235         (WebCore::keyIdentifierForKeyEvent):
2236
2237 2016-10-05  Michael Catanzaro  <mcatanzaro@igalia.com>
2238
2239         [GTK] Improve OS X UA quirk
2240         https://bugs.webkit.org/show_bug.cgi?id=162613
2241
2242         Reviewed by Carlos Garcia Campos.
2243
2244         Include OS X version number in user agent, like Safari does.
2245
2246         * platform/gtk/UserAgentGtk.cpp:
2247         (WebCore::buildUserAgentString):
2248
2249 2016-10-05  Michael Catanzaro  <mcatanzaro@igalia.com>
2250
2251         [GTK] Improve comment in platformVersionForUAString
2252         https://bugs.webkit.org/show_bug.cgi?id=162612
2253
2254         Reviewed by Carlos Garcia Campos.
2255
2256         * platform/gtk/UserAgentGtk.cpp:
2257         (WebCore::platformVersionForUAString):
2258
2259 2016-10-05  Zalan Bujtas  <zalan@apple.com>
2260
2261         Missing quotation mark when <q> gets reparented.
2262         https://bugs.webkit.org/show_bug.cgi?id=162940
2263
2264         Reviewed by Darin Adler.
2265
2266         When an opening RenderQuote gets removed due to some change in the render tree,
2267         we notify the closing RenderQuote so that it can update its content (") accordingly (and vice versa).
2268         However when the same RenderQuote is added back to the render tree (aka reparenting), we fail to
2269         let the other RenderQuote know about it and its content becomes stale.  
2270         This patch ensures that when either the opening or closing part of the quotation mark gets reparented,
2271         we inform the other, corresponding opening/closing renderer about it.
2272
2273         Test: fast/css-generated-content/missing-quotes-with-dynamic-content.html
2274
2275         * dom/PseudoElement.cpp:
2276         (WebCore::PseudoElement::didAttachRenderers):
2277         * rendering/RenderQuote.cpp:
2278         (WebCore::RenderQuote::insertedIntoTree):
2279         * rendering/RenderQuote.h:
2280
2281 2016-10-05  Alex Christensen  <achristensen@webkit.org>
2282
2283         URLParser should correctly strip unnecessary 0's in IPv6 addresses
2284         https://bugs.webkit.org/show_bug.cgi?id=162979
2285
2286         Reviewed by Brady Eidson.
2287
2288         Covered by new API tests.
2289
2290         * platform/URLParser.cpp:
2291         (WebCore::URLParser::parseIPv6Host):
2292         Strip leading 0's and any 0's before the last 0 if the value is 0.
2293
2294 2016-10-05  Alex Christensen  <achristensen@webkit.org>
2295
2296         UTF-8 encode queries of nonspecial and websocket schemes
2297         https://bugs.webkit.org/show_bug.cgi?id=162956
2298
2299         Reviewed by Geoffrey Garen and Brady Eidson.
2300
2301         The URL spec says in the query state:
2302         'If url is not special or url's scheme is either "ws" or "wss", set encoding to UTF-8.'
2303         This should be determined as soon as we are done parsing the scheme.
2304         
2305         Covered by new API tests.
2306         This also fixes tests like fast/loader/javascript-url-encoding-2.html when URLParser is enabled.
2307
2308         * platform/URLParser.cpp:
2309         (WebCore::isValidSchemeCharacter):
2310         Renamed Scheme to ValidScheme so I can use Scheme as the name of an enum class in the same namespace.
2311         (WebCore::isSpecial):
2312         (WebCore::scheme):
2313         Separate functionality so we can have different behavior for different sets of
2314         ws and wss schemes, special, and non-special schemes.
2315         (WebCore::URLParser::copyURLPartsUntil):
2316         (WebCore::URLParser::parse):
2317         Set isUTF8Encoding to true when we finish parsing the scheme if the scheme is ws, wss, or non-special,
2318         according to spec.  This also matches existing behavior.  This way we will already know whether to go
2319         into UTF8Query or NonUTF8Query state when we see a '?'.
2320         (WebCore::isSpecialScheme): Deleted.
2321
2322 2016-10-05  Alex Christensen  <achristensen@webkit.org>
2323
2324         Prepare to enable URLParser
2325         https://bugs.webkit.org/show_bug.cgi?id=162974
2326
2327         Reviewed by Brady Eidson.
2328
2329         * platform/URL.cpp:
2330         (WebCore::URL::serialize):
2331         When we enable the URLParser, this attempt to make serialized URLs more spec compliant
2332         won't be needed any more.
2333
2334 2016-10-05  Brent Fulgham  <bfulgham@apple.com>
2335
2336         [Win][Direct2D] Add initial D2D Path and Gradient implementation
2337         https://bugs.webkit.org/show_bug.cgi?id=162923
2338
2339         Reviewed by Alex Christensen.
2340
2341         This patch lands a set of new files that implements initial Path
2342         and Gradient features on Windows using Direct2D.
2343
2344         No new tests until complete backend lands.
2345
2346         * platform/graphics/Gradient.h:
2347         * platform/graphics/Path.cpp:
2348         * platform/graphics/Path.h:
2349         * platform/graphics/win/GradientDirect2D.cpp: Added.
2350         * platform/graphics/win/PathDirect2D.cpp: Added.
2351
2352 2016-10-05  Romain Bellessort  <romain.bellessort@crf.canon.fr>
2353
2354         [Readable Streams API] Align function names with spec
2355         https://bugs.webkit.org/show_bug.cgi?id=162967
2356
2357         Reviewed by Darin Adler.
2358
2359         Align function names with spec. Behaviour was already in line with spec, but previous function names had
2360         sometimes been preserved to track the changes more easily. This led to some inconsistencies (for instance,
2361         enqueueInReadableStream was still used even though it works on a controller instead of a stream) and it
2362         also made it more difficult to compare spec and implementation.
2363
2364         No change in behaviour.
2365
2366         * Modules/fetch/FetchInternals.js:
2367         (consumeStream): Updated with new function names.
2368         * Modules/fetch/FetchResponse.js:
2369         (clone): Updated with new function names.
2370         * Modules/streams/ReadableStream.js:
2371         (tee): Updated with new function names.
2372         * Modules/streams/ReadableStreamDefaultController.js:
2373         (enqueue): Updated with new function names.
2374         (error): Updated with new function names.
2375         * Modules/streams/ReadableStreamDefaultReader.js:
2376         (read): Updated with new function names.
2377         * Modules/streams/ReadableStreamInternals.js:
2378         (privateInitializeReadableStreamDefaultController): Updated with new function names.
2379         (readableStreamDefaultControllerError): Updated with new function names.
2380         (readableStreamTee): Updated with new function names.
2381         (readableStreamTeePullFunction): Updated with new function names.
2382         (readableStreamTeeBranch2CancelFunction): Updated with new function names.
2383         (readableStreamError): Updated with new function names.
2384         (readableStreamCancel): Updated with new function names.
2385         (readableStreamDefaultControllerPull): Updated with new function names.
2386         (readableStreamDefaultControllerClose): Updated with new function names.
2387         (readableStreamClose): Updated with new function names.
2388         (readableStreamDefaultControllerEnqueue): Updated with new function names.
2389         (readableStreamDefaultReaderRead): Updated with new function names.
2390
2391 2016-10-05  Chris Dumez  <cdumez@apple.com>
2392
2393         [Bindings] Declare dictionary / enumeration template specializations in the header
2394         https://bugs.webkit.org/show_bug.cgi?id=162929
2395
2396         Reviewed by Darin Adler.
2397
2398         Declare dictionary / enumeration template specializations in the header
2399         so that:
2400         - They can be used from custom bindings code.
2401         - Dictionaries / enumerations can be used to their own IDL files to
2402           share them (Bug 162912).
2403
2404         No new tests, rebaselined bindings tests.
2405
2406         * WebCore.xcodeproj/project.pbxproj:
2407         * bindings/generic/IDLTypes.h:
2408         * bindings/js/JSDOMConvert.h:
2409         * bindings/scripts/CodeGeneratorJS.pm:
2410         (GenerateInterface):
2411         (GenerateEnumerationImplementationContent):
2412         (GenerateEnumerationHeaderContent):
2413         (GenerateDictionaryHeaderContent):
2414         (GenerateHeader):
2415         (GenerateCallbackHeader):
2416         (GenerateCallbackImplementation):
2417         (GenerateDefaultValue): Deleted.
2418         (GenerateDictionaryImplementationContent): Deleted.
2419         (GenerateParametersCheck): Deleted.
2420         * bindings/scripts/test/JS/JSTestObj.cpp:
2421         * bindings/scripts/test/JS/JSTestObj.h:
2422
2423 2016-10-05  Zan Dobersek  <zdobersek@igalia.com>
2424
2425         Rename ENABLE_ENCRYPTED_MEDIA_V2 to ENABLE_LEGACY_ENCRYPTED_MEDIA
2426         https://bugs.webkit.org/show_bug.cgi?id=162903
2427
2428         Reviewed by Alex Christensen.
2429
2430         Rename build guards for the remaining implementation of the legacy EME API
2431         to ENABLE_LEGACY_ENCRYPTED_MEDIA. This will allow for the future implementation
2432         of the near-finished API to be guarded with the simple ENABLE_ENCRYPTED_MEDIA guards.
2433
2434         No new tests -- no change in behavior.
2435
2436         * CMakeLists.txt:
2437         * Configurations/FeatureDefines.xcconfig:
2438         * DerivedSources.cpp:
2439         * DerivedSources.make:
2440         * Modules/encryptedmedia/CDM.cpp:
2441         * Modules/encryptedmedia/CDM.h:
2442         * Modules/encryptedmedia/CDMPrivate.h:
2443         * Modules/encryptedmedia/CDMPrivateClearKey.cpp:
2444         * Modules/encryptedmedia/CDMPrivateClearKey.h:
2445         * Modules/encryptedmedia/CDMPrivateMediaPlayer.cpp:
2446         * Modules/encryptedmedia/CDMPrivateMediaPlayer.h:
2447         * Modules/encryptedmedia/CDMSessionClearKey.cpp:
2448         * Modules/encryptedmedia/CDMSessionClearKey.h:
2449         * Modules/encryptedmedia/MediaKeyMessageEvent.cpp:
2450         * Modules/encryptedmedia/MediaKeyMessageEvent.h:
2451         * Modules/encryptedmedia/MediaKeyMessageEvent.idl:
2452         * Modules/encryptedmedia/MediaKeyNeededEvent.cpp:
2453         * Modules/encryptedmedia/MediaKeyNeededEvent.h:
2454         * Modules/encryptedmedia/MediaKeyNeededEvent.idl:
2455         * Modules/encryptedmedia/MediaKeySession.cpp:
2456         * Modules/encryptedmedia/MediaKeySession.h:
2457         * Modules/encryptedmedia/MediaKeySession.idl:
2458         * Modules/encryptedmedia/MediaKeys.cpp:
2459         * Modules/encryptedmedia/MediaKeys.h:
2460         * Modules/encryptedmedia/MediaKeys.idl:
2461         * bindings/js/JSDictionary.cpp:
2462         * bindings/js/JSDictionary.h:
2463         * dom/Element.idl:
2464         * dom/EventNames.in:
2465         * dom/EventTargetFactory.in:
2466         * html/HTMLMediaElement.cpp:
2467         (WebCore::HTMLMediaElement::~HTMLMediaElement):
2468         (WebCore::HTMLMediaElement::webkitGenerateKeyRequest):
2469         (WebCore::HTMLMediaElement::webkitAddKey):
2470         * html/HTMLMediaElement.h:
2471         * html/HTMLMediaElement.idl:
2472         * html/MediaError.h:
2473         * html/MediaError.idl:
2474         * html/MediaKeyError.h:
2475         * html/MediaKeyError.idl:
2476         * page/Settings.h:
2477         * platform/graphics/CDMSession.h:
2478         * platform/graphics/MediaPlayer.cpp:
2479         * platform/graphics/MediaPlayer.h:
2480         * platform/graphics/MediaPlayerPrivate.h:
2481         * platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.h:
2482         * platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm:
2483         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
2484         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
2485         * platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.cpp:
2486         * platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.h:
2487         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
2488         (WebCore::MediaPlayerPrivateAVFoundationCF::supportsKeySystem):
2489         (WebCore::AVFWrapper::shouldWaitForLoadingOfResource):
2490         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h:
2491         * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.h:
2492         * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
2493         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h:
2494         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
2495         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.h:
2496         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
2497         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h:
2498         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm:
2499         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
2500         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2501         (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsKeySystem):
2502         (WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource):
2503         (WebCore::playerKVOProperties):
2504         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
2505         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
2506         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
2507         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h:
2508         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
2509         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
2510         (WebCore::SourceBufferPrivateAVFObjC::willProvideContentKeyRequestInitializationDataForTrackID):
2511         (WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID):
2512         * testing/Internals.cpp:
2513         * testing/Internals.h:
2514         * testing/Internals.idl:
2515         * testing/MockCDM.cpp:
2516         * testing/MockCDM.h:
2517
2518 2016-10-05  Daniel Bates  <dabates@apple.com>
2519
2520         Do not follow redirects when sending violation report
2521         https://bugs.webkit.org/show_bug.cgi?id=162520
2522         <rdar://problem/27957639>
2523
2524         Reviewed by Alex Christensen.
2525
2526         Do not follow redirects when sending a Content Security Policy or XSS Auditor violation report
2527         as redirects can be used to forward report details to a third-party.
2528
2529         This changes makes WebKit more closely conform to the reporting requirements in section Reporting
2530         of the Content Security Level 2 standard: <https://w3c.github.io/webappsec-csp/2/#violation-reports>
2531         (Editor's Draft, 25 April 2016).
2532
2533         Tests: http/tests/security/contentSecurityPolicy/report-blocked-uri-and-do-not-follow-redirect-when-sending-report.php
2534                http/tests/security/xssAuditor/report-script-tag-and-do-not-follow-redirect-when-sending-report.html
2535                http/tests/security/xssAuditor/report-script-tag-full-block-and-do-not-follow-redirect-when-sending-report.html
2536
2537         * loader/LoaderStrategy.h: Modified createPingHandle() to take a boolean, shouldFollowRedirects,
2538         whether to follow redirect responses for a ping request.
2539         * loader/PingLoader.cpp:
2540         (WebCore::PingLoader::loadImage): Pass ShouldFollowRedirects::Yes to PingLoader::startPingLoad to
2541         keep our current behavior.
2542         (WebCore::PingLoader::sendPing): Ditto. Note our current behavior of following redirects matches
2543         the behavior described in the section "Hyperlink auditing" of the HTML standard:
2544         <https://html.spec.whatwg.org/multipage/semantics.html#hyperlink-auditing> (23 September 2016).
2545         (WebCore::PingLoader::sendViolationReport): Pass ShouldFollowRedirects::No to PingLoader::startPingLoad
2546         so that we do not follow redirects when sending a violation report.
2547         (WebCore::PingLoader::startPingLoad): Modified to take argument shouldFollowRedirects whether to
2548         follow redirect responses for a ping request.
2549         * loader/PingLoader.h:
2550         * platform/network/PingHandle.h: Add boolean m_shouldFollowRedirects. I grouped this boolean with
2551         the existing boolean, m_shouldUseCredentialStorage, as opposed to appending to the end of the class
2552         definition to avoid increasing object size as clang will coalesces the two bools into a single
2553         machine word. Override ResourceHandleClient::willSendRequest() and ResourceHandleClient::willSendRequestAsync()
2554         to follow a redirect, if applicable. 
2555
2556 2016-10-05  Carlos Garcia Campos  <cgarcia@igalia.com>
2557
2558         [SOUP] Move global TLS errors handling from ResourceHandle to SoupNetworkSession
2559         https://bugs.webkit.org/show_bug.cgi?id=162910
2560
2561         Reviewed by Alex Christensen.
2562
2563         So that it will be shared with network session code. Also remove setHostAllowsAnyHTTPSCertificate() that we have
2564         never actually used.
2565
2566         * platform/network/ResourceHandle.h:
2567         * platform/network/soup/ResourceHandleSoup.cpp:
2568         (WebCore::tlsErrorsChangedCallback): Use SoupNetworkSession::checkTLSErrors().
2569         * platform/network/soup/SoupNetworkSession.cpp:
2570         (WebCore::HostTLSCertificateSet::add):
2571         (WebCore::HostTLSCertificateSet::contains):
2572         (WebCore::HostTLSCertificateSet::computeCertificateHash):
2573         (WebCore::clientCertificates):
2574         (WebCore::SoupNetworkSession::setShouldIgnoreTLSErrors):
2575         (WebCore::SoupNetworkSession::checkTLSErrors):
2576         (WebCore::SoupNetworkSession::allowSpecificHTTPSCertificateForHost):
2577         * platform/network/soup/SoupNetworkSession.h:
2578
2579 2016-10-05  Carlos Garcia Campos  <cgarcia@igalia.com>
2580
2581         [SOUP] Move request HTTP body handling to ResourceRequestSoup and simplify it
2582         https://bugs.webkit.org/show_bug.cgi?id=162891
2583
2584         Reviewed by Michael Catanzaro.
2585
2586         We are currently adding the HTTP body to the message in ResourceHandleSoup, but we could do it as part of the
2587         ResourceRequest::updateSoupMessage() method, since the HTTP body is indeed part of the request. The code can be
2588         also simplified, especially the handling of files, by using SharedBuffer that already mmaps the file when
2589         possible, instead of using GMappedFile API.
2590
2591         * platform/SharedBuffer.h: Add createSoupBuffer() method.
2592         * platform/network/soup/ResourceHandleSoup.cpp:
2593         (WebCore::createSoupMessageForHandleAndRequest):
2594         (WebCore::milisecondsSinceRequest): Deleted.
2595         (WebCore::ResourceHandle::didStartRequest): Deleted.
2596         (WebCore::startingCallback): Deleted.
2597         (WebCore::networkEventCallback): Deleted.
2598         (WebCore::ResourceHandle::start): Deleted.
2599         (WebCore::ResourceHandle::releaseForDownload): Deleted.
2600         (WebCore::ResourceHandle::timeoutFired): Deleted.
2601         * platform/network/soup/ResourceRequest.h:
2602         * platform/network/soup/ResourceRequestSoup.cpp:
2603         (WebCore::appendEncodedBlobItemToSoupMessageBody): Helper method to append the blob to the request message body.
2604         (WebCore::ResourceRequest::updateSoupMessageBody): Add HTTPBody to the request message body.
2605         (WebCore::ResourceRequest::updateSoupMessage): Call updateSoupMessageBody() to also update the body.
2606         * platform/soup/SharedBufferSoup.cpp:
2607         (WebCore::SharedBuffer::createSoupBuffer): Returns a new SoupBuffer for the SharedBuffer.
2608
2609 2016-10-04  Chris Dumez  <cdumez@apple.com>
2610
2611         Implement KeyboardEvent.code from the UI Event spec
2612         https://bugs.webkit.org/show_bug.cgi?id=149584
2613
2614         Reviewed by Darin Adler.
2615
2616         Add support for Keyboard.code attribute:
2617         - https://w3c.github.io/uievents/#dom-keyboardevent-code
2618         - https://w3c.github.io/uievents-code/
2619
2620         The feature is only enabled on Mac for now as the implementation is
2621         platform-specific and Mac only.
2622
2623         Test: fast/events/keyboardevent-code.html
2624
2625         * dom/KeyboardEvent.cpp:
2626         (WebCore::KeyboardEvent::KeyboardEvent):
2627         * dom/KeyboardEvent.h:
2628         * dom/KeyboardEvent.idl:
2629         * platform/PlatformKeyboardEvent.h:
2630         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
2631         (WebCore::PlatformKeyboardEvent::code):
2632         (WebCore::PlatformKeyboardEvent::unmodifiedText): Deleted.
2633         * platform/mac/PlatformEventFactoryMac.h:
2634         * platform/mac/PlatformEventFactoryMac.mm:
2635         (WebCore::codeForKeyEvent):
2636         (WebCore::keyIdentifierForKeyEvent):
2637         * replay/SerializationMethods.cpp:
2638         (JSC::EncodingTraits<PlatformKeyboardEvent>::encodeValue):
2639         (JSC::EncodingTraits<PlatformKeyboardEvent>::decodeValue):
2640
2641 2016-10-04  Said Abou-Hallawa  <sabouhallawa@apple.com>
2642
2643         The dragged image should be the current frame only of the animated image
2644         https://bugs.webkit.org/show_bug.cgi?id=162109
2645
2646         Reviewed by Tim Horton.
2647
2648         Instead of creating an NSImage with all the frames for the dragImage,
2649         create an NSImage with the current frame only.
2650
2651         * dom/DataTransferMac.mm:
2652         (WebCore::DataTransfer::createDragImage): Call snapshotNSImage() to create the dragImage.
2653         * editing/cocoa/HTMLConverter.mm:
2654         (fileWrapperForElement):  Call the Image function with its new name.
2655         * platform/graphics/BitmapImage.h:
2656         * platform/graphics/Image.h:
2657         (WebCore::Image::nsImage): Rename getNSImage() to nsImage().
2658         (WebCore::Image::snapshotNSImage): Returns the NSImage of the current frame.
2659         (WebCore::Image::tiffRepresentation): Rename getTIFFRepresentation() to tiffRepresentation().
2660         (WebCore::Image::getNSImage): Deleted.
2661         (WebCore::Image::getTIFFRepresentation): Deleted.
2662         * platform/graphics/mac/ImageMac.mm:
2663         (WebCore::BitmapImage::tiffRepresentation): Rename getTIFFRepresentation() to tiffRepresentation().
2664         (WebCore::BitmapImage::nsImage): Rename getNSImage() to nsImage().
2665         (WebCore::BitmapImage::snapshotNSImage): Returns the NSImage of the current frame.
2666         (WebCore::BitmapImage::getTIFFRepresentation): Deleted.
2667         (WebCore::BitmapImage::getNSImage): Deleted.
2668         * platform/mac/CursorMac.mm:
2669         (WebCore::createCustomCursor): Call snapshotNSImage() since the cursor does not animate anyway.
2670         * platform/mac/DragImageMac.mm:
2671         (WebCore::createDragImageFromImage): Use snapshotNSImage() for the dragImage.
2672         * platform/mac/PasteboardMac.mm:
2673         (WebCore::Pasteboard::write): Call the Image function with its new name.
2674
2675 2016-10-04  Andy Estes  <aestes@apple.com>
2676
2677         [iOS] Crash in WebResourceLoaderQuickLookDelegate when the client cancels the navigation to a QuickLook resource
2678         https://bugs.webkit.org/show_bug.cgi?id=162950
2679         <rdar://problem/23759114>
2680
2681         Reviewed by Brady Eidson.
2682
2683         When we receive data from QLPreviewConverter for the first time, we call
2684         ResourceLoader::didReceiveResponse() with the preview NSURLResponse from QuickLook. If the
2685         client decides to cancel this navigation in decidePolicyForResponse(),
2686         WebResourceLoaderQuickLookDelegate will end up with a null _resourceLoader after
2687         didReceiveResponse() returns. This change adds null checks in the methods that use
2688         _resourceLoader after calling -_sendDidReceiveResponseIfNecessary.
2689
2690         New API test: QuickLook.CancelNavigationAfterResponse
2691
2692         * platform/network/ios/QuickLook.mm:
2693         (-[WebResourceLoaderQuickLookDelegate connection:didReceiveDataArray:]): Changed to only
2694         call ResourceLoader::didReceiveDataArray() if _resourceLoader is non-null.
2695         (-[WebResourceLoaderQuickLookDelegate connection:didReceiveData:lengthReceived:]): Ditto for
2696         ResourceLoader::didReceiveData().
2697         (-[WebResourceLoaderQuickLookDelegate connection:didFailWithError:]): Ditto for
2698         ResourceLoader::didFail().
2699
2700 2016-10-04  Chris Dumez  <cdumez@apple.com>
2701
2702         Add support for KeyboardEvent.isComposing attribute
2703         https://bugs.webkit.org/show_bug.cgi?id=162921
2704
2705         Reviewed by Darin Adler.
2706
2707         Add support for KeyboardEvent.isComposing attribute:
2708         - https://www.w3.org/TR/uievents/#dom-keyboardevent-iscomposing
2709         - https://www.w3.org/TR/uievents/#ref-for-dom-keyboardevent-iscomposing-3
2710
2711         Manual test: https://jsfiddle.net/ay92sr08/9/
2712
2713         No new tests, extended existing tests.
2714
2715         * dom/KeyboardEvent.cpp:
2716         (WebCore::KeyboardEvent::KeyboardEvent):
2717         * dom/KeyboardEvent.h:
2718         * dom/KeyboardEvent.idl:
2719
2720 2016-10-03  Ryosuke Niwa  <rniwa@webkit.org>
2721
2722         ShadowRoot interface should have elementFromPoint
2723         https://bugs.webkit.org/show_bug.cgi?id=162882
2724
2725         Reviewed by Chris Dumez.
2726
2727         Add elementFromPoint to ShadowRoot's prototype as specified at:
2728         https://www.w3.org/TR/shadow-dom/#extensions-to-the-documentorshadowroot-mixin
2729         with changes proposed at https://github.com/w3c/csswg-drafts/issues/556
2730
2731         Added TreeScope::retargetToScope which implements 
2732
2733         This patch also factors DocumentOrShadowRoot.idl out of Document and ShadowRoot interfaces to better match
2734         the latest DOM specification: https://dom.spec.whatwg.org/#mixin-documentorshadowroot
2735
2736         Test: fast/shadow-dom/Document-prototype-elementFromPoint.html
2737
2738         * CMakeLists.txt:
2739         * DerivedSources.make:
2740         * WebCore.xcodeproj/project.pbxproj:
2741         * dom/Document.cpp:
2742         (WebCore::Document::nodeFromPoint): Moved to TreeScope.
2743         (WebCore::Document::elementFromPoint): Moved to TreeScope.
2744         * dom/Document.h:
2745         * dom/Document.idl: Moved elementFromPoint and activeElement to DocumentOrShadowRoot.idl.
2746         * dom/DocumentOrShadowRoot.idl: Added.
2747         * dom/EventPath.cpp:
2748         (WebCore::RelatedNodeRetargeter::checkConsistency): Use newly added TreeScope::retargetToScope.
2749         * dom/ShadowRoot.idl: Moved activeElement to DocumentOrShadowRoot.idl.
2750         * dom/TreeScope.cpp:
2751         (WebCore::TreeScope::retargetToScope): Added. Implements https://dom.spec.whatwg.org/#retarget efficiently.
2752         Instead of checking whether A (node) is a shadow-including inclusive ancestor of B (this scope) at each
2753         parent, find the lowest ancestor which contains both A and B, and return the self-inclusive ancestor of B
2754         in that tree. To find the lowest common ancestor in O(n), traverse all ancestors of A and B separately and
2755         do a top-down traversal. The last tree scope in which A's ancestor and B's ancestor match is the lowest
2756         common ancestor.
2757         (WebCore::TreeScope::nodeFromPoint): Moved from Document.
2758         (WebCore::TreeScope::elementFromPoint): Moved from Document. Use retargetToScope and parentInComposedTree
2759         instead of parentNode and ancestorInThisScope to match the semantics proposed in
2760         https://github.com/w3c/csswg-drafts/issues/556
2761         * dom/TreeScope.h:
2762
2763 2016-10-04  Myles C. Maxfield  <mmaxfield@apple.com>
2764
2765         font-family: cursive should map to KaiTi in Chinese
2766         https://bugs.webkit.org/show_bug.cgi?id=162889
2767         <rdar://problem/28363547>
2768
2769         Reviewed by Tim Horton.
2770
2771         According to Bobby Tung, this is a better mapping. Previously, we were
2772         relying on the system fallback mechanism. However, an explicit mapping
2773         is more robust.
2774
2775         Test: fast/text/cursive-zh.html
2776
2777         * page/cocoa/SettingsCocoa.mm:
2778         (WebCore::Settings::initializeDefaultFontFamilies):
2779
2780 2016-10-04  Alex Christensen  <achristensen@webkit.org>
2781
2782         URLParser: query-only URLs relative to file URLs should just add a query
2783         https://bugs.webkit.org/show_bug.cgi?id=162888
2784
2785         Reviewed by Tim Horton.
2786
2787         Covered by new API tests.
2788
2789         * platform/URLParser.cpp:
2790         (WebCore::URLParser::parse):
2791         Like bug 206749 but with queries instead of fragments.
2792
2793 2016-10-04  Alex Christensen  <achristensen@webkit.org>
2794
2795         URLParser should match URL::parse and other browsers when parsing a URL containing only scheme://
2796         https://bugs.webkit.org/show_bug.cgi?id=162909
2797
2798         Reviewed by Tim Horton.
2799
2800         If there's no host in this case we shouldn't fail, but rather make a valid URL with the // in the path.
2801         This matches Chrome, Firefox, and Safari's behavior.
2802         Covered by API tests.
2803
2804         * platform/URLParser.cpp:
2805         (WebCore::URLParser::parse):
2806
2807 2016-10-04  Brent Fulgham  <bfulgham@apple.com>
2808
2809         Unreviewed build fix after r206773.
2810
2811         Exclude Direct2D definitions when building for normal CG Windows.
2812
2813         * platform/graphics/GraphicsContext.h:
2814
2815 2016-10-04  Yusuke Suzuki  <utatane.tea@gmail.com>
2816
2817         [DOMJIT] Introduce DOMJIT::GetterSetter to tell JIT information
2818         https://bugs.webkit.org/show_bug.cgi?id=162916
2819
2820         Reviewed by Filip Pizlo.
2821
2822         * ForwardingHeaders/domjit/DOMJITGetterSetter.h: Added.
2823         * PlatformEfl.cmake:
2824         * PlatformGTK.cmake:
2825         * PlatformMac.cmake:
2826         * PlatformWin.cmake:
2827
2828 2016-10-04  Chris Dumez  <cdumez@apple.com>
2829
2830         Return null when window.open() is popup blocked
2831         https://bugs.webkit.org/show_bug.cgi?id=162897
2832
2833         Reviewed by Michael Catanzaro.
2834
2835         The return value of window.open() when the popup is blocked should be null:
2836         - https://github.com/whatwg/html/pull/1854
2837         - https://github.com/whatwg/html/issues/1851
2838
2839         Firefox / Edge return null.
2840
2841         No new tests, rebaselined existing tests.
2842
2843         * bindings/js/JSDOMWindowCustom.cpp:
2844         (WebCore::JSDOMWindow::open):
2845
2846 2016-10-04  Chris Dumez  <cdumez@apple.com>
2847
2848         [Web IDL] Add support for dictionary inheritance
2849         https://bugs.webkit.org/show_bug.cgi?id=162907
2850
2851         Reviewed by Sam Weinig.
2852
2853         Add support for dictionary inheritance to our Web IDL parser and
2854         bindings generator. Leverage this new support for EventTarget's
2855         EventListenerOptions / AddEventListenerOptions dictionaries, in
2856         order to match the DOM specification:
2857         - https://dom.spec.whatwg.org/#interface-eventtarget
2858
2859         Also update the bindings generator to convert the dictionary
2860         members in lexicographical order, as per:
2861         - https://heycam.github.io/webidl/#es-dictionary (Step 5.1)
2862
2863         No new tests, rebaselined bindings tests.
2864
2865         * bindings/scripts/CodeGenerator.pm:
2866         (GetDictionaryByName):
2867         * bindings/scripts/CodeGeneratorJS.pm:
2868         (GenerateDictionaryImplementationContent):
2869         * bindings/scripts/IDLParser.pm:
2870         (parseDictionary):
2871         * bindings/scripts/test/JS/JSTestObj.cpp:
2872         (WebCore::convertDictionary<TestObj::Dictionary>):
2873         (WebCore::convertDictionary<TestObj::DictionaryThatShouldNotTolerateNull>):
2874         (WebCore::convertDictionary<TestObj::DictionaryThatShouldTolerateNull>):
2875         (WebCore::convertDictionary<AlternateDictionaryName>):
2876         (WebCore::convertDictionary<TestObj::ParentDictionary>):
2877         (WebCore::convertDictionary<TestObj::ChildDictionary>):
2878         * bindings/scripts/test/TestObj.idl:
2879         * dom/EventTarget.idl:
2880
2881 2016-10-04  Brent Fulgham  <bfulgham@apple.com>
2882
2883         [Win][Direct2D] Add initial D2D GraphicsContext implementation
2884         https://bugs.webkit.org/show_bug.cgi?id=162917
2885
2886         Reviewed by Dean Jackson.
2887
2888         This patch lands a set of new files that implement the GraphicsContext
2889         features on Windows using Direct2D.
2890
2891         No new tests until complete backend lands.
2892
2893         * platform/graphics/Color.h: Add new casting operator.
2894         * platform/graphics/FloatSize.h: Ditto.
2895         * platform/graphics/GraphicsContext.cpp: Update for Direct2D
2896         implementation.
2897         * platform/graphics/GraphicsContext.h:
2898         * platform/graphics/win/ColorDirect2D.cpp:
2899         (WebCore::Color::operator D2D1_VECTOR_4F): Added.
2900         * platform/graphics/win/GraphicsContextCGWin.cpp: Add compiler
2901         guard to avoid building when using Direct2D.
2902         * platform/graphics/win/GraphicsContextDirect2D.cpp: Added.
2903         * platform/graphics/win/GraphicsContextPlatformPrivateDirect2D.h: Added.
2904         * platform/graphics/win/GraphicsContextWin.cpp: Update for Direct2D
2905         includes.
2906         * platform/graphics/win/TransformationMatrixDirect2D.cpp: Fix comment.
2907
2908 2016-10-04  Carlos Garcia Campos  <cgarcia@igalia.com>
2909
2910         [SOUP] Remove SSLPolicyFlags from SoupNetworkSession
2911         https://bugs.webkit.org/show_bug.cgi?id=162906
2912
2913         Reviewed by Michael Catanzaro.
2914
2915         All soup based ports are setting SSLUseSystemCAFile flag unconditionally, so we can just use that when creating
2916         the session like we do for all other construct parameters.
2917
2918         * platform/network/soup/SoupNetworkSession.cpp:
2919         (WebCore::SoupNetworkSession::createTestingSession):
2920         (WebCore::SoupNetworkSession::setupLogger):
2921         (WebCore::SoupNetworkSession::SoupNetworkSession): Deleted.
2922         (WebCore::SoupNetworkSession::clearOldSoupCache): Deleted.
2923         (WebCore::SoupNetworkSession::setHTTPProxy): Deleted.
2924         * platform/network/soup/SoupNetworkSession.h:
2925         (WebCore::SoupNetworkSession::soupSession): Deleted.
2926
2927 2016-10-04  Wenson Hsieh  <wenson_hsieh@apple.com>
2928
2929         Media controls are displayed in the incorrect state momentarily after switching between tabs playing media
2930         https://bugs.webkit.org/show_bug.cgi?id=162766
2931         <rdar://problem/28533523>
2932
2933         Reviewed by Jer Noble.
2934
2935         When showing Now Playing controls for a media session, we should first set up the Now Playing info and
2936         playback state before telling MediaRemote to make the session visible. This is WebKit work in ensuring that
2937         when switching Now Playing sessions by switching tabs, we do not first display an invalid Now Playing state
2938         before updating to the expected state.
2939
2940         Adds 2 new WebKit API tests in NowPlayingControlsTests: NowPlayingControlsHideAfterShowingClearsInfo and
2941         NowPlayingControlsClearInfoAfterSessionIsNoLongerValid.
2942
2943         * platform/audio/PlatformMediaSessionManager.h:
2944         (WebCore::PlatformMediaSessionManager::lastUpdatedNowPlayingTitle):
2945         (WebCore::PlatformMediaSessionManager::lastUpdatedNowPlayingDuration):
2946         (WebCore::PlatformMediaSessionManager::lastUpdatedNowPlayingElapsedTime):
2947         (WebCore::PlatformMediaSessionManager::hasActiveNowPlayingSession): Deleted.
2948         * platform/audio/mac/MediaSessionManagerMac.h:
2949         * platform/audio/mac/MediaSessionManagerMac.mm:
2950         (WebCore::MediaSessionManagerMac::updateNowPlayingInfo):
2951
2952 2016-10-04  Youenn Fablet  <youenn@apple.com>
2953
2954         [Fetch API] ReadableStream should be errored with TypeError values
2955         https://bugs.webkit.org/show_bug.cgi?id=162895
2956
2957         Reviewed by Alex Christensen.
2958
2959         Test: imported/w3c/web-platform-tests/fetch/api/basic/error-after-response.html
2960
2961         * Modules/fetch/FetchResponse.cpp:
2962         (WebCore::FetchResponse::BodyLoader::didFail): Removing FIXME.
2963         * bindings/js/ReadableStreamDefaultController.h:
2964         (WebCore::ReadableStreamDefaultController::error<String>): Erroring with TypeError values.
2965
2966 2016-10-03  Chris Dumez  <cdumez@apple.com>
2967
2968         Bindings do not throw a TypeError if a required dictionary member is missing
2969         https://bugs.webkit.org/show_bug.cgi?id=162734
2970
2971         Reviewed by Geoffrey Garen.
2972
2973         Bindings should throw a TypeError if a required dictionary member is missing.
2974         For example, if there is a "required long id" member in a dictionary that is
2975         missing, our bindings would prevously pass 0 to the implementation instead
2976         of throwing a TypeError.
2977
2978         Relevant specification:
2979         - https://heycam.github.io/webidl/#es-dictionary
2980
2981         I aligned our bindings generator implementation with the specification,
2982         except for the support for dictionary inheritance that is still missing
2983         and will be addressed in a follow-up patch.
2984
2985         No new tests, I rebaselined the bindings tests and this is already covered
2986         by fast/events/touch/touch-constructor.html on iOS.
2987
2988         * bindings/js/JSCustomElementRegistryCustom.cpp:
2989         (WebCore::JSCustomElementRegistry::define):
2990         * bindings/js/JSDOMConvert.h:
2991         (WebCore::convert): Deleted.
2992         (WebCore::Converter<bool>::convert): Deleted.
2993         (WebCore::Converter<String>::convert): Deleted.
2994         (WebCore::Converter<IDLDOMString>::convert): Deleted.
2995         (WebCore::Converter<IDLUSVString>::convert): Deleted.
2996         (WebCore::Converter<JSC::JSValue>::convert): Deleted.
2997         (WebCore::Converter<int8_t>::convert): Deleted.
2998         (WebCore::Converter<uint8_t>::convert): Deleted.
2999         * bindings/scripts/CodeGeneratorJS.pm:
3000         (GenerateDictionaryImplementationContent):
3001         * bindings/scripts/test/JS/JSTestObj.cpp:
3002         (WebCore::convertDictionary<TestObj::Dictionary>):
3003         (WebCore::convertDictionary<TestObj::DictionaryThatShouldNotTolerateNull>):
3004         (WebCore::convertDictionary<TestObj::DictionaryThatShouldTolerateNull>):
3005         (WebCore::convertDictionary<AlternateDictionaryName>):
3006
3007 2016-10-03  Zalan Bujtas  <zalan@apple.com>
3008
3009         [ListItems] Render tree should be all clean by the end of FrameView::layout().
3010         https://bugs.webkit.org/show_bug.cgi?id=162832
3011
3012         Reviewed by Simon Fraser.
3013
3014         List item markers are inserted into the tree during layout, right before laying out
3015         the list item (that's a big FIXME). At this point we already know what part of the tree
3016         needs to be laid out. Inserting a list item marker does not expand this dirty area.
3017         However whenever we insert a new renderer into the tree, we call setNeedsLayout on the contining block chain.
3018         In certain cases (floating renderers), it could potentially trigger some unintentional markings
3019         and we return from FrameView::layout() with a dirty subtree.
3020
3021         This patch preemptively marks the list item and its marker dirty so that
3022         when the marker is getting inserted into the tree, we stop the marking at the parent.
3023
3024         Not testable.
3025
3026         * rendering/RenderListItem.cpp:
3027         (WebCore::RenderListItem::insertOrMoveMarkerRendererIfNeeded):
3028
3029 2016-10-03  Myles C. Maxfield  <mmaxfield@apple.com>
3030
3031         Implement rendering of font-variation-settings
3032         https://bugs.webkit.org/show_bug.cgi?id=162782
3033
3034         Reviewed by Zalan Bujtas.
3035
3036         (Re-landing after fixing tests.)
3037
3038         Because the heavy lifting for font-variation-settings is done by CoreText, 
3039         this patch is fairly minimal. It simply hooks up the CSS property to CoreText. 
3040
3041         There is an existing bug in CoreText where variations inside fonts do not 
3042         survive the addition of a cascade list. Therefore, FontPlatformData::ctFont() 
3043         needs to work around this (conditionally) by resupplying the variation at 
3044         the same time as the cascade list. The CoreText bug is <rdar://problem/28449441>. 
3045
3046         Tests: fast/text/variations/duplicate.html
3047                fast/text/variations/exist.html
3048                fast/text/variations/inheritance.html
3049                fast/text/variations/order.html
3050                fast/text/variations/outofbounds.html
3051
3052         * platform/graphics/FontCache.h:
3053         * platform/graphics/cocoa/FontCacheCoreText.cpp:
3054         (WebCore::preparePlatformFont):
3055         (WebCore::fontWithFamily):
3056         (WebCore::FontCache::createFontPlatformData):
3057         (WebCore::FontCache::systemFallbackForCharacters):
3058         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
3059         (WebCore::cascadeToLastResortAttributesDictionary):
3060         (WebCore::cascadeToLastResortAndVariationsFontDescriptor):
3061         (WebCore::FontPlatformData::ctFont):
3062         (WebCore::cascadeToLastResortFontDescriptor): Deleted.
3063         * platform/graphics/mac/FontCustomPlatformData.cpp:
3064         (WebCore::FontCustomPlatformData::fontPlatformData):
3065         * rendering/RenderThemeIOS.mm:
3066         (WebCore::RenderThemeIOS::updateCachedSystemFontDescription):
3067
3068 2016-10-03  Alex Christensen  <achristensen@webkit.org>
3069
3070         URLParser should strip tabs at all locations
3071         https://bugs.webkit.org/show_bug.cgi?id=162836
3072
3073         Reviewed by Geoffrey Garen.
3074
3075         Covered by adding tabs to each location of each API test
3076         except tests that test the encoding of surrogate pairs,
3077         because inserting a tab between the pairs changes the encoding.
3078
3079         * platform/URLParser.cpp:
3080         (WebCore::URLParser::takesTwoAdvancesUntilEnd):
3081         (WebCore::URLParser::parse):
3082         (WebCore::URLParser::parseIPv4Number):
3083         (WebCore::URLParser::parseIPv4Host):
3084         * platform/URLParser.h:
3085
3086 2016-10-03  Antti Koivisto  <antti@apple.com>
3087
3088         Remove Document::elementSheet()
3089         https://bugs.webkit.org/show_bug.cgi?id=162876
3090
3091         Reviewed by Andreas Kling.
3092
3093         This is a Document owned stylesheet that exists as a context for parsing element inline style.
3094         It never contains any rules and is generally confusing.
3095
3096         This patch removes the requirement for a stylesheet to be present for CSSParser to operate in
3097         the correct context. Inline style is now parsed without stylesheet and a context object is
3098         passed instead.
3099
3100         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
3101         (WebCore::root):
3102         * bindings/js/JSCSSStyleDeclarationCustom.h:
3103         (WebCore::root): Deleted.
3104         * css/PropertySetCSSStyleDeclaration.cpp:
3105         (WebCore::PropertySetCSSStyleDeclaration::setCssText):
3106         (WebCore::PropertySetCSSStyleDeclaration::setProperty):
3107         (WebCore::PropertySetCSSStyleDeclaration::setPropertyInternal):
3108         (WebCore::PropertySetCSSStyleDeclaration::cssParserContext):
3109         (WebCore::StyleRuleCSSStyleDeclaration::parentStyleSheet):
3110         (WebCore::StyleRuleCSSStyleDeclaration::cssParserContext):
3111         (WebCore::InlineCSSStyleDeclaration::parentStyleSheet):
3112         (WebCore::InlineCSSStyleDeclaration::cssParserContext):
3113         * css/PropertySetCSSStyleDeclaration.h:
3114         (WebCore::PropertySetCSSStyleDeclaration::didMutate): Deleted.
3115         * css/StyleProperties.cpp:
3116         (WebCore::MutableStyleProperties::setProperty):
3117         (WebCore::MutableStyleProperties::setCustomProperty):
3118         (WebCore::MutableStyleProperties::parseDeclaration):
3119         * css/parser/CSSParser.cpp:
3120         (WebCore::CSSParser::parseValue):
3121         (WebCore::CSSParser::parseCustomPropertyValue):
3122         (WebCore::CSSParser::parseInlineStyleDeclaration):
3123         * css/parser/CSSParser.h:
3124         * css/parser/CSSParserImpl.cpp:
3125         (WebCore::CSSParserImpl::parseInlineStyleDeclaration):
3126         * dom/Document.cpp:
3127         (WebCore::Document::~Document):
3128         (WebCore::Document::updateBaseURL):
3129         (WebCore::Document::usesStyleBasedEditability):
3130         (WebCore::Document::setHasElementUsingStyleBasedEditability):
3131         (WebCore::Document::elementSheet): Deleted.
3132         * dom/Document.h:
3133         * dom/StyledElement.cpp:
3134         (WebCore::StyledElement::setInlineStyleFromString):
3135         (WebCore::StyledElement::invalidateStyleAttribute):
3136
3137             The usesStyleBasedEditability bit used to be set via the elementSheet. Instead check for it after inline style mutations.
3138
3139         (WebCore::StyledElement::setInlineStyleProperty):
3140         (WebCore::StyledElement::addPropertyToPresentationAttributeStyle):
3141         * dom/StyledElement.h:
3142         (WebCore::StyledElement::invalidateStyleAttribute): Deleted.
3143         * inspector/InspectorStyleSheet.cpp:
3144         (WebCore::InspectorStyleSheetForInlineStyle::getStyleAttributeRanges):
3145         * svg/SVGAnimateElementBase.cpp:
3146         (WebCore::applyCSSPropertyToTarget):
3147
3148 2016-10-03  Brent Fulgham  <bfulgham@apple.com>
3149
3150         Avoid null dereference when changing focus in design mode.
3151         https://bugs.webkit.org/show_bug.cgi?id=162877
3152         <rdar://problem/28061261>
3153
3154         Reviewed by Chris Dumez.
3155
3156         The bare m_frame pointer in DOMWindow can be cleared when setting focus to a new element. Check
3157         that the m_frame pointer is non-null before using it after calling a routine that could
3158         clear the pointer value.
3159
3160         Test: fast/frames/iframe-focus-crash.html
3161
3162         * page/DOMWindow.cpp:
3163         (WebCore::DOMWindow::focus): Check that the pointer is still non-null after setting the
3164         current focused element to nullptr.
3165
3166 2016-10-03  Chris Dumez  <cdumez@apple.com>
3167
3168         Add support for KeyboardEvent.key attribute
3169         https://bugs.webkit.org/show_bug.cgi?id=36267
3170
3171         Reviewed by Darin Adler.
3172
3173         Add support for KeyboardEvent.key attribute:
3174         - https://w3c.github.io/uievents/#dom-keyboardevent-key
3175
3176         This is behind a compile time flag that is only enabled on Mac and
3177         iOS and the implementation is still missing for other platforms.
3178
3179         Test: fast/events/keyboardevent-key.html
3180
3181         * dom/KeyboardEvent.cpp:
3182         (WebCore::KeyboardEvent::KeyboardEvent):
3183         * dom/KeyboardEvent.h:
3184         * dom/KeyboardEvent.idl:
3185         * platform/PlatformKeyboardEvent.h:
3186         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
3187         (WebCore::PlatformKeyboardEvent::key):
3188         * platform/cocoa/KeyEventCocoa.h:
3189         * platform/cocoa/KeyEventCocoa.mm:
3190         (WebCore::keyForCharCode):
3191         * platform/ios/PlatformEventFactoryIOS.h:
3192         * platform/ios/PlatformEventFactoryIOS.mm:
3193         (WebCore::keyForKeyEvent):
3194         (WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder):
3195         * platform/mac/PlatformEventFactoryMac.h:
3196         * platform/mac/PlatformEventFactoryMac.mm:
3197         (WebCore::keyForKeyEvent):
3198         (WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder):
3199         (WebCore::PlatformWheelEventBuilder::PlatformWheelEventBuilder): Deleted.
3200         * replay/SerializationMethods.cpp:
3201         (JSC::EncodingTraits<PlatformKeyboardEvent>::encodeValue):
3202         (JSC::EncodingTraits<PlatformKeyboardEvent>::decodeValue):
3203
3204 2016-10-03  Chris Dumez  <cdumez@apple.com>
3205
3206         Add support for KeyboardEvent.key attribute
3207         https://bugs.webkit.org/show_bug.cgi?id=36267
3208
3209         Reviewed by Darin Adler.
3210
3211         Add support for KeyboardEvent.key attribute:
3212         - https://w3c.github.io/uievents/#dom-keyboardevent-key
3213
3214         This is behind a compile time flag that is only enabled on Mac and
3215         iOS and the implementation is still missing for other platforms.
3216
3217         Test: fast/events/keyboardevent-key.html
3218
3219         * dom/KeyboardEvent.cpp:
3220         (WebCore::KeyboardEvent::KeyboardEvent):
3221         * dom/KeyboardEvent.h:
3222         * dom/KeyboardEvent.idl:
3223         * platform/PlatformKeyboardEvent.h:
3224         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
3225         (WebCore::PlatformKeyboardEvent::key):
3226         * platform/cocoa/KeyEventCocoa.h:
3227         * platform/cocoa/KeyEventCocoa.mm:
3228         (WebCore::keyForCharCode):
3229         * platform/ios/PlatformEventFactoryIOS.h:
3230         * platform/ios/PlatformEventFactoryIOS.mm:
3231         (WebCore::keyForKeyEvent):
3232         (WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder):
3233         * platform/mac/PlatformEventFactoryMac.h:
3234         * platform/mac/PlatformEventFactoryMac.mm:
3235         (WebCore::keyForKeyEvent):
3236         (WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder):
3237         (WebCore::PlatformWheelEventBuilder::PlatformWheelEventBuilder): Deleted.
3238         * replay/SerializationMethods.cpp:
3239         (JSC::EncodingTraits<PlatformKeyboardEvent>::encodeValue):
3240         (JSC::EncodingTraits<PlatformKeyboardEvent>::decodeValue):
3241
3242 2016-10-03  Alex Christensen  <achristensen@webkit.org>
3243
3244         URLParser: fragment-only URLs relative to file URLs should just add a fragment
3245         https://bugs.webkit.org/show_bug.cgi?id=162871
3246
3247         Reviewed by Geoffrey Garen.
3248
3249         Covered by new API tests.
3250
3251         * platform/URLParser.cpp:
3252         (WebCore::URLParser::parse):
3253         Instead of adding ///# after copying the base URL to the query, just add an #.
3254
3255 2016-10-03  Antoine Quint  <graouts@apple.com>
3256
3257         [Modern Media Controls] LayoutItem and Button classes
3258         https://bugs.webkit.org/show_bug.cgi?id=162868
3259         <rdar://problem/28590166>
3260
3261         Reviewed by Dean Jackson.
3262
3263         We introduce the new Button class and its parent class LayoutItem. We will subclass Button
3264         a lot in coming patches, as it provides a way to create a button and provide a delegate to
3265         respond to UI events via the `uiDelegate` property. A Button extends a LayoutItem, another
3266         class that we'll subclass heavily in coming patches, which is simply a LayoutNode with a
3267         `layoutDelegate` which allows to set the node's `layoutTraits`, a bit-mask allowing to
3268         specify layout attributes such as the platform and playback styles. 
3269
3270         Tests: media/modern-media-controls/button/button.html
3271                media/modern-media-controls/layout-item/layout-item.html
3272
3273         * Modules/modern-media-controls/controls/button.css: Added.
3274         (button):
3275         * Modules/modern-media-controls/controls/button.js: Added.
3276         (Button):
3277         (Button.prototype.get enabled):
3278         (Button.prototype.set enabled):
3279         (Button.prototype.handleEvent):
3280         (Button.prototype._handleUIEvent):
3281         * Modules/modern-media-controls/controls/layout-item.js: Added.
3282         (LayoutItem.prototype.get layoutTraits):
3283         (LayoutItem):
3284
3285 2016-10-03  Andy Estes  <aestes@apple.com>
3286
3287         ASSERTION FAILED: url.containsOnlyASCII() in WebCore::checkEncodedString() when parsing an invalid CSS cursor URL
3288         https://bugs.webkit.org/show_bug.cgi?id=162763
3289         <rdar://problem/28572758>
3290
3291         Reviewed by Youenn Fablet.
3292
3293         CSSCursorImageValue copies the URL of its underlying CSSImageValue by using the
3294         ParsedURLString URL constructor on the String returned by CSSImageValue::url(). While
3295         CSSImageValues were always being constructed from a URL implicitly converted to a String,
3296         nothing ensured that the URL was valid. For invalid URLs, URL::string() returns the string
3297         it was constructed with, which might still represent a relative URL or contain non-ASCII
3298         characters, violating the preconditions of the ParsedURLString URL constructor and causing
3299         an assertion to fail in Debug builds.
3300
3301         Fix this by having CSSImageValue store its image URL using a WebCore::URL rather than a
3302         String. CSSCursorImageValue can then copy this URL instead of attempting to re-parse a
3303         possibly-invalid URL string.
3304
3305         Test: fast/css/cursor-with-invalid-url.html
3306
3307         * css/CSSCursorImageValue.cpp:
3308         (WebCore::CSSCursorImageValue::CSSCursorImageValue): Copied m_imageValue.url() into
3309         m_originalURL instead of using the ParsedURLString URL constructor, since
3310         CSSImageValue::url() now returns a WebCore::URL.
3311         (WebCore::CSSCursorImageValue::loadImage): Created a URL from cursorElement->href() by
3312         calling Document::completeURL().
3313         * css/CSSImageValue.cpp:
3314         (WebCore::CSSImageValue::CSSImageValue): Changed to take a URL&& instead of a const String&.
3315         (WebCore::CSSImageValue::loadImage): Stopped calling Document::completeURL(), since m_url is
3316         now a WebCore::URL.
3317         * css/CSSImageValue.h: Changed url() to return a const URL&, and changed m_url to be a URL.
3318         * html/HTMLBodyElement.cpp:
3319         (WebCore::HTMLBodyElement::collectStyleForPresentationAttribute): Removed a call to
3320         URL::string().
3321         * html/HTMLTableElement.cpp:
3322         (WebCore::HTMLTableElement::collectStyleForPresentationAttribute): Ditto.
3323         * html/HTMLTablePartElement.cpp:
3324         (WebCore::HTMLTablePartElement::collectStyleForPresentationAttribute): Ditto.
3325
3326 2016-10-03  Zalan Bujtas  <zalan@apple.com>
3327
3328         Log an error to stderr when FrameView::layout() fails to clean all the renderers.
3329         https://bugs.webkit.org/show_bug.cgi?id=162835
3330
3331         Reviewed by Simon Fraser.
3332
3333         We've come across multiple layout/painting bugs caused by renderers left dirty
3334         after FrameView::layout(). This patch helps catching such issues early.
3335         Once all the blocking bugs are fixed (webkit.org/b/162835), logging should be replaced with ASSERT(). 
3336
3337         Not testable.
3338
3339         * page/FrameView.cpp:
3340         (WebCore::RenderTreeNeedsLayoutChecker::~RenderTreeNeedsLayoutChecker):
3341         (WebCore::FrameView::layout):
3342
3343 2016-10-03  Brent Fulgham  <bfulgham@apple.com>
3344
3345         [Win][Direct2D] Add D2D Bitmap Image handling code
3346         https://bugs.webkit.org/show_bug.cgi?id=162761
3347
3348         Reviewed by Dean Jackson.
3349
3350         This patch lands a set of new files that implement
3351         Image and BitmapImage features on Windows using
3352         Direct2D.
3353
3354         The desired ID2D1RenderTarget handle is needed by the
3355         image decoder so that it can load the resulting bitmap
3356         into the GPU.
3357
3358         No new tests until complete backend lands.
3359
3360         * platform/graphics/BitmapImage.cpp:
3361         (WebCore::BitmapImage::draw): Tell the Direct2D image decoder
3362         which render target to use.
3363         * platform/graphics/BitmapImage.h:
3364         * platform/graphics/ImageBuffer.cpp:
3365         * platform/graphics/ImageBuffer.h:
3366         * platform/graphics/ImageBufferData.h:
3367         * platform/graphics/ImageFrameCache.cpp:
3368         (WebCore::ImageFrameCache::setRenderTarget): Added.
3369         * platform/graphics/ImageFrameCache.h:
3370         (WebCore::ImageFrameCache::decoder): Added.
3371         * platform/graphics/ImageSource.cpp:
3372         * platform/graphics/ImageSource.h:
3373         (WebCore::ImageSource::setRenderTarget):
3374         * platform/graphics/win/ImageBufferDataDirect2D.cpp: Added.
3375         * platform/graphics/win/ImageBufferDataDirect2D.h: Added.
3376         * platform/graphics/win/ImageBufferDirect2D.cpp: Added.
3377         * platform/graphics/win/ImageCGWin.cpp:
3378         * platform/graphics/win/ImageDecoderDirect2D.cpp: Added.
3379         * platform/graphics/win/ImageDecoderDirect2D.h: Added.
3380         * platform/graphics/win/ImageDirect2D.cpp: Added.
3381         * platform/graphics/win/NativeImageDirect2D.cpp: Added.
3382
3383 2016-10-03  Carlos Garcia Campos  <cgarcia@igalia.com>
3384
3385         [SOUP] Remove unused methods toSoupMessage from ResourceRequest/Response
3386         https://bugs.webkit.org/show_bug.cgi?id=162867
3387
3388         Reviewed by Sergio Villar Senin.
3389
3390         * platform/network/soup/ResourceRequest.h:
3391         * platform/network/soup/ResourceRequestSoup.cpp:
3392         (WebCore::ResourceRequest::updateSoupMessage):
3393         (WebCore::ResourceRequest::updateFromSoupMessage): Deleted.
3394         * platform/network/soup/ResourceResponse.h:
3395         * platform/network/soup/ResourceResponseSoup.cpp:
3396         (WebCore::ResourceResponse::updateFromSoupMessage): Deleted.
3397
3398 2016-10-03  Youenn Fablet  <youenn@apple.com>
3399
3400         Remove FetchBody::m_isEmpty
3401         https://bugs.webkit.org/show_bug.cgi?id=162857
3402
3403         Reviewed by Alex Christensen.
3404
3405         No change of behavior.
3406
3407         Moving handling of null bodies in FetchBodyOwner, by having an Optional<FetchBody> in FetchBodyOwner.
3408         Moving storage of m_contentType in FetchBodyOwner.
3409
3410         Moving header storage from FetchResponse/FetchRequest to FetchBodyOwner, as it helps updating m_contentType.
3411
3412         * Modules/fetch/FetchBody.cpp: removing m_isEmpty and m_contentType.
3413         (WebCore::FetchBody::extract): Computes the default content-type which is stored in FetchBodyOwner.
3414         (WebCore::FetchBody::blob):
3415         (WebCore::FetchBody::consume):
3416         (WebCore::FetchBody::consumeAsStream):
3417         (WebCore::FetchBody::loadingSucceeded):
3418         (WebCore::FetchBody::bodyForInternalRequest):
3419         (WebCore::FetchBody::clone):
3420         * Modules/fetch/FetchBody.h:
3421         (WebCore::FetchBody::loadingBody):
3422         (WebCore::FetchBody::FetchBody):
3423         * Modules/fetch/FetchBodyOwner.cpp: