Unreviewed, rolling out r197793 and r197799.
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2016-03-08  Commit Queue  <commit-queue@webkit.org>
2
3         Unreviewed, rolling out r197793 and r197799.
4         https://bugs.webkit.org/show_bug.cgi?id=155195
5
6         something weird happened while landing this and everything
7         broke (Requested by olliej on #webkit).
8
9         Reverted changesets:
10
11         "Start moving to separated writable and executable mappings in
12         the JIT"
13         https://bugs.webkit.org/show_bug.cgi?id=155178
14         http://trac.webkit.org/changeset/197793
15
16         "arm64 build fix after r197793."
17         http://trac.webkit.org/changeset/197799
18
19 2016-03-08  Mark Lam  <mark.lam@apple.com>
20
21         synthesizePrototype() and friends need to be followed by exception checks (or equivalent).
22         https://bugs.webkit.org/show_bug.cgi?id=155169
23
24         Reviewed by Geoffrey Garen.
25
26         No new tests because this issue is covered by existing tests when the fix for
27         https://bugs.webkit.org/show_bug.cgi?id=154865 lands.  That patch is waiting for
28         this patch to land first so as to not introduce test failures.
29
30         * Modules/plugins/QuickTimePluginReplacement.mm:
31         (WebCore::QuickTimePluginReplacement::installReplacement):
32         * bindings/js/JSDeviceMotionEventCustom.cpp:
33         (WebCore::readAccelerationArgument):
34         (WebCore::readRotationRateArgument):
35         * bindings/js/JSGeolocationCustom.cpp:
36         (WebCore::createPositionOptions):
37         * bindings/js/JSHTMLCanvasElementCustom.cpp:
38         (WebCore::get3DContextAttributes):
39         * bindings/scripts/CodeGeneratorJS.pm:
40         (GenerateConstructorDefinition):
41         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
42         (WebCore::JSTestEventConstructorConstructor::construct):
43         * contentextensions/ContentExtensionParser.cpp:
44         (WebCore::ContentExtensions::getTypeFlags):
45         * html/HTMLMediaElement.cpp:
46         (WebCore::setPageScaleFactorProperty):
47         (WebCore::HTMLMediaElement::didAddUserAgentShadowRoot):
48         (WebCore::HTMLMediaElement::getCurrentMediaControlsStatus):
49         * html/HTMLPlugInImageElement.cpp:
50         (WebCore::HTMLPlugInImageElement::didAddUserAgentShadowRoot):
51
52 2016-03-08  Oliver Hunt  <oliver@apple.com>
53
54         Start moving to separated writable and executable mappings in the JIT
55         https://bugs.webkit.org/show_bug.cgi?id=155178
56
57         Reviewed by Filip Pizlo.
58
59         Update feature defines.
60
61         * Configurations/FeatureDefines.xcconfig:
62
63 2016-03-08  Commit Queue  <commit-queue@webkit.org>
64
65         Unreviewed, rolling out r197766.
66         https://bugs.webkit.org/show_bug.cgi?id=155183
67
68         Has platform-specific code in non-platform files (Requested by
69         smfr on #webkit).
70
71         Reverted changeset:
72
73         "AX: Force allow user zoom"
74         https://bugs.webkit.org/show_bug.cgi?id=155056
75         http://trac.webkit.org/changeset/197766
76
77 2016-03-08  Beth Dakin  <bdakin@apple.com>
78
79         Add an event for when touch force changes
80         https://bugs.webkit.org/show_bug.cgi?id=155143
81         -and corresponding-
82         rdar://problem/24068726
83
84         Reviewed by Darin Adler.
85
86         We will be able to test this once we fix the iOS touch tests. 
87
88         This patch adds touchforcechange which is a lot like the iOS equivalent of 
89         webkitmouseforcechanged. We had originally hoped to use touchmove to dispatch 
90         force changes, but that turned out to be a compatibility nightmare.
91
92         * dom/EventNames.h:
93         (WebCore::EventNames::isTouchEventType):
94         (WebCore::EventNames::isWheelEventType):
95         (WebCore::EventNames::touchEventNames):
96         * dom/GlobalEventHandlers.idl:
97         * html/HTMLAttributeNames.in:
98         * html/HTMLElement.cpp:
99         (WebCore::HTMLElement::createEventHandlerNameMap):
100         * platform/PlatformEvent.h:
101
102 2016-03-08  Anders Carlsson  <andersca@apple.com>
103
104         Ignore deprecation warnings.
105
106         * editing/cocoa/HTMLConverter.mm:
107         (HTMLConverter::computedAttributesForElement):
108         (HTMLConverter::_addMarkersToList):
109         * page/mac/EventHandlerMac.mm:
110         (WebCore::EventHandler::keyEvent):
111         (WebCore::lastEventIsMouseUp):
112         (WebCore::EventHandler::passSubframeEventToSubframe):
113         (WebCore::EventHandler::passWheelEventToWidget):
114         (WebCore::EventHandler::sendFakeEventsAfterWidgetTracking):
115         * page/mac/TextIndicatorWindow.mm:
116         (WebCore::TextIndicatorWindow::setTextIndicator):
117         * platform/graphics/mac/IconMac.mm:
118         (WebCore::Icon::paint):
119         * platform/mac/CursorMac.mm:
120         (WebCore::createCustomCursor):
121         * platform/mac/DragImageMac.mm:
122         (WebCore::dissolveDragImageToFraction):
123         (WebCore::createDragImageFromImage):
124         * platform/mac/EventLoopMac.mm:
125         (WebCore::EventLoop::cycle):
126         * platform/mac/PasteboardMac.mm:
127         (WebCore::Pasteboard::setDragImage):
128         * platform/mac/PlatformEventFactoryMac.mm:
129         (WebCore::globalPointForEvent):
130         (WebCore::pointForEvent):
131         (WebCore::mouseButtonForEvent):
132         (WebCore::mouseEventTypeForEvent):
133         (WebCore::clickCountForEvent):
134         (WebCore::textFromEvent):
135         (WebCore::unmodifiedTextFromEvent):
136         (WebCore::keyIdentifierForKeyEvent):
137         (WebCore::isKeypadEvent):
138         (WebCore::windowsKeyCodeForKeyEvent):
139         (WebCore::isKeyUpEvent):
140         (WebCore::modifiersForEvent):
141         (WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder):
142         * platform/mac/ScrollbarThemeMac.mm:
143         (WebCore::scrollbarControlSizeToNSControlSize):
144         * platform/mac/ThemeMac.mm:
145         (-[WebCoreThemeView window]):
146         (WebCore::controlSizeForFont):
147         (WebCore::controlSizeFromPixelSize):
148         (WebCore::setUpButtonCell):
149         (WebCore::stepperControlSizeForFont):
150         (WebCore::paintStepper):
151         (WebCore::ThemeMac::minimumControlSize):
152         * platform/mac/WebVideoFullscreenHUDWindowController.mm:
153         (-[WebVideoFullscreenHUDWindow initWithContentRect:styleMask:backing:defer:]):
154         (-[WebVideoFullscreenHUDWindow performKeyEquivalent:]):
155         (-[WebVideoFullscreenHUDWindowController init]):
156         (-[WebVideoFullscreenHUDWindowController keyDown:]):
157         (-[WebVideoFullscreenHUDWindowController windowDidLoad]):
158         * platform/mac/WebWindowAnimation.mm:
159         (WebWindowAnimationDurationFromDuration):
160         * rendering/RenderThemeMac.mm:
161         (WebCore::RenderThemeMac::updateCachedSystemFontDescription):
162         (WebCore::RenderThemeMac::controlSizeForFont):
163         (WebCore::RenderThemeMac::controlSizeForCell):
164         (WebCore::RenderThemeMac::controlSizeForSystemFont):
165         (WebCore::RenderThemeMac::paintProgressBar):
166         (WebCore::RenderThemeMac::popupMenuSize):
167         (WebCore::RenderThemeMac::sliderThumbHorizontal):
168         (WebCore::RenderThemeMac::sliderThumbVertical):
169
170 2016-03-08  Chris Dumez  <cdumez@apple.com>
171
172         Unreviewed attempt to fix the 32bit build after r197782.
173
174         * platform/MemoryPressureHandler.cpp:
175         (WebCore::MemoryPressureHandler::ReliefLogger::logMemoryUsageChange):
176
177 2016-03-08  Antonio Gomes  <tonikitoo@webkit.org>
178
179         Scrolling does not work when the mouse down is handled by a node
180         https://bugs.webkit.org/show_bug.cgi?id=19033
181
182         Reviewed by Simon Fraser.
183
184         Test: fast/events/prevent-default-prevents-interaction-with-scrollbars-.html
185
186         When a mouse press/down event happens on a scrollbar area, but event
187         is default prevented in the document level**, for example, event does not get
188         properly passed to scrollbars, although it should.
189
190         Problem started long ago with r17770, and was improved with r19596.
191         However, years later, the way Scrollbar* is obtained is still currently different
192         weither event is default prevented or not.
193
194         Patch uniforms the logic for both cases, and fixes the bug.
195
196         Note: code before used to look like
197
198         if (swallowEvent) {
199             <code>
200         } else {
201             <bleh>
202             <foo>
203         }
204
205         .. and now looks like
206
207         if (!swallowEvent)
208             <bleh>
209
210         <code>
211
212         if (!swallowEvent)
213             <foo>
214
215         ** e.g. document.addEventListener('mousedown', function (e) { e.preventDefault(); });
216
217         * page/EventHandler.cpp:
218         (WebCore::scrollbarForMouseEvent):
219         (WebCore::EventHandler::handleMousePressEvent):
220
221 2016-03-08  Chris Dumez  <cdumez@apple.com>
222
223         Unreviewed Windows build fix after r197728.
224
225         * platform/MemoryPressureHandler.cpp:
226         (WebCore::MemoryPressureHandler::ReliefLogger::logMemoryUsageChange):
227
228 2016-03-08  Commit Queue  <commit-queue@webkit.org>
229
230         Unreviewed, rolling out r197765.
231         https://bugs.webkit.org/show_bug.cgi?id=155172
232
233         The test added with this change is failing on all platforms.
234         (Requested by ryanhaddad on #webkit).
235
236         Reverted changeset:
237
238         "ImageDocuments leak their world."
239         https://bugs.webkit.org/show_bug.cgi?id=155167
240         http://trac.webkit.org/changeset/197765
241
242 2016-03-08  Antti Koivisto  <antti@apple.com>
243
244         Make Element const in ElementRuleCollector
245         https://bugs.webkit.org/show_bug.cgi?id=155170
246
247         Reviewed by Andreas Kling.
248
249         More const.
250
251         * css/ElementRuleCollector.cpp:
252         (WebCore::ElementRuleCollector::ElementRuleCollector):
253         (WebCore::ElementRuleCollector::matchAllRules):
254         * css/ElementRuleCollector.h:
255         * css/SelectorChecker.cpp:
256         (WebCore::SelectorChecker::checkOne):
257         (WebCore::SelectorChecker::matchesFocusPseudoClass):
258         * cssjit/SelectorCompiler.cpp:
259         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateAddStyleRelationIfResolvingStyle):
260         (WebCore::SelectorCompiler::addStyleRelationFunction):
261         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateContextFunctionCallTest):
262         (WebCore::SelectorCompiler::elementIsActive):
263         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsFirstChild):
264         (WebCore::SelectorCompiler::elementIsHovered):
265         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsOnlyChild):
266         (WebCore::SelectorCompiler::makeContextStyleUniqueIfNecessaryAndTestIsPlaceholderShown):
267         (WebCore::SelectorCompiler::isPlaceholderShown):
268         * cssjit/SelectorCompiler.h:
269         * dom/StyledElement.h:
270         (WebCore::StyledElement::additionalPresentationAttributeStyle):
271         (WebCore::StyledElement::inlineStyle):
272         (WebCore::StyledElement::collectStyleForPresentationAttribute):
273         (WebCore::StyledElement::invalidateStyleAttribute):
274         (WebCore::StyledElement::presentationAttributeStyle):
275         * html/HTMLTableCellElement.cpp:
276         (WebCore::HTMLTableCellElement::parseAttribute):
277         (WebCore::HTMLTableCellElement::additionalPresentationAttributeStyle):
278         * html/HTMLTableCellElement.h:
279         * html/HTMLTableColElement.cpp:
280         (WebCore::HTMLTableColElement::parseAttribute):
281         (WebCore::HTMLTableColElement::additionalPresentationAttributeStyle):
282         * html/HTMLTableColElement.h:
283         * html/HTMLTableElement.cpp:
284         (WebCore::leakBorderStyle):
285         (WebCore::HTMLTableElement::additionalPresentationAttributeStyle):
286         * html/HTMLTableElement.h:
287         * html/HTMLTableSectionElement.cpp:
288         (WebCore::HTMLTableSectionElement::create):
289         (WebCore::HTMLTableSectionElement::additionalPresentationAttributeStyle):
290         * html/HTMLTableSectionElement.h:
291         * inspector/InspectorCSSAgent.cpp:
292         (WebCore::InspectorCSSAgent::didUnregisterNamedFlowContentElement):
293         (WebCore::InspectorCSSAgent::forcePseudoState):
294         * inspector/InspectorCSSAgent.h:
295         * inspector/InspectorDOMAgent.cpp:
296         (WebCore::InspectorDOMAgent::pushNodePathToFrontend):
297         (WebCore::InspectorDOMAgent::boundNodeId):
298         (WebCore::InspectorDOMAgent::backendNodeIdForNode):
299         * inspector/InspectorDOMAgent.h:
300         * inspector/InspectorInstrumentation.cpp:
301         (WebCore::InspectorInstrumentation::handleMousePressImpl):
302         (WebCore::InspectorInstrumentation::forcePseudoStateImpl):
303         * inspector/InspectorInstrumentation.h:
304         (WebCore::InspectorInstrumentation::handleMousePress):
305         (WebCore::InspectorInstrumentation::forcePseudoState):
306
307 2016-03-08  Youenn Fablet  <youenn.fablet@crf.canon.fr>
308
309         [Fetch API] Commonalize handling of FetchBody by FetchRequest and FetchResponse
310         https://bugs.webkit.org/show_bug.cgi?id=154959
311
312         Reviewed by Darin Adler.
313
314         Introducing FetchBodyOwner class as base class of FetchRequest and FetchResponse.
315         This class is an ActiveDOMObject and is responsible of handling the Body API implemented by Request and Response.
316
317         Covered by existing tests.
318
319         * Modules/fetch/FetchBodyOwner.h: Added.
320         (WebCore::FetchBodyOwner::isDisturbed):
321         (WebCore::FetchBodyOwner::arrayBuffer):
322         (WebCore::FetchBodyOwner::formData):
323         (WebCore::FetchBodyOwner::blob):
324         (WebCore::FetchBodyOwner::json):
325         (WebCore::FetchBodyOwner::text):
326         (WebCore::FetchBodyOwner::body):
327         (WebCore::FetchBodyOwner::FetchBodyOwner):
328         * Modules/fetch/FetchRequest.h:
329         (WebCore::FetchRequest::FetchRequest):
330         * Modules/fetch/FetchResponse.cpp:
331         (WebCore::FetchResponse::FetchResponse):
332         * Modules/fetch/FetchResponse.h:
333         * WebCore.xcodeproj/project.pbxproj:
334
335 2016-03-08  Chris Dumez  <cdumez@apple.com>
336
337         Unreviewed, fix 32-bit build after r197726.
338
339         Also, re-enable static_assert to check the ElementRareData size.
340
341         * dom/ElementRareData.cpp:
342
343 2016-03-08  Brent Fulgham  <bfulgham@apple.com>
344
345         Unreviewed test fix after r197721.
346         https://bugs.webkit.org/show_bug.cgi?id=155120
347         <rdar://problem/25010167>
348
349         If a WK1 client turns on the "Resource Load Statistics" debug flag, but
350         does not supply a data modification handler, we dereference a null function.
351
352         * loader/ResourceLoadStatisticsStore.cpp:
353         (WebCore::ResourceLoadStatisticsStore::fireDataModificationHandler): Check
354         for nullptr function before invoking it.
355
356 2016-03-08  Chris Dumez  <cdumez@apple.com>
357
358         Unreviewed, temporarily comment out static_assert while I investigate.
359
360         It still did not build on some platforms.
361
362         * dom/ElementRareData.cpp:
363
364 2016-03-08  Chris Dumez  <cdumez@apple.com>
365
366         Unreviewed, another build fix after r197726.
367
368         * dom/ElementRareData.cpp:
369
370 2016-03-08  Chris Dumez  <cdumez@apple.com>
371
372         Unreviewed Windows build fix after r197728.
373
374         * platform/MemoryPressureHandler.cpp:
375
376 2016-03-08  Chris Dumez  <cdumez@apple.com>
377
378         Unreviewed build fix after r197726.
379
380         * dom/ElementRareData.cpp:
381
382 2016-03-08  Nan Wang  <n_wang@apple.com>
383
384         AX: Force allow user zoom
385         https://bugs.webkit.org/show_bug.cgi?id=155056
386
387         Reviewed by Chris Fleizach.
388
389         Override the maximum scale factor when forceAlwaysUserScalable is true.
390
391         Test: accessibility/ios-simulator/force-user-scalable.html
392
393         * page/ViewportConfiguration.h:
394         (WebCore::ViewportConfiguration::maximumScale):
395         * testing/Internals.cpp:
396         (WebCore::Internals::composedTreeAsText):
397         (WebCore::Internals::setViewportForceAlwaysUserScalable):
398         (WebCore::Internals::viewportConfigurationMaximumScale):
399         * testing/Internals.h:
400         * testing/Internals.idl:
401
402 2016-03-08  Andreas Kling  <akling@apple.com>
403
404         ImageDocuments leak their world.
405         <https://webkit.org/b/155167>
406         <rdar://problem/24987363>
407
408         Reviewed by Antti Koivisto.
409
410         ImageDocument uses a special code path in ImageLoader in order to manually
411         control how the image is loaded. It has to do this because the ImageDocument
412         is really just a synthetic wrapper around a main resource that's an image.
413
414         This custom loading code had a bug where it would create a new CachedImage
415         and neglect to set its CachedResource::m_state flag to Pending (which is
416         normally set by CachedResource::load(), but we don't call that for these.)
417
418         This meant that when ImageDocument called CachedImage::finishLoading() to
419         trigger the notifyFinished() callback path, the image would look at its
420         loading state and see that it was Unknown (not Pending), and conclude that
421         it hadn't loaded yet. So we never got the notifyFinished() signal.
422
423         The world leaks here because ImageLoader slaps a ref on its <img> element
424         while it waits for the loading operation to complete. Once finished, whether
425         successfully or with an error, it derefs the <img>.
426
427         Since we never fired notifyFinished(), we ended up with an extra ref on
428         these <img> forever, and then the element kept its document alive too.
429
430         Test: fast/dom/ImageDocument-world-leak.html
431
432         * loader/ImageLoader.cpp:
433         (WebCore::ImageLoader::updateFromElement):
434
435 2016-03-07  Antti Koivisto  <antti@apple.com>
436
437         ElementRuleCollector should not mutate document and style
438         https://bugs.webkit.org/show_bug.cgi?id=155113
439
440         Reviewed by Andreas Kling.
441
442         Move applying of style relations out of ElementRuleCollector and StyleResolver.
443         This gets us closer to making StyleResolver const for Element.
444
445         * CMakeLists.txt:
446         * WebCore.xcodeproj/project.pbxproj:
447         * css/ElementRuleCollector.cpp:
448         (WebCore::ElementRuleCollector::ElementRuleCollector):
449
450             No need for style parameter anymore.
451
452         (WebCore::ElementRuleCollector::collectMatchingRules):
453         (WebCore::ElementRuleCollector::sortAndTransferMatchedRules):
454         (WebCore::ElementRuleCollector::ruleMatches):
455
456             Client will now do the style and element mutations. Just collect the data here.
457
458         (WebCore::ElementRuleCollector::collectMatchingRulesForList):
459         (WebCore::ElementRuleCollector::commitStyleRelations): Deleted.
460
461             Moves to StyleRelations.cpp
462
463         * css/ElementRuleCollector.h:
464         (WebCore::ElementRuleCollector::hasMatchedRules):
465         (WebCore::ElementRuleCollector::matchedPseudoElementIds):
466         (WebCore::ElementRuleCollector::styleRelations):
467         (WebCore::ElementRuleCollector::didMatchUncommonAttributeSelector):
468         * css/MediaQueryMatcher.cpp:
469         (WebCore::MediaQueryMatcher::prepareEvaluator):
470         (WebCore::MediaQueryMatcher::evaluate):
471         * css/SelectorChecker.cpp:
472         (WebCore::addStyleRelation):
473         (WebCore::isFirstChildElement):
474         (WebCore::isFirstOfType):
475         (WebCore::countElementsBefore):
476         (WebCore::countElementsOfTypeBefore):
477         (WebCore::SelectorChecker::matchRecursively):
478         (WebCore::SelectorChecker::checkOne):
479         * css/SelectorChecker.h:
480         (WebCore::SelectorChecker::CheckingContext::CheckingContext):
481         * css/StyleMedia.cpp:
482         (WebCore::StyleMedia::matchMedium):
483         * css/StyleResolver.cpp:
484         (WebCore::StyleResolver::StyleResolver):
485         (WebCore::isAtShadowBoundary):
486         (WebCore::StyleResolver::styleForElement):
487
488             Apply the style relations affecting current style immediately.
489             Pass the rest to the client.
490
491         (WebCore::StyleResolver::styleForKeyframe):
492         (WebCore::StyleResolver::pseudoStyleForElement):
493         (WebCore::StyleResolver::pseudoStyleRulesForElement):
494         * css/StyleResolver.h:
495         (WebCore::ElementStyle::ElementStyle):
496         * cssjit/SelectorCompiler.cpp:
497         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateAddStyleRelationIfResolvingStyle):
498         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateAddStyleRelation):
499         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateSelectorCheckerExcludingPseudoElements):
500         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateDirectAdjacentTreeWalker):
501         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateIndirectAdjacentTreeWalker):
502         (WebCore::SelectorCompiler::addStyleRelationFunction):
503         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsActive):
504         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsEmpty):
505         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsFirstChild):
506         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsHovered):
507         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsLastChild):
508         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsOnlyChild):
509         (WebCore::SelectorCompiler::makeContextStyleUniqueIfNecessaryAndTestIsPlaceholderShown):
510         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthChild):
511         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthChildOf):
512         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthLastChild):
513         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthLastChildOf):
514         * dom/Document.cpp:
515         (WebCore::Document::styleForElementIgnoringPendingStylesheets):
516
517             Apply style relations.
518
519         (WebCore::Document::updateLayoutIfDimensionsOutOfDate):
520         * dom/Element.cpp:
521         (WebCore::Element::styleResolver):
522         (WebCore::Element::resolveStyle):
523         (WebCore::Element::didDetachRenderers):
524         (WebCore::Element::resolveCustomStyle):
525
526             Return ElementStyle (which contains style relations along with the render style).
527             Rename for consistency.
528
529         (WebCore::Element::cloneAttributesFromElement):
530         (WebCore::Element::customStyleForRenderer): Deleted.
531         * dom/Element.h:
532         (WebCore::Element::isVisibleInViewportChanged):
533         * dom/PseudoElement.cpp:
534         (WebCore::PseudoElement::clearHostElement):
535         (WebCore::PseudoElement::resolveCustomStyle):
536         (WebCore::PseudoElement::didAttachRenderers):
537         (WebCore::PseudoElement::customStyleForRenderer): Deleted.
538         * dom/PseudoElement.h:
539         * html/HTMLTitleElement.cpp:
540         (WebCore::HTMLTitleElement::computedTextWithDirection):
541         * html/shadow/SliderThumbElement.cpp:
542         (WebCore::SliderThumbElement::hostInput):
543         (WebCore::SliderThumbElement::resolveCustomStyle):
544         (WebCore::SliderThumbElement::shadowPseudoId):
545         (WebCore::SliderContainerElement::createElementRenderer):
546         (WebCore::SliderContainerElement::resolveCustomStyle):
547         (WebCore::SliderContainerElement::shadowPseudoId):
548         (WebCore::SliderThumbElement::customStyleForRenderer): Deleted.
549         (WebCore::SliderContainerElement::customStyleForRenderer): Deleted.
550         * html/shadow/SliderThumbElement.h:
551         * html/shadow/TextControlInnerElements.cpp:
552         (WebCore::TextControlInnerElement::create):
553         (WebCore::TextControlInnerElement::resolveCustomStyle):
554         (WebCore::TextControlInnerTextElement::renderer):
555         (WebCore::TextControlInnerTextElement::resolveCustomStyle):
556         (WebCore::TextControlPlaceholderElement::TextControlPlaceholderElement):
557         (WebCore::TextControlPlaceholderElement::resolveCustomStyle):
558         (WebCore::TextControlInnerElement::customStyleForRenderer): Deleted.
559         (WebCore::TextControlInnerTextElement::customStyleForRenderer): Deleted.
560         (WebCore::TextControlPlaceholderElement::customStyleForRenderer): Deleted.
561         * html/shadow/TextControlInnerElements.h:
562         * rendering/RenderElement.cpp:
563         (WebCore::RenderElement::getUncachedPseudoStyle):
564         * rendering/RenderNamedFlowFragment.cpp:
565         (WebCore::RenderNamedFlowFragment::computeStyleInRegion):
566         (WebCore::RenderNamedFlowFragment::computeChildrenStyleInRegion):
567         * style/StyleRelations.cpp: Added.
568         (WebCore::Style::commitRelationsToRenderStyle):
569
570             Commit relations affecting style that is being computed.
571
572         (WebCore::Style::commitRelationsToDocument):
573
574             Commit relations that mutate document.
575
576         * style/StyleRelations.h: Added.
577
578             Factor style relation data structures and functions to a file of their own.
579
580         (WebCore::Style::Relation::Relation):
581         * style/StyleSharingResolver.cpp:
582         (WebCore::Style::SharingResolver::styleSharingCandidateMatchesRuleSet):
583         * style/StyleTreeResolver.cpp:
584         (WebCore::Style::TreeResolver::styleForElement):
585
586             Apply style relations.
587
588         * style/StyleTreeResolver.h:
589         * svg/SVGElement.cpp:
590         (WebCore::SVGElement::synchronizeSystemLanguage):
591         (WebCore::SVGElement::resolveCustomStyle):
592         (WebCore::SVGElement::customStyleForRenderer): Deleted.
593         * svg/SVGElement.h:
594         * svg/SVGElementRareData.h:
595         (WebCore::SVGElementRareData::overrideComputedStyle):
596
597 2016-03-08  Youenn Fablet  <youenn.fablet@crf.canon.fr>
598
599         [Fetch API] Implement fetch skeleton
600         https://bugs.webkit.org/show_bug.cgi?id=155111
601
602         Reviewed by Darin Adler.
603
604         Adding skeleton code to call fetch API from normal and worker scopes.
605         Fetch API implementation is limited to reject the promise.
606
607         Updating the binding generator to fix the case of overloaded promise-returning functions.
608         Made overloaded utility functions "static inline".
609
610         Tests: imported/w3c/web-platform-tests/fetch/api/basic/accept-header-worker.html
611                imported/w3c/web-platform-tests/fetch/api/basic/accept-header.html
612                imported/w3c/web-platform-tests/fetch/api/basic/integrity-worker.html
613                imported/w3c/web-platform-tests/fetch/api/basic/integrity.html
614                imported/w3c/web-platform-tests/fetch/api/basic/mode-no-cors-worker.html
615                imported/w3c/web-platform-tests/fetch/api/basic/mode-no-cors.html
616                imported/w3c/web-platform-tests/fetch/api/basic/mode-same-origin-worker.html
617                imported/w3c/web-platform-tests/fetch/api/basic/mode-same-origin.html
618                imported/w3c/web-platform-tests/fetch/api/basic/request-forbidden-headers-worker.html
619                imported/w3c/web-platform-tests/fetch/api/basic/request-forbidden-headers.html
620                imported/w3c/web-platform-tests/fetch/api/basic/request-headers-worker.html
621                imported/w3c/web-platform-tests/fetch/api/basic/request-headers.html
622                imported/w3c/web-platform-tests/fetch/api/basic/scheme-about-worker.html
623                imported/w3c/web-platform-tests/fetch/api/basic/scheme-about.html
624                imported/w3c/web-platform-tests/fetch/api/basic/scheme-blob-worker.html
625                imported/w3c/web-platform-tests/fetch/api/basic/scheme-blob.html
626                imported/w3c/web-platform-tests/fetch/api/basic/scheme-data-worker.html
627                imported/w3c/web-platform-tests/fetch/api/basic/scheme-data.html
628                imported/w3c/web-platform-tests/fetch/api/basic/scheme-others-worker.html
629                imported/w3c/web-platform-tests/fetch/api/basic/scheme-others.html
630                imported/w3c/web-platform-tests/fetch/api/basic/stream-response-worker.html
631                imported/w3c/web-platform-tests/fetch/api/basic/stream-response.html
632
633         * CMakeLists.txt:
634         * DerivedSources.make:
635         * Modules/fetch/DOMWindowFetch.cpp: Added.
636         (WebCore::DOMWindowFetch::fetch):
637         * Modules/fetch/DOMWindowFetch.h: Added.
638         * Modules/fetch/DOMWindowFetch.idl: Added.
639         * Modules/fetch/WorkerGlobalScopeFetch.cpp: Added.
640         (WebCore::WorkerGlobalScopeFetch::fetch):
641         * Modules/fetch/WorkerGlobalScopeFetch.h: Added.
642         * Modules/fetch/WorkerGlobalScopeFetch.idl: Added.
643         * WebCore.xcodeproj/project.pbxproj:
644         * bindings/scripts/CodeGeneratorJS.pm:
645         (GenerateImplementation): Fixing the case of overloaded promise-returning functions.
646         * bindings/scripts/test/JS/JSTestObj.cpp:
647         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod1):
648         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod2):
649         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod3):
650         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod4):
651         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod5):
652         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod6):
653         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod7):
654         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod8):
655         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod9):
656         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod10):
657         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod11):
658         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod12):
659         (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter1):
660         (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter2):
661         (WebCore::jsTestObjConstructorFunctionOverloadedMethod11):
662         (WebCore::jsTestObjConstructorFunctionOverloadedMethod12):
663         (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction1):
664         (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction1Promise):
665         (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction2):
666         (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction2Promise):
667         (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction):
668         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod): Deleted.
669         (WebCore::jsTestObjConstructorFunctionClassMethod2): Deleted.
670         (WebCore::jsTestObjPrototypeFunctionAny): Deleted.
671         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionPromise): Deleted.
672         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithFloatArgumentPromise): Deleted.
673         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithExceptionPromise): Deleted.
674         * bindings/scripts/test/TestObj.idl:
675
676 2016-03-08  Youenn Fablet  <youenn.fablet@crf.canon.fr>
677
678         [Fetch API] Make FetchRequest and FetchResponse ActiveDOMObject
679         https://bugs.webkit.org/show_bug.cgi?id=154729
680
681         Reviewed by Darin Adler.
682
683         Covered by existing tests.
684
685         Making FetchRequest and FetchResponse ActiveDOMObject.
686         Both objects can always be suspended now.
687         This might be updated when blob conversion is added or when fetching data to fill in FetchResponse.
688
689         * Modules/fetch/FetchRequest.cpp:
690         (WebCore::FetchRequest::create):
691         (WebCore::FetchRequest::clone):
692         (WebCore::FetchRequest::activeDOMObjectName):
693         (WebCore::FetchRequest::canSuspendForDocumentSuspension):
694         * Modules/fetch/FetchRequest.h:
695         (WebCore::FetchRequest::FetchRequest):
696         * Modules/fetch/FetchRequest.idl:
697         * Modules/fetch/FetchResponse.cpp:
698         (WebCore::FetchResponse::error):
699         (WebCore::FetchResponse::redirect):
700         (WebCore::FetchResponse::FetchResponse):
701         (WebCore::FetchResponse::clone):
702         (WebCore::FetchResponse::activeDOMObjectName):
703         (WebCore::FetchResponse::canSuspendForDocumentSuspension):
704         * Modules/fetch/FetchResponse.h:
705         (WebCore::FetchResponse::create):
706         * Modules/fetch/FetchResponse.idl:
707
708 2016-03-08  Nikos Andronikos  <nikos.andronikos-webkit@cisra.canon.com.au>
709
710         [SVG2] Implement marker orient='auto-start-reverse'
711         https://bugs.webkit.org/show_bug.cgi?id=138456
712
713         Reviewed by Darin Adler.
714
715         https://www.w3.org/TR/SVG2/painting.html#OrientAttribute
716         marker-start markers must be oriented at 180 degrees to the direction of the path when
717         the orient attribute of the marker is set to 'auto-start-reverse'.
718
719         To acheive this the SVGMarkerData class which calculates the angles for each marker on
720         a path must know whether the orient type is set to reverse the start marker. 
721
722         Tests: svg/animations/animate-marker-orient-from-angle-to-autostartreverse.html
723                svg/animations/animate-marker-orienttype-4.html
724                svg/custom/marker-auto-start-reverse.html
725
726         * rendering/svg/RenderSVGShape.cpp:
727         (WebCore::RenderSVGShape::processMarkerPositions):
728           Create marker data, using animated value of orient to determine
729           if first marker should be reversed.
730         * rendering/svg/SVGMarkerData.h:
731         (WebCore::SVGMarkerData::SVGMarkerData):
732           Constructor now requires boolean indicating if start marker is 
733           reversed.
734         (WebCore::SVGMarkerData::currentAngle):
735           Take into account whether start marker should be reversed.
736         * rendering/svg/SVGResources.cpp:
737         (WebCore::SVGResources::markerReverseStart):
738           New function to query whether start marker should be reversed.
739         * rendering/svg/SVGResources.h:
740           Add declaration for new function.
741         * svg/SVGAnimatedAngle.cpp:
742         (WebCore::SVGAnimatedAngleAnimator::calculateAnimatedValue):
743           Support animation including the value auto-start-reverse.
744         * svg/SVGMarkerElement.cpp:
745         (WebCore::SVGMarkerElement::setOrient):
746           Combine duplicated functionality into one private method
747         (WebCore::SVGMarkerElement::setOrientToAuto):
748           Set orient type and angle correctly for orient=auto. Uses setOrient.
749         (WebCore::SVGMarkerElement::setOrientToAngle):
750           Set orient type and angle correctly for orient=<angle>. Uses setOrient.
751         (WebCore::SVGMarkerElement::synchronizeOrientType):
752           Support auto-start-reverse as a possible case.
753         * svg/SVGMarkerElement.h:
754         (WebCore::SVGIDLEnumLimits<SVGMarkerOrientType>::highestExposedEnumValue):
755           Limit the orient DOM property so that the new enum value
756           required for auto-start-reverse is not exposed.
757         (WebCore::SVGPropertyTraits<SVGMarkerOrientType>::highestEnumValue):
758           Support auto-start-reverse.
759         (WebCore::SVGPropertyTraits<SVGMarkerOrientType>::fromString):
760           Support auto-start-reverse.
761
762 2016-03-07  Keith Rollin  <krollin@apple.com>
763
764         Enhance logging: Use "always on" macros
765         https://bugs.webkit.org/show_bug.cgi?id=154499
766         <rdar://problem/24757730>
767
768         Reviewed by Chris Dumez.
769
770         Make use of new logging macros by reporting on frame and resource
771         load activity.
772
773         Add new logging to memory pressure handler to show when it's called
774         and its effectiveness. As part of this change, the various
775         platform-specific implementations have been unified.
776
777         No new tests. No new basic functionality has been added. Only new
778         logging has been added in release mode or has been enabled to execute
779         in release mode as well as debug mode.
780
781         * loader/FrameLoader.cpp:
782         (WebCore::FrameLoader::prepareForLoadStart):
783         (WebCore::FrameLoader::checkLoadCompleteForThisFrame):
784         (WebCore::FrameLoader::isAlwaysOnLoggingAllowed):
785         * loader/FrameLoader.h:
786         * loader/ResourceLoader.cpp:
787         (WebCore::ResourceLoader::isAlwaysOnLoggingAllowed):
788         * loader/ResourceLoader.h:
789         * page/Frame.cpp:
790         (WebCore::Frame::isAlwaysOnLoggingAllowed):
791         * page/Frame.h:
792         * page/Page.cpp:
793         (WebCore::Page::isAlwaysOnLoggingAllowed):
794         * page/Page.h:
795         * page/SessionID.h:
796         (WebCore::SessionID::isAlwaysOnLoggingAllowed):
797         * platform/MemoryPressureHandler.cpp:
798         (WebCore::MemoryPressureHandler::ReliefLogger::logMemoryUsageChange):
799         (WebCore::MemoryPressureHandler::ReliefLogger::platformLog): Deleted.
800         * platform/MemoryPressureHandler.h:
801         (WebCore::MemoryPressureHandler::ReliefLogger::ReliefLogger):
802         (WebCore::MemoryPressureHandler::ReliefLogger::~ReliefLogger):
803         * platform/cocoa/MemoryPressureHandlerCocoa.mm:
804         (WebCore::MemoryPressureHandler::ReliefLogger::platformLog): Deleted.
805         * platform/linux/MemoryPressureHandlerLinux.cpp:
806         (WebCore::MemoryPressureHandler::ReliefLogger::platformLog): Deleted.
807         * platform/win/MemoryPressureHandlerWin.cpp:
808         (WebCore::MemoryPressureHandler::ReliefLogger::platformLog): Deleted.
809
810 2016-03-07  Chris Dumez  <cdumez@apple.com>
811
812         Align HTMLCanvasElement.width / height with the specification
813         https://bugs.webkit.org/show_bug.cgi?id=155156
814
815         Reviewed by Ryosuke Niwa.
816
817         Align HTMLCanvasElement.width / height with the specification:
818         - https://html.spec.whatwg.org/multipage/scripting.html#dom-canvas-width
819         - https://html.spec.whatwg.org/multipage/scripting.html#attr-canvas-width
820
821         In particular, the following changes were made:
822         1. The attributes are now 'unsigned long' instead of 'long'
823         2. The corresponding content attributes are parsed as per the HTML rules
824            for passing non-negative integers.
825         3. Upon setting, if the value is out-of-range, the content attributes is
826            set to its default value.
827
828         No new tests, already covered by existing test.
829
830         * html/HTMLCanvasElement.cpp:
831         (WebCore::HTMLCanvasElement::setHeight):
832         (WebCore::HTMLCanvasElement::setWidth):
833         (WebCore::HTMLCanvasElement::reset):
834         * html/HTMLCanvasElement.h:
835         * html/HTMLCanvasElement.idl:
836
837 2016-03-07  Chris Dumez  <cdumez@apple.com>
838
839         Stop clamping HTMLElement.tabIndex to the range of a short
840         https://bugs.webkit.org/show_bug.cgi?id=155159
841
842         Reviewed by Ryosuke Niwa.
843
844         Stop clamping HTMLElement.tabIndex to the range of a short. We
845         apparently did this to match Firefox. However, this no longer matches
846         Firefox's behavior nor the HTML specification:
847         - https://html.spec.whatwg.org/multipage/interaction.html#dom-tabindex
848
849         No new tests, already covered by existing test.
850
851         * dom/Element.cpp:
852         (WebCore::Element::setTabIndexExplicitly):
853         (WebCore::Element::tabIndex):
854         * dom/Element.h:
855         * dom/ElementRareData.h:
856         (WebCore::ElementRareData::tabIndex):
857         (WebCore::ElementRareData::setTabIndexExplicitly):
858         * html/HTMLAnchorElement.cpp:
859         (WebCore::HTMLAnchorElement::tabIndex):
860         * html/HTMLAnchorElement.h:
861         * html/HTMLElement.cpp:
862         (WebCore::HTMLElement::parseAttribute):
863         (WebCore::HTMLElement::tabIndex):
864         * html/HTMLElement.h:
865         * html/HTMLFormControlElement.cpp:
866         (WebCore::HTMLFormControlElement::tabIndex):
867         * html/HTMLFormControlElement.h:
868         * page/FocusController.cpp:
869         (WebCore::nextElementWithGreaterTabIndex):
870         (WebCore::FocusController::previousFocusableElement):
871         * svg/SVGAElement.cpp:
872         (WebCore::SVGAElement::tabIndex):
873         * svg/SVGAElement.h:
874         * svg/SVGElement.cpp:
875         (WebCore::SVGElement::tabIndex):
876         (WebCore::SVGElement::parseAttribute):
877         * svg/SVGElement.h:
878
879 2016-03-07  Daniel Bates  <dabates@apple.com>
880
881         CSP: Source '*' should not match URLs with schemes blob, data, or filesystem
882         https://bugs.webkit.org/show_bug.cgi?id=154122
883         <rdar://problem/24613336>
884
885         Reviewed by Brent Fulgham.
886
887         Restrict matching of source expression * to HTTP or HTTPS URLs for all directives except
888         img-src and media-src. This policy is more restrictive than the policy described in section
889         Matching Source Expressions of the Content Security Policy 2.0 spec., <https://www.w3.org/TR/2015/CR-CSP2-20150721>,
890         which restricts matching * to schemes that are not blob, data, or filesystem.
891
892         For directive img-src we restrict matching of * to HTTP, HTTPS, and data URLs. For directive
893         media-src we restrict matching of * to HTTP, HTTPS, data URLs and blob URLs. We use a
894         more lenient interpretation of * for directives img-src and media-src than required by
895         the spec. to mitigate web compatibility issues.
896
897         Tests: fast/dom/HTMLImageElement/image-with-blob-url-blocked-by-csp-img-src-star.html
898                fast/dom/HTMLImageElement/image-with-data-url-allowed-by-csp-img-src-star.html
899                fast/dom/HTMLImageElement/image-with-file-url-blocked-by-csp-img-src-star.html
900                fast/dom/HTMLLinkElement/link-with-blob-url-blocked-by-csp-style-src-star.html
901                fast/dom/HTMLLinkElement/link-with-data-url-blocked-by-csp-style-src-star.html
902                fast/dom/HTMLLinkElement/link-with-file-url-blocked-by-csp-style-src-star.html
903                http/tests/security/contentSecurityPolicy/image-with-http-url-allowed-by-csp-img-src-star.html
904                http/tests/security/contentSecurityPolicy/image-with-https-url-allowed-by-csp-img-src-star.html
905                http/tests/security/contentSecurityPolicy/javascript-url-blocked-by-default-src-star.html
906                http/tests/security/contentSecurityPolicy/link-with-http-url-allowed-by-csp-style-src-star.html
907                http/tests/security/contentSecurityPolicy/link-with-https-url-allowed-by-csp-style-src-star.html
908                http/tests/security/contentSecurityPolicy/video-with-http-url-allowed-by-csp-media-src-star.html
909                http/tests/security/contentSecurityPolicy/video-with-https-url-allowed-by-csp-media-src-star.html
910                media/video-with-blob-url-allowed-by-csp-media-src-star.html
911                media/video-with-data-url-allowed-by-csp-media-src-star.html
912                media/video-with-file-url-blocked-by-csp-media-src-star.html
913
914         * page/csp/ContentSecurityPolicySourceList.cpp:
915         (WebCore::ContentSecurityPolicySourceList::isProtocolAllowedByStar): Added.
916         (WebCore::ContentSecurityPolicySourceList::matches): Modified to only match * if ContentSecurityPolicySourceList::isProtocolAllowedByStar().
917         evaluates to true.
918         * page/csp/ContentSecurityPolicySourceList.h:
919
920 2016-03-07  Brent Fulgham  <bfulgham@apple.com>
921
922         Reduce startup and shutdown cost of resource load statistics
923         https://bugs.webkit.org/show_bug.cgi?id=155120
924         <rdar://problem/25010167>
925
926         Reviewed by Andy Estes.
927
928         Move all file-related code out of WebCore.
929
930         * loader/ResourceLoadStatisticsStore.cpp:
931         (WebCore::ResourceLoadStatisticsStore::create): Deleted path overload.
932         (WebCore::ResourceLoadStatisticsStore::createEncoderFromData): Added.
933         (WebCore::ResourceLoadStatisticsStore::readDataFromDecoder): Added.
934         (WebCore::ResourceLoadStatisticsStore::ResourceLoadStatisticsStore): Deleted.
935         (WebCore::ResourceLoadStatisticsStore::writeDataToDisk): Deleted.
936         (WebCore::ResourceLoadStatisticsStore::setStatisticsStorageDirectory): Deleted.
937         (WebCore::ResourceLoadStatisticsStore::persistentStoragePath): Deleted.
938         (WebCore::ResourceLoadStatisticsStore::readDataFromDiskIfNeeded): Deleted.
939         (WebCore::ResourceLoadStatisticsStore::createDecoderFromDisk): Deleted.
940         (WebCore::ResourceLoadStatisticsStore::writeEncoderToDisk): Deleted.
941         * loader/ResourceLoadStatisticsStore.h:
942         (WebCore::ResourceLoadStatisticsStore::clear): Added.
943
944 2016-03-07  Zalan Bujtas  <zalan@apple.com>
945
946         Crash in WebCore::RenderElement::containingBlockForObjectInFlow
947         https://bugs.webkit.org/show_bug.cgi?id=155109
948
949         Reviewed by Simon Fraser.
950
951         It's unsafe to call containingBlock() on RenderView.
952
953         Unable to reproduce.
954
955         * rendering/RenderBlock.cpp:
956         (WebCore::RenderBlock::styleWillChange):
957         (WebCore::RenderBlock::isSelfCollapsingBlock):
958         (WebCore::RenderBlock::selectionGaps):
959         * rendering/RenderBox.cpp:
960         (WebCore::RenderBox::borderBoxRectInRegion):
961         (WebCore::RenderBox::computePercentageLogicalHeight):
962         (WebCore::RenderBox::computeReplacedLogicalHeightUsing):
963         (WebCore::logicalWidthIsResolvable):
964         (WebCore::RenderBox::percentageLogicalHeightIsResolvableFromBlock):
965         * rendering/RenderBoxModelObject.cpp:
966         (WebCore::RenderBoxModelObject::hasAutoHeightOrContainingBlockWithAutoHeight):
967         * rendering/RenderFlowThread.cpp:
968         (WebCore::RenderFlowThread::adjustedPositionRelativeToOffsetParent):
969         (WebCore::RenderFlowThread::offsetFromLogicalTopOfFirstRegion):
970         * rendering/RenderLayer.cpp:
971         (WebCore::RenderLayer::hasCompositedLayerInEnclosingPaginationChain):
972         (WebCore::RenderLayer::updatePagination):
973         (WebCore::inContainingBlockChain):
974         * rendering/RenderMultiColumnFlowThread.cpp:
975         (WebCore::isValidColumnSpanner):
976         * rendering/RenderNamedFlowThread.cpp:
977         (WebCore::RenderNamedFlowThread::decorationsClipRectForBoxInNamedFlowFragment):
978         * rendering/RenderObject.cpp:
979         (WebCore::hasFixedPosInNamedFlowContainingBlock):
980         * rendering/RenderReplaced.cpp:
981         (WebCore::firstContainingBlockWithLogicalWidth):
982         * rendering/RenderView.cpp:
983         (WebCore::RenderView::subtreeSelectionBounds):
984         (WebCore::RenderView::repaintSubtreeSelection):
985         (WebCore::RenderView::clearSubtreeSelection):
986         (WebCore::RenderView::applySubtreeSelection):
987
988 2016-03-07  Daniel Bates  <dabates@apple.com>
989
990         Cleanup: Add convenience function URL::procotolIsBlob()
991         https://bugs.webkit.org/show_bug.cgi?id=155127
992         <rdar://problem/25016829>
993
994         Reviewed by Brent Fulgham.
995
996         Similar to the class member function URL::protocolIsData(), add a class member function to
997         class URL to determine if a URL is a blob URL.
998
999         No functionality was changed. So, no new tests.
1000
1001         * page/SecurityOrigin.cpp:
1002         (WebCore::SecurityOrigin::shouldUseInnerURL): Modified to use URL::protocolIsBlob().
1003         (WebCore::getCachedOrigin): Ditto.
1004         * platform/URL.h:
1005         (WebCore::URL::protocolIsBlob): Added.
1006         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
1007         (webKitWebSrcStart): Modified to use URL::protocolIsBlob().
1008         (urlHasSupportedProtocol): Ditto.
1009         * workers/Worker.cpp:
1010         (WebCore::Worker::didReceiveResponse): Ditto.
1011         * xml/XMLHttpRequest.cpp:
1012         (WebCore::XMLHttpRequest::createRequest): Ditto.
1013
1014 2016-03-07  Adam Bergkvist  <adam.bergkvist@ericsson.com>
1015
1016         WebRTC: Implement MediaEndpointPeerConnection::createOffer()
1017         https://bugs.webkit.org/show_bug.cgi?id=154867
1018
1019         Reviewed by Eric Carlson and Jer Noble.
1020
1021         - MediaEndpointPeerConnection: Initial implementation of createOffer()
1022         added. createOffer() is split up into a synchronous part, and a
1023         scheduled task. The task will be deferred until information, requiring
1024         some amount of work, such as the DTLS fingerprint is available. Other
1025         async API functions will also follow this pattern.
1026
1027         - SDPProcessor (added): The SDPProcessors parses SDP to a
1028         MediaEndpointSessionConfiguration object and generates SDP in the
1029         reverse direction. Any SDP string handling is confined to the
1030         SDPProcessor and all configuration of the media session is done via the
1031         MediaEndpointSessionConfiguration object.
1032
1033         The SDP parser and generator logic is implemented in JavaScript and
1034         works with JSON (SDP->JSON, JSON->SDP). The SDPProcessor runs JS in an
1035         isolated scope and converts JSON to a MediaEndpointSessionConfiguration
1036         object and the reverse. Using JSON signaling (nonstandard) can be
1037         helpful during debugging.
1038
1039         - MockMediaEndpoint (added): Mock MediaEndpoint implementation with
1040         support for generating offers. DTLS information, such as fingerprint,
1041         is hard coded to facilitate testing with expected values.
1042
1043         Test: fast/mediastream/RTCPeerConnection-inspect-offer.html
1044
1045         The test is currently skipped on the mac port until support to read the
1046         SDPProcessor JavaScript resource is added.
1047
1048         * CMakeLists.txt:
1049         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
1050         (WebCore::WrappedSessionDescriptionPromise::create):
1051         (WebCore::WrappedSessionDescriptionPromise::promise):
1052         (WebCore::WrappedSessionDescriptionPromise::WrappedSessionDescriptionPromise):
1053         (WebCore::randomString):
1054         (WebCore::MediaEndpointPeerConnection::MediaEndpointPeerConnection):
1055         (WebCore::MediaEndpointPeerConnection::runTask):
1056         (WebCore::MediaEndpointPeerConnection::startRunningTasks):
1057         (WebCore::MediaEndpointPeerConnection::createOffer):
1058         (WebCore::MediaEndpointPeerConnection::createOfferTask):
1059         (WebCore::MediaEndpointPeerConnection::gotDtlsFingerprint):
1060         * Modules/mediastream/MediaEndpointPeerConnection.h:
1061         * Modules/mediastream/SDPProcessor.cpp: Added.
1062         (WebCore::SDPProcessor::SDPProcessor):
1063         (WebCore::createCandidateObject):
1064         (WebCore::createCandidate):
1065         (WebCore::configurationFromJSON):
1066         (WebCore::iceCandidateFromJSON):
1067         (WebCore::configurationToJSON):
1068         (WebCore::iceCandidateToJSON):
1069         (WebCore::SDPProcessor::generate):
1070         (WebCore::SDPProcessor::parse):
1071         (WebCore::SDPProcessor::generateCandidateLine):
1072         (WebCore::SDPProcessor::parseCandidateLine):
1073         (WebCore::SDPProcessor::callScript):
1074         * Modules/mediastream/SDPProcessor.h: Added.
1075         * Modules/mediastream/sdp.js: Added.
1076         (match):
1077         (addDefaults):
1078         (fillTemplate):
1079         (SDP.parse):
1080         (SDP.generate):
1081         (SDP.generateCandidateLine):
1082         (hasAllProperties):
1083         (SDP.verifyObject):
1084         (generate):
1085         (parse):
1086         (generateCandidateLine):
1087         (parseCandidateLine):
1088         * PlatformGTK.cmake:
1089         * WebCore.xcodeproj/project.pbxproj:
1090         * platform/mediastream/MediaEndpoint.cpp:
1091         (WebCore::createMediaEndpoint):
1092         * platform/mediastream/MediaEndpoint.h:
1093         * platform/mediastream/PeerMediaDescription.h:
1094         * platform/mediastream/SDPProcessorScriptResource.cpp: Added.
1095         (WebCore::SDPProcessorScriptResource::scriptString):
1096         * platform/mediastream/SDPProcessorScriptResource.h: Added.
1097         * platform/mediastream/gtk/SDPProcessorScriptResourceGtk.cpp: Added.
1098         (WebCore::SDPProcessorScriptResource::scriptString):
1099         * platform/mock/MockMediaEndpoint.cpp: Added.
1100         (WebCore::MockMediaEndpoint::create):
1101         (WebCore::MockMediaEndpoint::MockMediaEndpoint):
1102         (WebCore::MockMediaEndpoint::~MockMediaEndpoint):
1103         (WebCore::MockMediaEndpoint::setConfiguration):
1104         (WebCore::MockMediaEndpoint::generateDtlsInfo):
1105         (WebCore::MockMediaEndpoint::getDefaultAudioPayloads):
1106         (WebCore::MockMediaEndpoint::getDefaultVideoPayloads):
1107         (WebCore::MockMediaEndpoint::updateReceiveConfiguration):
1108         (WebCore::MockMediaEndpoint::updateSendConfiguration):
1109         (WebCore::MockMediaEndpoint::addRemoteCandidate):
1110         (WebCore::MockMediaEndpoint::replaceSendSource):
1111         (WebCore::MockMediaEndpoint::stop):
1112         * platform/mock/MockMediaEndpoint.h: Added.
1113         * testing/Internals.cpp:
1114         (WebCore::Internals::Internals):
1115         (WebCore::Internals::enableMockMediaEndpoint):
1116         * testing/Internals.h:
1117
1118 2016-03-07  Daniel Bates  <dabates@apple.com>
1119
1120         CSP: object-src directive should prohibit creation of nested browsing context
1121         https://bugs.webkit.org/show_bug.cgi?id=153153
1122         <rdar://problem/24383209>
1123
1124         Reviewed by Brent Fulgham.
1125
1126         Enforce the Content Security Policy object-src directive when fetching a URL for content
1127         that will cause an HTML object or HTML embed element to act as a nested browsing context
1128         (i.e. behave as if the content was loaded in an HTML iframe element). This makes our
1129         enforcement of the object-src directive match the behavior of the object-src directive
1130         in the Content Security Policy 2.0 spec., <http://www.w3.org/TR/2015/CR-CSP2-20150721/>.
1131
1132         Tests: http/tests/security/contentSecurityPolicy/embed-src-url-blocked.html
1133                http/tests/security/contentSecurityPolicy/embed-src-url-blocked2.html
1134                http/tests/security/contentSecurityPolicy/object-src-param-src-blocked2.html
1135                http/tests/security/contentSecurityPolicy/object-src-url-blocked2.html
1136
1137         * loader/SubframeLoader.cpp:
1138         (WebCore::SubframeLoader::isPluginContentAllowedByContentSecurityPolicy): Extracted from SubframeLoader::pluginIsLoadable().
1139         Checks if the plugin element is allowed by the Content Security Policy to load the URL and MIME type.
1140         (WebCore::SubframeLoader::pluginIsLoadable): Extract out the logic for determining if
1141         the plugin content is allowed to load by the Content Security Policy into SubframeLoader::isPluginContentAllowedByContentSecurityPolicy()
1142         and make use of this function.
1143         (WebCore::SubframeLoader::requestObject): Modified to call SubframeLoader::isPluginContentAllowedByContentSecurityPolicy()
1144         before loading plugin content into a sub frame. If the plugin content is not allowed to load then we
1145         mark the plugin as unavailable with the reason being that it was blocked by the Content Security Policy.
1146         * loader/SubframeLoader.h:
1147
1148 2016-03-06  Gavin Barraclough  <barraclough@apple.com>
1149
1150         Convert DOMTimer to std::chrono::milliseconds
1151         https://bugs.webkit.org/show_bug.cgi?id=155085
1152
1153         Reviewed by Andreas Kling.
1154
1155         DOMTimer currently uses a mix of millisecond (was int, now std::chrono) and second (as double)
1156         time values. Constant conversion back and forth is a complete mess. Stop that.
1157
1158         * dom/Document.cpp:
1159         (WebCore::Document::minimumTimerInterval):
1160         (WebCore::Document::timerAlignmentInterval):
1161         * dom/Document.h:
1162             - double -> std::chrono::milliseconds
1163         * dom/ScriptExecutionContext.cpp:
1164         (WebCore::ScriptExecutionContext::adjustMinimumTimerInterval):
1165         (WebCore::ScriptExecutionContext::minimumTimerInterval):
1166         (WebCore::ScriptExecutionContext::timerAlignmentInterval):
1167         * dom/ScriptExecutionContext.h:
1168             - double -> std::chrono::milliseconds
1169         * page/DOMTimer.cpp:
1170         (WebCore::DOMTimer::updateTimerIntervalIfNecessary):
1171         (WebCore::DOMTimer::intervalClampedToMinimum):
1172         (WebCore::DOMTimer::alignedFireTime):
1173         * page/DOMTimer.h:
1174             - double -> std::chrono::milliseconds
1175         * page/Page.cpp:
1176         (WebCore::Page::setTimerThrottlingState):
1177         (WebCore::Page::setTimerAlignmentIntervalIncreaseLimit):
1178         (WebCore::Page::updateDOMTimerAlignmentInterval):
1179         * page/Page.h:
1180             - double -> std::chrono::milliseconds
1181         * page/Settings.cpp:
1182         (WebCore::Settings::setNeedsAdobeFrameReloadingQuirk):
1183         (WebCore::Settings::setMinimumDOMTimerInterval):
1184         * page/Settings.h:
1185             - double -> std::chrono::milliseconds
1186         * page/SuspendableTimer.h:
1187         (WebCore::SuspendableTimer::startRepeating):
1188         (WebCore::SuspendableTimer::startOneShot):
1189         (WebCore::SuspendableTimer::repeatIntervalMS):
1190         (WebCore::SuspendableTimer::augmentFireInterval):
1191         (WebCore::SuspendableTimer::augmentRepeatInterval):
1192             - added std::chrono::milliseconds interface.
1193         * platform/Timer.cpp:
1194         (WebCore::TimerBase::setNextFireTime):
1195             - restructured for new alignedFireTime signatured, moved zero-delay handling to here.
1196               This change made because inside alignedFireTime fireTime will have already been truncated.
1197         * platform/Timer.h:
1198         (WebCore::TimerBase::msToSeconds):
1199         (WebCore::TimerBase::secondsToMS):
1200             - internal helper functions to bridge std::chrono::milliseconds to internal double.
1201         (WebCore::TimerBase::startRepeating):
1202         (WebCore::TimerBase::startOneShot):
1203         (WebCore::TimerBase::repeatIntervalMS):
1204         (WebCore::TimerBase::augmentFireInterval):
1205         (WebCore::TimerBase::augmentRepeatInterval):
1206             - expanded std::chrono::milliseconds interface.
1207         (WebCore::TimerBase::alignedFireTime):
1208             - changed to std::chrono::milliseconds, made return value Optional (null means no alignment).
1209         * testing/InternalSettings.cpp:
1210         (WebCore::InternalSettings::setMinimumTimerInterval):
1211         * testing/InternalSettings.h:
1212             - double -> std::chrono::milliseconds
1213
1214 2016-03-07  Andreas Kling  <akling@apple.com>
1215
1216         Make RenderStyle copy-on-write a bit less.
1217         <https://webkit.org/b/155106>
1218
1219         Reviewed by Antti Koivisto.
1220
1221         Add a cheesy SET_NESTED_VAR macro complement to SET_VAR so we can avoid copy-on-write
1222         detachment of nested RenderStyle substructures when the leaf value doesn't change.
1223
1224         I spotted about 300kB of these mistakes being made during PLT on iOS, most of them
1225         in the transformX setter.
1226
1227         * rendering/style/RenderStyle.h:
1228
1229 2016-03-07  Miguel Gomez  <magomez@igalia.com>
1230
1231         [TextureMapper] [BitmapTexturePool] Use appropriate list size when freeing textures
1232         https://bugs.webkit.org/show_bug.cgi?id=155105
1233
1234         Reviewed by Žan Doberšek.
1235
1236         Use appropriate list size when releasing the textures used as attachment.
1237         This is a fix for the patch to https://bugs.webkit.org/show_bug.cgi?id=154965.
1238
1239         No new tests because no new functionality was added.
1240
1241         * platform/graphics/texmap/BitmapTexturePool.cpp:
1242         (WebCore::BitmapTexturePool::releaseUnusedTexturesTimerFired):
1243
1244 2016-03-06  Benjamin Poulain  <bpoulain@apple.com>
1245
1246         [JSC] Improve codegen of Compare and Test
1247         https://bugs.webkit.org/show_bug.cgi?id=155055
1248
1249         Reviewed by Filip Pizlo.
1250
1251         * cssjit/FunctionCall.h:
1252         (WebCore::FunctionCall::callAndBranchOnCondition):
1253
1254 2016-03-06  Saam Barati  <sbarati@apple.com>
1255
1256         [[GetPrototypeOf]] should be a fully virtual method in the method table
1257         https://bugs.webkit.org/show_bug.cgi?id=155002
1258
1259         Reviewed by Filip Pizlo.
1260
1261         Change ::getPrototype(.) to ::prototype(.) in various places to prevent
1262         a naming conflict with JSC.
1263
1264         No new tests because no new functionality was added.
1265
1266         * bindings/js/JSDOMWindowShell.cpp:
1267         (WebCore::JSDOMWindowShell::setWindow):
1268         * bindings/js/JSImageConstructor.cpp:
1269         (WebCore::JSImageConstructor::initializeProperties):
1270         (WebCore::JSImageConstructor::prototypeForStructure):
1271         * bindings/js/WorkerScriptController.cpp:
1272         (WebCore::WorkerScriptController::initScript):
1273         * bindings/scripts/CodeGeneratorJS.pm:
1274         (GenerateHeader):
1275         (GenerateImplementation):
1276         (GenerateConstructorHelperMethods):
1277         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
1278         (WebCore::JSTestActiveDOMObjectConstructor::initializeProperties):
1279         (WebCore::JSTestActiveDOMObject::createPrototype):
1280         (WebCore::JSTestActiveDOMObject::prototype):
1281         (WebCore::JSTestActiveDOMObject::getPrototype): Deleted.
1282         * bindings/scripts/test/JS/JSTestActiveDOMObject.h:
1283         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
1284         (WebCore::JSTestClassWithJSBuiltinConstructorConstructor::initializeProperties):
1285         (WebCore::JSTestClassWithJSBuiltinConstructor::createPrototype):
1286         (WebCore::JSTestClassWithJSBuiltinConstructor::prototype):
1287         (WebCore::JSTestClassWithJSBuiltinConstructor::getPrototype): Deleted.
1288         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.h:
1289         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
1290         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectConstructor::initializeProperties):
1291         (WebCore::JSTestCustomConstructorWithNoInterfaceObject::createPrototype):
1292         (WebCore::JSTestCustomConstructorWithNoInterfaceObject::prototype):
1293         (WebCore::JSTestCustomConstructorWithNoInterfaceObject::getPrototype): Deleted.
1294         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h:
1295         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
1296         (WebCore::JSTestCustomNamedGetterConstructor::initializeProperties):
1297         (WebCore::JSTestCustomNamedGetter::createPrototype):
1298         (WebCore::JSTestCustomNamedGetter::prototype):
1299         (WebCore::JSTestCustomNamedGetter::getPrototype): Deleted.
1300         * bindings/scripts/test/JS/JSTestCustomNamedGetter.h:
1301         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
1302         (WebCore::JSTestEventConstructorConstructor::initializeProperties):
1303         (WebCore::JSTestEventConstructor::createPrototype):
1304         (WebCore::JSTestEventConstructor::prototype):
1305         (WebCore::JSTestEventConstructor::getPrototype): Deleted.
1306         * bindings/scripts/test/JS/JSTestEventConstructor.h:
1307         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
1308         (WebCore::JSTestEventTargetConstructor::initializeProperties):
1309         (WebCore::JSTestEventTarget::createPrototype):
1310         (WebCore::JSTestEventTarget::prototype):
1311         (WebCore::JSTestEventTarget::getPrototype): Deleted.
1312         * bindings/scripts/test/JS/JSTestEventTarget.h:
1313         * bindings/scripts/test/JS/JSTestException.cpp:
1314         (WebCore::JSTestExceptionConstructor::initializeProperties):
1315         (WebCore::JSTestException::createPrototype):
1316         (WebCore::JSTestException::prototype):
1317         (WebCore::JSTestException::getPrototype): Deleted.
1318         * bindings/scripts/test/JS/JSTestException.h:
1319         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
1320         (WebCore::JSTestGenerateIsReachableConstructor::initializeProperties):
1321         (WebCore::JSTestGenerateIsReachable::createPrototype):
1322         (WebCore::JSTestGenerateIsReachable::prototype):
1323         (WebCore::JSTestGenerateIsReachable::getPrototype): Deleted.
1324         * bindings/scripts/test/JS/JSTestGenerateIsReachable.h:
1325         * bindings/scripts/test/JS/JSTestInterface.cpp:
1326         (WebCore::JSTestInterfaceConstructor::initializeProperties):
1327         (WebCore::JSTestInterface::createPrototype):
1328         (WebCore::JSTestInterface::prototype):
1329         (WebCore::JSTestInterface::getPrototype): Deleted.
1330         * bindings/scripts/test/JS/JSTestInterface.h:
1331         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
1332         (WebCore::JSTestJSBuiltinConstructorConstructor::initializeProperties):
1333         (WebCore::JSTestJSBuiltinConstructor::createPrototype):
1334         (WebCore::JSTestJSBuiltinConstructor::prototype):
1335         (WebCore::JSTestJSBuiltinConstructor::getPrototype): Deleted.
1336         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.h:
1337         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
1338         (WebCore::JSTestMediaQueryListListenerConstructor::initializeProperties):
1339         (WebCore::JSTestMediaQueryListListener::createPrototype):
1340         (WebCore::JSTestMediaQueryListListener::prototype):
1341         (WebCore::JSTestMediaQueryListListener::getPrototype): Deleted.
1342         * bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
1343         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
1344         (WebCore::JSTestNamedConstructorConstructor::initializeProperties):
1345         (WebCore::JSTestNamedConstructorNamedConstructor::initializeProperties):
1346         (WebCore::JSTestNamedConstructor::createPrototype):
1347         (WebCore::JSTestNamedConstructor::prototype):
1348         (WebCore::JSTestNamedConstructor::getPrototype): Deleted.
1349         * bindings/scripts/test/JS/JSTestNamedConstructor.h:
1350         * bindings/scripts/test/JS/JSTestNode.cpp:
1351         (WebCore::JSTestNodeConstructor::initializeProperties):
1352         (WebCore::JSTestNode::createPrototype):
1353         (WebCore::JSTestNode::prototype):
1354         (WebCore::JSTestNode::getPrototype): Deleted.
1355         * bindings/scripts/test/JS/JSTestNode.h:
1356         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
1357         (WebCore::JSTestNondeterministicConstructor::initializeProperties):
1358         (WebCore::JSTestNondeterministic::createPrototype):
1359         (WebCore::JSTestNondeterministic::prototype):
1360         (WebCore::JSTestNondeterministic::getPrototype): Deleted.
1361         * bindings/scripts/test/JS/JSTestNondeterministic.h:
1362         * bindings/scripts/test/JS/JSTestObj.cpp:
1363         (WebCore::JSTestObjConstructor::initializeProperties):
1364         (WebCore::JSTestObj::createPrototype):
1365         (WebCore::JSTestObj::prototype):
1366         (WebCore::JSTestObj::getPrototype): Deleted.
1367         * bindings/scripts/test/JS/JSTestObj.h:
1368         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
1369         (WebCore::JSTestOverloadedConstructorsConstructor::initializeProperties):
1370         (WebCore::JSTestOverloadedConstructors::createPrototype):
1371         (WebCore::JSTestOverloadedConstructors::prototype):
1372         (WebCore::JSTestOverloadedConstructors::getPrototype): Deleted.
1373         * bindings/scripts/test/JS/JSTestOverloadedConstructors.h:
1374         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
1375         (WebCore::JSTestOverrideBuiltinsConstructor::initializeProperties):
1376         (WebCore::JSTestOverrideBuiltins::createPrototype):
1377         (WebCore::JSTestOverrideBuiltins::prototype):
1378         (WebCore::JSTestOverrideBuiltins::getPrototype): Deleted.
1379         * bindings/scripts/test/JS/JSTestOverrideBuiltins.h:
1380         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
1381         (WebCore::JSTestSerializedScriptValueInterfaceConstructor::initializeProperties):
1382         (WebCore::JSTestSerializedScriptValueInterface::createPrototype):
1383         (WebCore::JSTestSerializedScriptValueInterface::prototype):
1384         (WebCore::JSTestSerializedScriptValueInterface::getPrototype): Deleted.
1385         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
1386         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
1387         (WebCore::JSTestTypedefsConstructor::initializeProperties):
1388         (WebCore::JSTestTypedefs::createPrototype):
1389         (WebCore::JSTestTypedefs::prototype):
1390         (WebCore::JSTestTypedefs::getPrototype): Deleted.
1391         * bindings/scripts/test/JS/JSTestTypedefs.h:
1392         * bindings/scripts/test/JS/JSattribute.cpp:
1393         (WebCore::JSattributeConstructor::initializeProperties):
1394         (WebCore::JSattribute::createPrototype):
1395         (WebCore::JSattribute::prototype):
1396         (WebCore::JSattribute::getPrototype): Deleted.
1397         * bindings/scripts/test/JS/JSattribute.h:
1398         * bindings/scripts/test/JS/JSreadonly.cpp:
1399         (WebCore::JSreadonlyConstructor::initializeProperties):
1400         (WebCore::JSreadonly::createPrototype):
1401         (WebCore::JSreadonly::prototype):
1402         (WebCore::JSreadonly::getPrototype): Deleted.
1403         * bindings/scripts/test/JS/JSreadonly.h:
1404
1405 2016-03-06  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1406
1407         Enable DOM class create functions to take parameters in case of JSBuiltinConstructor
1408         https://bugs.webkit.org/show_bug.cgi?id=155022
1409
1410         Reviewed by Darin Adler.
1411
1412         Introducing JSDOMObjectInspector to check whether a given JS class is built-in (no DOM class).
1413         If that is not the case, the JS class wraps a DOM class.
1414         The inspector detects whether the DOM class create static method takes no parameter or some parameters.
1415         This is used in JSDOMConstructor.h to generate correctly the createJSObject functions needed by JSBuiltinConstructor.
1416
1417         Updated binding generator to not generate anymore createJSObject as it is handled directly in JSDOMConstructor.h.
1418
1419         Covered by existing tests.
1420
1421         * bindings/js/JSDOMConstructor.h:
1422         (WebCore::JSBuiltinConstructor<JSClass>::callConstructor):
1423         (WebCore::createJSObject):
1424         (WebCore::JSBuiltinConstructor<JSClass>::construct):
1425         * bindings/js/JSDOMWrapper.h:
1426         * bindings/js/JSKeyValueIterator.h: Taking benefit of JSClass::DOMWrapper type declaration.
1427         * bindings/js/JSReadableStreamPrivateConstructors.cpp:
1428         (WebCore::JSBuiltinReadableStreamReaderPrivateConstructor::initializeExecutable): Deleted.
1429         (WebCore::JSBuiltinReadableStreamControllerPrivateConstructor::initializeExecutable): Deleted.
1430         * bindings/scripts/CodeGeneratorJS.pm:
1431         (GenerateConstructorDefinition): Deleted.
1432         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
1433         (WebCore::JSTestClassWithJSBuiltinConstructorConstructor::prototypeForStructure): Deleted.
1434
1435 2016-03-06  Antti Koivisto  <antti@apple.com>
1436
1437         RenderTextControlSingleLine shouldn't mutate placeholder element inline style
1438         https://bugs.webkit.org/show_bug.cgi?id=155086
1439
1440         Reviewed by Andreas Kling.
1441
1442         Text field placeholder element is currently managed by changing its inline style
1443         from the host renderer based on the host style and state. Rendering poking
1444         into DOM is wrong.
1445
1446         * html/HTMLInputElement.cpp:
1447         (WebCore::HTMLInputElement::setRangeText):
1448         (WebCore::HTMLInputElement::shouldTruncateText):
1449
1450             Add a helper.
1451
1452         (WebCore::HTMLInputElement::createInnerTextStyle):
1453         * html/HTMLInputElement.h:
1454         * html/HTMLTextAreaElement.cpp:
1455         (WebCore::HTMLTextAreaElement::HTMLTextAreaElement):
1456         (WebCore::HTMLTextAreaElement::placeholderElement):
1457         (WebCore::HTMLTextAreaElement::matchesReadWritePseudoClass):
1458         (WebCore::HTMLTextAreaElement::updatePlaceholderText):
1459
1460             Use the new shadow element.
1461
1462         * html/HTMLTextAreaElement.h:
1463         * html/HTMLTextFormControlElement.cpp:
1464         (WebCore::HTMLTextFormControlElement::updatePlaceholderVisibility):
1465
1466             No more poking to inline style.
1467
1468         (WebCore::HTMLTextFormControlElement::setSelectionStart):
1469         * html/TextFieldInputType.cpp:
1470         (WebCore::TextFieldInputType::updatePlaceholderText):
1471
1472             Use the new shadow element.
1473
1474         * html/shadow/TextControlInnerElements.cpp:
1475         (WebCore::TextControlPlaceholderElement::TextControlPlaceholderElement):
1476
1477             Add a subclass for the placeholder element instead of just using div.
1478
1479         (WebCore::TextControlPlaceholderElement::customStyleForRenderer):
1480
1481             Compute style base on the host state and style.
1482
1483         (WebCore::SearchFieldResultsButtonElement::SearchFieldResultsButtonElement):
1484         * html/shadow/TextControlInnerElements.h:
1485         * rendering/RenderTextControlSingleLine.cpp:
1486         (WebCore::RenderTextControlSingleLine::styleDidChange):
1487
1488             No more setInlineStyleProperty.
1489             This now needs to trigger layout like it does with other inner elements.
1490
1491         (WebCore::RenderTextControlSingleLine::computeControlLogicalHeight):
1492         (WebCore::RenderTextControlSingleLine::autoscroll):
1493         (WebCore::RenderTextControlSingleLine::textShouldBeTruncated): Deleted.
1494         * rendering/RenderTextControlSingleLine.h:
1495
1496 2016-03-05  Ryosuke Niwa  <rniwa@webkit.org>
1497
1498         Add the support for upgrading custom elements in cloneNode
1499         https://bugs.webkit.org/show_bug.cgi?id=155062
1500
1501         Reviewed by Antti Koivisto.
1502
1503         Implement https://w3c.github.io/webcomponents/spec/custom/#upgrading and steps 6 through 11 in
1504         https://w3c.github.io/webcomponents/spec/custom/#htmlelement-constructor to support upgrading elements
1505         created by Node.prototype.cloneNode.
1506
1507         Tests: fast/custom-elements/lifecycle-callback-timing.html
1508                fast/custom-elements/upgrading/Node-cloneNode.html
1509
1510         * bindings/js/JSCustomElementInterface.cpp:
1511         (WebCore::JSCustomElementInterface::upgradeElement): Added. Implements
1512          https://w3c.github.io/webcomponents/spec/custom/#dfn-upgrade-a-custom-element
1513         (WebCore::JSCustomElementInterface::didUpgradeLastElementInConstructionStack): Added. Implements step 10
1514          "Replace the last entry in definition's construction stacka with an already constructed marker."
1515          in https://w3c.github.io/webcomponents/spec/custom/#dom-htmlelement-constructor
1516         * bindings/js/JSCustomElementInterface.h:
1517         (WebCore::JSCustomElementInterface::isUpgradingElement):
1518         (WebCore::JSCustomElementInterface::lastElementInConstructionStack):
1519         (WebCore::JSCustomElementInterface): Added m_constructionStack. This is the construction stack:
1520          https://w3c.github.io/webcomponents/spec/custom/#dfn-element-definition-construction-stack
1521         * bindings/js/JSDOMBinding.cpp:
1522         (WebCore::throwInvalidStateError): Added.
1523         * bindings/js/JSDOMBinding.h:
1524         * bindings/js/JSHTMLElementCustom.cpp:
1525         (WebCore::constructJSHTMLElement): Implement the upgrading case in:
1526          https://w3c.github.io/webcomponents/spec/custom/#htmlelement-constructor
1527         * dom/Document.cpp:
1528         (WebCore::createFallbackHTMLElement): Added. Enqueues upgrades of custom elements (enqueueElementUpgrade
1529          currently does nothing if there is no InvokesCustomElementLifecycleCallbacks; e.g. in other DOM APIs).
1530          This function implements https://w3c.github.io/webcomponents/spec/custom/#dfn-element-upgrade-algorithm
1531         (WebCore::Document::createElement):
1532         * dom/LifecycleCallbackQueue.cpp:
1533         (WebCore::LifecycleQueueItem::LifecycleQueueItem): Added a generic constructor.
1534         (WebCore::LifecycleQueueItem::invoke): Call upgradeElement when m_type is Type::ElementUpgrade.
1535         (WebCore::LifecycleCallbackQueue::enqueueElementUpgrade): Added.
1536         * dom/LifecycleCallbackQueue.h:
1537         * dom/Node.idl: Added InvokesCustomElementLifecycleCallbacks on cloneNode.
1538         * dom/make_names.pl:
1539         (printFactoryCppFile): Added a variant of createKnownElement which takes QualifiedName. Also directly call
1540          find(HTML|SVG|MathML)ElementConstructorFunction in createElement that takes AtomicString to avoid an extra
1541          function call.
1542         (printFactoryHeaderFile): Added a function declaration for createKnownElement that takes QualifiedName and
1543          outdented class and function declarations to match the modern code style guideline.
1544
1545 2016-03-05  Tim Horton  <timothy_horton@apple.com>
1546
1547         Create a DOMHTMLVideoElement when wrapping <video> elements
1548         https://bugs.webkit.org/show_bug.cgi?id=155084
1549         <rdar://problem/24997193>
1550
1551         Reviewed by Dan Bernstein.
1552
1553         * bindings/objc/DOM.mm:
1554         (WebCore::createElementClassMap):
1555         Add <video> to the mapping.
1556
1557 2016-03-05  Ryosuke Niwa  <rniwa@webkit.org>
1558
1559         Minor cleans up in custom elements' code per Darin's comments
1560         https://bugs.webkit.org/show_bug.cgi?id=155081
1561
1562         Reviewed by Darin Adler.
1563
1564         Cleanup per Darin's comments.
1565
1566         * dom/CustomElementDefinitions.cpp:
1567         (WebCore::CustomElementDefinitions::findInterface): Use get instead of explicitly checking against end().
1568         * dom/LifecycleCallbackQueue.h: Remove unecessary header includes.
1569
1570 2016-03-05  Sam Weinig  <sam@webkit.org>
1571
1572         Fix two minor typos from http://trac.webkit.org/changeset/197626 that were causing some test failures.
1573
1574         * html/Autofill.cpp:
1575         (WebCore::fieldNameMap):
1576         (WebCore::AutofillData::createFromHTMLFormControlElement):
1577
1578 2016-03-05  Chris Dumez  <cdumez@apple.com>
1579
1580         Consolidate RuntimeApplicationChecks and RuntimeApplicationChecksIOS
1581         https://bugs.webkit.org/show_bug.cgi?id=155035
1582
1583         Reviewed by Darin Adler.
1584
1585         Consolidate RuntimeApplicationChecks and RuntimeApplicationChecksIOS into
1586         one file. The following changes were made:
1587         - The checks now all rely on applicationBundleIdentifier(), which has the
1588           benefit of working in WK1 and WK2 UI/WebContent/Networking processes.
1589         - Use namespaces to distinguish Mac and iOS applications instead of relying
1590           on the method name. So, applicationIsIBooksForIOS() becomes
1591           IOSApplication::isIBooks().
1592         - Use NSBundle API on both iOS and Mac instead of using the CF API on Mac
1593           and the NS API on iOS.
1594
1595         * CMakeLists.txt:
1596         * WebCore.xcodeproj/project.pbxproj:
1597         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1598         (-[WebAccessibilityObjectWrapper _accessibilityWebDocumentView]):
1599         * bindings/js/JSDOMWindowBase.cpp:
1600         (WebCore::JSDOMWindowBase::commonVM):
1601         * bindings/js/JSLocationCustom.cpp:
1602         (WebCore::JSLocation::putDelegate):
1603         * html/HTMLMediaElement.cpp:
1604         * html/HTMLObjectElement.cpp:
1605         (WebCore::shouldNotPerformURLAdjustment):
1606         * html/MediaElementSession.cpp:
1607         * inspector/InspectorTimelineAgent.cpp:
1608         (WebCore::currentRunLoop):
1609         * loader/FrameLoader.cpp:
1610         (WebCore::FrameLoader::willLoadMediaElementURL):
1611         * loader/SubresourceLoader.cpp:
1612         (WebCore::SubresourceLoader::create):
1613         (WebCore::SubresourceLoader::startLoading):
1614         * loader/cache/CachedScript.cpp:
1615         (WebCore::CachedScript::shouldIgnoreHTTPStatusCodeErrors):
1616         * platform/RuntimeApplicationChecks.cpp: Removed.
1617         * platform/RuntimeApplicationChecks.h:
1618         * platform/RuntimeApplicationChecks.mm: Added.
1619         (WebCore::applicationBundleIdentifier):
1620         (WebCore::applicationBundleIsEqualTo):
1621         (WebCore::MacApplication::isSafari):
1622         (WebCore::MacApplication::isAppleMail):
1623         (WebCore::MacApplication::isIBooks):
1624         (WebCore::MacApplication::isITunes):
1625         (WebCore::MacApplication::isMicrosoftMessenger):
1626         (WebCore::MacApplication::isAdobeInstaller):
1627         (WebCore::MacApplication::isAOLInstantMessenger):
1628         (WebCore::MacApplication::isMicrosoftMyDay):
1629         (WebCore::MacApplication::isMicrosoftOutlook):
1630         (WebCore::MacApplication::isQuickenEssentials):
1631         (WebCore::MacApplication::isAperture):
1632         (WebCore::MacApplication::isVersions):
1633         (WebCore::MacApplication::isHRBlock):
1634         (WebCore::MacApplication::isSolidStateNetworksDownloader):
1635         (WebCore::MacApplication::isHipChat):
1636         (WebCore::IOSApplication::isMobileMail):
1637         (WebCore::IOSApplication::isMobileSafari):
1638         (WebCore::IOSApplication::isDumpRenderTree):
1639         (WebCore::IOSApplication::isMobileStore):
1640         (WebCore::IOSApplication::isWebApp):
1641         (WebCore::IOSApplication::isOkCupid):
1642         (WebCore::IOSApplication::isFacebook):
1643         (WebCore::IOSApplication::isDaijisenDictionary):
1644         (WebCore::IOSApplication::isNASAHD):
1645         (WebCore::IOSApplication::isTheEconomistOnIphone):
1646         (WebCore::IOSApplication::isWebProcess):
1647         (WebCore::IOSApplication::isIBooks):
1648         (WebCore::setApplicationBundleIdentifier):
1649         * platform/RuntimeApplicationChecksIOS.h: Removed.
1650         * platform/RuntimeApplicationChecksIOS.mm: Removed.
1651         * platform/audio/ios/AudioDestinationIOS.cpp:
1652         * platform/cf/URLCF.cpp:
1653         * platform/graphics/ca/cocoa/LayerFlushSchedulerMac.cpp:
1654         (WebCore::currentRunLoop):
1655         * platform/ios/PasteboardIOS.mm:
1656         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
1657         * platform/ios/wak/WebCoreThread.mm:
1658         (WebThreadEnable):
1659         * platform/mac/WidgetMac.mm:
1660         (WebCore::Widget::paint):
1661         * platform/network/ios/QuickLook.mm:
1662         * platform/network/mac/ResourceHandleMac.mm:
1663         * rendering/RenderLayerBacking.cpp:
1664         (WebCore::RenderLayerBacking::needsIOSDumpRenderTreeMainFrameRenderViewLayerIsAlwaysOpaqueHack):
1665
1666 2016-03-05  Zalan Bujtas  <zalan@apple.com>
1667
1668         Make table collapsed borders subpixel aware.
1669         https://bugs.webkit.org/show_bug.cgi?id=150383
1670
1671         Reviewed by Simon Fraser.
1672
1673         This patch enables authors to 
1674         - set subpixel width on collapsed borders
1675         - and push those borders to subpixel positions.
1676
1677         Test: fast/table/collapsed-border-with-odd-pixel-width.html
1678
1679         * rendering/RenderTable.cpp:
1680         (WebCore::RenderTable::calcBorderStart):
1681         (WebCore::RenderTable::calcBorderEnd):
1682         (WebCore::RenderTable::outerBorderBefore):
1683         (WebCore::RenderTable::outerBorderAfter):
1684         (WebCore::RenderTable::outerBorderStart):
1685         (WebCore::RenderTable::outerBorderEnd):
1686         * rendering/RenderTableCell.cpp:
1687         (WebCore::RenderTableCell::borderHalfStart):
1688         (WebCore::RenderTableCell::borderHalfEnd):
1689         (WebCore::RenderTableCell::borderHalfBefore):
1690         (WebCore::RenderTableCell::borderHalfAfter):
1691         (WebCore::RenderTableCell::paintCollapsedBorders):
1692         * rendering/RenderTableSection.cpp:
1693         (WebCore::RenderTableSection::calcOuterBorderBefore):
1694         (WebCore::RenderTableSection::calcOuterBorderAfter):
1695         (WebCore::RenderTableSection::calcOuterBorderStart):
1696         (WebCore::RenderTableSection::calcOuterBorderEnd):
1697         * rendering/style/CollapsedBorderValue.h:
1698         (WebCore::CollapsedBorderValue::adjustedCollapsedBorderWidth):
1699
1700 2016-03-05  Sam Weinig  <sam@webkit.org>
1701
1702         Add support for processing the autofill field name out of form control elements ultimately to aid input methods
1703         <rdar://problem/23041180>
1704         https://bugs.webkit.org/show_bug.cgi?id=155079
1705
1706         Reviewed by Enrica Casucci.
1707
1708         Added additional cases to fast/forms/autocomplete-tokens.html.
1709
1710         * WebCore.xcodeproj/project.pbxproj:
1711         Add Autofill.h/cpp
1712
1713         * html/Autofill.cpp: Added.
1714         (WebCore::fieldNameMap):
1715         (WebCore::toAutofillFieldName):
1716         (WebCore::isContactToken):
1717         (WebCore::maxTokensForAutofillFieldCategory):
1718         (WebCore::AutofillData::createFromHTMLFormControlElement):
1719         * html/Autofill.h: Added.
1720         (WebCore::AutofillData::AutofillData):
1721         Refactored the autofill data processing algorithm into it's own file and added support
1722         returning not just the IDL-exposed autofill value but also the autofill field name. The
1723         code is structured simply enough that if we find a need for the hint set or scope information
1724         we could return it as well.
1725
1726         * html/HTMLFormControlElement.cpp:
1727         (WebCore::HTMLFormControlElement::autocomplete):
1728         (WebCore::HTMLFormControlElement::setAutocomplete):
1729         (WebCore::HTMLFormControlElement::autofillMantle):
1730         (WebCore::HTMLFormControlElement::autofillData):
1731         Use AutofillData to implement these.
1732
1733         * html/HTMLFormControlElement.h:
1734         Expose accessor for mantle and AutofillData.
1735
1736         * html/HTMLFormElement.cpp:
1737         (WebCore::HTMLFormElement::autocomplete):
1738         * html/HTMLFormElement.h:
1739         Switch to return an AtomicString as it will always
1740         return one of two known values.
1741
1742         * testing/Internals.cpp:
1743         (WebCore::Internals::autofillFieldName):
1744         * testing/Internals.h:
1745         * testing/Internals.idl:
1746         Add accessor of the field name for testing purposes.
1747
1748 2016-03-05  Ryosuke Niwa  <rniwa@webkit.org>
1749
1750         Build fix after r197612 (under ASAN/GuardMalloc).
1751
1752         * dom/CustomElementDefinitions.cpp:
1753         (WebCore::CustomElementDefinitions::findInterface):
1754
1755 2016-03-05  Michael Catanzaro  <mcatanzaro@igalia.com>
1756
1757         Unreviewed, fix GTK/EFL build after r197575 and add mandatory GnuTLS dependency
1758
1759         * PlatformEfl.cmake:
1760         * PlatformGTK.cmake:
1761
1762 2016-03-05  Simon Fraser  <simon.fraser@apple.com>
1763
1764         Add support for the object-position CSS property
1765         https://bugs.webkit.org/show_bug.cgi?id=122811
1766         rdar://problem/15836338
1767
1768         Reviewed by Sam Weinig.
1769
1770         Take object-position into account when rendering replaced elements.
1771         RenderReplaced::replacedContentRect() is the one place where we compute
1772         the content rect for replaced elements.
1773
1774         Also return false from foregroundIsKnownToBeOpaqueInRect() if we have
1775         any non-default object-position, as the foreground may no longer fill the box.
1776
1777         Tests: compositing/video/video-object-position.html
1778                fast/css/object-position/object-position-canvas.html
1779                fast/css/object-position/object-position-embed.html
1780                fast/css/object-position/object-position-img-svg.html
1781                fast/css/object-position/object-position-img.html
1782                fast/css/object-position/object-position-input-image.html
1783                fast/css/object-position/object-position-object.html
1784                fast/css/object-position/object-position-video-poster.html
1785
1786         * rendering/RenderImage.cpp:
1787         (WebCore::RenderImage::foregroundIsKnownToBeOpaqueInRect):
1788         * rendering/RenderReplaced.cpp:
1789         (WebCore::RenderReplaced::replacedContentRect):
1790
1791 2016-03-05  Simon Fraser  <simon.fraser@apple.com>
1792
1793         Add parsing support for object-position
1794         https://bugs.webkit.org/show_bug.cgi?id=155065
1795
1796         Reviewed by Sam Weinig.
1797         
1798         Add parsing support for object-position. This is the first property with
1799         CSS <position> values which does not have equivalent -x and -y shorthands,
1800         so we can store it as a new LengthPoint type.
1801         
1802         Per the CSS Values spec, bottom- and right-relative values are translated
1803         into calc() expressions, which are exposed via computed style. For example,
1804         "right 10px bottom" becomes "calc(100% - 10px) 100%". This also allows transitions
1805         between, say, "left 10px bottom" and "right 10px bottom".
1806
1807         Test: fast/css/object-position/parsing-object-position.html
1808
1809         * CMakeLists.txt:
1810         * WebCore.xcodeproj/project.pbxproj:
1811         * css/CSSComputedStyleDeclaration.cpp:
1812         (WebCore::ComputedStyleExtractor::propertyValue):
1813         * css/CSSParser.cpp:
1814         (WebCore::CSSParser::parseValue):
1815         * css/CSSPrimitiveValue.h:
1816         (WebCore::CSSPrimitiveValue::isPair):
1817         * css/CSSPropertyNames.in:
1818         * css/CSSValue.h:
1819         * css/StyleBuilderConverter.h:
1820         (WebCore::StyleBuilderConverter::convertLength):
1821         (WebCore::StyleBuilderConverter::convertTo100PercentMinusLength):
1822         (WebCore::StyleBuilderConverter::convertPositionComponent):
1823         (WebCore::StyleBuilderConverter::convertObjectPosition):
1824         * platform/LengthPoint.cpp: Added.
1825         (WebCore::operator<<):
1826         * platform/LengthPoint.h: Added.
1827         (WebCore::LengthPoint::LengthPoint):
1828         (WebCore::LengthPoint::operator==):
1829         (WebCore::LengthPoint::setX):
1830         (WebCore::LengthPoint::x):
1831         (WebCore::LengthPoint::setY):
1832         (WebCore::LengthPoint::y):
1833         (WebCore::LengthPoint::blend):
1834         * rendering/style/RenderStyle.cpp:
1835         (WebCore::RenderStyle::changeRequiresRepaint):
1836         * rendering/style/RenderStyle.h:
1837         * rendering/style/StyleRareNonInheritedData.cpp:
1838         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
1839         (WebCore::StyleRareNonInheritedData::operator==):
1840         * rendering/style/StyleRareNonInheritedData.h:
1841
1842 2016-03-05  Joanmarie Diggs  <jdiggs@igalia.com>
1843
1844         AX: Implement missing/different accessibility API mappings for SVG
1845         https://bugs.webkit.org/show_bug.cgi?id=155034
1846
1847         Reviewed by Chris Fleizach.
1848
1849         Create an AccessibilitySVGElement class for the SVG-specific mappings;
1850         fix name and description mappings for ATK; add new AccessibilityRole
1851         types (SVGTextRole, SVGTSpanRole, SVGTextPathRole) and map them for
1852         ATK and AX API.
1853
1854         Tests: accessibility/w3c-svg-description-calculation.html
1855                accessibility/w3c-svg-elements-not-exposed.html
1856                accessibility/w3c-svg-name-calculation.html
1857                accessibility/w3c-svg-presentational-role.html
1858                accessibility/w3c-svg-roles.html
1859
1860         * CMakeLists.txt:
1861         * WebCore.xcodeproj/project.pbxproj:
1862         * accessibility/AXObjectCache.cpp:
1863         (WebCore::createFromRenderer):
1864         * accessibility/AccessibilityAllInOne.cpp:
1865         * accessibility/AccessibilityNodeObject.cpp:
1866         (WebCore::AccessibilityNodeObject::alternativeText): Deleted.
1867         (WebCore::AccessibilityNodeObject::accessibilityDescription): Deleted.
1868         * accessibility/AccessibilityObject.h:
1869         (WebCore::AccessibilityObject::isAccessibilitySVGElement):
1870         * accessibility/AccessibilityRenderObject.cpp:
1871         (WebCore::AccessibilityRenderObject::determineAccessibilityRole): Deleted.
1872         * accessibility/AccessibilitySVGElement.cpp: Added.
1873         (WebCore::AccessibilitySVGElement::AccessibilitySVGElement):
1874         (WebCore::AccessibilitySVGElement::~AccessibilitySVGElement):
1875         (WebCore::AccessibilitySVGElement::create):
1876         (WebCore::AccessibilitySVGElement::targetForUseElement):
1877         (WebCore::AccessibilitySVGElement::accessibilityText):
1878         (WebCore::AccessibilitySVGElement::accessibilityDescription):
1879         (WebCore::AccessibilitySVGElement::helpText):
1880         (WebCore::AccessibilitySVGElement::computeAccessibilityIsIgnored):
1881         (WebCore::AccessibilitySVGElement::inheritsPresentationalRole):
1882         (WebCore::AccessibilitySVGElement::determineAriaRoleAttribute):
1883         (WebCore::AccessibilitySVGElement::determineAccessibilityRole):
1884         * accessibility/AccessibilitySVGElement.h: Added.
1885         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
1886         (webkitAccessibleGetName):
1887         (webkitAccessibleGetDescription):
1888         (atkRole):
1889         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1890         (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
1891         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1892         (createAccessibilityRoleMap):
1893         * rendering/RenderObject.h:
1894         (WebCore::RenderObject::isSVGTSpan):
1895         * rendering/svg/RenderSVGTSpan.h:
1896
1897 2016-03-05  Yusuke Suzuki  <utatane.tea@gmail.com>
1898
1899         [ES6] Support Reflect.construct
1900         https://bugs.webkit.org/show_bug.cgi?id=147330
1901
1902         Reviewed by Saam Barati.
1903
1904         * Modules/plugins/QuickTimePluginReplacement.mm:
1905         (WebCore::QuickTimePluginReplacement::installReplacement):
1906         * bindings/js/CallbackFunction.cpp:
1907         (WebCore::checkFunctionOnlyCallback):
1908         * bindings/js/JSCallbackData.cpp:
1909         (WebCore::JSCallbackData::invokeCallback):
1910         * bindings/js/JSCustomElementInterface.cpp:
1911         (WebCore::JSCustomElementInterface::constructElement):
1912         (WebCore::JSCustomElementInterface::attributeChanged):
1913         * bindings/js/JSCustomXPathNSResolver.cpp:
1914         (WebCore::JSCustomXPathNSResolver::lookupNamespaceURI):
1915         * bindings/js/JSDOMBinding.cpp:
1916         (WebCore::callFunctionWithCurrentArguments):
1917         (WebCore::DOMConstructorObject::getCallData):
1918         * bindings/js/JSDOMConstructor.h:
1919         (WebCore::JSDOMConstructorNotConstructable::getCallData):
1920         (WebCore::JSDOMConstructor<JSClass>::getConstructData):
1921         (WebCore::JSDOMNamedConstructor<JSClass>::getConstructData):
1922         (WebCore::JSBuiltinConstructor<JSClass>::getConstructData):
1923         * bindings/js/JSDOMPromise.cpp:
1924         (WebCore::DeferredWrapper::callFunction):
1925         * bindings/js/JSDocumentCustom.cpp:
1926         (WebCore::JSDocument::defineElement):
1927         * bindings/js/JSErrorHandler.cpp:
1928         (WebCore::JSErrorHandler::handleEvent):
1929         * bindings/js/JSEventListener.cpp:
1930         (WebCore::JSEventListener::handleEvent):
1931         * bindings/js/JSHTMLAllCollectionCustom.cpp:
1932         (WebCore::JSHTMLAllCollection::getCallData):
1933         * bindings/js/JSHTMLDocumentCustom.cpp:
1934         (WebCore::JSHTMLDocument::open):
1935         * bindings/js/JSKeyValueIterator.h:
1936         (WebCore::keyValueIteratorForEach):
1937         * bindings/js/JSMainThreadExecStateInstrumentation.h:
1938         (WebCore::JSMainThreadExecState::instrumentFunctionCall):
1939         (WebCore::JSMainThreadExecState::instrumentFunctionConstruct):
1940         * bindings/js/JSMutationCallback.cpp:
1941         (WebCore::JSMutationCallback::call):
1942         * bindings/js/JSMutationObserverCustom.cpp:
1943         (WebCore::constructJSMutationObserver):
1944         * bindings/js/JSPluginElementFunctions.cpp:
1945         (WebCore::callPlugin):
1946         (WebCore::pluginElementGetCallData):
1947         * bindings/js/ScheduledAction.cpp:
1948         (WebCore::ScheduledAction::create):
1949         (WebCore::ScheduledAction::executeFunctionInContext):
1950         * bindings/objc/WebScriptObject.mm:
1951         (-[WebScriptObject callWebScriptMethod:withArguments:]):
1952         * bindings/scripts/CodeGeneratorJS.pm:
1953         (GenerateConstructorHelperMethods):
1954         * bindings/scripts/test/JS/JSFloat64Array.cpp:
1955         (WebCore::JSFloat64ArrayConstructor::getConstructData):
1956         * bindings/scripts/test/JS/JSTestInterface.cpp:
1957         (WebCore::JSTestInterfaceConstructor::getConstructData):
1958         * bridge/NP_jsobject.cpp:
1959         (_NPN_InvokeDefault):
1960         (_NPN_Invoke):
1961         (_NPN_Construct):
1962         * bridge/objc/objc_runtime.mm:
1963         (JSC::Bindings::ObjcFallbackObjectImp::getCallData):
1964         * bridge/runtime_method.cpp:
1965         (JSC::RuntimeMethod::getCallData):
1966         * bridge/runtime_object.cpp:
1967         (JSC::Bindings::RuntimeObject::getCallData):
1968         (JSC::Bindings::RuntimeObject::getConstructData):
1969         * html/HTMLMediaElement.cpp:
1970         (WebCore::HTMLMediaElement::updateCaptionContainer):
1971         (WebCore::HTMLMediaElement::didAddUserAgentShadowRoot):
1972         (WebCore::HTMLMediaElement::getCurrentMediaControlsStatus):
1973         * html/HTMLPlugInImageElement.cpp:
1974         (WebCore::HTMLPlugInImageElement::didAddUserAgentShadowRoot):
1975         * testing/Internals.cpp:
1976         (WebCore::Internals::isReadableStreamDisturbed):
1977
1978 2016-03-05  Ryosuke Niwa  <rniwa@webkit.org>
1979
1980         Fix the bindings test after r197611.
1981
1982         * bindings/scripts/test/TestObj.idl:
1983
1984 2016-03-05  Ryosuke Niwa  <rniwa@webkit.org>
1985
1986         Move QualifiedName from CustomElementInfo to JSCustomElementInterface
1987         https://bugs.webkit.org/show_bug.cgi?id=155061
1988
1989         Reviewed by Antti Koivisto.
1990
1991         Store QualifiedName of custom elements in JSCustomElementInterface instead of CustomElementInfo
1992         now that each interface is associated with exactly one custom element as of r197602.
1993
1994         No new tests since this is a refactoring.
1995
1996         * bindings/js/JSCustomElementInterface.cpp:
1997         (WebCore::JSCustomElementInterface::JSCustomElementInterface): Now takes QualifiedName as the
1998         first argument.
1999         * bindings/js/JSCustomElementInterface.h:
2000         (WebCore::JSCustomElementInterface::create):
2001         (WebCore::JSCustomElementInterface::name): Added.
2002         * bindings/js/JSDocumentCustom.cpp:
2003         (WebCore::JSDocument::defineElement):
2004         * bindings/js/JSHTMLElementCustom.cpp:
2005         (WebCore::constructJSHTMLElement): Use findInterface instead of the deleted findName.
2006         * dom/CustomElementDefinitions.cpp:
2007         (WebCore::CustomElementDefinitions::checkName):
2008         (WebCore::CustomElementDefinitions::addElementDefinition): Renamed from defineElement.
2009         (WebCore::CustomElementDefinitions::findInterface): Add a variant that finds the interface object
2010         by a JS constructor.
2011         (WebCore::CustomElementDefinitions::containsConstructor):
2012         (WebCore::CustomElementDefinitions::findName): Deleted.
2013         * dom/CustomElementDefinitions.h:
2014         (WebCore::CustomElementDefinitions::CustomElementInfo::CustomElementInfo): Deleted.
2015
2016 2016-03-04  Ryosuke Niwa  <rniwa@webkit.org>
2017
2018         Add basic support for attributeChanged lifecycle callback
2019         https://bugs.webkit.org/show_bug.cgi?id=155011
2020
2021         Reviewed by Antti Koivisto.
2022
2023         Add basic support for attributeChangedCallback in setAttribute, removeAttribute, setAttributeNS,
2024         remoteAttributeNS, setAttributeNode, and removeAttributeNS. There are many other DOM APIs that
2025         could modify attributes but we would annotate those APIs in a separate patch to limit the scope
2026         of this change.
2027
2028         In order to invoke the lifecycle callback right before returning to the author script, allocate
2029         an instance of CustomElementLifecycleProcessingStack in each of these functions' binding code.
2030         The stack object's destructor invokes all callbacks enqueued by the DOM API if there are any.
2031
2032         Spec: https://w3c.github.io/webcomponents/spec/custom/#dfn-attribute-changed-callback
2033
2034         Tests: fast/custom-elements/attribute-changed-callback.html
2035                fast/custom-elements/lifecycle-callback-timing.html
2036
2037         * CMakeLists.txt:
2038         * WebCore.xcodeproj/project.pbxproj:
2039         * bindings/js/JSCustomElementInterface.cpp:
2040         (WebCore::JSCustomElementInterface::attributeChanged): Added. Invokes attributeChangedCallback.
2041         * bindings/js/JSCustomElementInterface.h:
2042         * bindings/js/JSMainThreadExecState.h:
2043         (JSMainThreadNullState): Allocate an instance of CustomElementLifecycleProcessingStack in GObject
2044         and Objective-C binding code for consistency with JavaScript. We can't do this in JavaScript
2045         because there is no RAII object all functions, getters, and setters allocate (for a good reason).
2046
2047         * bindings/scripts/CodeGeneratorJS.pm:
2048         (GenerateImplementation): Generate an instance of CustomElementLifecycleProcessingStack when
2049         NeedsLifecycleProcessingStack is specified as an extended IDL attribute.
2050         * bindings/scripts/IDLAttributes.txt: Added NeedsLifecycleProcessingStack.
2051         * bindings/scripts/test/JS/JSTestObj.cpp:
2052         (WebCore::jsTestObjPrototypeFunctionMethodWithNeedsLifecycleProcessingStack):
2053         * bindings/scripts/test/TestObj.idl: Added a test for NeedsLifecycleProcessingStack.
2054
2055         * dom/DOMAllInOne.cpp:
2056         * dom/Element.cpp:
2057         (WebCore::Element::attributeChanged): Enqueue attributeChanged callback if the context object
2058         is a custom element and there is a CustomElementLifecycleProcessingStack allocated in the stack.
2059         * dom/Element.idl:
2060
2061         * dom/LifecycleCallbackQueue.cpp: Added.
2062         (WebCore::LifecycleQueueItem): Added.
2063         (WebCore::LifecycleQueueItem::LifecycleQueueItem): Added.
2064         (WebCore::LifecycleQueueItem::invoke): Added.
2065         (WebCore::LifecycleCallbackQueue::LifecycleCallbackQueue): Added.
2066         (WebCore::LifecycleCallbackQueue::~LifecycleCallbackQueue): Added.
2067         (WebCore::LifecycleCallbackQueue::enqueueAttributeChangedCallback): Added.
2068         (WebCore::LifecycleCallbackQueue::invokeAll): Added.
2069         (WebCore::CustomElementLifecycleProcessingStack::ensureCurrentQueue): Added. As noted in FIXME,
2070         the early exit in the code is necessary only because we haven't added NeedsLifecycleProcessingStack
2071         in all places. It should go away in a follow up patch.
2072         (WebCore::CustomElementLifecycleProcessingStack::processQueue): Added.
2073         * dom/LifecycleCallbackQueue.h: Added.
2074         (WebCore::CustomElementLifecycleProcessingStack): This is a light weight RAII object the binding
2075         code will allocate in order to queue up lifecycle callbacks. We don't use Ref or std::unique_ptr
2076         in m_queue to avoid generating the code to destruct LifecycleCallbackQueue everywhere.
2077         (WebCore::CustomElementLifecycleProcessingStack::CustomElementLifecycleProcessingStack): Added.
2078         (WebCore::CustomElementLifecycleProcessingStack::~CustomElementLifecycleProcessingStack): Added.
2079         (WebCore::CustomElementLifecycleProcessingStack::hasCurrentProcessingStack): Added.
2080
2081 2016-03-04  Carlos Garcia Campos  <cgarcia@igalia.com>
2082
2083         [GTK] Scrollbars are broken again with GTK+ >= 3.19.11
2084         https://bugs.webkit.org/show_bug.cgi?id=154890
2085
2086         Reviewed by Michael Catanzaro.
2087
2088         Scrollbar style properties have been deprecated in GTK+, and it
2089         seems that now deprecating means keeping the properties but
2090         ignoring them. So, this reworks the whole scrollbars theme code
2091         again to not cache style properties anymore, but retrieve them
2092         from the GtkStyleContext. Previous GTK+ versions still need to
2093         query the style properties, so I've added helper functions to get
2094         all the style properties with the ifdefs, trying to keep the
2095         common render code free of GTK+ versions ifdefs.
2096
2097         * platform/gtk/ScrollbarThemeGtk.cpp:
2098         (WebCore::ScrollbarThemeGtk::backButtonRect):
2099         (WebCore::ScrollbarThemeGtk::forwardButtonRect):
2100         (WebCore::ScrollbarThemeGtk::trackRect):
2101         (WebCore::ScrollbarThemeGtk::thumbRect):
2102         (WebCore::ScrollbarThemeGtk::paintTrackBackground):
2103         (WebCore::ScrollbarThemeGtk::paintThumb):
2104         (WebCore::ScrollbarThemeGtk::paint):
2105         (WebCore::ScrollbarThemeGtk::scrollbarThickness):
2106         (WebCore::ScrollbarThemeGtk::buttonSize):
2107         (WebCore::ScrollbarThemeGtk::stepperSize):
2108         (WebCore::ScrollbarThemeGtk::getStepperSpacing):
2109         (WebCore::ScrollbarThemeGtk::troughUnderSteppers):
2110         (WebCore::ScrollbarThemeGtk::minimumThumbLength):
2111         (WebCore::ScrollbarThemeGtk::thumbFatness):
2112         (WebCore::ScrollbarThemeGtk::getTroughBorder):
2113         (WebCore::ScrollbarThemeGtk::getOrCreateStyleContext):
2114         (WebCore::ScrollbarThemeGtk::updateThemeProperties):
2115         (WebCore::ScrollbarThemeGtk::handleMousePressEvent):
2116         * platform/gtk/ScrollbarThemeGtk.h:
2117
2118 2016-03-04  Brent Fulgham  <bfulgham@apple.com>
2119
2120         Resource load statistics are not honoring private browsing
2121         https://bugs.webkit.org/show_bug.cgi?id=155054
2122         <rdar://problem/24987873>
2123
2124         Reviewed by Andy Estes.
2125
2126         Modify the points where we capture resource load statistics to ignore
2127         loads made during private browsing. Do this by moving more of the logic
2128         about whether to gather statistics into the logging functions, passing
2129         the raw input types (frame, ResourceRequest, ResourceResponse) internally
2130         so that we don't pay any cost until we decide we want to gather data.s
2131
2132         * loader/DocumentLoader.cpp:
2133         (WebCore::DocumentLoader::willSendRequest): Revise for the new API on
2134         ResourceLoadObserver.
2135         * loader/ResourceLoadObserver.cpp:
2136         (WebCore::ResourceLoadObserver::logFrameNavigation): Revise signature and
2137         check for private browsing.
2138         (WebCore::ResourceLoadObserver::logSubresourceLoading): Ditto.
2139         (WebCore::ResourceLoadObserver::logUserInteraction): Ditto.
2140         * loader/ResourceLoadObserver.h:
2141         * loader/SubresourceLoader.cpp:
2142         (WebCore::SubresourceLoader::willSendRequestInternal): Ditto.
2143
2144 2016-03-04  Alex Christensen  <achristensen@webkit.org>
2145
2146         Fix file mime-types when using NetworkSession
2147         https://bugs.webkit.org/show_bug.cgi?id=155058
2148
2149         Reviewed by Andy Estes.
2150
2151         This fixes platform/mac/fast/loader/file-url-mimetypes-3.html
2152         and platform/mac/fast/loader/file-url-mimetypes.html.
2153
2154         * platform/network/mac/WebCoreURLResponse.h:
2155
2156 2016-03-04  Sam Weinig  <sam@webkit.org>
2157
2158         [WebKit2] Add WebKit2 equivalent of -[WebView _insertNewlineInQuotedContent]
2159         <rdar://problem/24943591>
2160         https://bugs.webkit.org/show_bug.cgi?id=155057
2161
2162         Reviewed by Tim Horton.
2163
2164         Move Editor::insertParagraphSeparatorInQuotedContent() into Editor.cpp
2165         and remove the duplicated code in EditorIOS.mm and EditorMac.mm.
2166
2167         * editing/Editor.cpp:
2168         (WebCore::Editor::insertParagraphSeparatorInQuotedContent):
2169         * editing/Editor.h:
2170         * editing/ios/EditorIOS.mm:
2171         (WebCore::Editor::insertParagraphSeparatorInQuotedContent): Deleted.
2172         * editing/mac/EditorMac.mm:
2173         (WebCore::Editor::insertParagraphSeparatorInQuotedContent): Deleted.
2174
2175 2016-03-04  Gavin Barraclough  <barraclough@apple.com>
2176
2177         Convert DOMTimer interval from int to std::chromo::milliseconds
2178         https://bugs.webkit.org/show_bug.cgi?id=155051
2179
2180         Speculative build fix.
2181
2182         * inspector/TimelineRecordFactory.cpp:
2183         (WebCore::TimelineRecordFactory::createTimerInstallData):
2184
2185 2016-03-04  Gavin Barraclough  <barraclough@apple.com>
2186
2187         Convert DOMTimer interval from int to std::chromo::milliseconds
2188         https://bugs.webkit.org/show_bug.cgi?id=155051
2189
2190         iOS build fix
2191
2192         * page/DOMTimer.cpp:
2193         (WebCore::DOMTimer::install):
2194
2195 2016-03-04  Ryosuke Niwa  <rniwa@webkit.org>
2196
2197         Update defineCustomElement according to the spec rewrite
2198         https://bugs.webkit.org/show_bug.cgi?id=155010
2199         <rdar://problem/24970878>
2200
2201         Reviewed by Chris Dumez.
2202
2203         Updated the implementation of defineCustomElement and HTMLConstructor per recent rewrite of the spec:
2204         https://w3c.github.io/webcomponents/spec/custom/#dom-document-defineelement
2205         https://w3c.github.io/webcomponents/spec/custom/#htmlelement-constructor
2206
2207         defineCustomElement is now called defineElement and we disallow defining multiple custom elements with
2208         a single class and throw an exception in defineElement.
2209
2210         Test: fast/custom-elements/Document-defineElement.html
2211
2212         * bindings/js/JSDocumentCustom.cpp:
2213         (WebCore::JSDocument::defineElement): Renamed from defineCustomElement. Throw an exception when the interface
2214         already defines another custom element. Also added FIXME's for missing steps.
2215
2216         * bindings/js/JSHTMLElementCustom.cpp:
2217         (WebCore::constructJSHTMLElement): Removed the support for specifying a tag name in the first argument when
2218         a single class defines multiple custom elements since that now results in an exception (in defineElement).
2219
2220         * dom/CustomElementDefinitions.cpp:
2221         (WebCore::CustomElementDefinitions::containsConstructor): Added.
2222         * dom/CustomElementDefinitions.h:
2223         * dom/Document.idl: Renamed defineCustomElement to defineElement.
2224         * html/HTMLElement.idl: Removed the optional tag name from the constructor.
2225
2226 2016-03-04  Tim Horton  <timothy_horton@apple.com>
2227
2228         Begin implementing <attachment> painting on iOS
2229         https://bugs.webkit.org/show_bug.cgi?id=155046
2230         <rdar://problem/24805991>
2231
2232         Reviewed by Enrica Casucci.
2233
2234         No new tests; there are existing tests that I will unskip and rebaseline
2235         in the near future.
2236
2237         * rendering/RenderThemeIOS.h:
2238         * rendering/RenderThemeIOS.mm:
2239         (WebCore::AttachmentInfo::addLine):
2240         (WebCore::AttachmentInfo::buildTitleLines):
2241         (WebCore::AttachmentInfo::buildSingleLine):
2242         (WebCore::getAttachmentProgress):
2243         (WebCore::iconForAttachment):
2244         (WebCore::AttachmentInfo::AttachmentInfo):
2245         (WebCore::RenderThemeIOS::attachmentIntrinsicSize):
2246         (WebCore::RenderThemeIOS::attachmentBaseline):
2247         (WebCore::paintAttachmentIcon):
2248         (WebCore::paintAttachmentText):
2249         (WebCore::paintAttachmentProgress):
2250         (WebCore::paintAttachmentBorder):
2251         (WebCore::RenderThemeIOS::paintAttachment):
2252         There are still a few missing pieces, but get <attachment> painting a bit on iOS.
2253         We will paint an icon, action, title, and subtitle - in that order - depending on what we have.
2254         The content is vertically and horizontally centered.
2255
2256 2016-03-04  Gavin Barraclough  <barraclough@apple.com>
2257
2258         Convert DOMTimer interval from int to std::chromo::milliseconds
2259         https://bugs.webkit.org/show_bug.cgi?id=155051
2260
2261         Reviewed by Ryosuke Niwa.
2262
2263         This change is pretty much mechanical, replacing int with std::chrono::milliseconds.
2264
2265         * inspector/InspectorInstrumentation.cpp:
2266         (WebCore::InspectorInstrumentation::willSendXMLHttpRequestImpl):
2267         (WebCore::InspectorInstrumentation::didInstallTimerImpl):
2268         * inspector/InspectorInstrumentation.h:
2269         (WebCore::InspectorInstrumentation::willSendXMLHttpRequest):
2270         (WebCore::InspectorInstrumentation::didInstallTimer):
2271         * inspector/InspectorTimelineAgent.cpp:
2272         (WebCore::InspectorTimelineAgent::didPaint):
2273         (WebCore::InspectorTimelineAgent::didInstallTimer):
2274         * inspector/InspectorTimelineAgent.h:
2275         * inspector/TimelineRecordFactory.cpp:
2276         (WebCore::TimelineRecordFactory::createGenericTimerData):
2277         (WebCore::TimelineRecordFactory::createTimerInstallData):
2278         * inspector/TimelineRecordFactory.h:
2279         * page/DOMTimer.cpp:
2280         (WebCore::shouldForwardUserGesture):
2281         (WebCore::DOMTimer::DOMTimer):
2282         (WebCore::DOMTimer::~DOMTimer):
2283         (WebCore::DOMTimer::install):
2284         (WebCore::DOMTimer::intervalClampedToMinimum):
2285         * page/DOMTimer.h:
2286         * page/DOMWindow.cpp:
2287         (WebCore::DOMWindow::setTimeout):
2288         (WebCore::DOMWindow::clearTimeout):
2289         (WebCore::DOMWindow::setInterval):
2290         (WebCore::DOMWindow::clearInterval):
2291         * workers/WorkerGlobalScope.cpp:
2292         (WebCore::WorkerGlobalScope::setTimeout):
2293         (WebCore::WorkerGlobalScope::clearTimeout):
2294         (WebCore::WorkerGlobalScope::setInterval):
2295         (WebCore::WorkerGlobalScope::clearInterval):
2296
2297 2016-03-03  Enrica Casucci  <enrica@apple.com>
2298
2299         Add a mechanism to customize the long press action.
2300         https://bugs.webkit.org/show_bug.cgi?id=154995
2301         rdar://problem/24823732
2302
2303         Reviewed by Tim Horton.
2304
2305         We want to allow long press on attachment elements as well.
2306
2307         * WebCore.xcodeproj/project.pbxproj: Making HTMLAttachmentElement.h private.
2308         * html/HTMLAttachmentElement.h: Adding exported functions.
2309
2310 2016-03-04  Andreas Kling  <akling@apple.com>
2311
2312         [iOS] Throw away compiled RegExp code when navigating to a new page.
2313         <https://webkit.org/b/155015>
2314
2315         Reviewed by Anders Carlsson.
2316
2317         Discard RegExp code when doing a top-level navigation.
2318         This frees up a couple hundred kilobytes on many pages.
2319
2320         * bindings/js/GCController.cpp:
2321         (WebCore::GCController::deleteAllRegExpCode):
2322         * bindings/js/GCController.h:
2323         * loader/FrameLoader.cpp:
2324         (WebCore::FrameLoader::commitProvisionalLoad):
2325
2326 2016-03-04  Simon Fraser  <simon.fraser@apple.com>
2327
2328         Use larger tiles when possible to reduce per-tile painting overhead
2329         https://bugs.webkit.org/show_bug.cgi?id=154985
2330
2331         Reviewed by Zalan Bujtas.
2332
2333         r197541 inadvertently missed FrameView changes that push scrollability data
2334         onto the TiledBacking, so didn't actually change behavior (hence the 512x512 tiles
2335         in the failing tests).
2336
2337         Also remove m_tileSizeAtLastRevalidate from TileGrid; it's replaced by a simpler test.
2338
2339         * page/FrameView.cpp:
2340         (WebCore::FrameView::addedOrRemovedScrollbar):
2341         * platform/graphics/ca/TileGrid.cpp:
2342         (WebCore::TileGrid::revalidateTiles):
2343         (WebCore::TileGrid::TileGrid): Deleted.
2344         * platform/graphics/ca/TileGrid.h:
2345
2346 2016-03-04  Simon Fraser  <simon.fraser@apple.com>
2347
2348         Use BoxExtent instead of EdgeSet in TileController
2349         https://bugs.webkit.org/show_bug.cgi?id=155040
2350
2351         Reviewed by Zalan Bujtas.
2352
2353         Remove EdgeSet, which was very similar to the existing BoxExtent, and use BoxExtent
2354         in TileController.
2355
2356         * WebCore.xcodeproj/project.pbxproj:
2357         * platform/graphics/EdgeSet.h: Removed.
2358         (WebCore::EdgeSet::EdgeSet): Deleted.
2359         (WebCore::EdgeSet::top): Deleted.
2360         (WebCore::EdgeSet::setTop): Deleted.
2361         (WebCore::EdgeSet::right): Deleted.
2362         (WebCore::EdgeSet::setRight): Deleted.
2363         (WebCore::EdgeSet::bottom): Deleted.
2364         (WebCore::EdgeSet::setBottom): Deleted.
2365         (WebCore::EdgeSet::left): Deleted.
2366         (WebCore::EdgeSet::setLeft): Deleted.
2367         (WebCore::EdgeSet::operator==): Deleted.
2368         (WebCore::EdgeSet::operator!=): Deleted.
2369         * platform/graphics/ca/TileController.cpp:
2370         (WebCore::TileController::setHasMargins):
2371         * platform/graphics/ca/TileController.h:
2372
2373 2016-03-04  Brent Fulgham  <bfulgham@apple.com>
2374
2375         [WK2] Gather resource load statistics
2376         https://bugs.webkit.org/show_bug.cgi?id=154278
2377         <rdar://problem/24702892>
2378
2379         Reviewed by Andy Estes.
2380
2381         Tested (now under WK2) by http/tests/navigation/statistics.html
2382
2383         Split part of the ResourceLoadObserver into a new class (ResourceLoadStatisticsStore)
2384         that manages the collection of ResourceLoadStatistic objects, and that can be used
2385         in the UIProcess without touching various WebProcess-specific WebCore classes.
2386
2387         Have the WebProcess only fire a message to the UIProcess if data has been modified. Otherwise,
2388         no messages should be sent. When new data is encountered, start a 5 second timer. If more
2389         data is found during this delay, just accumulate it. When the timer fires, all data is sent
2390         and the timer stops until a new batch of data arrives.
2391
2392         * CMakeLists.txt: Add the new ResourceLoadStatisticsStore class.
2393         * WebCore.xcodeproj/project.pbxproj: Adjust visibility of ResourceLoadStatistics header,
2394         and add new ResourceLoadStatisticsStore class.
2395         * loader/ResourceLoadObserver.cpp:
2396         (WebCore::ResourceLoadObserver::setResourceLoadStatisticsEnabled): Deleted.
2397         (WebCore::ResourceLoadObserver::resourceLoadStatisticsEnabled): Deleted.
2398         (WebCore::ResourceLoadObserver::setStatisticsStore): Added.
2399         (WebCore::ResourceLoadObserver::logFrameNavigation): Tell the ResourceLoadStatisticsStore to fire its 'data changed'
2400         handler if necessary.
2401         (WebCore::ResourceLoadObserver::logSubresourceLoading): Ditto.
2402         (WebCore::ResourceLoadObserver::logUserInteraction): Ditto.
2403         (WebCore::ResourceLoadObserver::statisticsForOrigin): Use new ResourceLoadStatisticsStore.
2404         (WebCore::ResourceLoadObserver::isPrevalentResource): Deleted.
2405         (WebCore::ResourceLoadObserver::resourceStatisticsForPrimaryDomain): Deleted.
2406         (WebCore::ResourceLoadObserver::writeDataToDisk): Deleted.
2407         (WebCore::ResourceLoadObserver::setStatisticsStorageDirectory): Deleted.
2408         (WebCore::ResourceLoadObserver::persistentStoragePath): Deleted.
2409         (WebCore::ResourceLoadObserver::readDataFromDiskIfNeeded): Deleted.
2410         (WebCore::ResourceLoadObserver::createDecoderFromDisk): Deleted.
2411         (WebCore::ResourceLoadObserver::writeEncoderToDisk): Deleted.
2412         * loader/ResourceLoadObserver.h:
2413         * loader/ResourceLoadStatistics.cpp:
2414         (WebCore::ResourceLoadStatistics::encode): Get rid of unneeded argument.
2415         (WebCore::ResourceLoadStatistics::decode): Ditto.
2416         (WebCore::mergeHashCountedSet): Added helper function.
2417         (WebCore::ResourceLoadStatistics::merge): Added.
2418         * loader/ResourceLoadStatistics.h:
2419         (WebCore::ResourceLoadStatistics::ResourceLoadStatistics):
2420         * loader/ResourceLoadStatisticsStore.cpp: Added.
2421         (WebCore::ResourceLoadStatisticsStore::create):
2422         (WebCore::ResourceLoadStatisticsStore::ResourceLoadStatisticsStore):
2423         (WebCore::ResourceLoadStatisticsStore::isPrevalentResource):
2424         (WebCore::ResourceLoadStatisticsStore::resourceStatisticsForPrimaryDomain):
2425         (WebCore::ResourceLoadStatisticsStore::writeDataToDisk):
2426         (WebCore::ResourceLoadStatisticsStore::setStatisticsStorageDirectory):
2427         (WebCore::ResourceLoadStatisticsStore::persistentStoragePath):
2428         (WebCore::ResourceLoadStatisticsStore::readDataFromDiskIfNeeded):
2429         (WebCore::ResourceLoadStatisticsStore::createDecoderFromDisk):
2430         (WebCore::ResourceLoadStatisticsStore::writeEncoderToDisk):
2431         (WebCore::ResourceLoadStatisticsStore::statisticsForOrigin):
2432         (WebCore::ResourceLoadStatisticsStore::takeStatistics):
2433         (WebCore::ResourceLoadStatisticsStore::mergeStatistics):
2434         (WebCore::ResourceLoadStatisticsStore::setNotificationCallback):
2435         (WebCore::ResourceLoadStatisticsStore::fireDataModificationHandler):
2436         * loader/ResourceLoadStatisticsStore.h: Added.
2437
2438 2016-03-04  Konstantin Tokarev  <annulen@yandex.ru>
2439
2440         Added missing override specifiers under Source/WebCore.
2441         https://bugs.webkit.org/show_bug.cgi?id=155021
2442
2443         Reviewed by Michael Catanzaro.
2444
2445         No new tests needed.
2446
2447         * bridge/NP_jsobject.cpp:
2448         * css/CSSStyleSheet.cpp:
2449         * dom/MutationObserver.cpp:
2450         * editing/DictationCommand.cpp:
2451         * editing/EditingStyle.cpp:
2452         * loader/EmptyClients.cpp:
2453         * loader/SinkDocument.cpp:
2454         * page/DOMWindow.cpp:
2455         * page/animation/CSSPropertyAnimation.cpp:
2456         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
2457         Also added #if(SOUP) guard to
2458         ResourceHandleStreamingClient::getOrCreateReadBuffer
2459         because it is not an overridden method otherwise.
2460         * platform/text/LineEnding.cpp:
2461         * xml/parser/XMLDocumentParserLibxml2.cpp:
2462
2463 2016-03-04  Gavin Barraclough  <barraclough@apple.com>
2464
2465         Max out timer throttling immediately for pre-render pages
2466         https://bugs.webkit.org/show_bug.cgi?id=155038
2467
2468         Reviewed by Chris Dumez.
2469
2470         If a hidden page has never been visible, no need to gently ramp into throttling - treat it
2471         the same as a page that has been viewed, but has been in the background for a long time.
2472
2473         Why? The throttling mechanism scales with the amount of background work by shifting the
2474         limit - once all background pages have maxed out the limit, they should no longer be burden
2475         of the system. However the mechanism doesn't currently do anything to accelerate towards
2476         the limit based on the number of pages in the ramp up phase, and ramp up duration is
2477         proportional to limit (so ramping up to a high limit takes a long time). So if you quickly
2478         create a large number of hidden pages the system may be under excessive load for a while,
2479         as we slowly ramp up to a limit that will adequately constrain resource consumption.
2480         In cases where a large number of hidden pages are rapidly generated, many likely remain in
2481         the pre-render state, so this mitigation should typically help.
2482
2483         * page/Page.cpp:
2484         (WebCore::Page::updateDOMTimerAlignmentInterval):
2485             - if m_isPrerender then m_timerAlignmentInterval is set to the limit.
2486         (WebCore::Page::setIsPrerender):
2487             - When this changes updateDOMTimerAlignmentInterval().
2488
2489 2016-03-04  Gavin Barraclough  <barraclough@apple.com>
2490
2491         Unify determination of page timer alignment
2492         https://bugs.webkit.org/show_bug.cgi?id=155031
2493
2494         Reviewed by Chris Dumez.
2495
2496         Currently this is scattered throughout Page - sites that call setDOMTimerAlignmentInterval have
2497         to determine the correct alignment interval. Instead, replace setDOMTimerAlignmentInterval with
2498         updateDOMTimerAlignmentInterval, and unify the policy decision here.
2499
2500         * page/Page.cpp:
2501         (WebCore::Page::setTimerThrottlingState):
2502             - setDOMTimerAlignmentInterval -> updateDOMTimerAlignmentInterval
2503               Also, to simplify always record the timestamp when the state changes.
2504         (WebCore::Page::setTimerAlignmentIntervalIncreaseLimit):
2505             - setDOMTimerAlignmentInterval -> updateDOMTimerAlignmentInterval
2506         (WebCore::Page::updateDOMTimerAlignmentInterval):
2507             - Was setDOMTimerAlignmentInterval, now determines the new alignment value.
2508         (WebCore::Page::timerAlignmentIntervalIncreaseTimerFired):
2509             - setDOMTimerAlignmentInterval -> updateDOMTimerAlignmentInterval
2510         (WebCore::Page::setDOMTimerAlignmentInterval): Deleted.
2511             - Removed, became updateDOMTimerAlignmentInterval.
2512         * page/Page.h:
2513             - setDOMTimerAlignmentInterval -> updateDOMTimerAlignmentInterval
2514               m_timerThrottlingEnabledTime -> m_timerThrottlingStateLastChangedTime
2515
2516 2016-03-04  Simon Fraser  <simon.fraser@apple.com>
2517
2518         Fix crash seen in iOS simulator tests
2519         https://bugs.webkit.org/show_bug.cgi?id=155030
2520
2521         Reviewed by Tim Horton.
2522
2523         owningGraphicsLayer() can be null when the tileSizeChangeTimer fires, so null check
2524         it and return, as we do for the tileRevalidationTimer.
2525
2526         * platform/graphics/ca/TileController.cpp:
2527         (WebCore::TileController::tileSizeChangeTimerFired):
2528
2529 2016-03-04  Alex Christensen  <achristensen@webkit.org>
2530
2531         Remove vcxproj build system
2532         https://bugs.webkit.org/show_bug.cgi?id=154388
2533
2534         Rubber-stamped by Brent Fulgham.
2535
2536         * WebCore.vcxproj/WebCore.submit.sln: Removed.
2537         * WebCore.vcxproj/WebCore.vcxproj: Removed.
2538         * WebCore.vcxproj/WebCore.vcxproj.filters: Removed.
2539         * WebCore.vcxproj/WebCoreCFNetwork.props: Removed.
2540         * WebCore.vcxproj/WebCoreCG.props: Removed.
2541         * WebCore.vcxproj/WebCoreCURL.props: Removed.
2542         * WebCore.vcxproj/WebCoreCairo.props: Removed.
2543         * WebCore.vcxproj/WebCoreCommon.props: Removed.
2544         * WebCore.vcxproj/WebCoreDebug.props: Removed.
2545         * WebCore.vcxproj/WebCoreDebugWinCairo.props: Removed.
2546         * WebCore.vcxproj/WebCoreGenerated.make: Removed.
2547         * WebCore.vcxproj/WebCoreGenerated.vcxproj: Removed.
2548         * WebCore.vcxproj/WebCoreGenerated.vcxproj.filters: Removed.
2549         * WebCore.vcxproj/WebCoreGeneratedCommon.props: Removed.
2550         * WebCore.vcxproj/WebCoreGeneratedDebug.props: Removed.
2551         * WebCore.vcxproj/WebCoreGeneratedDebugWinCairo.props: Removed.
2552         * WebCore.vcxproj/WebCoreGeneratedProduction.props: Removed.
2553         * WebCore.vcxproj/WebCoreGeneratedRelease.props: Removed.
2554         * WebCore.vcxproj/WebCoreGeneratedReleaseWinCairo.props: Removed.
2555         * WebCore.vcxproj/WebCoreGeneratedWinCairo.make: Removed.
2556         * WebCore.vcxproj/WebCoreGeneratedWinCairoCommon.props: Removed.
2557         * WebCore.vcxproj/WebCoreIncludeCommon.props: Removed.
2558         * WebCore.vcxproj/WebCoreMediaQT.props: Removed.
2559         * WebCore.vcxproj/WebCorePostBuild.cmd: Removed.
2560         * WebCore.vcxproj/WebCorePreBuild.cmd: Removed.
2561         * WebCore.vcxproj/WebCoreProduction.props: Removed.
2562         * WebCore.vcxproj/WebCoreQuartzCore.props: Removed.
2563         * WebCore.vcxproj/WebCoreRelease.props: Removed.
2564         * WebCore.vcxproj/WebCoreReleaseWinCairo.props: Removed.
2565         * WebCore.vcxproj/WebCoreTestSupport.vcxproj: Removed.
2566         * WebCore.vcxproj/WebCoreTestSupport.vcxproj.filters: Removed.
2567         * WebCore.vcxproj/WebCoreTestSupportCommon.props: Removed.
2568         * WebCore.vcxproj/WebCoreTestSupportDebug.props: Removed.
2569         * WebCore.vcxproj/WebCoreTestSupportDebugWinCairo.props: Removed.
2570         * WebCore.vcxproj/WebCoreTestSupportProduction.props: Removed.
2571         * WebCore.vcxproj/WebCoreTestSupportRelease.props: Removed.
2572         * WebCore.vcxproj/WebCoreTestSupportReleaseWinCairo.props: Removed.
2573         * WebCore.vcxproj/build-generated-files.pl: Removed.
2574         * WebCore.vcxproj/copyForwardingHeaders.cmd: Removed.
2575         * WebCore.vcxproj/copyWebCoreResourceFiles.cmd: Removed.
2576         * WebCore.vcxproj/migrate-scripts.pl: Removed.
2577
2578 2016-03-04  Brady Eidson  <beidson@apple.com>
2579
2580         Remove use of deprecated sqlite3_expired
2581         https://bugs.webkit.org/show_bug.cgi?id=155025
2582
2583         Reviewed by Tim Horton.
2584
2585         Since we exclusively use sqlite3_prepare_v2 and don't use sqlite3_prepare,
2586         manually checking for expired statements is not necessary.
2587
2588         * platform/sql/SQLiteStatement.cpp:
2589         (WebCore::SQLiteStatement::isExpired): Null check the statement, but don't bother
2590           with sqlite3_expired.
2591
2592 2016-03-04  Daniel Bates  <dabates@apple.com>
2593
2594         Move CryptoDigest to WebCore/platform
2595         https://bugs.webkit.org/show_bug.cgi?id=155008
2596         <rdar://problem/24969787>
2597
2598         Reviewed by Brent Fulgham.
2599
2600         CryptoDigest provides a platform-independent interface for interacting with platform-
2601         specific cryptographic hashing services. We currently make use of this code as part
2602         of the implementation of Web Crypto. This code will also be beneficial as part of
2603         implementing support for Content Security Policy inline script and inline stylesheet
2604         hashes. We should move CryptoDigest to WebCore/platform to convey that it a general
2605         purpose platform abstraction.
2606
2607         * CMakeLists.txt: Add include directory WebCore/platform/crypto.
2608         * PlatformEfl.cmake: Add file platform/crypto/gnutls/CryptoDigestGnuTLS.cpp and
2609         remove file crypto/gnutls/CryptoDigestGnuTLS.cpp.
2610         * PlatformGTK.cmake: Ditto.
2611         * PlatformMac.cmake: Add file platform/crypto/mac/CryptoDigestMac.cpp and
2612         remove file crypto/mac/CryptoDigestMac.cpp.
2613         * WebCore.xcodeproj/project.pbxproj:
2614         * crypto/algorithms/CryptoAlgorithmSHA1.cpp:
2615         (WebCore::CryptoAlgorithmSHA1::digest): Substitute "CryptoDigest::Algorithm" for "CryptoAlgorithmIdentifier".
2616         * crypto/algorithms/CryptoAlgorithmSHA224.cpp:
2617         (WebCore::CryptoAlgorithmSHA224::digest): Ditto.
2618         * crypto/algorithms/CryptoAlgorithmSHA256.cpp:
2619         (WebCore::CryptoAlgorithmSHA256::digest): Ditto.
2620         * crypto/algorithms/CryptoAlgorithmSHA384.cpp:
2621         (WebCore::CryptoAlgorithmSHA384::digest): Ditto.
2622         * crypto/algorithms/CryptoAlgorithmSHA512.cpp:
2623         (WebCore::CryptoAlgorithmSHA512::digest): Ditto.
2624         * crypto/mac/CryptoAlgorithmRSASSA_PKCS1_v1_5Mac.cpp:
2625         (WebCore::getCryptoDigestAlgorithm): Converts a CryptoAlgorithmIdentifier enumerator to a
2626         CryptoDigest::Algorithm enumerator, if applicable.
2627         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::platformSign): Write in terms of WebCore::getCryptoDigestAlgorithm().
2628         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::platformVerify): Ditto.
2629         * platform/crypto/CryptoDigest.h: Renamed from Source/WebCore/crypto/CryptoDigest.h. Also added enum CryptoDigest::Algorithm
2630         and changed constructor to take this enum.
2631         * platform/crypto/gnutls/CryptoDigestGnuTLS.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoDigestGnuTLS.cpp.
2632         (WebCore::CryptoDigest::CryptoDigest): Substitute "CryptoDigest::Algorithm" for "CryptoAlgorithmIdentifier".
2633         (WebCore::CryptoDigest::~CryptoDigest): Ditto.
2634         (WebCore::CryptoDigest::create): Ditto.
2635         (WebCore::CryptoDigest::addBytes): Ditto.
2636         (WebCore::CryptoDigest::computeHash): Ditto.
2637         * platform/crypto/mac/CryptoDigestMac.cpp: Renamed from Source/WebCore/crypto/mac/CryptoDigestMac.cpp.
2638         (WebCore::toSHA1Context): Ditto.
2639         (WebCore::toSHA224Context): Ditto.
2640         (WebCore::toSHA256Context): Ditto.
2641         (WebCore::toSHA384Context): Ditto.
2642         (WebCore::toSHA512Context): Ditto.
2643         (WebCore::CryptoDigest::CryptoDigest): Ditto.
2644         (WebCore::CryptoDigest::~CryptoDigest): Ditto.
2645         (WebCore::CryptoDigest::create): Ditto.
2646         (WebCore::CryptoDigest::addBytes): Ditto.
2647         (WebCore::CryptoDigest::computeHash): Ditto.
2648
2649 2016-03-04  Myles C. Maxfield  <mmaxfield@apple.com>
2650
2651         Whitespace causes font-variant: all-small-caps to synthesize
2652         https://bugs.webkit.org/show_bug.cgi?id=155004
2653         <rdar://problem/24630796>
2654
2655         Reviewed by Darin Adler.
2656
2657         Many fonts (such as Avenir Next) don't report to support whitespace characters under
2658         smcp or c2sc. Previously, we were using this as a signal to synthesize small caps
2659         instead of true small caps. However, a better solution is for whitespace to never
2660         cause synthesis with all-small-caps.
2661
2662         Test: fast/text/all-small-caps-whitespace.html
2663
2664         * platform/graphics/mac/ComplexTextController.cpp:
2665         (WebCore::shouldSynthesize):
2666         (WebCore::ComplexTextController::collectComplexTextRuns):
2667
2668 2016-03-04  Myles C. Maxfield  <mmaxfield@apple.com>
2669
2670         [iOS] Crash during font loading when injected bundle cancels load
2671         https://bugs.webkit.org/show_bug.cgi?id=155001
2672
2673         Reviewed by Tim Horton.
2674
2675         If a injected bundle cancels the load, the fontLoaded() callback will be
2676         called twice. We can simply detect this condition.
2677
2678         Test: CancelLoading.CancelFontSubresource API test
2679
2680         * css/CSSFontFaceSource.cpp:
2681         (WebCore::CSSFontFaceSource::fontLoaded):
2682
2683 2016-03-03  Ada Chan  <adachan@apple.com>
2684
2685         The visibility of the airplay menu also depends on whether there's a custom menu item.
2686         https://bugs.webkit.org/show_bug.cgi?id=154987
2687
2688         Reviewed by Darin Adler.
2689
2690         * html/HTMLMediaElement.cpp:
2691         (WebCore::HTMLMediaElement::enqueuePlaybackTargetAvailabilityChangedEvent):
2692
2693 2016-03-04  Timothy Hatcher  <timothy@apple.com>
2694
2695         Inform WebKit and WebCore if a page is controlled by automation.
2696
2697         https://bugs.webkit.org/show_bug.cgi?id=154991
2698         rdar://problem/24965784
2699
2700         Reviewed by Joseph Pecoraro.
2701
2702         * page/Page.h:
2703         (WebCore::Page::isControlledByAutomation): Added.
2704         (WebCore::Page::setControlledByAutomation): Added.
2705
2706 2016-03-03  Antti Koivisto  <antti@apple.com>
2707
2708         ComposedTreeIterator may traverse slotted nodes multiple times
2709         https://bugs.webkit.org/show_bug.cgi?id=154983
2710
2711         Reviewed by Ryosuke Niwa.
2712
2713         Traversal of slotted nodes can escape to real siblings. Those siblings are then traversed again as slotted nodes.
2714
2715         Test: fast/shadow-dom/composed-tree-slots.html
2716
2717         * dom/ComposedTreeIterator.cpp:
2718         (WebCore::ComposedTreeIterator::initializeContextStack):
2719         (WebCore::ComposedTreeIterator::traverseNextInShadowTree):
2720         (WebCore::ComposedTreeIterator::traverseNextLeavingContext):
2721         (WebCore::ComposedTreeIterator::advanceInSlot):
2722         * dom/ComposedTreeIterator.h:
2723         (WebCore::ComposedTreeIterator::Context::Context):
2724
2725             Include end iterator to the context.
2726             For slotted nodes set it up to point to the next sibling of the node.
2727
2728         (WebCore::ComposedTreeIterator::context):
2729         (WebCore::ComposedTreeIterator::traverseNextSkippingChildren):
2730
2731 2016-03-04  Andreas Kling  <akling@apple.com>
2732
2733         Drop DocumentSharedObjectPool immediately when going into PageCache.
2734         <https://webkit.org/b/154986>
2735
2736         Reviewed by Antti Koivisto.
2737
2738         The DocumentSharedObjectPool is a weirdly efficient little optimization
2739         that deduplicates ElementData during the first 10s of a Document's lifetime.
2740         While it's up, every ElementData created will persist so it can be used for
2741         deduplication.
2742
2743         If a Document goes into the PageCache while its shared object pool is still
2744         alive, we can just kill it right away. This will sometimes allow us to free
2745         a bunch of ElementData sooner.
2746
2747         * dom/Document.cpp:
2748         (WebCore::Document::Document):
2749         (WebCore::Document::setInPageCache):
2750         (WebCore::Document::clearSharedObjectPool):
2751         (WebCore::Document::sharedObjectPoolClearTimerFired): Deleted.
2752         * dom/Document.h:
2753
2754 2016-03-04  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2755
2756         Remove PassRefPtr from ThreadableLoader and relatives
2757         https://bugs.webkit.org/show_bug.cgi?id=154966
2758
2759         Reviewed by Darin Adler.
2760
2761         Covered by existing tests.
2762
2763         * loader/DocumentThreadableLoader.cpp:
2764         (WebCore::DocumentThreadableLoader::create):
2765         * loader/DocumentThreadableLoader.h:
2766         * loader/ThreadableLoader.cpp:
2767         (WebCore::ThreadableLoader::create):
2768         * loader/ThreadableLoader.h:
2769         * loader/WorkerThreadableLoader.cpp:
2770         (WebCore::WorkerThreadableLoader::WorkerThreadableLoader):
2771         (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge):
2772         * loader/WorkerThreadableLoader.h:
2773
2774 2016-03-03  Ryosuke Niwa  <rniwa@webkit.org>
2775
2776         Let XCode have its own way and also sort the file.
2777
2778         * WebCore.xcodeproj/project.pbxproj:
2779
2780 2016-03-03  Chris Dumez  <cdumez@apple.com>
2781
2782         Regression(r196770): Unable to use HipChat Mac app
2783         https://bugs.webkit.org/show_bug.cgi?id=154999
2784         <rdar://problem/24931959>
2785
2786         Reviewed by Darin Adler.
2787
2788         r196770 made [Unforgeable] operations such as Location.reload()
2789         non-writable as per the Web IDL specification. As a result,
2790         trying to set such properties will be ignored in non-strict
2791         mode and will throw an exception is strict mode. This also matches
2792         Firefox and Chrome.
2793
2794         However, this broke the HipChat Mac App (the Web App seems fine)
2795         because it sets Location.reload() and is using strict mode, therefore
2796         causing an exception to be thrown.
2797
2798         This patch adds a quirk to JSLocation::putDelegate() which disable
2799         strict mode when we detect that the application is HipChat. As a
2800         result, we no longer throw when HipChat tries to set Location.reload
2801         and the application is able to connect again.
2802
2803         * bindings/js/JSLocationCustom.cpp:
2804         (WebCore::JSLocation::putDelegate):
2805         Add a quirk which disables strict mode if the application is HipChat.
2806
2807         * platform/RuntimeApplicationChecks.cpp:
2808         (WebCore::mainBundleIdentifier):
2809         Extract this from mainBundleIsEqualTo() so it can be shared with
2810         applicationBundleIdentifier().
2811
2812         (WebCore::applicationBundleIdentifier):
2813         Returns the application bundle identifier, which is a static variable.
2814         For the WebContent / Networking processes, the application bundle
2815         identifier gets set to the UIProcess bundle identifier upon
2816         initialization. If unset, we fall back to using mainBundleIdentifier()
2817         which will do the right thing for the WK2 UIProcess and WK1.
2818
2819         (WebCore::mainBundleIsEqualTo):
2820         Extract part of the code to mainBundleIdentifier() to better share
2821         code.
2822
2823         (WebCore::applicationIsHipChat):
2824         Add utility function that checks if the application is HipChat. This
2825         will do the right thing whether it is called from the UIProcess, the
2826         WebProcess or the UIProcess.
2827
2828         (WebCore::setApplicationBundleIdentifier):
2829         Add utility function to set the application bundle identifier. It gets
2830         called with the UIProcess bundle identifier by the NetworkProcess and
2831         the WebProcess upon initialization.
2832
2833         * platform/RuntimeApplicationChecks.h:
2834
2835 2016-03-03  Keith Miller  <keith_miller@apple.com>
2836
2837         JSArrayBuffers should be collected less aggressively
2838         https://bugs.webkit.org/show_bug.cgi?id=154982
2839
2840         Reviewed by Geoffrey Garen.
2841
2842         We are currently too aggressive in our collection of ArrayBuffer wrappers.
2843         There are three cases where we need to avoid collecting ArrayBuffer wrappers.
2844         1. If the wrapper has custom properties.
2845         2. If the wrapper is a subclass of ArrayBuffer.
2846         3. If the wrapper is in a WeakMap/WeakSet.
2847
2848         Currently, we only pass the first case in WebCore and none in the jsc CLI.
2849         This patch removes some optimizations that cause us to collect when we
2850         should not. Namely, always skipping the object unless it has custom
2851         properties. Additionally, in the case of subclassing, we also need a way
2852         for custom JSArrayBuffer objects to register themselves as the wrapper for
2853         an ArrayBuffer class.
2854
2855         Finally, this patch removes an unnecessary ref() and deref() of
2856         ArrayBuffer objects during the creation/destruction of the wrapper.
2857         Since an ArrayBuffer object's GC lifetime will be at least as long
2858         as the lifetime of the wrapper we are creating for it we don't need
2859         to ref() and deref() the ArrayBuffer object. This lifetime is
2860         guaranteed because ArrayBuffer objects are both GCed and refcounted
2861         and any new wrapper will visit the ArrayBuffer object as long as the
2862         wrapper is still alive.
2863
2864         Test: js/arraybuffer-wrappers.html
2865
2866         * bindings/js/JSDOMBinding.h:
2867         (WebCore::toJS):
2868         * bindings/js/WebCoreTypedArrayController.cpp:
2869         (WebCore::WebCoreTypedArrayController::registerWrapper):
2870         (WebCore::WebCoreTypedArrayController::JSArrayBufferOwner::finalize):
2871         (WebCore::WebCoreTypedArrayController::JSArrayBufferOwner::isReachableFromOpaqueRoots): Deleted.
2872         * bindings/js/WebCoreTypedArrayController.h:
2873
2874 2016-03-03  Simon Fraser  <simon.fraser@apple.com>
2875
2876         Use larger tiles when possible to reduce per-tile painting overhead
2877         https://bugs.webkit.org/show_bug.cgi?id=154985
2878         rdar://problem/23635219
2879
2880         Reviewed by Tim Horton.
2881
2882         There's no reason to use lots of 512x512 tiles on a non-scrollable page. We can reduce
2883         per-tile painting overhead by using one big tile. On vertically scrolling pages, we
2884         can also use wide tiles to reduce tile-crossing when painting. Have FrameView tell
2885         the TiledBacking about scrollability, allowing TileController to make tile size decisions.
2886
2887         Change the "giant tile" code path to just return whether Settings says we're in giant
2888         tile mode, so that tile size decisions can be made in TileController.
2889
2890         TileController now stores a single margin size, and a per-edge margin flag rather than a size
2891         per edge. It computes tile size based on scrollability, but adjusts tile size with some 
2892         hysteresis to avoid size thrashing for content that frequently resizes the document (e.g.
2893         some performance tests).
2894
2895         TileGrid stores a copy of the tile size, so that it remains unchanged from one revalidate
2896         to the next, and the grid can detect when the tile size changes, since it needs to throw away
2897         all tiles in that case.
2898
2899         Tests: tiled-drawing/tile-size-both-scrollable.html
2900                tiled-drawing/tile-size-horizontally-scrollable.html
2901                tiled-drawing/tile-size-unscrollable.html
2902                tiled-drawing/tile-size-vertically-scrollable.html
2903
2904         * WebCore.xcodeproj/project.pbxproj:
2905         * page/FrameView.cpp:
2906         (WebCore::FrameView::addedOrRemovedScrollbar):
2907         (WebCore::FrameView::willStartLiveResize): Tell the tile backing when live resize starts and stops.
2908         (WebCore::FrameView::willEndLiveResize):
2909         * platform/graphics/EdgeSet.h: Added. Template class that just stores some value
2910         per edge.
2911         (WebCore::EdgeSet::EdgeSet):
2912         (WebCore::EdgeSet::top):
2913         (WebCore::EdgeSet::setTop):
2914         (WebCore::EdgeSet::right):
2915         (WebCore::EdgeSet::setRight):
2916         (WebCore::EdgeSet::bottom):
2917         (WebCore::EdgeSet::setBottom):
2918         (WebCore::EdgeSet::left):
2919         (WebCore::EdgeSet::setLeft):
2920         (WebCore::EdgeSet::operator==):
2921         (WebCore::EdgeSet::operator!=):
2922         * platform/graphics/GraphicsLayerClient.h: Rather than have the client return the
2923         tile size, have it return whether we're in giant tile mode.
2924         (WebCore::GraphicsLayerClient::useGiantTiles):
2925         (WebCore::GraphicsLayerClient::tileSize): Deleted.
2926         * platform/graphics/TiledBacking.h:
2927         (WebCore::defaultTileSize): Deleted.
2928         * platform/graphics/ca/GraphicsLayerCA.cpp:
2929         (WebCore::GraphicsLayerCA::platformCALayerUseGiantTiles):
2930         (WebCore::GraphicsLayerCA::platformCALayerTileSize): Deleted.
2931         * platform/graphics/ca/GraphicsLayerCA.h:
2932         * platform/graphics/ca/PlatformCALayerClient.h:
2933         (WebCore::PlatformCALayerClient::platformCALayerUseGiantTiles):
2934         (WebCore::PlatformCALayerClient::platformCALayerTileSize): Deleted.
2935         * platform/graphics/ca/TileController.cpp:
2936         (WebCore::TileController::TileController):
2937         (WebCore::TileController::setScrollability):
2938         (WebCore::TileController::willStartLiveResize):
2939         (WebCore::TileController::didEndLiveResize):
2940         (WebCore::TileController::tileSize):
2941         (WebCore::TileController::setHasMargins):
2942         (WebCore::TileController::setMarginSize):
2943         (WebCore::TileController::hasMargins):
2944         (WebCore::TileController::hasHorizontalMargins):
2945         (WebCore::TileController::hasVerticalMargins):
2946         (WebCore::TileController::topMarginHeight):
2947         (WebCore::TileController::bottomMarginHeight):
2948         (WebCore::TileController::leftMarginWidth):
2949         (WebCore::TileController::rightMarginWidth):
2950         (WebCore::TileController::setTileMargins): Deleted.
2951         * platform/graphics/ca/TileController.h:
2952         * platform/graphics/ca/TileGrid.cpp:
2953         (WebCore::TileGrid::TileGrid):
2954         (WebCore::TileGrid::setNeedsDisplayInRect):
2955         (WebCore::TileGrid::rectForTileIndex):
2956         (WebCore::TileGrid::getTileIndexRangeForRect):
2957         (WebCore::TileGrid::removeAllTiles):
2958         (WebCore::TileGrid::revalidateTiles):
2959         * platform/graphics/ca/TileGrid.h:
2960         (WebCore::TileGrid::tileSize):
2961         * rendering/RenderLayerBacking.cpp:
2962         (WebCore::RenderLayerBacking::setTiledBackingHasMargins):
2963         (WebCore::RenderLayerBacking::useGiantTiles):
2964         (WebCore::RenderLayerBacking::tileSize): Deleted.
2965         * rendering/RenderLayerBacking.h:
2966
2967 2016-03-03  Ryosuke Niwa  <rniwa@webkit.org>
2968
2969         Disallow custom elements inside a window-less documents
2970         https://bugs.webkit.org/show_bug.cgi?id=154944
2971         <rdar://problem/24944875>
2972
2973         Reviewed by Antti Koivisto.
2974
2975         Disallow custom elements inside a window-less documents such as the shared inert document of template elements
2976         and the ones created by DOMImplementation.createDocument and DOMImplementation.createHTMLDocument.
2977
2978         Throw NotSupportedError in defineCustomElement when it's called in such a document as discussed in:
2979         https://github.com/w3c/webcomponents/issues/369
2980
2981         Tests: fast/custom-elements/parser/parser-constructs-custom-element-in-document-write.html
2982                fast/custom-elements/parser/parser-uses-registry-of-owner-document.html
2983
2984         * bindings/js/JSDOMBinding.cpp:
2985         (WebCore::throwNotSupportedError): Added.
2986         * bindings/js/JSDOMBinding.h:
2987         * bindings/js/JSDocumentCustom.cpp:
2988         (WebCore::JSDocument::defineCustomElement): Throw NotSupportedError when the context object's document doesn't
2989         have a browsing context (i.e. window-less).
2990         * html/parser/HTMLDocumentParser.cpp:
2991         (WebCore::HTMLDocumentParser::runScriptsForPausedTreeBuilder): Replaced a FIXME with an assertion now that we
2992         disallow instantiation of custom elements inside a template element.
2993
2994 2016-03-03  Alex Christensen  <achristensen@webkit.org>
2995
2996         Move SPI to CFNetworkSPI.h
2997         https://bugs.webkit.org/show_bug.cgi?id=154992
2998
2999         Reviewed by Andy Estes.
3000
3001         * platform/spi/cf/CFNetworkSPI.h:
3002
3003 2016-03-03  Alex Christensen  <achristensen@webkit.org>
3004
3005         Use CredentialStorage with NetworkSession
3006         https://bugs.webkit.org/show_bug.cgi?id=154939
3007
3008         Reviewed by Darin Adler.
3009
3010         This makes the credential-based http tests pass when using NetworkSession.
3011
3012         * platform/network/CredentialBase.h:
3013         (WebCore::CredentialBase::encodingRequiresPlatformData):
3014         * platform/network/CredentialStorage.h:
3015         WEBCORE_EXPORT more things that are newly used in WebKit2.
3016
3017 2016-03-03  Zalan Bujtas  <zalan@apple.com>
3018
3019         Subpixel rendering: Make collapsed borders painting subpixel aware.
3020         https://bugs.webkit.org/show_bug.cgi?id=154980
3021
3022         Reviewed by David Hyatt.
3023
3024         This patch enables collapsed borders with odd pixel width paint on subpixel position.
3025         Currently borders with odd pixels are split at integral position so that border-width: 3px;
3026         paints 1px on the left(top) and 2px on the right(bottom) side. With this patch
3027         we paint 1.5px on both sides(on 2x display).
3028
3029         Test: fast/table/hidpi-collapsed-border-with-odd-pixel-width.html
3030
3031         * rendering/RenderTableCell.cpp:
3032         (WebCore::RenderTableCell::paintCollapsedBorders):
3033
3034 2016-03-03  Dave Hyatt  <hyatt@apple.com>
3035
3036         Add support for the "last" value of hanging-punctuation
3037         https://bugs.webkit.org/show_bug.cgi?id=154977
3038
3039         Reviewed by Darin Adler and Simon Fraser.
3040
3041         New tests in fast/text.
3042
3043         This patch adds support for the new "last" value and also fixes up both
3044         "first" and "last" to work with leading and trailing whitespace that ends
3045         up getting collapsed away.
3046
3047         * rendering/RenderBlockFlow.cpp:
3048         (WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths):
3049         * rendering/RenderBlockLineLayout.cpp:
3050         (WebCore::inlineAncestorHasStartBorderPaddingOrMargin):
3051         (WebCore::inlineAncestorHasEndBorderPaddingOrMargin):
3052         (WebCore::isLastInFlowRun):
3053         (WebCore::RenderBlockFlow::computeInlineDirectionPositionsForSegment):
3054         * rendering/RenderText.cpp:
3055         (WebCore::isHangablePunctuationAtLineEnd):
3056         (WebCore::RenderText::hangablePunctuationStartWidth):
3057         (WebCore::RenderText::hangablePunctuationEndWidth):
3058         (WebCore::RenderText::firstCharacterIndexStrippingSpaces):
3059         (WebCore::RenderText::lastCharacterIndexStrippingSpaces):
3060         (WebCore::RenderText::trimmedPrefWidths):
3061         * rendering/RenderText.h:
3062         * rendering/line/BreakingContext.h:
3063         (WebCore::BreakingContext::handleText):
3064
3065 2016-03-03  Andy Estes  <aestes@apple.com>
3066
3067         Adopt CFNetwork storage partitioning SPI
3068         https://bugs.webkit.org/show_bug.cgi?id=154957
3069         rdar://problem/23614620
3070
3071         Reviewed by Darin Adler.
3072
3073         Adopt CFNetwork SPI for creating storage partitions. If Settings::cookieStoragePartitioningEnabled() is true,
3074         create cookie storage partitions for third-party contexts. This feature is disabled by default.
3075
3076         No new tests. Test support is tracked by <https://webkit.org/b/154958>.
3077
3078         * page/Settings.cpp:
3079         (WebCore::Settings::setCookieStoragePartitioningEnabled): Controls whether storage partitioning for cookies is enabled.
3080         * page/Settings.h:
3081         (WebCore::Settings::cookieStoragePartitioningEnabled):
3082         * platform/network/NetworkStorageSession.h:
3083         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
3084         (WebCore::cookieStoragePartition): Computes a storage partition identifier by determining the top
3085         privately-controlled domain of the cookie's first-party (main frame document) URL, then determining whether the
3086         cookie's document hostname is a subdomain of it. If is is not, the first-party top domain is the partition name.
3087         Otherwise, there is no partition name.
3088         * platform/network/mac/CookieJarMac.mm:
3089         (WebCore::applyPartitionToCookies): Returns a deep copy of the given cookie array after adding a storage
3090         partition property to each copied cookie.
3091         (WebCore::cookiesInPartitionForURL): Returns cookies for the partition computed by the given URLs. If no
3092         partition can be determined, nil is returned.
3093         (WebCore::cookiesForURL): Returns cookiesInPartitionForURL() if non-nil, otherwise returns wkHTTPCookiesForURL().
3094         (WebCore::cookiesForSession): Started calling cookiesForURL().
3095         (WebCore::setCookiesFromDOM): Called applyPartitionToCookies() if a partition can be computed from the given URLs.
3096         (WebCore::getRawCookies): Started calling cookiesForURL().
3097         * platform/network/mac/ResourceHandleMac.mm:
3098         (WebCore::ResourceHandle::createNSURLConnection): Computed the storage partition identifier for the new request.
3099         If non-empty, set it as a property on the NSURLRequest where CFNetwork knows to find it.
3100         * platform/spi/cf/CFNetworkSPI.h: Declare new SPI for building with the public SDK.
3101
3102 2016-03-03  Manuel Rego Casasnovas  <rego@igalia.com>
3103
3104         [css-grid] Fix order of grid shorthands in CSSPropertyNames.in
3105         https://bugs.webkit.org/show_bug.cgi?id=154915
3106
3107         Reviewed by Darin Adler.
3108
3109         The order of columns and rows in grid and grid-template shorthands
3110         has been swapped recently (r196906 & r196934).
3111         However the order was not updated in CSSPropertyNames.in file.
3112
3113         * css/CSSPropertyNames.in:
3114
3115 2016-03-03  Alexey Proskuryakov  <ap@apple.com>
3116
3117         AllInOne build fix.
3118
3119         * rendering/RenderFlexibleBox.cpp:
3120         * rendering/RenderGrid.cpp:
3121         Don't have two static functions with the same name.
3122
3123 2016-03-03  Chris Dumez  <cdumez@apple.com>
3124
3125         Drop [TreatNullAs=EmptyString] from URL interface attributes
3126         https://bugs.webkit.org/show_bug.cgi?id=154951
3127
3128         Reviewed by Darin Adler.
3129
3130         Drop [TreatNullAs=EmptyString] from URL interface attributes to match
3131         the specification:
3132         - https://url.spec.whatwg.org/#api
3133
3134         Firefox and Chrome both already follow the specification and convert
3135         null to the "null" string.
3136
3137         No new tests, already covered by existing tests.
3138
3139         * html/URLUtils.idl:
3140
3141 2016-03-03  Miguel Gomez  <magomez@igalia.com>
3142
3143         [TextureMapper] Use RGBA format for textures attached to framebuffers
3144         https://bugs.webkit.org/show_bug.cgi?id=154965
3145
3146         Reviewed by Žan Doberšek.
3147
3148         Use RGBA format when allocating textures that will be used as framebuffer
3149         attachments. This means adding a new flag to BitmapTexture and modifying
3150         BitmapTextureGL to use the appropriate format according to the flag. Also,
3151         BitmapTexturePool needs to use two vectors to handle both types of textures
3152         separately, as we want to avoid constantly switching the format of a reused
3153         texture.
3154
3155         No new tests since the behavior change is covered by existing tests.
3156
3157         * platform/graphics/texmap/BitmapTexture.h: Add new flag.
3158         * platform/graphics/texmap/BitmapTextureGL.cpp:
3159         (WebCore::BitmapTextureGL::BitmapTextureGL): Receive flags on constructor and use RGBA
3160         when the FBOAttachment flag is enabled.
3161         (WebCore::BitmapTextureGL::applyFilters): Use FBOAttachemt flag to request a texture.
3162         * platform/graphics/texmap/BitmapTextureGL.h: Add flags to the constructor.
3163         * platform/graphics/texmap/BitmapTexturePool.cpp: Add a new vector of textures to hold
3164         those in RGBA format.
3165         (WebCore::BitmapTexturePool::acquireTexture): Return a texture for the usage specified
3166         in the incoming flags.
3167         (WebCore::BitmapTexturePool::releaseUnusedTexturesTimerFired): Release textures from
3168         both vectors.
3169         (WebCore::BitmapTexturePool::createTexture): Pass the usage flag when creating a new
3170         texture.
3171         * platform/graphics/texmap/BitmapTexturePool.h: Add new texture vector and add flags to
3172         the needed headers.
3173         * platform/graphics/texmap/TextureMapper.cpp:
3174         (WebCore::TextureMapper::acquireTextureFromPool): Pass the received flags to the BitmapTexturePool.
3175         * platform/graphics/texmap/TextureMapperLayer.cpp:
3176         (WebCore::TextureMapperLayer::paintIntoSurface): Use FBOAttachemt flag to request a texture.
3177
3178 2016-03-03  Javier Fernandez  <jfernandez@igalia.com>
3179
3180         [CSS Box Alignment] New CSS Value 'normal' for Content Alignment
3181         https://bugs.webkit.org/show_bug.cgi?id=154282
3182
3183         Reviewed by David Hyatt.
3184
3185         The Box Alignment specification defines a new value 'normal' to be used
3186         as default for the different layout models, which will define the
3187         specific behavior for each case. This patch adds a new CSS value in the
3188         parsing logic and adapts the Content Alignment properties to the new
3189         value.
3190
3191         The 'auto' value is no longer valid and the Computed Value will be
3192         always the specified value. Hence, I removed the StyleResolver logic
3193         because is not required now; the specific behavior of the 'normal'
3194         value will be resolved at layout time.
3195
3196         Computed value of both align-content and justify-content is the
3197         specified value, we don't have to resolve any 'auto' value now.
3198
3199         Additionally, this patch updates the layout logic as well, for both
3200         Flexbox and Grid layout models.
3201
3202         No new tests, since we only need to rebaseline those test cases
3203         affected by the new default computed value.
3204
3205         * css/CSSComputedStyleDeclaration.cpp:
3206         (WebCore::valueForContentPositionAndDistributionWithOverflowAlignment):
3207         (WebCore::ComputedStyleExtractor::propertyValue):
3208         (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): Deleted.
3209         (WebCore::CSSComputedStyleDeclaration::copyProperties): Deleted.
3210         (WebCore::nodeOrItsAncestorNeedsStyleRecalc): Deleted.
3211         (WebCore::isFlexOrGrid): Deleted.
3212         (WebCore::ComputedStyleExtractor::customPropertyValue): Deleted.
3213         * css/CSSParser.cpp:
3214         (WebCore::CSSParser::parseContentDistributionOverflowPosition):
3215         * css/CSSPrimitiveValueMappings.h:
3216         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
3217         (WebCore::CSSPrimitiveValue::operator ContentPosition):
3218         * rendering/RenderFlexibleBox.cpp:
3219         (WebCore::normalValueBehavior):
3220         (WebCore::RenderFlexibleBox::layoutAndPlaceChildren):
3221         (WebCore::RenderFlexibleBox::layoutColumnReverse):
3222         (WebCore::RenderFlexibleBox::alignFlexLines):
3223         (WebCore::alignContentSpaceBetweenChildren): Deleted.
3224         * rendering/RenderGrid.cpp:
3225         (WebCore::normalValueBehavior):
3226         (WebCore::RenderGrid::applyStretchAlignmentToTracksIfNeeded):
3227         (WebCore::RenderGrid::columnAxisOffsetForChild):
3228         (WebCore::RenderGrid::rowAxisOffsetForChild):
3229         (WebCore::resolveContentDistributionFallback):
3230         (WebCore::contentDistributionOffset):
3231         (WebCore::RenderGrid::computeContentPositionAndDistributionOffset):
3232         * rendering/style/RenderStyle.cpp:
3233         (WebCore::resolvedContentAlignmentPosition):
3234         (WebCore::resolvedContentAlignmentDistribution):
3235         (WebCore::RenderStyle::resolvedJustifyContentPosition):
3236         (WebCore::RenderStyle::resolvedJustifyContentDistribution):
3237         (WebCore::RenderStyle::resolvedAlignContentPosition):
3238         (WebCore::RenderStyle::resolvedAlignContentDistribution):
3239         * rendering/style/RenderStyle.h:
3240         * rendering/style/RenderStyleConstants.h:
3241
3242 2016-03-03  Antti Koivisto  <antti@apple.com>
3243
3244         Slider thumb style should not depend on renderers
3245         https://bugs.webkit.org/show_bug.cgi?id=154961
3246
3247         Reviewed by Andreas Kling.
3248
3249         Currently slider thumb pseudo id is computed based on host element renderer.
3250         Style is the input for building a render tree and should be computable without having one.
3251
3252         * html/shadow/SliderThumbElement.cpp:
3253         (WebCore::SliderThumbElement::hostInput):
3254         (WebCore::SliderThumbElement::customStyleForRenderer):
3255
3256             Compute pseudo id based on the host style.
3257             Return nullptr so style recalc will otherwise proceed normally.
3258
3259         (WebCore::SliderThumbElement::shadowPseudoId):
3260         (WebCore::SliderThumbElement::cloneElementWithoutAttributesAndChildren):
3261         (WebCore::SliderContainerElement::SliderContainerElement):
3262         (WebCore::SliderContainerElement::create):
3263         (WebCore::SliderContainerElement::createElementRenderer):
3264         (WebCore::SliderContainerElement::customStyleForRenderer):
3265
3266             Here too.
3267
3268         (WebCore::SliderContainerElement::shadowPseudoId):
3269         (WebCore::sliderThumbShadowPseudoId): Deleted.
3270         (WebCore::mediaSliderThumbShadowPseudoId): Deleted.
3271         * html/shadow/SliderThumbElement.h:
3272
3273 2016-03-03  Manuel Rego Casasnovas  <rego@igalia.com>
3274
3275         [css-grid] Simplify method to resolve auto-placed items
3276         https://bugs.webkit.org/show_bug.cgi?id=154911
3277
3278         Reviewed by Sergio Villar Senin.
3279
3280         Refactor the method to resolve auto-placed items
3281         as we're only interested in knowing the span size.
3282
3283         Adapt the calls to use the span size instead of a GridSpan.
3284
3285         No new tests, no change of behavior.
3286
3287         * rendering/RenderGrid.cpp:
3288         (WebCore::RenderGrid::populateExplicitGridAndOrderIterator):
3289         (WebCore::RenderGrid::createEmptyGridAreaAtSpecifiedPositionsOutsideGrid):
3290         (WebCore::RenderGrid::placeSpecifiedMajorAxisItemsOnGrid):
3291         (WebCore::RenderGrid::placeAutoMajorAxisItemOnGrid):
3292         * rendering/style/GridResolvedPosition.cpp:
3293         (WebCore::GridResolvedPosition::spanSizeForAutoPlacedItem):
3294         (WebCore::GridResolvedPosition::resolveGridPositionsFromAutoPlacementPosition):
3295         Renamed to spanSizeForAutoPlacedItem().
3296         * rendering/style/GridResolvedPosition.h:
3297
3298 2016-03-02  Chris Dumez  <cdumez@apple.com>
3299
3300         HTMLFormElement's named property getter does not return a RadioNodelist
3301         https://bugs.webkit.org/show_bug.cgi?id=154949
3302
3303         Reviewed by Ryosuke Niwa.
3304
3305         HTMLFormElement's named property getter should return a RadioNodeList
3306         when there are several matches:
3307         https://html.spec.whatwg.org/multipage/forms.html#the-form-element
3308
3309         Previously, WebKit returned a generic NodeList. As a result, users
3310         cannot create a white-and-gold hat in the MAKE A HAT GREAT AGAIN
3311         section at:
3312         https://www.washingtonpost.com/news/the-fix/wp/2015/10/06/hey-lets-all-make-our-own-donald-trump-hats/
3313
3314         Chrome and Firefox already match the specification. Edge will soon.
3315
3316         Test: fast/dom/HTMLFormElement/named-property-getter-radionodelist.html
3317
3318         * bindings/js/JSHTMLFormElementCustom.cpp:
3319         (WebCore::JSHTMLFormElement::nameGetter):
3320
3321 2016-03-02  Chris Dumez  <cdumez@apple.com>
3322
3323         Drop [TreatNullAs=LegacyNullString] from HTMLBaseElement.href
3324         https://bugs.webkit.org/show_bug.cgi?id=154952
3325
3326         Reviewed by Ryosuke Niwa.
3327
3328         Drop [TreatNullAs=LegacyNullString] from HTMLBaseElement.href as this
3329         does not match the specification:
3330         - https://html.spec.whatwg.org/multipage/semantics.html#the-base-element
3331
3332         Firefox and Chrome both convert null to the string "null".
3333
3334         No new tests, updated the following existing test:
3335         fast/dom/HTMLBaseElement/href-attribute-resolves-with-respect-to-document.html
3336
3337         * html/HTMLBaseElement.idl:
3338
3339 2016-03-02  Zalan Bujtas  <zalan@apple.com>
3340
3341         Paint table borders on empty cells even in quirks mode.
3342         https://bugs.webkit.org/show_bug.cgi?id=154928
3343
3344         Reviewed by David Hyatt.
3345
3346         Enable border painting for empty cells unless 'empty-cells: hide' is set. 
3347         This is inline with FF and Chrome behaviour.
3348
3349         Test: fast/table/border-on-empty-table-cells-quirks-mode.html
3350
3351         * rendering/RenderTableCell.cpp:
3352         (WebCore::RenderTableCell::paintBoxDecorations):
3353
3354 2016-03-02  Ryosuke Niwa  <rniwa@webkit.org>
3355
3356         HTML parser instantiates a custom element inside a template element with a wrong owner document
3357         https://bugs.webkit.org/show_bug.cgi?id=154936
3358
3359         Reviewed by Chris Dumez.
3360
3361         The bug was caused by our implementation following the old spec which didn't create a appropriate template
3362         contents owner document [1] for a document without a browsing context. The new spec no longer has this clause,
3363         and we should be always creating the appropriate template contents owner document unless the document itself
3364         is an appropriate template contents owner document for another document (comes up in nested template elements).
3365
3366         No new tests since the behavior change is covered by existing tests.
3367
3368         [1] https://html.spec.whatwg.org/#appropriate-template-contents-owner-document
3369
3370         * dom/Document.h:
3371         (WebCore::Document::templateDocument):
3372
3373 2016-03-02  Gavin Barraclough  <barraclough@apple.com>
3374
3375         PageThrottler should apply hysteresis to media activity
3376         https://bugs.webkit.org/show_bug.cgi?id=154940
3377
3378         Reviewed by Ryosuke Niwa.
3379
3380         Currently PageThrottler keeps a track of audible plugin activity and HTML media element
3381         activity separately. Audible plugin activity also gets an extra 5s hysteresis applied,
3382         so that after audio playback has completed there is a chance to queue up more audio
3383         before timer throttling kicks in. HTML audio does not get this grace. Funnel both
3384         together into a single activity flag, such that the hysteresis is applied to both.
3385
3386         * page/PageThrottler.cpp:
3387         (WebCore::PageThrottler::PageThrottler):
3388         (WebCore::m_mediaActivityHysteresis):
3389             - PageActivityState::AudiblePlugin -> PageActivityState::MediaActivity.
3390         (WebCore::m_mediaActivityCounter):
3391             - when m_mediaActivityCounter value changes call mediaActivityCounterChanged().
3392         (WebCore::PageThrottler::mediaActivityCounterChanged):
3393             - Drive PageActivityState::MediaActivity indirectly via m_mediaActivityHysteresis,
3394               such that a 5s hysteresis is applied.
3395         * page/PageThrottler.h:
3396             - Removed AudiblePlugin (merged in with MediaActivity).
3397         (WebCore::PageThrottler::pluginDidEvaluateWhileAudioIsPlaying):
3398             - m_audiblePluginHysteresis.impulse -> m_mediaActivityHysteresis.impulse.
3399
3400 2016-03-01  Ada Chan  <adachan@apple.com>
3401
3402         Update the media element's presentation mode properly after going in and out of full screen via the Full Screen API
3403         https://bugs.webkit.org/show_bug.cgi?id=154834
3404
3405         Reviewed by Simon Fraser.
3406
3407         * dom/Document.cpp:
3408         (WebCore::Document::webkitWillEnterFullScreenForElement):