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