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