Unreviewed, fix GTK/EFL build after r197575 and add mandatory GnuTLS dependency
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2016-03-05  Michael Catanzaro  <mcatanzaro@igalia.com>
2
3         Unreviewed, fix GTK/EFL build after r197575 and add mandatory GnuTLS dependency
4
5         * PlatformEfl.cmake:
6         * PlatformGTK.cmake:
7
8 2016-03-05  Simon Fraser  <simon.fraser@apple.com>
9
10         Add support for the object-position CSS property
11         https://bugs.webkit.org/show_bug.cgi?id=122811
12         rdar://problem/15836338
13
14         Reviewed by Sam Weinig.
15
16         Take object-position into account when rendering replaced elements.
17         RenderReplaced::replacedContentRect() is the one place where we compute
18         the content rect for replaced elements.
19
20         Also return false from foregroundIsKnownToBeOpaqueInRect() if we have
21         any non-default object-position, as the foreground may no longer fill the box.
22
23         Tests: compositing/video/video-object-position.html
24                fast/css/object-position/object-position-canvas.html
25                fast/css/object-position/object-position-embed.html
26                fast/css/object-position/object-position-img-svg.html
27                fast/css/object-position/object-position-img.html
28                fast/css/object-position/object-position-input-image.html
29                fast/css/object-position/object-position-object.html
30                fast/css/object-position/object-position-video-poster.html
31
32         * rendering/RenderImage.cpp:
33         (WebCore::RenderImage::foregroundIsKnownToBeOpaqueInRect):
34         * rendering/RenderReplaced.cpp:
35         (WebCore::RenderReplaced::replacedContentRect):
36
37 2016-03-05  Simon Fraser  <simon.fraser@apple.com>
38
39         Add parsing support for object-position
40         https://bugs.webkit.org/show_bug.cgi?id=155065
41
42         Reviewed by Sam Weinig.
43         
44         Add parsing support for object-position. This is the first property with
45         CSS <position> values which does not have equivalent -x and -y shorthands,
46         so we can store it as a new LengthPoint type.
47         
48         Per the CSS Values spec, bottom- and right-relative values are translated
49         into calc() expressions, which are exposed via computed style. For example,
50         "right 10px bottom" becomes "calc(100% - 10px) 100%". This also allows transitions
51         between, say, "left 10px bottom" and "right 10px bottom".
52
53         Test: fast/css/object-position/parsing-object-position.html
54
55         * CMakeLists.txt:
56         * WebCore.xcodeproj/project.pbxproj:
57         * css/CSSComputedStyleDeclaration.cpp:
58         (WebCore::ComputedStyleExtractor::propertyValue):
59         * css/CSSParser.cpp:
60         (WebCore::CSSParser::parseValue):
61         * css/CSSPrimitiveValue.h:
62         (WebCore::CSSPrimitiveValue::isPair):
63         * css/CSSPropertyNames.in:
64         * css/CSSValue.h:
65         * css/StyleBuilderConverter.h:
66         (WebCore::StyleBuilderConverter::convertLength):
67         (WebCore::StyleBuilderConverter::convertTo100PercentMinusLength):
68         (WebCore::StyleBuilderConverter::convertPositionComponent):
69         (WebCore::StyleBuilderConverter::convertObjectPosition):
70         * platform/LengthPoint.cpp: Added.
71         (WebCore::operator<<):
72         * platform/LengthPoint.h: Added.
73         (WebCore::LengthPoint::LengthPoint):
74         (WebCore::LengthPoint::operator==):
75         (WebCore::LengthPoint::setX):
76         (WebCore::LengthPoint::x):
77         (WebCore::LengthPoint::setY):
78         (WebCore::LengthPoint::y):
79         (WebCore::LengthPoint::blend):
80         * rendering/style/RenderStyle.cpp:
81         (WebCore::RenderStyle::changeRequiresRepaint):
82         * rendering/style/RenderStyle.h:
83         * rendering/style/StyleRareNonInheritedData.cpp:
84         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
85         (WebCore::StyleRareNonInheritedData::operator==):
86         * rendering/style/StyleRareNonInheritedData.h:
87
88 2016-03-05  Joanmarie Diggs  <jdiggs@igalia.com>
89
90         AX: Implement missing/different accessibility API mappings for SVG
91         https://bugs.webkit.org/show_bug.cgi?id=155034
92
93         Reviewed by Chris Fleizach.
94
95         Create an AccessibilitySVGElement class for the SVG-specific mappings;
96         fix name and description mappings for ATK; add new AccessibilityRole
97         types (SVGTextRole, SVGTSpanRole, SVGTextPathRole) and map them for
98         ATK and AX API.
99
100         Tests: accessibility/w3c-svg-description-calculation.html
101                accessibility/w3c-svg-elements-not-exposed.html
102                accessibility/w3c-svg-name-calculation.html
103                accessibility/w3c-svg-presentational-role.html
104                accessibility/w3c-svg-roles.html
105
106         * CMakeLists.txt:
107         * WebCore.xcodeproj/project.pbxproj:
108         * accessibility/AXObjectCache.cpp:
109         (WebCore::createFromRenderer):
110         * accessibility/AccessibilityAllInOne.cpp:
111         * accessibility/AccessibilityNodeObject.cpp:
112         (WebCore::AccessibilityNodeObject::alternativeText): Deleted.
113         (WebCore::AccessibilityNodeObject::accessibilityDescription): Deleted.
114         * accessibility/AccessibilityObject.h:
115         (WebCore::AccessibilityObject::isAccessibilitySVGElement):
116         * accessibility/AccessibilityRenderObject.cpp:
117         (WebCore::AccessibilityRenderObject::determineAccessibilityRole): Deleted.
118         * accessibility/AccessibilitySVGElement.cpp: Added.
119         (WebCore::AccessibilitySVGElement::AccessibilitySVGElement):
120         (WebCore::AccessibilitySVGElement::~AccessibilitySVGElement):
121         (WebCore::AccessibilitySVGElement::create):
122         (WebCore::AccessibilitySVGElement::targetForUseElement):
123         (WebCore::AccessibilitySVGElement::accessibilityText):
124         (WebCore::AccessibilitySVGElement::accessibilityDescription):
125         (WebCore::AccessibilitySVGElement::helpText):
126         (WebCore::AccessibilitySVGElement::computeAccessibilityIsIgnored):
127         (WebCore::AccessibilitySVGElement::inheritsPresentationalRole):
128         (WebCore::AccessibilitySVGElement::determineAriaRoleAttribute):
129         (WebCore::AccessibilitySVGElement::determineAccessibilityRole):
130         * accessibility/AccessibilitySVGElement.h: Added.
131         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
132         (webkitAccessibleGetName):
133         (webkitAccessibleGetDescription):
134         (atkRole):
135         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
136         (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
137         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
138         (createAccessibilityRoleMap):
139         * rendering/RenderObject.h:
140         (WebCore::RenderObject::isSVGTSpan):
141         * rendering/svg/RenderSVGTSpan.h:
142
143 2016-03-05  Yusuke Suzuki  <utatane.tea@gmail.com>
144
145         [ES6] Support Reflect.construct
146         https://bugs.webkit.org/show_bug.cgi?id=147330
147
148         Reviewed by Saam Barati.
149
150         * Modules/plugins/QuickTimePluginReplacement.mm:
151         (WebCore::QuickTimePluginReplacement::installReplacement):
152         * bindings/js/CallbackFunction.cpp:
153         (WebCore::checkFunctionOnlyCallback):
154         * bindings/js/JSCallbackData.cpp:
155         (WebCore::JSCallbackData::invokeCallback):
156         * bindings/js/JSCustomElementInterface.cpp:
157         (WebCore::JSCustomElementInterface::constructElement):
158         (WebCore::JSCustomElementInterface::attributeChanged):
159         * bindings/js/JSCustomXPathNSResolver.cpp:
160         (WebCore::JSCustomXPathNSResolver::lookupNamespaceURI):
161         * bindings/js/JSDOMBinding.cpp:
162         (WebCore::callFunctionWithCurrentArguments):
163         (WebCore::DOMConstructorObject::getCallData):
164         * bindings/js/JSDOMConstructor.h:
165         (WebCore::JSDOMConstructorNotConstructable::getCallData):
166         (WebCore::JSDOMConstructor<JSClass>::getConstructData):
167         (WebCore::JSDOMNamedConstructor<JSClass>::getConstructData):
168         (WebCore::JSBuiltinConstructor<JSClass>::getConstructData):
169         * bindings/js/JSDOMPromise.cpp:
170         (WebCore::DeferredWrapper::callFunction):
171         * bindings/js/JSDocumentCustom.cpp:
172         (WebCore::JSDocument::defineElement):
173         * bindings/js/JSErrorHandler.cpp:
174         (WebCore::JSErrorHandler::handleEvent):
175         * bindings/js/JSEventListener.cpp:
176         (WebCore::JSEventListener::handleEvent):
177         * bindings/js/JSHTMLAllCollectionCustom.cpp:
178         (WebCore::JSHTMLAllCollection::getCallData):
179         * bindings/js/JSHTMLDocumentCustom.cpp:
180         (WebCore::JSHTMLDocument::open):
181         * bindings/js/JSKeyValueIterator.h:
182         (WebCore::keyValueIteratorForEach):
183         * bindings/js/JSMainThreadExecStateInstrumentation.h:
184         (WebCore::JSMainThreadExecState::instrumentFunctionCall):
185         (WebCore::JSMainThreadExecState::instrumentFunctionConstruct):
186         * bindings/js/JSMutationCallback.cpp:
187         (WebCore::JSMutationCallback::call):
188         * bindings/js/JSMutationObserverCustom.cpp:
189         (WebCore::constructJSMutationObserver):
190         * bindings/js/JSPluginElementFunctions.cpp:
191         (WebCore::callPlugin):
192         (WebCore::pluginElementGetCallData):
193         * bindings/js/ScheduledAction.cpp:
194         (WebCore::ScheduledAction::create):
195         (WebCore::ScheduledAction::executeFunctionInContext):
196         * bindings/objc/WebScriptObject.mm:
197         (-[WebScriptObject callWebScriptMethod:withArguments:]):
198         * bindings/scripts/CodeGeneratorJS.pm:
199         (GenerateConstructorHelperMethods):
200         * bindings/scripts/test/JS/JSFloat64Array.cpp:
201         (WebCore::JSFloat64ArrayConstructor::getConstructData):
202         * bindings/scripts/test/JS/JSTestInterface.cpp:
203         (WebCore::JSTestInterfaceConstructor::getConstructData):
204         * bridge/NP_jsobject.cpp:
205         (_NPN_InvokeDefault):
206         (_NPN_Invoke):
207         (_NPN_Construct):
208         * bridge/objc/objc_runtime.mm:
209         (JSC::Bindings::ObjcFallbackObjectImp::getCallData):
210         * bridge/runtime_method.cpp:
211         (JSC::RuntimeMethod::getCallData):
212         * bridge/runtime_object.cpp:
213         (JSC::Bindings::RuntimeObject::getCallData):
214         (JSC::Bindings::RuntimeObject::getConstructData):
215         * html/HTMLMediaElement.cpp:
216         (WebCore::HTMLMediaElement::updateCaptionContainer):
217         (WebCore::HTMLMediaElement::didAddUserAgentShadowRoot):
218         (WebCore::HTMLMediaElement::getCurrentMediaControlsStatus):
219         * html/HTMLPlugInImageElement.cpp:
220         (WebCore::HTMLPlugInImageElement::didAddUserAgentShadowRoot):
221         * testing/Internals.cpp:
222         (WebCore::Internals::isReadableStreamDisturbed):
223
224 2016-03-05  Ryosuke Niwa  <rniwa@webkit.org>
225
226         Fix the bindings test after r197611.
227
228         * bindings/scripts/test/TestObj.idl:
229
230 2016-03-05  Ryosuke Niwa  <rniwa@webkit.org>
231
232         Move QualifiedName from CustomElementInfo to JSCustomElementInterface
233         https://bugs.webkit.org/show_bug.cgi?id=155061
234
235         Reviewed by Antti Koivisto.
236
237         Store QualifiedName of custom elements in JSCustomElementInterface instead of CustomElementInfo
238         now that each interface is associated with exactly one custom element as of r197602.
239
240         No new tests since this is a refactoring.
241
242         * bindings/js/JSCustomElementInterface.cpp:
243         (WebCore::JSCustomElementInterface::JSCustomElementInterface): Now takes QualifiedName as the
244         first argument.
245         * bindings/js/JSCustomElementInterface.h:
246         (WebCore::JSCustomElementInterface::create):
247         (WebCore::JSCustomElementInterface::name): Added.
248         * bindings/js/JSDocumentCustom.cpp:
249         (WebCore::JSDocument::defineElement):
250         * bindings/js/JSHTMLElementCustom.cpp:
251         (WebCore::constructJSHTMLElement): Use findInterface instead of the deleted findName.
252         * dom/CustomElementDefinitions.cpp:
253         (WebCore::CustomElementDefinitions::checkName):
254         (WebCore::CustomElementDefinitions::addElementDefinition): Renamed from defineElement.
255         (WebCore::CustomElementDefinitions::findInterface): Add a variant that finds the interface object
256         by a JS constructor.
257         (WebCore::CustomElementDefinitions::containsConstructor):
258         (WebCore::CustomElementDefinitions::findName): Deleted.
259         * dom/CustomElementDefinitions.h:
260         (WebCore::CustomElementDefinitions::CustomElementInfo::CustomElementInfo): Deleted.
261
262 2016-03-04  Ryosuke Niwa  <rniwa@webkit.org>
263
264         Add basic support for attributeChanged lifecycle callback
265         https://bugs.webkit.org/show_bug.cgi?id=155011
266
267         Reviewed by Antti Koivisto.
268
269         Add basic support for attributeChangedCallback in setAttribute, removeAttribute, setAttributeNS,
270         remoteAttributeNS, setAttributeNode, and removeAttributeNS. There are many other DOM APIs that
271         could modify attributes but we would annotate those APIs in a separate patch to limit the scope
272         of this change.
273
274         In order to invoke the lifecycle callback right before returning to the author script, allocate
275         an instance of CustomElementLifecycleProcessingStack in each of these functions' binding code.
276         The stack object's destructor invokes all callbacks enqueued by the DOM API if there are any.
277
278         Spec: https://w3c.github.io/webcomponents/spec/custom/#dfn-attribute-changed-callback
279
280         Tests: fast/custom-elements/attribute-changed-callback.html
281                fast/custom-elements/lifecycle-callback-timing.html
282
283         * CMakeLists.txt:
284         * WebCore.xcodeproj/project.pbxproj:
285         * bindings/js/JSCustomElementInterface.cpp:
286         (WebCore::JSCustomElementInterface::attributeChanged): Added. Invokes attributeChangedCallback.
287         * bindings/js/JSCustomElementInterface.h:
288         * bindings/js/JSMainThreadExecState.h:
289         (JSMainThreadNullState): Allocate an instance of CustomElementLifecycleProcessingStack in GObject
290         and Objective-C binding code for consistency with JavaScript. We can't do this in JavaScript
291         because there is no RAII object all functions, getters, and setters allocate (for a good reason).
292
293         * bindings/scripts/CodeGeneratorJS.pm:
294         (GenerateImplementation): Generate an instance of CustomElementLifecycleProcessingStack when
295         NeedsLifecycleProcessingStack is specified as an extended IDL attribute.
296         * bindings/scripts/IDLAttributes.txt: Added NeedsLifecycleProcessingStack.
297         * bindings/scripts/test/JS/JSTestObj.cpp:
298         (WebCore::jsTestObjPrototypeFunctionMethodWithNeedsLifecycleProcessingStack):
299         * bindings/scripts/test/TestObj.idl: Added a test for NeedsLifecycleProcessingStack.
300
301         * dom/DOMAllInOne.cpp:
302         * dom/Element.cpp:
303         (WebCore::Element::attributeChanged): Enqueue attributeChanged callback if the context object
304         is a custom element and there is a CustomElementLifecycleProcessingStack allocated in the stack.
305         * dom/Element.idl:
306
307         * dom/LifecycleCallbackQueue.cpp: Added.
308         (WebCore::LifecycleQueueItem): Added.
309         (WebCore::LifecycleQueueItem::LifecycleQueueItem): Added.
310         (WebCore::LifecycleQueueItem::invoke): Added.
311         (WebCore::LifecycleCallbackQueue::LifecycleCallbackQueue): Added.
312         (WebCore::LifecycleCallbackQueue::~LifecycleCallbackQueue): Added.
313         (WebCore::LifecycleCallbackQueue::enqueueAttributeChangedCallback): Added.
314         (WebCore::LifecycleCallbackQueue::invokeAll): Added.
315         (WebCore::CustomElementLifecycleProcessingStack::ensureCurrentQueue): Added. As noted in FIXME,
316         the early exit in the code is necessary only because we haven't added NeedsLifecycleProcessingStack
317         in all places. It should go away in a follow up patch.
318         (WebCore::CustomElementLifecycleProcessingStack::processQueue): Added.
319         * dom/LifecycleCallbackQueue.h: Added.
320         (WebCore::CustomElementLifecycleProcessingStack): This is a light weight RAII object the binding
321         code will allocate in order to queue up lifecycle callbacks. We don't use Ref or std::unique_ptr
322         in m_queue to avoid generating the code to destruct LifecycleCallbackQueue everywhere.
323         (WebCore::CustomElementLifecycleProcessingStack::CustomElementLifecycleProcessingStack): Added.
324         (WebCore::CustomElementLifecycleProcessingStack::~CustomElementLifecycleProcessingStack): Added.
325         (WebCore::CustomElementLifecycleProcessingStack::hasCurrentProcessingStack): Added.
326
327 2016-03-04  Carlos Garcia Campos  <cgarcia@igalia.com>
328
329         [GTK] Scrollbars are broken again with GTK+ >= 3.19.11
330         https://bugs.webkit.org/show_bug.cgi?id=154890
331
332         Reviewed by Michael Catanzaro.
333
334         Scrollbar style properties have been deprecated in GTK+, and it
335         seems that now deprecating means keeping the properties but
336         ignoring them. So, this reworks the whole scrollbars theme code
337         again to not cache style properties anymore, but retrieve them
338         from the GtkStyleContext. Previous GTK+ versions still need to
339         query the style properties, so I've added helper functions to get
340         all the style properties with the ifdefs, trying to keep the
341         common render code free of GTK+ versions ifdefs.
342
343         * platform/gtk/ScrollbarThemeGtk.cpp:
344         (WebCore::ScrollbarThemeGtk::backButtonRect):
345         (WebCore::ScrollbarThemeGtk::forwardButtonRect):
346         (WebCore::ScrollbarThemeGtk::trackRect):
347         (WebCore::ScrollbarThemeGtk::thumbRect):
348         (WebCore::ScrollbarThemeGtk::paintTrackBackground):
349         (WebCore::ScrollbarThemeGtk::paintThumb):
350         (WebCore::ScrollbarThemeGtk::paint):
351         (WebCore::ScrollbarThemeGtk::scrollbarThickness):
352         (WebCore::ScrollbarThemeGtk::buttonSize):
353         (WebCore::ScrollbarThemeGtk::stepperSize):
354         (WebCore::ScrollbarThemeGtk::getStepperSpacing):
355         (WebCore::ScrollbarThemeGtk::troughUnderSteppers):
356         (WebCore::ScrollbarThemeGtk::minimumThumbLength):
357         (WebCore::ScrollbarThemeGtk::thumbFatness):
358         (WebCore::ScrollbarThemeGtk::getTroughBorder):
359         (WebCore::ScrollbarThemeGtk::getOrCreateStyleContext):
360         (WebCore::ScrollbarThemeGtk::updateThemeProperties):
361         (WebCore::ScrollbarThemeGtk::handleMousePressEvent):
362         * platform/gtk/ScrollbarThemeGtk.h:
363
364 2016-03-04  Brent Fulgham  <bfulgham@apple.com>
365
366         Resource load statistics are not honoring private browsing
367         https://bugs.webkit.org/show_bug.cgi?id=155054
368         <rdar://problem/24987873>
369
370         Reviewed by Andy Estes.
371
372         Modify the points where we capture resource load statistics to ignore
373         loads made during private browsing. Do this by moving more of the logic
374         about whether to gather statistics into the logging functions, passing
375         the raw input types (frame, ResourceRequest, ResourceResponse) internally
376         so that we don't pay any cost until we decide we want to gather data.s
377
378         * loader/DocumentLoader.cpp:
379         (WebCore::DocumentLoader::willSendRequest): Revise for the new API on
380         ResourceLoadObserver.
381         * loader/ResourceLoadObserver.cpp:
382         (WebCore::ResourceLoadObserver::logFrameNavigation): Revise signature and
383         check for private browsing.
384         (WebCore::ResourceLoadObserver::logSubresourceLoading): Ditto.
385         (WebCore::ResourceLoadObserver::logUserInteraction): Ditto.
386         * loader/ResourceLoadObserver.h:
387         * loader/SubresourceLoader.cpp:
388         (WebCore::SubresourceLoader::willSendRequestInternal): Ditto.
389
390 2016-03-04  Alex Christensen  <achristensen@webkit.org>
391
392         Fix file mime-types when using NetworkSession
393         https://bugs.webkit.org/show_bug.cgi?id=155058
394
395         Reviewed by Andy Estes.
396
397         This fixes platform/mac/fast/loader/file-url-mimetypes-3.html
398         and platform/mac/fast/loader/file-url-mimetypes.html.
399
400         * platform/network/mac/WebCoreURLResponse.h:
401
402 2016-03-04  Sam Weinig  <sam@webkit.org>
403
404         [WebKit2] Add WebKit2 equivalent of -[WebView _insertNewlineInQuotedContent]
405         <rdar://problem/24943591>
406         https://bugs.webkit.org/show_bug.cgi?id=155057
407
408         Reviewed by Tim Horton.
409
410         Move Editor::insertParagraphSeparatorInQuotedContent() into Editor.cpp
411         and remove the duplicated code in EditorIOS.mm and EditorMac.mm.
412
413         * editing/Editor.cpp:
414         (WebCore::Editor::insertParagraphSeparatorInQuotedContent):
415         * editing/Editor.h:
416         * editing/ios/EditorIOS.mm:
417         (WebCore::Editor::insertParagraphSeparatorInQuotedContent): Deleted.
418         * editing/mac/EditorMac.mm:
419         (WebCore::Editor::insertParagraphSeparatorInQuotedContent): Deleted.
420
421 2016-03-04  Gavin Barraclough  <barraclough@apple.com>
422
423         Convert DOMTimer interval from int to std::chromo::milliseconds
424         https://bugs.webkit.org/show_bug.cgi?id=155051
425
426         Speculative build fix.
427
428         * inspector/TimelineRecordFactory.cpp:
429         (WebCore::TimelineRecordFactory::createTimerInstallData):
430
431 2016-03-04  Gavin Barraclough  <barraclough@apple.com>
432
433         Convert DOMTimer interval from int to std::chromo::milliseconds
434         https://bugs.webkit.org/show_bug.cgi?id=155051
435
436         iOS build fix
437
438         * page/DOMTimer.cpp:
439         (WebCore::DOMTimer::install):
440
441 2016-03-04  Ryosuke Niwa  <rniwa@webkit.org>
442
443         Update defineCustomElement according to the spec rewrite
444         https://bugs.webkit.org/show_bug.cgi?id=155010
445         <rdar://problem/24970878>
446
447         Reviewed by Chris Dumez.
448
449         Updated the implementation of defineCustomElement and HTMLConstructor per recent rewrite of the spec:
450         https://w3c.github.io/webcomponents/spec/custom/#dom-document-defineelement
451         https://w3c.github.io/webcomponents/spec/custom/#htmlelement-constructor
452
453         defineCustomElement is now called defineElement and we disallow defining multiple custom elements with
454         a single class and throw an exception in defineElement.
455
456         Test: fast/custom-elements/Document-defineElement.html
457
458         * bindings/js/JSDocumentCustom.cpp:
459         (WebCore::JSDocument::defineElement): Renamed from defineCustomElement. Throw an exception when the interface
460         already defines another custom element. Also added FIXME's for missing steps.
461
462         * bindings/js/JSHTMLElementCustom.cpp:
463         (WebCore::constructJSHTMLElement): Removed the support for specifying a tag name in the first argument when
464         a single class defines multiple custom elements since that now results in an exception (in defineElement).
465
466         * dom/CustomElementDefinitions.cpp:
467         (WebCore::CustomElementDefinitions::containsConstructor): Added.
468         * dom/CustomElementDefinitions.h:
469         * dom/Document.idl: Renamed defineCustomElement to defineElement.
470         * html/HTMLElement.idl: Removed the optional tag name from the constructor.
471
472 2016-03-04  Tim Horton  <timothy_horton@apple.com>
473
474         Begin implementing <attachment> painting on iOS
475         https://bugs.webkit.org/show_bug.cgi?id=155046
476         <rdar://problem/24805991>
477
478         Reviewed by Enrica Casucci.
479
480         No new tests; there are existing tests that I will unskip and rebaseline
481         in the near future.
482
483         * rendering/RenderThemeIOS.h:
484         * rendering/RenderThemeIOS.mm:
485         (WebCore::AttachmentInfo::addLine):
486         (WebCore::AttachmentInfo::buildTitleLines):
487         (WebCore::AttachmentInfo::buildSingleLine):
488         (WebCore::getAttachmentProgress):
489         (WebCore::iconForAttachment):
490         (WebCore::AttachmentInfo::AttachmentInfo):
491         (WebCore::RenderThemeIOS::attachmentIntrinsicSize):
492         (WebCore::RenderThemeIOS::attachmentBaseline):
493         (WebCore::paintAttachmentIcon):
494         (WebCore::paintAttachmentText):
495         (WebCore::paintAttachmentProgress):
496         (WebCore::paintAttachmentBorder):
497         (WebCore::RenderThemeIOS::paintAttachment):
498         There are still a few missing pieces, but get <attachment> painting a bit on iOS.
499         We will paint an icon, action, title, and subtitle - in that order - depending on what we have.
500         The content is vertically and horizontally centered.
501
502 2016-03-04  Gavin Barraclough  <barraclough@apple.com>
503
504         Convert DOMTimer interval from int to std::chromo::milliseconds
505         https://bugs.webkit.org/show_bug.cgi?id=155051
506
507         Reviewed by Ryosuke Niwa.
508
509         This change is pretty much mechanical, replacing int with std::chrono::milliseconds.
510
511         * inspector/InspectorInstrumentation.cpp:
512         (WebCore::InspectorInstrumentation::willSendXMLHttpRequestImpl):
513         (WebCore::InspectorInstrumentation::didInstallTimerImpl):
514         * inspector/InspectorInstrumentation.h:
515         (WebCore::InspectorInstrumentation::willSendXMLHttpRequest):
516         (WebCore::InspectorInstrumentation::didInstallTimer):
517         * inspector/InspectorTimelineAgent.cpp:
518         (WebCore::InspectorTimelineAgent::didPaint):
519         (WebCore::InspectorTimelineAgent::didInstallTimer):
520         * inspector/InspectorTimelineAgent.h:
521         * inspector/TimelineRecordFactory.cpp:
522         (WebCore::TimelineRecordFactory::createGenericTimerData):
523         (WebCore::TimelineRecordFactory::createTimerInstallData):
524         * inspector/TimelineRecordFactory.h:
525         * page/DOMTimer.cpp:
526         (WebCore::shouldForwardUserGesture):
527         (WebCore::DOMTimer::DOMTimer):
528         (WebCore::DOMTimer::~DOMTimer):
529         (WebCore::DOMTimer::install):
530         (WebCore::DOMTimer::intervalClampedToMinimum):
531         * page/DOMTimer.h:
532         * page/DOMWindow.cpp:
533         (WebCore::DOMWindow::setTimeout):
534         (WebCore::DOMWindow::clearTimeout):
535         (WebCore::DOMWindow::setInterval):
536         (WebCore::DOMWindow::clearInterval):
537         * workers/WorkerGlobalScope.cpp:
538         (WebCore::WorkerGlobalScope::setTimeout):
539         (WebCore::WorkerGlobalScope::clearTimeout):
540         (WebCore::WorkerGlobalScope::setInterval):
541         (WebCore::WorkerGlobalScope::clearInterval):
542
543 2016-03-03  Enrica Casucci  <enrica@apple.com>
544
545         Add a mechanism to customize the long press action.
546         https://bugs.webkit.org/show_bug.cgi?id=154995
547         rdar://problem/24823732
548
549         Reviewed by Tim Horton.
550
551         We want to allow long press on attachment elements as well.
552
553         * WebCore.xcodeproj/project.pbxproj: Making HTMLAttachmentElement.h private.
554         * html/HTMLAttachmentElement.h: Adding exported functions.
555
556 2016-03-04  Andreas Kling  <akling@apple.com>
557
558         [iOS] Throw away compiled RegExp code when navigating to a new page.
559         <https://webkit.org/b/155015>
560
561         Reviewed by Anders Carlsson.
562
563         Discard RegExp code when doing a top-level navigation.
564         This frees up a couple hundred kilobytes on many pages.
565
566         * bindings/js/GCController.cpp:
567         (WebCore::GCController::deleteAllRegExpCode):
568         * bindings/js/GCController.h:
569         * loader/FrameLoader.cpp:
570         (WebCore::FrameLoader::commitProvisionalLoad):
571
572 2016-03-04  Simon Fraser  <simon.fraser@apple.com>
573
574         Use larger tiles when possible to reduce per-tile painting overhead
575         https://bugs.webkit.org/show_bug.cgi?id=154985
576
577         Reviewed by Zalan Bujtas.
578
579         r197541 inadvertently missed FrameView changes that push scrollability data
580         onto the TiledBacking, so didn't actually change behavior (hence the 512x512 tiles
581         in the failing tests).
582
583         Also remove m_tileSizeAtLastRevalidate from TileGrid; it's replaced by a simpler test.
584
585         * page/FrameView.cpp:
586         (WebCore::FrameView::addedOrRemovedScrollbar):
587         * platform/graphics/ca/TileGrid.cpp:
588         (WebCore::TileGrid::revalidateTiles):
589         (WebCore::TileGrid::TileGrid): Deleted.
590         * platform/graphics/ca/TileGrid.h:
591
592 2016-03-04  Simon Fraser  <simon.fraser@apple.com>
593
594         Use BoxExtent instead of EdgeSet in TileController
595         https://bugs.webkit.org/show_bug.cgi?id=155040
596
597         Reviewed by Zalan Bujtas.
598
599         Remove EdgeSet, which was very similar to the existing BoxExtent, and use BoxExtent
600         in TileController.
601
602         * WebCore.xcodeproj/project.pbxproj:
603         * platform/graphics/EdgeSet.h: Removed.
604         (WebCore::EdgeSet::EdgeSet): Deleted.
605         (WebCore::EdgeSet::top): Deleted.
606         (WebCore::EdgeSet::setTop): Deleted.
607         (WebCore::EdgeSet::right): Deleted.
608         (WebCore::EdgeSet::setRight): Deleted.
609         (WebCore::EdgeSet::bottom): Deleted.
610         (WebCore::EdgeSet::setBottom): Deleted.
611         (WebCore::EdgeSet::left): Deleted.
612         (WebCore::EdgeSet::setLeft): Deleted.
613         (WebCore::EdgeSet::operator==): Deleted.
614         (WebCore::EdgeSet::operator!=): Deleted.
615         * platform/graphics/ca/TileController.cpp:
616         (WebCore::TileController::setHasMargins):
617         * platform/graphics/ca/TileController.h:
618
619 2016-03-04  Brent Fulgham  <bfulgham@apple.com>
620
621         [WK2] Gather resource load statistics
622         https://bugs.webkit.org/show_bug.cgi?id=154278
623         <rdar://problem/24702892>
624
625         Reviewed by Andy Estes.
626
627         Tested (now under WK2) by http/tests/navigation/statistics.html
628
629         Split part of the ResourceLoadObserver into a new class (ResourceLoadStatisticsStore)
630         that manages the collection of ResourceLoadStatistic objects, and that can be used
631         in the UIProcess without touching various WebProcess-specific WebCore classes.
632
633         Have the WebProcess only fire a message to the UIProcess if data has been modified. Otherwise,
634         no messages should be sent. When new data is encountered, start a 5 second timer. If more
635         data is found during this delay, just accumulate it. When the timer fires, all data is sent
636         and the timer stops until a new batch of data arrives.
637
638         * CMakeLists.txt: Add the new ResourceLoadStatisticsStore class.
639         * WebCore.xcodeproj/project.pbxproj: Adjust visibility of ResourceLoadStatistics header,
640         and add new ResourceLoadStatisticsStore class.
641         * loader/ResourceLoadObserver.cpp:
642         (WebCore::ResourceLoadObserver::setResourceLoadStatisticsEnabled): Deleted.
643         (WebCore::ResourceLoadObserver::resourceLoadStatisticsEnabled): Deleted.
644         (WebCore::ResourceLoadObserver::setStatisticsStore): Added.
645         (WebCore::ResourceLoadObserver::logFrameNavigation): Tell the ResourceLoadStatisticsStore to fire its 'data changed'
646         handler if necessary.
647         (WebCore::ResourceLoadObserver::logSubresourceLoading): Ditto.
648         (WebCore::ResourceLoadObserver::logUserInteraction): Ditto.
649         (WebCore::ResourceLoadObserver::statisticsForOrigin): Use new ResourceLoadStatisticsStore.
650         (WebCore::ResourceLoadObserver::isPrevalentResource): Deleted.
651         (WebCore::ResourceLoadObserver::resourceStatisticsForPrimaryDomain): Deleted.
652         (WebCore::ResourceLoadObserver::writeDataToDisk): Deleted.
653         (WebCore::ResourceLoadObserver::setStatisticsStorageDirectory): Deleted.
654         (WebCore::ResourceLoadObserver::persistentStoragePath): Deleted.
655         (WebCore::ResourceLoadObserver::readDataFromDiskIfNeeded): Deleted.
656         (WebCore::ResourceLoadObserver::createDecoderFromDisk): Deleted.
657         (WebCore::ResourceLoadObserver::writeEncoderToDisk): Deleted.
658         * loader/ResourceLoadObserver.h:
659         * loader/ResourceLoadStatistics.cpp:
660         (WebCore::ResourceLoadStatistics::encode): Get rid of unneeded argument.
661         (WebCore::ResourceLoadStatistics::decode): Ditto.
662         (WebCore::mergeHashCountedSet): Added helper function.
663         (WebCore::ResourceLoadStatistics::merge): Added.
664         * loader/ResourceLoadStatistics.h:
665         (WebCore::ResourceLoadStatistics::ResourceLoadStatistics):
666         * loader/ResourceLoadStatisticsStore.cpp: Added.
667         (WebCore::ResourceLoadStatisticsStore::create):
668         (WebCore::ResourceLoadStatisticsStore::ResourceLoadStatisticsStore):
669         (WebCore::ResourceLoadStatisticsStore::isPrevalentResource):
670         (WebCore::ResourceLoadStatisticsStore::resourceStatisticsForPrimaryDomain):
671         (WebCore::ResourceLoadStatisticsStore::writeDataToDisk):
672         (WebCore::ResourceLoadStatisticsStore::setStatisticsStorageDirectory):
673         (WebCore::ResourceLoadStatisticsStore::persistentStoragePath):
674         (WebCore::ResourceLoadStatisticsStore::readDataFromDiskIfNeeded):
675         (WebCore::ResourceLoadStatisticsStore::createDecoderFromDisk):
676         (WebCore::ResourceLoadStatisticsStore::writeEncoderToDisk):
677         (WebCore::ResourceLoadStatisticsStore::statisticsForOrigin):
678         (WebCore::ResourceLoadStatisticsStore::takeStatistics):
679         (WebCore::ResourceLoadStatisticsStore::mergeStatistics):
680         (WebCore::ResourceLoadStatisticsStore::setNotificationCallback):
681         (WebCore::ResourceLoadStatisticsStore::fireDataModificationHandler):
682         * loader/ResourceLoadStatisticsStore.h: Added.
683
684 2016-03-04  Konstantin Tokarev  <annulen@yandex.ru>
685
686         Added missing override specifiers under Source/WebCore.
687         https://bugs.webkit.org/show_bug.cgi?id=155021
688
689         Reviewed by Michael Catanzaro.
690
691         No new tests needed.
692
693         * bridge/NP_jsobject.cpp:
694         * css/CSSStyleSheet.cpp:
695         * dom/MutationObserver.cpp:
696         * editing/DictationCommand.cpp:
697         * editing/EditingStyle.cpp:
698         * loader/EmptyClients.cpp:
699         * loader/SinkDocument.cpp:
700         * page/DOMWindow.cpp:
701         * page/animation/CSSPropertyAnimation.cpp:
702         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
703         Also added #if(SOUP) guard to
704         ResourceHandleStreamingClient::getOrCreateReadBuffer
705         because it is not an overridden method otherwise.
706         * platform/text/LineEnding.cpp:
707         * xml/parser/XMLDocumentParserLibxml2.cpp:
708
709 2016-03-04  Gavin Barraclough  <barraclough@apple.com>
710
711         Max out timer throttling immediately for pre-render pages
712         https://bugs.webkit.org/show_bug.cgi?id=155038
713
714         Reviewed by Chris Dumez.
715
716         If a hidden page has never been visible, no need to gently ramp into throttling - treat it
717         the same as a page that has been viewed, but has been in the background for a long time.
718
719         Why? The throttling mechanism scales with the amount of background work by shifting the
720         limit - once all background pages have maxed out the limit, they should no longer be burden
721         of the system. However the mechanism doesn't currently do anything to accelerate towards
722         the limit based on the number of pages in the ramp up phase, and ramp up duration is
723         proportional to limit (so ramping up to a high limit takes a long time). So if you quickly
724         create a large number of hidden pages the system may be under excessive load for a while,
725         as we slowly ramp up to a limit that will adequately constrain resource consumption.
726         In cases where a large number of hidden pages are rapidly generated, many likely remain in
727         the pre-render state, so this mitigation should typically help.
728
729         * page/Page.cpp:
730         (WebCore::Page::updateDOMTimerAlignmentInterval):
731             - if m_isPrerender then m_timerAlignmentInterval is set to the limit.
732         (WebCore::Page::setIsPrerender):
733             - When this changes updateDOMTimerAlignmentInterval().
734
735 2016-03-04  Gavin Barraclough  <barraclough@apple.com>
736
737         Unify determination of page timer alignment
738         https://bugs.webkit.org/show_bug.cgi?id=155031
739
740         Reviewed by Chris Dumez.
741
742         Currently this is scattered throughout Page - sites that call setDOMTimerAlignmentInterval have
743         to determine the correct alignment interval. Instead, replace setDOMTimerAlignmentInterval with
744         updateDOMTimerAlignmentInterval, and unify the policy decision here.
745
746         * page/Page.cpp:
747         (WebCore::Page::setTimerThrottlingState):
748             - setDOMTimerAlignmentInterval -> updateDOMTimerAlignmentInterval
749               Also, to simplify always record the timestamp when the state changes.
750         (WebCore::Page::setTimerAlignmentIntervalIncreaseLimit):
751             - setDOMTimerAlignmentInterval -> updateDOMTimerAlignmentInterval
752         (WebCore::Page::updateDOMTimerAlignmentInterval):
753             - Was setDOMTimerAlignmentInterval, now determines the new alignment value.
754         (WebCore::Page::timerAlignmentIntervalIncreaseTimerFired):
755             - setDOMTimerAlignmentInterval -> updateDOMTimerAlignmentInterval
756         (WebCore::Page::setDOMTimerAlignmentInterval): Deleted.
757             - Removed, became updateDOMTimerAlignmentInterval.
758         * page/Page.h:
759             - setDOMTimerAlignmentInterval -> updateDOMTimerAlignmentInterval
760               m_timerThrottlingEnabledTime -> m_timerThrottlingStateLastChangedTime
761
762 2016-03-04  Simon Fraser  <simon.fraser@apple.com>
763
764         Fix crash seen in iOS simulator tests
765         https://bugs.webkit.org/show_bug.cgi?id=155030
766
767         Reviewed by Tim Horton.
768
769         owningGraphicsLayer() can be null when the tileSizeChangeTimer fires, so null check
770         it and return, as we do for the tileRevalidationTimer.
771
772         * platform/graphics/ca/TileController.cpp:
773         (WebCore::TileController::tileSizeChangeTimerFired):
774
775 2016-03-04  Alex Christensen  <achristensen@webkit.org>
776
777         Remove vcxproj build system
778         https://bugs.webkit.org/show_bug.cgi?id=154388
779
780         Rubber-stamped by Brent Fulgham.
781
782         * WebCore.vcxproj/WebCore.submit.sln: Removed.
783         * WebCore.vcxproj/WebCore.vcxproj: Removed.
784         * WebCore.vcxproj/WebCore.vcxproj.filters: Removed.
785         * WebCore.vcxproj/WebCoreCFNetwork.props: Removed.
786         * WebCore.vcxproj/WebCoreCG.props: Removed.
787         * WebCore.vcxproj/WebCoreCURL.props: Removed.
788         * WebCore.vcxproj/WebCoreCairo.props: Removed.
789         * WebCore.vcxproj/WebCoreCommon.props: Removed.
790         * WebCore.vcxproj/WebCoreDebug.props: Removed.
791         * WebCore.vcxproj/WebCoreDebugWinCairo.props: Removed.
792         * WebCore.vcxproj/WebCoreGenerated.make: Removed.
793         * WebCore.vcxproj/WebCoreGenerated.vcxproj: Removed.
794         * WebCore.vcxproj/WebCoreGenerated.vcxproj.filters: Removed.
795         * WebCore.vcxproj/WebCoreGeneratedCommon.props: Removed.
796         * WebCore.vcxproj/WebCoreGeneratedDebug.props: Removed.
797         * WebCore.vcxproj/WebCoreGeneratedDebugWinCairo.props: Removed.
798         * WebCore.vcxproj/WebCoreGeneratedProduction.props: Removed.
799         * WebCore.vcxproj/WebCoreGeneratedRelease.props: Removed.
800         * WebCore.vcxproj/WebCoreGeneratedReleaseWinCairo.props: Removed.
801         * WebCore.vcxproj/WebCoreGeneratedWinCairo.make: Removed.
802         * WebCore.vcxproj/WebCoreGeneratedWinCairoCommon.props: Removed.
803         * WebCore.vcxproj/WebCoreIncludeCommon.props: Removed.
804         * WebCore.vcxproj/WebCoreMediaQT.props: Removed.
805         * WebCore.vcxproj/WebCorePostBuild.cmd: Removed.
806         * WebCore.vcxproj/WebCorePreBuild.cmd: Removed.
807         * WebCore.vcxproj/WebCoreProduction.props: Removed.
808         * WebCore.vcxproj/WebCoreQuartzCore.props: Removed.
809         * WebCore.vcxproj/WebCoreRelease.props: Removed.
810         * WebCore.vcxproj/WebCoreReleaseWinCairo.props: Removed.
811         * WebCore.vcxproj/WebCoreTestSupport.vcxproj: Removed.
812         * WebCore.vcxproj/WebCoreTestSupport.vcxproj.filters: Removed.
813         * WebCore.vcxproj/WebCoreTestSupportCommon.props: Removed.
814         * WebCore.vcxproj/WebCoreTestSupportDebug.props: Removed.
815         * WebCore.vcxproj/WebCoreTestSupportDebugWinCairo.props: Removed.
816         * WebCore.vcxproj/WebCoreTestSupportProduction.props: Removed.
817         * WebCore.vcxproj/WebCoreTestSupportRelease.props: Removed.
818         * WebCore.vcxproj/WebCoreTestSupportReleaseWinCairo.props: Removed.
819         * WebCore.vcxproj/build-generated-files.pl: Removed.
820         * WebCore.vcxproj/copyForwardingHeaders.cmd: Removed.
821         * WebCore.vcxproj/copyWebCoreResourceFiles.cmd: Removed.
822         * WebCore.vcxproj/migrate-scripts.pl: Removed.
823
824 2016-03-04  Brady Eidson  <beidson@apple.com>
825
826         Remove use of deprecated sqlite3_expired
827         https://bugs.webkit.org/show_bug.cgi?id=155025
828
829         Reviewed by Tim Horton.
830
831         Since we exclusively use sqlite3_prepare_v2 and don't use sqlite3_prepare,
832         manually checking for expired statements is not necessary.
833
834         * platform/sql/SQLiteStatement.cpp:
835         (WebCore::SQLiteStatement::isExpired): Null check the statement, but don't bother
836           with sqlite3_expired.
837
838 2016-03-04  Daniel Bates  <dabates@apple.com>
839
840         Move CryptoDigest to WebCore/platform
841         https://bugs.webkit.org/show_bug.cgi?id=155008
842         <rdar://problem/24969787>
843
844         Reviewed by Brent Fulgham.
845
846         CryptoDigest provides a platform-independent interface for interacting with platform-
847         specific cryptographic hashing services. We currently make use of this code as part
848         of the implementation of Web Crypto. This code will also be beneficial as part of
849         implementing support for Content Security Policy inline script and inline stylesheet
850         hashes. We should move CryptoDigest to WebCore/platform to convey that it a general
851         purpose platform abstraction.
852
853         * CMakeLists.txt: Add include directory WebCore/platform/crypto.
854         * PlatformEfl.cmake: Add file platform/crypto/gnutls/CryptoDigestGnuTLS.cpp and
855         remove file crypto/gnutls/CryptoDigestGnuTLS.cpp.
856         * PlatformGTK.cmake: Ditto.
857         * PlatformMac.cmake: Add file platform/crypto/mac/CryptoDigestMac.cpp and
858         remove file crypto/mac/CryptoDigestMac.cpp.
859         * WebCore.xcodeproj/project.pbxproj:
860         * crypto/algorithms/CryptoAlgorithmSHA1.cpp:
861         (WebCore::CryptoAlgorithmSHA1::digest): Substitute "CryptoDigest::Algorithm" for "CryptoAlgorithmIdentifier".
862         * crypto/algorithms/CryptoAlgorithmSHA224.cpp:
863         (WebCore::CryptoAlgorithmSHA224::digest): Ditto.
864         * crypto/algorithms/CryptoAlgorithmSHA256.cpp:
865         (WebCore::CryptoAlgorithmSHA256::digest): Ditto.
866         * crypto/algorithms/CryptoAlgorithmSHA384.cpp:
867         (WebCore::CryptoAlgorithmSHA384::digest): Ditto.
868         * crypto/algorithms/CryptoAlgorithmSHA512.cpp:
869         (WebCore::CryptoAlgorithmSHA512::digest): Ditto.
870         * crypto/mac/CryptoAlgorithmRSASSA_PKCS1_v1_5Mac.cpp:
871         (WebCore::getCryptoDigestAlgorithm): Converts a CryptoAlgorithmIdentifier enumerator to a
872         CryptoDigest::Algorithm enumerator, if applicable.
873         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::platformSign): Write in terms of WebCore::getCryptoDigestAlgorithm().
874         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::platformVerify): Ditto.
875         * platform/crypto/CryptoDigest.h: Renamed from Source/WebCore/crypto/CryptoDigest.h. Also added enum CryptoDigest::Algorithm
876         and changed constructor to take this enum.
877         * platform/crypto/gnutls/CryptoDigestGnuTLS.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoDigestGnuTLS.cpp.
878         (WebCore::CryptoDigest::CryptoDigest): Substitute "CryptoDigest::Algorithm" for "CryptoAlgorithmIdentifier".
879         (WebCore::CryptoDigest::~CryptoDigest): Ditto.
880         (WebCore::CryptoDigest::create): Ditto.
881         (WebCore::CryptoDigest::addBytes): Ditto.
882         (WebCore::CryptoDigest::computeHash): Ditto.
883         * platform/crypto/mac/CryptoDigestMac.cpp: Renamed from Source/WebCore/crypto/mac/CryptoDigestMac.cpp.
884         (WebCore::toSHA1Context): Ditto.
885         (WebCore::toSHA224Context): Ditto.
886         (WebCore::toSHA256Context): Ditto.
887         (WebCore::toSHA384Context): Ditto.
888         (WebCore::toSHA512Context): Ditto.
889         (WebCore::CryptoDigest::CryptoDigest): Ditto.
890         (WebCore::CryptoDigest::~CryptoDigest): Ditto.
891         (WebCore::CryptoDigest::create): Ditto.
892         (WebCore::CryptoDigest::addBytes): Ditto.
893         (WebCore::CryptoDigest::computeHash): Ditto.
894
895 2016-03-04  Myles C. Maxfield  <mmaxfield@apple.com>
896
897         Whitespace causes font-variant: all-small-caps to synthesize
898         https://bugs.webkit.org/show_bug.cgi?id=155004
899         <rdar://problem/24630796>
900
901         Reviewed by Darin Adler.
902
903         Many fonts (such as Avenir Next) don't report to support whitespace characters under
904         smcp or c2sc. Previously, we were using this as a signal to synthesize small caps
905         instead of true small caps. However, a better solution is for whitespace to never
906         cause synthesis with all-small-caps.
907
908         Test: fast/text/all-small-caps-whitespace.html
909
910         * platform/graphics/mac/ComplexTextController.cpp:
911         (WebCore::shouldSynthesize):
912         (WebCore::ComplexTextController::collectComplexTextRuns):
913
914 2016-03-04  Myles C. Maxfield  <mmaxfield@apple.com>
915
916         [iOS] Crash during font loading when injected bundle cancels load
917         https://bugs.webkit.org/show_bug.cgi?id=155001
918
919         Reviewed by Tim Horton.
920
921         If a injected bundle cancels the load, the fontLoaded() callback will be
922         called twice. We can simply detect this condition.
923
924         Test: CancelLoading.CancelFontSubresource API test
925
926         * css/CSSFontFaceSource.cpp:
927         (WebCore::CSSFontFaceSource::fontLoaded):
928
929 2016-03-03  Ada Chan  <adachan@apple.com>
930
931         The visibility of the airplay menu also depends on whether there's a custom menu item.
932         https://bugs.webkit.org/show_bug.cgi?id=154987
933
934         Reviewed by Darin Adler.
935
936         * html/HTMLMediaElement.cpp:
937         (WebCore::HTMLMediaElement::enqueuePlaybackTargetAvailabilityChangedEvent):
938
939 2016-03-04  Timothy Hatcher  <timothy@apple.com>
940
941         Inform WebKit and WebCore if a page is controlled by automation.
942
943         https://bugs.webkit.org/show_bug.cgi?id=154991
944         rdar://problem/24965784
945
946         Reviewed by Joseph Pecoraro.
947
948         * page/Page.h:
949         (WebCore::Page::isControlledByAutomation): Added.
950         (WebCore::Page::setControlledByAutomation): Added.
951
952 2016-03-03  Antti Koivisto  <antti@apple.com>
953
954         ComposedTreeIterator may traverse slotted nodes multiple times
955         https://bugs.webkit.org/show_bug.cgi?id=154983
956
957         Reviewed by Ryosuke Niwa.
958
959         Traversal of slotted nodes can escape to real siblings. Those siblings are then traversed again as slotted nodes.
960
961         Test: fast/shadow-dom/composed-tree-slots.html
962
963         * dom/ComposedTreeIterator.cpp:
964         (WebCore::ComposedTreeIterator::initializeContextStack):
965         (WebCore::ComposedTreeIterator::traverseNextInShadowTree):
966         (WebCore::ComposedTreeIterator::traverseNextLeavingContext):
967         (WebCore::ComposedTreeIterator::advanceInSlot):
968         * dom/ComposedTreeIterator.h:
969         (WebCore::ComposedTreeIterator::Context::Context):
970
971             Include end iterator to the context.
972             For slotted nodes set it up to point to the next sibling of the node.
973
974         (WebCore::ComposedTreeIterator::context):
975         (WebCore::ComposedTreeIterator::traverseNextSkippingChildren):
976
977 2016-03-04  Andreas Kling  <akling@apple.com>
978
979         Drop DocumentSharedObjectPool immediately when going into PageCache.
980         <https://webkit.org/b/154986>
981
982         Reviewed by Antti Koivisto.
983
984         The DocumentSharedObjectPool is a weirdly efficient little optimization
985         that deduplicates ElementData during the first 10s of a Document's lifetime.
986         While it's up, every ElementData created will persist so it can be used for
987         deduplication.
988
989         If a Document goes into the PageCache while its shared object pool is still
990         alive, we can just kill it right away. This will sometimes allow us to free
991         a bunch of ElementData sooner.
992
993         * dom/Document.cpp:
994         (WebCore::Document::Document):
995         (WebCore::Document::setInPageCache):
996         (WebCore::Document::clearSharedObjectPool):
997         (WebCore::Document::sharedObjectPoolClearTimerFired): Deleted.
998         * dom/Document.h:
999
1000 2016-03-04  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1001
1002         Remove PassRefPtr from ThreadableLoader and relatives
1003         https://bugs.webkit.org/show_bug.cgi?id=154966
1004
1005         Reviewed by Darin Adler.
1006
1007         Covered by existing tests.
1008
1009         * loader/DocumentThreadableLoader.cpp:
1010         (WebCore::DocumentThreadableLoader::create):
1011         * loader/DocumentThreadableLoader.h:
1012         * loader/ThreadableLoader.cpp:
1013         (WebCore::ThreadableLoader::create):
1014         * loader/ThreadableLoader.h:
1015         * loader/WorkerThreadableLoader.cpp:
1016         (WebCore::WorkerThreadableLoader::WorkerThreadableLoader):
1017         (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge):
1018         * loader/WorkerThreadableLoader.h:
1019
1020 2016-03-03  Ryosuke Niwa  <rniwa@webkit.org>
1021
1022         Let XCode have its own way and also sort the file.
1023
1024         * WebCore.xcodeproj/project.pbxproj:
1025
1026 2016-03-03  Chris Dumez  <cdumez@apple.com>
1027
1028         Regression(r196770): Unable to use HipChat Mac app
1029         https://bugs.webkit.org/show_bug.cgi?id=154999
1030         <rdar://problem/24931959>
1031
1032         Reviewed by Darin Adler.
1033
1034         r196770 made [Unforgeable] operations such as Location.reload()
1035         non-writable as per the Web IDL specification. As a result,
1036         trying to set such properties will be ignored in non-strict
1037         mode and will throw an exception is strict mode. This also matches
1038         Firefox and Chrome.
1039
1040         However, this broke the HipChat Mac App (the Web App seems fine)
1041         because it sets Location.reload() and is using strict mode, therefore
1042         causing an exception to be thrown.
1043
1044         This patch adds a quirk to JSLocation::putDelegate() which disable
1045         strict mode when we detect that the application is HipChat. As a
1046         result, we no longer throw when HipChat tries to set Location.reload
1047         and the application is able to connect again.
1048
1049         * bindings/js/JSLocationCustom.cpp:
1050         (WebCore::JSLocation::putDelegate):
1051         Add a quirk which disables strict mode if the application is HipChat.
1052
1053         * platform/RuntimeApplicationChecks.cpp:
1054         (WebCore::mainBundleIdentifier):
1055         Extract this from mainBundleIsEqualTo() so it can be shared with
1056         applicationBundleIdentifier().
1057
1058         (WebCore::applicationBundleIdentifier):
1059         Returns the application bundle identifier, which is a static variable.
1060         For the WebContent / Networking processes, the application bundle
1061         identifier gets set to the UIProcess bundle identifier upon
1062         initialization. If unset, we fall back to using mainBundleIdentifier()
1063         which will do the right thing for the WK2 UIProcess and WK1.
1064
1065         (WebCore::mainBundleIsEqualTo):
1066         Extract part of the code to mainBundleIdentifier() to better share
1067         code.
1068
1069         (WebCore::applicationIsHipChat):
1070         Add utility function that checks if the application is HipChat. This
1071         will do the right thing whether it is called from the UIProcess, the
1072         WebProcess or the UIProcess.
1073
1074         (WebCore::setApplicationBundleIdentifier):
1075         Add utility function to set the application bundle identifier. It gets
1076         called with the UIProcess bundle identifier by the NetworkProcess and
1077         the WebProcess upon initialization.
1078
1079         * platform/RuntimeApplicationChecks.h:
1080
1081 2016-03-03  Keith Miller  <keith_miller@apple.com>
1082
1083         JSArrayBuffers should be collected less aggressively
1084         https://bugs.webkit.org/show_bug.cgi?id=154982
1085
1086         Reviewed by Geoffrey Garen.
1087
1088         We are currently too aggressive in our collection of ArrayBuffer wrappers.
1089         There are three cases where we need to avoid collecting ArrayBuffer wrappers.
1090         1. If the wrapper has custom properties.
1091         2. If the wrapper is a subclass of ArrayBuffer.
1092         3. If the wrapper is in a WeakMap/WeakSet.
1093
1094         Currently, we only pass the first case in WebCore and none in the jsc CLI.
1095         This patch removes some optimizations that cause us to collect when we
1096         should not. Namely, always skipping the object unless it has custom
1097         properties. Additionally, in the case of subclassing, we also need a way
1098         for custom JSArrayBuffer objects to register themselves as the wrapper for
1099         an ArrayBuffer class.
1100
1101         Finally, this patch removes an unnecessary ref() and deref() of
1102         ArrayBuffer objects during the creation/destruction of the wrapper.
1103         Since an ArrayBuffer object's GC lifetime will be at least as long
1104         as the lifetime of the wrapper we are creating for it we don't need
1105         to ref() and deref() the ArrayBuffer object. This lifetime is
1106         guaranteed because ArrayBuffer objects are both GCed and refcounted
1107         and any new wrapper will visit the ArrayBuffer object as long as the
1108         wrapper is still alive.
1109
1110         Test: js/arraybuffer-wrappers.html
1111
1112         * bindings/js/JSDOMBinding.h:
1113         (WebCore::toJS):
1114         * bindings/js/WebCoreTypedArrayController.cpp:
1115         (WebCore::WebCoreTypedArrayController::registerWrapper):
1116         (WebCore::WebCoreTypedArrayController::JSArrayBufferOwner::finalize):
1117         (WebCore::WebCoreTypedArrayController::JSArrayBufferOwner::isReachableFromOpaqueRoots): Deleted.
1118         * bindings/js/WebCoreTypedArrayController.h:
1119
1120 2016-03-03  Simon Fraser  <simon.fraser@apple.com>
1121
1122         Use larger tiles when possible to reduce per-tile painting overhead
1123         https://bugs.webkit.org/show_bug.cgi?id=154985
1124         rdar://problem/23635219
1125
1126         Reviewed by Tim Horton.
1127
1128         There's no reason to use lots of 512x512 tiles on a non-scrollable page. We can reduce
1129         per-tile painting overhead by using one big tile. On vertically scrolling pages, we
1130         can also use wide tiles to reduce tile-crossing when painting. Have FrameView tell
1131         the TiledBacking about scrollability, allowing TileController to make tile size decisions.
1132
1133         Change the "giant tile" code path to just return whether Settings says we're in giant
1134         tile mode, so that tile size decisions can be made in TileController.
1135
1136         TileController now stores a single margin size, and a per-edge margin flag rather than a size
1137         per edge. It computes tile size based on scrollability, but adjusts tile size with some 
1138         hysteresis to avoid size thrashing for content that frequently resizes the document (e.g.
1139         some performance tests).
1140
1141         TileGrid stores a copy of the tile size, so that it remains unchanged from one revalidate
1142         to the next, and the grid can detect when the tile size changes, since it needs to throw away
1143         all tiles in that case.
1144
1145         Tests: tiled-drawing/tile-size-both-scrollable.html
1146                tiled-drawing/tile-size-horizontally-scrollable.html
1147                tiled-drawing/tile-size-unscrollable.html
1148                tiled-drawing/tile-size-vertically-scrollable.html
1149
1150         * WebCore.xcodeproj/project.pbxproj:
1151         * page/FrameView.cpp:
1152         (WebCore::FrameView::addedOrRemovedScrollbar):
1153         (WebCore::FrameView::willStartLiveResize): Tell the tile backing when live resize starts and stops.
1154         (WebCore::FrameView::willEndLiveResize):
1155         * platform/graphics/EdgeSet.h: Added. Template class that just stores some value
1156         per edge.
1157         (WebCore::EdgeSet::EdgeSet):
1158         (WebCore::EdgeSet::top):
1159         (WebCore::EdgeSet::setTop):
1160         (WebCore::EdgeSet::right):
1161         (WebCore::EdgeSet::setRight):
1162         (WebCore::EdgeSet::bottom):
1163         (WebCore::EdgeSet::setBottom):
1164         (WebCore::EdgeSet::left):
1165         (WebCore::EdgeSet::setLeft):
1166         (WebCore::EdgeSet::operator==):
1167         (WebCore::EdgeSet::operator!=):
1168         * platform/graphics/GraphicsLayerClient.h: Rather than have the client return the
1169         tile size, have it return whether we're in giant tile mode.
1170         (WebCore::GraphicsLayerClient::useGiantTiles):
1171         (WebCore::GraphicsLayerClient::tileSize): Deleted.
1172         * platform/graphics/TiledBacking.h:
1173         (WebCore::defaultTileSize): Deleted.
1174         * platform/graphics/ca/GraphicsLayerCA.cpp:
1175         (WebCore::GraphicsLayerCA::platformCALayerUseGiantTiles):
1176         (WebCore::GraphicsLayerCA::platformCALayerTileSize): Deleted.
1177         * platform/graphics/ca/GraphicsLayerCA.h:
1178         * platform/graphics/ca/PlatformCALayerClient.h:
1179         (WebCore::PlatformCALayerClient::platformCALayerUseGiantTiles):
1180         (WebCore::PlatformCALayerClient::platformCALayerTileSize): Deleted.
1181         * platform/graphics/ca/TileController.cpp:
1182         (WebCore::TileController::TileController):
1183         (WebCore::TileController::setScrollability):
1184         (WebCore::TileController::willStartLiveResize):
1185         (WebCore::TileController::didEndLiveResize):
1186         (WebCore::TileController::tileSize):
1187         (WebCore::TileController::setHasMargins):
1188         (WebCore::TileController::setMarginSize):
1189         (WebCore::TileController::hasMargins):
1190         (WebCore::TileController::hasHorizontalMargins):
1191         (WebCore::TileController::hasVerticalMargins):
1192         (WebCore::TileController::topMarginHeight):
1193         (WebCore::TileController::bottomMarginHeight):
1194         (WebCore::TileController::leftMarginWidth):
1195         (WebCore::TileController::rightMarginWidth):
1196         (WebCore::TileController::setTileMargins): Deleted.
1197         * platform/graphics/ca/TileController.h:
1198         * platform/graphics/ca/TileGrid.cpp:
1199         (WebCore::TileGrid::TileGrid):
1200         (WebCore::TileGrid::setNeedsDisplayInRect):
1201         (WebCore::TileGrid::rectForTileIndex):
1202         (WebCore::TileGrid::getTileIndexRangeForRect):
1203         (WebCore::TileGrid::removeAllTiles):
1204         (WebCore::TileGrid::revalidateTiles):
1205         * platform/graphics/ca/TileGrid.h:
1206         (WebCore::TileGrid::tileSize):
1207         * rendering/RenderLayerBacking.cpp:
1208         (WebCore::RenderLayerBacking::setTiledBackingHasMargins):
1209         (WebCore::RenderLayerBacking::useGiantTiles):
1210         (WebCore::RenderLayerBacking::tileSize): Deleted.
1211         * rendering/RenderLayerBacking.h:
1212
1213 2016-03-03  Ryosuke Niwa  <rniwa@webkit.org>
1214
1215         Disallow custom elements inside a window-less documents
1216         https://bugs.webkit.org/show_bug.cgi?id=154944
1217         <rdar://problem/24944875>
1218
1219         Reviewed by Antti Koivisto.
1220
1221         Disallow custom elements inside a window-less documents such as the shared inert document of template elements
1222         and the ones created by DOMImplementation.createDocument and DOMImplementation.createHTMLDocument.
1223
1224         Throw NotSupportedError in defineCustomElement when it's called in such a document as discussed in:
1225         https://github.com/w3c/webcomponents/issues/369
1226
1227         Tests: fast/custom-elements/parser/parser-constructs-custom-element-in-document-write.html
1228                fast/custom-elements/parser/parser-uses-registry-of-owner-document.html
1229
1230         * bindings/js/JSDOMBinding.cpp:
1231         (WebCore::throwNotSupportedError): Added.
1232         * bindings/js/JSDOMBinding.h:
1233         * bindings/js/JSDocumentCustom.cpp:
1234         (WebCore::JSDocument::defineCustomElement): Throw NotSupportedError when the context object's document doesn't
1235         have a browsing context (i.e. window-less).
1236         * html/parser/HTMLDocumentParser.cpp:
1237         (WebCore::HTMLDocumentParser::runScriptsForPausedTreeBuilder): Replaced a FIXME with an assertion now that we
1238         disallow instantiation of custom elements inside a template element.
1239
1240 2016-03-03  Alex Christensen  <achristensen@webkit.org>
1241
1242         Move SPI to CFNetworkSPI.h
1243         https://bugs.webkit.org/show_bug.cgi?id=154992
1244
1245         Reviewed by Andy Estes.
1246
1247         * platform/spi/cf/CFNetworkSPI.h:
1248
1249 2016-03-03  Alex Christensen  <achristensen@webkit.org>
1250
1251         Use CredentialStorage with NetworkSession
1252         https://bugs.webkit.org/show_bug.cgi?id=154939
1253
1254         Reviewed by Darin Adler.
1255
1256         This makes the credential-based http tests pass when using NetworkSession.
1257
1258         * platform/network/CredentialBase.h:
1259         (WebCore::CredentialBase::encodingRequiresPlatformData):
1260         * platform/network/CredentialStorage.h:
1261         WEBCORE_EXPORT more things that are newly used in WebKit2.
1262
1263 2016-03-03  Zalan Bujtas  <zalan@apple.com>
1264
1265         Subpixel rendering: Make collapsed borders painting subpixel aware.
1266         https://bugs.webkit.org/show_bug.cgi?id=154980
1267
1268         Reviewed by David Hyatt.
1269
1270         This patch enables collapsed borders with odd pixel width paint on subpixel position.
1271         Currently borders with odd pixels are split at integral position so that border-width: 3px;
1272         paints 1px on the left(top) and 2px on the right(bottom) side. With this patch
1273         we paint 1.5px on both sides(on 2x display).
1274
1275         Test: fast/table/hidpi-collapsed-border-with-odd-pixel-width.html
1276
1277         * rendering/RenderTableCell.cpp:
1278         (WebCore::RenderTableCell::paintCollapsedBorders):
1279
1280 2016-03-03  Dave Hyatt  <hyatt@apple.com>
1281
1282         Add support for the "last" value of hanging-punctuation
1283         https://bugs.webkit.org/show_bug.cgi?id=154977
1284
1285         Reviewed by Darin Adler and Simon Fraser.
1286
1287         New tests in fast/text.
1288
1289         This patch adds support for the new "last" value and also fixes up both
1290         "first" and "last" to work with leading and trailing whitespace that ends
1291         up getting collapsed away.
1292
1293         * rendering/RenderBlockFlow.cpp:
1294         (WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths):
1295         * rendering/RenderBlockLineLayout.cpp:
1296         (WebCore::inlineAncestorHasStartBorderPaddingOrMargin):
1297         (WebCore::inlineAncestorHasEndBorderPaddingOrMargin):
1298         (WebCore::isLastInFlowRun):
1299         (WebCore::RenderBlockFlow::computeInlineDirectionPositionsForSegment):
1300         * rendering/RenderText.cpp:
1301         (WebCore::isHangablePunctuationAtLineEnd):
1302         (WebCore::RenderText::hangablePunctuationStartWidth):
1303         (WebCore::RenderText::hangablePunctuationEndWidth):
1304         (WebCore::RenderText::firstCharacterIndexStrippingSpaces):
1305         (WebCore::RenderText::lastCharacterIndexStrippingSpaces):
1306         (WebCore::RenderText::trimmedPrefWidths):
1307         * rendering/RenderText.h:
1308         * rendering/line/BreakingContext.h:
1309         (WebCore::BreakingContext::handleText):
1310
1311 2016-03-03  Andy Estes  <aestes@apple.com>
1312
1313         Adopt CFNetwork storage partitioning SPI
1314         https://bugs.webkit.org/show_bug.cgi?id=154957
1315         rdar://problem/23614620
1316
1317         Reviewed by Darin Adler.
1318
1319         Adopt CFNetwork SPI for creating storage partitions. If Settings::cookieStoragePartitioningEnabled() is true,
1320         create cookie storage partitions for third-party contexts. This feature is disabled by default.
1321
1322         No new tests. Test support is tracked by <https://webkit.org/b/154958>.
1323
1324         * page/Settings.cpp:
1325         (WebCore::Settings::setCookieStoragePartitioningEnabled): Controls whether storage partitioning for cookies is enabled.
1326         * page/Settings.h:
1327         (WebCore::Settings::cookieStoragePartitioningEnabled):
1328         * platform/network/NetworkStorageSession.h:
1329         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
1330         (WebCore::cookieStoragePartition): Computes a storage partition identifier by determining the top
1331         privately-controlled domain of the cookie's first-party (main frame document) URL, then determining whether the
1332         cookie's document hostname is a subdomain of it. If is is not, the first-party top domain is the partition name.
1333         Otherwise, there is no partition name.
1334         * platform/network/mac/CookieJarMac.mm:
1335         (WebCore::applyPartitionToCookies): Returns a deep copy of the given cookie array after adding a storage
1336         partition property to each copied cookie.
1337         (WebCore::cookiesInPartitionForURL): Returns cookies for the partition computed by the given URLs. If no
1338         partition can be determined, nil is returned.
1339         (WebCore::cookiesForURL): Returns cookiesInPartitionForURL() if non-nil, otherwise returns wkHTTPCookiesForURL().
1340         (WebCore::cookiesForSession): Started calling cookiesForURL().
1341         (WebCore::setCookiesFromDOM): Called applyPartitionToCookies() if a partition can be computed from the given URLs.
1342         (WebCore::getRawCookies): Started calling cookiesForURL().
1343         * platform/network/mac/ResourceHandleMac.mm:
1344         (WebCore::ResourceHandle::createNSURLConnection): Computed the storage partition identifier for the new request.
1345         If non-empty, set it as a property on the NSURLRequest where CFNetwork knows to find it.
1346         * platform/spi/cf/CFNetworkSPI.h: Declare new SPI for building with the public SDK.
1347
1348 2016-03-03  Manuel Rego Casasnovas  <rego@igalia.com>
1349
1350         [css-grid] Fix order of grid shorthands in CSSPropertyNames.in
1351         https://bugs.webkit.org/show_bug.cgi?id=154915
1352
1353         Reviewed by Darin Adler.
1354
1355         The order of columns and rows in grid and grid-template shorthands
1356         has been swapped recently (r196906 & r196934).
1357         However the order was not updated in CSSPropertyNames.in file.
1358
1359         * css/CSSPropertyNames.in:
1360
1361 2016-03-03  Alexey Proskuryakov  <ap@apple.com>
1362
1363         AllInOne build fix.
1364
1365         * rendering/RenderFlexibleBox.cpp:
1366         * rendering/RenderGrid.cpp:
1367         Don't have two static functions with the same name.
1368
1369 2016-03-03  Chris Dumez  <cdumez@apple.com>
1370
1371         Drop [TreatNullAs=EmptyString] from URL interface attributes
1372         https://bugs.webkit.org/show_bug.cgi?id=154951
1373
1374         Reviewed by Darin Adler.
1375
1376         Drop [TreatNullAs=EmptyString] from URL interface attributes to match
1377         the specification:
1378         - https://url.spec.whatwg.org/#api
1379
1380         Firefox and Chrome both already follow the specification and convert
1381         null to the "null" string.
1382
1383         No new tests, already covered by existing tests.
1384
1385         * html/URLUtils.idl:
1386
1387 2016-03-03  Miguel Gomez  <magomez@igalia.com>
1388
1389         [TextureMapper] Use RGBA format for textures attached to framebuffers
1390         https://bugs.webkit.org/show_bug.cgi?id=154965
1391
1392         Reviewed by Žan Doberšek.
1393
1394         Use RGBA format when allocating textures that will be used as framebuffer
1395         attachments. This means adding a new flag to BitmapTexture and modifying
1396         BitmapTextureGL to use the appropriate format according to the flag. Also,
1397         BitmapTexturePool needs to use two vectors to handle both types of textures
1398         separately, as we want to avoid constantly switching the format of a reused
1399         texture.
1400
1401         No new tests since the behavior change is covered by existing tests.
1402
1403         * platform/graphics/texmap/BitmapTexture.h: Add new flag.
1404         * platform/graphics/texmap/BitmapTextureGL.cpp:
1405         (WebCore::BitmapTextureGL::BitmapTextureGL): Receive flags on constructor and use RGBA
1406         when the FBOAttachment flag is enabled.
1407         (WebCore::BitmapTextureGL::applyFilters): Use FBOAttachemt flag to request a texture.
1408         * platform/graphics/texmap/BitmapTextureGL.h: Add flags to the constructor.
1409         * platform/graphics/texmap/BitmapTexturePool.cpp: Add a new vector of textures to hold
1410         those in RGBA format.
1411         (WebCore::BitmapTexturePool::acquireTexture): Return a texture for the usage specified
1412         in the incoming flags.
1413         (WebCore::BitmapTexturePool::releaseUnusedTexturesTimerFired): Release textures from
1414         both vectors.
1415         (WebCore::BitmapTexturePool::createTexture): Pass the usage flag when creating a new
1416         texture.
1417         * platform/graphics/texmap/BitmapTexturePool.h: Add new texture vector and add flags to
1418         the needed headers.
1419         * platform/graphics/texmap/TextureMapper.cpp:
1420         (WebCore::TextureMapper::acquireTextureFromPool): Pass the received flags to the BitmapTexturePool.
1421         * platform/graphics/texmap/TextureMapperLayer.cpp:
1422         (WebCore::TextureMapperLayer::paintIntoSurface): Use FBOAttachemt flag to request a texture.
1423
1424 2016-03-03  Javier Fernandez  <jfernandez@igalia.com>
1425
1426         [CSS Box Alignment] New CSS Value 'normal' for Content Alignment
1427         https://bugs.webkit.org/show_bug.cgi?id=154282
1428
1429         Reviewed by David Hyatt.
1430
1431         The Box Alignment specification defines a new value 'normal' to be used
1432         as default for the different layout models, which will define the
1433         specific behavior for each case. This patch adds a new CSS value in the
1434         parsing logic and adapts the Content Alignment properties to the new
1435         value.
1436
1437         The 'auto' value is no longer valid and the Computed Value will be
1438         always the specified value. Hence, I removed the StyleResolver logic
1439         because is not required now; the specific behavior of the 'normal'
1440         value will be resolved at layout time.
1441
1442         Computed value of both align-content and justify-content is the
1443         specified value, we don't have to resolve any 'auto' value now.
1444
1445         Additionally, this patch updates the layout logic as well, for both
1446         Flexbox and Grid layout models.
1447
1448         No new tests, since we only need to rebaseline those test cases
1449         affected by the new default computed value.
1450
1451         * css/CSSComputedStyleDeclaration.cpp:
1452         (WebCore::valueForContentPositionAndDistributionWithOverflowAlignment):
1453         (WebCore::ComputedStyleExtractor::propertyValue):
1454         (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): Deleted.
1455         (WebCore::CSSComputedStyleDeclaration::copyProperties): Deleted.
1456         (WebCore::nodeOrItsAncestorNeedsStyleRecalc): Deleted.
1457         (WebCore::isFlexOrGrid): Deleted.
1458         (WebCore::ComputedStyleExtractor::customPropertyValue): Deleted.
1459         * css/CSSParser.cpp:
1460         (WebCore::CSSParser::parseContentDistributionOverflowPosition):
1461         * css/CSSPrimitiveValueMappings.h:
1462         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
1463         (WebCore::CSSPrimitiveValue::operator ContentPosition):
1464         * rendering/RenderFlexibleBox.cpp:
1465         (WebCore::normalValueBehavior):
1466         (WebCore::RenderFlexibleBox::layoutAndPlaceChildren):
1467         (WebCore::RenderFlexibleBox::layoutColumnReverse):
1468         (WebCore::RenderFlexibleBox::alignFlexLines):
1469         (WebCore::alignContentSpaceBetweenChildren): Deleted.
1470         * rendering/RenderGrid.cpp:
1471         (WebCore::normalValueBehavior):
1472         (WebCore::RenderGrid::applyStretchAlignmentToTracksIfNeeded):
1473         (WebCore::RenderGrid::columnAxisOffsetForChild):
1474         (WebCore::RenderGrid::rowAxisOffsetForChild):
1475         (WebCore::resolveContentDistributionFallback):
1476         (WebCore::contentDistributionOffset):
1477         (WebCore::RenderGrid::computeContentPositionAndDistributionOffset):
1478         * rendering/style/RenderStyle.cpp:
1479         (WebCore::resolvedContentAlignmentPosition):
1480         (WebCore::resolvedContentAlignmentDistribution):
1481         (WebCore::RenderStyle::resolvedJustifyContentPosition):
1482         (WebCore::RenderStyle::resolvedJustifyContentDistribution):
1483         (WebCore::RenderStyle::resolvedAlignContentPosition):
1484         (WebCore::RenderStyle::resolvedAlignContentDistribution):
1485         * rendering/style/RenderStyle.h:
1486         * rendering/style/RenderStyleConstants.h:
1487
1488 2016-03-03  Antti Koivisto  <antti@apple.com>
1489
1490         Slider thumb style should not depend on renderers
1491         https://bugs.webkit.org/show_bug.cgi?id=154961
1492
1493         Reviewed by Andreas Kling.
1494
1495         Currently slider thumb pseudo id is computed based on host element renderer.
1496         Style is the input for building a render tree and should be computable without having one.
1497
1498         * html/shadow/SliderThumbElement.cpp:
1499         (WebCore::SliderThumbElement::hostInput):
1500         (WebCore::SliderThumbElement::customStyleForRenderer):
1501
1502             Compute pseudo id based on the host style.
1503             Return nullptr so style recalc will otherwise proceed normally.
1504
1505         (WebCore::SliderThumbElement::shadowPseudoId):
1506         (WebCore::SliderThumbElement::cloneElementWithoutAttributesAndChildren):
1507         (WebCore::SliderContainerElement::SliderContainerElement):
1508         (WebCore::SliderContainerElement::create):
1509         (WebCore::SliderContainerElement::createElementRenderer):
1510         (WebCore::SliderContainerElement::customStyleForRenderer):
1511
1512             Here too.
1513
1514         (WebCore::SliderContainerElement::shadowPseudoId):
1515         (WebCore::sliderThumbShadowPseudoId): Deleted.
1516         (WebCore::mediaSliderThumbShadowPseudoId): Deleted.
1517         * html/shadow/SliderThumbElement.h:
1518
1519 2016-03-03  Manuel Rego Casasnovas  <rego@igalia.com>
1520
1521         [css-grid] Simplify method to resolve auto-placed items
1522         https://bugs.webkit.org/show_bug.cgi?id=154911
1523
1524         Reviewed by Sergio Villar Senin.
1525
1526         Refactor the method to resolve auto-placed items
1527         as we're only interested in knowing the span size.
1528
1529         Adapt the calls to use the span size instead of a GridSpan.
1530
1531         No new tests, no change of behavior.
1532
1533         * rendering/RenderGrid.cpp:
1534         (WebCore::RenderGrid::populateExplicitGridAndOrderIterator):
1535         (WebCore::RenderGrid::createEmptyGridAreaAtSpecifiedPositionsOutsideGrid):
1536         (WebCore::RenderGrid::placeSpecifiedMajorAxisItemsOnGrid):
1537         (WebCore::RenderGrid::placeAutoMajorAxisItemOnGrid):
1538         * rendering/style/GridResolvedPosition.cpp:
1539         (WebCore::GridResolvedPosition::spanSizeForAutoPlacedItem):
1540         (WebCore::GridResolvedPosition::resolveGridPositionsFromAutoPlacementPosition):
1541         Renamed to spanSizeForAutoPlacedItem().
1542         * rendering/style/GridResolvedPosition.h:
1543
1544 2016-03-02  Chris Dumez  <cdumez@apple.com>
1545
1546         HTMLFormElement's named property getter does not return a RadioNodelist
1547         https://bugs.webkit.org/show_bug.cgi?id=154949
1548
1549         Reviewed by Ryosuke Niwa.
1550
1551         HTMLFormElement's named property getter should return a RadioNodeList
1552         when there are several matches:
1553         https://html.spec.whatwg.org/multipage/forms.html#the-form-element
1554
1555         Previously, WebKit returned a generic NodeList. As a result, users
1556         cannot create a white-and-gold hat in the MAKE A HAT GREAT AGAIN
1557         section at:
1558         https://www.washingtonpost.com/news/the-fix/wp/2015/10/06/hey-lets-all-make-our-own-donald-trump-hats/
1559
1560         Chrome and Firefox already match the specification. Edge will soon.
1561
1562         Test: fast/dom/HTMLFormElement/named-property-getter-radionodelist.html
1563
1564         * bindings/js/JSHTMLFormElementCustom.cpp:
1565         (WebCore::JSHTMLFormElement::nameGetter):
1566
1567 2016-03-02  Chris Dumez  <cdumez@apple.com>
1568
1569         Drop [TreatNullAs=LegacyNullString] from HTMLBaseElement.href
1570         https://bugs.webkit.org/show_bug.cgi?id=154952
1571
1572         Reviewed by Ryosuke Niwa.
1573
1574         Drop [TreatNullAs=LegacyNullString] from HTMLBaseElement.href as this
1575         does not match the specification:
1576         - https://html.spec.whatwg.org/multipage/semantics.html#the-base-element
1577
1578         Firefox and Chrome both convert null to the string "null".
1579
1580         No new tests, updated the following existing test:
1581         fast/dom/HTMLBaseElement/href-attribute-resolves-with-respect-to-document.html
1582
1583         * html/HTMLBaseElement.idl:
1584
1585 2016-03-02  Zalan Bujtas  <zalan@apple.com>
1586
1587         Paint table borders on empty cells even in quirks mode.
1588         https://bugs.webkit.org/show_bug.cgi?id=154928
1589
1590         Reviewed by David Hyatt.
1591
1592         Enable border painting for empty cells unless 'empty-cells: hide' is set. 
1593         This is inline with FF and Chrome behaviour.
1594
1595         Test: fast/table/border-on-empty-table-cells-quirks-mode.html
1596
1597         * rendering/RenderTableCell.cpp:
1598         (WebCore::RenderTableCell::paintBoxDecorations):
1599
1600 2016-03-02  Ryosuke Niwa  <rniwa@webkit.org>
1601
1602         HTML parser instantiates a custom element inside a template element with a wrong owner document
1603         https://bugs.webkit.org/show_bug.cgi?id=154936
1604
1605         Reviewed by Chris Dumez.
1606
1607         The bug was caused by our implementation following the old spec which didn't create a appropriate template
1608         contents owner document [1] for a document without a browsing context. The new spec no longer has this clause,
1609         and we should be always creating the appropriate template contents owner document unless the document itself
1610         is an appropriate template contents owner document for another document (comes up in nested template elements).
1611
1612         No new tests since the behavior change is covered by existing tests.
1613
1614         [1] https://html.spec.whatwg.org/#appropriate-template-contents-owner-document
1615
1616         * dom/Document.h:
1617         (WebCore::Document::templateDocument):
1618
1619 2016-03-02  Gavin Barraclough  <barraclough@apple.com>
1620
1621         PageThrottler should apply hysteresis to media activity
1622         https://bugs.webkit.org/show_bug.cgi?id=154940
1623
1624         Reviewed by Ryosuke Niwa.
1625
1626         Currently PageThrottler keeps a track of audible plugin activity and HTML media element
1627         activity separately. Audible plugin activity also gets an extra 5s hysteresis applied,
1628         so that after audio playback has completed there is a chance to queue up more audio
1629         before timer throttling kicks in. HTML audio does not get this grace. Funnel both
1630         together into a single activity flag, such that the hysteresis is applied to both.
1631
1632         * page/PageThrottler.cpp:
1633         (WebCore::PageThrottler::PageThrottler):
1634         (WebCore::m_mediaActivityHysteresis):
1635             - PageActivityState::AudiblePlugin -> PageActivityState::MediaActivity.
1636         (WebCore::m_mediaActivityCounter):
1637             - when m_mediaActivityCounter value changes call mediaActivityCounterChanged().
1638         (WebCore::PageThrottler::mediaActivityCounterChanged):
1639             - Drive PageActivityState::MediaActivity indirectly via m_mediaActivityHysteresis,
1640               such that a 5s hysteresis is applied.
1641         * page/PageThrottler.h:
1642             - Removed AudiblePlugin (merged in with MediaActivity).
1643         (WebCore::PageThrottler::pluginDidEvaluateWhileAudioIsPlaying):
1644             - m_audiblePluginHysteresis.impulse -> m_mediaActivityHysteresis.impulse.
1645
1646 2016-03-01  Ada Chan  <adachan@apple.com>
1647
1648         Update the media element's presentation mode properly after going in and out of full screen via the Full Screen API
1649         https://bugs.webkit.org/show_bug.cgi?id=154834
1650
1651         Reviewed by Simon Fraser.
1652
1653         * dom/Document.cpp:
1654         (WebCore::Document::webkitWillEnterFullScreenForElement):
1655         * dom/Element.cpp:
1656         (WebCore::Element::willBecomeFullscreenElement):
1657         * dom/Element.h:
1658         (WebCore::Element::ancestorWillEnterFullscreen):
1659         * html/HTMLMediaElement.cpp:
1660         (WebCore::HTMLMediaElement::enterFullscreen):
1661         If the Full Screen API is enabled and this media element is entering a mode other than standard
1662         full screen, see if it's currently contained in a full screen element. If so, exit full screen.
1663         (WebCore::HTMLMediaElement::willBecomeFullscreenElement):
1664         If this media element is going to standard full screen, update its presentation mode. If
1665         this media element also supports presentation mode and it currently has a presentation mode
1666         that's not standard full screen, exit that presentation mode directly without animation.
1667         (WebCore::HTMLMediaElement::willStopBeingFullscreenElement):
1668         Set the presentation mode back to inline unless it's already changed to a different
1669         presentation mode.
1670         * html/HTMLMediaElement.h:
1671         * html/HTMLVideoElement.cpp:
1672         (WebCore::HTMLVideoElement::ancestorWillEnterFullscreen):
1673         Reset this video element's presentation state to inline if its ancestor is going to full screen.
1674         (WebCore::HTMLVideoElement::exitToFullscreenModeWithoutAnimationIfPossible):
1675         If the fullscreen mode the video element is exiting from is supported, exit that mode to the new mode.
1676         * html/HTMLVideoElement.h:
1677         * page/ChromeClient.h:
1678         * platform/mac/WebVideoFullscreenInterfaceMac.h:
1679         * platform/mac/WebVideoFullscreenInterfaceMac.mm:
1680         (WebCore::WebVideoFullscreenInterfaceMac::exitFullscreenWithoutAnimationToMode):
1681
1682 2016-03-02  Brady Eidson  <beidson@apple.com>
1683
1684         Modern IDB: Close UniqueIDBDatabases once they become unused.
1685         https://bugs.webkit.org/show_bug.cgi?id=154922
1686
1687         Reviewed by Alex Christensen.
1688
1689         Tests: storage/indexeddb/modern/256-open-databases.html
1690                storage/indexeddb/modern/exceed-open-file-limit.html
1691
1692         Without this change, attempts to open a 256th database in the DatabaseProcess will fail on Mac.
1693         
1694         Due to SQLite journal files, this limit could come up as early as 128 databases if they are all
1695         in active use.
1696         
1697         This is because launchd - by default - limits xpc services to having 256 open file handles by default.
1698         
1699         While we should explore raising the limit, we should also close databases we no longer need.
1700         
1701         * Modules/indexeddb/server/IDBBackingStore.h:
1702
1703         * Modules/indexeddb/server/IDBServer.cpp:
1704         (WebCore::IDBServer::IDBServer::closeUniqueIDBDatabase):
1705         (WebCore::IDBServer::IDBServer::deleteUniqueIDBDatabase): Deleted.
1706         * Modules/indexeddb/server/IDBServer.h:
1707
1708         * Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
1709         (WebCore::IDBServer::MemoryBackingStoreTransaction::MemoryBackingStoreTransaction):
1710
1711         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
1712         (WebCore::IDBServer::MemoryIDBBackingStore::getOrEstablishDatabaseInfo):
1713         * Modules/indexeddb/server/MemoryIDBBackingStore.h:
1714
1715         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
1716         (WebCore::IDBServer::SQLiteIDBBackingStore::getOrEstablishDatabaseInfo):
1717         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
1718
1719         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1720         (WebCore::IDBServer::UniqueIDBDatabase::UniqueIDBDatabase):
1721         (WebCore::IDBServer::UniqueIDBDatabase::~UniqueIDBDatabase):
1722         (WebCore::IDBServer::UniqueIDBDatabase::performCurrentOpenOperation): Handle the case where opening
1723           the backing store failed by firing an error event instead of pretending everything is okay.
1724         (WebCore::IDBServer::UniqueIDBDatabase::deleteBackingStore):
1725         (WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore):
1726         (WebCore::IDBServer::UniqueIDBDatabase::openBackingStore):
1727         (WebCore::IDBServer::UniqueIDBDatabase::didOpenBackingStore):
1728         (WebCore::IDBServer::UniqueIDBDatabase::isCurrentlyInUse):
1729         (WebCore::IDBServer::UniqueIDBDatabase::operationAndTransactionTimerFired): If the database is not
1730           currently in use, close it.
1731         (WebCore::IDBServer::UniqueIDBDatabase::inProgressTransactionCompleted):
1732         * Modules/indexeddb/server/UniqueIDBDatabase.h:
1733         (WebCore::IDBServer::UniqueIDBDatabase::deletePending): Deleted.
1734
1735         * Modules/indexeddb/shared/IDBObjectStoreInfo.cpp:
1736         (WebCore::IDBObjectStoreInfo::isolatedCopy): Actually get this right.
1737
1738 2016-03-02  Gavin Barraclough  <barraclough@apple.com>
1739
1740         Disable timer throttling increases for visually idle / active pages.
1741         https://bugs.webkit.org/show_bug.cgi?id=154935
1742
1743         Reviewed by Chris Dumez.
1744
1745         Currently any page that is visually idle can timer throttle, and all are eligible for throttling
1746         allow throttling to increase.
1747
1748         Instead, still allow any visually idle page to timer throttle, but only allow increasing in those
1749         that are fully hidden & inactive (no page loading or media activity).
1750
1751         * page/Page.cpp:
1752         (WebCore::Page::setTimerThrottlingState):
1753             - Updated policy per commet above.
1754         (WebCore::Page::setPageActivityState):
1755         (WebCore::Page::setIsVisible):
1756             - We now may need to updated timer throttling when these change.
1757
1758 2016-03-02  Konstantin Tokarev  <annulen@yandex.ru>
1759
1760         [cmake] Moved PRE/POST_BUILD_COMMAND to WEBKIT_FRAMEWORK.
1761         https://bugs.webkit.org/show_bug.cgi?id=154651
1762
1763         Reviewed by Alex Christensen.
1764
1765         No new tests needed.
1766
1767         * CMakeLists.txt: Moved shared code to WEBKIT_FRAMEWORK macro.
1768
1769 2016-03-02  Dave Hyatt  <hyatt@apple.com>
1770
1771         Add support for the "first" value of the hanging-punctuation property.
1772         https://bugs.webkit.org/show_bug.cgi?id=154919
1773
1774         Reviewed by Simon Fraser.
1775
1776         New tests added in fast/text.
1777
1778         Implement the "first" value for hanging-punctuation as described here:
1779         https://drafts.csswg.org/css-text-3/#propdef-hanging-punctuation
1780
1781         * rendering/RenderBlockFlow.cpp:
1782         (WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths):
1783         Update the preferred logical width computation to factor in hanging punctuation.
1784         This check is similar to the text-indent logic in that we only want to do it for
1785         the first formatted line.
1786
1787         * rendering/RenderBlockFlow.h:
1788         (WebCore::RenderBlockFlow::simpleLineLayout):
1789         Make sure to turn off simple line layout when hanging punctuation is present. Eventually
1790         it should be feasible to support this in simple line layout, but since the full line
1791         layout model has to work with it anyway, we are starting there.
1792
1793         * rendering/RenderBlockLineLayout.cpp:
1794         (WebCore::inlineAncestorHasStartBorderPaddingOrMargin):
1795         (WebCore::isLastInFlowRun):
1796         Helper functions that are needed to determine whether or not we're allowed to apply
1797         hanging punctuation "first" to a text run.
1798
1799         (WebCore::RenderBlockFlow::computeInlineDirectionPositionsForSegment):
1800         This function manipulates logicalLeft and availableWidth when hanging punctuation
1801         is present to shift the line as needed and to expand the availableWidth of the line.
1802
1803         * rendering/RenderText.cpp:
1804         (WebCore::isHangablePunctuationAtLineStart):
1805         (WebCore::isHangablePunctuationAtLineEnd):
1806         (WebCore::RenderText::hangablePunctuationStartWidth):
1807         (WebCore::RenderText::trimmedPrefWidths):
1808         * rendering/RenderText.h:
1809         RenderText has a helper function for handing back the hangable punctuation width. This
1810         is used everywhere line layout wants to apply that offset. There are also helper functions
1811         that detect whether the character is a hangable punctuation character.
1812
1813         * rendering/SimpleLineLayout.cpp:
1814         (WebCore::SimpleLineLayout::canUseForWithReason):
1815         (WebCore::SimpleLineLayout::printReason):
1816         Turn off simple line layout when hanging punctuation is enabled.
1817
1818         * rendering/line/BreakingContext.h:
1819         (WebCore::BreakingContext::handleText):
1820         Modified to expand the available width when hanging punctuation is present so that we
1821         know we have more room on the line.
1822
1823         * rendering/line/LineWidth.h:
1824         (WebCore::LineWidth::isFirstLine):
1825         Add an accessor for whether or not we're the first line.
1826
1827 2016-03-01  Ryosuke Niwa  <rniwa@webkit.org>
1828
1829         Make HTML parser construct custom elements
1830         https://bugs.webkit.org/show_bug.cgi?id=154908
1831         <rdar://problem/24923735>
1832
1833         Reviewed by Antti Koivisto.
1834
1835         Added the support for instantiating custom elements inside the parser. Based on Jan F2F discussion,
1836         the HTML parser is going to synchronously construct custom elements. When a custom element constructor
1837         throws, the HTML parser creates a HTMLUnknownElement instead.
1838
1839         In our implementation, we pause the parser completely and construct custom elements using the same
1840         mechanism used to run author scripts. It's possible that we may want to apply some optimizations to
1841         to make custom element construction but it's probably a good idea to get semantics right first.
1842
1843         Tests: fast/custom-elements/parser/parser-constructs-custom-elements.html
1844                fast/custom-elements/parser/parser-fallsback-to-unknown-element.html
1845                fast/custom-elements/parser/parser-sets-attributes-and-children.html
1846                fast/custom-elements/parser/parser-uses-constructed-element.html
1847
1848         * bindings/js/JSCustomElementInterface.cpp:
1849         (WebCore::JSCustomElementInterface::constructElement): Added ShouldClearException as an argument
1850         to be used by the HTML parser since the parser can't re-throw to anywhere or fail parsing.
1851
1852         * bindings/js/JSCustomElementInterface.h:
1853         (WebCore::JSCustomElementInterface::ShouldClearException): Added.
1854
1855         * dom/Document.cpp:
1856         (WebCore::createHTMLElementWithNameValidation): Do not clear the exception here since createElement
1857         must re-throw the exception thrown by a custom element constructor.
1858         (WebCore::Document::createElementForBindings):
1859
1860         * dom/make_names.pl:
1861         (printFactoryCppFile): Added ConstructorFunctionMapEntry which contains the constructor function
1862         as well as the qualified name.
1863         (printFactoryHeaderFile): Added a variant of createKnownElement and createElement that takes
1864         AtomicString instead of QualifiedName.
1865
1866         * html/parser/HTMLConstructionSite.cpp:
1867         (WebCore::setAttributes): Added a variant that takes Vector<Attribute>.
1868         (WebCore::HTMLConstructionSite::insertHTMLElementOrFindCustomElementInterface): Added. Returns a
1869         custom element interface when the element doesn't match any builtin element and there is a custom
1870         element definition that matches the specified name.
1871         (WebCore::HTMLConstructionSite::insertCustomElement): Added. Like insertElement but also sets the
1872         attributes on the newly created custom element.
1873         (WebCore::HTMLConstructionSite::createHTMLElementOrFindCustomElementInterface): Extracted from
1874         createHTMLElement. When customElementInterface is not nullptr, we optionally find the custom
1875         element interface and return nullptr.
1876         (WebCore::HTMLConstructionSite::createHTMLElement):
1877         * html/parser/HTMLConstructionSite.h:
1878
1879         * html/parser/HTMLDocumentParser.cpp:
1880         (WebCore::HTMLDocumentParser::runScriptsForPausedTreeBuilder): Create a custom element when there
1881         is a pending custom element to create (i.e. m_customElementToConstruct is not empty).
1882         (WebCore::HTMLDocumentParser::isWaitingForScripts):
1883
1884         * html/parser/HTMLStackItem.h:
1885         (WebCore::HTMLStackItem::create): Added a variant used for custom elements.
1886         (WebCore::HTMLStackItem::HTMLStackItem): Ditto.
1887
1888         * html/parser/HTMLTreeBuilder.cpp:
1889         (WebCore::CustomElementConstructionData::CustomElementConstructionData): Added. It needs to be in
1890         the cpp file to avoid introducing more header dependencies in HTMLTreeBuilder.h.
1891         (WebCore::CustomElementConstructionData::~CustomElementConstructionData): Ditto.
1892         (WebCore::HTMLTreeBuilder::processStartTagForInBody): Use insertGenericHTMLElement when creating
1893         a generic element that could be custom elements.
1894         (WebCore::HTMLTreeBuilder::insertGenericHTMLElement): Added. Create and insert a new element
1895         or set m_customElementToConstruct so that the HTMLDocumentParser will create a custom element later.
1896         (WebCore::HTMLTreeBuilder::didCreateCustomOrCallbackElement): Added. Called by HTMLDocumentParser
1897         when it finishes creating a new custom element.
1898
1899         * html/parser/HTMLTreeBuilder.h:
1900         (WebCore::HTMLTreeBuilder::takeCustomElementConstructionData): Added.
1901         (WebCore::HTMLTreeBuilder::hasParserBlockingScriptWork): Renamed from hasParserBlockingScript.
1902         Checks the existence of m_customElementToConstruct as well as m_scriptToProcess.
1903
1904 2016-03-02  Zalan Bujtas  <zalan@apple.com>
1905
1906         Use IndentTextOrNot instead of passing isFirstLine/shouldIndentText as bool.
1907         https://bugs.webkit.org/show_bug.cgi?id=154628
1908
1909         Reviewed by Simon Fraser.
1910
1911         No change in behaviour.
1912
1913         * rendering/RenderBlock.cpp:
1914         (WebCore::RenderBlock::computeStartPositionDeltaForChildAvoidingFloats):
1915         (WebCore::RenderBlock::logicalLeftSelectionOffset):
1916         (WebCore::RenderBlock::logicalRightSelectionOffset):
1917         * rendering/RenderBlock.h:
1918         (WebCore::RenderBlock::availableLogicalWidthForLineInRegion):
1919         (WebCore::RenderBlock::logicalRightOffsetForLineInRegion):
1920         (WebCore::RenderBlock::logicalLeftOffsetForLineInRegion):
1921         (WebCore::RenderBlock::startOffsetForLineInRegion):
1922         (WebCore::RenderBlock::endOffsetForLineInRegion):
1923         (WebCore::RenderBlock::availableLogicalWidthForLine):
1924         (WebCore::RenderBlock::logicalRightOffsetForLine):
1925         (WebCore::RenderBlock::logicalLeftOffsetForLine):
1926         (WebCore::RenderBlock::startOffsetForLine):
1927         (WebCore::RenderBlock::endOffsetForLine):
1928         * rendering/RenderBlockFlow.cpp:
1929         (WebCore::RenderBlockFlow::getClearDelta):
1930         * rendering/RenderBlockLineLayout.cpp:
1931         (WebCore::updateLogicalInlinePositions):
1932         (WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):
1933         (WebCore::RenderBlockFlow::deleteEllipsisLineBoxes):
1934         (WebCore::RenderBlockFlow::checkLinesForTextOverflow):
1935         (WebCore::RenderBlockFlow::startAlignedOffsetForLine):
1936         * rendering/RenderBox.cpp:
1937         (WebCore::RenderBox::shrinkLogicalWidthToAvoidFloats):
1938         (WebCore::RenderBox::containingBlockAvailableLineWidthInRegion):
1939         * rendering/RenderDeprecatedFlexibleBox.cpp:
1940         (WebCore::RenderDeprecatedFlexibleBox::applyLineClamp):
1941         * rendering/RenderListItem.cpp:
1942         (WebCore::RenderListItem::positionListMarker):
1943         * rendering/RootInlineBox.cpp:
1944         (WebCore::RootInlineBox::selectionTop):
1945         (WebCore::RootInlineBox::selectionBottom):
1946         * rendering/SimpleLineLayout.cpp:
1947         (WebCore::SimpleLineLayout::canUseForWithReason):
1948         (WebCore::SimpleLineLayout::updateLineConstrains):
1949         * rendering/line/LineBreaker.cpp:
1950         (WebCore::LineBreaker::skipLeadingWhitespace):
1951         * rendering/line/LineWidth.cpp:
1952         (WebCore::LineWidth::shrinkAvailableWidthForNewFloatIfNeeded):
1953         (WebCore::availableWidthAtOffset):
1954         * rendering/line/LineWidth.h:
1955         (WebCore::LineWidth::shouldIndentText):
1956
1957 2016-03-02  Beth Dakin  <bdakin@apple.com>
1958
1959         Add support for playbackControlsManager
1960         https://bugs.webkit.org/show_bug.cgi?id=154742
1961         -and corresponding-
1962         rdar://problem/23833753
1963
1964         Reviewed by Jer Noble.
1965
1966         Make AVKitSPI.h private so that it can be used from other projects.
1967         * WebCore.xcodeproj/project.pbxproj:
1968
1969         Right now, set up a controls manager for a video when it starts playing. In 
1970         the future, this is something that should be handled by the 
1971         PlatformMediaSessionManager since we only want a controls for the 
1972         currentSession.
1973         * html/HTMLMediaElement.cpp:
1974         (WebCore::HTMLMediaElement::playInternal):
1975
1976         New function setUpVideoControlsManager.
1977         * page/ChromeClient.h:
1978
1979         Make these CoreMedia functions available on Mac and iOS instead of just iOS.
1980         * platform/cf/CoreMediaSoftLink.cpp:
1981         * platform/cf/CoreMediaSoftLink.h:
1982
1983         This patch fleshes out an implementation for a bunch of these interface 
1984         functions since they need to communicate to the playbackControlsManager. This 
1985         is also where the playbackControlsManager lives.
1986         * platform/mac/WebVideoFullscreenInterfaceMac.h:
1987
1988         Define an interface and implementation for WebPlaybackControlsManager.
1989         * platform/mac/WebVideoFullscreenInterfaceMac.mm:
1990         (-[WebPlaybackControlsManager initWithWebVideoFullscreenInterfaceMac:]):
1991         (-[WebPlaybackControlsManager isSeeking]):
1992         (-[WebPlaybackControlsManager seekToTime:toleranceBefore:toleranceAfter:]):
1993         (-[WebPlaybackControlsManager audioMediaSelectionOptions]):
1994         (-[WebPlaybackControlsManager currentAudioMediaSelectionOption]):
1995         (-[WebPlaybackControlsManager setCurrentAudioMediaSelectionOption:]):
1996         (-[WebPlaybackControlsManager legibleMediaSelectionOptions]):
1997         (-[WebPlaybackControlsManager currentLegibleMediaSelectionOption]):
1998         (-[WebPlaybackControlsManager setCurrentLegibleMediaSelectionOption:]):
1999         (-[WebPlaybackControlsManager cancelThumbnailAndAudioAmplitudeSampleGeneration]):
2000
2001         Relay this information to the playbackControlsManager.
2002         (WebCore::WebVideoFullscreenInterfaceMac::setDuration):
2003         (WebCore::WebVideoFullscreenInterfaceMac::setCurrentTime):
2004         (WebCore::WebVideoFullscreenInterfaceMac::setRate):
2005         (WebCore::WebVideoFullscreenInterfaceMac::setSeekableRanges):
2006         (WebCore::WebVideoFullscreenInterfaceMac::ensureControlsManager):
2007         (WebCore::WebVideoFullscreenInterfaceMac::playBackControlsManager):
2008         (WebCore::WebVideoFullscreenInterfaceMac::setupFullscreen):
2009
2010         New SPI needed.
2011         * platform/spi/cocoa/AVKitSPI.h:
2012         * platform/spi/mac/AVFoundationSPI.h:
2013
2014 2016-03-02  Gavin Barraclough  <barraclough@apple.com>
2015
2016         Add Page::TimerThrottlingState
2017         https://bugs.webkit.org/show_bug.cgi?id=154926
2018
2019         Reviewed by Chris Dumez.
2020
2021         Hidden page timer throttling is currently a boolean state, indicated by whether the Optional
2022         m_timerThrottlingEnabledTime is in a set/unset state. When enabled, the increasing mechanism
2023         may or may not be enabled, this is controlled directly by the setting.
2024
2025         Refactor to add an enum tracking timer throttling being in one of three states - disabled,
2026         enabled, or enabled-increasing. This cleans things up, and will enabled up to introduce a
2027         dynamic policy for when enabled-throttling is enabled. (Behavior is unchanged in this patch.)
2028
2029         * page/Page.cpp:
2030         (WebCore::Page::Page):
2031         (WebCore::Page::setIsVisuallyIdleInternal):
2032         (WebCore::Page::hiddenPageDOMTimerThrottlingStateChanged):
2033             - setTimerThrottlingEnabled -> updateTimerThrottlingState.
2034         (WebCore::Page::updateTimerThrottlingState):
2035             - policy decision (currently enabled if visually-idle) was scattered across
2036               all call sites to setTimerThrottlingState. Unify in one place.
2037         (WebCore::Page::setTimerThrottlingState):
2038             - Was setTimerThrottlingEnabled.
2039         (WebCore::Page::setTimerAlignmentIntervalIncreaseLimit):
2040         (WebCore::Page::setDOMTimerAlignmentInterval):
2041         (WebCore::Page::timerAlignmentIntervalIncreaseTimerFired):
2042             - updated to check m_timerThrottlingState.
2043         (WebCore::Page::setTimerThrottlingEnabled): Deleted.
2044             - This became updateTimerThrottlingState.
2045         * page/Page.h:
2046         (WebCore::Page::timerThrottlingEnabled): Deleted.
2047             - Removed, it's easy enough now to just check m_timerThrottlingState.
2048
2049 2016-03-02  Chris Dumez  <cdumez@apple.com>
2050
2051         Align HTMLInputElement.maxLength with the specification
2052         https://bugs.webkit.org/show_bug.cgi?id=154906
2053
2054         Reviewed by Ryosuke Niwa.
2055
2056         Align HTMLInputElement.maxLength with the specification:
2057         - https://html.spec.whatwg.org/multipage/forms.html#dom-input-maxlength
2058         - https://html.spec.whatwg.org/multipage/forms.html#attr-input-maxlength
2059
2060         In particular, the following Web-facing change was made:
2061         - HTMLInputElement.maxLength returns -1 instead of 524288 when
2062           the corresponding content attribute is missing, cannot be parsed
2063           or out of range (i.e. negative), as per:
2064           - https://html.spec.whatwg.org/multipage/infrastructure.html#limited-to-only-non-negative-numbers
2065
2066         Note that HTMLTextAreaElement.maxLength was already returning -1 in
2067         this case.
2068
2069         The new behavior matches Firefox. Chrome however, still seems to
2070         return 524288.
2071
2072         Note that we keep using 524288 as a maximum maxLength internally for
2073         performance reasons. However, we stop exposing this arbitrary value to
2074         the Web as this is an internal limitation.
2075
2076         No new tests, already covered by existing tests.
2077
2078         * html/HTMLInputElement.cpp:
2079         (WebCore::HTMLInputElement::HTMLInputElement):
2080         Initialize m_maxLength to -1 initially, instead of 524288.
2081
2082         (WebCore::HTMLInputElement::tooLong):
2083         Call effectiveMaxLength() instead of maxLength(), which no longer
2084         exists. effectiveMaxLength() makes sure of returning a value in
2085         the range [0, 524288].
2086
2087         (WebCore::HTMLInputElement::parseAttribute):
2088
2089         (WebCore::HTMLInputElement::effectiveMaxLength):
2090         Split maxLength() into maxLengthForBindings() and effectiveMaxLength().
2091         effectiveMaxLength() returns a value in the range [0, 524288], while
2092         maxLengthForBindings() returns values in the range [-1, 2147483647].
2093
2094         (WebCore::HTMLInputElement::setMaxLength): Deleted.
2095         The implementation was moved to the parent class so that it can be
2096         shared with HTMLTextAreaElement.
2097
2098         (WebCore::HTMLInputElement::maxLengthAttributeChanged):
2099         Rename for clarity.
2100
2101         * html/HTMLTextAreaElement.cpp:
2102         (WebCore::HTMLTextAreaElement::parseAttribute):
2103         (WebCore::HTMLTextAreaElement::maxLengthAttributeChanged):
2104         Cache the parsed maxLength when the content attribute changes, similarly
2105         to what is already done in HTMLInputElement.
2106
2107         (WebCore::HTMLTextAreaElement::handleBeforeTextInsertedEvent):
2108         (WebCore::HTMLTextAreaElement::validationMessage):
2109         (WebCore::HTMLTextAreaElement::tooLong):
2110         Call effectiveMaxLength() instead of maxLength() which no longer exists.
2111         effectiveMaxLength() returns a cached value and is therefore a lot more
2112         efficient.
2113
2114         * html/HTMLTextAreaElement.h:
2115         * html/HTMLTextAreaElement.idl:
2116         * html/HTMLTextFormControlElement.cpp:
2117         (WebCore::HTMLTextFormControlElement::setMaxLengthForBindings):
2118         This was moved up from HTMLInputElement / HTMLTextAreaElement to avoid code
2119         duplication.
2120
2121         * html/HTMLTextFormControlElement.h:
2122
2123         * html/InputType.cpp:
2124         (WebCore::InputType::validationMessage):
2125         * html/TextFieldInputType.cpp:
2126         (WebCore::TextFieldInputType::handleBeforeTextInsertedEvent):
2127         Call HTMLInputElement::effectiveMaxLength() instead of
2128         HTMLInputElement::maxLength() which no longer exists.
2129
2130 2016-03-02  Commit Queue  <commit-queue@webkit.org>
2131
2132         Unreviewed, rolling out r197434 and r197436.
2133         https://bugs.webkit.org/show_bug.cgi?id=154921
2134
2135         This change caused a LayoutTest assertion in debug (Requested
2136         by ryanhaddad on #webkit).
2137
2138         Reverted changesets:
2139
2140         "Extend CSSFontSelector's lifetime to be longer than the
2141         Document's lifetime"
2142         https://bugs.webkit.org/show_bug.cgi?id=154101
2143         http://trac.webkit.org/changeset/197434
2144
2145         "Unreviewed build fix after r197434."
2146         http://trac.webkit.org/changeset/197436
2147
2148 2016-03-02  Zalan Bujtas  <zalan@apple.com>
2149
2150         Subpixel layout: Enable vertical/horizontal subpixel spacing for tables.
2151         https://bugs.webkit.org/show_bug.cgi?id=154899
2152
2153         Reviewed by Simon Fraser.
2154
2155         This patch enables authors to specify device pixel values for table border spacing.
2156         (see border-spacing)
2157
2158         Test: fast/table/hidpi-vertical-and-horizontal-spacing.html
2159
2160         * css/CSSPropertyNames.in:
2161         * page/animation/CSSPropertyAnimation.cpp:
2162         (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
2163         * rendering/RenderTable.cpp:
2164         (WebCore::RenderTable::offsetLeftForColumn):
2165         (WebCore::RenderTable::offsetWidthForColumn):
2166         (WebCore::RenderTable::RenderTable): Deleted.
2167         * rendering/RenderTable.h:
2168         * rendering/style/RenderStyle.cpp:
2169         (WebCore::RenderStyle::horizontalBorderSpacing):
2170         (WebCore::RenderStyle::verticalBorderSpacing):
2171         (WebCore::RenderStyle::setHorizontalBorderSpacing):
2172         (WebCore::RenderStyle::setVerticalBorderSpacing):
2173         * rendering/style/RenderStyle.h:
2174         * rendering/style/StyleInheritedData.h:
2175
2176 2016-03-02  Chris Dumez  <cdumez@apple.com>
2177
2178         Have parseHTMLInteger() / parseHTMLNonNegativeInteger() use WTF::Optional
2179         https://bugs.webkit.org/show_bug.cgi?id=154845
2180
2181         Reviewed by Darin Adler.
2182
2183         Take into consideration review comments made after landing r197389.
2184
2185         * html/HTMLElement.cpp:
2186         (WebCore::HTMLElement::parseBorderWidthAttribute):
2187         (WebCore::HTMLElement::parseAttribute):
2188         * html/HTMLInputElement.cpp:
2189         * html/HTMLInputElement.h:
2190         * html/HTMLTextAreaElement.cpp:
2191         (WebCore::HTMLTextAreaElement::maxLength):
2192         * html/ImageInputType.cpp:
2193         (WebCore::ImageInputType::height):
2194         (WebCore::ImageInputType::width):
2195         * html/parser/HTMLParserIdioms.cpp:
2196         (WebCore::parseHTMLNonNegativeInteger):
2197         * html/parser/HTMLParserIdioms.h:
2198         (WebCore::limitToOnlyHTMLNonNegativeNumbersGreaterThanZero):
2199         (WebCore::limitToOnlyHTMLNonNegative):
2200         * svg/SVGElement.cpp:
2201         (WebCore::SVGElement::parseAttribute):
2202
2203 2016-03-01  Ryosuke Niwa  <rniwa@webkit.org>
2204
2205         Unreviewed. Remove the "Partial Support" status from web components since shadow DOM and custom elements
2206         are in active development.
2207
2208         * features.json:
2209
2210 2016-03-01  Ryosuke Niwa  <rniwa@webkit.org>
2211
2212         Unreviewed. Update the feature status for custom elements API.
2213
2214         * features.json:
2215
2216 2016-02-26  Ryosuke Niwa  <rniwa@webkit.org>
2217
2218         Contents inside a shadow host with a negative tabindex should not be tab focusable
2219         https://bugs.webkit.org/show_bug.cgi?id=154769
2220
2221         Reviewed by Antti Koivisto.
2222
2223         Contents inside a shadow host with a negative tabindex content attribute should not be included in
2224         the sequential focus navigation order as discussed on https://github.com/w3c/webcomponents/issues/399.
2225
2226         Test: fast/shadow-dom/negative-tabindex-on-shadow-host.html
2227
2228         * dom/Element.cpp:
2229         (WebCore::Element::tabIndexSetExplicitly): Added.
2230         * dom/Element.h:
2231         * page/FocusController.cpp:
2232         (WebCore::shadowAdjustedTabIndex): Renamed from adjustedTabIndex. Return 0 when tabindex content attribute
2233         is not explicitly set since element.tabIndex() would return -1 for HTML elements in such case.
2234         (WebCore::isFocusableOrHasShadowTreeWithoutCustomFocusLogic): Renamed from shouldVisit.
2235         (WebCore::FocusController::findElementWithExactTabIndex):
2236         (WebCore::nextElementWithGreaterTabIndex):
2237         (WebCore::previousElementWithLowerTabIndex):
2238         (WebCore::FocusController::nextFocusableElement):
2239         (WebCore::FocusController::previousFocusableElement):
2240
2241 2016-03-01  Michael Saboff  <msaboff@apple.com>
2242
2243         REGRESSION (r197426): Missed adding unicode parameter to call to Yarr::parse() in URLFilterParser::addPattern()
2244         https://bugs.webkit.org/show_bug.cgi?id=154898
2245
2246         Reviewed by Saam Barati.
2247
2248         This is a fix for the API tests after r197426.
2249
2250         Added missing bool unicode parameter of "false".
2251
2252         * contentextensions/URLFilterParser.cpp:
2253         (WebCore::ContentExtensions::URLFilterParser::addPattern):
2254
2255 2016-03-01  Myles C. Maxfield  <mmaxfield@apple.com>
2256
2257         Unreviewed build fix after r197434.
2258
2259         Unreviewed
2260
2261         * css/SourceSizeList.cpp:
2262         (WebCore::parseSizesAttribute):
2263
2264 2016-03-01  Myles C. Maxfield  <mmaxfield@apple.com>
2265
2266         Small-caps non-BMP characters are garbled in the complex text codepath
2267         https://bugs.webkit.org/show_bug.cgi?id=154875
2268
2269         Reviewed by Michael Saboff.
2270
2271         We were assuming that all characters able to be capitalized are in BMP. This is not true.
2272
2273         Test: fast/text/complex-small-caps-non-bmp-capitalize.html
2274
2275         * platform/graphics/mac/ComplexTextController.cpp:
2276         (WebCore::capitalized):
2277         (WebCore::ComplexTextController::collectComplexTextRuns):
2278
2279 2016-03-01  Myles C. Maxfield  <mmaxfield@apple.com>
2280
2281         Extend CSSFontSelector's lifetime to be longer than the Document's lifetime
2282         https://bugs.webkit.org/show_bug.cgi?id=154101
2283
2284         Reviewed by Darin Adler.
2285
2286         Rather than destroying the Document's CSSFontSelector, instead, the object should
2287         live for the lifetime of the document, and it should instead be asked to clear its
2288         contents.
2289
2290         This is important for the CSS Font Loading API, where the identity of objects the
2291         CSSFontSelector references needs to persist throughout the lifetime of the
2292         Document. This patch represents the first step to implementing this correctly.
2293         The second step is for the CSSFontSelector to perform a diff instead of a
2294         wholesale clear of its contents. Once this is done, font loading objects can
2295         survive through a call to Document::clearStyleResolver().
2296
2297         This patch gives the CSSFontSelector two states: building underway and building not
2298         underway. The state is building underway in between calls to clearStyleResolver()
2299         and when the style resolver gets built back up. Otherwise, the state is building
2300         not underway. Because of this new design, creation of all FontFace objects can be
2301         postponed until a state transition from building underway to building not underway.
2302         A subsequent patch will perform the diff at this point. An ASSERT() makes sure that
2303         we never service a font lookup request while Building.
2304
2305         No new tests because there is no behavior change.
2306
2307         * css/CSSFontFaceSet.cpp:
2308         (WebCore::CSSFontFaceSet::clear):
2309         * css/CSSFontSelector.cpp:
2310         (WebCore::CSSFontSelector::buildStarted):
2311         (WebCore::CSSFontSelector::buildCompleted):
2312         (WebCore::CSSFontSelector::addFontFaceRule):
2313         (WebCore::CSSFontSelector::fontRangesForFamily):
2314         (WebCore::CSSFontSelector::CSSFontSelector): Deleted.
2315         (WebCore::CSSFontSelector::clearDocument): Deleted.
2316         * css/CSSFontSelector.h:
2317         * css/StyleResolver.cpp:
2318         (WebCore::StyleResolver::appendAuthorStyleSheets):
2319         * dom/Document.cpp:
2320         (WebCore::Document::Document):
2321         (WebCore::Document::~Document):
2322         (WebCore::Document::clearStyleResolver):
2323         (WebCore::Document::fontSelector): Deleted.
2324         * dom/Document.h:
2325         (WebCore::Document::fontSelector):
2326
2327 2016-03-01  Alexey Proskuryakov  <ap@apple.com>
2328
2329         Update Xcode project for InstallAPI
2330         https://bugs.webkit.org/show_bug.cgi?id=154896
2331         rdar://problem/24825992
2332
2333         Patch by Daniel Dunbar, reviewed by me.
2334
2335         * Configurations/WebCore.xcconfig:
2336         * WebCore.xcodeproj/project.pbxproj:
2337
2338 2016-03-01  Ada Chan  <adachan@apple.com>
2339
2340         One more attempt to fix the build.
2341
2342         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
2343         (WebCore::MediaPlaybackTargetPickerMac::showPlaybackTargetPicker):
2344
2345 2016-03-01  Ada Chan  <adachan@apple.com>
2346
2347         Attempt to fix the internal build.
2348
2349         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
2350         (WebCore::MediaPlaybackTargetPickerMac::showPlaybackTargetPicker):
2351
2352 2016-02-29  Ada Chan  <adachan@apple.com>
2353
2354         Adopt the new version of AVOutputDeviceMenuController's showMenuForRect method.
2355         https://bugs.webkit.org/show_bug.cgi?id=154823
2356
2357         Reviewed by Tim Horton.
2358
2359         * Modules/mediasession/WebMediaSessionManager.cpp:
2360         (WebCore::WebMediaSessionManager::showPlaybackTargetPicker):
2361         (WebCore::WebMediaSessionManager::customPlaybackActionSelected):
2362         Call customPlaybackActionSelected() on the client that requested the picker.
2363         * Modules/mediasession/WebMediaSessionManager.h:
2364         * Modules/mediasession/WebMediaSessionManagerClient.h:
2365         * dom/Document.cpp:
2366         (WebCore::Document::showPlaybackTargetPicker):
2367         (WebCore::Document::customPlaybackActionSelected):
2368         * dom/Document.h:
2369         * html/HTMLMediaElement.cpp:
2370         (WebCore::HTMLMediaElement::customPlaybackActionSelected):
2371         (WebCore::HTMLMediaElement::playbackTargetPickerCustomActionName):
2372         * html/HTMLMediaElement.h:
2373         * html/MediaElementSession.cpp:
2374         (WebCore::MediaElementSession::showPlaybackTargetPicker):
2375         (WebCore::MediaElementSession::customPlaybackActionSelected):
2376         * html/MediaElementSession.h:
2377         * page/ChromeClient.h:
2378         * page/Page.cpp:
2379         (WebCore::Page::showPlaybackTargetPicker):
2380         (WebCore::Page::customPlaybackActionSelected):
2381         * page/Page.h:
2382         * platform/audio/PlatformMediaSession.h:
2383         (WebCore::PlatformMediaSessionClient::customPlaybackActionSelected):
2384         * platform/graphics/MediaPlaybackTargetClient.h:
2385         * platform/graphics/MediaPlaybackTargetPicker.cpp:
2386         (WebCore::MediaPlaybackTargetPicker::pendingActionTimerFired):
2387         (WebCore::MediaPlaybackTargetPicker::showPlaybackTargetPicker):
2388         * platform/graphics/MediaPlaybackTargetPicker.h:
2389         (WebCore::MediaPlaybackTargetPicker::Client::customPlaybackActionSelected):
2390         (WebCore::MediaPlaybackTargetPicker::customPlaybackActionSelected):
2391         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.h:
2392         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
2393         Update the forward declaration of AVOutputDeviceMenuController's showMenuForRect method.
2394         (WebCore::MediaPlaybackTargetPickerMac::showPlaybackTargetPicker):
2395         Call the new version of showMenuForRect if available.
2396         * platform/mac/WebVideoFullscreenInterfaceMac.h:
2397         * platform/mac/WebVideoFullscreenInterfaceMac.mm:
2398         (WebCore::WebVideoFullscreenInterfaceMac::setExternalPlayback):
2399         * platform/mock/MediaPlaybackTargetPickerMock.cpp:
2400         (WebCore::MediaPlaybackTargetPickerMock::showPlaybackTargetPicker):
2401         * platform/mock/MediaPlaybackTargetPickerMock.h:
2402         * platform/spi/cocoa/AVKitSPI.h:
2403         Updated with the new version of showMenuForRect.
2404
2405 2016-03-01  Daniel Bates  <dabates@apple.com>
2406
2407         com.apple.WebKit.Networking.Development crashes in WebCore::formOpen()
2408         https://bugs.webkit.org/show_bug.cgi?id=154682
2409         <rdar://problem/23550269>
2410
2411         Reviewed by Brent Fulgham.
2412
2413         Speculative fix for a race condition when opening the stream for the next form data element.
2414         Calling CFReadStreamOpen(s) in WebCore::openNextStream() can cause stream s to be closed and
2415         deallocated before CFReadStreamOpen(s) returns.
2416
2417         When WebCore::openNextStream() is called it closes and deallocates the current stream and
2418         then opens a new stream for the next form data element. Calling CFReadStreamOpen() in
2419         WebCore::openNextStream() can lead to WebCore::openNextStream() being re-entered via
2420         WebCore::formEventCallback() from another thread. One example when this can occur is when
2421         the stream being opened has no data (i.e. WebCore::formEventCallback() is called
2422         back with event type kCFStreamEventEndEncountered).
2423
2424         I have been unable to reproduce this crash. We know that it occurs from crash reports.
2425
2426         * platform/network/cf/FormDataStreamCFNet.cpp:
2427         (WebCore::closeCurrentStream): Assert that we had acquired a lock to close the stream.
2428         (WebCore::advanceCurrentStream): Assert that we had acquired a lock to advance the stream.
2429         (WebCore::openNextStream): Acquire a lock before we open the next stream to ensure that
2430         exactly one thread executes this critical section at a time.
2431         (WebCore::formFinalize): Acquire a lock before we close the current stream.
2432         (WebCore::formClose): Ditto.
2433
2434 2016-03-01  Michael Saboff  <msaboff@apple.com>
2435
2436         ASSERT in platform/graphics/mac/ComplexTextController.cpp::capitalize()
2437         https://bugs.webkit.org/show_bug.cgi?id=154875
2438
2439         Reviewed by Myles C. Maxfield.
2440
2441         Change an ASSERT to verify that uper casing a character doesn't change its size.
2442
2443         Test: fast/text/regress-154875.html
2444
2445         * platform/graphics/mac/ComplexTextController.cpp:
2446         (WebCore::capitalized):
2447
2448 2016-03-01  Gavin Barraclough  <barraclough@apple.com>
2449
2450         Timer alignment in separate web processes should not all sync up to the same point.
2451         https://bugs.webkit.org/show_bug.cgi?id=154878
2452
2453         Reviewed by Chris Dumez.
2454
2455         For any given WebContent process it is desirable that timers are synchronized to a single
2456         alignment point, but if all WebContent processes align to the same point then there may
2457         be a thundering herd of processes waking up.
2458
2459         * page/DOMTimer.cpp:
2460         (WebCore::DOMTimer::alignedFireTime):
2461             - align to a randomized point.
2462
2463 2016-03-01  Alex Christensen  <achristensen@webkit.org>
2464
2465         Reduce size of internal windows build output
2466         https://bugs.webkit.org/show_bug.cgi?id=154763
2467
2468         Reviewed by Brent Fulgham.
2469
2470         * WebCore.vcxproj/WebCore.proj:
2471
2472 2016-03-01  Andreas Kling  <akling@apple.com>
2473
2474         REGRESSION (r154616): Accelerated drawing is off during the initial load
2475         <https://webkit.org/b/123812>
2476
2477         Reviewed by Tim Horton.
2478
2479         Robustify the hey-the-Settings-changed callbacks in Page to handle document-less frames.
2480         This is needed because now Settings are changed even before the main Frame has a Document.
2481
2482         * page/Page.cpp:
2483         (WebCore::networkStateChanged):
2484         (WebCore::Page::updateStyleForAllPagesAfterGlobalChangeInEnvironment):
2485         (WebCore::Page::takeAnyMediaCanStartListener):
2486         (WebCore::Page::setMediaVolume):
2487         (WebCore::Page::setPageScaleFactor):
2488         (WebCore::Page::invalidateStylesForAllLinks):
2489         (WebCore::Page::invalidateStylesForLink):
2490         (WebCore::Page::dnsPrefetchingStateChanged):
2491         (WebCore::Page::storageBlockingStateChanged):
2492         (WebCore::Page::setMuted):
2493         (WebCore::Page::captionPreferencesChanged):
2494         (WebCore::Page::setSessionID):
2495         (WebCore::Page::setPlaybackTarget):
2496         (WebCore::Page::playbackTargetAvailabilityDidChange):
2497         (WebCore::Page::setShouldPlayToPlaybackTarget):
2498         * page/Settings.cpp:
2499         (WebCore::setImageLoadingSettings):
2500
2501 2016-03-01  Commit Queue  <commit-queue@webkit.org>
2502
2503         Unreviewed, rolling out r197056.
2504         https://bugs.webkit.org/show_bug.cgi?id=154870
2505
2506         broke win ews (Requested by alexchristensen on #webkit).
2507
2508         Reverted changeset:
2509
2510         "[cmake] Moved PRE/POST_BUILD_COMMAND to WEBKIT_FRAMEWORK."
2511         https://bugs.webkit.org/show_bug.cgi?id=154651
2512         http://trac.webkit.org/changeset/197056
2513
2514 2016-03-01  Brady Eidson  <beidson@apple.com>
2515
2516         Modern IDB: Possible crash deallocating IDBDatabaseInfo/IDBObjectStoreInfo/IDBIndexInfo.
2517         https://bugs.webkit.org/show_bug.cgi?id=154860
2518
2519         Reviewed by Alex Christensen.
2520
2521         Covered by existing tests.
2522
2523         * Modules/indexeddb/shared/IDBDatabaseInfo.cpp:
2524         (WebCore::IDBDatabaseInfo::IDBDatabaseInfo):
2525         (WebCore::IDBDatabaseInfo::isolatedCopy):
2526         * Modules/indexeddb/shared/IDBDatabaseInfo.h:
2527
2528         * Modules/indexeddb/shared/IDBTransactionInfo.cpp:
2529         (WebCore::IDBTransactionInfo::isolatedCopy): If there's an IDBDatabaseInfo to copy,  that
2530           copy needs to be isolated.
2531
2532 2016-03-01  Tim Horton  <timothy_horton@apple.com>
2533
2534         Expose MediaElement and VideoElement to the Objective-C DOM bindings
2535         https://bugs.webkit.org/show_bug.cgi?id=154830
2536
2537         Reviewed by Sam Weinig.
2538
2539         * Modules/mediasession/HTMLMediaElementMediaSession.idl:
2540         * Modules/mediastream/HTMLMediaElementMediaStream.idl:
2541         * html/HTMLMediaElement.idl:
2542         * html/HTMLVideoElement.idl:
2543         Avoid Objective-C bindings for various extraneous bits, like MediaSource and MediaSession,
2544         to avoid exposing way more than we need to.
2545
2546         * WebCore.xcodeproj/project.pbxproj:
2547         Add a bunch of Derived Sources.
2548
2549 2016-03-01  Antti Koivisto  <antti@apple.com>
2550
2551         Text control shadow element style shouldn't depend on renderers
2552         https://bugs.webkit.org/show_bug.cgi?id=154855
2553
2554         Reviewed by Andreas Kling.
2555
2556         Currently the code for computing style for text control shadow elements lives in render tree.
2557         Style is the input for building a render tree and should be computable without having one.
2558
2559         Fix by moving virtual createInnerTextStyle() from RenderTextControl hierarchy to the DOM side
2560         HTMLTextFormControlElement hierarchy.
2561
2562         * dom/Element.cpp:
2563         (WebCore::Element::didDetachRenderers):
2564         (WebCore::Element::customStyleForRenderer):
2565
2566             Also pass shadow host style as it is needed for text controls.
2567
2568         * dom/Element.h:
2569         * dom/PseudoElement.cpp:
2570         (WebCore::PseudoElement::clearHostElement):
2571         (WebCore::PseudoElement::customStyleForRenderer):
2572         * dom/PseudoElement.h:
2573         * html/HTMLInputElement.cpp:
2574         (WebCore::HTMLInputElement::setRangeText):
2575         (WebCore::HTMLInputElement::createInnerTextStyle):
2576         (WebCore::HTMLInputElement::setupDateTimeChooserParameters):
2577         * html/HTMLInputElement.h:
2578         * html/HTMLTextAreaElement.cpp:
2579         (WebCore::HTMLTextAreaElement::willRespondToMouseClickEvents):
2580         (WebCore::HTMLTextAreaElement::createInnerTextStyle):
2581         * html/HTMLTextAreaElement.h:
2582         * html/HTMLTextFormControlElement.cpp:
2583         (WebCore::HTMLTextFormControlElement::directionForFormData):
2584         (WebCore::HTMLTextFormControlElement::adjustInnerTextStyle):
2585         * html/HTMLTextFormControlElement.h:
2586         (WebCore::HTMLTextFormControlElement::cachedSelectionDirection):
2587         * html/shadow/TextControlInnerElements.cpp:
2588         (WebCore::TextControlInnerElement::create):
2589         (WebCore::TextControlInnerElement::customStyleForRenderer):
2590         (WebCore::TextControlInnerTextElement::renderer):
2591         (WebCore::TextControlInnerTextElement::customStyleForRenderer):
2592         * html/shadow/TextControlInnerElements.h:
2593         * rendering/RenderTextControl.cpp:
2594         (WebCore::RenderTextControl::styleDidChange):
2595         (WebCore::RenderTextControl::textBlockLogicalHeight):
2596         (WebCore::RenderTextControl::adjustInnerTextStyle): Deleted.
2597         * rendering/RenderTextControl.h:
2598         * rendering/RenderTextControlMultiLine.cpp:
2599         (WebCore::RenderTextControlMultiLine::baselinePosition):
2600         (WebCore::RenderTextControlMultiLine::layoutSpecialExcludedChild):
2601         (WebCore::RenderTextControlMultiLine::createInnerTextStyle): Deleted.
2602
2603             createInnerTextStyle moves to HTMLTextAreaElement::createInnerTextStyle
2604
2605         * rendering/RenderTextControlMultiLine.h:
2606         * rendering/RenderTextControlSingleLine.cpp:
2607         (WebCore::RenderTextControlSingleLine::RenderTextControlSingleLine):
2608
2609             Remove m_desiredInnerTextLogicalHeight cache. It doesn't work, it is never valid when hit.
2610
2611         (WebCore::RenderTextControlSingleLine::layout):
2612         (WebCore::RenderTextControlSingleLine::styleDidChange):
2613         (WebCore::RenderTextControlSingleLine::computeControlLogicalHeight):
2614         (WebCore::RenderTextControlSingleLine::textShouldBeTruncated):
2615         (WebCore::RenderTextControlSingleLine::createInnerTextStyle): Deleted.
2616         (WebCore::RenderTextControlSingleLine::createInnerBlockStyle): Deleted.
2617
2618             - createInnerTextStyle moves to HTMLInputElement::createInnerTextStyle
2619             - createInnerBlockStyle moves to TextControlInnerElement::customStyleForRenderer
2620
2621         * rendering/RenderTextControlSingleLine.h:
2622         (WebCore::RenderTextControlSingleLine::centerContainerIfNeeded):
2623         (WebCore::RenderTextControlSingleLine::containerElement):
2624         * style/StyleTreeResolver.cpp:
2625         (WebCore::Style::TreeResolver::styleForElement):
2626         * svg/SVGElement.cpp:
2627         (WebCore::SVGElement::synchronizeSystemLanguage):
2628         (WebCore::SVGElement::customStyleForRenderer):
2629         * svg/SVGElement.h:
2630
2631 2016-03-01  Manuel Rego Casasnovas  <rego@igalia.com>
2632
2633         [css-grid] Get rid of GridResolvedPosition
2634         https://bugs.webkit.org/show_bug.cgi?id=154818
2635
2636         Reviewed by Darin Adler.
2637
2638         GridResolvedPosition was a small class just wrapping a unsigned.
2639         In the future it should actually wrap an integer,
2640         as we want to support implicit tracks before the explicit grid.
2641
2642         The class itself is not providing any benefit,
2643         so we can get rid of it and store directly 2 unsigned in GridSpan.
2644
2645         This will make simpler future changes related to this task.
2646
2647         We keep the class just as a utility for the methods
2648         that deal with the positions resolution.
2649         But it should be renamed in a follow-up patch.
2650
2651         No new tests, no change of behavior.
2652
2653         * css/CSSGridTemplateAreasValue.cpp:
2654         (WebCore::stringForPosition):
2655         * css/CSSParser.cpp:
2656         (WebCore::CSSParser::parseGridTemplateAreasRow):
2657         * css/StyleBuilderConverter.h:
2658         (WebCore::StyleBuilderConverter::createImplicitNamedGridLinesFromGridArea):
2659         * rendering/RenderGrid.cpp:
2660         (WebCore::RenderGrid::computeUsedBreadthOfGridTracks):
2661         (WebCore::RenderGrid::findFlexFactorUnitSize):
2662         (WebCore::RenderGrid::spanningItemCrossesFlexibleSizedTracks):
2663         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForNonSpanningItems):
2664         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForItems):
2665         (WebCore::RenderGrid::insertItemIntoGrid):
2666         (WebCore::RenderGrid::populateExplicitGridAndOrderIterator):
2667         (WebCore::RenderGrid::createEmptyGridAreaAtSpecifiedPositionsOutsideGrid):
2668         (WebCore::RenderGrid::placeSpecifiedMajorAxisItemsOnGrid):
2669         (WebCore::RenderGrid::placeAutoMajorAxisItemOnGrid):
2670         (WebCore::RenderGrid::offsetAndBreadthForPositionedChild):
2671         (WebCore::RenderGrid::gridAreaBreadthForChild):
2672         (WebCore::RenderGrid::gridAreaBreadthForChildIncludingAlignmentOffsets):
2673         (WebCore::RenderGrid::columnAxisOffsetForChild):
2674         (WebCore::RenderGrid::rowAxisOffsetForChild):
2675         * rendering/style/GridCoordinate.h:
2676         (WebCore::GridSpan::definiteGridSpan):
2677         (WebCore::GridSpan::integerSpan):
2678         (WebCore::GridSpan::resolvedInitialPosition):
2679         (WebCore::GridSpan::resolvedFinalPosition):
2680         (WebCore::GridSpan::GridSpanIterator::GridSpanIterator):
2681         (WebCore::GridSpan::GridSpanIterator::operator*):
2682         (WebCore::GridSpan::GridSpanIterator::operator++):
2683         (WebCore::GridSpan::GridSpanIterator::operator!=):
2684         (WebCore::GridSpan::begin):
2685         (WebCore::GridSpan::end):
2686         (WebCore::GridSpan::GridSpan):
2687         * rendering/style/GridResolvedPosition.cpp:
2688         (WebCore::resolveNamedGridLinePositionFromStyle):
2689         (WebCore::resolveRowStartColumnStartNamedGridLinePositionAgainstOppositePosition):
2690         (WebCore::resolveRowEndColumnEndNamedGridLinePositionAgainstOppositePosition):
2691         (WebCore::resolveNamedGridLinePositionAgainstOppositePosition):
2692         (WebCore::resolveGridPositionAgainstOppositePosition):
2693         (WebCore::GridResolvedPosition::resolveGridPositionsFromAutoPlacementPosition):
2694         (WebCore::resolveGridPositionFromStyle):
2695         (WebCore::GridResolvedPosition::resolveGridPositionsFromStyle):
2696         * rendering/style/GridResolvedPosition.h:
2697         (WebCore::GridResolvedPosition::GridResolvedPosition): Deleted.
2698         (WebCore::GridResolvedPosition::operator*): Deleted.
2699         (WebCore::GridResolvedPosition::operator++): Deleted.
2700         (WebCore::GridResolvedPosition::operator==): Deleted.
2701         (WebCore::GridResolvedPosition::operator!=): Deleted.
2702         (WebCore::GridResolvedPosition::operator<): Deleted.
2703         (WebCore::GridResolvedPosition::operator>): Deleted.
2704         (WebCore::GridResolvedPosition::operator<=): Deleted.
2705         (WebCore::GridResolvedPosition::operator>=): Deleted.
2706         (WebCore::GridResolvedPosition::toInt): Deleted.
2707         (WebCore::GridResolvedPosition::next): Deleted.
2708         (WebCore::GridResolvedPosition::prev): Deleted.
2709
2710 2016-03-01  Andreas Kling  <akling@apple.com>
2711
2712         MemoryCache::forEachResource() should guard resources across function invocation.
2713         <https://webkit.org/b/154846>
2714
2715         Reviewed by Antti Koivisto.
2716
2717         It occurred to me that we should protect the CachedResources from being
2718         deleted while invoking the custom function here, lest we create a giant footgun.
2719
2720         * loader/cache/MemoryCache.cpp:
2721         (WebCore::MemoryCache::forEachResource):
2722
2723 2016-03-01  Csaba Osztrogonác  <ossy@webkit.org>
2724
2725         [Mac][cmake] One more unreviewed speculative buildfix after r197375. Just for fun.
2726
2727         * PlatformMac.cmake:
2728
2729 2016-03-01  Csaba Osztrogonác  <ossy@webkit.org>
2730
2731         [Mac][cmake] Unreviewed speculative buildfix after r197375. Just for fun.
2732
2733         * PlatformMac.cmake:
2734
2735 2016-03-01  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2736
2737         [Fetch API] Support Request and Response blob() when body data is a blob
2738         https://bugs.webkit.org/show_bug.cgi?id=154820
2739
2740         Reviewed by Darin Adler.
2741
2742         Adding support for returning the same Blob that is stored in Body in case JS blob() is called.
2743         Adding support for Blob creation when data is stored as text.
2744         Updated JSDOMBinding and JSDOMPromise to return a JS ArrayBuffer for Vector<char> as well as Vector<unsigned char>.
2745
2746         Covered by added tests.
2747
2748         * Modules/fetch/FetchBody.cpp:
2749         (WebCore::FetchBody::arrayBuffer):
2750         (WebCore::FetchBody::blob):
2751         (WebCore::FetchBody::extractFromText):
2752         * Modules/fetch/FetchBody.h:
2753         * bindings/js/JSDOMBinding.h:
2754         (WebCore::toJS):
2755         * bindings/js/JSDOMPromise.h:
2756         (WebCore::DeferredWrapper::resolve): Deleted.
2757
2758 2016-02-29  Chris Dumez  <cdumez@apple.com>
2759
2760         Have parseHTMLInteger() / parseHTMLNonNegativeInteger() use WTF::Optional
2761         https://bugs.webkit.org/show_bug.cgi?id=154845
2762
2763         Reviewed by Ryosuke Niwa.
2764
2765         Have parseHTMLInteger() / parseHTMLNonNegativeInteger() use
2766         WTF::Optional.
2767
2768         * dom/Element.cpp:
2769         (WebCore::Element::getIntegralAttribute):
2770         (WebCore::Element::getUnsignedIntegralAttribute):
2771         (WebCore::Element::setUnsignedIntegralAttribute): Deleted.
2772         * html/HTMLElement.cpp:
2773         (WebCore::HTMLElement::parseBorderWidthAttribute):
2774         (WebCore::HTMLElement::parseAttribute):
2775         * html/HTMLInputElement.cpp:
2776         (WebCore::HTMLInputElement::parseMaxLengthAttribute):
2777         * html/HTMLInputElement.h:
2778         * html/HTMLOListElement.cpp:
2779         (WebCore::HTMLOListElement::parseAttribute):
2780         * html/HTMLTextAreaElement.cpp:
2781         (WebCore::HTMLTextAreaElement::maxLength):
2782         * html/ImageInputType.cpp:
2783         (WebCore::ImageInputType::height):
2784         (WebCore::ImageInputType::width):
2785         * html/parser/HTMLParserIdioms.cpp:
2786         (WebCore::parseHTMLIntegerInternal):
2787         (WebCore::parseHTMLInteger):
2788         (WebCore::parseHTMLNonNegativeInteger):
2789         * html/parser/HTMLParserIdioms.h:
2790         (WebCore::limitToOnlyHTMLNonNegativeNumbersGreaterThanZero):
2791         (WebCore::limitToOnlyHTMLNonNegative):
2792         * svg/SVGElement.cpp:
2793         (WebCore::SVGElement::parseAttribute):
2794
2795 2016-02-29  Zan Dobersek  <zdobersek@igalia.com>
2796
2797         TextureMapperGL: simplify TransformationMatrix copies in draw(), beginClip()
2798         https://bugs.webkit.org/show_bug.cgi?id=154791
2799
2800         Reviewed by Carlos Garcia Campos.
2801
2802         In both functions, the passed-in model-view matrix is first copied, multiplied
2803         against a rect-to-rect TransformationMatrix, and then assigned into a local
2804         TransformationMatrix variable, which causes another copy due to the multiply()
2805         function returning a reference to the modified object.
2806
2807         To avoid the last copy, first copy the model-view matrix into a local variable,
2808         and multiply the rect-to-rect TransformationMatrix into the new object afterwards.
2809
2810         * platform/graphics/texmap/TextureMapperGL.cpp:
2811         (WebCore::TextureMapperGL::draw):
2812         (WebCore::TextureMapperGL::beginClip):
2813
2814 2016-02-29  Zan Dobersek  <zdobersek@igalia.com>
2815
2816         ImageBufferCairo should support OpenGL ES 2 configurations
2817         https://bugs.webkit.org/show_bug.cgi?id=154790
2818
2819         Reviewed by Carlos Garcia Campos.
2820
2821         When building with OpenGL ES 2 and with accelerated 2D canvas support,
2822         the GLES2 header should be included instead of the OpenGLShims.h header.
2823
2824         The glTexParameterf() calls targeting GL_TEXTURE_WRAP_S and
2825         GL_TEXTURE_WRAP_T parameters should use the GL_CLAMP_TO_EDGE value.
2826         GL_CLAMP isn't available in OpenGL ES 2 and was dropped in OpenGL 3.
2827
2828         * platform/graphics/cairo/ImageBufferCairo.cpp:
2829         (WebCore::ImageBufferData::createCairoGLSurface):
2830
2831 2016-02-29  Zan Dobersek  <zdobersek@igalia.com>
2832
2833         TextureMapperGL: beginPainting() should handle the PaintingMirrored value in PaintFlags
2834         https://bugs.webkit.org/show_bug.cgi?id=154789
2835
2836         Reviewed by Carlos Garcia Campos.
2837
2838         * platform/graphics/texmap/TextureMapperGL.cpp:
2839         (WebCore::TextureMapperGL::beginPainting): The ClipStack should be reset with
2840         a Y-axis mode that corresponds to the presence of the PaintingMirrored value in
2841         the passed-in PaintFlags argument. If present, the default Y-axis mode should be
2842         used, and the inverted Y-axis otherwise.
2843
2844 2016-02-29  Zan Dobersek  <zdobersek@igalia.com>
2845
2846         CoordinatedGraphicsLayer should override the inherited TextureMapperPlatformLayer::Client methods
2847         https://bugs.webkit.org/show_bug.cgi?id=154788
2848
2849         Reviewed by Carlos Garcia Campos.
2850
2851         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
2852         Add the override specifiers for the two methods that are inherited
2853         from the TextureMapperPlatformLayer::Client interface.
2854
2855 2016-02-29  Simon Fraser  <simon.fraser@apple.com>
2856
2857         Remove the experimental feature of antialiased font dilation
2858         https://bugs.webkit.org/show_bug.cgi?id=154843
2859
2860         Reviewed by Zalan Bujtas.
2861         
2862         Remove the "antialiased font dilation" code path, and related prefs.
2863
2864         * page/Settings.cpp:
2865         (WebCore::Settings::Settings): Deleted.
2866         (WebCore::Settings::setAntialiasedFontDilationEnabled): Deleted.
2867         * page/Settings.h:
2868         (WebCore::Settings::antialiasedFontDilationEnabled): Deleted.
2869         * platform/graphics/FontCascade.cpp:
2870         (WebCore::FontCascade::setAntialiasedFontDilationEnabled): Deleted.
2871         (WebCore::FontCascade::antialiasedFontDilationEnabled): Deleted.
2872         * platform/graphics/FontCascade.h:
2873         * platform/graphics/GraphicsContext.cpp:
2874         (WebCore::GraphicsContextStateChange::changesFromState): Deleted.
2875         (WebCore::GraphicsContextStateChange::accumulate): Deleted.
2876         (WebCore::GraphicsContextStateChange::apply): Deleted.
2877         (WebCore::GraphicsContextStateChange::dump): Deleted.
2878         (WebCore::GraphicsContext::setAntialiasedFontDilationEnabled): Deleted.
2879         * platform/graphics/GraphicsContext.h:
2880         (WebCore::GraphicsContextState::GraphicsContextState): Deleted.
2881         (WebCore::GraphicsContext::antialiasedFontDilationEnabled): Deleted.
2882         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
2883         (PlatformCALayer::drawLayerContents): Deleted.
2884         * platform/graphics/cocoa/FontCascadeCocoa.mm:
2885         (WebCore::dilationSizeForTextColor): Deleted.
2886         (WebCore::FontCascade::drawGlyphs): Deleted.
2887         * platform/graphics/displaylists/DisplayList.cpp:
2888         (WebCore::DisplayList::DisplayList::shouldDumpForFlags): Deleted.
2889
2890 2016-02-29  Jer Noble  <jer.noble@apple.com>
2891
2892         Refactor CoreVideo API access into their own classes so code can be re-used.
2893         https://bugs.webkit.org/show_bug.cgi?id=154544
2894
2895         Reviewed by Eric Carlson.
2896
2897         In order for common CoreVideo code paths to be re-used in other classes, pull those paths
2898         out of MediaPlayerPrivateAVFoundationObjC and into re-usable clasess.
2899
2900         * WebCore.xcodeproj/project.pbxproj:
2901         * platform/cf/CoreMediaSoftLink.cpp:
2902         * platform/cf/CoreMediaSoftLink.h:
2903         * platform/cocoa/CoreVideoSoftLink.cpp: Added.
2904         * platform/cocoa/CoreVideoSoftLink.h: Added.
2905         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
2906         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2907         (WebCore::MediaPlayerPrivateAVFoundationObjC::createPixelBuffer):
2908         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateLastImage):
2909         (WebCore::MediaPlayerPrivateAVFoundationObjC::copyVideoTextureToPlatformTexture):
2910         (WebCore::CVPixelBufferGetBytePointerCallback): Deleted.
2911         (WebCore::CVPixelBufferReleaseBytePointerCallback): Deleted.
2912         (WebCore::CVPixelBufferReleaseInfoCallback): Deleted.
2913         (WebCore::createImageFromPixelBuffer): Deleted.
2914         (WebCore::enumToStringMap): Deleted.
2915         * platform/graphics/cv/PixelBufferConformerCV.cpp: Added.
2916         (WebCore::PixelBufferConformerCV::PixelBufferConformerCV):
2917         (WebCore::CVPixelBufferGetBytePointerCallback):
2918         (WebCore::CVPixelBufferReleaseBytePointerCallback):
2919         (WebCore::CVPixelBufferReleaseInfoCallback):
2920         (WebCore::PixelBufferConformerCV::createImageFromPixelBuffer):
2921         * platform/graphics/cv/PixelBufferConformerCV.h: Added.
2922         * platform/graphics/cv/TextureCacheCV.h: Added.
2923         (WebCore::TextureCacheCV::context):
2924         * platform/graphics/cv/TextureCacheCV.mm: Added.
2925         (WebCore::TextureCacheCV::create):
2926         (WebCore::TextureCacheCV::TextureCacheCV):
2927         (WebCore::TextureCacheCV::textureFromImage):
2928         * platform/graphics/cv/VideoTextureCopierCV.cpp: Added.
2929         (WebCore::VideoTextureCopierCV::VideoTextureCopierCV):
2930         (WebCore::VideoTextureCopierCV::~VideoTextureCopierCV):
2931         (WebCore::enumToStringMap):
2932         (WebCore::VideoTextureCopierCV::copyVideoTextureToPlatformTexture):
2933         * platform/graphics/cv/VideoTextureCopierCV.h: Added.
2934         (WebCore::VideoTextureCopierCV::context):
2935         * platform/mediastream/mac/AVVideoCaptureSource.mm: Move SOFT_LINK declarations into CoreVideoSoftLink.h/cpp.
2936
2937 2016-02-29  Chris Dumez  <cdumez@apple.com>
2938
2939         Use WTF::Optional for HTMLOListElement::m_start
2940         https://bugs.webkit.org/show_bug.cgi?id=154824
2941
2942         Reviewed by Andreas Kling.
2943
2944         Use WTF::Optional for HTMLOListElement::m_start.
2945
2946         * html/HTMLOListElement.cpp:
2947         (WebCore::HTMLOListElement::parseAttribute):
2948         * html/HTMLOListElement.h:
2949
2950 2016-02-29  Gavin Barraclough  <barraclough@apple.com>
2951
2952         RefCounter<T>::Event -> RefCounterEvent
2953         https://bugs.webkit.org/show_bug.cgi?id=154767
2954
2955         Reviewed by Darin Adler.
2956
2957         RefCounter<T>::Event is kinda verbose to use, and there is no need for this
2958         to be specific to a particular typeof RefCounter. Move the enum class up to
2959         the top level & rename to RefCounterEvent.
2960
2961         * page/PageThrottler.cpp:
2962         (WebCore::PageThrottler::PageThrottler):
2963         (WebCore::m_audiblePluginHysteresis):
2964         (WebCore::m_mediaActivityCounter):
2965         (WebCore::m_pageLoadActivityCounter):
2966         * platform/VNodeTracker.cpp:
2967         (WebCore::VNodeTracker::singleton):
2968         (WebCore::VNodeTracker::VNodeTracker):
2969         (WebCore::m_lastWarningTime):
2970
2971 2016-02-29  Chris Dumez  <cdumez@apple.com>
2972
2973         Use HTML parsing rules for textarea.maxLength
2974         https://bugs.webkit.org/show_bug.cgi?id=154805
2975
2976         Reviewed by Andreas Kling.
2977
2978         Use HTML parsing rules for textarea.maxLength:
2979         - https://html.spec.whatwg.org/multipage/forms.html#dom-textarea-maxlength
2980         - https://html.spec.whatwg.org/multipage/infrastructure.html#limited-to-only-non-negative-numbers
2981
2982         No new tests, already covered by existing test.
2983
2984         * html/HTMLTextAreaElement.cpp:
2985         (WebCore::HTMLTextAreaElement::maxLength):
2986
2987 2016-02-29  Chris Dumez  <cdumez@apple.com>
2988
2989         Align td.rowSpan / td.colSpan with the specification
2990         https://bugs.webkit.org/show_bug.cgi?id=154803
2991
2992         Reviewed by Darin Adler.
2993
2994         Align td.rowSpan / td.colSpan with the specification:
2995         - https://html.spec.whatwg.org/multipage/tables.html#htmltablecellelement
2996         - https://html.spec.whatwg.org/multipage/tables.html#dom-tdth-colspan
2997         - https://html.spec.whatwg.org/multipage/tables.html#dom-tdth-rowspan
2998
2999         In particular, the following changes were made:
3000         - Change type from 'long' to 'unsigned long'.
3001         - Use HTML rules for parsing unsigned integers:
3002           - https://html.spec.whatwg.org/multipage/infrastructure.html#rules-for-parsing-non-negative-integers
3003         - Use 1 as default value when the input value is out of range instead
3004           of 0 when setting.
3005         - rowspan is still clamped to [1, 8190] internally but we now expose the
3006           unclamped value to JS as this is an internal restriction. The same is
3007           done for a colSpan value of 0, we expose 0 to the Web but clamp to 1
3008           internally.
3009
3010         No new tests, already covered by existing test.
3011
3012         * html/HTMLTableCellElement.cpp:
3013         (WebCore::HTMLTableCellElement::colSpan):
3014         (WebCore::HTMLTableCellElement::rowSpan):
3015         (WebCore::HTMLTableCellElement::rowSpanForBindings):
3016         (WebCore::HTMLTableCellElement::setColSpan):
3017         (WebCore::HTMLTableCellElement::setRowSpanForBindings):
3018         (WebCore::HTMLTableCellElement::axis): Deleted.
3019         (WebCore::HTMLTableCellElement::headers): Deleted.
3020         * html/HTMLTableCellElement.h:
3021         * html/HTMLTableCellElement.idl:
3022
3023 2016-02-29  Chris Dumez  <cdumez@apple.com>
3024
3025         [Web IDL] Add support for [TreatNullAs=EmptyString] and use it
3026         https://bugs.webkit.org/show_bug.cgi?id=154654
3027
3028         Reviewed by Darin Adler.
3029
3030         Add support for [TreatNullAs=EmptyString] standard Web IDL extended
3031         attribute:
3032         - http://heycam.github.io/webidl/#TreatNullAs
3033
3034         This replaces the WebKit-specific [TreatNullAs=NullString] IDL
3035         extended attribute. Instead of passing a null String() to the
3036         implementation, emptyString() is passed.
3037
3038         This patch does not cause any web-exposed behavior change. For
3039         case where switching from NullString to EmptyString would change
3040         the behavior (or require changes to the implementation), the old
3041         IDL attribute was kept. However, it was renamed to
3042         [TreatNullAs=LegacyNullString] to discourage its use in new code.
3043         Eventually, this legacy IDL attribute should go away entirely.
3044
3045         [TreatNullAs=EmptyString] should only be used when it is present
3046         in the corresponding specification. Note that there are a lot of
3047         places where we use [TreatNullAs=EmptyString] in our IDL where it
3048         does not match the specification. I have added FIXME comments for
3049         those so we can clean them up later.
3050
3051         No new tests, no web-exposed behavior change.
3052
3053         * Modules/mediastream/RTCPeerConnection.idl:
3054         No behavior change because this is not implemented.
3055
3056         * bindings/js/JSDOMBinding.cpp:
3057         (WebCore::valueToStringTreatingNullAsEmptyString):
3058         * bindings/js/JSDOMBinding.h:
3059         Add new function to convert a JSValue into a String while treating
3060         null as the empty string.
3061
3062         * bindings/scripts/CodeGeneratorJS.pm:
3063         (JSValueToNative):
3064         * bindings/scripts/IDLAttributes.txt:
3065         - Add support for [TreatNullAs=EmptyString].
3066         - Rename NullString to LegacyNullString to discourage its use.
3067
3068         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
3069         * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
3070         * bindings/scripts/test/JS/JSTestObj.cpp:
3071         * bindings/scripts/test/ObjC/DOMTestObj.h:
3072         * bindings/scripts/test/ObjC/DOMTestObj.mm:
3073         * bindings/scripts/test/TestObj.idl:
3074         Add bindings tests coverage for [TreatNullAs=EmptyString].
3075
3076         * css/CSSStyleDeclaration.idl:
3077         * dom/CharacterData.idl:
3078         * dom/DOMImplementation.idl:
3079         * dom/Document.idl:
3080         * dom/Element.idl:
3081         * dom/ShadowRoot.idl:
3082         * html/HTMLOutputElement.idl:
3083         * html/HTMLScriptElement.idl:
3084         * html/URLUtils.idl:
3085         * svg/SVGAngle.idl:
3086         * svg/SVGLength.idl:
3087         Use [TreatNullAs=EmptyString] instead of [TreatNullAs=NullString].
3088         There is not behavior change because the implementation does
3089         not distinguish the null string from the empty string.
3090
3091         * html/HTMLBaseElement.idl:
3092         * html/HTMLButtonElement.idl:
3093         * html/HTMLFormElement.idl:
3094         * html/HTMLMediaElement.idl:
3095         * html/HTMLSelectElement.idl:
3096         * svg/SVGElement.idl:
3097         * svg/SVGScriptElement.idl:
3098         Rename [TreatNullAs=NullString] to [TreatNullAs=LegacyNullString],
3099         no behavior change.
3100
3101         * html/HTMLDocument.idl:
3102         - dir and *Color: Rename [TreatNullAs=NullString] to
3103           [TreatNullAs=LegacyNullString].
3104         - designMode: Drop [TreatNullAs=NullString] as per the specification:
3105           - https://html.spec.whatwg.org/multipage/dom.html#the-document-object
3106           null now gets converted to "null" instead of the null String but this
3107           does not change behavior because the implementation only recognizes
3108           "on" / "off" / others. So we still end up using inherit mode when
3109           set to null.
3110
3111         * html/HTMLElement.idl:
3112         - Use [TreatNullAs=EmptyString] instead of [TreatNullAs=NullString] for
3113           innerText / outerText. Does not change behavior because the
3114           implementation does not distinguishes.
3115         - Drop [TreatNullAs=NullString] from contentEditable to match the spec:
3116           - https://html.spec.whatwg.org/multipage/interaction.html#elementcontenteditable
3117           This does not change behavior because the implementation will the a SyntaxError
3118           wether a null String or the string "null" is passed.
3119
3120         * html/HTMLFrameElement.idl:
3121         Drop [TreatNullAs=NullString] from location attribute. This does not
3122         change behavior because the attribute is using a custom setter.
3123
3124         * html/HTMLInputElement.idl:
3125         - formEnctype / formMethod / autocapitalize: Rename [TreatNullAs=NullString] to
3126           [TreatNullAs=LegacyNullString].
3127         - value: Rename [TreatNullAs=NullString] to Rename [TreatNullAs=EmptyString], which
3128           does not change behavior because the implementation does not distinguish. Also
3129           drop the extended attribute for non-JS bindings as it has no impact.
3130
3131         * html/HTMLMediaElement.cpp:
3132         (WebCore::HTMLMediaElement::setMediaGroup):
3133         Drop redundant group.isNull() check as group.isEmpty() already checks for null.
3134
3135         * html/HTMLScriptElement.cpp:
3136         (WebCore::HTMLScriptElement::setText):
3137         Drop useless .impl() call as we have a String and the method requires a String
3138         as input.
3139
3140         * html/HTMLTextAreaElement.cpp:
3141         (WebCore::HTMLTextAreaElement::setValueCommon):
3142         Use emptyString() instead of "" as it is slightly more efficient.
3143
3144         * html/HTMLTextAreaElement.idl:
3145         - value: Use [TreatNullAs=EmptyString] instead of [TreatNullAs=NullString]. No
3146           behavior change because the implementation does not distinguish.
3147         - autocapitalize: Rename [TreatNullAs=NullString] to [TreatNullAs=LegacyNullString].
3148
3149         * html/canvas/CanvasRenderingContext2D.idl:
3150         - globalCompositeOperation / repetitionType: Use [TreatNullAs=EmptyString] instead of
3151           [TreatNullAs=NullString]. No behavior change because the implementation does not
3152           distinguish.
3153         - lineCap / lineJoin: Drop the [TreatNullAs=NullString] to match the spec:
3154           - https://html.spec.whatwg.org/multipage/scripting.html#canvaspathdrawingstyles
3155           There is no behavior change because those are string enumerations and the value
3156           is not recognized either way (String() or String("null")).
3157         - shadowColor: Drop the [TreatNullAs=NullString] to match the spec:
3158           - https://html.spec.whatwg.org/multipage/scripting.html#canvasshadowstyles
3159           No behavior change because this is not a valid color either way.
3160
3161 2016-02-29  Youenn Fablet  <youenn.fablet@crf.canon.fr>
3162
3163         Refactor FetchBody constructors
3164         https://bugs.webkit.org/show_bug.cgi?id=154721
3165
3166         Reviewed by Sam Weinig and Darin Adler.
3167
3168         Covered by existing tests.
3169
3170         * Modules/fetch/FetchBody.cpp:
3171         (WebCore::FetchBody::extract): Renamed from "fromJSValue"
3172         (WebCore::FetchBody::extractFromBody): Renamed from "fromRequestBody" and making use of move constructor.
3173         * Modules/fetch/FetchBody.h:
3174         (WebCore::FetchBody::FetchBody): Making default constructor public and removing empty static method.
3175         * Modules/fetch/FetchRequest.cpp:
3176         (WebCore::buildBody):
3177         * Modules/fetch/FetchResponse.cpp:
3178         (WebCore::FetchResponse::error):
3179         (WebCore::FetchResponse::redirect):
3180         (WebCore::FetchResponse::initializeWith):
3181         * Modules/fetch/FetchResponse.h:
3182         (WebCore::FetchResponse::create):
3183
3184 2016-02-28  Antti Koivisto  <antti@apple.com>
3185
3186         ::slotted doesn't work in nested shadow trees
3187         https://bugs.webkit.org/show_bug.cgi?id=154765
3188         <rdar://problem/24870995>
3189
3190         Reviewed by Ryosuke Niwa.
3191
3192         See https://github.com/w3c/webcomponents/issues/331#issuecomment-189191593
3193
3194         Test: fast/shadow-dom/css-scoping-shadow-slotted-nested.html
3195
3196         * css/ElementRuleCollector.cpp:
3197         (WebCore::ElementRuleCollector::matchSlottedPseudoElementRules):
3198
3199         Collect ::slotted rules from all the nested shadow trees instead of just the host's.
3200
3201 2016-02-28  Chris Dumez  <cdumez@apple.com>
3202
3203         Parse HTMLOLElement.start as per the HTML spec
3204         https://bugs.webkit.org/show_bug.cgi?id=154802
3205
3206         Reviewed by Andreas Kling.
3207
3208         Parse HTMLOLElement.start as per the HTML spec:
3209         - https://html.spec.whatwg.org/multipage/semantics.html#dom-ol-start
3210         - https://html.spec.whatwg.org/multipage/infrastructure.html#rules-for-parsing-integers
3211
3212         No new tests, already covered by existing test.
3213
3214         * html/HTMLOListElement.cpp:
3215         (WebCore::HTMLOListElement::parseAttribute):
3216
3217 2016-02-28  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
3218
3219         Reduce uses of PassRefPtr in indexeddb
3220         https://bugs.webkit.org/show_bug.cgi?id=154273
3221
3222         Reviewed by Darin Adler.
3223
3224         No new tests, no behavior changes.
3225
3226         * Modules/indexeddb/IDBDatabaseError.h:
3227         (WebCore::IDBDatabaseError::create):
3228         * Modules/indexeddb/IDBKeyData.cpp:
3229         (WebCore::IDBKeyData::maybeCreateIDBKey):
3230         * Modules/indexeddb/IDBKeyData.h:
3231         * Modules/indexeddb/IDBKeyRange.cpp:
3232         (WebCore::IDBKeyRange::create):
3233         (WebCore::IDBKeyRange::IDBKeyRange):
3234         (WebCore::IDBKeyRange::only):
3235         (WebCore::IDBKeyRange::lowerBound):
3236         (WebCore::IDBKeyRange::upperBound):
3237         (WebCore::IDBKeyRange::bound):
3238         * Modules/indexeddb/IDBKeyRange.h:
3239         (WebCore::IDBKeyRange::create):
3240         (WebCore::IDBKeyRange::lower):
3241         (WebCore::IDBKeyRange::upper):
3242         (WebCore::IDBKeyRange::lowerBound):
3243         (WebCore::IDBKeyRange::upperBound):
3244         (WebCore::IDBKeyRange::bound):
3245         * Modules/indexeddb/IDBKeyRangeData.cpp:
3246         (WebCore::IDBKeyRangeData::maybeCreateIDBKeyRange):
3247         * Modules/indexeddb/IDBKeyRangeData.h:
3248         * Modules/indexeddb/IDBServerConnection.h:
3249         * Modules/indexeddb/legacy/IDBCallbacks.h:
3250         * Modules/indexeddb/legacy/IDBCursorBackend.cpp:
3251         (WebCore::IDBCursorBackend::continueFunction):
3252         * Modules/indexeddb/legacy/IDBCursorBackend.h:
3253         * Modules/indexeddb/legacy/IDBCursorBackendOperations.h:
3254         (WebCore::CursorIterationOperation::create):
3255         (WebCore::CursorIterationOperation::CursorIterationOperation):
3256         * Modules/indexeddb/legacy/IDBTransactionBackendOperations.cpp:
3257         (WebCore::GetOperation::perform):
3258         (WebCore::PutOperation::perform):
3259         * Modules/indexeddb/legacy/LegacyCursor.cpp:
3260         (WebCore::LegacyCursor::continueFunction):
3261         * Modules/indexeddb/legacy/LegacyCursor.h:
3262         * Modules/indexeddb/legacy/LegacyFactory.h:
3263         (WebCore::LegacyFactory::create):
3264         * Modules/indexeddb/legacy/LegacyRequest.cpp:
3265         (WebCore::LegacyRequest::onSuccess):
3266         * Modules/indexeddb/legacy/LegacyRequest.h:
3267         * inspector/InspectorIndexedDBAgent.cpp:
3268
3269 2016-02-28  Tim Horton  <timothy_horton@apple.com>
3270
3271         Switch to application/vnd.apple.folder for <attachment> folder special-case
3272         https://bugs.webkit.org/show_bug.cgi?id=154786
3273         <rdar://problem/24416632>
3274
3275         Reviewed by Anders Carlsson.
3276
3277         No new tests, adjusted an existing test to cover this.
3278
3279         * rendering/RenderThemeMac.mm:
3280         (WebCore::iconForAttachment):
3281         Add a second folder MIME type.
3282
3283 2016-02-28  Tim Horton  <timothy_horton@apple.com>
3284
3285         Variables can resolve to the wrong value when elements differ in nothing but inherited variable value
3286         https://bugs.webkit.org/show_bug.cgi?id=154785
3287
3288         Reviewed by Antti Koivisto.
3289
3290         Test: fast/css/variables/avoid-matched-property-cache.html
3291
3292         * css/StyleResolver.cpp:
3293         (WebCore::StyleResolver::MatchResult::addMatchedProperties):
3294         Disable the matched property cache when a value is variable-dependent, because
3295         they can resolve to inherited values, and the matched property cache could
3296         end up copying the wrong value from another similarly-styled element.
3297
3298 2016-02-28  Konstantin Tokarev  <annulen@yandex.ru>
3299
3300         SVGToOTFFontConversion.cpp does not compile with libstdc++ 4.8
3301         https://bugs.webkit.org/show_bug.cgi?id=154794
3302
3303         Reviewed by Michael Catanzaro.
3304
3305         No new tests needed.
3306
3307         * svg/SVGToOTFFontConversion.cpp:
3308         (WebCore::SVGToOTFFontConverter::appendLigatureSubtable): Added const
3309         qualifiers.
3310
3311 2016-02-27  Chris Dumez  <cdumez@apple.com>
3312
3313         Prevent cross-origin access to Location.assign() / Location.reload()
3314         https://bugs.webkit.org/show_bug.cgi?id=154779
3315
3316         Reviewed by Darin Adler.
3317
3318         Prevent cross-origin access to Location.assign() / Location.reload()
3319         to match the latest specification:
3320         - https://html.spec.whatwg.org/multipage/browsers.html#crossoriginproperties-(-o-)
3321
3322         Firefox and Chrome already prevent this but WebKit allowed it.
3323
3324         No new tests, already covered by existing tests.
3325
3326         * bindings/js/JSLocationCustom.cpp:
3327         (WebCore::JSLocation::getOwnPropertySlotDelegate):
3328         (WebCore::JSLocation::putDelegate): Deleted.
3329
3330 2016-02-27  Andy VanWagoner  <thetalecrafter@gmail.com>
3331
3332         Intl.Collator uses POSIX locale (detected by js/intl-collator.html on iOS Simulator)
3333         https://bugs.webkit.org/show_bug.cgi?id=152448
3334
3335         Reviewed by Darin Adler.
3336
3337         Pass defaultLanguage from Language.h to the globalObjectMethodTable to
3338         ensure Intl objects can be initialized with the correct default locale.
3339
3340         * bindings/js/JSDOMWindowBase.cpp:
3341         * bindings/js/JSWorkerGlobalScopeBase.cpp:
3342
3343 2016-02-27  Chris Dumez  <cdumez@apple.com>
3344
3345         Align HTMLMarqueeElement.scrollAmount / scrollDelay with the specification
3346         https://bugs.webkit.org/show_bug.cgi?id=154781
3347
3348         Reviewed by Darin Adler.
3349
3350         Align HTMLMarqueeElement.scrollAmount / scrollDelay with the
3351         specification:
3352         - https://www.w3.org/TR/html5/obsolete.html#the-marquee-element-0
3353
3354         In particular:
3355         - The attributes should have unsigned long type
3356         - We should not throw for negative values
3357         - Values should be in the range [0, 2147483647] as per:
3358         - https://html.spec.whatwg.org/multipage/infrastructure.html#reflect
3359
3360         No new tests, already covered by existing tests.
3361
3362         * html/HTMLMarqueeElement.cpp:
3363         (WebCore::HTMLMarqueeElement::scrollAmount):
3364         (WebCore::HTMLMarqueeElement::setScrollAmount):
3365         (WebCore::HTMLMarqueeElement::scrollDelay):
3366         (WebCore::HTMLMarqueeElement::setScrollDelay):
3367         (WebCore::HTMLMarqueeElement::loop): Deleted.
3368         * html/HTMLMarqueeElement.h:
3369         * html/HTMLMarqueeElement.idl:
3370
3371 2016-02-27  Commit Queue  <commit-queue@webkit.org>
3372
3373         Unreviewed, rolling out r197204, r197207, r197211, r197217,
3374         r197218, and r197219.
3375         https://bugs.webkit.org/show_bug.cgi?id=154780
3376
3377         Caused crashes in WebVideoFullscreenManagerProxy (Requested by
3378         ap on #webkit).
3379
3380         Reverted changesets:
3381
3382         "Add support for playbackControlsManager"
3383         https://bugs.webkit.org/show_bug.cgi?id=154742
3384         http://trac.webkit.org/changeset/197204
3385
3386         "Attempted build fix."
3387         http://trac.webkit.org/changeset/197207
3388
3389         "Attempted build fix."
3390         http://trac.webkit.org/changeset/197211
3391
3392         "Attempted 32-bit build fix."
3393         http://trac.webkit.org/changeset/197217
3394
3395         "Another 32-bit build fix."
3396         http://trac.webkit.org/changeset/197218
3397
3398         "32-bit!!!"
3399         http://trac.webkit.org/changeset/197219
3400
3401 2016-02-27  Chris Dumez  <cdumez@apple.com>
3402
3403         Optimize parseHTMLInteger()
3404         https://bugs.webkit.org/show_bug.cgi?id=154772
3405
3406         Reviewed by Ryosuke Niwa.
3407
3408         Optimize parseHTMLInteger() a bit now that it is used a lot more and
3409         that it has decent API test coverage. In particular, we now:
3410         - Avoid using a StringBuilder for the digits.
3411         - Get rid of a is8Bit() branch.
3412         - Only traverse the input string once.
3413
3414         * html/parser/HTMLParserIdioms.cpp:
3415         (WebCore::parseHTMLIntegerInternal):
3416         (WebCore::parseHTMLInteger):
3417         (WebCore::parseHTMLNonNegativeInteger): Deleted.
3418
3419 2016-02-27  Andreas Kling  <akling@apple.com>