64b45d95cb998d8a892657b167ab2674d18dd580
[WebKit.git] / Source / WebCore / ChangeLog
1 2016-04-26  Myles C. Maxfield  <mmaxfield@apple.com>
2
3         Use auto-generated operators in FontPlatformData
4         https://bugs.webkit.org/show_bug.cgi?id=157037
5
6         Reviewed by Geoffrey Garen.
7
8         The only reason why they weren't used before is because Cairo was
9         using a raw pointer. However, RefPtr supports Cairo types, so this
10         patch migrates that pointer to a RefPtr. Therefore, we can remove
11         our custom operators (because they work the same way as auto-
12         generated ones do).
13
14         No new tests because there is no behavior change.
15
16         * platform/graphics/FontPlatformData.cpp:
17         (WebCore::FontPlatformData::FontPlatformData): Deleted.
18         (WebCore::FontPlatformData::operator=): Deleted.
19         * platform/graphics/FontPlatformData.h:
20         (WebCore::FontPlatformData::scaledFont):
21         (WebCore::FontPlatformData::hash):
22         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
23         (WebCore::FontPlatformData::~FontPlatformData): Deleted.
24         (WebCore::FontPlatformData::platformDataInit): Deleted.
25         (WebCore::FontPlatformData::platformDataAssign): Deleted.
26         * platform/graphics/win/FontPlatformDataCGWin.cpp:
27         (WebCore::FontPlatformData::~FontPlatformData): Deleted.
28         (WebCore::FontPlatformData::platformDataInit): Deleted.
29         (WebCore::FontPlatformData::platformDataAssign): Deleted.
30         * platform/graphics/win/FontPlatformDataCairoWin.cpp:
31         (WebCore::FontPlatformData::platformDataInit):
32         (WebCore::FontPlatformData::FontPlatformData):
33         (WebCore::FontPlatformData::~FontPlatformData): Deleted.
34         (WebCore::FontPlatformData::platformDataAssign): Deleted.
35         * platform/graphics/win/FontPlatformDataWin.cpp:
36         (WebCore::FontPlatformData::FontPlatformData): Deleted.
37
38 2016-04-26  Zalan Bujtas  <zalan@apple.com>
39
40         Add renderer address and needslayout state to inlineboxtree dump.
41         https://bugs.webkit.org/show_bug.cgi?id=157035
42
43         Reviewed by Simon Fraser.
44
45         * rendering/InlineBox.cpp:
46         (WebCore::InlineBox::showLineBox):
47         * rendering/InlineTextBox.cpp:
48         (WebCore::InlineTextBox::showLineBox):
49         * rendering/SimpleLineLayoutFunctions.cpp:
50         (WebCore::SimpleLineLayout::printPrefix):
51
52 2016-04-26  Fujii Hironori  <Hironori.Fujii@sony.com>
53
54         [curl] Requests interrupted when using https via proxy
55         https://bugs.webkit.org/show_bug.cgi?id=157028
56
57         Reviewed by Alex Christensen.
58
59         A proxy responds "200 Connection Established" to a CONNECT
60         method.  This response doesn't have Content-Type, then the
61         request is canceled due to a unsupported MIME type. This is not
62         a real response from the recipient server. It should not be
63         processed normally. Just ignore the response.
64
65         * platform/network/curl/ResourceHandleManager.cpp:
66         (WebCore::headerCallback):
67         Do nothing if httpCode is 0. This is the case of "200 Connection Established".
68
69 2016-04-26  Chris Dumez  <cdumez@apple.com>
70
71         Drop Dictionary from CanUseWTFOptionalForParameter()
72         https://bugs.webkit.org/show_bug.cgi?id=157023
73
74         Reviewed by Darin Adler.
75
76         As per Web IDL, optional dictionary parameters are always considered to have
77         a default value of an empty dictionary, unless otherwise specified. There is
78         therefore never any need to use Optional<> for it. Just implement this
79         behavior in the bindings generator and drop blacklisting of Dictionary from
80         CanUseWTFOptionalForParameter().
81
82         * bindings/scripts/CodeGeneratorJS.pm:
83         (GenerateParametersCheck):
84         (CanUseWTFOptionalForParameter): Deleted.
85         * bindings/scripts/test/JS/JSTestObj.cpp:
86         (WebCore::jsTestObjPrototypeFunctionOptionsObject):
87
88 2016-04-26  Antti Koivisto  <antti@apple.com>
89
90         RenderElement::style() should return const RenderStyle
91         https://bugs.webkit.org/show_bug.cgi?id=157016
92
93         Reviewed by Geoff Garen.
94
95         Style should be changed via setStyle, not by mutating it directly.
96
97         Pulling this string turns RenderStyle const in many places.
98
99         * accessibility/AccessibilityObject.cpp:
100         (WebCore::startOfStyleRange):
101         * accessibility/atk/WebKitAccessibleInterfaceText.cpp:
102         (getAttributeSetForAccessibilityObject):
103         * bindings/objc/DOM.mm:
104         (-[DOMNode innerFrameQuad]):
105         (-[DOMNode computedFontSize]):
106         * css/CSSComputedStyleDeclaration.cpp:
107         (WebCore::createPositionListForLayer):
108         (WebCore::positionOffsetValue):
109         (WebCore::ComputedStyleExtractor::currentColorOrValidColor):
110         (WebCore::getTransitionPropertyValue):
111         (WebCore::scrollSnapDestination):
112         (WebCore::scrollSnapPoints):
113         (WebCore::scrollSnapCoordinates):
114         (WebCore::logUnimplementedPropertyID):
115         (WebCore::fontFamilyFromStyle):
116         (WebCore::lineHeightFromStyle):
117         (WebCore::fontSizeFromStyle):
118         (WebCore::fontStyleFromStyle):
119         (WebCore::fontVariantFromStyle):
120         (WebCore::fontWeightFromStyle):
121         (WebCore::fontSynthesisFromStyle):
122         (WebCore::zoomAdjustedPaddingOrMarginPixelValue):
123         (WebCore::paddingOrMarginIsRendererDependent):
124         (WebCore::convertToRegionBreak):
125         (WebCore::isLayoutDependent):
126         (WebCore::updateStyleIfNeededForNode):
127         (WebCore::computeRenderStyleForProperty):
128         (WebCore::ComputedStyleExtractor::propertyValue):
129         (WebCore::CSSComputedStyleDeclaration::length):
130         (WebCore::CSSComputedStyleDeclaration::item):
131         (WebCore::ComputedStyleExtractor::propertyMatches):
132         * css/CSSComputedStyleDeclaration.h:
133         * css/CSSToLengthConversionData.cpp:
134         (WebCore::CSSToLengthConversionData::viewportWidthFactor):
135         (WebCore::CSSToLengthConversionData::viewportHeightFactor):
136         (WebCore::CSSToLengthConversionData::viewportMinFactor):
137         (WebCore::CSSToLengthConversionData::viewportMaxFactor):
138         * css/CSSToLengthConversionData.h:
139         (WebCore::CSSToLengthConversionData::CSSToLengthConversionData):
140         (WebCore::CSSToLengthConversionData::style):
141         (WebCore::CSSToLengthConversionData::rootStyle):
142         (WebCore::CSSToLengthConversionData::computingFontSize):
143         (WebCore::CSSToLengthConversionData::copyWithAdjustedZoom):
144         * css/CSSToStyleMap.cpp:
145         (WebCore::CSSToStyleMap::style):
146         (WebCore::CSSToStyleMap::rootElementStyle):
147         * css/CSSToStyleMap.h:
148         * css/MediaQueryEvaluator.cpp:
149         (WebCore::MediaQueryEvaluator::MediaQueryEvaluator):
150         * css/MediaQueryEvaluator.h:
151         * css/SVGCSSComputedStyleDeclaration.cpp:
152         (WebCore::strokeDashArrayToCSSValueList):
153         (WebCore::ComputedStyleExtractor::adjustSVGPaintForCurrentColor):
154         (WebCore::ComputedStyleExtractor::svgPropertyValue):
155         * css/SourceSizeList.cpp:
156         (WebCore::match):
157         (WebCore::defaultLength):
158         (WebCore::computeLength):
159         (WebCore::parseSizesAttribute):
160         * css/StyleBuilderCustom.h:
161         (WebCore::ApplyPropertyBorderImageModifier::applyValue):
162         (WebCore::ApplyPropertyBorderImageModifier::getValue):
163         (WebCore::StyleBuilderCustom::applyInheritClip):
164         (WebCore::StyleBuilderCustom::applyInheritCounter):
165         (WebCore::StyleBuilderCustom::applyValueContent):
166         (WebCore::StyleBuilderCustom::applyValueAlt):
167         * css/StyleResolver.cpp:
168         (WebCore::StyleResolver::sweepMatchedPropertiesCache):
169         (WebCore::StyleResolver::State::State):
170         (WebCore::isAtShadowBoundary):
171         (WebCore::StyleResolver::styleForElement):
172         (WebCore::StyleResolver::keyframeStylesForAnimation):
173         (WebCore::StyleResolver::pseudoStyleForElement):
174         (WebCore::StyleResolver::applyProperty):
175         (WebCore::StyleResolver::checkForTextSizeAdjust):
176         (WebCore::StyleResolver::checkForZoomChange):
177         (WebCore::StyleResolver::checkForGenericFamilyChange):
178         * css/StyleResolver.h:
179         (WebCore::StyleResolver::style):
180         (WebCore::StyleResolver::parentStyle):
181         (WebCore::StyleResolver::rootElementStyle):
182         (WebCore::StyleResolver::element):
183         (WebCore::StyleResolver::document):
184         (WebCore::StyleResolver::documentSettings):
185         (WebCore::StyleResolver::State::State):
186         (WebCore::StyleResolver::State::takeStyle):
187         (WebCore::StyleResolver::State::parentStyle):
188         (WebCore::StyleResolver::State::rootElementStyle):
189         (WebCore::StyleResolver::State::regionForStyling):
190         (WebCore::StyleResolver::State::elementLinkState):
191         * dom/Document.cpp:
192         (WebCore::Document::updateLayoutIgnorePendingStylesheets):
193         (WebCore::Document::styleForElementIgnoringPendingStylesheets):
194         (WebCore::Document::setVisuallyOrdered):
195         (WebCore::Document::createParser):
196         * dom/Document.h:
197         * dom/Element.cpp:
198         (WebCore::Element::styleResolver):
199         (WebCore::Element::resolveStyle):
200         (WebCore::checkForEmptyStyleChange):
201         (WebCore::checkForSiblingStyleChanges):
202         (WebCore::beforeOrAfterPseudoElement):
203         (WebCore::Element::existingComputedStyle):
204         (WebCore::Element::resolveComputedStyle):
205         (WebCore::Element::computedStyle):
206         (WebCore::Element::didDetachRenderers):
207         (WebCore::Element::resolveCustomStyle):
208         * dom/Element.h:
209         * dom/Node.cpp:
210         (WebCore::computeEditabilityFromComputedStyle):
211         (WebCore::Node::pseudoAwareLastChild):
212         (WebCore::Node::computedStyle):
213         * dom/Node.h:
214         * dom/NodeRenderStyle.h:
215         (WebCore::Node::renderStyle):
216         * dom/PseudoElement.cpp:
217         (WebCore::PseudoElement::clearHostElement):
218         (WebCore::PseudoElement::resolveCustomStyle):
219         * dom/PseudoElement.h:
220         * editing/ApplyBlockElementCommand.cpp:
221         (WebCore::isNewLineAtPosition):
222         (WebCore::ApplyBlockElementCommand::renderStyleOfEnclosingTextNode):
223         (WebCore::ApplyBlockElementCommand::rangeForParagraphSplittingTextNodesIfNeeded):
224         (WebCore::ApplyBlockElementCommand::endOfNextParagraphSplittingTextNodesIfNeeded):
225         * editing/ApplyBlockElementCommand.h:
226         * editing/EditingStyle.cpp:
227         (WebCore::EditingStyle::init):
228         (WebCore::EditingStyle::removeTextFillAndStrokeColorsIfNeeded):
229         * editing/EditingStyle.h:
230         * editing/Editor.h:
231         * editing/SimplifyMarkupCommand.cpp:
232         (WebCore::SimplifyMarkupCommand::doApply):
233         * editing/cocoa/EditorCocoa.mm:
234         (WebCore::Editor::styleForSelectionStart):
235         (WebCore::Editor::getTextDecorationAttributesRespectingTypingStyle):
236         * editing/ios/EditorIOS.mm:
237         (WebCore::Editor::fontForSelection):
238         (WebCore::Editor::fontAttributesForSelectionStart):
239         * editing/mac/EditorMac.mm:
240         (WebCore::Editor::fontForSelection):
241         (WebCore::Editor::fontAttributesForSelectionStart):
242         * html/HTMLTitleElement.cpp:
243         (WebCore::HTMLTitleElement::computedTextWithDirection):
244         * html/canvas/CanvasRenderingContext2D.cpp:
245         (WebCore::CanvasRenderingContext2D::FontProxy::fontsNeedUpdate):
246         (WebCore::CanvasRenderingContext2D::FontProxy::initialize):
247         (WebCore::CanvasRenderingContext2D::setFont):
248         (WebCore::CanvasRenderingContext2D::setTextBaseline):
249         (WebCore::CanvasRenderingContext2D::toTextDirection):
250         (WebCore::CanvasRenderingContext2D::drawTextInternal):
251         * html/canvas/CanvasRenderingContext2D.h:
252         * html/parser/HTMLResourcePreloader.cpp:
253         (WebCore::HTMLResourcePreloader::preload):
254         (WebCore::mediaAttributeMatches):
255         * html/shadow/SliderThumbElement.cpp:
256         (WebCore::RenderSliderThumb::RenderSliderThumb):
257         (WebCore::RenderSliderThumb::updateAppearance):
258         (WebCore::RenderSliderContainer::layout):
259         (WebCore::SliderThumbElement::hostInput):
260         (WebCore::SliderThumbElement::resolveCustomStyle):
261         (WebCore::SliderContainerElement::createElementRenderer):
262         (WebCore::SliderContainerElement::resolveCustomStyle):
263         * html/shadow/SliderThumbElement.h:
264         * html/shadow/TextControlInnerElements.cpp:
265         (WebCore::TextControlInnerElement::create):
266         (WebCore::TextControlInnerElement::resolveCustomStyle):
267         (WebCore::TextControlInnerTextElement::renderer):
268         (WebCore::TextControlInnerTextElement::resolveCustomStyle):
269         (WebCore::TextControlPlaceholderElement::TextControlPlaceholderElement):
270         (WebCore::TextControlPlaceholderElement::resolveCustomStyle):
271         * html/shadow/TextControlInnerElements.h:
272         * page/EventHandler.cpp:
273         (WebCore::EventHandler::selectCursor):
274         * page/animation/AnimationBase.cpp:
275         (WebCore::solveStepsFunction):
276         (WebCore::AnimationBase::AnimationBase):
277         * page/animation/AnimationBase.h:
278         (WebCore::AnimationBase::~AnimationBase):
279         (WebCore::AnimationBase::renderer):
280         (WebCore::AnimationBase::animation):
281         (WebCore::AnimationBase::setAnimation):
282         * page/animation/AnimationController.cpp:
283         (WebCore::AnimationController::cancelAnimations):
284         (WebCore::AnimationController::updateAnimations):
285         * page/animation/AnimationController.h:
286         * page/animation/CompositeAnimation.cpp:
287         (WebCore::CompositeAnimation::clearRenderer):
288         (WebCore::CompositeAnimation::updateTransitions):
289         (WebCore::CompositeAnimation::updateKeyframeAnimations):
290         (WebCore::CompositeAnimation::animate):
291         * page/animation/CompositeAnimation.h:
292         * page/animation/ImplicitAnimation.cpp:
293         (WebCore::ImplicitAnimation::ImplicitAnimation):
294         (WebCore::ImplicitAnimation::shouldSendEventForListener):
295         (WebCore::ImplicitAnimation::animate):
296         (WebCore::ImplicitAnimation::sendTransitionEvent):
297         (WebCore::ImplicitAnimation::reset):
298         * page/animation/ImplicitAnimation.h:
299         (WebCore::ImplicitAnimation::create):
300         * page/animation/KeyframeAnimation.cpp:
301         (WebCore::KeyframeAnimation::KeyframeAnimation):
302         (WebCore::KeyframeAnimation::fetchIntervalEndpointsForProperty):
303         (WebCore::KeyframeAnimation::animate):
304         * page/animation/KeyframeAnimation.h:
305         * page/ios/FrameIOS.mm:
306         (WebCore::ancestorRespondingToScrollWheelEvents):
307         * rendering/FlowThreadController.cpp:
308         (WebCore::FlowThreadController::styleDidChange):
309         * rendering/InlineFlowBox.cpp:
310         (WebCore::clipRectForNinePieceImageStrip):
311         * rendering/RenderBlock.cpp:
312         (WebCore::RenderBlock::styleDidChange):
313         (WebCore::RenderBlock::lineHeight):
314         (WebCore::RenderBlock::firstLineBlock):
315         (WebCore::styleForFirstLetter):
316         (WebCore::RenderBlock::updateFirstLetterStyle):
317         (WebCore::RenderBlock::createFirstLetterRenderer):
318         * rendering/RenderBlockFlow.cpp:
319         (WebCore::RenderBlockFlow::adjustBlockChildForPagination):
320         (WebCore::calculateMinimumPageHeight):
321         (WebCore::RenderBlockFlow::adjustComputedFontSizes):
322         * rendering/RenderBox.cpp:
323         (WebCore::RenderBox::styleDidChange):
324         (WebCore::RenderBox::borderRadii):
325         (WebCore::RenderBox::enclosingFloatPaintingLayer):
326         (WebCore::RenderBox::logicalVisualOverflowRectForPropagation):
327         (WebCore::RenderBox::visualOverflowRectForPropagation):
328         (WebCore::RenderBox::logicalLayoutOverflowRectForPropagation):
329         (WebCore::RenderBox::layoutOverflowRectForPropagation):
330         * rendering/RenderBox.h:
331         (WebCore::RenderBox::applyTopLeftLocationOffset):
332         (WebCore::RenderBox::hasRenderOverflow):
333         (WebCore::RenderBox::hasVisualOverflow):
334         * rendering/RenderBoxModelObject.cpp:
335         (WebCore::RenderBoxModelObject::backgroundRoundedRectAdjustedForBleedAvoidance):
336         (WebCore::applyBoxShadowForBackground):
337         * rendering/RenderButton.cpp:
338         (WebCore::RenderButton::addChild):
339         (WebCore::RenderButton::styleWillChange):
340         (WebCore::RenderButton::styleDidChange):
341         (WebCore::RenderButton::setupInnerStyle):
342         (WebCore::RenderButton::layout):
343         * rendering/RenderDeprecatedFlexibleBox.cpp:
344         (WebCore::RenderDeprecatedFlexibleBox::styleWillChange):
345         * rendering/RenderElement.cpp:
346         (WebCore::RenderElement::createFor):
347         (WebCore::RenderElement::uncachedFirstLineStyle):
348         (WebCore::RenderElement::cachedFirstLineStyle):
349         (WebCore::RenderElement::firstLineStyle):
350         (WebCore::RenderElement::styleWillChange):
351         (WebCore::RenderElement::addControlStatesForRenderer):
352         (WebCore::RenderElement::getCachedPseudoStyle):
353         (WebCore::RenderElement::getMutableCachedPseudoStyle):
354         (WebCore::RenderElement::getUncachedPseudoStyle):
355         (WebCore::RenderElement::paintOutline):
356         * rendering/RenderElement.h:
357         (WebCore::RenderElement::hasInitializedStyle):
358         (WebCore::RenderElement::style):
359         (WebCore::RenderElement::mutableStyle):
360         (WebCore::RenderElement::element):
361         (WebCore::RenderObject::isRenderInline):
362         (WebCore::RenderObject::style):
363         (WebCore::RenderObject::firstLineStyle):
364         * rendering/RenderEmbeddedObject.cpp:
365         (WebCore::RenderEmbeddedObject::layout):
366         * rendering/RenderFlowThread.cpp:
367         (WebCore::RenderFlowThread::RenderFlowThread):
368         (WebCore::RenderFlowThread::createFlowThreadStyle):
369         * rendering/RenderFlowThread.h:
370         * rendering/RenderImage.cpp:
371         (WebCore::RenderImage::layoutShadowControls):
372         * rendering/RenderInline.cpp:
373         (WebCore::RenderInline::styleDidChange):
374         (WebCore::RenderInline::updateAlwaysCreateLineBoxes):
375         (WebCore::RenderInline::paintOutline):
376         * rendering/RenderLayer.cpp:
377         (WebCore::RenderLayer::setupClipPath):
378         * rendering/RenderListBox.cpp:
379         (WebCore::RenderListBox::paintScrollbar):
380         (WebCore::itemOffsetForAlignment):
381         (WebCore::RenderListBox::paintItemForeground):
382         (WebCore::RenderListBox::paintItemBackground):
383         * rendering/RenderListMarker.cpp:
384         (WebCore::RenderListMarker::updateMargins):
385         (WebCore::RenderListMarker::lineHeight):
386         * rendering/RenderMarquee.cpp:
387         (WebCore::RenderMarquee::computePosition):
388         (WebCore::RenderMarquee::updateMarqueeStyle):
389         * rendering/RenderMenuList.cpp:
390         (WebCore::RenderMenuList::adjustInnerStyle):
391         (RenderMenuList::updateOptionsWidth):
392         (RenderMenuList::itemStyle):
393         * rendering/RenderMultiColumnFlowThread.cpp:
394         (WebCore::isValidColumnSpanner):
395         * rendering/RenderMultiColumnSpannerPlaceholder.cpp:
396         (WebCore::RenderMultiColumnSpannerPlaceholder::createAnonymous):
397         * rendering/RenderMultiColumnSpannerPlaceholder.h:
398         * rendering/RenderNamedFlowFragment.cpp:
399         (WebCore::RenderNamedFlowFragment::checkRegionStyle):
400         (WebCore::RenderNamedFlowFragment::computeStyleInRegion):
401         * rendering/RenderNamedFlowFragment.h:
402         * rendering/RenderObject.cpp:
403         (WebCore::RenderObject::innerLineHeight):
404         (WebCore::decorationColor):
405         (WebCore::RenderObject::getTextDecorationColorsAndStyles):
406         * rendering/RenderObject.h:
407         (WebCore::RenderObject::minPreferredLogicalWidth):
408         (WebCore::RenderObject::maxPreferredLogicalWidth):
409         * rendering/RenderTable.cpp:
410         (WebCore::RenderTable::computePreferredLogicalWidths):
411         * rendering/RenderTableSection.cpp:
412         (WebCore::RenderTableSection::paintRowGroupBorderIfRequired):
413         (WebCore::physicalBorderForDirection):
414         * rendering/RenderText.h:
415         (WebCore::RenderText::characterAt):
416         (WebCore::RenderText::style):
417         (WebCore::RenderText::firstLineStyle):
418         (WebCore::RenderText::getCachedPseudoStyle):
419         * rendering/RenderTextControl.cpp:
420         (WebCore::RenderTextControl::styleDidChange):
421         * rendering/RenderTextControlMultiLine.cpp:
422         (WebCore::RenderTextControlMultiLine::layoutSpecialExcludedChild):
423         * rendering/RenderTextControlSingleLine.cpp:
424         (WebCore::RenderTextControlSingleLine::layout):
425         (WebCore::RenderTextControlSingleLine::styleDidChange):
426         * rendering/RenderTextFragment.cpp:
427         (WebCore::RenderTextFragment::styleDidChange):
428         * rendering/RenderThemeGtk.cpp:
429         (WebCore::RenderThemeGtk::paintMediaToggleClosedCaptionsButton):
430         (WebCore::borderRadiiFromStyle):
431         (WebCore::RenderThemeGtk::paintMediaSliderTrack):
432         (WebCore::RenderThemeGtk::paintMediaSliderThumb):
433         (WebCore::RenderThemeGtk::paintMediaVolumeSliderTrack):
434         * rendering/SimpleLineLayoutFunctions.cpp:
435         (WebCore::SimpleLineLayout::paintFlow):
436         (WebCore::SimpleLineLayout::hitTestFlow):
437         * rendering/TextAutoSizing.cpp:
438         (WebCore::TextAutoSizingKey::TextAutoSizingKey):
439         * rendering/TextAutoSizing.h:
440         (WebCore::TextAutoSizingKey::style):
441         (WebCore::TextAutoSizingKey::isDeleted):
442         * rendering/TextPaintStyle.cpp:
443         (WebCore::computeTextSelectionPaintStyle):
444         * rendering/line/BreakingContext.h:
445         * rendering/mathml/RenderMathMLRoot.cpp:
446         (WebCore::RenderMathMLRoot::layout):
447         * rendering/style/RenderStyle.h:
448         (WebCore::RenderStyle::setColumnRuleWidth):
449         (WebCore::RenderStyle::resetColumnRule):
450         (WebCore::RenderStyle::setColumnSpan):
451         (WebCore::RenderStyle::inheritColumnPropertiesFrom):
452         (WebCore::RenderStyle::setTransform):
453         (WebCore::RenderStyle::setTransformOriginX):
454         (WebCore::RenderStyle::setTransformOriginY):
455         * rendering/svg/SVGInlineTextBox.cpp:
456         (WebCore::SVGInlineTextBox::positionForOffset):
457         (WebCore::SVGInlineTextBox::selectionRectForTextFragment):
458         (WebCore::SVGInlineTextBox::localSelectionRect):
459         (WebCore::SVGInlineTextBox::paintSelectionBackground):
460         (WebCore::SVGInlineTextBox::paint):
461         (WebCore::SVGInlineTextBox::acquirePaintingResource):
462         (WebCore::SVGInlineTextBox::releasePaintingResource):
463         (WebCore::SVGInlineTextBox::prepareGraphicsContextForTextPainting):
464         (WebCore::SVGInlineTextBox::restoreGraphicsContextAfterTextPainting):
465         (WebCore::SVGInlineTextBox::constructTextRun):
466         (WebCore::SVGInlineTextBox::paintDecorationWithStyle):
467         (WebCore::SVGInlineTextBox::paintTextWithShadows):
468         (WebCore::SVGInlineTextBox::paintText):
469         * rendering/svg/SVGInlineTextBox.h:
470         * rendering/svg/SVGPathData.cpp:
471         (WebCore::updatePathFromCircleElement):
472         (WebCore::updatePathFromEllipseElement):
473         (WebCore::updatePathFromRectElement):
474         * rendering/svg/SVGRenderingContext.cpp:
475         (WebCore::SVGRenderingContext::prepareToRenderSVGContent):
476         * style/StyleTreeResolver.cpp:
477         (WebCore::Style::TreeResolver::Parent::Parent):
478         (WebCore::Style::TreeResolver::popScope):
479         (WebCore::Style::TreeResolver::styleForElement):
480         (WebCore::Style::TreeResolver::pushParent):
481         (WebCore::Style::TreeResolver::resolveComposedTree):
482         * style/StyleTreeResolver.h:
483         (WebCore::Style::TreeResolver::scope):
484         * style/StyleUpdate.cpp:
485         (WebCore::Style::Update::textUpdate):
486         (WebCore::Style::Update::elementStyle):
487         (WebCore::Style::Update::addElement):
488         * style/StyleUpdate.h:
489         (WebCore::Style::Update::document):
490         * svg/SVGElement.cpp:
491         (WebCore::SVGElement::synchronizeSystemLanguage):
492         (WebCore::SVGElement::resolveCustomStyle):
493         (WebCore::SVGElement::setUseOverrideComputedStyle):
494         (WebCore::SVGElement::computedStyle):
495         * svg/SVGElement.h:
496         * svg/SVGElementRareData.h:
497         (WebCore::SVGElementRareData::ensureAnimatedSMILStyleProperties):
498         (WebCore::SVGElementRareData::overrideComputedStyle):
499         * svg/SVGGraphicsElement.cpp:
500         (WebCore::SVGGraphicsElement::animatedLocalTransform):
501         * svg/SVGLengthContext.cpp:
502         (WebCore::SVGLengthContext::convertValueFromPercentageToUserUnits):
503         (WebCore::renderStyleForLengthResolving):
504         (WebCore::SVGLengthContext::convertValueFromUserUnitsToEMS):
505         (WebCore::SVGLengthContext::convertValueFromEMSToUserUnits):
506         (WebCore::SVGLengthContext::convertValueFromUserUnitsToEXS):
507         (WebCore::SVGLengthContext::convertValueFromEXSToUserUnits):
508         * svg/SVGStopElement.cpp:
509         (WebCore::SVGStopElement::stopColorIncludingOpacity):
510         * svg/SVGTextElement.cpp:
511         (WebCore::SVGTextElement::animatedLocalTransform):
512
513 2016-04-26  Myles C. Maxfield  <mmaxfield@apple.com>
514
515         Make FontPlatformData immutable
516         https://bugs.webkit.org/show_bug.cgi?id=157024
517
518         Reviewed by Darin Adler.
519
520         This patch deletes all functions which modify a FontPlatformData once
521         it has been created. This makes for a cleaner design.
522
523         No new tests because there is no behavior change.
524
525         * platform/graphics/Font.cpp:
526         (WebCore::Font::verticalRightOrientationFont):
527         (WebCore::Font::nonSyntheticItalicFont):
528         * platform/graphics/FontPlatformData.cpp:
529         (WebCore::FontPlatformData::FontPlatformData):
530         (WebCore::FontPlatformData::cloneWithOrientation):
531         (WebCore::FontPlatformData::cloneWithSyntheticOblique):
532         * platform/graphics/FontPlatformData.h:
533         (WebCore::FontPlatformData::setIsSystemFont): Deleted.
534         (WebCore::FontPlatformData::setSize): Deleted.
535         (WebCore::FontPlatformData::setOrientation): Deleted.
536         (WebCore::FontPlatformData::setSyntheticOblique): Deleted.
537         * platform/graphics/cocoa/FontCacheCoreText.cpp:
538         (WebCore::FontCache::systemFallbackForCharacters):
539         * platform/graphics/cocoa/FontCascadeCocoa.mm:
540         (WebCore::FontCascade::drawGlyphs):
541         * platform/graphics/cocoa/FontCocoa.mm:
542         (WebCore::Font::platformInit):
543         (WebCore::Font::platformCharWidthInit):
544         (WebCore::createDerivativeFont):
545         (WebCore::Font::createFontWithoutSynthesizableFeatures):
546         (WebCore::Font::platformCreateScaledFont):
547         (WebCore::Font::platformWidthForGlyph):
548         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
549         (WebCore::FontPlatformData::openTypeTable):
550         * platform/graphics/win/FontPlatformDataCairoWin.cpp:
551         (WebCore::FontPlatformData::platformDataInit):
552
553 2016-04-26  Ryan Haddad  <ryanhaddad@apple.com>
554
555         Unreviewed, rolling out r200089.
556
557         This change causes API test failures
558
559         Reverted changeset:
560
561         "WebCore on Mac ignores the user's preferred region (country)
562         while getting the language"
563         https://bugs.webkit.org/show_bug.cgi?id=156993
564         http://trac.webkit.org/changeset/200089
565
566 2016-04-26  Brent Fulgham  <bfulgham@apple.com>
567
568         GuardMalloc crash in WebCore::HTMLFrameElementBase::marginHeight() 
569         https://bugs.webkit.org/show_bug.cgi?id=157020
570         <rdar://problem/25148315>
571
572         Reviewed by Darin Adler.
573
574         Calls to setIntegralAttribute triggers event handling code, which can cause
575         the underlying m_frameOwnerElement member to be deleted. We could clone this
576         object, but since we only want the width and height we should just read them
577         while we know the object is in a good state, then execute the potentially
578         mutating methods.
579
580         Tested by imported/blink/fast/dom/HTMLBodyElement/body-inserting-iframe-crash.html.
581
582         * html/HTMLBodyElement.cpp:
583         (WebCore::HTMLBodyElement::insertedInto): Read margin width and height before
584         calling setIntegralAttribute.
585
586 2016-04-25  Filip Pizlo  <fpizlo@apple.com>
587
588         WebCore on Mac ignores the user's preferred region (country) while getting the language
589         https://bugs.webkit.org/show_bug.cgi?id=156993
590
591         Reviewed by Geoffrey Garen.
592
593         I don't know how to test this since this depends on user settings.
594         
595         WebCore was previously getting the list of preferred languages, and for each one, deducing
596         the default region. That's wrong, since for example it doesn't respect the user's choice (in
597         System Preferences) to display dates/calenders/etc according to a different region (like how
598         I have my machine set to en-pl right now).
599         
600         It might be possible for the country code we get via kCFLocaleCountryCode to be something
601         that our ICU doesn't handle. To defend against this, we search for the resulting country
602         code in ICU's ISO countries list. If it doesn't appear in that list, we fall back on old
603         behavior.
604
605         * platform/mac/Language.mm:
606         (WebCore::httpStyleLanguageCode):
607         (WebCore::platformUserPreferredLanguages):
608
609 2016-04-26  Chris Dumez  <cdumez@apple.com>
610
611         [Web IDL] Specify default values for optional parameters of TypedArray types
612         https://bugs.webkit.org/show_bug.cgi?id=157017
613
614         Reviewed by Darin Adler.
615
616         Specify default values for optional parameters of TypedArray types and let
617         the bindings generator use WTF::Optional<> for the ones that do not have a
618         default value.
619
620         * bindings/scripts/CodeGeneratorJS.pm:
621         (CanUseWTFOptionalForParameter): Deleted.
622         * html/HTMLMediaElement.cpp:
623         (WebCore::HTMLMediaElement::webkitGenerateKeyRequest):
624         (WebCore::HTMLMediaElement::webkitAddKey):
625         (WebCore::HTMLMediaElement::webkitCancelKeyRequest): Deleted.
626         * html/HTMLMediaElement.h:
627         * html/HTMLMediaElement.idl:
628
629 2016-04-26  Chris Dumez  <cdumez@apple.com>
630
631         [Web IDL] Specify default values for optional parameters of type 'long' / 'unrestricted double'
632         https://bugs.webkit.org/show_bug.cgi?id=157012
633
634         Reviewed by Darin Adler.
635
636         Specify default values for optional parameters of type 'long' / 'unrestricted double'
637         and let the bindings generator use WTF::Optional<> for the ones that do not have a
638         default value.
639
640         * Modules/mediastream/RTCDTMFSender.cpp:
641         (WebCore::RTCDTMFSender::insertDTMF):
642         (WebCore::RTCDTMFSender::didPlayTone): Deleted.
643         * Modules/mediastream/RTCDTMFSender.h:
644         * Modules/webaudio/AudioBufferSourceNode.cpp:
645         (WebCore::AudioBufferSourceNode::start):
646         (WebCore::AudioBufferSourceNode::startPlaying): Deleted.
647         * Modules/webaudio/AudioBufferSourceNode.h:
648         * Modules/webaudio/AudioBufferSourceNode.idl:
649         * Modules/webaudio/AudioContext.cpp:
650         (WebCore::AudioContext::createDelay): Deleted.
651         * Modules/webaudio/AudioContext.h:
652         * Modules/webaudio/AudioContext.idl:
653         * Modules/webaudio/AudioScheduledSourceNode.cpp:
654         (WebCore::AudioScheduledSourceNode::start): Deleted.
655         (WebCore::AudioScheduledSourceNode::stop): Deleted.
656         * Modules/webaudio/AudioScheduledSourceNode.h:
657         * Modules/webaudio/OscillatorNode.idl:
658         * bindings/scripts/CodeGeneratorJS.pm:
659         (CanUseWTFOptionalForParameter): Deleted.
660         * bindings/scripts/test/JS/JSTestObj.cpp:
661         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalArg):
662         (WebCore::jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndOptionalArg):
663         (WebCore::jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndTwoOptionalArgs):
664         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod2):
665         (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter2):
666         (WebCore::jsTestObjConstructorFunctionClassMethodWithOptional):
667         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithOptionalIntArgumentPromise):
668         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalArgAndDefaultValue): Deleted.
669         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalString): Deleted.
670         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod4): Deleted.
671         (WebCore::jsTestObjConstructorFunctionClassMethod2): Deleted.
672         (WebCore::jsTestObjConstructorFunctionOverloadedMethod1): Deleted.
673         (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction2Promise): Deleted.
674         * html/HTMLInputElement.idl:
675         * page/WindowTimers.idl:
676         * testing/Internals.h:
677         * testing/Internals.idl:
678
679 2016-04-26  Youenn Fablet  <youenn.fablet@crf.canon.fr>
680
681         Drop [UsePointersEvenForNonNullableObjectArguments] from SpeechSynthesis
682         https://bugs.webkit.org/show_bug.cgi?id=156901
683
684         Reviewed by Darin Adler.
685
686         SpeechSynthesis.speak will now throw in case of bad parameters instead of silently failing.
687         Started refactoring to use more references where possible.
688
689         Covered by updated test.
690
691         * Modules/speech/SpeechSynthesis.cpp:
692         (WebCore::SpeechSynthesis::startSpeakingImmediately): Refactored to get a reference.
693         (WebCore::SpeechSynthesis::speak):
694         (WebCore::SpeechSynthesis::fireEvent):
695         (WebCore::SpeechSynthesis::handleSpeakingCompleted): Removing first item in utteranceQueue unconditionally,
696         since that would crash in Debug mode otherwise.
697         (WebCore::SpeechSynthesis::boundaryEventOccurred):
698         (WebCore::SpeechSynthesis::didStartSpeaking):
699         (WebCore::SpeechSynthesis::didPauseSpeaking):
700         (WebCore::SpeechSynthesis::didResumeSpeaking):
701         (WebCore::SpeechSynthesis::didFinishSpeaking):
702         (WebCore::SpeechSynthesis::speakingErrorOccurred):
703         * Modules/speech/SpeechSynthesis.h:
704         * Modules/speech/SpeechSynthesis.idl:
705
706 2016-04-26  Youenn Fablet  <youenn.fablet@crf.canon.fr>
707
708         Drop [UsePointersEvenForNonNullableObjectArguments] from WebKitNamedFlow
709         https://bugs.webkit.org/show_bug.cgi?id=156979
710
711         Reviewed by Chris Dumez.
712
713         No change of behavior.
714
715         * dom/WebKitNamedFlow.idl: Marking contentNode parameter as nullable.
716
717 2016-04-26  Youenn Fablet  <youenn.fablet@crf.canon.fr>
718
719         Drop [UsePointersEvenForNonNullableObjectArguments] from EventTarget
720         https://bugs.webkit.org/show_bug.cgi?id=156977
721
722         Reviewed by Chris Dumez.
723
724         No change of behavior.
725
726         * dom/EventTarget.idl:
727
728 2016-04-25  Ryosuke Niwa  <rniwa@webkit.org>
729
730         Remove the build flag for template elements
731         https://bugs.webkit.org/show_bug.cgi?id=157022
732
733         Reviewed by Daniel Bates.
734
735         Removed the build flag.
736
737         * Configurations/FeatureDefines.xcconfig:
738         * DerivedSources.cpp:
739         * bindings/js/JSHTMLTemplateElementCustom.cpp:
740         (WebCore::JSHTMLTemplateElement::content):
741         * css/html.css:
742         (summary::-webkit-details-marker):
743         (template):
744         (bdi, output):
745         * dom/ContainerNode.cpp:
746         (WebCore::isInTemplateContent):
747         (WebCore::containsConsideringHostElements):
748         (WebCore::ContainerNode::parserInsertBefore):
749         (WebCore::ContainerNode::parserAppendChild):
750         * dom/Document.cpp:
751         (WebCore::Document::Document):
752         (WebCore::Document::~Document):
753         (WebCore::Document::getCachedLocale):
754         (WebCore::Document::ensureTemplateDocument):
755         (WebCore::Document::fonts):
756         * dom/Document.h:
757         (WebCore::Document::setTemplateDocumentHost):
758         (WebCore::Document::templateDocumentHost):
759         (WebCore::Document::hasDisabledFieldsetElement):
760         (WebCore::Document::textEncoding):
761         (WebCore::Document::templateDocument):
762         * dom/Element.cpp:
763         (WebCore::Element::setInnerHTML):
764         * dom/Node.cpp:
765         (WebCore::Node::containsIncludingHostElements):
766         (WebCore::Node::pseudoAwarePreviousSibling):
767         * dom/TemplateContentDocumentFragment.h:
768         * editing/MarkupAccumulator.cpp:
769         (WebCore::MarkupAccumulator::serializeNodesWithNamespaces):
770         * editing/markup.cpp:
771         (WebCore::createFragmentForInnerOuterHTML):
772         * html/HTMLTagNames.in:
773         * html/HTMLTemplateElement.cpp:
774         (WebCore::HTMLTemplateElement::didMoveToNewDocument):
775         * html/HTMLTemplateElement.h:
776         * html/HTMLTemplateElement.idl:
777         * html/parser/HTMLConstructionSite.cpp:
778         (WebCore::insert):
779         (WebCore::HTMLConstructionSite::insertTextNode):
780         (WebCore::HTMLConstructionSite::ownerDocumentForCurrentNode):
781         (WebCore::HTMLConstructionSite::findFosterSite):
782         * html/parser/HTMLElementStack.cpp:
783         (WebCore::HTMLNames::isScopeMarker):
784         (WebCore::HTMLNames::isTableScopeMarker):
785         (WebCore::HTMLNames::isTableBodyScopeMarker):
786         (WebCore::HTMLNames::isTableRowScopeMarker):
787         (WebCore::HTMLElementStack::inSelectScope):
788         (WebCore::HTMLElementStack::hasTemplateInHTMLScope):
789         (WebCore::HTMLElementStack::htmlElement):
790         * html/parser/HTMLElementStack.h:
791         * html/parser/HTMLPreloadScanner.cpp:
792         (WebCore::TokenPreloadScanner::scan):
793         * html/parser/HTMLPreloadScanner.h:
794         * html/parser/HTMLStackItem.h:
795         (WebCore::isSpecialNode):
796         * html/parser/HTMLTreeBuilder.cpp:
797         (WebCore::HTMLTreeBuilder::isParsingTemplateContents):
798         (WebCore::HTMLTreeBuilder::isParsingFragmentOrTemplateContents):
799         (WebCore::HTMLTreeBuilder::HTMLTreeBuilder):
800         (WebCore::HTMLTreeBuilder::processStartTagForInBody):
801         (WebCore::HTMLTreeBuilder::didCreateCustomOrCallbackElement):
802         (WebCore::HTMLTreeBuilder::processTemplateStartTag):
803         (WebCore::HTMLTreeBuilder::processEndOfFileForInTemplateContents):
804         (WebCore::HTMLTreeBuilder::processColgroupEndTagForInColumnGroup):
805         (WebCore::HTMLTreeBuilder::processStartTagForInTable):
806         (WebCore::HTMLTreeBuilder::processStartTag):
807         (WebCore::HTMLTreeBuilder::processHtmlStartTagForInBody):
808         (WebCore::HTMLTreeBuilder::resetInsertionModeAppropriately):
809         (WebCore::HTMLTreeBuilder::processEndTagForInCell):
810         (WebCore::HTMLTreeBuilder::processEndTagForInBody):
811         (WebCore::HTMLTreeBuilder::processEndTag):
812         (WebCore::HTMLTreeBuilder::processCharacterBuffer):
813         (WebCore::HTMLTreeBuilder::processEndOfFile):
814         (WebCore::HTMLTreeBuilder::processStartTagForInHead):
815         (WebCore::HTMLTreeBuilder::finished):
816         * html/parser/HTMLTreeBuilder.h:
817         * inspector/InspectorDOMAgent.cpp:
818         (WebCore::InspectorDOMAgent::buildObjectForNode):
819         * inspector/InspectorInstrumentation.h:
820         (WebCore::InspectorInstrumentation::instrumentingAgentsForDocument):
821         * xml/parser/XMLDocumentParserLibxml2.cpp:
822         (WebCore::XMLDocumentParser::startElementNs):
823
824 2016-04-25  Jiewen Tan  <jiewen_tan@apple.com>
825
826         [iOS] ftp links crash @ WebCore::FTPDirectoryDocumentParser::appendEntry
827         https://bugs.webkit.org/show_bug.cgi?id=157019
828         <rdar://problem/24292650>
829
830         Reviewed by Chris Dumez.
831
832         Create separate Ref<Element> object for every row element instead of reusing
833         one because Ref<>'s operator=() does not allow assignment after a WTFMove().
834
835         * html/FTPDirectoryDocument.cpp:
836         (WebCore::FTPDirectoryDocumentParser::appendEntry):
837
838 2016-04-25  Myles C. Maxfield  <mmaxfield@apple.com>
839
840         [Cocoa] Guarantee FontPlatformData's m_cgFont is never nullptr
841         https://bugs.webkit.org/show_bug.cgi?id=156929
842
843         Reviewed by Darin Adler.
844
845         After some investigation, it turns out that there is no place where it is meaningful
846         to pass us a null CoreText font. Therefore, the CoreGraphics font is also never null.
847
848         We should simply check for these null values at the ingestion site in order to
849         make the guarantee internally of having non-null values.
850
851         * platform/graphics/FontPlatformData.cpp:
852         (WebCore::FontPlatformData::FontPlatformData): Because the pointer is never null, we
853         can delete the code which handles that case.
854         * platform/graphics/FontPlatformData.h:
855         * platform/graphics/cocoa/FontPlatformDataCocoa.mm: Ditto.
856         (WebCore::webFallbackFontFamily): Deleted.
857         (WebCore::FontPlatformData::setFallbackCGFont): Deleted.
858         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
859         (WebCore::ComplexTextController::collectComplexTextRunsForCharacters): Asking the
860         CTRun for its kCTFontAttributeName will always return non-null.
861         * platform/graphics/mac/FontCustomPlatformData.cpp:
862         (WebCore::FontCustomPlatformData::fontPlatformData): Once we have a font descriptor,
863         CTFontCreateWithFontDescriptor() will always return non-null. We check if the font
864         descriptor is null elsewhere.
865         * platform/mac/DragImageMac.mm: The fonts in this file are gotten by asking for the
866         system font, which will always return non-null.
867         (WebCore::fontFromNSFont):
868         (WebCore::widthWithFont):
869         (WebCore::drawAtPoint):
870         (WebCore::createDragImageForLink):
871
872 2016-04-25  Chris Dumez  <cdumez@apple.com>
873
874         Crash under MemoryCache::remove()
875         https://bugs.webkit.org/show_bug.cgi?id=157000
876         <rdar://problem/23344660>
877
878         Reviewed by Andreas Kling.
879
880         MemoryCache::evictResources() was caching the number of resources ('size')
881         in the cache for a particular sessionID, and then proceed to call
882         MemoryCache::remove() 'size' times using the first item in the HashMap
883         each time. This was unsafe because resources may be ref'ing each other
884         and therefore removing one may cause other resources to get removed as
885         well. In such case, we would call remove() too many times and crash because
886         we dereferenced resources.begin()->value (with the HashMap being empty).
887
888         This patch avoids the issue by copying the resources to a Vector and
889         ref'ing them first, before going on to remove each one from the cache.
890
891         * loader/cache/MemoryCache.cpp:
892         (WebCore::MemoryCache::forEachSessionResource):
893         (WebCore::MemoryCache::evictResources):
894         * loader/cache/MemoryCache.h:
895
896 2016-04-25  Chris Dumez  <cdumez@apple.com>
897
898         Crash under WebCore::MutationObserver::deliverAllMutations()
899         https://bugs.webkit.org/show_bug.cgi?id=156997
900         <rdar://problem/16542323>
901
902         Reviewed by Ryosuke Niwa.
903
904         The crash traces indicate that we may derefence a null pointer when
905         dereferencing MutationCallback::scriptExecutationContext() in
906         MutationObserver::canDeliver(). This can happen when the script
907         execution context gets destroyed as a JSMutationCallback is an
908         ActiveDOMObject, which is a ContextDestructionObserver.
909
910         This patch refactors the code so that MutationObserver::canDeliver()
911         now simply asks JSMutationCallback if it can invoke its callback.
912         JSMutationCallback makes this decision using
913         ActiveDOMCallback::canInvokeCallback() which does a proper null
914         check of the ScriptExecutationContext. This avoids some code
915         duplication and fixes the crash.
916
917         * bindings/js/JSMutationCallback.h:
918         * dom/MutationCallback.h:
919         * dom/MutationObserver.cpp:
920         (WebCore::MutationObserver::canDeliver):
921
922 2016-04-25  Brady Eidson  <beidson@apple.com>
923
924         Fix a flaky test after r200032
925
926         * fileapi/File.cpp:
927         (WebCore::File::lastModified): This used to return a date object which did a WTF::timeClip on the double,
928           but now that we're returning a raw double we need to WTF::timeClip it ourselves.
929
930 2016-04-25  Chris Dumez  <cdumez@apple.com>
931
932         [Web IDL] Specify default values for optional parameters of type 'float' / 'unrestricted float'
933         https://bugs.webkit.org/show_bug.cgi?id=156995
934
935         Reviewed by Darin Adler.
936
937         Specify default values for optional parameters of type 'float' / 'unrestricted float'
938         and let the bindings generator use WTF::Optional<> for the ones that do not have a
939         default value.
940
941         * bindings/scripts/CodeGeneratorJS.pm:
942         (CanUseWTFOptionalForParameter): Deleted.
943         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
944         (WebCore::jsTestTypedefsPrototypeFunctionSetShadow):
945         * html/canvas/CanvasRenderingContext2D.cpp:
946         (WebCore::CanvasRenderingContext2D::setStrokeColor):
947         (WebCore::CanvasRenderingContext2D::setFillColor):
948         (WebCore::CanvasRenderingContext2D::setShadow):
949         (WebCore::CanvasRenderingContext2D::fillText):
950         (WebCore::CanvasRenderingContext2D::strokeText):
951         (WebCore::CanvasRenderingContext2D::drawTextInternal):
952         (WebCore::CanvasRenderingContext2D::clearShadow): Deleted.
953         (WebCore::normalizeSpaces): Deleted.
954         (WebCore::CanvasRenderingContext2D::measureText): Deleted.
955         * html/canvas/CanvasRenderingContext2D.h:
956         * html/canvas/CanvasRenderingContext2D.idl:
957         * testing/Internals.idl:
958
959 2016-04-25  Brent Fulgham  <bfulgham@apple.com>
960
961         Add port 4190 (managesieve) to port blacklist
962         https://bugs.webkit.org/show_bug.cgi?id=156986
963         <rdar://problem/9119470>
964
965         Reviewed by Daniel Bates.
966
967         Tested by security/block-test.html.
968
969         * platform/URL.cpp:
970         (WebCore::portAllowed): Add 4190 to the port blacklist.
971
972 2016-04-25  Nan Wang  <n_wang@apple.com>
973
974         AX: Crash at -[WebAccessibilityObjectWrapper accessibilityAttributeValue:] + 4391
975         https://bugs.webkit.org/show_bug.cgi?id=156987
976
977         Reviewed by Chris Fleizach.
978
979         When we hit test on a slider indicator asking for the value when the parent slider's
980         accessibility object is not created or the parent slider has been removed, it will cause
981         crash. Fixed it by adding a check to see if the object is detached from the parent. 
982
983         Test: accessibility/mac/slider-thumb-value-crash.html
984
985         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
986         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
987
988 2016-04-25  Jer Noble  <jer.noble@apple.com>
989
990         WebKitPlaybackSessionModelMediaElement should initialize the interface added by setWebPlaybackSessionInterface() with initial data
991         https://bugs.webkit.org/show_bug.cgi?id=156996
992
993         Reviewed by Beth Dakin.
994
995         Notify the interface of the current values in the media element when the model is given an interface.
996
997         * platform/cocoa/WebPlaybackSessionModelMediaElement.mm:
998         (WebPlaybackSessionModelMediaElement::setWebPlaybackSessionInterface):
999
1000 2016-04-25  Simon Fraser  <simon.fraser@apple.com>
1001
1002         Toggling animation-play-state can re-start a finished animation
1003         https://bugs.webkit.org/show_bug.cgi?id=156731
1004
1005         Reviewed by Dean Jackson.
1006
1007         After an animation completed, CompositeAnimation::updateKeyframeAnimations() cleared
1008         all state that the animation had run on the element, so changing the value of some
1009         animation property triggered the animation to run again. This is wrong, since animation-name
1010         still applied to the element.
1011
1012         Fix by keeping state for keyframe animations in the Done state in the m_keyframeAnimations
1013         map. This allows for the removal of the index property on KeyframeAnimation.
1014
1015         Tests: animations/change-completed-animation-transform.html
1016                animations/change-completed-animation.html
1017
1018         * page/animation/AnimationBase.cpp:
1019         (WebCore::AnimationBase::timeToNextService):
1020         * page/animation/AnimationBase.h:
1021         (WebCore::AnimationBase::isAnimatingProperty):
1022         * page/animation/CompositeAnimation.cpp: Add animations that should stick around to AnimationNameMap,
1023         and swap with m_keyframeAnimations at the end.
1024         (WebCore::CompositeAnimation::updateKeyframeAnimations):
1025         * page/animation/KeyframeAnimation.cpp:
1026         (WebCore::KeyframeAnimation::KeyframeAnimation):
1027         (WebCore::KeyframeAnimation::getAnimatedStyle):
1028         * page/animation/KeyframeAnimation.h:
1029
1030 2016-04-25  Alberto Garcia  <berto@igalia.com>
1031
1032         [GTK] Crashes if DISPLAY is unset
1033         https://bugs.webkit.org/show_bug.cgi?id=156972
1034
1035         Reviewed by Carlos Garcia Campos.
1036
1037         If DISPLAY is unset then m_display will be NULL, crashing WebKit
1038         when XCloseDisplay is called in the PlatformDisplayX11 destructor.
1039
1040         * platform/graphics/x11/PlatformDisplayX11.cpp:
1041         (WebCore::PlatformDisplayX11::~PlatformDisplayX11):
1042
1043 2016-04-25  Ryan Haddad  <ryanhaddad@apple.com>
1044
1045         Update JS bindings test results after r200037
1046
1047         Unreviewed test gardening.
1048
1049         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
1050         (WebCore::jsTestTypedefsPrototypeFunctionFuncWithClamp):
1051
1052 2016-04-25  Simon Fraser  <simon.fraser@apple.com>
1053
1054         play-state not parsed as part of animation shorthand
1055         https://bugs.webkit.org/show_bug.cgi?id=156959
1056
1057         Reviewed by Darin Adler.
1058
1059         We failed to parse animation-play-state as part of the animation shorthand, contrary
1060         to the spec and other browsers.
1061
1062         Fix for both the prefixed and unprefixed properties. There is some compat risk here,
1063         but only changing unprefixed behavior will probably lead to more author confusion.
1064
1065         Test: animations/play-state-in-shorthand.html
1066
1067         * css/CSSParser.cpp:
1068         (WebCore::CSSParser::parseAnimationShorthand):
1069         * css/CSSPropertyNames.in:
1070         * css/StylePropertyShorthand.cpp:
1071         (WebCore::animationShorthandForParsing): Remove the long comment which is no longer relevant
1072         now that the behavior has been written into the spec.
1073
1074 2016-04-25  Simon Fraser  <simon.fraser@apple.com>
1075
1076         Negative animation-delay is treated as 0s
1077         https://bugs.webkit.org/show_bug.cgi?id=141008
1078
1079         Reviewed by Daniel Bates.
1080         
1081         Fix keyframe animations which start in the paused state.
1082         
1083         Explicitly move such animations from the new to the paused state, and
1084         set m_pauseTime to 0, rather than leaving it at -1. Fix getElapsedTime()
1085         to compute a correct time elapsed time for such animations, which takes
1086         negative delay into account correctly.
1087         
1088         Fix assertions which need to account for the new transition of New -> PlayStatePaused.
1089
1090         Test: animations/play-state-start-paused.html
1091
1092         * page/animation/AnimationBase.cpp:
1093         (WebCore::AnimationBase::updateStateMachine):
1094         (WebCore::AnimationBase::getElapsedTime):
1095         * page/animation/KeyframeAnimation.cpp:
1096         (WebCore::KeyframeAnimation::animate):
1097
1098 2016-04-25  Antti Koivisto  <antti@apple.com>
1099
1100         Inline RenderStyle into RenderElement
1101         https://bugs.webkit.org/show_bug.cgi?id=156981
1102
1103         Reviewed by Andreas Kling.
1104
1105         We can save memory and reduce indirection of style access by inlining RenderStyle to RenderElement.
1106
1107         This patch also makes RenderStyle moveable and switches from std::unique_ptr<RenderStyle> to RenderStyle&&
1108         in many places where ownership is passed.
1109
1110         * Modules/plugins/PluginReplacement.h:
1111         (WebCore::PluginReplacement::scriptObject):
1112         (WebCore::PluginReplacement::willCreateRenderer):
1113         * Modules/plugins/QuickTimePluginReplacement.h:
1114         * Modules/plugins/QuickTimePluginReplacement.mm:
1115         (WebCore::QuickTimePluginReplacement::~QuickTimePluginReplacement):
1116         (WebCore::QuickTimePluginReplacement::createElementRenderer):
1117         * Modules/plugins/YouTubePluginReplacement.cpp:
1118         (WebCore::YouTubePluginReplacement::YouTubePluginReplacement):
1119         (WebCore::YouTubePluginReplacement::createElementRenderer):
1120         * Modules/plugins/YouTubePluginReplacement.h:
1121         * css/StyleResolver.cpp:
1122         (WebCore::StyleResolver::styleForElement):
1123         (WebCore::StyleResolver::styleForKeyframe):
1124         (WebCore::StyleResolver::pseudoStyleForElement):
1125         (WebCore::StyleResolver::styleForPage):
1126         (WebCore::StyleResolver::defaultStyleForElement):
1127         (WebCore::StyleResolver::addToMatchedPropertiesCache):
1128         (WebCore::StyleResolver::applyPropertyToStyle):
1129         * dom/Document.cpp:
1130         (WebCore::Document::recalcStyle):
1131         (WebCore::Document::webkitWillEnterFullScreenForElement):
1132         (WebCore::Document::setFullScreenRenderer):
1133         * dom/Element.cpp:
1134         (WebCore::Element::rendererIsNeeded):
1135         (WebCore::Element::createElementRenderer):
1136         * dom/Element.h:
1137         (WebCore::Element::copyNonAttributePropertiesFromElement):
1138         * dom/PseudoElement.cpp:
1139         (WebCore::PseudoElement::resolveCustomStyle):
1140         (WebCore::PseudoElement::didAttachRenderers):
1141         (WebCore::PseudoElement::didRecalcStyle):
1142         * html/BaseButtonInputType.cpp:
1143         (WebCore::BaseButtonInputType::appendFormData):
1144         (WebCore::BaseButtonInputType::createInputRenderer):
1145         * html/BaseButtonInputType.h:
1146         * html/FileInputType.cpp:
1147         (WebCore::FileInputType::handleDOMActivateEvent):
1148         (WebCore::FileInputType::createInputRenderer):
1149         * html/FileInputType.h:
1150         * html/HTMLAppletElement.cpp:
1151         (WebCore::HTMLAppletElement::rendererIsNeeded):
1152         (WebCore::HTMLAppletElement::createElementRenderer):
1153
1154         ...
1155
1156 2016-04-25  Eric Carlson  <eric.carlson@apple.com>
1157
1158         Stop listening for "media can start" notifications when media player is cleared
1159         https://bugs.webkit.org/show_bug.cgi?id=156985
1160         <rdar://problem/23158505>
1161
1162         Reviewed by Jer Noble.
1163
1164         No new tests, I have not been able to create a test that reliably reproduces this.
1165
1166         * html/HTMLMediaElement.cpp:
1167         (WebCore::HTMLMediaElement::loadInternal): Add logging.
1168         (WebCore::HTMLMediaElement::selectMediaResource): Assert and return early if there is
1169           no media player.
1170         (WebCore::HTMLMediaElement::clearMediaPlayer): Stop listening for can start notifications.
1171         (WebCore::HTMLMediaElement::visibilityStateChanged): Add logging.
1172         (WebCore::HTMLMediaElement::mediaCanStart): Ditto.
1173
1174 2016-04-25  Chris Dumez  <cdumez@apple.com>
1175
1176         [Web IDL] Specify default values for parameters of type 'unsigned short'
1177         https://bugs.webkit.org/show_bug.cgi?id=156967
1178
1179         Reviewed by Darin Adler.
1180
1181         Specify default values for parameters of type 'unsigned short' and let
1182         the bindings generator use WTF::Optional<> for the ones without a
1183         default value.
1184
1185         * bindings/scripts/CodeGeneratorJS.pm:
1186         (CanUseWTFOptionalForParameter):
1187         (GenerateParametersCheck):
1188         * testing/Internals.cpp:
1189         (WebCore::Internals::layerTreeAsText): Deleted.
1190         (WebCore::Internals::displayListForElement): Deleted.
1191         (WebCore::Internals::replayDisplayListForElement): Deleted.
1192         * testing/Internals.h:
1193         * testing/Internals.idl:
1194
1195 2016-04-25  Per Arne Vollan  <peavo@outlook.com>
1196
1197         [Win][IndexedDB] Fix build errors.
1198         https://bugs.webkit.org/show_bug.cgi?id=156713
1199
1200         Reviewed by Alex Christensen.
1201
1202         Fix compile and link errors when building with IndexedDB enabled.
1203
1204         * Modules/indexeddb/IDBCursor.h:
1205         * Modules/indexeddb/IDBTransaction.cpp:
1206         * Modules/indexeddb/server/MemoryBackingStoreTransaction.h:
1207         * Modules/indexeddb/server/MemoryIDBBackingStore.h:
1208         * PlatformWin.cmake:
1209         * platform/win/FileSystemWin.cpp:
1210         (WebCore::hardLinkOrCopyFile):
1211
1212 2016-04-25  Brady Eidson  <beidson@apple.com>
1213
1214         Implement latest File object spec (including its constructor).
1215         https://bugs.webkit.org/show_bug.cgi?id=156511
1216
1217         Reviewed by Darin Adler.
1218
1219         Test: fast/files/file-constructor.html
1220
1221         * CMakeLists.txt:
1222         * WebCore.xcodeproj/project.pbxproj:
1223
1224         * bindings/js/JSDictionary.cpp:
1225         (WebCore::JSDictionary::convertValue):
1226         * bindings/js/JSDictionary.h:
1227
1228         * bindings/js/JSFileCustom.cpp: Added.
1229         (WebCore::constructJSFile):
1230
1231         * fileapi/File.cpp:
1232         (WebCore::File::File):
1233         (WebCore::File::lastModified):
1234         (WebCore::File::lastModifiedDate): Deleted.
1235         * fileapi/File.h:
1236         * fileapi/File.idl:
1237
1238
1239
1240 2016-04-25  Antti Koivisto  <antti@apple.com>
1241
1242         REGRESSION(r156846): Crashes with guard malloc
1243         https://bugs.webkit.org/show_bug.cgi?id=156984
1244
1245         Reviewed by Andreas Kling.
1246
1247         RenderElement::cachedFirstLineStyle() returns pointer to local std::unique_ptr.
1248
1249         * rendering/RenderElement.cpp:
1250         (WebCore::RenderElement::uncachedFirstLineStyle):
1251         (WebCore::RenderElement::cachedFirstLineStyle):
1252         (WebCore::RenderElement::firstLineStyle):
1253         (WebCore::firstLineStyleForCachedUncachedType): Deleted.
1254
1255             Don't try to use a single function for the cached and uncached cases. Separate the cases into the calling functions.
1256
1257 2016-04-25  Daniel Bates  <dabates@apple.com>
1258
1259         REGRESSION (r196012): Subresource may be blocked by Content Security Policy if it only matches 'self'
1260         https://bugs.webkit.org/show_bug.cgi?id=156935
1261         <rdar://problem/25351286>
1262
1263         Reviewed by Darin Adler.
1264
1265         Fixes an issue where subresource load may be blocked by the Content Security Policy (CSP) if its URL only
1266         matched 'self'. In particular, the load would be blocked if initiated from a document that inherited the
1267         origin of its owner document (e.g. the document contained in <iframe src="about:blank"></iframe>).
1268
1269         Following r196012 we compute and cache 'self' and its protocol on instantiation of a ContentSecurityPolicy
1270         object for use when matching a URL against it. These cached values become out-of-date if the document
1271         subsequently inherits the origin of its owner document. Therefore matches against 'self' will fail and
1272         CSP will block a load if its not otherwise allowed by the policy. Previously we would compute 'self' when
1273         parsing the definition of a source list and compute the protocol for 'self' each time we tried to match a
1274         URL against 'self'. So, 'self' would always be up-to-date with respect to the origin of the document.
1275
1276         Tests: http/tests/security/contentSecurityPolicy/iframe-blank-url-programmatically-add-external-script.html
1277                http/tests/security/contentSecurityPolicy/iframe-srcdoc-external-script.html
1278
1279         * page/csp/ContentSecurityPolicy.cpp:
1280         (WebCore::ContentSecurityPolicy::ContentSecurityPolicy): Extract out logic for computing and caching
1281         'self' and its protocol into ContentSecurityPolicy::updateSourceSelf() and make use of this function.
1282         (WebCore::ContentSecurityPolicy::updateSourceSelf): Computes and caches 'self' and its protocol with
1283         respect to the specified SecurityOrigin.
1284         (WebCore::ContentSecurityPolicy::applyPolicyToScriptExecutionContext): Call ContentSecurityPolicy::updateSourceSelf()
1285         to ensure that we have an up-to-date representation for 'self' and the protocol of 'self' which can
1286         become out-of-date if the document inherited the origin of its owner document.
1287         * page/csp/ContentSecurityPolicy.h:
1288
1289 2016-04-25  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1290
1291         Drop [UsePointersEvenForNonNullableObjectArguments] from TextTrack
1292         https://bugs.webkit.org/show_bug.cgi?id=156899
1293
1294         Reviewed by Chris Dumez.
1295
1296         No behavior changes.
1297
1298         * html/track/TextTrack.idl: Marking cue and region parameter as nullable.
1299         Also marking cues and activeCues as nullable attributes.
1300
1301 2016-04-25  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1302
1303         Drop [UsePointersEvenForNonNullableObjectArguments] from File API interfaces
1304         https://bugs.webkit.org/show_bug.cgi?id=156898
1305
1306         Reviewed by Chris Dumez.
1307
1308         Making FileReaderSync API API throwing a TypeError in case of null parameters, in lieu of a NOT_FOUND_ERR.
1309         Making FileReader API taking nullable parameters as a temporary fix.
1310
1311         Test: fast/files/workers/worker-file-reader-sync-bad-parameter.html
1312
1313         * Modules/websockets/WebSocketChannel.cpp:
1314         (WebCore::WebSocketChannel::processOutgoingFrameQueue): Updated to cope with FileReaderLoader::start taking a Blob&.
1315         * fileapi/FileReader.cpp:
1316         (WebCore::FileReader::readAsArrayBuffer): Updated to cope with readInternal taking a Blob&.
1317         (WebCore::FileReader::readAsBinaryString): Ditto.
1318         (WebCore::FileReader::readAsText): Ditto.
1319         (WebCore::FileReader::readAsDataURL): Ditto.
1320         (WebCore::FileReader::readInternal):  Updated to cope with FileReaderLoader::start taking a Blob&.
1321         * fileapi/FileReader.h:
1322         * fileapi/FileReader.idl: Marking the readXX methods as taking a nullable blob parameter to keep compatibility, at least temporarily.
1323         * fileapi/FileReaderLoader.cpp:
1324         (WebCore::FileReaderLoader::start): It now takes a Blob& as input.
1325         * fileapi/FileReaderLoader.h:
1326         * fileapi/FileReaderSync.cpp:
1327         (WebCore::FileReaderSync::readAsArrayBuffer): Taking a Blob& as input.
1328         (WebCore::FileReaderSync::readAsBinaryString): Ditto.
1329         (WebCore::FileReaderSync::readAsText): Ditto.
1330         (WebCore::FileReaderSync::readAsDataURL): Ditto.
1331         (WebCore::FileReaderSync::startLoading) Ditto.
1332         * fileapi/FileReaderSync.h:
1333         (WebCore::FileReaderSync::readAsText): Ditto.
1334         * fileapi/FileReaderSync.idl:
1335
1336 2016-04-25  Manuel Rego Casasnovas  <rego@igalia.com>
1337
1338         [css-grid] Fix grid-template-columns|rows computed style with content alignment
1339         https://bugs.webkit.org/show_bug.cgi?id=156793
1340
1341         Reviewed by Darin Adler.
1342
1343         Computed style of grid-template-columns and grid-template-rows properties
1344         was including the distribution offset because of content alignment.
1345         We should subtract that offset, like we do for the case of gaps,
1346         when we're calculating the computed style.
1347
1348         Test: fast/css-grid-layout/grid-template-columns-rows-computed-style-gaps-content-alignment.html
1349
1350         * css/CSSComputedStyleDeclaration.cpp:
1351         (WebCore::valueForGridTrackList):
1352         * rendering/RenderGrid.cpp:
1353         (WebCore::RenderGrid::offsetBetweenTracks):
1354         (WebCore::RenderGrid::populateGridPositions): Deleted FIXME.
1355         * rendering/RenderGrid.h:
1356
1357 2016-04-25  Frederic Wang  <fwang@igalia.com>
1358
1359         Refactor RenderMathMLMenclose.
1360         https://bugs.webkit.org/show_bug.cgi?id=155019
1361
1362         Reviewed by Sergio Villar Senin.
1363
1364         Tests: mathml/presentation/menclose-notation-equivalence.html
1365                mathml/presentation/menclose-notation-values.html
1366
1367         We rewrite RenderMathMLMenclose so that layout functions correctly override the
1368         behavior of RenderMathMLRow. We try and rely on the draft  of the MathML in HTML5
1369         implementation note, to make easier to get consistency with other rendering engines
1370         in the future. All notations are now drawn with GraphicContext functions instead of
1371         mixing them with CSS style. To save memory space, the list of known notations are
1372         now saved on a short integer using bit masks instead of a vector of string names.
1373         Finally, we remove support for the radical notation so that we no longer need to
1374         create an anonymous RenderMathMLRoot.
1375
1376         * mathml/MathMLMencloseElement.cpp: Remove code for some special notations and just
1377         reimplement parsing of the notation attribute.
1378         (WebCore::MathMLMencloseElement::MathMLMencloseElement): By default, the notation is longdiv.
1379         (WebCore::MathMLMencloseElement::parseAttribute): By default, the list of notation is empty.
1380         If there is no notation attribute, the default value longdiv is used.
1381         Otherwise, we parse the notation attribute and add each notation, using some equivalences
1382         for box, actuarial and madruwb.
1383         (WebCore::MathMLMencloseElement::isPresentationAttribute): Deleted. No need to define
1384         specific style for some notation.
1385         (WebCore::MathMLMencloseElement::finishParsingChildren): Deleted. No need to add an
1386         anonymous square root.
1387         (WebCore::MathMLMencloseElement::collectStyleForPresentationAttribute): Deleted. No need to
1388         define specific style for some notation.
1389         (WebCore::MathMLMencloseElement::longDivLeftPadding): Deleted. RenderMathMLMenclose uses an
1390         arbitrary size instead of measure a glyph.
1391         * mathml/MathMLMencloseElement.h: Define simple bit mask for each notation, add a short
1392         integer to store the list of notations together with helper functions. Remove old code.
1393         * rendering/mathml/RenderMathMLMenclose.cpp: Rewrite RenderMathMLMenclose so that layout
1394         functions correctly override the behavior of RenderMathMLRow.
1395         (WebCore::RenderMathMLMenclose::RenderMathMLMenclose): Init m_ascent to 0.
1396         (WebCore::RenderMathMLMenclose::ruleThickness): For now, we use the fallback value used by
1397         for other bars. We may refine that in the future.
1398         (WebCore::RenderMathMLMenclose::getSpaceAroundContent): Helper function to retrieve the
1399         space to add around the content, depending on the notations specified. Note that for
1400         notation circle, this spacing depends on the content size.
1401         (WebCore::RenderMathMLMenclose::computePreferredLogicalWidths): Reimplement this function.
1402         This is just adding left/right spacing around the content.
1403         (WebCore::RenderMathMLMenclose::layoutBlock): Reimplement this function. We do the normal
1404         RenderMathMLRow layout, adjust spacing and child position and
1405         calculate m_ascent and m_contentRect.
1406         (WebCore::RenderMathMLMenclose::firstLineBaseline): Implement this function.
1407         We just return m_ascent.
1408         (WebCore::drawLine): Helper function to draw a line using strokePath.
1409         (WebCore::RenderMathMLMenclose::paint): We reimplement this function to draw
1410         all notations using GraphicContext.
1411         (WebCore::RenderMathMLMenclose::addChild): Deleted. No need to manage anonymous renderers.
1412         (WebCore::RenderMathMLMenclose::updateLogicalHeight): Deleted. Height is now calculated
1413         in layoutBlock.
1414         (WebCore::RenderMathMLMenclose::checkNotationalValuesValidity): Deleted.
1415         * rendering/mathml/RenderMathMLMenclose.h: Update member definitions.
1416         * rendering/mathml/RenderMathMLRoot.cpp: We no longer need anonymous roots.
1417         (WebCore::RenderMathMLRoot::RenderMathMLRoot): Deleted.
1418         * rendering/mathml/RenderMathMLRoot.h: We no longer need anonymous roots.
1419         * rendering/mathml/RenderMathMLRow.cpp: Allow to get the exact metrics of the chid row,
1420         for use in RenderMathMLRoot.
1421         (WebCore::RenderMathMLRow::computeLineVerticalStretch): rename parameters.
1422         (WebCore::RenderMathMLRow::layoutRowItems): Set parameters to the final ascent, descent and
1423         logical width of the chid row. Set the temporary logical width for RenderMathMenclose before
1424         laying the children out.
1425         (WebCore::RenderMathMLRow::layoutBlock): Rename parameters ; add a dummy logicalWidth
1426         parameter.
1427         * rendering/mathml/RenderMathMLRow.h: Make some functions accessible or overridable by
1428         RenderMathMLRoot. Make layoutRowItems return the final ascent, descent and logical width
1429         after the chid row is laid out.
1430         * rendering/mathml/RenderMathMLSquareRoot.cpp: We no longer need anonymous roots.
1431         (WebCore::RenderMathMLSquareRoot::RenderMathMLSquareRoot): Deleted.
1432         (WebCore::RenderMathMLSquareRoot::createAnonymousWithParentRenderer): Deleted.
1433         * rendering/mathml/RenderMathMLSquareRoot.h: We no longer need anonymous roots.
1434
1435 2016-04-25  Frederic Wang  <fwang@igalia.com>
1436
1437         Minor refactoring in RenderMathMLOperator
1438         https://bugs.webkit.org/show_bug.cgi?id=156906
1439
1440         Reviewed by Martin Robinson.
1441
1442         No new tests, this is only minor refactoring that does not change the behavior.
1443
1444         * rendering/mathml/RenderMathMLOperator.cpp:
1445         (WebCore::RenderMathMLOperator::getGlyphAssemblyFallBack):
1446         We rename the "state" integer to an "expected" enum indicating the next expected part.
1447         (WebCore::RenderMathMLOperator::paintGlyph): We add a missing dot at the end of a sequence.
1448         We also replace ceil(x+1) with ceil(x)+1 to get rid of the temporary variable.
1449
1450 2016-04-24  Chris Dumez  <cdumez@apple.com>
1451
1452         [Web IDL] Specify default values for boolean parameters
1453         https://bugs.webkit.org/show_bug.cgi?id=156964
1454
1455         Reviewed by Darin Adler.
1456
1457         Specify default values for boolean parameters in our IDL files and
1458         let the bindings generator use WTF::Optional<> for the ones without
1459         a default value.
1460
1461         * CMakeLists.txt:
1462         * Modules/indexeddb/IDBKeyRange.cpp:
1463         * Modules/indexeddb/IDBKeyRange.h:
1464         * Modules/indexeddb/IDBKeyRange.idl:
1465         * WebCore.xcodeproj/project.pbxproj:
1466         * bindings/js/JSBindingsAllInOne.cpp:
1467
1468         * bindings/js/JSDOMTokenListCustom.cpp: Removed.
1469         We no longer need these custom bindings as the bindings generator
1470         will now provide the implementation with an Optional<bool>, given
1471         that the parameter has no default value.
1472
1473         * bindings/scripts/CodeGeneratorJS.pm:
1474         (CanUseWTFOptionalForParameterType): Deleted.
1475         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
1476         (webkit_dom_test_obj_method_with_optional_boolean):
1477         (webkit_dom_test_obj_method_with_optional_boolean_is_false):
1478         * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
1479         * bindings/scripts/test/JS/JSTestObj.cpp:
1480         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalBoolean):
1481         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalBooleanIsFalse):
1482         * bindings/scripts/test/ObjC/DOMTestObj.h:
1483         * bindings/scripts/test/ObjC/DOMTestObj.mm:
1484         (-[DOMTestObj methodWithOptionalBoolean:]):
1485         (-[DOMTestObj methodWithOptionalBooleanIsFalse:]):
1486         * bindings/scripts/test/TestObj.idl:
1487         * dom/Document.h:
1488         * dom/Document.idl:
1489         * dom/Element.idl:
1490         * dom/EventTarget.idl:
1491         * html/DOMTokenList.idl:
1492
1493 2016-04-24  Chris Dumez  <cdumez@apple.com>
1494
1495         Autogenerated IDBFactory.open() does the wrong thing if you pass an explicit 'undefined' as the second argument
1496         https://bugs.webkit.org/show_bug.cgi?id=156939
1497
1498         Reviewed by Darin Adler.
1499
1500         As per WebIDL, if undefined is passed by JS for an optional parameter then
1501         we should use its default value if it has one, or use the special value
1502         "missing":
1503         http://heycam.github.io/webidl/#es-overloads (step 10.4)
1504
1505         Our bindings generator was already mapping undefined to the parameter's
1506         default value when present. However, it was missing the notion of
1507         "missing" value when there no default value. This patch adds supports
1508         for its by passing Optional<>(Nullopt) to the implementation in such
1509         case. This means that the implementation will need to use WTF::Optional<>
1510         type for parameters that do not have a default value. Thankfully though,
1511         in most cases, we will be able to specify a default value in the IDL
1512         so cases where we will need to use WTF::Optional<> will actually be
1513         rare.
1514
1515         To avoid having to do too much refactoring in this patch, the support
1516         for WTF::Optional is currently blacklisted for most IDL types. I will
1517         gradually stop blacklisting each type in follow-up patches, as I either:
1518         - Add default parameter values in our IDL (preferred)
1519         - Use WTF::Optional<> in our implementation (when we cannot specify a
1520           default value).
1521
1522         This patch fixes a bug with IDBFactory.open()'s second parameter (version)
1523         for which undefined should not throw and indicate that the version
1524         should not be changed. We now use WTF::Optional in the implementation to
1525         distinguish this case and not throw.
1526
1527         No new tests, existing tests were updated / rebaselined.
1528
1529         * Modules/indexeddb/IDBFactory.cpp:
1530         (WebCore::IDBFactory::open):
1531         (WebCore::IDBFactory::openInternal): Deleted.
1532         * Modules/indexeddb/IDBFactory.h:
1533         * bindings/scripts/CodeGeneratorJS.pm:
1534         (ShouldUseWTFOptionalForParameterType):
1535         (GenerateParametersCheck):
1536         * fileapi/Blob.idl:
1537         * inspector/InspectorIndexedDBAgent.cpp:
1538
1539 2016-04-23  Chris Dumez  <cdumez@apple.com>
1540
1541         [WebIDL] Drop [Default] WebKit-IDL extended attribute
1542         https://bugs.webkit.org/show_bug.cgi?id=156955
1543
1544         Reviewed by Darin Adler.
1545
1546         Drop [Default] WebKit-IDL extended attribute in favor of the standard
1547         WebIDL syntax for parameters' default value.
1548
1549         Here is what it looks like:
1550         [Default=NullString] optional DOMString a -> optional DOMString a = null
1551         [Default=NullString] optional DOMString? a -> optional DOMString? a = null
1552         [Default=Undefined] optional DOMString a -> optional DOMString a = "undefined"
1553         [Default=Undefined] optional DOMString? a -> optional DOMString? a = null
1554         [Default=Undefined] optional long a -> optional long a = 0
1555         [Default=Undefined] optional bool a -> optional bool a = false
1556         [Default=Undefined] optional unrestricted double a -> optional unrestricted double a = NaN
1557         [Default=Undefined] optional unrestricted float a -> optional unrestricted float a = NaN
1558         [Default=Undefined] optional sequence<DOMString> a -> optional sequence<DOMString> a = []
1559
1560         These do not cause any Web-Exposed behavior change. However, when getting
1561         rid of [Default] started passing more parameters by derefence instead of
1562         pointer (as is expected for parameters not marked as nullable). As a result,
1563         I had to mark a few parameters as nullable in the IDL to maintain the
1564         previous behavior. In some cases, the implementation was already throwing
1565         when passing null. In such cases, I have not marked the type as nullable
1566         so that the generated bindings now throw the exception instead of our
1567         implementation code. In some cases, the exception being thrown is now
1568         different. This is why some of the layout tests had to be rebaselined.
1569
1570         No new tests, existing tests have been rebaselined. No significant Web
1571         exposed behavior change is expected from this patch, beside exceptions
1572         type sometimes being different.
1573
1574         * Modules/encryptedmedia/MediaKeys.idl:
1575         * Modules/fetch/FetchRequest.idl:
1576         * Modules/gamepad/deprecated/GamepadList.idl:
1577         * Modules/indexeddb/IDBDatabase.idl:
1578         * Modules/mediastream/RTCStatsResponse.idl:
1579         * Modules/notifications/Notification.idl:
1580         * Modules/speech/SpeechSynthesisUtterance.idl:
1581         * Modules/webaudio/AudioNode.idl:
1582         * Modules/websockets/WebSocket.idl:
1583         * bindings/scripts/CodeGeneratorJS.pm:
1584         (GenerateParametersCheck):
1585         * bindings/scripts/IDLAttributes.txt:
1586         * bindings/scripts/IDLParser.pm:
1587         (parseDefault):
1588         (parseDefaultValue):
1589         * bindings/scripts/test/TestInterface.idl:
1590         * bindings/scripts/test/TestNamedConstructor.idl:
1591         * bindings/scripts/test/TestObj.idl:
1592         * bindings/scripts/test/TestOverrideBuiltins.idl:
1593         * css/CSSKeyframesRule.idl:
1594         * css/CSSMediaRule.idl:
1595         * css/CSSPrimitiveValue.idl:
1596         * css/CSSRuleList.idl:
1597         * css/CSSStyleDeclaration.idl:
1598         * css/CSSStyleSheet.idl:
1599         * css/CSSSupportsRule.idl:
1600         * css/CSSValueList.idl:
1601         * css/MediaList.idl:
1602         * css/MediaQueryList.idl:
1603         * css/MediaQueryListListener.idl:
1604         * css/StyleMedia.idl:
1605         * css/StyleSheetList.idl:
1606         * css/WebKitCSSFilterValue.idl:
1607         * css/WebKitCSSMatrix.idl:
1608         * css/WebKitCSSTransformValue.idl:
1609         * dom/ClientRectList.idl:
1610         * dom/Comment.idl:
1611         * dom/CompositionEvent.idl:
1612         * dom/CustomEvent.h:
1613         * dom/CustomEvent.idl:
1614         * dom/DOMImplementation.idl:
1615         * dom/DOMStringList.idl:
1616         * dom/DataTransferItem.idl:
1617         * dom/DataTransferItemList.idl:
1618         * dom/DeviceMotionEvent.idl:
1619         * dom/DeviceOrientationEvent.idl:
1620         * dom/Document.cpp:
1621         (WebCore::Document::adoptNode):
1622         * dom/Document.idl:
1623         * dom/Element.cpp:
1624         (WebCore::Element::setAttributeNode):
1625         (WebCore::Element::setAttributeNodeNS):
1626         (WebCore::Element::removeAttributeNode):
1627         (WebCore::Element::parseAttributeName): Deleted.
1628         * dom/Element.h:
1629         * dom/Element.idl:
1630         * dom/Event.idl:
1631         * dom/HashChangeEvent.idl:
1632         * dom/KeyboardEvent.idl:
1633         * dom/MessageEvent.idl:
1634         * dom/MouseEvent.idl:
1635         * dom/MutationEvent.idl:
1636         * dom/NamedNodeMap.cpp:
1637         (WebCore::NamedNodeMap::setNamedItem):
1638         (WebCore::NamedNodeMap::setNamedItemNS):
1639         (WebCore::NamedNodeMap::item): Deleted.
1640         * dom/NamedNodeMap.h:
1641         * dom/NamedNodeMap.idl:
1642         * dom/Node.idl:
1643         * dom/NodeFilter.idl:
1644         * dom/NonElementParentNode.idl:
1645         * dom/OverflowEvent.idl:
1646         * dom/Range.idl:
1647         * dom/Text.idl:
1648         * dom/TextEvent.idl:
1649         * dom/TouchEvent.idl:
1650         * dom/UIEvent.idl:
1651         * dom/WheelEvent.idl:
1652         * html/DOMFormData.idl:
1653         * html/HTMLAllCollection.idl:
1654         * html/HTMLAudioElement.idl:
1655         * html/HTMLCanvasElement.idl:
1656         * html/HTMLCollection.idl:
1657         * html/HTMLDocument.idl:
1658         * html/HTMLElement.cpp:
1659         (WebCore::HTMLElement::insertAdjacentElement):
1660         (WebCore::contextElementForInsertion): Deleted.
1661         * html/HTMLElement.h:
1662         * html/HTMLElement.idl:
1663         * html/HTMLFormControlsCollection.idl:
1664         * html/HTMLInputElement.idl:
1665         * html/HTMLMediaElement.idl:
1666         * html/HTMLOptionElement.idl:
1667         * html/HTMLOptionsCollection.idl:
1668         * html/HTMLSelectElement.idl:
1669         * html/HTMLTableElement.idl:
1670         * html/HTMLTableRowElement.idl:
1671         * html/HTMLTableSectionElement.idl:
1672         * html/HTMLTextAreaElement.idl:
1673         * html/ImageData.idl:
1674         * html/canvas/CanvasGradient.idl:
1675         * html/canvas/CanvasRenderingContext2D.idl:
1676         * html/canvas/DOMPath.idl:
1677         * html/canvas/OESVertexArrayObject.idl:
1678         * page/DOMSelection.cpp:
1679         (WebCore::DOMSelection::extend):
1680         (WebCore::DOMSelection::getRangeAt): Deleted.
1681         * page/DOMSelection.h:
1682         * page/DOMSelection.idl:
1683         * page/DOMWindow.idl:
1684         * page/History.idl:
1685         * page/Performance.idl:
1686         * page/WindowTimers.idl:
1687         * plugins/DOMMimeTypeArray.idl:
1688         * plugins/DOMPlugin.idl:
1689         * plugins/DOMPluginArray.idl:
1690         * storage/StorageEvent.idl:
1691         * svg/SVGAnimationElement.idl:
1692         * svg/SVGDocument.idl:
1693         * svg/SVGElement.idl:
1694         * svg/SVGFEDropShadowElement.idl:
1695         * svg/SVGFEGaussianBlurElement.idl:
1696         * svg/SVGFEMorphologyElement.idl:
1697         * svg/SVGFilterElement.idl:
1698         * svg/SVGGraphicsElement.idl:
1699         * svg/SVGMarkerElement.idl:
1700         * svg/SVGPathElement.idl:
1701         * svg/SVGSVGElement.idl:
1702         * svg/SVGTests.idl:
1703         * svg/SVGTextContentElement.idl:
1704         * xml/DOMParser.idl:
1705         * xml/XMLSerializer.cpp:
1706         (WebCore::XMLSerializer::serializeToString):
1707         * xml/XMLSerializer.h:
1708         * xml/XMLSerializer.idl:
1709         * xml/XPathEvaluator.idl:
1710         * xml/XPathExpression.idl:
1711         * xml/XPathNSResolver.idl:
1712         * xml/XPathResult.idl:
1713         * xml/XSLTProcessor.idl:
1714
1715 2016-04-24  Antti Koivisto  <antti@apple.com>
1716
1717         RenderStyle should not be reference counted
1718         https://bugs.webkit.org/show_bug.cgi?id=156846
1719
1720         Reviewed by Andreas Kling.
1721
1722         RenderStyle reference counts its substructures. We no longer share RenderStyle objects between normal renderers
1723         so there is no reason to refcount the RenderStyles themselves too. Making it a non-refcounted type clarifies
1724         ownership relations, reduces branchiness and saves some memory.
1725
1726         This patches switches mostly mechanically from Ref/RefPtr<RenderStyle> to std::unique_ptr<RenderStyle>. In
1727         the future RenderStyle can be given regular value semantics.
1728
1729         * Modules/plugins/PluginReplacement.h:
1730         (WebCore::PluginReplacement::scriptObject):
1731         (WebCore::PluginReplacement::willCreateRenderer):
1732         * Modules/plugins/QuickTimePluginReplacement.h:
1733         * Modules/plugins/QuickTimePluginReplacement.mm:
1734         (WebCore::QuickTimePluginReplacement::~QuickTimePluginReplacement):
1735         (WebCore::QuickTimePluginReplacement::createElementRenderer):
1736         * Modules/plugins/YouTubePluginReplacement.cpp:
1737         (WebCore::YouTubePluginReplacement::YouTubePluginReplacement):
1738         (WebCore::YouTubePluginReplacement::createElementRenderer):
1739         * Modules/plugins/YouTubePluginReplacement.h:
1740         * css/CSSComputedStyleDeclaration.cpp:
1741         (WebCore::ComputedStyleExtractor::getFontSizeCSSValuePreferringKeyword):
1742         (WebCore::ComputedStyleExtractor::useFixedFontDefaultSize):
1743         (WebCore::updateStyleIfNeededForNode):
1744         (WebCore::computeRenderStyleForProperty):
1745         (WebCore::ComputedStyleExtractor::customPropertyValue):
1746         (WebCore::ComputedStyleExtractor::propertyValue):
1747         * css/MediaQueryEvaluator.cpp:
1748         (WebCore::MediaQueryEvaluator::MediaQueryEvaluator):
1749         (WebCore::MediaQueryEvaluator::eval):
1750         * css/MediaQueryEvaluator.h:
1751
1752             Clarify in code that MediaQueryEvaluator does not own the style.
1753
1754         * css/MediaQueryMatcher.cpp:
1755         (WebCore::MediaQueryMatcher::mediaType):
1756         (WebCore::MediaQueryMatcher::documentElementUserAgentStyle):
1757         (WebCore::MediaQueryMatcher::evaluate):
1758         (WebCore::MediaQueryMatcher::matchMedia):
1759         (WebCore::MediaQueryMatcher::styleResolverChanged):
1760         (WebCore::MediaQueryMatcher::prepareEvaluator): Deleted.
1761         * css/MediaQueryMatcher.h:
1762         * css/StyleMedia.cpp:
1763         (WebCore::StyleMedia::matchMedium):
1764         * css/StyleResolver.cpp:
1765         (WebCore::StyleResolver::State::clear):
1766         (WebCore::StyleResolver::State::updateConversionData):
1767         (WebCore::StyleResolver::State::setStyle):
1768         (WebCore::StyleResolver::State::setParentStyle):
1769
1770             State owns the style explicitly set by setParentStyle but not the one given via constructor.
1771
1772         (WebCore::isAtShadowBoundary):
1773         (WebCore::StyleResolver::styleForElement):
1774         (WebCore::StyleResolver::styleForKeyframe):
1775         (WebCore::StyleResolver::keyframeStylesForAnimation):
1776         (WebCore::StyleResolver::pseudoStyleForElement):
1777         (WebCore::StyleResolver::styleForPage):
1778         (WebCore::StyleResolver::defaultStyleForElement):
1779         (WebCore::StyleResolver::applyMatchedProperties):
1780         (WebCore::StyleResolver::applyPropertyToStyle):
1781         * css/StyleResolver.h:
1782         (WebCore::ElementStyle::ElementStyle):
1783         (WebCore::StyleResolver::style):
1784         (WebCore::StyleResolver::parentStyle):
1785         (WebCore::StyleResolver::setOverrideDocumentElementStyle):
1786         (WebCore::StyleResolver::State::document):
1787         (WebCore::StyleResolver::State::element):
1788         (WebCore::StyleResolver::State::style):
1789         (WebCore::StyleResolver::State::takeStyle):
1790         (WebCore::StyleResolver::State::parentStyle):
1791         (WebCore::StyleResolver::State::rootElementStyle):
1792         (WebCore::StyleResolver::State::regionForStyling):
1793         (WebCore::StyleResolver::State::setParentStyle): Deleted.
1794         * dom/Document.cpp:
1795         (WebCore::Document::recalcStyle):
1796         (WebCore::Document::updateLayoutIgnorePendingStylesheets):
1797         (WebCore::Document::styleForElementIgnoringPendingStylesheets):
1798         (WebCore::Document::isPageBoxVisible):
1799         (WebCore::Document::pageSizeAndMarginsInPixels):
1800         (WebCore::Document::addAutoSizingNode):
1801         (WebCore::Document::validateAutoSizingNodes):
1802         (WebCore::Document::resetAutoSizingNodes):
1803         (WebCore::Document::setFullScreenRenderer):
1804         * dom/Document.h:
1805         * dom/Element.cpp:
1806         (WebCore::Element::rendererIsNeeded):
1807         (WebCore::Element::createElementRenderer):
1808         (WebCore::Element::resolveComputedStyle):
1809         * dom/Element.h:
1810         (WebCore::Element::copyNonAttributePropertiesFromElement):
1811         * dom/ElementRareData.h:
1812
1813         ...
1814
1815         * page/animation/AnimationBase.h:
1816         * page/animation/AnimationController.cpp:
1817         (WebCore::AnimationControllerPrivate::receivedStartTimeResponse):
1818         (WebCore::AnimationControllerPrivate::getAnimatedStyleForRenderer):
1819         (WebCore::AnimationControllerPrivate::computeExtentOfAnimation):
1820         (WebCore::AnimationController::cancelAnimations):
1821         (WebCore::AnimationController::updateAnimations):
1822
1823             std::unique_ptr<RenderStyle& animatedStyle argument is now expected no be initially null and
1824             is only set if a new style is created.
1825
1826         (WebCore::AnimationController::getAnimatedStyleForRenderer):
1827         * page/animation/AnimationController.h:
1828         * page/animation/AnimationControllerPrivate.h:
1829         * page/animation/CompositeAnimation.cpp:
1830         (WebCore::CompositeAnimation::updateTransitions):
1831         (WebCore::CompositeAnimation::updateKeyframeAnimations):
1832         (WebCore::CompositeAnimation::animate):
1833         (WebCore::CompositeAnimation::getAnimatedStyle):
1834         * page/animation/CompositeAnimation.h:
1835         * page/animation/ImplicitAnimation.cpp:
1836         (WebCore::ImplicitAnimation::ImplicitAnimation):
1837         (WebCore::ImplicitAnimation::shouldSendEventForListener):
1838         (WebCore::ImplicitAnimation::animate):
1839         (WebCore::ImplicitAnimation::getAnimatedStyle):
1840         (WebCore::ImplicitAnimation::onAnimationEnd):
1841         (WebCore::ImplicitAnimation::reset):
1842         * page/animation/ImplicitAnimation.h:
1843         * page/animation/KeyframeAnimation.cpp:
1844         (WebCore::KeyframeAnimation::KeyframeAnimation):
1845         (WebCore::KeyframeAnimation::fetchIntervalEndpointsForProperty):
1846         (WebCore::KeyframeAnimation::animate):
1847         (WebCore::KeyframeAnimation::getAnimatedStyle):
1848         * page/animation/KeyframeAnimation.h:
1849         * rendering/RenderAttachment.cpp:
1850         (WebCore::RenderAttachment::RenderAttachment):
1851         * rendering/RenderAttachment.h:
1852         * rendering/RenderBlock.cpp:
1853         (WebCore::RenderBlock::RenderBlock):
1854         (WebCore::RenderBlock::styleDidChange):
1855         (WebCore::RenderBlock::clone):
1856         (WebCore::RenderBlock::updateFirstLetterStyle):
1857         (WebCore::RenderBlock::createFirstLetterRenderer):
1858         * rendering/RenderBlock.h:
1859         * rendering/RenderBlockFlow.cpp:
1860         (WebCore::RenderBlockFlow::MarginInfo::MarginInfo):
1861         (WebCore::RenderBlockFlow::RenderBlockFlow):
1862         * rendering/RenderBlockFlow.h:
1863         * rendering/RenderBox.cpp:
1864         (WebCore::skipBodyBackground):
1865         (WebCore::RenderBox::RenderBox):
1866         * rendering/RenderBox.h:
1867         * rendering/RenderBoxModelObject.cpp:
1868         (WebCore::RenderBoxModelObject::suspendAnimations):
1869         (WebCore::RenderBoxModelObject::RenderBoxModelObject):
1870         * rendering/RenderBoxModelObject.h:
1871         * rendering/RenderButton.cpp:
1872         (WebCore::RenderButton::RenderButton):
1873         (WebCore::RenderButton::setupInnerStyle):
1874         * rendering/RenderButton.h:
1875         * rendering/RenderCombineText.h:
1876         * rendering/RenderDeprecatedFlexibleBox.cpp:
1877         (WebCore::RenderDeprecatedFlexibleBox::RenderDeprecatedFlexibleBox):
1878         * rendering/RenderDeprecatedFlexibleBox.h:
1879         * rendering/RenderDetailsMarker.cpp:
1880         (WebCore::RenderDetailsMarker::RenderDetailsMarker):
1881         * rendering/RenderDetailsMarker.h:
1882         * rendering/RenderElement.cpp:
1883         (WebCore::controlStatesRendererMap):
1884         (WebCore::RenderElement::RenderElement):
1885         (WebCore::RenderElement::~RenderElement):
1886         (WebCore::RenderElement::createFor):
1887         (WebCore::firstLineStyleForCachedUncachedType):
1888         (WebCore::RenderElement::uncachedFirstLineStyle):
1889         (WebCore::RenderElement::cachedFirstLineStyle):
1890         (WebCore::RenderElement::initializeStyle):
1891         (WebCore::RenderElement::setStyle):
1892         (WebCore::RenderElement::propagateStyleToAnonymousChildren):
1893         (WebCore::RenderElement::styleDidChange):
1894         (WebCore::RenderElement::getCachedPseudoStyle):
1895
1896             Return plain pointer as the cache owns the style.
1897
1898         (WebCore::RenderElement::getUncachedPseudoStyle):
1899
1900             return std::unique_ptr<RenderStyle>
1901
1902         (WebCore::RenderElement::selectionColor):
1903         (WebCore::RenderElement::selectionPseudoStyle):
1904         (WebCore::RenderElement::selectionBackgroundColor):
1905         * rendering/RenderElement.h:
1906         (WebCore::RenderElement::hasInitializedStyle):
1907         (WebCore::RenderElement::style):
1908         (WebCore::RenderElement::element):
1909         (WebCore::RenderElement::setStyleInternal):
1910         * rendering/RenderEmbeddedObject.cpp:
1911
1912         ...
1913
1914         (WebCore::RenderImage::imageResource):
1915         * rendering/RenderInline.cpp:
1916         (WebCore::RenderInline::RenderInline):
1917         (WebCore::updateStyleOfAnonymousBlockContinuations):
1918         (WebCore::RenderInline::styleDidChange):
1919
1920             Continuations now get their own RenderStyles.
1921
1922         (WebCore::RenderInline::addChildIgnoringContinuation):
1923         (WebCore::RenderInline::clone):
1924         * rendering/RenderInline.h:
1925         * rendering/RenderLayer.cpp:
1926         (WebCore::RenderLayer::currentTransform):
1927         (WebCore::RenderLayer::calculateClipRects):
1928         * rendering/RenderLayer.h:
1929
1930         ...
1931
1932         * rendering/style/KeyframeList.cpp:
1933         (WebCore::KeyframeList::operator==):
1934         (WebCore::KeyframeList::insert):
1935
1936             KeyframeValue is now movable but not copyable type. Adjust accordingly.
1937
1938         * rendering/style/KeyframeList.h:
1939         (WebCore::KeyframeValue::KeyframeValue):
1940         (WebCore::KeyframeValue::setKey):
1941         (WebCore::KeyframeValue::style):
1942         (WebCore::KeyframeValue::setStyle):
1943         (WebCore::KeyframeList::animationName):
1944         (WebCore::KeyframeList::addProperty):
1945         (WebCore::KeyframeList::containsProperty):
1946         * rendering/style/RenderStyle.cpp:
1947         (WebCore::defaultStyle):
1948         (WebCore::RenderStyle::create):
1949         (WebCore::RenderStyle::createDefaultStyle):
1950         (WebCore::RenderStyle::createAnonymousStyleWithDisplay):
1951         (WebCore::RenderStyle::clone):
1952         (WebCore::RenderStyle::createStyleInheritingFromPseudoStyle):
1953
1954             Return std::unique_ptr<RenderStyle> instead of Ref<RenderStyle>.
1955
1956         (WebCore::RenderStyle::RenderStyle):
1957         (WebCore::RenderStyle::~RenderStyle):
1958         (WebCore::resolveAlignmentData):
1959         (WebCore::RenderStyle::operator==):
1960         (WebCore::RenderStyle::hasUniquePseudoStyle):
1961         (WebCore::RenderStyle::getCachedPseudoStyle):
1962         (WebCore::RenderStyle::addCachedPseudoStyle):
1963         (WebCore::RenderStyle::isStyleAvailable): Deleted.
1964         * rendering/style/RenderStyle.h:
1965         (WebCore::RenderStyle::setStyleType):
1966         (WebCore::RenderStyle::cachedPseudoStyles):
1967         (WebCore::RenderStyle::initialIsolation):
1968         (WebCore::RenderStyle::isPlaceholderStyle):
1969         (WebCore::RenderStyle::setIsPlaceholderStyle):
1970
1971             Add placeholder style bit to rareNonInheritedData. We no longer rely on RenderStyle identity for this test.
1972
1973         (WebCore::RenderStyle::noninheritedFlagsMemoryOffset):
1974         * rendering/style/SVGRenderStyle.cpp:
1975         (WebCore::defaultSVGStyle):
1976         (WebCore::SVGRenderStyle::createDefaultStyle):
1977         * rendering/style/StyleRareNonInheritedData.cpp:
1978         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
1979         (WebCore::StyleRareNonInheritedData::operator==):
1980         (WebCore::StyleRareNonInheritedData::contentDataEquivalent):
1981         * rendering/style/StyleRareNonInheritedData.h:
1982
1983         ...
1984
1985         (WebCore::findRenderingRoot):
1986         (WebCore::findRenderingRoots):
1987         (WebCore::RenderTreeUpdater::commit):
1988
1989             Style::Update is no longer const as we move the styles from it to the render tree.
1990
1991         (WebCore::pseudoStyleCacheIsInvalid):
1992         (WebCore::RenderTreeUpdater::updateElementRenderer):
1993         (WebCore::moveToFlowThreadIfNeeded):
1994         (WebCore::RenderTreeUpdater::createRenderer):
1995         (WebCore::RenderTreeUpdater::updateBeforeOrAfterPseudoElement):
1996         * style/RenderTreeUpdater.h:
1997         * style/StyleResolveForDocument.cpp:
1998         (WebCore::Style::resolveForDocument):
1999         * style/StyleResolveForDocument.h:
2000         * style/StyleSharingResolver.cpp:
2001         (WebCore::Style::elementHasDirectionAuto):
2002         (WebCore::Style::SharingResolver::resolve):
2003         * style/StyleSharingResolver.h:
2004         * style/StyleTreeResolver.cpp:
2005         (WebCore::Style::ensurePlaceholderStyle):
2006
2007             Set the placeholder.
2008
2009         (WebCore::Style::TreeResolver::Parent::Parent):
2010         (WebCore::Style::TreeResolver::pushScope):
2011         (WebCore::Style::TreeResolver::pushEnclosingScope):
2012         (WebCore::Style::TreeResolver::popScope):
2013
2014             Set and clear StyleResolver overrideDocumentElementStyle as needed. It is owned by the TreeResolver.
2015
2016         (WebCore::Style::TreeResolver::styleForElement):
2017
2018             Clone the placeholder style.
2019
2020         (WebCore::Style::TreeResolver::resolveElement):
2021         (WebCore::Style::TreeResolver::pushParent):
2022         (WebCore::Style::TreeResolver::resolveComposedTree):
2023         (WebCore::Style::TreeResolver::resolve):
2024
2025             Adopt to the std::unique_ptr and ElementStyle move semantics.
2026
2027         * style/StyleTreeResolver.h:
2028         (WebCore::Style::TreeResolver::scope):
2029         * style/StyleUpdate.cpp:
2030         (WebCore::Style::Update::elementUpdate):
2031         (WebCore::Style::Update::textUpdate):
2032         (WebCore::Style::Update::elementStyle):
2033         (WebCore::Style::Update::addElement):
2034         (WebCore::Style::Update::addText):
2035         * style/StyleUpdate.h:
2036         (WebCore::Style::Update::roots):
2037         (WebCore::Style::Update::document):
2038         * svg/SVGAElement.cpp:
2039         (WebCore::SVGAElement::svgAttributeChanged):
2040         (WebCore::SVGAElement::createElementRenderer):
2041
2042         ...
2043
2044 2016-04-24  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2045
2046         Drop [UsePointersEvenForNonNullableObjectArguments] from MediaControlsHost
2047         https://bugs.webkit.org/show_bug.cgi?id=156903
2048
2049         Reviewed by Chris Dumez.
2050
2051         No change of behavior.
2052
2053         * Modules/mediacontrols/MediaControlsHost.idl: Marking some parameters as nullable.
2054
2055 2016-04-24  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2056
2057         Drop [UsePointersEvenForNonNullableObjectArguments] from WebGLRenderingContext
2058         https://bugs.webkit.org/show_bug.cgi?id=156909
2059
2060         Reviewed by Chris Dumez.
2061
2062         No change of behavior.
2063
2064         Marking a lot of method parameters as nullable.
2065
2066         * html/canvas/WebGLRenderingContextBase.idl:
2067
2068 2016-04-24  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2069
2070         Drop [UsePointersEvenForNonNullableObjectArguments] from WebSocket
2071         https://bugs.webkit.org/show_bug.cgi?id=156897
2072
2073         Reviewed by Chris Dumez.
2074
2075         No change of behavior.
2076
2077         Updating WebSocket::send methods to take references, except for ArrayBufferView, which is not yet supported by the binding generator.
2078
2079         * Modules/websockets/WebSocket.cpp:
2080         (WebCore::WebSocket::send):
2081         * Modules/websockets/WebSocket.h:
2082         * Modules/websockets/WebSocket.idl:
2083
2084 2016-04-23  Andy Estes  <aestes@apple.com>
2085
2086         Fix issues found by the clang static analyzer
2087         https://bugs.webkit.org/show_bug.cgi?id=156956
2088
2089         Reviewed by Alexey Proskuryakov.
2090
2091         * editing/cocoa/DataDetection.mm:
2092         (WebCore::DataDetection::detectContentInRange): Stored tz in a RetainPtr.
2093         * platform/cf/KeyedDecoderCF.cpp:
2094         (WebCore::KeyedDecoderCF::KeyedDecoderCF): If dynamic_cf_cast returned nullptr, the result of
2095         CFPropertyListCreateWithData would leak. Stored the CFPropertyListRef in a RetainPtr, then leaked/adopted it
2096         into m_rootDictionary (to avoid retain count churn) if it is a CFDictionary.
2097         * platform/ios/WebAVPlayerController.mm:
2098         (-[WebAVPlayerController dealloc]): Released _externalPlaybackAirPlayDeviceLocalizedName.
2099         (-[WebAVMediaSelectionOption dealloc]): Added to release _localizedDisplayName.
2100         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
2101         (-[WebAVPlayerLayer dealloc]): Released _pixelBufferAttributes.
2102         * platform/network/cocoa/WebCoreNSURLSession.h: Removed the readwrite attributes from properties, since
2103         properties are readwrite by default.
2104         * platform/network/cocoa/WebCoreNSURLSession.mm: Removed @dynamic, which isn't necessary just for defining a custom getter.
2105         (-[WebCoreNSURLSessionDataTask dealloc]): Added to release copied ivars.
2106
2107 2016-04-23  Dan Bernstein  <mitz@apple.com>
2108
2109         <rdar://problem/25894586> A project has failed to build because WTF_MAKE_FAST_ALLOCATED was not defined
2110
2111         Rubber-stamped by Chris Dumez.
2112
2113         Reverted the IntSize part of r199735, to let IntSize.h keep being used in another project.
2114
2115         * platform/graphics/IntSize.h:
2116         (WebCore::IntSize::IntSize):
2117
2118 2016-04-23  Chris Dumez  <cdumez@apple.com>
2119
2120         Tie the DiagnosticLoggingClient's lifetime to the Page
2121         https://bugs.webkit.org/show_bug.cgi?id=156938
2122         <rdar://problem/25851499>
2123
2124         Reviewed by Antti Koivisto.
2125
2126         Tie the DiagnosticLoggingClient's lifetime to the Page rather than to the
2127         MainFrame. The diagnostic logging client in WebKit2 requires the WebPage
2128         to be alive in order to send IPC to the UIProcess. The WebPage owns the
2129         Page and Page is not refCounted so the lifetime of the
2130         DiagnosticLoggingClient should now be tied to the one of the WebPage as
2131         well.
2132
2133         Previously, the DiagnosticLoggingClient would stay alive as long as the
2134         MainFrame and could apparently in rare cases outlive the WebPage, thus
2135         crashing when trying to send the IPC.
2136
2137         * history/PageCache.cpp:
2138         (WebCore::logPageCacheFailureDiagnosticMessage):
2139         (WebCore::canCachePage):
2140         * html/HTMLMediaElement.cpp:
2141         (WebCore::HTMLMediaElement::loadResource):
2142         (WebCore::logMediaLoadRequest):
2143         (WebCore::HTMLMediaElement::updatePlayState):
2144         (WebCore::HTMLMediaElement::mediaPlayerEngineFailedToLoad):
2145         * loader/EmptyClients.h:
2146         * loader/FrameLoader.cpp:
2147         (WebCore::logNavigation):
2148         (WebCore::FrameLoader::checkLoadCompleteForThisFrame):
2149         (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
2150         * loader/ResourceLoader.cpp:
2151         (WebCore::logResourceResponseSource):
2152         * loader/SubframeLoader.cpp:
2153         (WebCore::logPluginRequest):
2154         * loader/SubresourceLoader.cpp:
2155         (WebCore::SubresourceLoader::willSendRequestInternal):
2156         (WebCore::SubresourceLoader::didReceiveResponse):
2157         (WebCore::logResourceLoaded):
2158         * loader/cache/CachedResourceLoader.cpp:
2159         (WebCore::logMemoryCacheResourceRequest):
2160         (WebCore::logResourceRevalidationDecision):
2161         * page/DiagnosticLoggingClient.h:
2162         * page/MainFrame.cpp:
2163         (WebCore::MainFrame::MainFrame): Deleted.
2164         (WebCore::MainFrame::~MainFrame): Deleted.
2165         (WebCore::MainFrame::diagnosticLoggingClient): Deleted.
2166         * page/MainFrame.h:
2167         * page/Page.cpp:
2168         (WebCore::Page::Page):
2169         (WebCore::Page::~Page):
2170         (WebCore::Page::diagnosticLoggingClient):
2171         * page/Page.h:
2172
2173 2016-04-22  Chris Dumez  <cdumez@apple.com>
2174
2175         Cannot access the SQLTransaction.constructor.prototype
2176         https://bugs.webkit.org/show_bug.cgi?id=156613
2177
2178         Reviewed by Darin Adler.
2179
2180         Drop [NoInterfaceObject] from the following SQL interfaces:
2181         Database, SQLError, SQLResultSet, SQLResultSetRowList and SQLTransaction.
2182
2183         This matches the specification:
2184         https://dev.w3.org/html5/webdatabase/
2185
2186         This was causing the 'constructor' property to be wrong for these
2187         interfaces as it would be a generic Object.
2188
2189         Test: storage/websql/transaction-prototype.html
2190
2191         * Modules/webdatabase/Database.idl:
2192         * Modules/webdatabase/SQLError.idl:
2193         * Modules/webdatabase/SQLResultSet.idl:
2194         * Modules/webdatabase/SQLResultSetRowList.idl:
2195         * Modules/webdatabase/SQLTransaction.idl:
2196
2197 2016-04-22  Joseph Pecoraro  <pecoraro@apple.com>
2198
2199         Web Inspector: Include columnNumber in event listener locations
2200         https://bugs.webkit.org/show_bug.cgi?id=156927
2201         <rdar://problem/25884584>
2202
2203         Reviewed by Brian Burg.
2204
2205         * inspector/InspectorDOMAgent.cpp:
2206         (WebCore::InspectorDOMAgent::buildObjectForEventListener):
2207         Include the column number in the location as well.
2208
2209 2016-04-22  Brent Fulgham  <bfulgham@apple.com>
2210
2211         [Win] Unreviewed build fix.
2212
2213         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
2214         (PlatformCALayerWin::isHidden):
2215
2216 2016-04-22  Jer Noble  <jer.noble@apple.com>
2217
2218         [iOS] Crash at -[WebAVPlayerLayer resolveBounds]
2219         https://bugs.webkit.org/show_bug.cgi?id=156931
2220         <rdar://problem/25865315> 
2221
2222         Reviewed by Eric Carlson.
2223
2224         When cloning the WebAVPlayerLayer, we must copy over the fullscreenInterface to the cloned layer.
2225
2226         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
2227         (WebAVPlayerLayerView_startRoutingVideoToPictureInPicturePlayerLayerView):
2228
2229 2016-04-22  Chris Dumez  <cdumez@apple.com>
2230
2231         Crash under WebCore::DataDetection::detectContentInRange()
2232         https://bugs.webkit.org/show_bug.cgi?id=156880
2233         <rdar://problem/25622631>
2234
2235         Reviewed by Darin Adler.
2236
2237         We would sometimes crash under WebCore::DataDetection::detectContentInRange()
2238         when dereferencing a null parentNode pointer. This patch adds a null check
2239         for parentNode in the for() loop. It also does some clean up and optimization
2240         since I was passing by.
2241
2242         * editing/cocoa/DataDetection.mm:
2243         (WebCore::DataDetection::detectContentInRange):
2244
2245 2016-04-22  Keith Miller  <keith_miller@apple.com>
2246
2247         buildObjectForEventListener should not call into JSC with a null ExecState
2248         https://bugs.webkit.org/show_bug.cgi?id=156923
2249
2250         Reviewed by Joseph Pecoraro.
2251
2252         If a user had disabled JavaScript on their page then the inspector tried to
2253         add an event listener we would fail to create an ExecState. Since we didn't
2254         check this ExecState was valid we would then attempt to stringify the value,
2255         which would cause JSC to crash.
2256
2257         * inspector/InspectorDOMAgent.cpp:
2258         (WebCore::InspectorDOMAgent::buildObjectForEventListener):
2259
2260 2016-04-22  Dean Jackson  <dino@apple.com>
2261
2262         Yet another attempt at fixing Windows.
2263
2264         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
2265         (PlatformCALayerWin::isHidden):
2266         * platform/graphics/ca/win/PlatformCALayerWin.h:
2267
2268 2016-04-22  Ryan Haddad  <ryanhaddad@apple.com>
2269
2270         Attempt to fix Windows build after r199862
2271
2272         Unreviewed build fix.
2273
2274         * platform/graphics/ca/win/PlatformCALayerWin.h:
2275
2276 2016-04-22  Brent Fulgham  <bfulgham@apple.com>
2277
2278         Anchor element 'ping' property should only apply to http/https destinations
2279         https://bugs.webkit.org/show_bug.cgi?id=156801
2280         <rdar://problem/25834419>
2281
2282         Reviewed by Chris Dumez.
2283
2284         Take advantage of the hyperlink auditing language "UAs may either ignore the
2285         ping attribute altogether, or selectively ignore URLs in the list (e.g. ignoring
2286         any third-party URLs)" to restrict pings to http/https targets. For details, see
2287         <https://html.spec.whatwg.org/multipage/semantics.html#hyperlink-auditing>.
2288
2289         Tested by http/tests/navigation/ping-attribute tests.
2290
2291         * loader/PingLoader.cpp:
2292         (WebCore::PingLoader::sendPing): Ignore requests to ping anything outside the
2293         family of HTTP protocols (http/https).
2294
2295 2016-04-22  Ryan Haddad  <ryanhaddad@apple.com>
2296
2297         Fix builds that do not support AVKit
2298
2299         Unreviewed build fix.
2300
2301         * platform/ios/WebAVPlayerController.h:
2302         * platform/ios/WebAVPlayerController.mm:
2303
2304 2016-04-22  Dave Hyatt  <hyatt@apple.com>
2305
2306         REGRESSION (r189567): The top of Facebook's messenger.com looks visually broken
2307         https://bugs.webkit.org/show_bug.cgi?id=156869
2308         <rdar://problem/23204668>
2309
2310         Reviewed by Zalan Bujtas.
2311
2312         Added fast/block/min-content-with-box-sizing.html
2313
2314         * rendering/RenderBox.cpp:
2315         (WebCore::RenderBox::computeIntrinsicLogicalContentHeightUsing):
2316
2317 2016-04-22  Antti Koivisto  <antti@apple.com>
2318
2319         TextAutoSizingKey should use normal refcounting
2320         https://bugs.webkit.org/show_bug.cgi?id=156893
2321
2322         Reviewed by Andreas Kling.
2323
2324         Get rid of special refcounting of style in favor of RefPtr. It also becomes a move-only type
2325         to support future switch to non-refcounted RenderStyle.
2326
2327         Also general cleanups and modernization.
2328
2329         * dom/Document.cpp:
2330         (WebCore::TextAutoSizingTraits::constructDeletedValue):
2331         (WebCore::TextAutoSizingTraits::isDeletedValue):
2332         (WebCore::Document::addAutoSizingNode):
2333         (WebCore::Document::validateAutoSizingNodes):
2334         (WebCore::Document::resetAutoSizingNodes):
2335
2336             Adopt to being move-only.
2337
2338         * rendering/TextAutoSizing.cpp:
2339         (WebCore::cloneRenderStyleWithState):
2340         (WebCore::TextAutoSizingKey::TextAutoSizingKey):
2341
2342             Clone the style for safety against mutations. Cloning is cheap.
2343
2344         (WebCore::TextAutoSizingValue::numNodes):
2345         (WebCore::TextAutoSizingValue::adjustNodeSizes):
2346         (WebCore::TextAutoSizingValue::reset):
2347         (WebCore::TextAutoSizingKey::~TextAutoSizingKey): Deleted.
2348         (WebCore::TextAutoSizingKey::operator=): Deleted.
2349         (WebCore::TextAutoSizingKey::ref): Deleted.
2350         (WebCore::TextAutoSizingKey::deref): Deleted.
2351         * rendering/TextAutoSizing.h:
2352         (WebCore::TextAutoSizingKey::TextAutoSizingKey):
2353         (WebCore::TextAutoSizingKey::style):
2354         (WebCore::TextAutoSizingKey::isDeleted):
2355         (WebCore::operator==):
2356         (WebCore::TextAutoSizingKey::doc): Deleted.
2357         (WebCore::TextAutoSizingKey::isValidDoc): Deleted.
2358         (WebCore::TextAutoSizingKey::isValidStyle): Deleted.
2359         (WebCore::TextAutoSizingKey::deletedKeyDoc): Deleted.
2360         (WebCore::TextAutoSizingKey::deletedKeyStyle): Deleted.
2361
2362             m_doc member is not used for anything except deleted value comparisons. Replace it with a bit.
2363
2364 2016-04-22  Chris Dumez  <cdumez@apple.com>
2365
2366         Crash under FontCache::purgeInactiveFontData()
2367         https://bugs.webkit.org/show_bug.cgi?id=156822
2368         <rdar://problem/25373970>
2369
2370         Reviewed by Darin Adler.
2371
2372         In some rare cases, the Font constructor would mutate the FontPlatformData
2373         that is being passed in. This is an issue because because our FontCache
2374         uses the FontPlatformData as key for the cached fonts. This could lead to
2375         crashes because the WTFMove() in FontCache::purgeInactiveFontData() would
2376         nullify values in our HashMap but we would then fail to remove them from
2377         the HashMap (because the key did not match). We would then reference the
2378         null font when looping again when doing font->hasOneRef().
2379
2380         This patch marks Font::m_platformData member as const to avoid such issues
2381         in the future and moves the code altering the FontPlatformData from the
2382         Font constructor into the FontPlatformData constructor. The purpose of
2383         that code was to initialize FontPlatformData::m_cgFont in case the CGFont
2384         passed in the constructor was null.
2385
2386         * platform/graphics/Font.h:
2387         * platform/graphics/FontCache.cpp:
2388         (WebCore::FontCache::fontForPlatformData):
2389         (WebCore::FontCache::purgeInactiveFontData):
2390         * platform/graphics/FontPlatformData.cpp:
2391         (WebCore::FontPlatformData::FontPlatformData):
2392         * platform/graphics/FontPlatformData.h:
2393         * platform/graphics/cocoa/FontCocoa.mm:
2394         (WebCore::webFallbackFontFamily): Deleted.
2395         (WebCore::Font::platformInit): Deleted.
2396         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
2397         (WebCore::webFallbackFontFamily):
2398         (WebCore::FontPlatformData::setFallbackCGFont):
2399         * platform/graphics/win/FontPlatformDataCGWin.cpp:
2400         (WebCore::FontPlatformData::setFallbackCGFont):
2401
2402 2016-04-22  Chris Dumez  <cdumez@apple.com>
2403
2404         Support disabling at runtime IndexedDB constructors exposed to workers
2405         https://bugs.webkit.org/show_bug.cgi?id=156883
2406
2407         Reviewed by Darin Adler.
2408
2409         Support disabling at runtime IndexedDB constructors exposed to workers.
2410         Previously, constructors visibility to workers and window was constrolled
2411         by the same runtime flag.
2412
2413         * Modules/indexeddb/IDBCursor.idl:
2414         * Modules/indexeddb/IDBCursorWithValue.idl:
2415         * Modules/indexeddb/IDBDatabase.idl:
2416         * Modules/indexeddb/IDBFactory.idl:
2417         * Modules/indexeddb/IDBIndex.idl:
2418         * Modules/indexeddb/IDBKeyRange.idl:
2419         * Modules/indexeddb/IDBObjectStore.idl:
2420         * Modules/indexeddb/IDBOpenDBRequest.idl:
2421         * Modules/indexeddb/IDBRequest.idl:
2422         * Modules/indexeddb/IDBTransaction.idl:
2423         * Modules/indexeddb/IDBVersionChangeEvent.idl:
2424         * workers/WorkerGlobalScope.idl:
2425
2426 2016-04-22  Dean Jackson  <dino@apple.com>
2427
2428         Attempting to fix Windows build. Add isHidden implementation.
2429
2430         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
2431         (PlatformCALayerWin::isHidden):
2432
2433 2016-04-22  Brady Eidson  <beidson@apple.com>
2434
2435         Attempt at a Windows build fix.
2436
2437         * workers/WorkerMessagingProxy.cpp:
2438         (WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
2439
2440 2016-04-22  Dave Hyatt  <hyatt@apple.com>
2441
2442          -webkit-image-set doesn't work inside CSS variables
2443         https://bugs.webkit.org/show_bug.cgi?id=156915
2444         <rdar://problem/25473972>
2445
2446         Reviewed by Zalan Bujtas.
2447
2448         Added new tests in fast/hidpi.
2449
2450         * css/CSSPrimitiveValue.cpp:
2451         (WebCore::CSSPrimitiveValue::equals):
2452         (WebCore::CSSPrimitiveValue::buildParserValue):
2453
2454 2016-04-22  Commit Queue  <commit-queue@webkit.org>
2455
2456         Unreviewed, rolling out r199877.
2457         https://bugs.webkit.org/show_bug.cgi?id=156918
2458
2459         The LayoutTest added with this change is failing on all
2460         platforms. (Requested by ryanhaddad on #webkit).
2461
2462         Reverted changeset:
2463
2464         "REGRESSION (r189567): The top of Facebook's messenger.com
2465         looks visually broken"
2466         https://bugs.webkit.org/show_bug.cgi?id=156869
2467         http://trac.webkit.org/changeset/199877
2468
2469 2016-04-22  Brady Eidson  <beidson@apple.com>
2470
2471         Modern IDB: Rework the ownership/RefCounting model of IDBConnectionToServer and IDBConnectionProxy.
2472         https://bugs.webkit.org/show_bug.cgi?id=156916
2473
2474         Reviewed by Tim Horton.
2475
2476         No new tests (No behavior change).
2477
2478         * Modules/indexeddb/IDBFactory.cpp: Remove unneeded include.
2479         
2480         * Modules/indexeddb/client/IDBConnectionProxy.cpp:
2481         (WebCore::IDBClient::IDBConnectionProxy::ref): Ref the ConnectionToServer.
2482         (WebCore::IDBClient::IDBConnectionProxy::deref): Deref it.
2483         (WebCore::IDBClient::IDBConnectionProxy::connectionToServer):
2484         (WebCore::IDBClient::IDBConnectionProxy::openDatabase):
2485         (WebCore::IDBClient::IDBConnectionProxy::deleteDatabase):
2486         (WebCore::IDBClient::IDBConnectionProxy::create): Deleted.
2487         * Modules/indexeddb/client/IDBConnectionProxy.h:
2488         
2489         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
2490         (WebCore::IDBClient::IDBConnectionToServer::IDBConnectionToServer): Create a proxy owned by this.
2491         (WebCore::IDBClient::IDBConnectionToServer::proxy): Expose it.
2492         * Modules/indexeddb/client/IDBConnectionToServer.h:
2493         
2494         * dom/Document.cpp:
2495         (WebCore::Document::idbConnectionProxy):
2496
2497         * WebCore.xcodeproj/project.pbxproj:
2498
2499 2016-04-22  Antti Koivisto  <antti@apple.com>
2500
2501         REGRESSION (r194898): Multi download of external SVG defs file by <use> xlinks:href (caching)
2502         https://bugs.webkit.org/show_bug.cgi?id=156368
2503         <rdar://problem/25611746>
2504
2505         Reviewed by Simon Fraser.
2506
2507         We would load svg resources with fragment identifier again because the encoding never matched.
2508
2509         Test: http/tests/svg/svg-use-external.html
2510
2511         * loader/TextResourceDecoder.cpp:
2512         (WebCore::TextResourceDecoder::setEncoding):
2513         (WebCore::TextResourceDecoder::hasEqualEncodingForCharset):
2514
2515             Encoding can depend on mime type. Add a comparison function that takes this into account.
2516
2517         (WebCore::findXMLEncoding):
2518         * loader/TextResourceDecoder.h:
2519         (WebCore::TextResourceDecoder::encoding):
2520         * loader/cache/CachedCSSStyleSheet.h:
2521         * loader/cache/CachedResource.h:
2522         (WebCore::CachedResource::textResourceDecoder):
2523
2524             Add a way to get the TextResourceDecoder from a cached resource.
2525
2526         * loader/cache/CachedResourceLoader.cpp:
2527         (WebCore::CachedResourceLoader::determineRevalidationPolicy):
2528
2529             Use the new comparison function.
2530
2531         * loader/cache/CachedSVGDocument.h:
2532         * loader/cache/CachedScript.h:
2533         * loader/cache/CachedXSLStyleSheet.h:
2534
2535 2016-04-22  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2536
2537         Drop [UsePointersEvenForNonNullableObjectArguments] from InspectorFrontendHost
2538         https://bugs.webkit.org/show_bug.cgi?id=156908
2539
2540         Reviewed by Timothy Hatcher.
2541
2542         No change of behavior.
2543
2544         * inspector/InspectorFrontendHost.idl: Marking event parameter as nullable to keep compatibility.
2545
2546 2016-04-22  Chris Dumez  <cdumez@apple.com>
2547
2548         Drop [UsePointersEvenForNonNullableObjectArguments] from MutationObserver
2549         https://bugs.webkit.org/show_bug.cgi?id=156890
2550
2551         Reviewed by Darin Adler.
2552
2553         Drop [UsePointersEvenForNonNullableObjectArguments] from MutationObserver
2554         and clean up / modernize the code a bit. There is not significant Web-
2555         exposed behavior change except that MutationObserver.observe() now throws
2556         a different kind of exception (a TypeError as per Web IDL) when passed in
2557         a null Node.
2558
2559         No new tests, rebaselined existing test.
2560
2561         * bindings/js/JSMutationCallback.cpp:
2562         (WebCore::JSMutationCallback::call):
2563         * bindings/js/JSMutationCallback.h:
2564         * bindings/js/JSMutationObserverCustom.cpp:
2565         (WebCore::constructJSMutationObserver):
2566         * css/PropertySetCSSStyleDeclaration.cpp:
2567         * dom/ChildListMutationScope.cpp:
2568         (WebCore::ChildListMutationAccumulator::enqueueMutationRecord):
2569         * dom/MutationCallback.h:
2570         * dom/MutationObserver.cpp:
2571         (WebCore::MutationObserver::create):
2572         (WebCore::MutationObserver::MutationObserver):
2573         (WebCore::MutationObserver::observe):
2574         (WebCore::MutationObserver::takeRecords):
2575         (WebCore::MutationObserver::enqueueMutationRecord):
2576         (WebCore::MutationObserver::deliver):
2577         (WebCore::MutationObserver::disconnect): Deleted.
2578         * dom/MutationObserver.h:
2579         * dom/MutationObserver.idl:
2580         * dom/MutationObserverInterestGroup.cpp:
2581         (WebCore::MutationObserverInterestGroup::enqueueMutationRecord):
2582         * dom/MutationObserverInterestGroup.h:
2583         * dom/MutationRecord.cpp:
2584         (WebCore::MutationRecord::createChildList):
2585         * dom/MutationRecord.h:
2586
2587 2016-04-22  Dave Hyatt  <hyatt@apple.com>
2588
2589         REGRESSION (r189567): The top of Facebook's messenger.com looks visually broken
2590         https://bugs.webkit.org/show_bug.cgi?id=156869
2591         <rdar://problem/23204668>
2592
2593         Reviewed by Zalan Bujtas.
2594
2595         Added fast/block/min-content-with-box-sizing.html
2596
2597         * rendering/RenderBox.cpp:
2598         (WebCore::RenderBox::computeContentLogicalHeight):
2599
2600 2016-04-22  Manuel Rego Casasnovas  <rego@igalia.com>
2601
2602         [css-grid] Fix bug with positioned items in vertical writing mode
2603         https://bugs.webkit.org/show_bug.cgi?id=156870
2604
2605         Reviewed by Darin Adler.
2606
2607         In RenderGrid::offsetAndBreadthForPositionedChild() we were using
2608         directly borderLeft(), which is wrong in vertical writing modes.
2609
2610         To fix it we just need to use borderLogicalLeft() which is aware of
2611         the current writing mode.
2612
2613         Test: fast/css-grid-layout/grid-positioned-children-writing-modes.html
2614
2615         * rendering/RenderGrid.cpp:
2616         (WebCore::RenderGrid::offsetAndBreadthForPositionedChild):
2617
2618 2016-04-21  Zan Dobersek  <zdobersek@igalia.com>
2619
2620         REGRESSION(r199738): The ANGLE update broke accelerated compositing in GTK+ port
2621         https://bugs.webkit.org/show_bug.cgi?id=156789
2622
2623         Reviewed by Carlos Garcia Campos.
2624
2625         After the update, the ANGLE library has to be built with
2626         ANGLE_ENABLE_ESSL and ANGLE_ENABLE_GLSL definitions in order
2627         to compile in the support for the two translators that Linux-based
2628         ports using OpenGL ES or OpenGL require. Missing files are also added.
2629
2630         * CMakeLists.txt:
2631
2632 2016-04-21  Chris Dumez  <cdumez@apple.com>
2633
2634         Drop [UsePointersEvenForNonNullableObjectArguments] from Document
2635         https://bugs.webkit.org/show_bug.cgi?id=156881
2636
2637         Reviewed by Darin Adler.
2638
2639         Drop [UsePointersEvenForNonNullableObjectArguments] from Document. There
2640         is no major Web-exposed behavior change but the type of the exception
2641         being thrown when passing null or not enough parameters has changed for
2642         some of the API (It is now always a TypeError as per the Web IDL
2643         specification).
2644
2645         Tests: fast/dom/Document/adoptNode-null.html
2646                fast/dom/Document/importNode-null.html
2647
2648         * dom/ContainerNode.cpp:
2649         (WebCore::ContainerNode::takeAllChildrenFrom):
2650         (WebCore::ContainerNode::parserInsertBefore):
2651         (WebCore::ContainerNode::parserAppendChild):
2652         * dom/Document.cpp:
2653         (WebCore::Document::importNode):
2654         (WebCore::Document::adoptNode):
2655         (WebCore::Document::createNodeIterator):
2656         (WebCore::Document::createTreeWalker):
2657         (WebCore::Document::setBodyOrFrameset):
2658         (WebCore::Document::hasValidNamespaceForElements): Deleted.
2659         (WebCore::Document::scheduleForcedStyleRecalc): Deleted.
2660         (WebCore::Document::scheduleStyleRecalc): Deleted.
2661         (WebCore::Document::unscheduleStyleRecalc): Deleted.
2662         (WebCore::Document::hasPendingStyleRecalc): Deleted.
2663         (WebCore::Document::hasPendingForcedStyleRecalc): Deleted.
2664         (WebCore::Document::recalcStyle): Deleted.
2665         (WebCore::Document::explicitClose): Deleted.
2666         * dom/Document.h:
2667         (WebCore::Document::importNode):
2668         * dom/Document.idl:
2669         * dom/NodeIterator.cpp:
2670         (WebCore::NodeIterator::NodeIterator):
2671         * dom/NodeIterator.h:
2672         (WebCore::NodeIterator::create):
2673
2674 2016-04-21  Frederic Wang  <fwang@igalia.com>
2675
2676         More improvements and explanations regarding resetting CSS properties on the <math> element
2677         https://bugs.webkit.org/show_bug.cgi?id=156840
2678
2679         Reviewed by Darin Adler.
2680
2681         We some follow-up improvements regarding CSS rules on the <math> element, after bug 133603:
2682         - We fix indenting to use 4 spaces.
2683         - We explain why we set -webkit-line-box-contain and add references to related bugs.
2684         - We explain why we reset some CSS spacing rules.
2685         - We explain why the direction is set to ltr.
2686         - We explain why font-family is set to a list of known math fonts and add reference
2687           to the wiki.
2688         - We mention the need to customize math fonts to get consistent style and add references to
2689           a bug report and to the wiki.
2690         - We described each of the math font listed and add some justification about their orders.
2691         - We better explain the section about fonts that do not satisfy the requirements for good
2692           mathematical rendering, reformulate why we still need them for iOS/Mac and we add some
2693           references to a bug report and to the wiki. Some fonts that not pre-installed were removed
2694           in r199773.
2695         - We add a FIXME comments for potential changes of CSS properties on the <math> tag.
2696
2697         We make the following changes to the lists of font-family:
2698         - We move "TeX Gyre Termes Math" into the Times group.
2699         - We move "Asana Math" into the Palatino group.
2700         - We remove iOS conditionals on "Symbol" and "Times New Roman".
2701
2702         No new tests, only order of math fonts that are not used by test framework is changed.
2703
2704         * css/mathml.css:
2705         (math): We merge the two math selectors, reorder some font-families, remove iOS ifdef and
2706         add more description.
2707
2708 2016-04-21  Dean Jackson  <dino@apple.com>
2709
2710         Backdrop Filter should not be visible if element has visibility:hidden
2711         https://bugs.webkit.org/show_bug.cgi?id=149318
2712         <rdar://problem/22749780>
2713
2714         Reviewed by Simon Fraser.
2715
2716         Make sure that backdrop filter layers take note of when
2717         the contents are visible or not.
2718
2719         Tests: css3/filters/backdrop/backdrop-with-visibility-hidden-changing.html
2720                css3/filters/backdrop/backdrop-with-visibility-hidden.html
2721                css3/filters/backdrop/backdrop-with-visibility-hidden-2.html
2722
2723         * platform/graphics/ca/GraphicsLayerCA.cpp:
2724         (WebCore::GraphicsLayerCA::updateContentsVisibility): Tell the backdrop layer about the
2725         change if there is one.
2726         (WebCore::GraphicsLayerCA::updateBackdropFilters): When we update filters, make
2727         sure to check the contents visibility.
2728         (WebCore::dumpInnerLayer): Output "hidden" if the layer is set as such.
2729         * platform/graphics/ca/PlatformCALayer.h: Add an isHidden method.
2730         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
2731         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
2732         (PlatformCALayerCocoa::isHidden): Call into CALayer isHidden.
2733
2734 2016-04-21  Zalan Bujtas  <zalan@apple.com>
2735
2736         RenderVideo should always update the intrinsic size before layout.
2737         https://bugs.webkit.org/show_bug.cgi?id=156878
2738
2739         Reviewed by Simon Fraser.
2740
2741         In order to layout video element properly we need to know the correct intrinsic size.
2742         This patch also asserts if we end up updating the intrinsic size right after finishing video renderer layout.
2743
2744         This issues was discovered as part of webkit.org/b/156245. (hence covered by existing tests)
2745
2746         * rendering/RenderVideo.cpp:
2747         (WebCore::RenderVideo::updateIntrinsicSize):
2748         (WebCore::RenderVideo::layout):
2749         (WebCore::RenderVideo::updatePlayer):
2750         * rendering/RenderVideo.h:
2751
2752 2016-04-21  Brady Eidson  <beidson@apple.com>
2753
2754         Modern IDB (Workers): Get the IDBConnectionProxy from the Document to the WorkerGlobalScope.
2755         https://bugs.webkit.org/show_bug.cgi?id=156877
2756
2757         Reviewed by Tim Horton.
2758
2759         No new tests (Covered by changes to existing tests).
2760
2761         * workers/WorkerMessagingProxy.cpp:
2762         (WebCore::WorkerMessagingProxy::startWorkerGlobalScope): This is the point on the main thread
2763           where we can get the IDBConnectionProxy from the Document and pass it down through Worker
2764           machinery so it can end up at the WorkerGlobalScope.
2765         
2766         Everything else is this patch is just passing it along as needed.
2767
2768         And cleaning up header style for neglected headers.
2769
2770         * workers/DedicatedWorkerGlobalScope.cpp:
2771         (WebCore::DedicatedWorkerGlobalScope::create):
2772         (WebCore::DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope):
2773         * workers/DedicatedWorkerGlobalScope.h:
2774
2775         * workers/DedicatedWorkerThread.cpp:
2776         (WebCore::DedicatedWorkerThread::DedicatedWorkerThread):
2777         (WebCore::DedicatedWorkerThread::createWorkerGlobalScope):
2778         * workers/DedicatedWorkerThread.h:
2779         (WebCore::DedicatedWorkerThread::create):
2780         (WebCore::DedicatedWorkerThread::workerObjectProxy):
2781
2782         * workers/WorkerGlobalScope.cpp:
2783         (WebCore::WorkerGlobalScope::WorkerGlobalScope):
2784         (WebCore::WorkerGlobalScope::idbConnectionProxy):
2785         * workers/WorkerGlobalScope.h:
2786
2787         * workers/WorkerThread.cpp:
2788         (WebCore::WorkerThread::WorkerThread):
2789         (WebCore::WorkerThread::idbConnectionProxy):
2790         * workers/WorkerThread.h:
2791         (WebCore::WorkerThread::threadID):
2792         (WebCore::WorkerThread::runLoop):
2793         (WebCore::WorkerThread::workerLoaderProxy):
2794         (WebCore::WorkerThread::workerReportingProxy):
2795         (WebCore::WorkerThread::getNotificationClient):
2796         (WebCore::WorkerThread::setNotificationClient):
2797         (WebCore::WorkerThread::workerGlobalScope):
2798
2799 2016-04-21  Anders Carlsson  <andersca@apple.com>
2800
2801         Fix crashes when loading SVG images.
2802
2803         * loader/EmptyClients.cpp:
2804         (WebCore::fillWithEmptyClients):
2805         Give the SVG page its own application cache storage.
2806
2807 2016-04-21  Anders Carlsson  <andersca@apple.com>
2808
2809         Get rid of ApplicationCacheStorage::singleton
2810         https://bugs.webkit.org/show_bug.cgi?id=156882
2811
2812         Reviewed by Tim Horton.
2813
2814         * loader/appcache/ApplicationCacheStorage.cpp:
2815         (WebCore::ApplicationCacheStorage::setCacheDirectory): Deleted.
2816         (WebCore::ApplicationCacheStorage::singleton): Deleted.
2817         * loader/appcache/ApplicationCacheStorage.h:
2818         * page/Page.cpp:
2819         (WebCore::Page::Page):
2820
2821 2016-04-21  Simon Fraser  <simon.fraser@apple.com>
2822
2823         ASSERTION FAILED: accumulation == TransformState::FlattenTransform in WebCore::GraphicsLayerCA::computeVisibleAndCoverageRect
2824         https://bugs.webkit.org/show_bug.cgi?id=155362
2825
2826         Reviewed by Zalan Bujtas.
2827
2828         A particular configuration of composited RenderLayers with preserve-3d and clipping
2829         caused assertions because an ancestor clipping layer had masksToBounds() set, but
2830         a preserves3D() parent, triggering an assertion in GraphicsLayerCA::computeVisibleAndCoverageRect().
2831         Make two changes to address this:
2832
2833         First, CSS clip: and clip-path: should force flattening and override preserve-3d in
2834         the RenderStyle.
2835
2836         Second, don't accumulate transforms in GraphicsLayerCA through layers with masksToBounds().
2837
2838         Tests: compositing/clipping/preserve3d-flatten-assertion-nested.html
2839                compositing/clipping/preserve3d-flatten-assertion.html
2840
2841         * css/StyleResolver.cpp:
2842         (WebCore::StyleResolver::adjustRenderStyle):
2843         * platform/graphics/ca/GraphicsLayerCA.cpp:
2844         (WebCore::accumulatesTransform):
2845
2846 2016-04-21  Chris Dumez  <cdumez@apple.com>
2847
2848         Element::idForStyleResolution() is a foot-gun
2849         https://bugs.webkit.org/show_bug.cgi?id=156852
2850
2851         Reviewed by Darin Adler.
2852
2853         Element::idForStyleResolution() is a foot-gun. It requires the caller to check
2854         Element::hasID() first or it may end up crashing when dereferencing elementData()
2855         (e.g. see Bug 156806).
2856
2857         This patch updates Element::idForStyleResolution() to return nullAtom is the
2858         Element does not have an ID. I did not see a performance impact on Speedometer,
2859         Dromaeo DOM Core, Dromaeo CSS Selectors and our local performanceTests/.
2860
2861         * css/ElementRuleCollector.cpp:
2862         (WebCore::ElementRuleCollector::collectMatchingRules):
2863         * css/SelectorChecker.cpp:
2864         (WebCore::SelectorChecker::checkOne):
2865         * css/SelectorFilter.cpp:
2866         (WebCore::collectElementIdentifierHashes):
2867         * dom/Element.h:
2868         (WebCore::Element::idForStyleResolution):
2869         * rendering/RenderBlockFlow.cpp:
2870         (WebCore::needsAppleMailPaginationQuirk):
2871         * rendering/RenderTreeAsText.cpp:
2872         (WebCore::writeRenderRegionList):
2873         * style/StyleSharingResolver.cpp:
2874         (WebCore::Style::SharingResolver::canShareStyleWithElement):
2875
2876 2016-04-21  Brady Eidson  <beidson@apple.com>
2877
2878         Modern IDB (Workers): Move IDBConnectionProxy into IDBRequest and IDBDatabase.
2879         https://bugs.webkit.org/show_bug.cgi?id=156868
2880
2881         Reviewed by Tim Horton.
2882
2883         No new tests (No behavior change).
2884
2885         * Modules/indexeddb/IDBDatabase.cpp:
2886         (WebCore::IDBDatabase::create):
2887         (WebCore::IDBDatabase::IDBDatabase):
2888         (WebCore::IDBDatabase::~IDBDatabase):
2889         (WebCore::IDBDatabase::transaction):
2890         (WebCore::IDBDatabase::maybeCloseInServer):
2891         * Modules/indexeddb/IDBDatabase.h:
2892         (WebCore::IDBDatabase::connectionProxy):
2893         (WebCore::IDBDatabase::serverConnection):
2894
2895         * Modules/indexeddb/IDBOpenDBRequest.cpp:
2896         (WebCore::IDBOpenDBRequest::createDeleteRequest):
2897         (WebCore::IDBOpenDBRequest::createOpenRequest):
2898         (WebCore::IDBOpenDBRequest::IDBOpenDBRequest):
2899         (WebCore::IDBOpenDBRequest::onSuccess):
2900         (WebCore::IDBOpenDBRequest::onUpgradeNeeded):
2901         (WebCore::IDBOpenDBRequest::requestCompleted):
2902         (WebCore::IDBOpenDBRequest::maybeCreateDeleteRequest): Deleted.
2903         (WebCore::IDBOpenDBRequest::maybeCreateOpenRequest): Deleted.
2904         * Modules/indexeddb/IDBOpenDBRequest.h:
2905
2906         * Modules/indexeddb/IDBRequest.cpp:
2907         (WebCore::IDBRequest::IDBRequest):
2908         (WebCore::IDBRequest::connectionToServer): Deleted.
2909         * Modules/indexeddb/IDBRequest.h:
2910         (WebCore::IDBRequest::connectionProxy):
2911
2912         * Modules/indexeddb/IDBTransaction.h:
2913
2914         * Modules/indexeddb/client/IDBConnectionProxy.cpp:
2915         (WebCore::IDBClient::IDBConnectionProxy::openDatabase):
2916         (WebCore::IDBClient::IDBConnectionProxy::deleteDatabase):
2917
2918 2016-04-21  Jiewen Tan  <jiewen_tan@apple.com>
2919
2920         [iOS] DumpRenderTree crashed in com.apple.WebCore: WebCore::ResourceLoadNotifier::didFailToLoad
2921         https://bugs.webkit.org/show_bug.cgi?id=156829
2922         <rdar://problem/23348217>
2923
2924         Reviewed by Daniel Bates.
2925
2926         Ensure that the frame associated with the ResourceLoadNotifier is kept alive when notifying the Web Inspector.
2927
2928         Covered by existing tests.
2929
2930         * loader/ResourceLoadNotifier.cpp:
2931         (WebCore::ResourceLoadNotifier::didFailToLoad):
2932         (WebCore::ResourceLoadNotifier::dispatchWillSendRequest):
2933         (WebCore::ResourceLoadNotifier::dispatchDidReceiveResponse):
2934         (WebCore::ResourceLoadNotifier::dispatchDidReceiveData):
2935         (WebCore::ResourceLoadNotifier::dispatchDidFinishLoading):
2936         (WebCore::ResourceLoadNotifier::dispatchDidFailLoading):
2937
2938 2016-04-21  Brady Eidson  <beidson@apple.com>
2939
2940         Modern IDB (Workers): More IDBConnectionProxy refactoring.
2941         https://bugs.webkit.org/show_bug.cgi?id=156855
2942
2943         Reviewed by Darin Adler.
2944
2945         No new tests (Covered by changes to existing tests).
2946
2947         * Modules/indexeddb/DOMWindowIndexedDatabase.cpp:
2948         (WebCore::DOMWindowIndexedDatabase::indexedDB):
2949
2950         Hang on to the IDBConnectionProxy passed in at creation time, as it should never change:
2951         * Modules/indexeddb/IDBFactory.cpp:
2952         (WebCore::IDBFactory::create):
2953         (WebCore::IDBFactory::IDBFactory):
2954         (WebCore::IDBFactory::openInternal):
2955         (WebCore::IDBFactory::deleteDatabase):
2956         * Modules/indexeddb/IDBFactory.h:
2957
2958         Hang on to the IDBConnectionProxy passed in at creation time, as it should never change:
2959         * Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.cpp:
2960         (WebCore::WorkerGlobalScopeIndexedDatabase::WorkerGlobalScopeIndexedDatabase):
2961         (WebCore::WorkerGlobalScopeIndexedDatabase::from):
2962         (WebCore::WorkerGlobalScopeIndexedDatabase::indexedDB):
2963         * Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.h:
2964
2965         Make IDBConnectionProxy ThreadSafeRefCounted:
2966         * Modules/indexeddb/client/IDBConnectionProxy.cpp:
2967         (WebCore::IDBClient::IDBConnectionProxy::create):
2968         * Modules/indexeddb/client/IDBConnectionProxy.h:
2969
2970         * dom/Document.cpp:
2971         (WebCore::Document::idbConnectionProxy):
2972         * dom/Document.h:
2973
2974 2016-04-21  Keith Miller  <keith_miller@apple.com>
2975
2976         WebScriptObject description swizzler should work in a multi-threaded world
2977         https://bugs.webkit.org/show_bug.cgi?id=156808
2978
2979         Reviewed by Geoffrey Garen.
2980
2981         A WebKit legacy API user might be running Objective-C code on another thread.
2982         Since we don't want to corrupt other thread's NSObject description method
2983         we use TLS to record if we are in the stringValue function. As an attempt to
2984         preserve any user swizzling we update the non-stringValue NSObject description
2985         method on each call to stringValue if it has changed. Additionally, the TLS
2986         needs to be a int because the user might call into stringValue, back into JS,
2987         then back into stringValue. If the TLS was a boolean then it would be unset
2988         at that point so when we return into the first stringValue call we would call
2989         the original NSObject description method rather than our override.
2990
2991         Test added to API tests: WebKit1.WebScriptObjectDescription
2992
2993         * bridge/objc/objc_instance.mm:
2994         (-[NSObject _web_description]):
2995         (ObjcInstance::stringValue):
2996         (swizzleNSObjectDescription): Deleted.
2997
2998 2016-04-21  Beth Dakin  <bdakin@apple.com>
2999
3000         Build fix.
3001
3002         * platform/mac/WebPlaybackSessionInterfaceMac.mm:
3003         (WebCore::WebPlaybackSessionInterfaceMac::setAudioMediaSelectionOptions):
3004         (WebCore::WebPlaybackSessionInterfaceMac::setLegibleMediaSelectionOptions):
3005         (WebCore::WebPlaybackSessionInterfaceMac::invalidate):
3006
3007 2016-04-21  Beth Dakin  <bdakin@apple.com>
3008
3009         32 bit build fix.
3010
3011         * platform/mac/WebPlaybackSessionInterfaceMac.mm:
3012
3013 2016-04-21  Konstantin Tokarev  <annulen@yandex.ru>
3014
3015         Fixed compilation with !ENABLE(SVG_FONTS).
3016         https://bugs.webkit.org/show_bug.cgi?id=156850
3017
3018         Reviewed by Michael Catanzaro.
3019
3020         No new tests needed.
3021
3022         * css/CSSFontFaceSource.cpp:
3023         (WebCore::CSSFontFaceSource::CSSFontFaceSource):
3024         Added missing ENABLE(SVG_FONTS) guards.
3025         * css/CSSFontFaceSource.h: Ditto.
3026         * platform/graphics/FontCascade.cpp: Ditto.
3027         * svg/SVGToOTFFontConversion.cpp:
3028         (WebCore::FontCascade::drawGlyphBuffer): Deleted extraneous
3029         !ENABLE(SVG_FONTS) guard.
3030
3031 2016-04-21  Beth Dakin  <bdakin@apple.com>
3032
3033         Remove reliance on WebAVMediaSelectionOptionMac for the 
3034         WebPlaybackControlsManager
3035         https://bugs.webkit.org/show_bug.cgi?id=156811
3036         -and corresponding-
3037         rdar://problem/25760523
3038
3039         Reviewed by Jer Noble.
3040
3041         * platform/mac/WebPlaybackSessionInterfaceMac.mm:
3042         (-[WebPlaybackControlsManager setSeekableTimeRanges:]):
3043         (-[WebPlaybackControlsManager setAudioMediaSelectionOptions:withSelectedIndex:]):
3044         (-[WebPlaybackControlsManager setLegibleMediaSelectionOptions:withSelectedIndex:]):
3045         (WebCore::WebPlaybackSessionInterfaceMac::~WebPlaybackSessionInterfaceMac):
3046         (WebCore::WebPlaybackSessionInterfaceMac::setSeekableRanges):
3047         (WebCore::WebPlaybackSessionInterfaceMac::setAudioMediaSelectionOptions):
3048         (WebCore::WebPlaybackSessionInterfaceMac::setLegibleMediaSelectionOptions):
3049         (WebCore::WebPlaybackSessionInterfaceMac::invalidate):
3050         (-[WebAVMediaSelectionOptionMac localizedDisplayName]): Deleted.
3051         (-[WebAVMediaSelectionOptionMac setLocalizedDisplayName:]): Deleted.
3052         (-[WebPlaybackControlsManager isSeeking]): Deleted.
3053         (-[WebPlaybackControlsManager seekToTime:toleranceBefore:toleranceAfter:]): Deleted.
3054         (-[WebPlaybackControlsManager audioMediaSelectionOptions]): Deleted.
3055         (-[WebPlaybackControlsManager setAudioMediaSelectionOptions:]): Deleted.
3056         (-[WebPlaybackControlsManager currentAudioMediaSelectionOption]): Deleted.
3057         (-[WebPlaybackControlsManager setCurrentAudioMediaSelectionOption:]): Deleted.
3058         (-[WebPlaybackControlsManager legibleMediaSelectionOptions]): Deleted.
3059         (-[WebPlaybackControlsManager setLegibleMediaSelectionOptions:]): Deleted.
3060         (-[WebPlaybackControlsManager currentLegibleMediaSelectionOption]): Deleted.
3061         (-[WebPlaybackControlsManager setCurrentLegibleMediaSelectionOption:]): Deleted.
3062         (-[WebPlaybackControlsManager cancelThumbnailAndAudioAmplitudeSampleGeneration]): Deleted.
3063         (WebCore::mediaSelectionOptions): Deleted.
3064
3065 2016-04-21  Said Abou-Hallawa  <sabouhallawa@apple.com>
3066
3067         REGRESSION(198782): ImageSource::subsamplingLevelForScale() does not cache the MaximumSubsamplingLevel for this ImageSource
3068         https://bugs.webkit.org/show_bug.cgi?id=156766
3069
3070         Reviewed by Darin Adler.
3071
3072         Ensure the MaximumSubsamplingLevel for the ImageSource is calculated
3073         only once and is cached for subsequent uses. 
3074         
3075         The image subsampling is on by default only for iOS. So the and this
3076         patch currently affects the iOS port.
3077
3078         * platform/graphics/ImageSource.cpp:
3079         (WebCore::ImageSource::cacheMetadata): Cache m_maximumSubsamplingLevel.
3080         Use m_frameCount as a flag for having_the_cache_done.
3081         (WebCore::ImageSource::subsamplingLevelForScale): Call cacheMetadata()
3082         before using m_maximumSubsamplingLevel.
3083         (WebCore::ImageSource::frameCount): Call cacheMetadata() before returning
3084         m_frameCount.
3085         * platform/graphics/ImageSource.h:
3086
3087 2016-04-21  Antoine Quint  <graouts@apple.com>
3088
3089         Creating a large number of WebGL contexts should recycle older contexts
3090         https://bugs.webkit.org/show_bug.cgi?id=156689
3091         <rdar://problem/19535330>
3092
3093         Reviewed by Dean Jackson.
3094
3095         We used to stop creating WebGL contexts once a maximum of 64 WebGL contexts had been
3096         created on a page. Other browsers have a limit of 16 concurrent active WebGL contexts
3097         and they lose older contexts when the developer creates a new context, logging a warning
3098         to the console. We now follow the same approach.
3099
3100         Tests: webgl/max-active-contexts-console-warning.html
3101                webgl/max-active-contexts-gc.html
3102                webgl/max-active-contexts-oldest-context-lost.html
3103                webgl/max-active-contexts-webglcontextlost-prevent-default.html
3104
3105         * html/canvas/WebGLRenderingContextBase.cpp:
3106         (WebCore::WebGLRenderingContextBase::recycleContext):
3107
3108         Prints a warning message to the console indicating that an older WebGL context
3109         will be lost to accomodate for the active contexts limit being reached and loses
3110         the provided context in a way that it may not be recovered by calling `event.preventDefault()`
3111         in the `webglcontextlost` event handler. Finally, we destroy the associated GraphicsContext3D
3112         since it will no longer be useful and it may hold large Open GL resources.
3113
3114         * html/canvas/WebGLRenderingContextBase.h:
3115         * platform/graphics/GraphicsContext3D.h:
3116
3117         Changed GraphicsContext3D::create to return RefPtr instead of PassRefPtr.
3118
3119         * platform/graphics/cairo/GraphicsContext3DCairo.cpp:
3120         (WebCore::GraphicsContext3D::create):
3121         * platform/graphics/efl/GraphicsContext3DEfl.cpp:
3122         (WebCore::GraphicsContext3D::create):
3123         * platform/graphics/mac/GraphicsContext3DMac.mm:
3124         (WebCore::activeContexts):
3125         (WebCore::GraphicsContext3D::create):
3126
3127         Check if we are at the active contexts limit (16) and recycle the oldest context
3128         in our active contexts list. Calling recycleContext() on a context will call the
3129         GraphicsContext3D destructor and remove it from the active contexts list there.
3130
3131         (WebCore::GraphicsContext3D::~GraphicsContext3D):
3132
3133         Remove the deconstructed context from the active contexts list.
3134
3135         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
3136         (WebCore::GraphicsContext3D::recycleContext):
3137         * platform/graphics/win/GraphicsContext3DWin.cpp:
3138         (WebCore::GraphicsContext3D::create):
3139
3140 2016-04-21  Dave Hyatt  <hyatt@apple.com>
3141
3142         Don't hyphenate the last word in a paragraph of text.
3143         https://bugs.webkit.org/show_bug.cgi?id=156803
3144
3145         Reviewed by Simon Fraser.
3146
3147         Added fast/text/hyphenate-avoid-orphaned-word.html
3148
3149         * rendering/RenderText.h:
3150         * rendering/line/BreakingContext.h:
3151         (WebCore::BreakingContext::handleText):
3152
3153 2016-04-21  Chris Dumez  <cdumez@apple.com>
3154
3155         Drop [UsePointersEvenForNonNullableObjectArguments] from Range
3156         https://bugs.webkit.org/show_bug.cgi?id=156805
3157
3158         Reviewed by Youenn Fablet.
3159
3160         No new tests, no web-exposed behavior change.
3161
3162         * accessibility/AXObjectCache.cpp:
3163         (WebCore::AXObjectCache::rangeForNodeContents):
3164         (WebCore::characterOffsetsInOrder):
3165         (WebCore::setRangeStartOrEndWithCharacterOffset):
3166         (WebCore::AXObjectCache::startOrEndCharacterOffsetForRange):
3167         (WebCore::AXObjectCache::previousBoundary):
3168         * accessibility/AccessibilityObject.cpp:
3169         (WebCore::AccessibilityObject::selectText):
3170         * accessibility/AccessibilityRenderObject.cpp:
3171         (WebCore::AccessibilityRenderObject::documentBasedSelectedTextRange):
3172         * dom/Node.cpp:
3173         (WebCore::Node::textRects):
3174         * dom/Range.cpp:
3175         (WebCore::Range::Range):
3176         (WebCore::Range::setDocument):
3177         (WebCore::Range::setStart):
3178         (WebCore::Range::setEnd):
3179         (WebCore::Range::isPointInRange):
3180         (WebCore::Range::comparePoint):
3181         (WebCore::Range::compareNode):
3182         (WebCore::Range::compareBoundaryPoints):
3183         (WebCore::Range::compareBoundaryPointsForBindings):
3184         (WebCore::Range::intersectsNode):
3185         (WebCore::Range::processContents):
3186         (WebCore::Range::insertNode):
3187         (WebCore::Range::checkNodeWOffset):
3188         (WebCore::Range::setStartAfter):
3189         (WebCore::Range::setEndBefore):
3190         (WebCore::Range::setEndAfter):
3191         (WebCore::Range::selectNode):
3192         (WebCore::Range::selectNodeContents):
3193         (WebCore::Range::surroundContents):
3194         (WebCore::Range::setStartBefore):
3195         (WebCore::Range::contains):
3196         (WebCore::rangesOverlap):
3197         (WebCore::rangeOfContents):
3198         (WebCore::boundaryNodeChildrenWillBeRemoved):
3199         (WebCore::boundaryTextNodesMerged):
3200         (WebCore::boundaryTextNodesSplit):
3201         (WebCore::Range::expand):
3202         (WebCore::checkForDifferentRootContainer): Deleted.
3203         (WebCore::highestAncestorUnderCommonRoot): Deleted.
3204         (WebCore::childOfCommonRootBeforeOffset): Deleted.
3205         (WebCore::deleteCharacterData): Deleted.
3206         (WebCore::Range::toString): Deleted.
3207         (WebCore::Range::toHTML): Deleted.
3208         (WebCore::Range::text): Deleted.
3209         (WebCore::Range::cloneRange): Deleted.
3210         (WebCore::Range::absoluteTextRects): Deleted.
3211         (WebCore::Range::absoluteTextQuads): Deleted.
3212         (WebCore::boundaryNodeChildrenChanged): Deleted.
3213         (WebCore::boundaryNodeWillBeRemoved): Deleted.
3214         (WebCore::Range::nodeWillBeRemoved): Deleted.
3215         (WebCore::boundaryTextRemoved): Deleted.
3216         (WebCore::Range::getBoundingClientRect): Deleted.
3217         (WebCore::Range::getBorderAndTextQuads): Deleted.
3218         * dom/Range.h:
3219         * dom/Range.idl:
3220         * dom/RangeBoundaryPoint.h:
3221         (WebCore::RangeBoundaryPoint::set):
3222         (WebCore::RangeBoundaryPoint::setToStartOfNode):
3223         (WebCore::RangeBoundaryPoint::setToEndOfNode):
3224         * editing/AlternativeTextController.cpp:
3225         (WebCore::AlternativeTextController::applyAlternativeTextToRange):
3226         * editing/ApplyStyleCommand.cpp:
3227         (WebCore::ApplyStyleCommand::fixRangeAndApplyInlineStyle):
3228         * editing/Editor.cpp:
3229         (WebCore::Editor::advanceToNextMisspelling):
3230         (WebCore::Editor::rangeOfString):
3231         (WebCore::isFrameInRange):
3232         (WebCore::Editor::countMatchesForText):
3233         * editing/EditorCommand.cpp:
3234         (WebCore::unionDOMRanges):
3235         (WebCore::executeDeleteToMark):
3236         (WebCore::executeSelectToMark):
3237         * editing/FormatBlockCommand.cpp:
3238         (WebCore::FormatBlockCommand::formatRange):
3239         * editing/FrameSelection.cpp:
3240         (WebCore::FrameSelection::respondToNodeModification):
3241         * editing/InsertListCommand.cpp:
3242         (WebCore::InsertListCommand::doApplyForSingleParagraph):
3243         * editing/TextCheckingHelper.cpp:
3244         (WebCore::TextCheckingParagraph::offsetTo):
3245         * editing/TextIterator.cpp:
3246         (WebCore::CharacterIterator::range):
3247         (WebCore::BackwardsCharacterIterator::range):
3248         (WebCore::TextIterator::rangeFromLocationAndLength):
3249         (WebCore::TextIterator::getLocationAndLengthFromRange):
3250         (WebCore::findPlainText):
3251         * editing/VisiblePosition.cpp:
3252         (WebCore::setStart):
3253         (WebCore::setEnd):
3254         * editing/VisibleSelection.cpp:
3255         (WebCore::makeSearchRange):
3256         * editing/VisibleUnits.cpp:
3257         (WebCore::previousBoundary):
3258         (WebCore::nextBoundary):
3259         * editing/htmlediting.cpp:
3260         (WebCore::visiblePositionForIndexUsingCharacterIterator):
3261         (WebCore::isNodeVisiblyContainedWithin):
3262         * editing/htmlediting.h:
3263         * editing/mac/EditorMac.mm:
3264         (WebCore::Editor::adjustedSelectionRange):
3265         * page/ContextMenuController.cpp:
3266         (WebCore::ContextMenuController::contextMenuItemSelected):
3267         * page/DOMSelection.cpp:
3268         (WebCore::DOMSelection::addRange):
3269         * page/DragController.cpp:
3270         (WebCore::selectElement):
3271         * page/EventHandler.cpp:
3272         (WebCore::EventHandler::dispatchMouseEvent):
3273         * page/Page.cpp:
3274         (WebCore::Page::findStringMatchingRanges):
3275         * page/TextIndicator.cpp:
3276         (WebCore::hasNonInlineOrReplacedElements):
3277         * rendering/RenderNamedFlowThread.cpp:
3278         (WebCore::RenderNamedFlowThread::getRanges):
3279
3280 2016-04-21  Chris Dumez  <cdumez@apple.com>
3281
3282         Drop [UsePointersEvenForNonNullableObjectArguments] from DOMURL
3283         https://bugs.webkit.org/show_bug.cgi?id=156797
3284
3285         Reviewed by Youenn Fablet.
3286
3287         * html/DOMURL.cpp:
3288         (WebCore::DOMURL::create):
3289         * html/DOMURL.h:
3290         * html/DOMURL.idl:
3291
3292 2016-04-21  Claudio Saavedra  <csaavedra@igalia.com>
3293
3294         [GTK][EFL] Move non-glib/gtk platform implementations out of platform/gtk
3295         https://bugs.webkit.org/show_bug.cgi?id=156847
3296
3297         Reviewed by Carlos Garcia Campos.
3298
3299         The Language and Logging implementation don't really need glib, so
3300         rework them and move them to a new platform/unix directory so that
3301         they can be shared among Unix ports.
3302
3303         * PlatformEfl.cmake: Use the unix version.
3304         * PlatformGTK.cmake: Same.
3305         * platform/efl/LanguageEfl.cpp: Removed.
3306         * platform/efl/LoggingEfl.cpp: Removed.
3307         * platform/unix/LanguageUnix.cpp: Renamed from Source/WebCore/platform/gtk/LanguageGtk.cpp.
3308         (WebCore::platformLanguage):
3309         (WebCore::platformUserPreferredLanguages):
3310         * platform/unix/LoggingUnix.cpp: Renamed from Source/WebCore/platform/gtk/LoggingGtk.cpp.
3311         (WebCore::logLevelString):
3312
3313 2016-04-21  Nan Wang  <n_wang@apple.com>
3314
3315         AX: stringForTextMarkerRange returning empty string for document range
3316         https://bugs.webkit.org/show_bug.cgi?id=156819
3317
3318         Reviewed by Chris Fleizach.
3319
3320         Set text marker data with CharacterOffset when VisiblePosition is having PositionIsAfterAnchor
3321         or PositionIsAfterChildren anchor type, so that the character offset corresponds to the anchored
3322         node.
3323
3324         Test: accessibility/mac/text-marker-string-for-document-range.html
3325
3326         * accessibility/AXObjectCache.cpp:
3327         (WebCore::AXObjectCache::textMarkerDataForVisiblePosition):
3328
3329 2016-04-20  Chris Dumez  <cdumez@apple.com>
3330
3331         Crash under WebCore::TextIterator::subrange()
3332         https://bugs.webkit.org/show_bug.cgi?id=156809
3333         <rdar://problem/21102730>
3334
3335         Reviewed by Ryosuke Niwa.
3336
3337         TextIterator::rangeFromLocationAndLength() may return null. However, we
3338         failed to do a null check before calling TextIterator::subrange() with
3339         that range.
3340
3341         No new tests, do not know how to reproduce.
3342
3343         * editing/AlternativeTextController.cpp:
3344         (WebCore::AlternativeTextController::applyAlternativeTextToRange):
3345
3346 2016-04-20  Brady Eidson  <beidson@apple.com>
3347
3348         Modern IDB (Workers): Remove IDBRequest/IDBOpenDBRequest's requirement to get an IDBServerConnection around.
3349         https://bugs.webkit.org/show_bug.cgi?id=156826
3350
3351         Reviewed by Alex Christensen.
3352
3353         No new tests (No behavior change, existing tests pass).
3354
3355         This doesn't appear to do much but make things a little more complicated, but it's the first of a few 
3356         small pushes in the right direction.
3357         
3358         * Modules/indexeddb/IDBOpenDBRequest.cpp:
3359         (WebCore::IDBOpenDBRequest::maybeCreateDeleteRequest):
3360         (WebCore::IDBOpenDBRequest::maybeCreateOpenRequest):
3361         (WebCore::IDBOpenDBRequest::IDBOpenDBRequest):
3362         (WebCore::IDBOpenDBRequest::onSuccess):
3363         (WebCore::IDBOpenDBRequest::onUpgradeNeeded):
3364         (WebCore::IDBOpenDBRequest::requestCompleted):
3365         (WebCore::IDBOpenDBRequest::createDeleteRequest): Deleted.
3366         (WebCore::IDBOpenDBRequest::createOpenRequest): Deleted.
3367         * Modules/indexeddb/IDBOpenDBRequest.h:
3368         
3369         * Modules/indexeddb/IDBRequest.cpp:
3370         (WebCore::IDBRequest::IDBRequest):
3371         (WebCore::IDBRequest::connectionToServer):
3372         * Modules/indexeddb/IDBRequest.h:
3373         (WebCore::IDBRequest::connection): Deleted.
3374         
3375         * Modules/indexeddb/client/IDBConnectionProxy.cpp:
3376         (WebCore::IDBClient::IDBConnectionProxy::IDBConnectionProxy):
3377         (WebCore::IDBClient::IDBConnectionProxy::connectionToServer):
3378         (WebCore::IDBClient::IDBConnectionProxy::openDatabase):
3379         (WebCore::IDBClient::IDBConnectionProxy::deleteDatabase):
3380         * Modules/indexeddb/client/IDBConnectionProxy.h:
3381         (WebCore::IDBClient::IDBConnectionProxy::serverConnectionIdentifier):
3382         
3383         * Modules/indexeddb/shared/IDBResourceIdentifier.cpp:
3384         (WebCore::IDBResourceIdentifier::IDBResourceIdentifier):
3385         * Modules/indexeddb/shared/IDBResourceIdentifier.h:
3386
3387 2016-04-20  John Wilander  <wilander@apple.com>
3388
3389         Add Subresource Integrity as "Under consideration".
3390         https://bugs.webkit.org/show_bug.cgi?id=156800
3391
3392         Reviewed by Alexey Proskuryakov.
3393
3394         No new tests needed.
3395
3396         * features.json:
3397             Added an entry for Subresource Integrity.
3398
3399 2016-04-20  Anders Carlsson  <andersca@apple.com>
3400
3401         Get rid of a couple of uses of ApplicationCacheStorage::singleton()
3402         https://bugs.webkit.org/show_bug.cgi?id=156818
3403
3404         Reviewed by Geoffrey Garen.
3405
3406         * loader/appcache/ApplicationCache.cpp:
3407         (WebCore::ApplicationCache::addResource):
3408         * loader/appcache/ApplicationCacheGroup.h:
3409         (WebCore::ApplicationCacheGroup::storage):
3410         * testing/Internals.cpp:
3411         (WebCore::Internals::resetToConsistentState):
3412         (WebCore::Internals::setApplicationCacheOriginQuota):
3413
3414 2016-04-20  Brady Eidson  <beidson@apple.com>
3415
3416         Modern IDB (Workers): Introduce "IDBConnectionProxy" for future threading abstraction, and adopt it in IDBFactory.
3417         https://bugs.webkit.org/show_bug.cgi?id=156810
3418
3419         Reviewed by Alex Christensen.
3420
3421         No new tests (Covered by changes to existing tests).
3422
3423         Add the IDBConnectionProxy object, including the ability to replicate IDBFactory functionality:
3424         * Modules/indexeddb/client/IDBConnectionProxy.cpp: Added.
3425         (WebCore::IDBClient::IDBConnectionProxy::IDBConnectionProxy):
3426         (WebCore::IDBClient::IDBConnectionProxy::openDatabase):
3427         (WebCore::IDBClient::IDBConnectionProxy::deleteDatabase):
3428         * Modules/indexeddb/client/IDBConnectionProxy.h: 
3429         
3430         Add pure virtual IDBConnectionProxy accessor:
3431         * dom/ScriptExecutionContext.h: 
3432
3433         Implement it:
3434         * dom/Document.cpp:
3435         (WebCore::Document::idbConnectionProxy):
3436         * dom/Document.h:
3437         
3438         Implement it:
3439         * workers/WorkerGlobalScope.cpp:
3440         (WebCore::WorkerGlobalScope::idbConnectionProxy):
3441         * workers/WorkerGlobalScope.h:
3442         
3443         * Modules/indexeddb/DOMWindowIndexedDatabase.cpp:
3444         (WebCore::DOMWindowIndexedDatabase::indexedDB):
3445
3446
3447         Don't keep a reference to IDBConnectionToServer, but rather get at the context's IDBConnectionProxy:
3448         * Modules/indexeddb/IDBFactory.cpp:
3449         (WebCore::IDBFactory::create):
3450         (WebCore::IDBFactory::IDBFactory):
3451         (WebCore::IDBFactory::open):
3452         (WebCore::IDBFactory::openInternal):
3453         (WebCore::IDBFactory::deleteDatabase):
3454         * Modules/indexeddb/IDBFactory.h:
3455         * Modules/indexeddb/IDBFactory.idl:
3456
3457         * Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.cpp:
3458         (WebCore::WorkerGlobalScopeIndexedDatabase::indexedDB):
3459
3460         * Modules/indexeddb/client/IDBConnectionToServer.h:
3461
3462         * inspector/InspectorIndexedDBAgent.cpp:
3463
3464         * CMakeLists.txt:
3465         * WebCore.xcodeproj/project.pbxproj:
3466
3467 2016-04-20  Chris Dumez  <cdumez@apple.com>
3468
3469         Use Optional<size_t> for OrderIterator::m_orderIndex instead of int
3470         https://bugs.webkit.org/show_bug.cgi?id=156796
3471
3472         Reviewed by Anders Carlsson.
3473
3474         Use Optional<size_t> for OrderIterator::m_orderIndex instead of int
3475         (with invalid value of -1). m_orderIndex a vector index and therefore
3476         is in the range of an unsigned (type used internally by Vector, even
3477         though the index is exposed as size_t). Therefore, assigning it to an
3478         int is unsafe as it may overflow.
3479
3480         This may fix <rdar://problem/23410338> which is a top crasher.
3481
3482         * rendering/OrderIterator.cpp:
3483         (WebCore::OrderIterator::next):
3484         (WebCore::OrderIterator::reset):
3485         * rendering/OrderIterator.h:
3486
3487 2016-04-20  Chris Dumez  <cdumez@apple.com>
3488
3489         Crash under needsAppleMailPaginationQuirk()
3490         https://bugs.webkit.org/show_bug.cgi?id=156806
3491         <rdar://problem/23323479>
3492
3493         Reviewed by Simon Fraser.
3494
3495         Add check for element()->hasID() before calling element()->idForStyleResolution()
3496         so that we don't dereference a potentially null element()->elementData().
3497         Also stop repeatedly atomizing "messageContentContainer" and leverage
3498         the operator==(const AtomicString&, const char*) instead for performance.
3499
3500         * rendering/RenderBlockFlow.cpp:
3501         (WebCore::needsAppleMailPaginationQuirk):
3502
3503 2016-04-20  Brady Eidson  <beidson@apple.com>
3504
3505         Attempt to fix non-INDEXED_DATABASE_IN_WORKERS builds after r199779
3506
3507         * testing/InternalSettings.cpp:
3508         (WebCore::InternalSettings::Backup::Backup):
3509         (WebCore::InternalSettings::Backup::restoreTo):
3510         (WebCore::InternalSettings::setIndexedDBWorkersEnabled):
3511         * testing/InternalSettings.h:
3512
3513 2016-04-20  Chris Dumez  <cdumez@apple.com>
3514
3515         Potential overflow in RenderLayer::hitTestList()
3516         https://bugs.webkit.org/show_bug.cgi?id=156804
3517
3518         Reviewed by Simon Fraser.
3519
3520         Use size_t type instead of int to iterate over the Vector to make sure
3521         we don't overflow. This is a speculative fix for <rdar://problem/23249479>.
3522
3523         * rendering/RenderLayer.cpp:
3524         (WebCore::RenderLayer::hitTestList):
3525
3526 2016-04-20  Brady Eidson  <beidson@apple.com>
3527
3528         Modern IDB (Workers): Enable INDEXED_DATABASE_IN_WORKERS compile time flag, but disabled in RuntimeEnabledFeatures.
3529         https://bugs.webkit.org/show_bug.cgi?id=156782
3530
3531         Reviewed by Alex Christensen.
3532
3533         Test: storage/indexeddb/modern/workers-disabled.html
3534          &n