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