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