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