<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[207716] trunk/Source/WebCore</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/207716">207716</a></dd>
<dt>Author</dt> <dd>darin@apple.com</dd>
<dt>Date</dt> <dd>2016-10-22 13:56:47 -0700 (Sat, 22 Oct 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>Move SVG from ExceptionCode to Exception
https://bugs.webkit.org/show_bug.cgi?id=163837
Reviewed by Chris Dumez.
* WebCore.xcodeproj/project.pbxproj: Added SVGGraphicsElement.idl.
* bindings/js/JSSVGLengthCustom.cpp:
(WebCore::JSSVGLength::value): Use toJSNumber.
(WebCore::JSSVGLength::setValue): Use propagateException.
(WebCore::JSSVGLength::convertToSpecifiedUnits): Ditto.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation): Properly handle SetterMayThrowException
in the special case for SVG setters.
* rendering/style/SVGRenderStyle.h:
(WebCore::SVGRenderStyle::initialBaselineShiftValue): Removed
ASSERT_NO_EXCEPTION, no longer needed.
(WebCore::SVGRenderStyle::initialKerning): Ditto.
* svg/SVGAltGlyphElement.cpp:
(WebCore::SVGAltGlyphElement::setGlyphRef): Use ExceptionOr.
(WebCore::SVGAltGlyphElement::setFormat): Ditto.
(WebCore::SVGAltGlyphElement::hasValidGlyphElements): Tweaked a bit.
* svg/SVGAltGlyphElement.h: Updated for above changes.
* svg/SVGAltGlyphElement.idl: Use non-legacy exceptions.
* svg/SVGAngle.cpp:
(WebCore::SVGAngle::valueAsString): Removed unneeded String globals.
(WebCore::parseAngleType): Rewrote to be simpler and more direct.
(WebCore::SVGAngle::setValueAsString): Use ExceptionOr.
(WebCore::SVGAngle::newValueSpecifiedUnits): Ditto.
(WebCore::SVGAngle::convertToSpecifiedUnits): Ditto.
* svg/SVGAngle.h: Updated for above changes. Initialized data members
here in the class definite and removed constructor; default now works.
* svg/SVGAngle.idl: Use non-legacy exceptions.
* svg/SVGAnimateElementBase.cpp:
(WebCore::SVGAnimateElementBase::calculateAnimatedValue): Update since
CalcMode is now an enum class.
* svg/SVGAnimateMotionElement.cpp:
(WebCore::SVGAnimateMotionElement::SVGAnimateMotionElement): Ditto.
* svg/SVGAnimateTransformElement.cpp:
(WebCore::SVGAnimateTransformElement::hasValidAttributeType): Update
since AttributeType is now an enum class.
* svg/SVGAnimatedAngle.cpp:
(WebCore::SVGAnimatedAngleAnimator::calculateDistance): Removed
ASSERT_NO_EXCEPTION, no longer needed.
* svg/SVGAnimatedBoolean.idl: Use non-legacy exception.
* svg/SVGAnimatedEnumeration.idl: Ditto.
* svg/SVGAnimatedInteger.idl: Ditto.
* svg/SVGAnimatedLength.cpp:
(WebCore::sharedSVGLength): Deleted.
(WebCore::SVGAnimatedLengthAnimator::addAnimatedTypes): Removed
ASSERT_NO_EXCEPTION, no longer needed.
(WebCore::parseLengthFromString): Ditto. Also rewrote to not use
a shared SVGLength; no benefit to doing that.
(WebCore::SVGAnimatedLengthAnimator::calculateAnimatedValue): Ditto.
* svg/SVGAnimatedLengthList.cpp:
(WebCore::SVGAnimatedLengthListAnimator::addAnimatedTypes): Ditto.
(WebCore::SVGAnimatedLengthListAnimator::calculateAnimatedValue): Ditto.
* svg/SVGAnimatedNumber.idl: Use non-legacy exception.
* svg/SVGAnimatedString.idl: Ditto.
* svg/SVGAnimatedType.cpp:
(WebCore::SVGAnimatedType::setValueAsString): Updated since
setValueAsString now uses ExceptionOr.
* svg/SVGAnimationElement.cpp:
(WebCore::SVGAnimationElement::SVGAnimationElement): Initialized scalars
in the class definition instead of here.
(WebCore::SVGAnimationElement::getSimpleDuration): Removed uneeded ExceptionCode&.
(WebCore::SVGAnimationElement::setCalcMode): Updated since CalcMode is now an enum class.
(WebCore::SVGAnimationElement::setAttributeType): Updated since AttributeType
is now an enum class.
(WebCore::SVGAnimationElement::shouldApplyAnimation): Ditto.
(WebCore::SVGAnimationElement::calculateKeyTimesForCalcModePaced): Ditto.
(WebCore::SVGAnimationElement::calculatePercentForSpline): Ditto.
(WebCore::SVGAnimationElement::calculatePercentFromKeyPoints): Ditto.
(WebCore::SVGAnimationElement::calculatePercentForFromTo): Ditto.
(WebCore::SVGAnimationElement::currentValuesFromKeyPoints): Ditto.
(WebCore::SVGAnimationElement::currentValuesForValuesAnimation): Ditto.
(WebCore::SVGAnimationElement::startedActiveInterval): Ditto.
(WebCore::SVGAnimationElement::updateAnimation): Ditto.
(WebCore::SVGAnimationElement::checkInvalidCSSAttributeType): Ditto.
* svg/SVGAnimationElement.h: Changed CalcMode into an enum class.
Updated for above changes.
* svg/SVGAnimationElement.idl: Removed MayThrowLegacyException from
getSimpleDuration.
* svg/SVGColor.cpp:
(WebCore::SVGColor::SVGColor): Updated to take scalar in the straightforward
manner instead of constt SVGColorType&.
(WebCore::SVGColor::setRGBColor): Use ExceptionOr.
(WebCore::SVGColor::setRGBColorICCColor): Ditto.
(WebCore::SVGColor::setColor): Ditto.
* svg/SVGColor.h: Updated for above changes. Removed unneeded destructor.
* svg/SVGColor.idl: Use non-legacy exceptions.
* svg/SVGGlyphRefElement.cpp:
(WebCore::SVGGlyphRefElement::SVGGlyphRefElement): Initialize data members
in class definition, not here.
(WebCore::parseFloat): Added helper. Used in parseAttribute.
(WebCore::SVGGlyphRefElement::parseAttribute): Updated to use parseFloat helper.
(WebCore::SVGGlyphRefElement::glyphRef): Deleted.
(WebCore::SVGGlyphRefElement::setGlyphRef): Deleted.
(WebCore::SVGGlyphRefElement::setX): Removed unused Exception& argument.
(WebCore::SVGGlyphRefElement::setY): Ditto.
(WebCore::SVGGlyphRefElement::setDx): Ditto.
(WebCore::SVGGlyphRefElement::setDy): Ditto.
* svg/SVGGlyphRefElement.h: Updated for above changes.
* svg/SVGGlyphRefElement.idl: Use Reflect on glyphRef. Removed incorrect
SetterMayThrowLegacyException attributes for x, y, dx, and dy. Longer term
it might be nice to use [Reflect] on these too.
* svg/SVGGraphicsElement.idl: Use non-legacy exception.
* svg/SVGLength.cpp:
(WebCore::parseLengthType): Changed argument type since caller does not
need to know how many characters are consumed.
(WebCore::SVGLength::SVGLength): Removed IGNORE_EXCEPTION and ASSERT_NO_EXCEPTION.
Also removed the copy constructor, letting the compiler generate the default.
(WebCore::SVGLength::setValueAsString): Use ExceptionOr.
(WebCore::SVGLength::construct): Updated since setValueAsString uses ExceptionOr.
(WebCore::SVGLength::value): Ditto.
(WebCore::SVGLength::valueForBindings): Use ExceptionOr. Also renamed to
disambiguate with the version used outside of bindings.
(WebCore::SVGLength::setValue): Use ExceptionOr.
(WebCore::SVGLength::newValueSpecifiedUnits): Ditto.
(WebCore::SVGLength::convertToSpecifiedUnits): Ditto.
(WebCore::SVGLength::fromCSSPrimitiveValue): Updated since newValueSpecifiedUnits
uses ExceptionOr.
(WebCore::SVGLength::lengthModeForAnimatedLengthAttribute): Rewrote map generation
code to be more efficient and not unrolled. Only do one hash table lookup.
* svg/SVGLength.h: Updated for above changes.
* svg/SVGLength.idl: Use non-legacy exceptions.
* svg/SVGLengthContext.cpp:
(WebCore::SVGLengthContext::valueForLength): Update since function
uses ExceptionOr.
(WebCore::SVGLengthContext::convertValueToUserUnits): Use ExceptionOr.
(WebCore::SVGLengthContext::convertValueFromUserUnits): Ditto.
(WebCore::SVGLengthContext::convertValueFromUserUnitsToPercentage): Ditto.
(WebCore::SVGLengthContext::convertValueFromPercentageToUserUnits): Ditto.
(WebCore::SVGLengthContext::convertValueFromUserUnitsToEMS): Ditto.
(WebCore::SVGLengthContext::convertValueFromEMSToUserUnits): Ditto.
(WebCore::SVGLengthContext::convertValueFromUserUnitsToEXS): Ditto.
(WebCore::SVGLengthContext::convertValueFromEXSToUserUnits): Ditto.
* svg/SVGLengthContext.h: Updatedfor above changes.
* svg/SVGLengthList.cpp:
(WebCore::SVGLengthList::parse): Updated since setValueAsString uses
ExceptionOr now.
* svg/SVGLengthList.h: Removed unneeded constructor.
* svg/SVGLengthList.idl: Use non-legacy exceptions.
* svg/SVGLocatable.cpp:
(WebCore::SVGLocatable::getTransformToElement): Use ExceptionOr.
* svg/SVGLocatable.h: Updated for above change.
* svg/SVGMarkerElement.h:
(WebCore::SVGPropertyTraits<SVGMarkerOrientType>::fromString):
Updated since setValueAsString uses ExceptionOr now.
* svg/SVGMatrix.h: Use ExceptionOr.
* svg/SVGMatrix.idl: Use non-legacy exceptions.
* svg/SVGNumberList.h: Removed unneeded constructor.
* svg/SVGNumberList.idl: Use non-legacy exceptions.
* svg/SVGPaint.cpp:
(WebCore::SVGPaint::setPaint): Use ExceptionOr.
* svg/SVGPaint.h: Updated for above chagne.
* svg/SVGPaint.idl: Use non-legacy exception.
* svg/SVGPathSegList.h: Tweaked a bit.
* svg/SVGPathSegList.idl: Use non-legacy exceptions.
* svg/SVGPointList.h: Removed unneeded constructor.
* svg/SVGPointList.idl: Use non-legacy exceptions.
* svg/SVGPreserveAspectRatio.cpp:
(WebCore::SVGPreserveAspectRatio::setAlign): Use ExceptionOr.
(WebCore::SVGPreserveAspectRatio::setMeetOrSlice): Ditto.
* svg/SVGPreserveAspectRatio.h: Updated for above changes.
* svg/SVGPreserveAspectRatio.idl: Use non-legacy exceptions.
* svg/SVGSVGElement.cpp:
(WebCore::SVGSVGElement::currentView): Pass a reference.
* svg/SVGStringList.h: Tweaked a bit.
* svg/SVGStringList.idl: Use non-legacy exceptions.
* svg/SVGStyleElement.cpp:
(WebCore::SVGStyleElement::setType): Removed unneeded ExceptionCode&.
(WebCore::SVGStyleElement::setMedia): Ditto.
(WebCore::SVGStyleElement::setTitle): Deleted.
* svg/SVGStyleElement.h: Updated for above changes, and made the title
function override be private.
* svg/SVGStyleElement.idl: Use Reflect for title. Removed unneeded
SetterMayThrowLegacyException on all attributes.
* svg/SVGTextContentElement.cpp:
(WebCore::SVGTextContentElement::textLengthAnimated): Removed
ASSERT_NO_EXCEPTION, won't work any more.
(WebCore::SVGTextContentElement::getSubStringLength): Use ExceptionOr.
Also remove redundant call to updateLayoutIgnorePendingStylesheets,
called by getNumberOfChars.
(WebCore::SVGTextContentElement::getStartPositionOfChar): Ditto.
(WebCore::SVGTextContentElement::getEndPositionOfChar): Ditto.
(WebCore::SVGTextContentElement::getExtentOfChar): Ditto.
(WebCore::SVGTextContentElement::getRotationOfChar): Ditto.
(WebCore::SVGTextContentElement::selectSubString): Ditto.
* svg/SVGTextContentElement.h: Updated for above changes.
* svg/SVGTextContentElement.idl: Use non-legacy exceptions.
* svg/SVGTransformList.h: Removed unneeded constructor.
* svg/SVGTransformList.idl: Use non-legacy exceptions.
* svg/SVGViewSpec.cpp:
(WebCore::SVGViewSpec::SVGViewSpec): Updated to take a reference.
(WebCore::SVGViewSpec::setZoomAndPan): Use ExceptionOr.
(WebCore::SVGViewSpec::setTransformString): Deleted.
(WebCore::SVGViewSpec::viewBoxString): Use m_viewBox directly.
(WebCore::SVGViewSpec::preserveAspectRatioString): Use
m_preserveAspectRatio directly.
(WebCore::SVGViewSpec::viewTarget): Use is<SVGElement>.
(WebCore::SVGViewSpec::lookupOrCreateViewBoxWrapper): Use
m_contextElement directly.
(WebCore::SVGViewSpec::lookupOrCreatePreserveAspectRatioWrapper):
Ditto.
(WebCore::SVGViewSpec::lookupOrCreateTransformWrapper): Ditto.
(WebCore::SVGViewSpec::parseViewSpec): Set m_viewTargetString directly.
* svg/SVGViewSpec.h: Updated for above changes. Removed unneeded virtual
destructor, unneeded using for ref/deref, unused functions including
setTransformString, setViewTargetString, non-exception setZoomAndPan,
contextElement, viewBoxBaseValue, and preserveAspectRatioBaseValue.
* svg/SVGViewSpec.idl: Use non-legacy exceptions. Also specify
ImplementationLacksVTable.
* svg/properties/SVGAnimatedEnumerationPropertyTearOff.h:
Use ExceptionOr.
* svg/properties/SVGAnimatedStaticPropertyTearOff.h: Ditto.
* svg/properties/SVGListProperty.h: Ditto.
* svg/properties/SVGListPropertyTearOff.h: Ditto.
* svg/properties/SVGPathSegListPropertyTearOff.cpp:
(WebCore::SVGPathSegListPropertyTearOff::clear): Ditto.
(WebCore::SVGPathSegListPropertyTearOff::getItem): Ditto.
(WebCore::SVGPathSegListPropertyTearOff::replaceItem): Ditto.
(WebCore::SVGPathSegListPropertyTearOff::removeItem): Ditto.
* svg/properties/SVGPathSegListPropertyTearOff.h: Ditto.
* svg/properties/SVGPropertyTearOff.h: Ditto. Also added an overload
of create that knows how to deal with exceptions.
* svg/properties/SVGStaticListPropertyTearOff.h: Ditto.
* svg/properties/SVGTransformListPropertyTearOff.h: Ditto.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSSVGLengthCustomcpp">trunk/Source/WebCore/bindings/js/JSSVGLengthCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm">trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm</a></li>
<li><a href="#trunkSourceWebCorerenderingstyleSVGRenderStyleh">trunk/Source/WebCore/rendering/style/SVGRenderStyle.h</a></li>
<li><a href="#trunkSourceWebCoresvgSVGAltGlyphElementcpp">trunk/Source/WebCore/svg/SVGAltGlyphElement.cpp</a></li>
<li><a href="#trunkSourceWebCoresvgSVGAltGlyphElementh">trunk/Source/WebCore/svg/SVGAltGlyphElement.h</a></li>
<li><a href="#trunkSourceWebCoresvgSVGAltGlyphElementidl">trunk/Source/WebCore/svg/SVGAltGlyphElement.idl</a></li>
<li><a href="#trunkSourceWebCoresvgSVGAnglecpp">trunk/Source/WebCore/svg/SVGAngle.cpp</a></li>
<li><a href="#trunkSourceWebCoresvgSVGAngleh">trunk/Source/WebCore/svg/SVGAngle.h</a></li>
<li><a href="#trunkSourceWebCoresvgSVGAngleidl">trunk/Source/WebCore/svg/SVGAngle.idl</a></li>
<li><a href="#trunkSourceWebCoresvgSVGAnimateElementBasecpp">trunk/Source/WebCore/svg/SVGAnimateElementBase.cpp</a></li>
<li><a href="#trunkSourceWebCoresvgSVGAnimateMotionElementcpp">trunk/Source/WebCore/svg/SVGAnimateMotionElement.cpp</a></li>
<li><a href="#trunkSourceWebCoresvgSVGAnimateTransformElementcpp">trunk/Source/WebCore/svg/SVGAnimateTransformElement.cpp</a></li>
<li><a href="#trunkSourceWebCoresvgSVGAnimatedAnglecpp">trunk/Source/WebCore/svg/SVGAnimatedAngle.cpp</a></li>
<li><a href="#trunkSourceWebCoresvgSVGAnimatedBooleanidl">trunk/Source/WebCore/svg/SVGAnimatedBoolean.idl</a></li>
<li><a href="#trunkSourceWebCoresvgSVGAnimatedEnumerationidl">trunk/Source/WebCore/svg/SVGAnimatedEnumeration.idl</a></li>
<li><a href="#trunkSourceWebCoresvgSVGAnimatedIntegeridl">trunk/Source/WebCore/svg/SVGAnimatedInteger.idl</a></li>
<li><a href="#trunkSourceWebCoresvgSVGAnimatedLengthcpp">trunk/Source/WebCore/svg/SVGAnimatedLength.cpp</a></li>
<li><a href="#trunkSourceWebCoresvgSVGAnimatedLengthListcpp">trunk/Source/WebCore/svg/SVGAnimatedLengthList.cpp</a></li>
<li><a href="#trunkSourceWebCoresvgSVGAnimatedNumberidl">trunk/Source/WebCore/svg/SVGAnimatedNumber.idl</a></li>
<li><a href="#trunkSourceWebCoresvgSVGAnimatedStringidl">trunk/Source/WebCore/svg/SVGAnimatedString.idl</a></li>
<li><a href="#trunkSourceWebCoresvgSVGAnimatedTypecpp">trunk/Source/WebCore/svg/SVGAnimatedType.cpp</a></li>
<li><a href="#trunkSourceWebCoresvgSVGAnimationElementcpp">trunk/Source/WebCore/svg/SVGAnimationElement.cpp</a></li>
<li><a href="#trunkSourceWebCoresvgSVGAnimationElementh">trunk/Source/WebCore/svg/SVGAnimationElement.h</a></li>
<li><a href="#trunkSourceWebCoresvgSVGAnimationElementidl">trunk/Source/WebCore/svg/SVGAnimationElement.idl</a></li>
<li><a href="#trunkSourceWebCoresvgSVGColorcpp">trunk/Source/WebCore/svg/SVGColor.cpp</a></li>
<li><a href="#trunkSourceWebCoresvgSVGColorh">trunk/Source/WebCore/svg/SVGColor.h</a></li>
<li><a href="#trunkSourceWebCoresvgSVGColoridl">trunk/Source/WebCore/svg/SVGColor.idl</a></li>
<li><a href="#trunkSourceWebCoresvgSVGGlyphRefElementcpp">trunk/Source/WebCore/svg/SVGGlyphRefElement.cpp</a></li>
<li><a href="#trunkSourceWebCoresvgSVGGlyphRefElementh">trunk/Source/WebCore/svg/SVGGlyphRefElement.h</a></li>
<li><a href="#trunkSourceWebCoresvgSVGGlyphRefElementidl">trunk/Source/WebCore/svg/SVGGlyphRefElement.idl</a></li>
<li><a href="#trunkSourceWebCoresvgSVGGraphicsElementidl">trunk/Source/WebCore/svg/SVGGraphicsElement.idl</a></li>
<li><a href="#trunkSourceWebCoresvgSVGLengthcpp">trunk/Source/WebCore/svg/SVGLength.cpp</a></li>
<li><a href="#trunkSourceWebCoresvgSVGLengthh">trunk/Source/WebCore/svg/SVGLength.h</a></li>
<li><a href="#trunkSourceWebCoresvgSVGLengthidl">trunk/Source/WebCore/svg/SVGLength.idl</a></li>
<li><a href="#trunkSourceWebCoresvgSVGLengthContextcpp">trunk/Source/WebCore/svg/SVGLengthContext.cpp</a></li>
<li><a href="#trunkSourceWebCoresvgSVGLengthContexth">trunk/Source/WebCore/svg/SVGLengthContext.h</a></li>
<li><a href="#trunkSourceWebCoresvgSVGLengthListcpp">trunk/Source/WebCore/svg/SVGLengthList.cpp</a></li>
<li><a href="#trunkSourceWebCoresvgSVGLengthListh">trunk/Source/WebCore/svg/SVGLengthList.h</a></li>
<li><a href="#trunkSourceWebCoresvgSVGLengthListidl">trunk/Source/WebCore/svg/SVGLengthList.idl</a></li>
<li><a href="#trunkSourceWebCoresvgSVGLocatablecpp">trunk/Source/WebCore/svg/SVGLocatable.cpp</a></li>
<li><a href="#trunkSourceWebCoresvgSVGLocatableh">trunk/Source/WebCore/svg/SVGLocatable.h</a></li>
<li><a href="#trunkSourceWebCoresvgSVGMarkerElementh">trunk/Source/WebCore/svg/SVGMarkerElement.h</a></li>
<li><a href="#trunkSourceWebCoresvgSVGMatrixh">trunk/Source/WebCore/svg/SVGMatrix.h</a></li>
<li><a href="#trunkSourceWebCoresvgSVGMatrixidl">trunk/Source/WebCore/svg/SVGMatrix.idl</a></li>
<li><a href="#trunkSourceWebCoresvgSVGNumberListh">trunk/Source/WebCore/svg/SVGNumberList.h</a></li>
<li><a href="#trunkSourceWebCoresvgSVGNumberListidl">trunk/Source/WebCore/svg/SVGNumberList.idl</a></li>
<li><a href="#trunkSourceWebCoresvgSVGPaintcpp">trunk/Source/WebCore/svg/SVGPaint.cpp</a></li>
<li><a href="#trunkSourceWebCoresvgSVGPainth">trunk/Source/WebCore/svg/SVGPaint.h</a></li>
<li><a href="#trunkSourceWebCoresvgSVGPaintidl">trunk/Source/WebCore/svg/SVGPaint.idl</a></li>
<li><a href="#trunkSourceWebCoresvgSVGPathSegListh">trunk/Source/WebCore/svg/SVGPathSegList.h</a></li>
<li><a href="#trunkSourceWebCoresvgSVGPathSegListidl">trunk/Source/WebCore/svg/SVGPathSegList.idl</a></li>
<li><a href="#trunkSourceWebCoresvgSVGPointListh">trunk/Source/WebCore/svg/SVGPointList.h</a></li>
<li><a href="#trunkSourceWebCoresvgSVGPointListidl">trunk/Source/WebCore/svg/SVGPointList.idl</a></li>
<li><a href="#trunkSourceWebCoresvgSVGPreserveAspectRatiocpp">trunk/Source/WebCore/svg/SVGPreserveAspectRatio.cpp</a></li>
<li><a href="#trunkSourceWebCoresvgSVGPreserveAspectRatioh">trunk/Source/WebCore/svg/SVGPreserveAspectRatio.h</a></li>
<li><a href="#trunkSourceWebCoresvgSVGPreserveAspectRatioidl">trunk/Source/WebCore/svg/SVGPreserveAspectRatio.idl</a></li>
<li><a href="#trunkSourceWebCoresvgSVGSVGElementcpp">trunk/Source/WebCore/svg/SVGSVGElement.cpp</a></li>
<li><a href="#trunkSourceWebCoresvgSVGStringListh">trunk/Source/WebCore/svg/SVGStringList.h</a></li>
<li><a href="#trunkSourceWebCoresvgSVGStringListidl">trunk/Source/WebCore/svg/SVGStringList.idl</a></li>
<li><a href="#trunkSourceWebCoresvgSVGStyleElementcpp">trunk/Source/WebCore/svg/SVGStyleElement.cpp</a></li>
<li><a href="#trunkSourceWebCoresvgSVGStyleElementh">trunk/Source/WebCore/svg/SVGStyleElement.h</a></li>
<li><a href="#trunkSourceWebCoresvgSVGStyleElementidl">trunk/Source/WebCore/svg/SVGStyleElement.idl</a></li>
<li><a href="#trunkSourceWebCoresvgSVGTextContentElementcpp">trunk/Source/WebCore/svg/SVGTextContentElement.cpp</a></li>
<li><a href="#trunkSourceWebCoresvgSVGTextContentElementh">trunk/Source/WebCore/svg/SVGTextContentElement.h</a></li>
<li><a href="#trunkSourceWebCoresvgSVGTextContentElementidl">trunk/Source/WebCore/svg/SVGTextContentElement.idl</a></li>
<li><a href="#trunkSourceWebCoresvgSVGTransformListh">trunk/Source/WebCore/svg/SVGTransformList.h</a></li>
<li><a href="#trunkSourceWebCoresvgSVGTransformListidl">trunk/Source/WebCore/svg/SVGTransformList.idl</a></li>
<li><a href="#trunkSourceWebCoresvgSVGViewSpeccpp">trunk/Source/WebCore/svg/SVGViewSpec.cpp</a></li>
<li><a href="#trunkSourceWebCoresvgSVGViewSpech">trunk/Source/WebCore/svg/SVGViewSpec.h</a></li>
<li><a href="#trunkSourceWebCoresvgSVGViewSpecidl">trunk/Source/WebCore/svg/SVGViewSpec.idl</a></li>
<li><a href="#trunkSourceWebCoresvgpropertiesSVGAnimatedEnumerationPropertyTearOffh">trunk/Source/WebCore/svg/properties/SVGAnimatedEnumerationPropertyTearOff.h</a></li>
<li><a href="#trunkSourceWebCoresvgpropertiesSVGAnimatedStaticPropertyTearOffh">trunk/Source/WebCore/svg/properties/SVGAnimatedStaticPropertyTearOff.h</a></li>
<li><a href="#trunkSourceWebCoresvgpropertiesSVGListPropertyh">trunk/Source/WebCore/svg/properties/SVGListProperty.h</a></li>
<li><a href="#trunkSourceWebCoresvgpropertiesSVGListPropertyTearOffh">trunk/Source/WebCore/svg/properties/SVGListPropertyTearOff.h</a></li>
<li><a href="#trunkSourceWebCoresvgpropertiesSVGPathSegListPropertyTearOffcpp">trunk/Source/WebCore/svg/properties/SVGPathSegListPropertyTearOff.cpp</a></li>
<li><a href="#trunkSourceWebCoresvgpropertiesSVGPathSegListPropertyTearOffh">trunk/Source/WebCore/svg/properties/SVGPathSegListPropertyTearOff.h</a></li>
<li><a href="#trunkSourceWebCoresvgpropertiesSVGPropertyTearOffh">trunk/Source/WebCore/svg/properties/SVGPropertyTearOff.h</a></li>
<li><a href="#trunkSourceWebCoresvgpropertiesSVGStaticListPropertyTearOffh">trunk/Source/WebCore/svg/properties/SVGStaticListPropertyTearOff.h</a></li>
<li><a href="#trunkSourceWebCoresvgpropertiesSVGTransformListPropertyTearOffh">trunk/Source/WebCore/svg/properties/SVGTransformListPropertyTearOff.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (207715 => 207716)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-10-22 20:46:34 UTC (rev 207715)
+++ trunk/Source/WebCore/ChangeLog        2016-10-22 20:56:47 UTC (rev 207716)
</span><span class="lines">@@ -1,3 +1,269 @@
</span><ins>+2016-10-22 Darin Adler <darin@apple.com>
+
+ Move SVG from ExceptionCode to Exception
+ https://bugs.webkit.org/show_bug.cgi?id=163837
+
+ Reviewed by Chris Dumez.
+
+ * WebCore.xcodeproj/project.pbxproj: Added SVGGraphicsElement.idl.
+
+ * bindings/js/JSSVGLengthCustom.cpp:
+ (WebCore::JSSVGLength::value): Use toJSNumber.
+ (WebCore::JSSVGLength::setValue): Use propagateException.
+ (WebCore::JSSVGLength::convertToSpecifiedUnits): Ditto.
+
+ * bindings/scripts/CodeGeneratorJS.pm:
+ (GenerateImplementation): Properly handle SetterMayThrowException
+ in the special case for SVG setters.
+
+ * rendering/style/SVGRenderStyle.h:
+ (WebCore::SVGRenderStyle::initialBaselineShiftValue): Removed
+ ASSERT_NO_EXCEPTION, no longer needed.
+ (WebCore::SVGRenderStyle::initialKerning): Ditto.
+
+ * svg/SVGAltGlyphElement.cpp:
+ (WebCore::SVGAltGlyphElement::setGlyphRef): Use ExceptionOr.
+ (WebCore::SVGAltGlyphElement::setFormat): Ditto.
+ (WebCore::SVGAltGlyphElement::hasValidGlyphElements): Tweaked a bit.
+ * svg/SVGAltGlyphElement.h: Updated for above changes.
+ * svg/SVGAltGlyphElement.idl: Use non-legacy exceptions.
+
+ * svg/SVGAngle.cpp:
+ (WebCore::SVGAngle::valueAsString): Removed unneeded String globals.
+ (WebCore::parseAngleType): Rewrote to be simpler and more direct.
+ (WebCore::SVGAngle::setValueAsString): Use ExceptionOr.
+ (WebCore::SVGAngle::newValueSpecifiedUnits): Ditto.
+ (WebCore::SVGAngle::convertToSpecifiedUnits): Ditto.
+ * svg/SVGAngle.h: Updated for above changes. Initialized data members
+ here in the class definite and removed constructor; default now works.
+ * svg/SVGAngle.idl: Use non-legacy exceptions.
+
+ * svg/SVGAnimateElementBase.cpp:
+ (WebCore::SVGAnimateElementBase::calculateAnimatedValue): Update since
+ CalcMode is now an enum class.
+ * svg/SVGAnimateMotionElement.cpp:
+ (WebCore::SVGAnimateMotionElement::SVGAnimateMotionElement): Ditto.
+
+ * svg/SVGAnimateTransformElement.cpp:
+ (WebCore::SVGAnimateTransformElement::hasValidAttributeType): Update
+ since AttributeType is now an enum class.
+
+ * svg/SVGAnimatedAngle.cpp:
+ (WebCore::SVGAnimatedAngleAnimator::calculateDistance): Removed
+ ASSERT_NO_EXCEPTION, no longer needed.
+
+ * svg/SVGAnimatedBoolean.idl: Use non-legacy exception.
+ * svg/SVGAnimatedEnumeration.idl: Ditto.
+ * svg/SVGAnimatedInteger.idl: Ditto.
+
+ * svg/SVGAnimatedLength.cpp:
+ (WebCore::sharedSVGLength): Deleted.
+ (WebCore::SVGAnimatedLengthAnimator::addAnimatedTypes): Removed
+ ASSERT_NO_EXCEPTION, no longer needed.
+ (WebCore::parseLengthFromString): Ditto. Also rewrote to not use
+ a shared SVGLength; no benefit to doing that.
+ (WebCore::SVGAnimatedLengthAnimator::calculateAnimatedValue): Ditto.
+ * svg/SVGAnimatedLengthList.cpp:
+ (WebCore::SVGAnimatedLengthListAnimator::addAnimatedTypes): Ditto.
+ (WebCore::SVGAnimatedLengthListAnimator::calculateAnimatedValue): Ditto.
+
+ * svg/SVGAnimatedNumber.idl: Use non-legacy exception.
+ * svg/SVGAnimatedString.idl: Ditto.
+
+ * svg/SVGAnimatedType.cpp:
+ (WebCore::SVGAnimatedType::setValueAsString): Updated since
+ setValueAsString now uses ExceptionOr.
+
+ * svg/SVGAnimationElement.cpp:
+ (WebCore::SVGAnimationElement::SVGAnimationElement): Initialized scalars
+ in the class definition instead of here.
+ (WebCore::SVGAnimationElement::getSimpleDuration): Removed uneeded ExceptionCode&.
+ (WebCore::SVGAnimationElement::setCalcMode): Updated since CalcMode is now an enum class.
+ (WebCore::SVGAnimationElement::setAttributeType): Updated since AttributeType
+ is now an enum class.
+ (WebCore::SVGAnimationElement::shouldApplyAnimation): Ditto.
+ (WebCore::SVGAnimationElement::calculateKeyTimesForCalcModePaced): Ditto.
+ (WebCore::SVGAnimationElement::calculatePercentForSpline): Ditto.
+ (WebCore::SVGAnimationElement::calculatePercentFromKeyPoints): Ditto.
+ (WebCore::SVGAnimationElement::calculatePercentForFromTo): Ditto.
+ (WebCore::SVGAnimationElement::currentValuesFromKeyPoints): Ditto.
+ (WebCore::SVGAnimationElement::currentValuesForValuesAnimation): Ditto.
+ (WebCore::SVGAnimationElement::startedActiveInterval): Ditto.
+ (WebCore::SVGAnimationElement::updateAnimation): Ditto.
+ (WebCore::SVGAnimationElement::checkInvalidCSSAttributeType): Ditto.
+
+ * svg/SVGAnimationElement.h: Changed CalcMode into an enum class.
+ Updated for above changes.
+
+ * svg/SVGAnimationElement.idl: Removed MayThrowLegacyException from
+ getSimpleDuration.
+
+ * svg/SVGColor.cpp:
+ (WebCore::SVGColor::SVGColor): Updated to take scalar in the straightforward
+ manner instead of constt SVGColorType&.
+ (WebCore::SVGColor::setRGBColor): Use ExceptionOr.
+ (WebCore::SVGColor::setRGBColorICCColor): Ditto.
+ (WebCore::SVGColor::setColor): Ditto.
+ * svg/SVGColor.h: Updated for above changes. Removed unneeded destructor.
+ * svg/SVGColor.idl: Use non-legacy exceptions.
+
+ * svg/SVGGlyphRefElement.cpp:
+ (WebCore::SVGGlyphRefElement::SVGGlyphRefElement): Initialize data members
+ in class definition, not here.
+ (WebCore::parseFloat): Added helper. Used in parseAttribute.
+ (WebCore::SVGGlyphRefElement::parseAttribute): Updated to use parseFloat helper.
+ (WebCore::SVGGlyphRefElement::glyphRef): Deleted.
+ (WebCore::SVGGlyphRefElement::setGlyphRef): Deleted.
+ (WebCore::SVGGlyphRefElement::setX): Removed unused Exception& argument.
+ (WebCore::SVGGlyphRefElement::setY): Ditto.
+ (WebCore::SVGGlyphRefElement::setDx): Ditto.
+ (WebCore::SVGGlyphRefElement::setDy): Ditto.
+ * svg/SVGGlyphRefElement.h: Updated for above changes.
+ * svg/SVGGlyphRefElement.idl: Use Reflect on glyphRef. Removed incorrect
+ SetterMayThrowLegacyException attributes for x, y, dx, and dy. Longer term
+ it might be nice to use [Reflect] on these too.
+
+ * svg/SVGGraphicsElement.idl: Use non-legacy exception.
+
+ * svg/SVGLength.cpp:
+ (WebCore::parseLengthType): Changed argument type since caller does not
+ need to know how many characters are consumed.
+ (WebCore::SVGLength::SVGLength): Removed IGNORE_EXCEPTION and ASSERT_NO_EXCEPTION.
+ Also removed the copy constructor, letting the compiler generate the default.
+ (WebCore::SVGLength::setValueAsString): Use ExceptionOr.
+ (WebCore::SVGLength::construct): Updated since setValueAsString uses ExceptionOr.
+ (WebCore::SVGLength::value): Ditto.
+ (WebCore::SVGLength::valueForBindings): Use ExceptionOr. Also renamed to
+ disambiguate with the version used outside of bindings.
+ (WebCore::SVGLength::setValue): Use ExceptionOr.
+ (WebCore::SVGLength::newValueSpecifiedUnits): Ditto.
+ (WebCore::SVGLength::convertToSpecifiedUnits): Ditto.
+ (WebCore::SVGLength::fromCSSPrimitiveValue): Updated since newValueSpecifiedUnits
+ uses ExceptionOr.
+ (WebCore::SVGLength::lengthModeForAnimatedLengthAttribute): Rewrote map generation
+ code to be more efficient and not unrolled. Only do one hash table lookup.
+ * svg/SVGLength.h: Updated for above changes.
+ * svg/SVGLength.idl: Use non-legacy exceptions.
+
+ * svg/SVGLengthContext.cpp:
+ (WebCore::SVGLengthContext::valueForLength): Update since function
+ uses ExceptionOr.
+ (WebCore::SVGLengthContext::convertValueToUserUnits): Use ExceptionOr.
+ (WebCore::SVGLengthContext::convertValueFromUserUnits): Ditto.
+ (WebCore::SVGLengthContext::convertValueFromUserUnitsToPercentage): Ditto.
+ (WebCore::SVGLengthContext::convertValueFromPercentageToUserUnits): Ditto.
+ (WebCore::SVGLengthContext::convertValueFromUserUnitsToEMS): Ditto.
+ (WebCore::SVGLengthContext::convertValueFromEMSToUserUnits): Ditto.
+ (WebCore::SVGLengthContext::convertValueFromUserUnitsToEXS): Ditto.
+ (WebCore::SVGLengthContext::convertValueFromEXSToUserUnits): Ditto.
+ * svg/SVGLengthContext.h: Updatedfor above changes.
+
+ * svg/SVGLengthList.cpp:
+ (WebCore::SVGLengthList::parse): Updated since setValueAsString uses
+ ExceptionOr now.
+ * svg/SVGLengthList.h: Removed unneeded constructor.
+ * svg/SVGLengthList.idl: Use non-legacy exceptions.
+
+ * svg/SVGLocatable.cpp:
+ (WebCore::SVGLocatable::getTransformToElement): Use ExceptionOr.
+ * svg/SVGLocatable.h: Updated for above change.
+
+ * svg/SVGMarkerElement.h:
+ (WebCore::SVGPropertyTraits<SVGMarkerOrientType>::fromString):
+ Updated since setValueAsString uses ExceptionOr now.
+
+ * svg/SVGMatrix.h: Use ExceptionOr.
+ * svg/SVGMatrix.idl: Use non-legacy exceptions.
+
+ * svg/SVGNumberList.h: Removed unneeded constructor.
+ * svg/SVGNumberList.idl: Use non-legacy exceptions.
+
+ * svg/SVGPaint.cpp:
+ (WebCore::SVGPaint::setPaint): Use ExceptionOr.
+ * svg/SVGPaint.h: Updated for above chagne.
+ * svg/SVGPaint.idl: Use non-legacy exception.
+
+ * svg/SVGPathSegList.h: Tweaked a bit.
+ * svg/SVGPathSegList.idl: Use non-legacy exceptions.
+
+ * svg/SVGPointList.h: Removed unneeded constructor.
+ * svg/SVGPointList.idl: Use non-legacy exceptions.
+
+ * svg/SVGPreserveAspectRatio.cpp:
+ (WebCore::SVGPreserveAspectRatio::setAlign): Use ExceptionOr.
+ (WebCore::SVGPreserveAspectRatio::setMeetOrSlice): Ditto.
+ * svg/SVGPreserveAspectRatio.h: Updated for above changes.
+ * svg/SVGPreserveAspectRatio.idl: Use non-legacy exceptions.
+
+ * svg/SVGSVGElement.cpp:
+ (WebCore::SVGSVGElement::currentView): Pass a reference.
+
+ * svg/SVGStringList.h: Tweaked a bit.
+ * svg/SVGStringList.idl: Use non-legacy exceptions.
+
+ * svg/SVGStyleElement.cpp:
+ (WebCore::SVGStyleElement::setType): Removed unneeded ExceptionCode&.
+ (WebCore::SVGStyleElement::setMedia): Ditto.
+ (WebCore::SVGStyleElement::setTitle): Deleted.
+ * svg/SVGStyleElement.h: Updated for above changes, and made the title
+ function override be private.
+ * svg/SVGStyleElement.idl: Use Reflect for title. Removed unneeded
+ SetterMayThrowLegacyException on all attributes.
+
+ * svg/SVGTextContentElement.cpp:
+ (WebCore::SVGTextContentElement::textLengthAnimated): Removed
+ ASSERT_NO_EXCEPTION, won't work any more.
+ (WebCore::SVGTextContentElement::getSubStringLength): Use ExceptionOr.
+ Also remove redundant call to updateLayoutIgnorePendingStylesheets,
+ called by getNumberOfChars.
+ (WebCore::SVGTextContentElement::getStartPositionOfChar): Ditto.
+ (WebCore::SVGTextContentElement::getEndPositionOfChar): Ditto.
+ (WebCore::SVGTextContentElement::getExtentOfChar): Ditto.
+ (WebCore::SVGTextContentElement::getRotationOfChar): Ditto.
+ (WebCore::SVGTextContentElement::selectSubString): Ditto.
+ * svg/SVGTextContentElement.h: Updated for above changes.
+ * svg/SVGTextContentElement.idl: Use non-legacy exceptions.
+
+ * svg/SVGTransformList.h: Removed unneeded constructor.
+ * svg/SVGTransformList.idl: Use non-legacy exceptions.
+
+ * svg/SVGViewSpec.cpp:
+ (WebCore::SVGViewSpec::SVGViewSpec): Updated to take a reference.
+ (WebCore::SVGViewSpec::setZoomAndPan): Use ExceptionOr.
+ (WebCore::SVGViewSpec::setTransformString): Deleted.
+ (WebCore::SVGViewSpec::viewBoxString): Use m_viewBox directly.
+ (WebCore::SVGViewSpec::preserveAspectRatioString): Use
+ m_preserveAspectRatio directly.
+ (WebCore::SVGViewSpec::viewTarget): Use is<SVGElement>.
+ (WebCore::SVGViewSpec::lookupOrCreateViewBoxWrapper): Use
+ m_contextElement directly.
+ (WebCore::SVGViewSpec::lookupOrCreatePreserveAspectRatioWrapper):
+ Ditto.
+ (WebCore::SVGViewSpec::lookupOrCreateTransformWrapper): Ditto.
+ (WebCore::SVGViewSpec::parseViewSpec): Set m_viewTargetString directly.
+ * svg/SVGViewSpec.h: Updated for above changes. Removed unneeded virtual
+ destructor, unneeded using for ref/deref, unused functions including
+ setTransformString, setViewTargetString, non-exception setZoomAndPan,
+ contextElement, viewBoxBaseValue, and preserveAspectRatioBaseValue.
+ * svg/SVGViewSpec.idl: Use non-legacy exceptions. Also specify
+ ImplementationLacksVTable.
+
+ * svg/properties/SVGAnimatedEnumerationPropertyTearOff.h:
+ Use ExceptionOr.
+ * svg/properties/SVGAnimatedStaticPropertyTearOff.h: Ditto.
+ * svg/properties/SVGListProperty.h: Ditto.
+ * svg/properties/SVGListPropertyTearOff.h: Ditto.
+ * svg/properties/SVGPathSegListPropertyTearOff.cpp:
+ (WebCore::SVGPathSegListPropertyTearOff::clear): Ditto.
+ (WebCore::SVGPathSegListPropertyTearOff::getItem): Ditto.
+ (WebCore::SVGPathSegListPropertyTearOff::replaceItem): Ditto.
+ (WebCore::SVGPathSegListPropertyTearOff::removeItem): Ditto.
+ * svg/properties/SVGPathSegListPropertyTearOff.h: Ditto.
+ * svg/properties/SVGPropertyTearOff.h: Ditto. Also added an overload
+ of create that knows how to deal with exceptions.
+ * svg/properties/SVGStaticListPropertyTearOff.h: Ditto.
+ * svg/properties/SVGTransformListPropertyTearOff.h: Ditto.
+
</ins><span class="cx"> 2016-10-22 Chris Dumez <cdumez@apple.com>
</span><span class="cx">
</span><span class="cx"> WebGLRenderingContextBase.bufferData() should use a union instead of overloading
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (207715 => 207716)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-10-22 20:46:34 UTC (rev 207715)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-10-22 20:56:47 UTC (rev 207716)
</span><span class="lines">@@ -10613,6 +10613,7 @@
</span><span class="cx">                 933A14B60B7D1D5200A53FFD /* JSTextEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSTextEvent.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 933A14B70B7D1D5200A53FFD /* JSTextEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSTextEvent.h; sourceTree = "<group>"; };
</span><span class="cx">                 933C7A741C0FBC440034FB97 /* NSSpellCheckerSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSSpellCheckerSPI.h; sourceTree = "<group>"; };
</span><ins>+                934305961DB9FA0E00E712A7 /* SVGGraphicsElement.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = SVGGraphicsElement.idl; sourceTree = "<group>"; };
</ins><span class="cx">                 9343CB7F12F25E510033C5EE /* TextCodecUTF8.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextCodecUTF8.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 9343CB8012F25E510033C5EE /* TextCodecUTF8.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextCodecUTF8.h; sourceTree = "<group>"; };
</span><span class="cx">                 93442C9D0D2B335C00338FF9 /* HTMLTableRowsCollection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLTableRowsCollection.h; sourceTree = "<group>"; };
</span><span class="lines">@@ -20713,6 +20714,7 @@
</span><span class="cx">                                 B22278950D00BF200071B782 /* SVGGradientElement.idl */,
</span><span class="cx">                                 B222791F0D00BF210071B782 /* SVGGraphicsElement.cpp */,
</span><span class="cx">                                 B22279200D00BF210071B782 /* SVGGraphicsElement.h */,
</span><ins>+                                934305961DB9FA0E00E712A7 /* SVGGraphicsElement.idl */,
</ins><span class="cx">                                 650FBF270D9AF046008FC292 /* SVGHKernElement.cpp */,
</span><span class="cx">                                 650FBF280D9AF047008FC292 /* SVGHKernElement.h */,
</span><span class="cx">                                 650FBF290D9AF047008FC292 /* SVGHKernElement.idl */,
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSSVGLengthCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSSVGLengthCustom.cpp (207715 => 207716)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSSVGLengthCustom.cpp        2016-10-22 20:46:34 UTC (rev 207715)
+++ trunk/Source/WebCore/bindings/js/JSSVGLengthCustom.cpp        2016-10-22 20:56:47 UTC (rev 207716)
</span><span class="lines">@@ -34,16 +34,9 @@
</span><span class="cx">
</span><span class="cx"> JSValue JSSVGLength::value(ExecState& state) const
</span><span class="cx"> {
</span><del>- SVGLength& podImp = wrapped().propertyReference();
- ExceptionCode ec = 0;
- SVGLengthContext lengthContext(wrapped().contextElement());
- float value = podImp.value(lengthContext, ec);
- if (ec) {
- setDOMException(&state, ec);
- return jsUndefined();
- }
-
- return jsNumber(value);
</del><ins>+ VM& vm = state.vm();
+ auto scope = DECLARE_THROW_SCOPE(vm);
+ return toJSNumber(state, scope, wrapped().propertyReference().valueForBindings(SVGLengthContext { wrapped().contextElement() }));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void JSSVGLength::setValue(ExecState& state, JSValue value)
</span><span class="lines">@@ -61,13 +54,12 @@
</span><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- SVGLength& podImp = wrapped().propertyReference();
</del><ins>+ auto floatValue = value.toFloat(&state);
+ RETURN_IF_EXCEPTION(scope, void());
</ins><span class="cx">
</span><del>- ExceptionCode ec = 0;
- SVGLengthContext lengthContext(wrapped().contextElement());
- podImp.setValue(value.toFloat(&state), lengthContext, ec);
- if (ec) {
- setDOMException(&state, ec);
</del><ins>+ auto result = wrapped().propertyReference().setValue(floatValue, SVGLengthContext { wrapped().contextElement() });
+ if (result.hasException()) {
+ propagateException(state, scope, result.releaseException());
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -81,11 +73,9 @@
</span><span class="cx">
</span><span class="cx"> if (wrapped().isReadOnly()) {
</span><span class="cx"> setDOMException(&state, NO_MODIFICATION_ALLOWED_ERR);
</span><del>- return jsUndefined();
</del><ins>+ return { };
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- SVGLength& podImp = wrapped().propertyReference();
-
</del><span class="cx"> if (state.argumentCount() < 1)
</span><span class="cx"> return throwException(&state, scope, createNotEnoughArgumentsError(&state));
</span><span class="cx">
</span><span class="lines">@@ -92,12 +82,10 @@
</span><span class="cx"> unsigned short unitType = state.uncheckedArgument(0).toUInt32(&state);
</span><span class="cx"> RETURN_IF_EXCEPTION(scope, JSValue());
</span><span class="cx">
</span><del>- ExceptionCode ec = 0;
- SVGLengthContext lengthContext(wrapped().contextElement());
- podImp.convertToSpecifiedUnits(unitType, lengthContext, ec);
- if (ec) {
- setDOMException(&state, ec);
- return jsUndefined();
</del><ins>+ auto result = wrapped().propertyReference().convertToSpecifiedUnits(unitType, SVGLengthContext { wrapped().contextElement() });
+ if (result.hasException()) {
+ propagateException(state, scope, result.releaseException());
+ return { };
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> wrapped().commitChange();
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (207715 => 207716)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-10-22 20:46:34 UTC (rev 207715)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-10-22 20:56:47 UTC (rev 207716)
</span><span class="lines">@@ -3538,9 +3538,11 @@
</span><span class="cx"> if ($svgPropertyOrListPropertyType eq "float") { # Special case for JSSVGNumber
</span><span class="cx"> push(@implContent, " podImpl = nativeValue;\n");
</span><span class="cx"> } else {
</span><del>- push(@implContent, " podImpl.set$implSetterFunctionName(nativeValue");
- push(@implContent, ", ec") if $setterMayThrowLegacyException;
- push(@implContent, ");\n");
</del><ins>+ my $functionString = "podImpl.set$implSetterFunctionName(nativeValue";
+ $functionString .= ", ec" if $setterMayThrowLegacyException;
+ $functionString .= ")";
+ $functionString = "propagateException(state, throwScope, $functionString)" if $attribute->signature->extendedAttributes->{SetterMayThrowException};
+ push(@implContent, " $functionString;\n");
</ins><span class="cx"> push(@implContent, " setDOMException(&state, throwScope, ec);\n") if $setterMayThrowLegacyException;
</span><span class="cx"> }
</span><span class="cx"> if ($svgPropertyType) {
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingstyleSVGRenderStyleh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/style/SVGRenderStyle.h (207715 => 207716)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/style/SVGRenderStyle.h        2016-10-22 20:46:34 UTC (rev 207715)
+++ trunk/Source/WebCore/rendering/style/SVGRenderStyle.h        2016-10-22 20:56:47 UTC (rev 207716)
</span><span class="lines">@@ -100,7 +100,7 @@
</span><span class="cx"> static SVGLength initialBaselineShiftValue()
</span><span class="cx"> {
</span><span class="cx"> SVGLength length;
</span><del>- length.newValueSpecifiedUnits(LengthTypeNumber, 0, ASSERT_NO_EXCEPTION);
</del><ins>+ length.newValueSpecifiedUnits(LengthTypeNumber, 0);
</ins><span class="cx"> return length;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -107,7 +107,7 @@
</span><span class="cx"> static SVGLength initialKerning()
</span><span class="cx"> {
</span><span class="cx"> SVGLength length;
</span><del>- length.newValueSpecifiedUnits(LengthTypeNumber, 0, ASSERT_NO_EXCEPTION);
</del><ins>+ length.newValueSpecifiedUnits(LengthTypeNumber, 0);
</ins><span class="cx"> return length;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGAltGlyphElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGAltGlyphElement.cpp (207715 => 207716)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGAltGlyphElement.cpp        2016-10-22 20:46:34 UTC (rev 207715)
+++ trunk/Source/WebCore/svg/SVGAltGlyphElement.cpp        2016-10-22 20:56:47 UTC (rev 207716)
</span><span class="lines">@@ -55,9 +55,9 @@
</span><span class="cx"> return adoptRef(*new SVGAltGlyphElement(tagName, document));
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void SVGAltGlyphElement::setGlyphRef(const AtomicString&, ExceptionCode& ec)
</del><ins>+ExceptionOr<void> SVGAltGlyphElement::setGlyphRef(const AtomicString&)
</ins><span class="cx"> {
</span><del>- ec = NO_MODIFICATION_ALLOWED_ERR;
</del><ins>+ return Exception { NO_MODIFICATION_ALLOWED_ERR };
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> const AtomicString& SVGAltGlyphElement::glyphRef() const
</span><span class="lines">@@ -65,9 +65,9 @@
</span><span class="cx"> return attributeWithoutSynchronization(SVGNames::glyphRefAttr);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void SVGAltGlyphElement::setFormat(const AtomicString&, ExceptionCode& ec)
</del><ins>+ExceptionOr<void> SVGAltGlyphElement::setFormat(const AtomicString&)
</ins><span class="cx"> {
</span><del>- ec = NO_MODIFICATION_ALLOWED_ERR;
</del><ins>+ return Exception { NO_MODIFICATION_ALLOWED_ERR };
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> const AtomicString& SVGAltGlyphElement::format() const
</span><span class="lines">@@ -77,9 +77,7 @@
</span><span class="cx">
</span><span class="cx"> bool SVGAltGlyphElement::childShouldCreateRenderer(const Node& child) const
</span><span class="cx"> {
</span><del>- if (child.isTextNode())
- return true;
- return false;
</del><ins>+ return child.isTextNode();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> RenderPtr<RenderElement> SVGAltGlyphElement::createElementRenderer(RenderStyle&& style, const RenderTreePosition&)
</span><span class="lines">@@ -90,17 +88,14 @@
</span><span class="cx"> bool SVGAltGlyphElement::hasValidGlyphElements(Vector<String>& glyphNames) const
</span><span class="cx"> {
</span><span class="cx"> String target;
</span><del>- Element* element = targetElementFromIRIString(getAttribute(XLinkNames::hrefAttr), document(), &target);
- if (!element)
- return false;
</del><ins>+ auto* element = targetElementFromIRIString(getAttribute(XLinkNames::hrefAttr), document(), &target);
</ins><span class="cx">
</span><del>- if (is<SVGGlyphElement>(*element)) {
</del><ins>+ if (is<SVGGlyphElement>(element)) {
</ins><span class="cx"> glyphNames.append(target);
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- if (is<SVGAltGlyphDefElement>(*element)
- && downcast<SVGAltGlyphDefElement>(*element).hasValidGlyphElements(glyphNames))
</del><ins>+ if (is<SVGAltGlyphDefElement>(element) && downcast<SVGAltGlyphDefElement>(*element).hasValidGlyphElements(glyphNames))
</ins><span class="cx"> return true;
</span><span class="cx">
</span><span class="cx"> return false;
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGAltGlyphElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGAltGlyphElement.h (207715 => 207716)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGAltGlyphElement.h        2016-10-22 20:46:34 UTC (rev 207715)
+++ trunk/Source/WebCore/svg/SVGAltGlyphElement.h        2016-10-22 20:56:47 UTC (rev 207716)
</span><span class="lines">@@ -19,28 +19,25 @@
</span><span class="cx"> * Boston, MA 02110-1301, USA.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-#ifndef SVGAltGlyphElement_h
-#define SVGAltGlyphElement_h
</del><ins>+#pragma once
</ins><span class="cx">
</span><span class="cx"> #if ENABLE(SVG_FONTS)
</span><span class="cx">
</span><span class="cx"> #include "SVGTextPositioningElement.h"
</span><span class="cx"> #include "SVGURIReference.h"
</span><del>-#include <wtf/Vector.h>
</del><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="cx"> class SVGGlyphElement;
</span><span class="cx">
</span><del>-class SVGAltGlyphElement final : public SVGTextPositioningElement,
- public SVGURIReference {
</del><ins>+class SVGAltGlyphElement final : public SVGTextPositioningElement, public SVGURIReference {
</ins><span class="cx"> public:
</span><span class="cx"> static Ref<SVGAltGlyphElement> create(const QualifiedName&, Document&);
</span><span class="cx">
</span><span class="cx"> const AtomicString& glyphRef() const;
</span><del>- void setGlyphRef(const AtomicString&, ExceptionCode&);
</del><ins>+ ExceptionOr<void> setGlyphRef(const AtomicString&);
</ins><span class="cx"> const AtomicString& format() const;
</span><del>- void setFormat(const AtomicString&, ExceptionCode&);
</del><ins>+ ExceptionOr<void> setFormat(const AtomicString&);
</ins><span class="cx">
</span><span class="cx"> bool hasValidGlyphElements(Vector<String>& glyphNames) const;
</span><span class="cx">
</span><span class="lines">@@ -58,4 +55,3 @@
</span><span class="cx"> } // namespace WebCore
</span><span class="cx">
</span><span class="cx"> #endif
</span><del>-#endif
</del></span></pre></div>
<a id="trunkSourceWebCoresvgSVGAltGlyphElementidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGAltGlyphElement.idl (207715 => 207716)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGAltGlyphElement.idl        2016-10-22 20:46:34 UTC (rev 207715)
+++ trunk/Source/WebCore/svg/SVGAltGlyphElement.idl        2016-10-22 20:56:47 UTC (rev 207716)
</span><span class="lines">@@ -26,8 +26,8 @@
</span><span class="cx"> [
</span><span class="cx"> Conditional=SVG_FONTS,
</span><span class="cx"> ] interface SVGAltGlyphElement : SVGTextPositioningElement {
</span><del>- [SetterMayThrowLegacyException] attribute DOMString glyphRef;
- [SetterMayThrowLegacyException] attribute DOMString format;
</del><ins>+ [SetterMayThrowException] attribute DOMString glyphRef;
+ [SetterMayThrowException] attribute DOMString format;
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> SVGAltGlyphElement implements SVGURIReference;
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGAnglecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGAngle.cpp (207715 => 207716)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGAngle.cpp        2016-10-22 20:46:34 UTC (rev 207715)
+++ trunk/Source/WebCore/svg/SVGAngle.cpp        2016-10-22 20:56:47 UTC (rev 207716)
</span><span class="lines">@@ -25,17 +25,10 @@
</span><span class="cx"> #include "ExceptionCode.h"
</span><span class="cx"> #include "SVGParserUtilities.h"
</span><span class="cx"> #include <wtf/MathExtras.h>
</span><del>-#include <wtf/NeverDestroyed.h>
</del><span class="cx"> #include <wtf/text/StringView.h>
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>-SVGAngle::SVGAngle()
- : m_unitType(SVG_ANGLETYPE_UNSPECIFIED)
- , m_valueInSpecifiedUnits(0)
-{
-}
-
</del><span class="cx"> float SVGAngle::value() const
</span><span class="cx"> {
</span><span class="cx"> switch (m_unitType) {
</span><span class="lines">@@ -48,7 +41,6 @@
</span><span class="cx"> case SVG_ANGLETYPE_DEG:
</span><span class="cx"> return m_valueInSpecifiedUnits;
</span><span class="cx"> }
</span><del>-
</del><span class="cx"> ASSERT_NOT_REACHED();
</span><span class="cx"> return 0;
</span><span class="cx"> }
</span><span class="lines">@@ -58,72 +50,28 @@
</span><span class="cx"> switch (m_unitType) {
</span><span class="cx"> case SVG_ANGLETYPE_GRAD:
</span><span class="cx"> m_valueInSpecifiedUnits = deg2grad(value);
</span><del>- break;
</del><ins>+ return;
</ins><span class="cx"> case SVG_ANGLETYPE_RAD:
</span><span class="cx"> m_valueInSpecifiedUnits = deg2rad(value);
</span><del>- break;
</del><ins>+ return;
</ins><span class="cx"> case SVG_ANGLETYPE_UNSPECIFIED:
</span><span class="cx"> case SVG_ANGLETYPE_UNKNOWN:
</span><span class="cx"> case SVG_ANGLETYPE_DEG:
</span><span class="cx"> m_valueInSpecifiedUnits = value;
</span><del>- break;
</del><ins>+ return;
</ins><span class="cx"> }
</span><ins>+ ASSERT_NOT_REACHED();
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-inline SVGAngle::SVGAngleType stringToAngleType(const UChar*& ptr, const UChar* end)
-{
- // If there's no unit given, the angle type is unspecified.
- if (ptr == end)
- return SVGAngle::SVG_ANGLETYPE_UNSPECIFIED;
-
- const UChar firstChar = *ptr;
-
- // If the unit contains only one character, the angle type is unknown.
- ++ptr;
- if (ptr == end)
- return SVGAngle::SVG_ANGLETYPE_UNKNOWN;
-
- const UChar secondChar = *ptr;
-
- // If the unit contains only two characters, the angle type is unknown.
- ++ptr;
- if (ptr == end)
- return SVGAngle::SVG_ANGLETYPE_UNKNOWN;
-
- const UChar thirdChar = *ptr;
- if (firstChar == 'd' && secondChar == 'e' && thirdChar == 'g')
- return SVGAngle::SVG_ANGLETYPE_DEG;
- if (firstChar == 'r' && secondChar == 'a' && thirdChar == 'd')
- return SVGAngle::SVG_ANGLETYPE_RAD;
-
- // If the unit contains three characters, but is not deg or rad, then it's unknown.
- ++ptr;
- if (ptr == end)
- return SVGAngle::SVG_ANGLETYPE_UNKNOWN;
-
- const UChar fourthChar = *ptr;
-
- if (firstChar == 'g' && secondChar == 'r' && thirdChar == 'a' && fourthChar == 'd')
- return SVGAngle::SVG_ANGLETYPE_GRAD;
-
- return SVGAngle::SVG_ANGLETYPE_UNKNOWN;
-}
-
</del><span class="cx"> String SVGAngle::valueAsString() const
</span><span class="cx"> {
</span><span class="cx"> switch (m_unitType) {
</span><del>- case SVG_ANGLETYPE_DEG: {
- static NeverDestroyed<String> degString(ASCIILiteral("deg"));
- return String::number(m_valueInSpecifiedUnits) + degString.get();
- }
- case SVG_ANGLETYPE_RAD: {
- static NeverDestroyed<String> radString(ASCIILiteral("rad"));
- return String::number(m_valueInSpecifiedUnits) + radString.get();
- }
- case SVG_ANGLETYPE_GRAD: {
- static NeverDestroyed<String> gradString(ASCIILiteral("grad"));
- return String::number(m_valueInSpecifiedUnits) + gradString.get();
- }
</del><ins>+ case SVG_ANGLETYPE_DEG:
+ return String::number(m_valueInSpecifiedUnits) + "deg";
+ case SVG_ANGLETYPE_RAD:
+ return String::number(m_valueInSpecifiedUnits) + "rad";
+ case SVG_ANGLETYPE_GRAD:
+ return String::number(m_valueInSpecifiedUnits) + "grad";
</ins><span class="cx"> case SVG_ANGLETYPE_UNSPECIFIED:
</span><span class="cx"> case SVG_ANGLETYPE_UNKNOWN:
</span><span class="cx"> return String::number(m_valueInSpecifiedUnits);
</span><span class="lines">@@ -133,55 +81,66 @@
</span><span class="cx"> return String();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void SVGAngle::setValueAsString(const String& value, ExceptionCode& ec)
</del><ins>+static inline SVGAngle::SVGAngleType parseAngleType(const UChar* ptr, const UChar* end)
</ins><span class="cx"> {
</span><ins>+ switch (end - ptr) {
+ case 0:
+ return SVGAngle::SVG_ANGLETYPE_UNSPECIFIED;
+ case 3:
+ if (ptr[0] == 'd' && ptr[1] == 'e' && ptr[2] == 'g')
+ return SVGAngle::SVG_ANGLETYPE_DEG;
+ if (ptr[0] == 'r' && ptr[1] == 'a' && ptr[2] == 'd')
+ return SVGAngle::SVG_ANGLETYPE_RAD;
+ break;
+ case 4:
+ if (ptr[0] == 'g' && ptr[1] == 'r' && ptr[2] == 'a' && ptr[3] == 'd')
+ return SVGAngle::SVG_ANGLETYPE_GRAD;
+ break;
+ }
+ return SVGAngle::SVG_ANGLETYPE_UNKNOWN;
+}
+
+ExceptionOr<void> SVGAngle::setValueAsString(const String& value)
+{
</ins><span class="cx"> if (value.isEmpty()) {
</span><span class="cx"> m_unitType = SVG_ANGLETYPE_UNSPECIFIED;
</span><del>- return;
</del><ins>+ return { };
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- float valueInSpecifiedUnits = 0;
</del><span class="cx"> auto upconvertedCharacters = StringView(value).upconvertedCharacters();
</span><span class="cx"> const UChar* ptr = upconvertedCharacters;
</span><span class="cx"> const UChar* end = ptr + value.length();
</span><span class="cx">
</span><del>- if (!parseNumber(ptr, end, valueInSpecifiedUnits, false)) {
- ec = SYNTAX_ERR;
- return;
- }
</del><ins>+ float valueInSpecifiedUnits = 0;
+ if (!parseNumber(ptr, end, valueInSpecifiedUnits, false))
+ return Exception { SYNTAX_ERR };
</ins><span class="cx">
</span><del>- SVGAngleType unitType = stringToAngleType(ptr, end);
- if (unitType == SVG_ANGLETYPE_UNKNOWN) {
- ec = SYNTAX_ERR;
- return;
- }
</del><ins>+ auto unitType = parseAngleType(ptr, end);
+ if (unitType == SVG_ANGLETYPE_UNKNOWN)
+ return Exception { SYNTAX_ERR };
</ins><span class="cx">
</span><span class="cx"> m_unitType = unitType;
</span><span class="cx"> m_valueInSpecifiedUnits = valueInSpecifiedUnits;
</span><ins>+ return { };
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void SVGAngle::newValueSpecifiedUnits(unsigned short unitType, float valueInSpecifiedUnits, ExceptionCode& ec)
</del><ins>+ExceptionOr<void> SVGAngle::newValueSpecifiedUnits(unsigned short unitType, float valueInSpecifiedUnits)
</ins><span class="cx"> {
</span><del>- if (unitType == SVG_ANGLETYPE_UNKNOWN || unitType > SVG_ANGLETYPE_GRAD) {
- ec = NOT_SUPPORTED_ERR;
- return;
- }
</del><ins>+ if (unitType == SVG_ANGLETYPE_UNKNOWN || unitType > SVG_ANGLETYPE_GRAD)
+ return Exception { NOT_SUPPORTED_ERR };
</ins><span class="cx">
</span><del>- if (unitType != m_unitType)
- m_unitType = static_cast<SVGAngleType>(unitType);
-
</del><ins>+ m_unitType = static_cast<SVGAngleType>(unitType);
</ins><span class="cx"> m_valueInSpecifiedUnits = valueInSpecifiedUnits;
</span><ins>+ return { };
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void SVGAngle::convertToSpecifiedUnits(unsigned short unitType, ExceptionCode& ec)
</del><ins>+ExceptionOr<void> SVGAngle::convertToSpecifiedUnits(unsigned short unitType)
</ins><span class="cx"> {
</span><del>- if (unitType == SVG_ANGLETYPE_UNKNOWN || m_unitType == SVG_ANGLETYPE_UNKNOWN || unitType > SVG_ANGLETYPE_GRAD) {
- ec = NOT_SUPPORTED_ERR;
- return;
- }
</del><ins>+ if (unitType == SVG_ANGLETYPE_UNKNOWN || m_unitType == SVG_ANGLETYPE_UNKNOWN || unitType > SVG_ANGLETYPE_GRAD)
+ return Exception { NOT_SUPPORTED_ERR };
</ins><span class="cx">
</span><span class="cx"> if (unitType == m_unitType)
</span><del>- return;
</del><ins>+ return { };
</ins><span class="cx">
</span><span class="cx"> switch (m_unitType) {
</span><span class="cx"> case SVG_ANGLETYPE_RAD:
</span><span class="lines">@@ -225,8 +184,8 @@
</span><span class="cx"> m_valueInSpecifiedUnits = deg2grad(m_valueInSpecifiedUnits);
</span><span class="cx"> break;
</span><span class="cx"> case SVG_ANGLETYPE_UNSPECIFIED:
</span><ins>+ case SVG_ANGLETYPE_DEG:
</ins><span class="cx"> break;
</span><del>- case SVG_ANGLETYPE_DEG:
</del><span class="cx"> case SVG_ANGLETYPE_UNKNOWN:
</span><span class="cx"> ASSERT_NOT_REACHED();
</span><span class="cx"> break;
</span><span class="lines">@@ -238,6 +197,8 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> m_unitType = static_cast<SVGAngleType>(unitType);
</span><ins>+
+ return { };
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGAngleh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGAngle.h (207715 => 207716)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGAngle.h        2016-10-22 20:46:34 UTC (rev 207715)
+++ trunk/Source/WebCore/svg/SVGAngle.h        2016-10-22 20:56:47 UTC (rev 207716)
</span><span class="lines">@@ -19,20 +19,16 @@
</span><span class="cx"> * Boston, MA 02110-1301, USA.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-#ifndef SVGAngle_h
-#define SVGAngle_h
</del><ins>+#pragma once
</ins><span class="cx">
</span><ins>+#include "ExceptionOr.h"
</ins><span class="cx"> #include "SVGPropertyTraits.h"
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>-typedef int ExceptionCode;
-
</del><span class="cx"> class SVGAngle {
</span><span class="cx"> WTF_MAKE_FAST_ALLOCATED;
</span><span class="cx"> public:
</span><del>- SVGAngle();
-
</del><span class="cx"> enum SVGAngleType {
</span><span class="cx"> SVG_ANGLETYPE_UNKNOWN = 0,
</span><span class="cx"> SVG_ANGLETYPE_UNSPECIFIED = 1,
</span><span class="lines">@@ -49,23 +45,20 @@
</span><span class="cx"> void setValueInSpecifiedUnits(float valueInSpecifiedUnits) { m_valueInSpecifiedUnits = valueInSpecifiedUnits; }
</span><span class="cx"> float valueInSpecifiedUnits() const { return m_valueInSpecifiedUnits; }
</span><span class="cx">
</span><del>- void setValueAsString(const String&, ExceptionCode&);
</del><ins>+ ExceptionOr<void> setValueAsString(const String&);
</ins><span class="cx"> String valueAsString() const;
</span><span class="cx">
</span><del>- void newValueSpecifiedUnits(unsigned short unitType, float valueInSpecifiedUnits, ExceptionCode&);
- void convertToSpecifiedUnits(unsigned short unitType, ExceptionCode&);
</del><ins>+ ExceptionOr<void> newValueSpecifiedUnits(unsigned short unitType, float valueInSpecifiedUnits);
+ ExceptionOr<void> convertToSpecifiedUnits(unsigned short unitType);
</ins><span class="cx">
</span><span class="cx"> private:
</span><del>- SVGAngleType m_unitType;
- float m_valueInSpecifiedUnits;
</del><ins>+ SVGAngleType m_unitType { SVG_ANGLETYPE_UNSPECIFIED };
+ float m_valueInSpecifiedUnits { 0 };
</ins><span class="cx"> };
</span><span class="cx">
</span><del>-template<>
-struct SVGPropertyTraits<SVGAngle> {
</del><ins>+template<> struct SVGPropertyTraits<SVGAngle> {
</ins><span class="cx"> static SVGAngle initialValue() { return SVGAngle(); }
</span><span class="cx"> static String toString(const SVGAngle& type) { return type.valueAsString(); }
</span><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span><del>-
-#endif // SVGAngle_h
</del></span></pre></div>
<a id="trunkSourceWebCoresvgSVGAngleidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGAngle.idl (207715 => 207716)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGAngle.idl        2016-10-22 20:46:34 UTC (rev 207715)
+++ trunk/Source/WebCore/svg/SVGAngle.idl        2016-10-22 20:56:47 UTC (rev 207716)
</span><span class="lines">@@ -32,10 +32,8 @@
</span><span class="cx"> attribute unrestricted float value;
</span><span class="cx"> attribute unrestricted float valueInSpecifiedUnits;
</span><span class="cx">
</span><del>- [SetterMayThrowLegacyException] attribute DOMString valueAsString;
</del><ins>+ [SetterMayThrowException] attribute DOMString valueAsString;
</ins><span class="cx">
</span><del>- [MayThrowLegacyException] void newValueSpecifiedUnits(unsigned short unitType, unrestricted float valueInSpecifiedUnits);
-
- [MayThrowLegacyException] void convertToSpecifiedUnits(unsigned short unitType);
</del><ins>+ [MayThrowException] void newValueSpecifiedUnits(unsigned short unitType, unrestricted float valueInSpecifiedUnits);
+ [MayThrowException] void convertToSpecifiedUnits(unsigned short unitType);
</ins><span class="cx"> };
</span><del>-
</del></span></pre></div>
<a id="trunkSourceWebCoresvgSVGAnimateElementBasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGAnimateElementBase.cpp (207715 => 207716)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGAnimateElementBase.cpp        2016-10-22 20:46:34 UTC (rev 207715)
+++ trunk/Source/WebCore/svg/SVGAnimateElementBase.cpp        2016-10-22 20:56:47 UTC (rev 207716)
</span><span class="lines">@@ -109,7 +109,7 @@
</span><span class="cx"> if (hasTagName(SVGNames::setTag))
</span><span class="cx"> percentage = 1;
</span><span class="cx">
</span><del>- if (calcMode() == CalcModeDiscrete)
</del><ins>+ if (calcMode() == CalcMode::Discrete)
</ins><span class="cx"> percentage = percentage < 0.5 ? 0 : 1;
</span><span class="cx">
</span><span class="cx"> // Target element might have changed.
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGAnimateMotionElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGAnimateMotionElement.cpp (207715 => 207716)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGAnimateMotionElement.cpp        2016-10-22 20:46:34 UTC (rev 207715)
+++ trunk/Source/WebCore/svg/SVGAnimateMotionElement.cpp        2016-10-22 20:56:47 UTC (rev 207716)
</span><span class="lines">@@ -46,7 +46,7 @@
</span><span class="cx"> : SVGAnimationElement(tagName, document)
</span><span class="cx"> , m_hasToPointAtEndOfDuration(false)
</span><span class="cx"> {
</span><del>- setCalcMode(CalcModePaced);
</del><ins>+ setCalcMode(CalcMode::Paced);
</ins><span class="cx"> ASSERT(hasTagName(animateMotionTag));
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGAnimateTransformElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGAnimateTransformElement.cpp (207715 => 207716)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGAnimateTransformElement.cpp        2016-10-22 20:46:34 UTC (rev 207715)
+++ trunk/Source/WebCore/svg/SVGAnimateTransformElement.cpp        2016-10-22 20:56:47 UTC (rev 207716)
</span><span class="lines">@@ -46,7 +46,7 @@
</span><span class="cx"> if (!targetElement)
</span><span class="cx"> return false;
</span><span class="cx">
</span><del>- if (attributeType() == AttributeTypeCSS)
</del><ins>+ if (attributeType() == AttributeType::CSS)
</ins><span class="cx"> return false;
</span><span class="cx">
</span><span class="cx"> return m_animatedPropertyType == AnimatedTransformList;
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGAnimatedAnglecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGAnimatedAngle.cpp (207715 => 207716)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGAnimatedAngle.cpp        2016-10-22 20:46:34 UTC (rev 207715)
+++ trunk/Source/WebCore/svg/SVGAnimatedAngle.cpp        2016-10-22 20:56:47 UTC (rev 207716)
</span><span class="lines">@@ -137,9 +137,9 @@
</span><span class="cx"> float SVGAnimatedAngleAnimator::calculateDistance(const String& fromString, const String& toString)
</span><span class="cx"> {
</span><span class="cx"> SVGAngle from = SVGAngle();
</span><del>- from.setValueAsString(fromString, ASSERT_NO_EXCEPTION);
</del><ins>+ from.setValueAsString(fromString);
</ins><span class="cx"> SVGAngle to = SVGAngle();
</span><del>- to.setValueAsString(toString, ASSERT_NO_EXCEPTION);
</del><ins>+ to.setValueAsString(toString);
</ins><span class="cx"> return fabsf(to.value() - from.value());
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGAnimatedBooleanidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGAnimatedBoolean.idl (207715 => 207716)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGAnimatedBoolean.idl        2016-10-22 20:46:34 UTC (rev 207715)
+++ trunk/Source/WebCore/svg/SVGAnimatedBoolean.idl        2016-10-22 20:56:47 UTC (rev 207716)
</span><span class="lines">@@ -26,7 +26,7 @@
</span><span class="cx"> [
</span><span class="cx"> SkipVTableValidation
</span><span class="cx"> ] interface SVGAnimatedBoolean {
</span><del>- [SetterMayThrowLegacyException] attribute boolean baseVal;
</del><ins>+ [SetterMayThrowException] attribute boolean baseVal;
</ins><span class="cx"> readonly attribute boolean animVal;
</span><span class="cx"> };
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGAnimatedEnumerationidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGAnimatedEnumeration.idl (207715 => 207716)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGAnimatedEnumeration.idl        2016-10-22 20:46:34 UTC (rev 207715)
+++ trunk/Source/WebCore/svg/SVGAnimatedEnumeration.idl        2016-10-22 20:56:47 UTC (rev 207716)
</span><span class="lines">@@ -26,7 +26,7 @@
</span><span class="cx"> [
</span><span class="cx"> SkipVTableValidation
</span><span class="cx"> ] interface SVGAnimatedEnumeration {
</span><del>- [SetterMayThrowLegacyException] attribute unsigned short baseVal;
</del><ins>+ [SetterMayThrowException] attribute unsigned short baseVal;
</ins><span class="cx"> readonly attribute unsigned short animVal;
</span><span class="cx"> };
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGAnimatedIntegeridl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGAnimatedInteger.idl (207715 => 207716)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGAnimatedInteger.idl        2016-10-22 20:46:34 UTC (rev 207715)
+++ trunk/Source/WebCore/svg/SVGAnimatedInteger.idl        2016-10-22 20:56:47 UTC (rev 207716)
</span><span class="lines">@@ -26,7 +26,7 @@
</span><span class="cx"> [
</span><span class="cx"> SkipVTableValidation
</span><span class="cx"> ] interface SVGAnimatedInteger {
</span><del>- [SetterMayThrowLegacyException] attribute long baseVal;
</del><ins>+ [SetterMayThrowException] attribute long baseVal;
</ins><span class="cx"> readonly attribute long animVal;
</span><span class="cx"> };
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGAnimatedLengthcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGAnimatedLength.cpp (207715 => 207716)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGAnimatedLength.cpp        2016-10-22 20:46:34 UTC (rev 207715)
+++ trunk/Source/WebCore/svg/SVGAnimatedLength.cpp        2016-10-22 20:56:47 UTC (rev 207716)
</span><span class="lines">@@ -32,13 +32,6 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static inline SVGLength& sharedSVGLength(SVGLengthMode mode, const String& valueAsString)
-{
- static NeverDestroyed<SVGLength> sharedLength;
- sharedLength.get().setValueAsString(valueAsString, mode, ASSERT_NO_EXCEPTION);
- return sharedLength;
-}
-
</del><span class="cx"> std::unique_ptr<SVGAnimatedType> SVGAnimatedLengthAnimator::constructFromString(const String& string)
</span><span class="cx"> {
</span><span class="cx"> return SVGAnimatedType::createLength(std::make_unique<SVGLength>(m_lengthMode, string));
</span><span class="lines">@@ -78,12 +71,14 @@
</span><span class="cx"> const SVGLength& fromLength = from->length();
</span><span class="cx"> SVGLength& toLength = to->length();
</span><span class="cx">
</span><del>- toLength.setValue(toLength.value(lengthContext) + fromLength.value(lengthContext), lengthContext, ASSERT_NO_EXCEPTION);
</del><ins>+ toLength.setValue(toLength.value(lengthContext) + fromLength.value(lengthContext), lengthContext);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> static SVGLength parseLengthFromString(SVGAnimationElement* animationElement, const String& string)
</span><span class="cx"> {
</span><del>- return sharedSVGLength(SVGLength::lengthModeForAnimatedLengthAttribute(animationElement->attributeName()), string);
</del><ins>+ SVGLength length;
+ length.setValueAsString(string, SVGLength::lengthModeForAnimatedLengthAttribute(animationElement->attributeName()));
+ return length;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void SVGAnimatedLengthAnimator::calculateAnimatedValue(float percentage, unsigned repeatCount, SVGAnimatedType* from, SVGAnimatedType* to, SVGAnimatedType* toAtEndOfDuration, SVGAnimatedType* animated)
</span><span class="lines">@@ -105,7 +100,7 @@
</span><span class="cx"> SVGLengthType unitType = percentage < 0.5 ? fromSVGLength.unitType() : toSVGLength.unitType();
</span><span class="cx"> m_animationElement->animateAdditiveNumber(percentage, repeatCount, fromSVGLength.value(lengthContext), toSVGLength.value(lengthContext), toAtEndOfDurationSVGLength.value(lengthContext), animatedNumber);
</span><span class="cx">
</span><del>- animatedSVGLength.setValue(lengthContext, animatedNumber, m_lengthMode, unitType, ASSERT_NO_EXCEPTION);
</del><ins>+ animatedSVGLength.setValue(lengthContext, animatedNumber, m_lengthMode, unitType);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> float SVGAnimatedLengthAnimator::calculateDistance(const String& fromString, const String& toString)
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGAnimatedLengthListcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGAnimatedLengthList.cpp (207715 => 207716)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGAnimatedLengthList.cpp        2016-10-22 20:46:34 UTC (rev 207715)
+++ trunk/Source/WebCore/svg/SVGAnimatedLengthList.cpp        2016-10-22 20:56:47 UTC (rev 207716)
</span><span class="lines">@@ -77,7 +77,7 @@
</span><span class="cx">
</span><span class="cx"> SVGLengthContext lengthContext(m_contextElement);
</span><span class="cx"> for (unsigned i = 0; i < fromLengthListSize; ++i)
</span><del>- toLengthList[i].setValue(toLengthList[i].value(lengthContext) + fromLengthList[i].value(lengthContext), lengthContext, ASSERT_NO_EXCEPTION);
</del><ins>+ toLengthList[i].setValue(toLengthList[i].value(lengthContext) + fromLengthList[i].value(lengthContext), lengthContext);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> static SVGLengthList parseLengthListFromString(SVGAnimationElement* animationElement, const String& string)
</span><span class="lines">@@ -121,7 +121,7 @@
</span><span class="cx"> float effectiveToAtEnd = i < toAtEndOfDurationListSize ? toAtEndOfDurationLengthList[i].value(lengthContext) : 0;
</span><span class="cx">
</span><span class="cx"> m_animationElement->animateAdditiveNumber(percentage, repeatCount, effectiveFrom, toLengthList[i].value(lengthContext), effectiveToAtEnd, animatedNumber);
</span><del>- animatedLengthList[i].setValue(lengthContext, animatedNumber, m_lengthMode, unitType, ASSERT_NO_EXCEPTION);
</del><ins>+ animatedLengthList[i].setValue(lengthContext, animatedNumber, m_lengthMode, unitType);
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGAnimatedNumberidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGAnimatedNumber.idl (207715 => 207716)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGAnimatedNumber.idl        2016-10-22 20:46:34 UTC (rev 207715)
+++ trunk/Source/WebCore/svg/SVGAnimatedNumber.idl        2016-10-22 20:56:47 UTC (rev 207716)
</span><span class="lines">@@ -27,7 +27,7 @@
</span><span class="cx"> [
</span><span class="cx"> SkipVTableValidation
</span><span class="cx"> ] interface SVGAnimatedNumber {
</span><del>- [SetterMayThrowLegacyException] attribute unrestricted float baseVal;
</del><ins>+ [SetterMayThrowException] attribute unrestricted float baseVal;
</ins><span class="cx"> readonly attribute unrestricted float animVal;
</span><span class="cx"> };
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGAnimatedStringidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGAnimatedString.idl (207715 => 207716)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGAnimatedString.idl        2016-10-22 20:46:34 UTC (rev 207715)
+++ trunk/Source/WebCore/svg/SVGAnimatedString.idl        2016-10-22 20:56:47 UTC (rev 207716)
</span><span class="lines">@@ -26,7 +26,7 @@
</span><span class="cx"> [
</span><span class="cx"> SkipVTableValidation
</span><span class="cx"> ] interface SVGAnimatedString {
</span><del>- [SetterMayThrowLegacyException] attribute DOMString baseVal;
</del><ins>+ [SetterMayThrowException] attribute DOMString baseVal;
</ins><span class="cx"> readonly attribute DOMString animVal;
</span><span class="cx"> };
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGAnimatedTypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGAnimatedType.cpp (207715 => 207716)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGAnimatedType.cpp        2016-10-22 20:46:34 UTC (rev 207715)
+++ trunk/Source/WebCore/svg/SVGAnimatedType.cpp        2016-10-22 20:56:47 UTC (rev 207716)
</span><span class="lines">@@ -276,29 +276,26 @@
</span><span class="cx"> case AnimatedColor:
</span><span class="cx"> ASSERT(m_data.color);
</span><span class="cx"> *m_data.color = SVGColor::colorFromRGBColorString(value);
</span><del>- break;
- case AnimatedLength: {
</del><ins>+ return true;
+ case AnimatedLength:
</ins><span class="cx"> ASSERT(m_data.length);
</span><del>- ExceptionCode ec = 0;
- m_data.length->setValueAsString(value, SVGLength::lengthModeForAnimatedLengthAttribute(attrName), ec);
- return !ec;
- }
</del><ins>+ return !m_data.length->setValueAsString(value, SVGLength::lengthModeForAnimatedLengthAttribute(attrName)).hasException();
</ins><span class="cx"> case AnimatedLengthList:
</span><span class="cx"> ASSERT(m_data.lengthList);
</span><span class="cx"> m_data.lengthList->parse(value, SVGLength::lengthModeForAnimatedLengthAttribute(attrName));
</span><del>- break;
</del><ins>+ return true;
</ins><span class="cx"> case AnimatedNumber:
</span><span class="cx"> ASSERT(m_data.number);
</span><span class="cx"> parseNumberFromString(value, *m_data.number);
</span><del>- break;
</del><ins>+ return true;
</ins><span class="cx"> case AnimatedRect:
</span><span class="cx"> ASSERT(m_data.rect);
</span><span class="cx"> parseRect(value, *m_data.rect);
</span><del>- break;
</del><ins>+ return true;
</ins><span class="cx"> case AnimatedString:
</span><span class="cx"> ASSERT(m_data.string);
</span><span class="cx"> *m_data.string = value;
</span><del>- break;
</del><ins>+ return true;
</ins><span class="cx">
</span><span class="cx"> // These types don't appear in the table in SVGElement::cssPropertyToTypeMap() and thus don't need setValueAsString() support.
</span><span class="cx"> case AnimatedAngle:
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGAnimationElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGAnimationElement.cpp (207715 => 207716)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGAnimationElement.cpp        2016-10-22 20:46:34 UTC (rev 207715)
+++ trunk/Source/WebCore/svg/SVGAnimationElement.cpp        2016-10-22 20:56:47 UTC (rev 207716)
</span><span class="lines">@@ -53,13 +53,6 @@
</span><span class="cx">
</span><span class="cx"> SVGAnimationElement::SVGAnimationElement(const QualifiedName& tagName, Document& document)
</span><span class="cx"> : SVGSMILElement(tagName, document)
</span><del>- , m_fromPropertyValueType(RegularPropertyValue)
- , m_toPropertyValueType(RegularPropertyValue)
- , m_animationValid(false)
- , m_attributeType(AttributeTypeAuto)
- , m_hasInvalidCSSAttributeType(false)
- , m_calcMode(CalcModeLinear)
- , m_animationMode(NoAnimation)
</del><span class="cx"> {
</span><span class="cx"> registerAnimatedPropertiesForSVGAnimationElement();
</span><span class="cx"> }
</span><span class="lines">@@ -241,7 +234,7 @@
</span><span class="cx"> return narrowPrecisionToFloat(elapsed().value());
</span><span class="cx"> }
</span><span class="cx">
</span><del>-float SVGAnimationElement::getSimpleDuration(ExceptionCode&) const
</del><ins>+float SVGAnimationElement::getSimpleDuration() const
</ins><span class="cx"> {
</span><span class="cx"> return narrowPrecisionToFloat(simpleDuration().value());
</span><span class="cx"> }
</span><span class="lines">@@ -292,15 +285,15 @@
</span><span class="cx"> static NeverDestroyed<const AtomicString> paced("paced", AtomicString::ConstructFromLiteral);
</span><span class="cx"> static NeverDestroyed<const AtomicString> spline("spline", AtomicString::ConstructFromLiteral);
</span><span class="cx"> if (calcMode == discrete)
</span><del>- setCalcMode(CalcModeDiscrete);
</del><ins>+ setCalcMode(CalcMode::Discrete);
</ins><span class="cx"> else if (calcMode == linear)
</span><del>- setCalcMode(CalcModeLinear);
</del><ins>+ setCalcMode(CalcMode::Linear);
</ins><span class="cx"> else if (calcMode == paced)
</span><del>- setCalcMode(CalcModePaced);
</del><ins>+ setCalcMode(CalcMode::Paced);
</ins><span class="cx"> else if (calcMode == spline)
</span><del>- setCalcMode(CalcModeSpline);
</del><ins>+ setCalcMode(CalcMode::Spline);
</ins><span class="cx"> else
</span><del>- setCalcMode(hasTagName(SVGNames::animateMotionTag) ? CalcModePaced : CalcModeLinear);
</del><ins>+ setCalcMode(hasTagName(SVGNames::animateMotionTag) ? CalcMode::Paced : CalcMode::Linear);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void SVGAnimationElement::setAttributeType(const AtomicString& attributeType)
</span><span class="lines">@@ -308,11 +301,11 @@
</span><span class="cx"> static NeverDestroyed<const AtomicString> css("CSS", AtomicString::ConstructFromLiteral);
</span><span class="cx"> static NeverDestroyed<const AtomicString> xml("XML", AtomicString::ConstructFromLiteral);
</span><span class="cx"> if (attributeType == css)
</span><del>- m_attributeType = AttributeTypeCSS;
</del><ins>+ m_attributeType = AttributeType::CSS;
</ins><span class="cx"> else if (attributeType == xml)
</span><del>- m_attributeType = AttributeTypeXML;
</del><ins>+ m_attributeType = AttributeType::XML;
</ins><span class="cx"> else
</span><del>- m_attributeType = AttributeTypeAuto;
</del><ins>+ m_attributeType = AttributeType::Auto;
</ins><span class="cx"> checkInvalidCSSAttributeType(targetElement());
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -368,7 +361,7 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx"> // If attributeType="CSS" and attributeName doesn't point to a CSS property, ignore the animation.
</span><del>- if (attributeType() == AttributeTypeCSS)
</del><ins>+ if (attributeType() == AttributeType::CSS)
</ins><span class="cx"> return DontApplyAnimation;
</span><span class="cx">
</span><span class="cx"> return ApplyXMLAnimation;
</span><span class="lines">@@ -376,7 +369,7 @@
</span><span class="cx">
</span><span class="cx"> void SVGAnimationElement::calculateKeyTimesForCalcModePaced()
</span><span class="cx"> {
</span><del>- ASSERT(calcMode() == CalcModePaced);
</del><ins>+ ASSERT(calcMode() == CalcMode::Paced);
</ins><span class="cx"> ASSERT(animationMode() == ValuesAnimation);
</span><span class="cx">
</span><span class="cx"> unsigned valuesCount = m_values.size();
</span><span class="lines">@@ -428,7 +421,7 @@
</span><span class="cx">
</span><span class="cx"> float SVGAnimationElement::calculatePercentForSpline(float percent, unsigned splineIndex) const
</span><span class="cx"> {
</span><del>- ASSERT(calcMode() == CalcModeSpline);
</del><ins>+ ASSERT(calcMode() == CalcMode::Spline);
</ins><span class="cx"> ASSERT_WITH_SECURITY_IMPLICATION(splineIndex < m_keySplines.size());
</span><span class="cx"> UnitBezier bezier = m_keySplines[splineIndex];
</span><span class="cx"> SMILTime duration = simpleDuration();
</span><span class="lines">@@ -440,7 +433,7 @@
</span><span class="cx"> float SVGAnimationElement::calculatePercentFromKeyPoints(float percent) const
</span><span class="cx"> {
</span><span class="cx"> ASSERT(!m_keyPoints.isEmpty());
</span><del>- ASSERT(calcMode() != CalcModePaced);
</del><ins>+ ASSERT(calcMode() != CalcMode::Paced);
</ins><span class="cx"> ASSERT(m_keyTimes.size() > 1);
</span><span class="cx"> ASSERT(m_keyPoints.size() == m_keyTimes.size());
</span><span class="cx">
</span><span class="lines">@@ -453,12 +446,12 @@
</span><span class="cx"> float fromKeyPoint = m_keyPoints[index];
</span><span class="cx"> float toKeyPoint = m_keyPoints[index + 1];
</span><span class="cx">
</span><del>- if (calcMode() == CalcModeDiscrete)
</del><ins>+ if (calcMode() == CalcMode::Discrete)
</ins><span class="cx"> return fromKeyPoint;
</span><span class="cx">
</span><span class="cx"> float keyPointPercent = (percent - fromPercent) / (toPercent - fromPercent);
</span><span class="cx">
</span><del>- if (calcMode() == CalcModeSpline) {
</del><ins>+ if (calcMode() == CalcMode::Spline) {
</ins><span class="cx"> ASSERT(m_keySplines.size() == m_keyPoints.size() - 1);
</span><span class="cx"> keyPointPercent = calculatePercentForSpline(keyPointPercent, index);
</span><span class="cx"> }
</span><span class="lines">@@ -467,7 +460,7 @@
</span><span class="cx">
</span><span class="cx"> float SVGAnimationElement::calculatePercentForFromTo(float percent) const
</span><span class="cx"> {
</span><del>- if (calcMode() == CalcModeDiscrete && m_keyTimes.size() == 2)
</del><ins>+ if (calcMode() == CalcMode::Discrete && m_keyTimes.size() == 2)
</ins><span class="cx"> return percent > m_keyTimes[1] ? 1 : 0;
</span><span class="cx">
</span><span class="cx"> return percent;
</span><span class="lines">@@ -477,7 +470,7 @@
</span><span class="cx"> {
</span><span class="cx"> ASSERT(!m_keyPoints.isEmpty());
</span><span class="cx"> ASSERT(m_keyPoints.size() == m_keyTimes.size());
</span><del>- ASSERT(calcMode() != CalcModePaced);
</del><ins>+ ASSERT(calcMode() != CalcMode::Paced);
</ins><span class="cx"> effectivePercent = calculatePercentFromKeyPoints(percent);
</span><span class="cx"> unsigned index = effectivePercent == 1 ? m_values.size() - 2 : static_cast<unsigned>(effectivePercent * (m_values.size() - 1));
</span><span class="cx"> from = m_values[index];
</span><span class="lines">@@ -502,9 +495,9 @@
</span><span class="cx"> ASSERT(targetElement());
</span><span class="cx"> AnimatedPropertyType type = downcast<SVGAnimateElementBase>(*this).determineAnimatedPropertyType(*targetElement());
</span><span class="cx"> if (type == AnimatedBoolean || type == AnimatedEnumeration || type == AnimatedPreserveAspectRatio || type == AnimatedString)
</span><del>- calcMode = CalcModeDiscrete;
</del><ins>+ calcMode = CalcMode::Discrete;
</ins><span class="cx"> }
</span><del>- if (!m_keyPoints.isEmpty() && calcMode != CalcModePaced)
</del><ins>+ if (!m_keyPoints.isEmpty() && calcMode != CalcMode::Paced)
</ins><span class="cx"> return currentValuesFromKeyPoints(percent, effectivePercent, from, to);
</span><span class="cx">
</span><span class="cx"> unsigned keyTimesCount = m_keyTimes.size();
</span><span class="lines">@@ -512,7 +505,7 @@
</span><span class="cx"> ASSERT(!keyTimesCount || (keyTimesCount > 1 && !m_keyTimes[0]));
</span><span class="cx">
</span><span class="cx"> unsigned index = calculateKeyTimesIndex(percent);
</span><del>- if (calcMode == CalcModeDiscrete) {
</del><ins>+ if (calcMode == CalcMode::Discrete) {
</ins><span class="cx"> if (!keyTimesCount)
</span><span class="cx"> index = static_cast<unsigned>(percent * valuesCount);
</span><span class="cx"> from = m_values[index];
</span><span class="lines">@@ -539,7 +532,7 @@
</span><span class="cx"> ASSERT_WITH_SECURITY_IMPLICATION(toPercent > fromPercent);
</span><span class="cx"> effectivePercent = (percent - fromPercent) / (toPercent - fromPercent);
</span><span class="cx">
</span><del>- if (calcMode == CalcModeSpline) {
</del><ins>+ if (calcMode == CalcMode::Spline) {
</ins><span class="cx"> ASSERT(m_keySplines.size() == m_values.size() - 1);
</span><span class="cx"> effectivePercent = calculatePercentForSpline(effectivePercent, index);
</span><span class="cx"> }
</span><span class="lines">@@ -558,7 +551,7 @@
</span><span class="cx">
</span><span class="cx"> AnimationMode animationMode = this->animationMode();
</span><span class="cx"> CalcMode calcMode = this->calcMode();
</span><del>- if (calcMode == CalcModeSpline) {
</del><ins>+ if (calcMode == CalcMode::Spline) {
</ins><span class="cx"> unsigned splinesCount = m_keySplines.size();
</span><span class="cx"> if (!splinesCount
</span><span class="cx"> || (hasAttributeWithoutSynchronization(SVGNames::keyPointsAttr) && m_keyPoints.size() - 1 != splinesCount)
</span><span class="lines">@@ -587,16 +580,16 @@
</span><span class="cx"> m_animationValid = calculateFromAndByValues(emptyString(), by);
</span><span class="cx"> else if (animationMode == ValuesAnimation) {
</span><span class="cx"> m_animationValid = m_values.size() >= 1
</span><del>- && (calcMode == CalcModePaced || !hasAttributeWithoutSynchronization(SVGNames::keyTimesAttr) || hasAttributeWithoutSynchronization(SVGNames::keyPointsAttr) || (m_values.size() == m_keyTimes.size()))
- && (calcMode == CalcModeDiscrete || !m_keyTimes.size() || m_keyTimes.last() == 1)
- && (calcMode != CalcModeSpline || ((m_keySplines.size() && (m_keySplines.size() == m_values.size() - 1)) || m_keySplines.size() == m_keyPoints.size() - 1))
</del><ins>+ && (calcMode == CalcMode::Paced || !hasAttributeWithoutSynchronization(SVGNames::keyTimesAttr) || hasAttributeWithoutSynchronization(SVGNames::keyPointsAttr) || (m_values.size() == m_keyTimes.size()))
+ && (calcMode == CalcMode::Discrete || !m_keyTimes.size() || m_keyTimes.last() == 1)
+ && (calcMode != CalcMode::Spline || ((m_keySplines.size() && (m_keySplines.size() == m_values.size() - 1)) || m_keySplines.size() == m_keyPoints.size() - 1))
</ins><span class="cx"> && (!hasAttributeWithoutSynchronization(SVGNames::keyPointsAttr) || (m_keyTimes.size() > 1 && m_keyTimes.size() == m_keyPoints.size()));
</span><span class="cx"> if (m_animationValid)
</span><span class="cx"> m_animationValid = calculateToAtEndOfDurationValue(m_values.last());
</span><del>- if (calcMode == CalcModePaced && m_animationValid)
</del><ins>+ if (calcMode == CalcMode::Paced && m_animationValid)
</ins><span class="cx"> calculateKeyTimesForCalcModePaced();
</span><span class="cx"> } else if (animationMode == PathAnimation)
</span><del>- m_animationValid = calcMode == CalcModePaced || !hasAttributeWithoutSynchronization(SVGNames::keyPointsAttr) || (m_keyTimes.size() > 1 && m_keyTimes.size() == m_keyPoints.size());
</del><ins>+ m_animationValid = calcMode == CalcMode::Paced || !hasAttributeWithoutSynchronization(SVGNames::keyPointsAttr) || (m_keyTimes.size() > 1 && m_keyTimes.size() == m_keyPoints.size());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void SVGAnimationElement::updateAnimation(float percent, unsigned repeatCount, SVGSMILElement* resultElement)
</span><span class="lines">@@ -618,9 +611,9 @@
</span><span class="cx"> m_lastValuesAnimationFrom = from;
</span><span class="cx"> m_lastValuesAnimationTo = to;
</span><span class="cx"> }
</span><del>- } else if (!m_keyPoints.isEmpty() && calcMode != CalcModePaced)
</del><ins>+ } else if (!m_keyPoints.isEmpty() && calcMode != CalcMode::Paced)
</ins><span class="cx"> effectivePercent = calculatePercentFromKeyPoints(percent);
</span><del>- else if (m_keyPoints.isEmpty() && calcMode == CalcModeSpline && m_keyTimes.size() > 1)
</del><ins>+ else if (m_keyPoints.isEmpty() && calcMode == CalcMode::Spline && m_keyTimes.size() > 1)
</ins><span class="cx"> effectivePercent = calculatePercentForSpline(percent, calculateKeyTimesIndex(percent));
</span><span class="cx"> else if (animationMode == FromToAnimation || animationMode == ToAnimation)
</span><span class="cx"> effectivePercent = calculatePercentForFromTo(percent);
</span><span class="lines">@@ -689,7 +682,7 @@
</span><span class="cx">
</span><span class="cx"> void SVGAnimationElement::checkInvalidCSSAttributeType(SVGElement* target)
</span><span class="cx"> {
</span><del>- m_hasInvalidCSSAttributeType = target && hasValidAttributeName() && attributeType() == AttributeTypeCSS && !isTargetAttributeCSSProperty(target, attributeName());
</del><ins>+ m_hasInvalidCSSAttributeType = target && hasValidAttributeName() && attributeType() == AttributeType::CSS && !isTargetAttributeCSSProperty(target, attributeName());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGAnimationElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGAnimationElement.h (207715 => 207716)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGAnimationElement.h        2016-10-22 20:46:34 UTC (rev 207715)
+++ trunk/Source/WebCore/svg/SVGAnimationElement.h        2016-10-22 20:56:47 UTC (rev 207716)
</span><span class="lines">@@ -22,8 +22,7 @@
</span><span class="cx"> * Boston, MA 02110-1301, USA.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-#ifndef SVGAnimationElement_h
-#define SVGAnimationElement_h
</del><ins>+#pragma once
</ins><span class="cx">
</span><span class="cx"> #include "SMILTime.h"
</span><span class="cx"> #include "SVGAnimatedBoolean.h"
</span><span class="lines">@@ -34,6 +33,10 @@
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><ins>+class ConditionEventListener;
+class SVGAnimatedType;
+class TimeContainer;
+
</ins><span class="cx"> enum AnimationMode {
</span><span class="cx"> NoAnimation,
</span><span class="cx"> FromToAnimation,
</span><span class="lines">@@ -46,31 +49,15 @@
</span><span class="cx">
</span><span class="cx"> // If we have 'currentColor' or 'inherit' as animation value, we need to grab
</span><span class="cx"> // the value during the animation since the value can be animated itself.
</span><del>-enum AnimatedPropertyValueType {
- RegularPropertyValue,
- CurrentColorValue,
- InheritValue
-};
</del><ins>+enum AnimatedPropertyValueType { RegularPropertyValue, CurrentColorValue, InheritValue };
</ins><span class="cx">
</span><del>-enum CalcMode {
- CalcModeDiscrete,
- CalcModeLinear,
- CalcModePaced,
- CalcModeSpline
-};
</del><ins>+enum class CalcMode { Discrete, Linear, Paced, Spline };
</ins><span class="cx">
</span><del>-class ConditionEventListener;
-class TimeContainer;
-class SVGAnimatedType;
-
-class SVGAnimationElement : public SVGSMILElement,
- public SVGTests,
- public SVGExternalResourcesRequired {
</del><ins>+class SVGAnimationElement : public SVGSMILElement, public SVGTests, public SVGExternalResourcesRequired {
</ins><span class="cx"> public:
</span><del>- // SVGAnimationElement
</del><span class="cx"> float getStartTime() const;
</span><span class="cx"> float getCurrentTime() const;
</span><del>- float getSimpleDuration(ExceptionCode&) const;
</del><ins>+ float getSimpleDuration() const;
</ins><span class="cx">
</span><span class="cx"> void beginElement();
</span><span class="cx"> void beginElementAt(float offset);
</span><span class="lines">@@ -96,9 +83,7 @@
</span><span class="cx"> AnimatedPropertyValueType fromPropertyValueType() const { return m_fromPropertyValueType; }
</span><span class="cx"> AnimatedPropertyValueType toPropertyValueType() const { return m_toPropertyValueType; }
</span><span class="cx">
</span><del>- template<typename AnimatedType>
- void adjustForInheritance(AnimatedType (*parseTypeFromString)(SVGAnimationElement*, const String&),
- AnimatedPropertyValueType valueType, AnimatedType& animatedType, SVGElement* contextElement)
</del><ins>+ template<typename AnimatedType> void adjustForInheritance(AnimatedType (*parseTypeFromString)(SVGAnimationElement*, const String&), AnimatedPropertyValueType valueType, AnimatedType& animatedType, SVGElement* contextElement)
</ins><span class="cx"> {
</span><span class="cx"> if (valueType != InheritValue)
</span><span class="cx"> return;
</span><span class="lines">@@ -109,8 +94,7 @@
</span><span class="cx"> animatedType = (*parseTypeFromString)(this, typeString);
</span><span class="cx"> }
</span><span class="cx">
</span><del>- template<typename AnimatedType>
- bool adjustFromToListValues(const AnimatedType& fromList, const AnimatedType& toList, AnimatedType& animatedList, float percentage, bool resizeAnimatedListIfNeeded = true)
</del><ins>+ template<typename AnimatedType> bool adjustFromToListValues(const AnimatedType& fromList, const AnimatedType& toList, AnimatedType& animatedList, float percentage, bool resizeAnimatedListIfNeeded = true)
</ins><span class="cx"> {
</span><span class="cx"> // If no 'to' value is given, nothing to animate.
</span><span class="cx"> unsigned toListSize = toList.size();
</span><span class="lines">@@ -136,8 +120,7 @@
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- template<typename AnimatedType>
- void animateDiscreteType(float percentage, const AnimatedType& fromType, const AnimatedType& toType, AnimatedType& animatedType)
</del><ins>+ template<typename AnimatedType> void animateDiscreteType(float percentage, const AnimatedType& fromType, const AnimatedType& toType, AnimatedType& animatedType)
</ins><span class="cx"> {
</span><span class="cx"> if ((animationMode() == FromToAnimation && percentage > 0.5) || animationMode() == ToAnimation || percentage == 1) {
</span><span class="cx"> animatedType = AnimatedType(toType);
</span><span class="lines">@@ -149,7 +132,7 @@
</span><span class="cx"> void animateAdditiveNumber(float percentage, unsigned repeatCount, float fromNumber, float toNumber, float toAtEndOfDurationNumber, float& animatedNumber)
</span><span class="cx"> {
</span><span class="cx"> float number;
</span><del>- if (calcMode() == CalcModeDiscrete)
</del><ins>+ if (calcMode() == CalcMode::Discrete)
</ins><span class="cx"> number = percentage < 0.5 ? fromNumber : toNumber;
</span><span class="cx"> else
</span><span class="cx"> number = (toNumber - fromNumber) * percentage + fromNumber;
</span><span class="lines">@@ -174,11 +157,7 @@
</span><span class="cx"> void parseAttribute(const QualifiedName&, const AtomicString&) override;
</span><span class="cx"> void svgAttributeChanged(const QualifiedName&) override;
</span><span class="cx">
</span><del>- enum AttributeType {
- AttributeTypeCSS,
- AttributeTypeXML,
- AttributeTypeAuto
- };
</del><ins>+ enum class AttributeType { CSS, XML, Auto };
</ins><span class="cx"> AttributeType attributeType() const { return m_attributeType; }
</span><span class="cx">
</span><span class="cx"> String toValue() const;
</span><span class="lines">@@ -191,8 +170,8 @@
</span><span class="cx"> void startedActiveInterval() override;
</span><span class="cx"> void updateAnimation(float percent, unsigned repeat, SVGSMILElement* resultElement) override;
</span><span class="cx">
</span><del>- AnimatedPropertyValueType m_fromPropertyValueType;
- AnimatedPropertyValueType m_toPropertyValueType;
</del><ins>+ AnimatedPropertyValueType m_fromPropertyValueType { RegularPropertyValue };
+ AnimatedPropertyValueType m_toPropertyValueType { RegularPropertyValue };
</ins><span class="cx">
</span><span class="cx"> void setTargetElement(SVGElement*) override;
</span><span class="cx"> void setAttributeName(const QualifiedName&) override { }
</span><span class="lines">@@ -235,9 +214,9 @@
</span><span class="cx">
</span><span class="cx"> void setCalcMode(const AtomicString&);
</span><span class="cx">
</span><del>- bool m_animationValid;
</del><ins>+ bool m_animationValid { false };
</ins><span class="cx">
</span><del>- AttributeType m_attributeType;
</del><ins>+ AttributeType m_attributeType { AttributeType::Auto };
</ins><span class="cx"> Vector<String> m_values;
</span><span class="cx"> Vector<float> m_keyTimes;
</span><span class="cx"> Vector<float> m_keyPoints;
</span><span class="lines">@@ -244,11 +223,9 @@
</span><span class="cx"> Vector<UnitBezier> m_keySplines;
</span><span class="cx"> String m_lastValuesAnimationFrom;
</span><span class="cx"> String m_lastValuesAnimationTo;
</span><del>- bool m_hasInvalidCSSAttributeType;
- CalcMode m_calcMode;
- AnimationMode m_animationMode;
</del><ins>+ bool m_hasInvalidCSSAttributeType { false };
+ CalcMode m_calcMode { CalcMode::Linear };
+ AnimationMode m_animationMode { NoAnimation };
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span><del>-
-#endif // SVGAnimationElement_h
</del></span></pre></div>
<a id="trunkSourceWebCoresvgSVGAnimationElementidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGAnimationElement.idl (207715 => 207716)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGAnimationElement.idl        2016-10-22 20:46:34 UTC (rev 207715)
+++ trunk/Source/WebCore/svg/SVGAnimationElement.idl        2016-10-22 20:56:47 UTC (rev 207716)
</span><span class="lines">@@ -29,7 +29,7 @@
</span><span class="cx">
</span><span class="cx"> unrestricted float getStartTime();
</span><span class="cx"> unrestricted float getCurrentTime();
</span><del>- [MayThrowLegacyException] unrestricted float getSimpleDuration();
</del><ins>+ unrestricted float getSimpleDuration();
</ins><span class="cx">
</span><span class="cx"> void beginElement();
</span><span class="cx"> void beginElementAt(optional unrestricted float offset = NaN);
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGColorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGColor.cpp (207715 => 207716)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGColor.cpp        2016-10-22 20:46:34 UTC (rev 207715)
+++ trunk/Source/WebCore/svg/SVGColor.cpp        2016-10-22 20:56:47 UTC (rev 207716)
</span><span class="lines">@@ -28,13 +28,13 @@
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>-SVGColor::SVGColor(const SVGColorType& colorType)
</del><ins>+SVGColor::SVGColor(SVGColorType colorType)
</ins><span class="cx"> : CSSValue(SVGColorClass)
</span><span class="cx"> , m_colorType(colorType)
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><del>-SVGColor::SVGColor(ClassType classType, const SVGColorType& colorType)
</del><ins>+SVGColor::SVGColor(ClassType classType, SVGColorType colorType)
</ins><span class="cx"> : CSSValue(classType)
</span><span class="cx"> , m_colorType(colorType)
</span><span class="cx"> {
</span><span class="lines">@@ -54,21 +54,21 @@
</span><span class="cx"> return CSSParser::parseColor(colorString.stripWhiteSpace());
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void SVGColor::setRGBColor(const String&, ExceptionCode& ec)
</del><ins>+ExceptionOr<void> SVGColor::setRGBColor(const String&)
</ins><span class="cx"> {
</span><span class="cx"> // The whole SVGColor interface is deprecated in SVG 1.1 (2nd edition).
</span><span class="cx"> // Since the setters are the most problematic part, we removed the support for those first.
</span><del>- ec = NO_MODIFICATION_ALLOWED_ERR;
</del><ins>+ return Exception { NO_MODIFICATION_ALLOWED_ERR };
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void SVGColor::setRGBColorICCColor(const String&, const String&, ExceptionCode& ec)
</del><ins>+ExceptionOr<void> SVGColor::setRGBColorICCColor(const String&, const String&)
</ins><span class="cx"> {
</span><del>- ec = NO_MODIFICATION_ALLOWED_ERR;
</del><ins>+ return Exception { NO_MODIFICATION_ALLOWED_ERR };
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void SVGColor::setColor(unsigned short, const String&, const String&, ExceptionCode& ec)
</del><ins>+ExceptionOr<void> SVGColor::setColor(unsigned short, const String&, const String&)
</ins><span class="cx"> {
</span><del>- ec = NO_MODIFICATION_ALLOWED_ERR;
</del><ins>+ return Exception { NO_MODIFICATION_ALLOWED_ERR };
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> String SVGColor::customCSSText() const
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGColorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGColor.h (207715 => 207716)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGColor.h        2016-10-22 20:46:34 UTC (rev 207715)
+++ trunk/Source/WebCore/svg/SVGColor.h        2016-10-22 20:56:47 UTC (rev 207716)
</span><span class="lines">@@ -19,8 +19,7 @@
</span><span class="cx"> * Boston, MA 02110-1301, USA.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-#ifndef SVGColor_h
-#define SVGColor_h
</del><ins>+#pragma once
</ins><span class="cx">
</span><span class="cx"> #include "CSSValue.h"
</span><span class="cx"> #include "Color.h"
</span><span class="lines">@@ -63,14 +62,12 @@
</span><span class="cx">
</span><span class="cx"> static Color colorFromRGBColorString(const String&);
</span><span class="cx">
</span><del>- void setRGBColor(const String& rgbColor, ExceptionCode&);
- void setRGBColorICCColor(const String& rgbColor, const String& iccColor, ExceptionCode&);
- void setColor(unsigned short colorType, const String& rgbColor, const String& iccColor, ExceptionCode&);
</del><ins>+ ExceptionOr<void> setRGBColor(const String&);
+ ExceptionOr<void> setRGBColorICCColor(const String& rgbColor, const String& iccColor);
+ ExceptionOr<void> setColor(unsigned short colorType, const String& rgbColor, const String& iccColor);
</ins><span class="cx">
</span><span class="cx"> String customCSSText() const;
</span><span class="cx">
</span><del>- ~SVGColor() { }
-
</del><span class="cx"> Ref<SVGColor> cloneForCSSOM() const;
</span><span class="cx">
</span><span class="cx"> bool equals(const SVGColor&) const;
</span><span class="lines">@@ -78,7 +75,7 @@
</span><span class="cx"> protected:
</span><span class="cx"> friend class CSSComputedStyleDeclaration;
</span><span class="cx">
</span><del>- SVGColor(ClassType, const SVGColorType&);
</del><ins>+ SVGColor(ClassType, SVGColorType);
</ins><span class="cx"> SVGColor(ClassType, const SVGColor& cloneFrom);
</span><span class="cx">
</span><span class="cx"> void setColor(const Color& color) { m_color = color; }
</span><span class="lines">@@ -85,7 +82,7 @@
</span><span class="cx"> void setColorType(const SVGColorType& type) { m_colorType = type; }
</span><span class="cx">
</span><span class="cx"> private:
</span><del>- SVGColor(const SVGColorType&);
</del><ins>+ explicit SVGColor(SVGColorType);
</ins><span class="cx">
</span><span class="cx"> Color m_color;
</span><span class="cx"> SVGColorType m_colorType;
</span><span class="lines">@@ -94,5 +91,3 @@
</span><span class="cx"> } // namespace WebCore
</span><span class="cx">
</span><span class="cx"> SPECIALIZE_TYPE_TRAITS_CSS_VALUE(SVGColor, isSVGColor())
</span><del>-
-#endif // SVGColor_h
</del></span></pre></div>
<a id="trunkSourceWebCoresvgSVGColoridl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGColor.idl (207715 => 207716)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGColor.idl        2016-10-22 20:46:34 UTC (rev 207715)
+++ trunk/Source/WebCore/svg/SVGColor.idl        2016-10-22 20:56:47 UTC (rev 207716)
</span><span class="lines">@@ -31,10 +31,7 @@
</span><span class="cx"> readonly attribute RGBColor rgbColor;
</span><span class="cx"> // FIXME: readonly attribute SVGICCColor iccColor;
</span><span class="cx">
</span><del>- [MayThrowLegacyException] void setRGBColor(DOMString rgbColor);
-
- [MayThrowLegacyException] void setRGBColorICCColor(DOMString rgbColor, DOMString iccColor);
-
- [MayThrowLegacyException] void setColor(unsigned short colorType, DOMString rgbColor, DOMString iccColor);
</del><ins>+ [MayThrowException] void setRGBColor(DOMString rgbColor);
+ [MayThrowException] void setRGBColorICCColor(DOMString rgbColor, DOMString iccColor);
+ [MayThrowException] void setColor(unsigned short colorType, DOMString rgbColor, DOMString iccColor);
</ins><span class="cx"> };
</span><del>-
</del></span></pre></div>
<a id="trunkSourceWebCoresvgSVGGlyphRefElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGGlyphRefElement.cpp (207715 => 207716)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGGlyphRefElement.cpp        2016-10-22 20:46:34 UTC (rev 207715)
+++ trunk/Source/WebCore/svg/SVGGlyphRefElement.cpp        2016-10-22 20:56:47 UTC (rev 207716)
</span><span class="lines">@@ -27,7 +27,6 @@
</span><span class="cx"> #include "SVGParserUtilities.h"
</span><span class="cx"> #include "XLinkNames.h"
</span><span class="cx"> #include <wtf/text/AtomicString.h>
</span><del>-#include <wtf/text/StringView.h>
</del><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="lines">@@ -41,10 +40,6 @@
</span><span class="cx">
</span><span class="cx"> inline SVGGlyphRefElement::SVGGlyphRefElement(const QualifiedName& tagName, Document& document)
</span><span class="cx"> : SVGElement(tagName, document)
</span><del>- , m_x(0)
- , m_y(0)
- , m_dx(0)
- , m_dy(0)
</del><span class="cx"> {
</span><span class="cx"> ASSERT(hasTagName(SVGNames::glyphRefTag));
</span><span class="cx"> registerAnimatedPropertiesForSVGGlyphRefElement();
</span><span class="lines">@@ -62,21 +57,25 @@
</span><span class="cx"> return is<SVGGlyphElement>(targetElementFromIRIString(getAttribute(XLinkNames::hrefAttr), document(), &glyphName));
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+static float parseFloat(const AtomicString& value)
+{
+ float result;
+ if (!parseNumberFromString(value, result))
+ return 0;
+ return result;
+}
+
</ins><span class="cx"> void SVGGlyphRefElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
</span><span class="cx"> {
</span><del>- auto upconvertedCharacters = StringView(value.string()).upconvertedCharacters();
- const UChar* startPtr = upconvertedCharacters;
- const UChar* endPtr = startPtr + value.length();
-
- // FIXME: We need some error handling here.
</del><ins>+ // FIXME: Is the error handling in parseFloat correct for these attributes?
</ins><span class="cx"> if (name == SVGNames::xAttr)
</span><del>- parseNumber(startPtr, endPtr, m_x);
</del><ins>+ m_x = parseFloat(value);
</ins><span class="cx"> else if (name == SVGNames::yAttr)
</span><del>- parseNumber(startPtr, endPtr, m_y);
</del><ins>+ m_y = parseFloat(value);
</ins><span class="cx"> else if (name == SVGNames::dxAttr)
</span><del>- parseNumber(startPtr, endPtr, m_dx);
</del><ins>+ m_dx = parseFloat(value);
</ins><span class="cx"> else if (name == SVGNames::dyAttr)
</span><del>- parseNumber(startPtr, endPtr, m_dy);
</del><ins>+ m_dy = parseFloat(value);
</ins><span class="cx"> else {
</span><span class="cx"> SVGURIReference::parseAttribute(name, value);
</span><span class="cx"> SVGElement::parseAttribute(name, value);
</span><span class="lines">@@ -83,45 +82,26 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>-const AtomicString& SVGGlyphRefElement::glyphRef() const
</del><ins>+void SVGGlyphRefElement::setX(float x)
</ins><span class="cx"> {
</span><del>- return attributeWithoutSynchronization(SVGNames::glyphRefAttr);
</del><ins>+ setAttribute(SVGNames::xAttr, AtomicString::number(x));
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void SVGGlyphRefElement::setGlyphRef(const AtomicString&, ExceptionCode&)
</del><ins>+void SVGGlyphRefElement::setY(float y)
</ins><span class="cx"> {
</span><del>- // FIXME: Set and honor attribute change.
- // https://bugs.webkit.org/show_bug.cgi?id=64787
</del><ins>+ setAttribute(SVGNames::yAttr, AtomicString::number(y));
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void SVGGlyphRefElement::setX(float x, ExceptionCode&)
</del><ins>+void SVGGlyphRefElement::setDx(float dx)
</ins><span class="cx"> {
</span><del>- // FIXME: Honor attribute change.
- // https://bugs.webkit.org/show_bug.cgi?id=64787
- m_x = x;
</del><ins>+ setAttribute(SVGNames::dxAttr, AtomicString::number(dx));
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void SVGGlyphRefElement::setY(float y , ExceptionCode&)
</del><ins>+void SVGGlyphRefElement::setDy(float dy)
</ins><span class="cx"> {
</span><del>- // FIXME: Honor attribute change.
- // https://bugs.webkit.org/show_bug.cgi?id=64787
- m_y = y;
</del><ins>+ setAttribute(SVGNames::dyAttr, AtomicString::number(dy));
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void SVGGlyphRefElement::setDx(float dx, ExceptionCode&)
-{
- // FIXME: Honor attribute change.
- // https://bugs.webkit.org/show_bug.cgi?id=64787
- m_dx = dx;
</del><span class="cx"> }
</span><span class="cx">
</span><del>-void SVGGlyphRefElement::setDy(float dy, ExceptionCode&)
-{
- // FIXME: Honor attribute change.
- // https://bugs.webkit.org/show_bug.cgi?id=64787
- m_dy = dy;
-}
-
-}
-
</del><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGGlyphRefElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGGlyphRefElement.h (207715 => 207716)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGGlyphRefElement.h        2016-10-22 20:46:34 UTC (rev 207715)
+++ trunk/Source/WebCore/svg/SVGGlyphRefElement.h        2016-10-22 20:56:47 UTC (rev 207716)
</span><span class="lines">@@ -17,38 +17,34 @@
</span><span class="cx"> * Boston, MA 02110-1301, USA.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-#ifndef SVGGlyphRefElement_h
-#define SVGGlyphRefElement_h
</del><ins>+#pragma once
</ins><span class="cx">
</span><span class="cx"> #if ENABLE(SVG_FONTS)
</span><ins>+
</ins><span class="cx"> #include "SVGElement.h"
</span><span class="cx"> #include "SVGURIReference.h"
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>-class SVGGlyphRefElement final : public SVGElement,
- public SVGURIReference {
</del><ins>+class SVGGlyphRefElement final : public SVGElement, public SVGURIReference {
</ins><span class="cx"> public:
</span><span class="cx"> static Ref<SVGGlyphRefElement> create(const QualifiedName&, Document&);
</span><span class="cx">
</span><span class="cx"> bool hasValidGlyphElement(String& glyphName) const;
</span><del>- void parseAttribute(const QualifiedName&, const AtomicString&) final;
</del><span class="cx">
</span><del>- // DOM interface
- const AtomicString& glyphRef() const;
- void setGlyphRef(const AtomicString&, ExceptionCode&);
</del><span class="cx"> float x() const { return m_x; }
</span><del>- void setX(float, ExceptionCode&);
</del><ins>+ void setX(float);
</ins><span class="cx"> float y() const { return m_y; }
</span><del>- void setY(float, ExceptionCode&);
</del><ins>+ void setY(float);
</ins><span class="cx"> float dx() const { return m_dx; }
</span><del>- void setDx(float, ExceptionCode&);
</del><ins>+ void setDx(float);
</ins><span class="cx"> float dy() const { return m_dy; }
</span><del>- void setDy(float, ExceptionCode&);
</del><ins>+ void setDy(float);
</ins><span class="cx">
</span><span class="cx"> private:
</span><span class="cx"> SVGGlyphRefElement(const QualifiedName&, Document&);
</span><span class="cx">
</span><ins>+ void parseAttribute(const QualifiedName&, const AtomicString&) final;
</ins><span class="cx"> bool rendererIsNeeded(const RenderStyle&) final { return false; }
</span><span class="cx">
</span><span class="cx"> BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGGlyphRefElement)
</span><span class="lines">@@ -55,13 +51,12 @@
</span><span class="cx"> DECLARE_ANIMATED_STRING_OVERRIDE(Href, href)
</span><span class="cx"> END_DECLARE_ANIMATED_PROPERTIES
</span><span class="cx">
</span><del>- float m_x;
- float m_y;
- float m_dx;
- float m_dy;
</del><ins>+ float m_x { 0 };
+ float m_y { 0 };
+ float m_dx { 0 };
+ float m_dy { 0 };
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #endif
</span><del>-#endif
</del></span></pre></div>
<a id="trunkSourceWebCoresvgSVGGlyphRefElementidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGGlyphRefElement.idl (207715 => 207716)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGGlyphRefElement.idl        2016-10-22 20:46:34 UTC (rev 207715)
+++ trunk/Source/WebCore/svg/SVGGlyphRefElement.idl        2016-10-22 20:56:47 UTC (rev 207716)
</span><span class="lines">@@ -20,13 +20,12 @@
</span><span class="cx"> [
</span><span class="cx"> Conditional=SVG_FONTS
</span><span class="cx"> ] interface SVGGlyphRefElement : SVGElement {
</span><del>- // FIXME: Use [Reflect] after https://bugs.webkit.org/show_bug.cgi?id=64843 is fixed.
- [SetterMayThrowLegacyException] attribute DOMString glyphRef;
</del><ins>+ [Reflect=glyphRef] attribute DOMString glyphRef;
</ins><span class="cx"> [Reflect] attribute DOMString format;
</span><del>- [SetterMayThrowLegacyException] attribute unrestricted float x;
- [SetterMayThrowLegacyException] attribute unrestricted float y;
- [SetterMayThrowLegacyException] attribute unrestricted float dx;
- [SetterMayThrowLegacyException] attribute unrestricted float dy;
</del><ins>+ attribute unrestricted float x;
+ attribute unrestricted float y;
+ attribute unrestricted float dx;
+ attribute unrestricted float dy;
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> SVGGlyphRefElement implements SVGURIReference;
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGGraphicsElementidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGGraphicsElement.idl (207715 => 207716)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGGraphicsElement.idl        2016-10-22 20:46:34 UTC (rev 207715)
+++ trunk/Source/WebCore/svg/SVGGraphicsElement.idl        2016-10-22 20:56:47 UTC (rev 207716)
</span><span class="lines">@@ -32,7 +32,7 @@
</span><span class="cx"> SVGRect getBBox();
</span><span class="cx"> SVGMatrix getCTM();
</span><span class="cx"> SVGMatrix getScreenCTM();
</span><del>- [MayThrowLegacyException] SVGMatrix getTransformToElement(optional SVGElement? element = null);
</del><ins>+ [MayThrowException] SVGMatrix getTransformToElement(optional SVGElement? element = null);
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> SVGGraphicsElement implements SVGTests;
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGLengthcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGLength.cpp (207715 => 207716)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGLength.cpp        2016-10-22 20:46:34 UTC (rev 207715)
+++ trunk/Source/WebCore/svg/SVGLength.cpp        2016-10-22 20:56:47 UTC (rev 207716)
</span><span class="lines">@@ -25,7 +25,6 @@
</span><span class="cx"> #include "CSSHelper.h"
</span><span class="cx"> #include "CSSPrimitiveValue.h"
</span><span class="cx"> #include "ExceptionCode.h"
</span><del>-#include "ExceptionCodePlaceholder.h"
</del><span class="cx"> #include "FloatConversion.h"
</span><span class="cx"> #include "SVGNames.h"
</span><span class="cx"> #include "SVGParserUtilities.h"
</span><span class="lines">@@ -85,7 +84,7 @@
</span><span class="cx"> return "";
</span><span class="cx"> }
</span><span class="cx">
</span><del>-inline SVGLengthType stringToLengthType(const UChar*& ptr, const UChar* end)
</del><ins>+inline SVGLengthType parseLengthType(const UChar* ptr, const UChar* end)
</ins><span class="cx"> {
</span><span class="cx"> if (ptr == end)
</span><span class="cx"> return LengthTypeNumber;
</span><span class="lines">@@ -124,7 +123,7 @@
</span><span class="cx"> : m_valueInSpecifiedUnits(0)
</span><span class="cx"> , m_unit(storeUnit(mode, LengthTypeNumber))
</span><span class="cx"> {
</span><del>- setValueAsString(valueAsString, IGNORE_EXCEPTION);
</del><ins>+ setValueAsString(valueAsString);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> SVGLength::SVGLength(const SVGLengthContext& context, float value, SVGLengthMode mode, SVGLengthType unitType)
</span><span class="lines">@@ -131,20 +130,14 @@
</span><span class="cx"> : m_valueInSpecifiedUnits(0)
</span><span class="cx"> , m_unit(storeUnit(mode, unitType))
</span><span class="cx"> {
</span><del>- setValue(value, context, ASSERT_NO_EXCEPTION);
</del><ins>+ setValue(value, context);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-SVGLength::SVGLength(const SVGLength& other)
- : m_valueInSpecifiedUnits(other.m_valueInSpecifiedUnits)
- , m_unit(other.m_unit)
</del><ins>+ExceptionOr<void> SVGLength::setValueAsString(const String& valueAsString, SVGLengthMode mode)
</ins><span class="cx"> {
</span><del>-}
-
-void SVGLength::setValueAsString(const String& valueAsString, SVGLengthMode mode, ExceptionCode& ec)
-{
</del><span class="cx"> m_valueInSpecifiedUnits = 0;
</span><span class="cx"> m_unit = storeUnit(mode, LengthTypeNumber);
</span><del>- setValueAsString(valueAsString, ec);
</del><ins>+ return setValueAsString(valueAsString);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool SVGLength::operator==(const SVGLength& other) const
</span><span class="lines">@@ -160,12 +153,9 @@
</span><span class="cx">
</span><span class="cx"> SVGLength SVGLength::construct(SVGLengthMode mode, const String& valueAsString, SVGParsingError& parseError, SVGLengthNegativeValuesMode negativeValuesMode)
</span><span class="cx"> {
</span><del>- ExceptionCode ec = 0;
</del><span class="cx"> SVGLength length(mode);
</span><span class="cx">
</span><del>- length.setValueAsString(valueAsString, ec);
-
- if (ec)
</del><ins>+ if (length.setValueAsString(valueAsString).hasException())
</ins><span class="cx"> parseError = ParsingAttributeFailedError;
</span><span class="cx"> else if (negativeValuesMode == ForbidNegativeLengths && length.valueInSpecifiedUnits() < 0)
</span><span class="cx"> parseError = NegativeValueForbiddenError;
</span><span class="lines">@@ -185,30 +175,35 @@
</span><span class="cx">
</span><span class="cx"> float SVGLength::value(const SVGLengthContext& context) const
</span><span class="cx"> {
</span><del>- return value(context, IGNORE_EXCEPTION);
</del><ins>+ auto result = valueForBindings(context);
+ if (result.hasException())
+ return 0;
+ return result.releaseReturnValue();
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-float SVGLength::value(const SVGLengthContext& context, ExceptionCode& ec) const
</del><ins>+ExceptionOr<float> SVGLength::valueForBindings(const SVGLengthContext& context) const
</ins><span class="cx"> {
</span><del>- return context.convertValueToUserUnits(m_valueInSpecifiedUnits, extractMode(m_unit), extractType(m_unit), ec);
</del><ins>+ return context.convertValueToUserUnits(m_valueInSpecifiedUnits, extractMode(m_unit), extractType(m_unit));
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void SVGLength::setValue(const SVGLengthContext& context, float value, SVGLengthMode mode, SVGLengthType unitType, ExceptionCode& ec)
</del><ins>+ExceptionOr<void> SVGLength::setValue(const SVGLengthContext& context, float value, SVGLengthMode mode, SVGLengthType unitType)
</ins><span class="cx"> {
</span><ins>+ // FIXME: Seems like a bug that we change the value of m_unit even if setValue throws an exception.
</ins><span class="cx"> m_unit = storeUnit(mode, unitType);
</span><del>- setValue(value, context, ec);
</del><ins>+ return setValue(value, context);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void SVGLength::setValue(float value, const SVGLengthContext& context, ExceptionCode& ec)
</del><ins>+ExceptionOr<void> SVGLength::setValue(float value, const SVGLengthContext& context)
</ins><span class="cx"> {
</span><span class="cx"> // 100% = 100.0 instead of 1.0 for historical reasons, this could eventually be changed
</span><span class="cx"> if (extractType(m_unit) == LengthTypePercentage)
</span><span class="cx"> value = value / 100;
</span><span class="cx">
</span><del>- ec = 0;
- float convertedValue = context.convertValueFromUserUnits(value, extractMode(m_unit), extractType(m_unit), ec);
- if (!ec)
- m_valueInSpecifiedUnits = convertedValue;
</del><ins>+ auto convertedValue = context.convertValueFromUserUnits(value, extractMode(m_unit), extractType(m_unit));
+ if (convertedValue.hasException())
+ return convertedValue.releaseException();
+ m_valueInSpecifiedUnits = convertedValue.releaseReturnValue();
+ return { };
</ins><span class="cx"> }
</span><span class="cx"> float SVGLength::valueAsPercentage() const
</span><span class="cx"> {
</span><span class="lines">@@ -219,10 +214,10 @@
</span><span class="cx"> return m_valueInSpecifiedUnits;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void SVGLength::setValueAsString(const String& string, ExceptionCode& ec)
</del><ins>+ExceptionOr<void> SVGLength::setValueAsString(const String& string)
</ins><span class="cx"> {
</span><span class="cx"> if (string.isEmpty())
</span><del>- return;
</del><ins>+ return { };
</ins><span class="cx">
</span><span class="cx"> float convertedNumber = 0;
</span><span class="cx"> auto upconvertedCharacters = StringView(string).upconvertedCharacters();
</span><span class="lines">@@ -229,20 +224,16 @@
</span><span class="cx"> const UChar* ptr = upconvertedCharacters;
</span><span class="cx"> const UChar* end = ptr + string.length();
</span><span class="cx">
</span><del>- if (!parseNumber(ptr, end, convertedNumber, false)) {
- ec = SYNTAX_ERR;
- return;
- }
</del><ins>+ if (!parseNumber(ptr, end, convertedNumber, false))
+ return Exception { SYNTAX_ERR };
</ins><span class="cx">
</span><del>- SVGLengthType type = stringToLengthType(ptr, end);
- ASSERT(ptr <= end);
- if (type == LengthTypeUnknown) {
- ec = SYNTAX_ERR;
- return;
- }
</del><ins>+ auto type = parseLengthType(ptr, end);
+ if (type == LengthTypeUnknown)
+ return Exception { SYNTAX_ERR };
</ins><span class="cx">
</span><span class="cx"> m_unit = storeUnit(extractMode(m_unit), type);
</span><span class="cx"> m_valueInSpecifiedUnits = convertedNumber;
</span><ins>+ return { };
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> String SVGLength::valueAsString() const
</span><span class="lines">@@ -250,36 +241,34 @@
</span><span class="cx"> return String::number(m_valueInSpecifiedUnits) + lengthTypeToString(extractType(m_unit));
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void SVGLength::newValueSpecifiedUnits(unsigned short type, float value, ExceptionCode& ec)
</del><ins>+ExceptionOr<void> SVGLength::newValueSpecifiedUnits(unsigned short type, float value)
</ins><span class="cx"> {
</span><del>- if (type == LengthTypeUnknown || type > LengthTypePC) {
- ec = NOT_SUPPORTED_ERR;
- return;
- }
</del><ins>+ if (type == LengthTypeUnknown || type > LengthTypePC)
+ return Exception { NOT_SUPPORTED_ERR };
</ins><span class="cx">
</span><span class="cx"> m_unit = storeUnit(extractMode(m_unit), static_cast<SVGLengthType>(type));
</span><span class="cx"> m_valueInSpecifiedUnits = value;
</span><ins>+ return { };
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void SVGLength::convertToSpecifiedUnits(unsigned short type, const SVGLengthContext& context, ExceptionCode& ec)
</del><ins>+ExceptionOr<void> SVGLength::convertToSpecifiedUnits(unsigned short type, const SVGLengthContext& context)
</ins><span class="cx"> {
</span><del>- if (type == LengthTypeUnknown || type > LengthTypePC) {
- ec = NOT_SUPPORTED_ERR;
- return;
- }
</del><ins>+ if (type == LengthTypeUnknown || type > LengthTypePC)
+ return Exception { NOT_SUPPORTED_ERR };
</ins><span class="cx">
</span><del>- float valueInUserUnits = value(context, ec);
- if (ec)
- return;
</del><ins>+ auto valueInUserUnits = valueForBindings(context);
+ if (valueInUserUnits.hasException())
+ return valueInUserUnits.releaseException();
</ins><span class="cx">
</span><del>- unsigned int originalUnitAndType = m_unit;
</del><ins>+ auto originalUnitAndType = m_unit;
</ins><span class="cx"> m_unit = storeUnit(extractMode(m_unit), static_cast<SVGLengthType>(type));
</span><del>- setValue(valueInUserUnits, context, ec);
- if (!ec)
- return;
</del><ins>+ auto result = setValue(valueInUserUnits.releaseReturnValue(), context);
+ if (result.hasException()) {
+ m_unit = originalUnitAndType;
+ return result.releaseException();
+ }
</ins><span class="cx">
</span><del>- // Eventually restore old unit and type
- m_unit = originalUnitAndType;
</del><ins>+ return { };
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> SVGLength SVGLength::fromCSSPrimitiveValue(const CSSPrimitiveValue& value)
</span><span class="lines">@@ -325,12 +314,8 @@
</span><span class="cx"> if (svgType == LengthTypeUnknown)
</span><span class="cx"> return SVGLength();
</span><span class="cx">
</span><del>- ExceptionCode ec = 0;
</del><span class="cx"> SVGLength length;
</span><del>- length.newValueSpecifiedUnits(svgType, value.floatValue(), ec);
- if (ec)
- return SVGLength();
-
</del><ins>+ length.newValueSpecifiedUnits(svgType, value.floatValue());
</ins><span class="cx"> return length;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -377,37 +362,44 @@
</span><span class="cx">
</span><span class="cx"> SVGLengthMode SVGLength::lengthModeForAnimatedLengthAttribute(const QualifiedName& attrName)
</span><span class="cx"> {
</span><del>- typedef HashMap<QualifiedName, SVGLengthMode> LengthModeForLengthAttributeMap;
- static NeverDestroyed<LengthModeForLengthAttributeMap> s_lengthModeMap;
</del><ins>+ using Map = HashMap<QualifiedName, SVGLengthMode>;
+ static NeverDestroyed<Map> map = [] {
+ struct Mode {
+ const QualifiedName& name;
+ SVGLengthMode mode;
+ };
+ static const Mode modes[] = {
+ { SVGNames::xAttr, LengthModeWidth },
+ { SVGNames::yAttr, LengthModeHeight },
+ { SVGNames::cxAttr, LengthModeWidth },
+ { SVGNames::cyAttr, LengthModeHeight },
+ { SVGNames::dxAttr, LengthModeWidth },
+ { SVGNames::dyAttr, LengthModeHeight },
+ { SVGNames::fxAttr, LengthModeWidth },
+ { SVGNames::fyAttr, LengthModeHeight },
+ { SVGNames::widthAttr, LengthModeWidth },
+ { SVGNames::heightAttr, LengthModeHeight },
+ { SVGNames::x1Attr, LengthModeWidth },
+ { SVGNames::x2Attr, LengthModeWidth },
+ { SVGNames::y1Attr, LengthModeHeight },
+ { SVGNames::y2Attr, LengthModeHeight },
+ { SVGNames::refXAttr, LengthModeWidth },
+ { SVGNames::refYAttr, LengthModeHeight },
+ { SVGNames::markerWidthAttr, LengthModeWidth },
+ { SVGNames::markerHeightAttr, LengthModeHeight },
+ { SVGNames::textLengthAttr, LengthModeWidth },
+ { SVGNames::startOffsetAttr, LengthModeWidth },
+ };
+ Map map;
+ for (auto& mode : modes)
+ map.add(mode.name, mode.mode);
+ return map;
+ }();
</ins><span class="cx">
</span><del>- if (s_lengthModeMap.get().isEmpty()) {
- s_lengthModeMap.get().set(SVGNames::xAttr, LengthModeWidth);
- s_lengthModeMap.get().set(SVGNames::yAttr, LengthModeHeight);
- s_lengthModeMap.get().set(SVGNames::cxAttr, LengthModeWidth);
- s_lengthModeMap.get().set(SVGNames::cyAttr, LengthModeHeight);
- s_lengthModeMap.get().set(SVGNames::dxAttr, LengthModeWidth);
- s_lengthModeMap.get().set(SVGNames::dyAttr, LengthModeHeight);
- s_lengthModeMap.get().set(SVGNames::fxAttr, LengthModeWidth);
- s_lengthModeMap.get().set(SVGNames::fyAttr, LengthModeHeight);
- s_lengthModeMap.get().set(SVGNames::rAttr, LengthModeOther);
- s_lengthModeMap.get().set(SVGNames::widthAttr, LengthModeWidth);
- s_lengthModeMap.get().set(SVGNames::heightAttr, LengthModeHeight);
- s_lengthModeMap.get().set(SVGNames::x1Attr, LengthModeWidth);
- s_lengthModeMap.get().set(SVGNames::x2Attr, LengthModeWidth);
- s_lengthModeMap.get().set(SVGNames::y1Attr, LengthModeHeight);
- s_lengthModeMap.get().set(SVGNames::y2Attr, LengthModeHeight);
- s_lengthModeMap.get().set(SVGNames::refXAttr, LengthModeWidth);
- s_lengthModeMap.get().set(SVGNames::refYAttr, LengthModeHeight);
- s_lengthModeMap.get().set(SVGNames::markerWidthAttr, LengthModeWidth);
- s_lengthModeMap.get().set(SVGNames::markerHeightAttr, LengthModeHeight);
- s_lengthModeMap.get().set(SVGNames::textLengthAttr, LengthModeWidth);
- s_lengthModeMap.get().set(SVGNames::startOffsetAttr, LengthModeWidth);
- }
-
- if (s_lengthModeMap.get().contains(attrName))
- return s_lengthModeMap.get().get(attrName);
-
- return LengthModeOther;
</del><ins>+ auto result = map.get().find(attrName);
+ if (result == map.get().end())
+ return LengthModeOther;
+ return result->value;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> TextStream& operator<<(TextStream& ts, const SVGLength& length)
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGLengthh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGLength.h (207715 => 207716)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGLength.h        2016-10-22 20:46:34 UTC (rev 207715)
+++ trunk/Source/WebCore/svg/SVGLength.h        2016-10-22 20:56:47 UTC (rev 207716)
</span><span class="lines">@@ -18,8 +18,7 @@
</span><span class="cx"> * Boston, MA 02110-1301, USA.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-#ifndef SVGLength_h
-#define SVGLength_h
</del><ins>+#pragma once
</ins><span class="cx">
</span><span class="cx"> #include "AnimationUtilities.h"
</span><span class="cx"> #include "SVGLengthContext.h"
</span><span class="lines">@@ -31,8 +30,6 @@
</span><span class="cx"> class CSSPrimitiveValue;
</span><span class="cx"> class QualifiedName;
</span><span class="cx">
</span><del>-typedef int ExceptionCode;
-
</del><span class="cx"> enum SVGLengthNegativeValuesMode {
</span><span class="cx"> AllowNegativeLengths,
</span><span class="cx"> ForbidNegativeLengths
</span><span class="lines">@@ -59,7 +56,6 @@
</span><span class="cx"> // FIXME: Once all SVGLength users use Length internally, we make this a wrapper for Length.
</span><span class="cx"> SVGLength(SVGLengthMode = LengthModeOther, const String& valueAsString = String());
</span><span class="cx"> SVGLength(const SVGLengthContext&, float, SVGLengthMode = LengthModeOther, SVGLengthType = LengthTypeNumber);
</span><del>- SVGLength(const SVGLength&);
</del><span class="cx">
</span><span class="cx"> SVGLengthType unitType() const;
</span><span class="cx"> SVGLengthMode unitMode() const;
</span><span class="lines">@@ -70,9 +66,9 @@
</span><span class="cx"> static SVGLength construct(SVGLengthMode, const String&, SVGParsingError&, SVGLengthNegativeValuesMode = AllowNegativeLengths);
</span><span class="cx">
</span><span class="cx"> float value(const SVGLengthContext&) const;
</span><del>- float value(const SVGLengthContext&, ExceptionCode&) const;
- void setValue(float, const SVGLengthContext&, ExceptionCode&);
- void setValue(const SVGLengthContext&, float, SVGLengthMode, SVGLengthType, ExceptionCode&);
</del><ins>+ ExceptionOr<float> valueForBindings(const SVGLengthContext&) const;
+ ExceptionOr<void> setValue(float, const SVGLengthContext&);
+ ExceptionOr<void> setValue(const SVGLengthContext&, float, SVGLengthMode, SVGLengthType);
</ins><span class="cx">
</span><span class="cx"> float valueInSpecifiedUnits() const { return m_valueInSpecifiedUnits; }
</span><span class="cx"> void setValueInSpecifiedUnits(float value) { m_valueInSpecifiedUnits = value; }
</span><span class="lines">@@ -80,14 +76,14 @@
</span><span class="cx"> float valueAsPercentage() const;
</span><span class="cx">
</span><span class="cx"> String valueAsString() const;
</span><del>- void setValueAsString(const String&, ExceptionCode&);
- void setValueAsString(const String&, SVGLengthMode, ExceptionCode&);
</del><ins>+ ExceptionOr<void> setValueAsString(const String&);
+ ExceptionOr<void> setValueAsString(const String&, SVGLengthMode);
</ins><span class="cx">
</span><del>- void newValueSpecifiedUnits(unsigned short, float valueInSpecifiedUnits, ExceptionCode&);
- void convertToSpecifiedUnits(unsigned short, const SVGLengthContext&, ExceptionCode&);
</del><ins>+ ExceptionOr<void> newValueSpecifiedUnits(unsigned short, float valueInSpecifiedUnits);
+ ExceptionOr<void> convertToSpecifiedUnits(unsigned short, const SVGLengthContext&);
</ins><span class="cx">
</span><span class="cx"> // Helper functions
</span><del>- inline bool isRelative() const
</del><ins>+ bool isRelative() const
</ins><span class="cx"> {
</span><span class="cx"> SVGLengthType type = unitType();
</span><span class="cx"> return type == LengthTypePercentage || type == LengthTypeEMS || type == LengthTypeEXS;
</span><span class="lines">@@ -94,7 +90,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool isZero() const
</span><del>- {
</del><ins>+ {
</ins><span class="cx"> return !m_valueInSpecifiedUnits;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -115,13 +111,12 @@
</span><span class="cx"> return *this;
</span><span class="cx">
</span><span class="cx"> SVGLength length;
</span><del>- ExceptionCode ec = 0;
</del><span class="cx">
</span><span class="cx"> if (fromType == LengthTypePercentage || toType == LengthTypePercentage) {
</span><span class="cx"> float fromPercent = from.valueAsPercentage() * 100;
</span><span class="cx"> float toPercent = valueAsPercentage() * 100;
</span><del>- length.newValueSpecifiedUnits(LengthTypePercentage, WebCore::blend(fromPercent, toPercent, progress), ec);
- if (ec)
</del><ins>+ auto result = length.newValueSpecifiedUnits(LengthTypePercentage, WebCore::blend(fromPercent, toPercent, progress));
+ if (result.hasException())
</ins><span class="cx"> return SVGLength();
</span><span class="cx"> return length;
</span><span class="cx"> }
</span><span class="lines">@@ -129,12 +124,15 @@
</span><span class="cx"> if (fromType == toType || from.isZero() || isZero() || fromType == LengthTypeEMS || fromType == LengthTypeEXS) {
</span><span class="cx"> float fromValue = from.valueInSpecifiedUnits();
</span><span class="cx"> float toValue = valueInSpecifiedUnits();
</span><del>- if (isZero())
- length.newValueSpecifiedUnits(fromType, WebCore::blend(fromValue, toValue, progress), ec);
- else
- length.newValueSpecifiedUnits(toType, WebCore::blend(fromValue, toValue, progress), ec);
- if (ec)
- return SVGLength();
</del><ins>+ if (isZero()) {
+ auto result = length.newValueSpecifiedUnits(fromType, WebCore::blend(fromValue, toValue, progress));
+ if (result.hasException())
+ return SVGLength();
+ } else {
+ auto result = length.newValueSpecifiedUnits(toType, WebCore::blend(fromValue, toValue, progress));
+ if (result.hasException())
+ return SVGLength();
+ }
</ins><span class="cx"> return length;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -142,18 +140,17 @@
</span><span class="cx"> ASSERT(!from.isRelative());
</span><span class="cx">
</span><span class="cx"> SVGLengthContext nonRelativeLengthContext(nullptr);
</span><del>- float fromValueInUserUnits = nonRelativeLengthContext.convertValueToUserUnits(from.valueInSpecifiedUnits(), from.unitMode(), fromType, ec);
- if (ec)
</del><ins>+ auto fromValueInUserUnits = nonRelativeLengthContext.convertValueToUserUnits(from.valueInSpecifiedUnits(), from.unitMode(), fromType);
+ if (fromValueInUserUnits.hasException())
</ins><span class="cx"> return SVGLength();
</span><span class="cx">
</span><del>- float fromValue = nonRelativeLengthContext.convertValueFromUserUnits(fromValueInUserUnits, unitMode(), toType, ec);
- if (ec)
</del><ins>+ auto fromValue = nonRelativeLengthContext.convertValueFromUserUnits(fromValueInUserUnits.releaseReturnValue(), unitMode(), toType);
+ if (fromValue.hasException())
</ins><span class="cx"> return SVGLength();
</span><span class="cx">
</span><span class="cx"> float toValue = valueInSpecifiedUnits();
</span><del>- length.newValueSpecifiedUnits(toType, WebCore::blend(fromValue, toValue, progress), ec);
-
- if (ec)
</del><ins>+ auto result = length.newValueSpecifiedUnits(toType, WebCore::blend(fromValue.releaseReturnValue(), toValue, progress));
+ if (result.hasException())
</ins><span class="cx"> return SVGLength();
</span><span class="cx"> return length;
</span><span class="cx"> }
</span><span class="lines">@@ -160,11 +157,10 @@
</span><span class="cx">
</span><span class="cx"> private:
</span><span class="cx"> float m_valueInSpecifiedUnits;
</span><del>- unsigned int m_unit;
</del><ins>+ unsigned m_unit;
</ins><span class="cx"> };
</span><span class="cx">
</span><del>-template<>
-struct SVGPropertyTraits<SVGLength> {
</del><ins>+template<> struct SVGPropertyTraits<SVGLength> {
</ins><span class="cx"> static SVGLength initialValue() { return SVGLength(); }
</span><span class="cx"> static String toString(const SVGLength& type) { return type.valueAsString(); }
</span><span class="cx"> };
</span><span class="lines">@@ -172,5 +168,3 @@
</span><span class="cx"> TextStream& operator<<(TextStream&, const SVGLength&);
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span><del>-
-#endif // SVGLength_h
</del></span></pre></div>
<a id="trunkSourceWebCoresvgSVGLengthidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGLength.idl (207715 => 207716)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGLength.idl        2016-10-22 20:46:34 UTC (rev 207715)
+++ trunk/Source/WebCore/svg/SVGLength.idl        2016-10-22 20:56:47 UTC (rev 207716)
</span><span class="lines">@@ -22,28 +22,24 @@
</span><span class="cx">
</span><span class="cx"> interface SVGLength {
</span><span class="cx"> // Length Unit Types
</span><del>- const unsigned short SVG_LENGTHTYPE_UNKNOWN = 0;
- const unsigned short SVG_LENGTHTYPE_NUMBER = 1;
</del><ins>+ const unsigned short SVG_LENGTHTYPE_UNKNOWN = 0;
+ const unsigned short SVG_LENGTHTYPE_NUMBER = 1;
</ins><span class="cx"> const unsigned short SVG_LENGTHTYPE_PERCENTAGE = 2;
</span><del>- const unsigned short SVG_LENGTHTYPE_EMS = 3;
- const unsigned short SVG_LENGTHTYPE_EXS = 4;
- const unsigned short SVG_LENGTHTYPE_PX = 5;
- const unsigned short SVG_LENGTHTYPE_CM = 6;
- const unsigned short SVG_LENGTHTYPE_MM = 7;
- const unsigned short SVG_LENGTHTYPE_IN = 8;
- const unsigned short SVG_LENGTHTYPE_PT = 9;
- const unsigned short SVG_LENGTHTYPE_PC = 10;
</del><ins>+ const unsigned short SVG_LENGTHTYPE_EMS = 3;
+ const unsigned short SVG_LENGTHTYPE_EXS = 4;
+ const unsigned short SVG_LENGTHTYPE_PX = 5;
+ const unsigned short SVG_LENGTHTYPE_CM = 6;
+ const unsigned short SVG_LENGTHTYPE_MM = 7;
+ const unsigned short SVG_LENGTHTYPE_IN = 8;
+ const unsigned short SVG_LENGTHTYPE_PT = 9;
+ const unsigned short SVG_LENGTHTYPE_PC = 10;
</ins><span class="cx">
</span><span class="cx"> readonly attribute unsigned short unitType;
</span><del>- [GetterMayThrowLegacyException, SetterMayThrowLegacyException, Custom] attribute unrestricted float value;
</del><ins>+ [Custom, GetterMayThrowException, SetterMayThrowException] attribute unrestricted float value;
</ins><span class="cx">
</span><span class="cx"> attribute unrestricted float valueInSpecifiedUnits;
</span><ins>+ [SetterMayThrowException] attribute DOMString valueAsString;
</ins><span class="cx">
</span><del>- [SetterMayThrowLegacyException] attribute DOMString valueAsString;
-
- [MayThrowLegacyException] void newValueSpecifiedUnits(unsigned short unitType,
- unrestricted float valueInSpecifiedUnits);
-
- [Custom, MayThrowLegacyException] void convertToSpecifiedUnits(unsigned short unitType);
</del><ins>+ [MayThrowException] void newValueSpecifiedUnits(unsigned short unitType, unrestricted float valueInSpecifiedUnits);
+ [Custom, MayThrowException] void convertToSpecifiedUnits(unsigned short unitType);
</ins><span class="cx"> };
</span><del>-
</del></span></pre></div>
<a id="trunkSourceWebCoresvgSVGLengthContextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGLengthContext.cpp (207715 => 207716)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGLengthContext.cpp        2016-10-22 20:46:34 UTC (rev 207715)
+++ trunk/Source/WebCore/svg/SVGLengthContext.cpp        2016-10-22 20:56:47 UTC (rev 207716)
</span><span class="lines">@@ -89,8 +89,12 @@
</span><span class="cx">
</span><span class="cx"> float SVGLengthContext::valueForLength(const Length& length, SVGLengthMode mode)
</span><span class="cx"> {
</span><del>- if (length.isPercent())
- return convertValueFromPercentageToUserUnits(length.value() / 100, mode, IGNORE_EXCEPTION);
</del><ins>+ if (length.isPercent()) {
+ auto result = convertValueFromPercentageToUserUnits(length.value() / 100, mode);
+ if (result.hasException())
+ return 0;
+ return result.releaseReturnValue();
+ }
</ins><span class="cx"> if (length.isAuto() || !length.isSpecified())
</span><span class="cx"> return 0;
</span><span class="cx">
</span><span class="lines">@@ -103,12 +107,12 @@
</span><span class="cx"> case LengthModeHeight:
</span><span class="cx"> return floatValueForLength(length, viewportSize.height());
</span><span class="cx"> case LengthModeOther:
</span><del>- return floatValueForLength(length, sqrtf(viewportSize.diagonalLengthSquared() / 2));
</del><ins>+ return floatValueForLength(length, std::sqrt(viewportSize.diagonalLengthSquared() / 2));
</ins><span class="cx"> };
</span><span class="cx"> return 0;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-float SVGLengthContext::convertValueToUserUnits(float value, SVGLengthMode mode, SVGLengthType fromUnit, ExceptionCode& ec) const
</del><ins>+ExceptionOr<float> SVGLengthContext::convertValueToUserUnits(float value, SVGLengthMode mode, SVGLengthType fromUnit) const
</ins><span class="cx"> {
</span><span class="cx"> // If the SVGLengthContext carries a custom viewport, force resolving against it.
</span><span class="cx"> if (!m_overridenViewport.isEmpty()) {
</span><span class="lines">@@ -115,23 +119,22 @@
</span><span class="cx"> // 100% = 100.0 instead of 1.0 for historical reasons, this could eventually be changed
</span><span class="cx"> if (fromUnit == LengthTypePercentage)
</span><span class="cx"> value /= 100;
</span><del>- return convertValueFromPercentageToUserUnits(value, mode, ec);
</del><ins>+ return convertValueFromPercentageToUserUnits(value, mode);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> switch (fromUnit) {
</span><span class="cx"> case LengthTypeUnknown:
</span><del>- ec = NOT_SUPPORTED_ERR;
- return 0;
</del><ins>+ return Exception { NOT_SUPPORTED_ERR };
</ins><span class="cx"> case LengthTypeNumber:
</span><span class="cx"> return value;
</span><span class="cx"> case LengthTypePX:
</span><span class="cx"> return value;
</span><span class="cx"> case LengthTypePercentage:
</span><del>- return convertValueFromPercentageToUserUnits(value / 100, mode, ec);
</del><ins>+ return convertValueFromPercentageToUserUnits(value / 100, mode);
</ins><span class="cx"> case LengthTypeEMS:
</span><del>- return convertValueFromEMSToUserUnits(value, ec);
</del><ins>+ return convertValueFromEMSToUserUnits(value);
</ins><span class="cx"> case LengthTypeEXS:
</span><del>- return convertValueFromEXSToUserUnits(value, ec);
</del><ins>+ return convertValueFromEXSToUserUnits(value);
</ins><span class="cx"> case LengthTypeCM:
</span><span class="cx"> return value * cssPixelsPerInch / 2.54f;
</span><span class="cx"> case LengthTypeMM:
</span><span class="lines">@@ -148,20 +151,19 @@
</span><span class="cx"> return 0;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-float SVGLengthContext::convertValueFromUserUnits(float value, SVGLengthMode mode, SVGLengthType toUnit, ExceptionCode& ec) const
</del><ins>+ExceptionOr<float> SVGLengthContext::convertValueFromUserUnits(float value, SVGLengthMode mode, SVGLengthType toUnit) const
</ins><span class="cx"> {
</span><span class="cx"> switch (toUnit) {
</span><span class="cx"> case LengthTypeUnknown:
</span><del>- ec = NOT_SUPPORTED_ERR;
- return 0;
</del><ins>+ return Exception { NOT_SUPPORTED_ERR };
</ins><span class="cx"> case LengthTypeNumber:
</span><span class="cx"> return value;
</span><span class="cx"> case LengthTypePercentage:
</span><del>- return convertValueFromUserUnitsToPercentage(value * 100, mode, ec);
</del><ins>+ return convertValueFromUserUnitsToPercentage(value * 100, mode);
</ins><span class="cx"> case LengthTypeEMS:
</span><del>- return convertValueFromUserUnitsToEMS(value, ec);
</del><ins>+ return convertValueFromUserUnitsToEMS(value);
</ins><span class="cx"> case LengthTypeEXS:
</span><del>- return convertValueFromUserUnitsToEXS(value, ec);
</del><ins>+ return convertValueFromUserUnitsToEXS(value);
</ins><span class="cx"> case LengthTypePX:
</span><span class="cx"> return value;
</span><span class="cx"> case LengthTypeCM:
</span><span class="lines">@@ -180,13 +182,11 @@
</span><span class="cx"> return 0;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-float SVGLengthContext::convertValueFromUserUnitsToPercentage(float value, SVGLengthMode mode, ExceptionCode& ec) const
</del><ins>+ExceptionOr<float> SVGLengthContext::convertValueFromUserUnitsToPercentage(float value, SVGLengthMode mode) const
</ins><span class="cx"> {
</span><span class="cx"> FloatSize viewportSize;
</span><del>- if (!determineViewport(viewportSize)) {
- ec = NOT_SUPPORTED_ERR;
- return 0;
- }
</del><ins>+ if (!determineViewport(viewportSize))
+ return Exception { NOT_SUPPORTED_ERR };
</ins><span class="cx">
</span><span class="cx"> switch (mode) {
</span><span class="cx"> case LengthModeWidth:
</span><span class="lines">@@ -194,7 +194,7 @@
</span><span class="cx"> case LengthModeHeight:
</span><span class="cx"> return value / viewportSize.height() * 100;
</span><span class="cx"> case LengthModeOther:
</span><del>- return value / (sqrtf(viewportSize.diagonalLengthSquared() / 2)) * 100;
</del><ins>+ return value / (std::sqrt(viewportSize.diagonalLengthSquared() / 2)) * 100;
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> ASSERT_NOT_REACHED();
</span><span class="lines">@@ -201,13 +201,11 @@
</span><span class="cx"> return 0;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-float SVGLengthContext::convertValueFromPercentageToUserUnits(float value, SVGLengthMode mode, ExceptionCode& ec) const
</del><ins>+ExceptionOr<float> SVGLengthContext::convertValueFromPercentageToUserUnits(float value, SVGLengthMode mode) const
</ins><span class="cx"> {
</span><span class="cx"> FloatSize viewportSize;
</span><del>- if (!determineViewport(viewportSize)) {
- ec = NOT_SUPPORTED_ERR;
- return 0;
- }
</del><ins>+ if (!determineViewport(viewportSize))
+ return Exception { NOT_SUPPORTED_ERR };
</ins><span class="cx">
</span><span class="cx"> switch (mode) {
</span><span class="cx"> case LengthModeWidth:
</span><span class="lines">@@ -215,7 +213,7 @@
</span><span class="cx"> case LengthModeHeight:
</span><span class="cx"> return value * viewportSize.height();
</span><span class="cx"> case LengthModeOther:
</span><del>- return value * sqrtf(viewportSize.diagonalLengthSquared() / 2);
</del><ins>+ return value * std::sqrt(viewportSize.diagonalLengthSquared() / 2);
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> ASSERT_NOT_REACHED();
</span><span class="lines">@@ -239,64 +237,52 @@
</span><span class="cx"> return nullptr;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-float SVGLengthContext::convertValueFromUserUnitsToEMS(float value, ExceptionCode& ec) const
</del><ins>+ExceptionOr<float> SVGLengthContext::convertValueFromUserUnitsToEMS(float value) const
</ins><span class="cx"> {
</span><span class="cx"> auto* style = renderStyleForLengthResolving(m_context);
</span><del>- if (!style) {
- ec = NOT_SUPPORTED_ERR;
- return 0;
- }
</del><ins>+ if (!style)
+ return Exception { NOT_SUPPORTED_ERR };
</ins><span class="cx">
</span><span class="cx"> float fontSize = style->fontSize();
</span><del>- if (!fontSize) {
- ec = NOT_SUPPORTED_ERR;
- return 0;
- }
</del><ins>+ if (!fontSize)
+ return Exception { NOT_SUPPORTED_ERR };
</ins><span class="cx">
</span><span class="cx"> return value / fontSize;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-float SVGLengthContext::convertValueFromEMSToUserUnits(float value, ExceptionCode& ec) const
</del><ins>+ExceptionOr<float> SVGLengthContext::convertValueFromEMSToUserUnits(float value) const
</ins><span class="cx"> {
</span><span class="cx"> auto* style = renderStyleForLengthResolving(m_context);
</span><del>- if (!style) {
- ec = NOT_SUPPORTED_ERR;
- return 0;
- }
</del><ins>+ if (!style)
+ return Exception { NOT_SUPPORTED_ERR };
</ins><span class="cx">
</span><span class="cx"> return value * style->fontSize();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-float SVGLengthContext::convertValueFromUserUnitsToEXS(float value, ExceptionCode& ec) const
</del><ins>+ExceptionOr<float> SVGLengthContext::convertValueFromUserUnitsToEXS(float value) const
</ins><span class="cx"> {
</span><span class="cx"> auto* style = renderStyleForLengthResolving(m_context);
</span><del>- if (!style) {
- ec = NOT_SUPPORTED_ERR;
- return 0;
- }
</del><ins>+ if (!style)
+ return Exception { NOT_SUPPORTED_ERR };
</ins><span class="cx">
</span><span class="cx"> // Use of ceil allows a pixel match to the W3Cs expected output of coords-units-03-b.svg
</span><span class="cx"> // if this causes problems in real world cases maybe it would be best to remove this
</span><del>- float xHeight = ceilf(style->fontMetrics().xHeight());
- if (!xHeight) {
- ec = NOT_SUPPORTED_ERR;
- return 0;
- }
</del><ins>+ float xHeight = std::ceil(style->fontMetrics().xHeight());
+ if (!xHeight)
+ return Exception { NOT_SUPPORTED_ERR };
</ins><span class="cx">
</span><span class="cx"> return value / xHeight;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-float SVGLengthContext::convertValueFromEXSToUserUnits(float value, ExceptionCode& ec) const
</del><ins>+ExceptionOr<float> SVGLengthContext::convertValueFromEXSToUserUnits(float value) const
</ins><span class="cx"> {
</span><span class="cx"> auto* style = renderStyleForLengthResolving(m_context);
</span><del>- if (!style) {
- ec = NOT_SUPPORTED_ERR;
- return 0;
- }
</del><ins>+ if (!style)
+ return Exception { NOT_SUPPORTED_ERR };
</ins><span class="cx">
</span><span class="cx"> // Use of ceil allows a pixel match to the W3Cs expected output of coords-units-03-b.svg
</span><span class="cx"> // if this causes problems in real world cases maybe it would be best to remove this
</span><del>- return value * ceilf(style->fontMetrics().xHeight());
</del><ins>+ return value * std::ceil(style->fontMetrics().xHeight());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool SVGLengthContext::determineViewport(FloatSize& viewportSize) const
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGLengthContexth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGLengthContext.h (207715 => 207716)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGLengthContext.h        2016-10-22 20:46:34 UTC (rev 207715)
+++ trunk/Source/WebCore/svg/SVGLengthContext.h        2016-10-22 20:56:47 UTC (rev 207716)
</span><span class="lines">@@ -17,9 +17,9 @@
</span><span class="cx"> * Boston, MA 02110-1301, USA.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-#ifndef SVGLengthContext_h
-#define SVGLengthContext_h
</del><ins>+#pragma once
</ins><span class="cx">
</span><ins>+#include "ExceptionOr.h"
</ins><span class="cx"> #include "FloatRect.h"
</span><span class="cx"> #include "SVGUnitTypes.h"
</span><span class="cx">
</span><span class="lines">@@ -27,10 +27,9 @@
</span><span class="cx">
</span><span class="cx"> class SVGElement;
</span><span class="cx"> class SVGLength;
</span><ins>+
</ins><span class="cx"> struct Length;
</span><span class="cx">
</span><del>-typedef int ExceptionCode;
-
</del><span class="cx"> enum SVGLengthType {
</span><span class="cx"> LengthTypeUnknown = 0,
</span><span class="cx"> LengthTypeNumber,
</span><span class="lines">@@ -66,8 +65,8 @@
</span><span class="cx"> static float resolveLength(const SVGElement*, SVGUnitTypes::SVGUnitType, const SVGLength&);
</span><span class="cx">
</span><span class="cx"> float valueForLength(const Length&, SVGLengthMode = LengthModeOther);
</span><del>- float convertValueToUserUnits(float, SVGLengthMode, SVGLengthType fromUnit, ExceptionCode&) const;
- float convertValueFromUserUnits(float, SVGLengthMode, SVGLengthType toUnit, ExceptionCode&) const;
</del><ins>+ ExceptionOr<float> convertValueToUserUnits(float, SVGLengthMode, SVGLengthType fromUnit) const;
+ ExceptionOr<float> convertValueFromUserUnits(float, SVGLengthMode, SVGLengthType toUnit) const;
</ins><span class="cx">
</span><span class="cx"> bool determineViewport(FloatSize&) const;
</span><span class="cx">
</span><span class="lines">@@ -74,14 +73,14 @@
</span><span class="cx"> private:
</span><span class="cx"> SVGLengthContext(const SVGElement*, const FloatRect& viewport);
</span><span class="cx">
</span><del>- float convertValueFromUserUnitsToPercentage(float value, SVGLengthMode, ExceptionCode&) const;
- float convertValueFromPercentageToUserUnits(float value, SVGLengthMode, ExceptionCode&) const;
</del><ins>+ ExceptionOr<float> convertValueFromUserUnitsToPercentage(float value, SVGLengthMode) const;
+ ExceptionOr<float> convertValueFromPercentageToUserUnits(float value, SVGLengthMode) const;
</ins><span class="cx">
</span><del>- float convertValueFromUserUnitsToEMS(float value, ExceptionCode&) const;
- float convertValueFromEMSToUserUnits(float value, ExceptionCode&) const;
</del><ins>+ ExceptionOr<float> convertValueFromUserUnitsToEMS(float value) const;
+ ExceptionOr<float> convertValueFromEMSToUserUnits(float value) const;
</ins><span class="cx">
</span><del>- float convertValueFromUserUnitsToEXS(float value, ExceptionCode&) const;
- float convertValueFromEXSToUserUnits(float value, ExceptionCode&) const;
</del><ins>+ ExceptionOr<float> convertValueFromUserUnitsToEXS(float value) const;
+ ExceptionOr<float> convertValueFromEXSToUserUnits(float value) const;
</ins><span class="cx">
</span><span class="cx"> const SVGElement* m_context;
</span><span class="cx"> FloatRect m_overridenViewport;
</span><span class="lines">@@ -88,5 +87,3 @@
</span><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span><del>-
-#endif // SVGLengthContext_h
</del></span></pre></div>
<a id="trunkSourceWebCoresvgSVGLengthListcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGLengthList.cpp (207715 => 207716)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGLengthList.cpp        2016-10-22 20:46:34 UTC (rev 207715)
+++ trunk/Source/WebCore/svg/SVGLengthList.cpp        2016-10-22 20:56:47 UTC (rev 207716)
</span><span class="lines">@@ -29,7 +29,6 @@
</span><span class="cx"> void SVGLengthList::parse(const String& value, SVGLengthMode mode)
</span><span class="cx"> {
</span><span class="cx"> clear();
</span><del>- ExceptionCode ec = 0;
</del><span class="cx">
</span><span class="cx"> auto upconvertedCharacters = StringView(value).upconvertedCharacters();
</span><span class="cx"> const UChar* ptr = upconvertedCharacters;
</span><span class="lines">@@ -45,8 +44,7 @@
</span><span class="cx"> String valueString(start, ptr - start);
</span><span class="cx"> if (valueString.isEmpty())
</span><span class="cx"> return;
</span><del>- length.setValueAsString(valueString, ec);
- if (ec)
</del><ins>+ if (length.setValueAsString(valueString).hasException())
</ins><span class="cx"> return;
</span><span class="cx"> append(length);
</span><span class="cx"> skipOptionalSVGSpacesOrDelimiter(ptr, end);
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGLengthListh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGLengthList.h (207715 => 207716)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGLengthList.h        2016-10-22 20:46:34 UTC (rev 207715)
+++ trunk/Source/WebCore/svg/SVGLengthList.h        2016-10-22 20:56:47 UTC (rev 207716)
</span><span class="lines">@@ -18,8 +18,7 @@
</span><span class="cx"> * Boston, MA 02110-1301, USA.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-#ifndef SVGLengthList_h
-#define SVGLengthList_h
</del><ins>+#pragma once
</ins><span class="cx">
</span><span class="cx"> #include "SVGLength.h"
</span><span class="cx"> #include <wtf/Vector.h>
</span><span class="lines">@@ -28,14 +27,11 @@
</span><span class="cx">
</span><span class="cx"> class SVGLengthList final : public Vector<SVGLength> {
</span><span class="cx"> public:
</span><del>- SVGLengthList() { }
-
- void parse(const String& value, SVGLengthMode);
</del><ins>+ void parse(const String& value, SVGLengthMode);
</ins><span class="cx"> String valueAsString() const;
</span><span class="cx"> };
</span><span class="cx">
</span><del>-template<>
-struct SVGPropertyTraits<SVGLengthList> {
</del><ins>+template<> struct SVGPropertyTraits<SVGLengthList> {
</ins><span class="cx"> typedef SVGLength ListItemType;
</span><span class="cx">
</span><span class="cx"> static SVGLengthList initialValue() { return SVGLengthList(); }
</span><span class="lines">@@ -43,5 +39,3 @@
</span><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span><del>-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCoresvgSVGLengthListidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGLengthList.idl (207715 => 207716)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGLengthList.idl        2016-10-22 20:46:34 UTC (rev 207715)
+++ trunk/Source/WebCore/svg/SVGLengthList.idl        2016-10-22 20:56:47 UTC (rev 207716)
</span><span class="lines">@@ -27,11 +27,11 @@
</span><span class="cx"> interface SVGLengthList {
</span><span class="cx"> readonly attribute unsigned long numberOfItems;
</span><span class="cx">
</span><del>- [MayThrowLegacyException] void clear();
- [MayThrowLegacyException] SVGLength initialize(SVGLength item);
- [MayThrowLegacyException] SVGLength getItem(unsigned long index);
- [MayThrowLegacyException] SVGLength insertItemBefore(SVGLength item, unsigned long index);
- [MayThrowLegacyException] SVGLength replaceItem(SVGLength item, unsigned long index);
- [MayThrowLegacyException] SVGLength removeItem(unsigned long index);
- [MayThrowLegacyException] SVGLength appendItem(SVGLength item);
</del><ins>+ [MayThrowException] void clear();
+ [MayThrowException] SVGLength initialize(SVGLength item);
+ [MayThrowException] SVGLength getItem(unsigned long index);
+ [MayThrowException] SVGLength insertItemBefore(SVGLength item, unsigned long index);
+ [MayThrowException] SVGLength replaceItem(SVGLength item, unsigned long index);
+ [MayThrowException] SVGLength removeItem(unsigned long index);
+ [MayThrowException] SVGLength appendItem(SVGLength item);
</ins><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGLocatablecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGLocatable.cpp (207715 => 207716)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGLocatable.cpp        2016-10-22 20:46:34 UTC (rev 207715)
+++ trunk/Source/WebCore/svg/SVGLocatable.cpp        2016-10-22 20:56:47 UTC (rev 207716)
</span><span class="lines">@@ -97,7 +97,7 @@
</span><span class="cx"> return ctm;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-AffineTransform SVGLocatable::getTransformToElement(SVGElement* target, ExceptionCode& ec, StyleUpdateStrategy styleUpdateStrategy)
</del><ins>+ExceptionOr<AffineTransform> SVGLocatable::getTransformToElement(SVGElement* target, StyleUpdateStrategy styleUpdateStrategy)
</ins><span class="cx"> {
</span><span class="cx"> AffineTransform ctm = getCTM(styleUpdateStrategy);
</span><span class="cx">
</span><span class="lines">@@ -105,13 +105,11 @@
</span><span class="cx"> AffineTransform targetCTM = downcast<SVGGraphicsElement>(*target).getCTM(styleUpdateStrategy);
</span><span class="cx"> if (auto inverse = targetCTM.inverse())
</span><span class="cx"> ctm = inverse.value() * ctm;
</span><del>- else {
- ec = SVGException::SVG_MATRIX_NOT_INVERTABLE;
- return ctm;
- }
</del><ins>+ else
+ return Exception { SVGException::SVG_MATRIX_NOT_INVERTABLE };
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- return ctm;
</del><ins>+ return WTFMove(ctm);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGLocatableh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGLocatable.h (207715 => 207716)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGLocatable.h        2016-10-22 20:46:34 UTC (rev 207715)
+++ trunk/Source/WebCore/svg/SVGLocatable.h        2016-10-22 20:56:47 UTC (rev 207716)
</span><span class="lines">@@ -19,10 +19,10 @@
</span><span class="cx"> * Boston, MA 02110-1301, USA.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-#ifndef SVGLocatable_h
-#define SVGLocatable_h
</del><ins>+#pragma once
</ins><span class="cx">
</span><span class="cx"> #include "AffineTransform.h"
</span><ins>+#include "ExceptionOr.h"
</ins><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="lines">@@ -29,8 +29,6 @@
</span><span class="cx"> class FloatRect;
</span><span class="cx"> class SVGElement;
</span><span class="cx">
</span><del>-typedef int ExceptionCode;
-
</del><span class="cx"> class SVGLocatable {
</span><span class="cx"> public:
</span><span class="cx"> virtual ~SVGLocatable() { }
</span><span class="lines">@@ -44,7 +42,7 @@
</span><span class="cx"> virtual FloatRect getBBox(StyleUpdateStrategy) = 0;
</span><span class="cx"> virtual AffineTransform getCTM(StyleUpdateStrategy) = 0;
</span><span class="cx"> virtual AffineTransform getScreenCTM(StyleUpdateStrategy) = 0;
</span><del>- AffineTransform getTransformToElement(SVGElement*, ExceptionCode&, StyleUpdateStrategy = AllowStyleUpdate);
</del><ins>+ ExceptionOr<AffineTransform> getTransformToElement(SVGElement*, StyleUpdateStrategy = AllowStyleUpdate);
</ins><span class="cx">
</span><span class="cx"> static SVGElement* nearestViewportElement(const SVGElement*);
</span><span class="cx"> static SVGElement* farthestViewportElement(const SVGElement*);
</span><span class="lines">@@ -62,5 +60,3 @@
</span><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span><del>-
-#endif // SVGLocatable_h
</del></span></pre></div>
<a id="trunkSourceWebCoresvgSVGMarkerElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGMarkerElement.h (207715 => 207716)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGMarkerElement.h        2016-10-22 20:46:34 UTC (rev 207715)
+++ trunk/Source/WebCore/svg/SVGMarkerElement.h        2016-10-22 20:56:47 UTC (rev 207716)
</span><span class="lines">@@ -81,8 +81,7 @@
</span><span class="cx"> template<>
</span><span class="cx"> inline unsigned SVGIDLEnumLimits<SVGMarkerOrientType>::highestExposedEnumValue() { return SVGMarkerOrientAngle; }
</span><span class="cx">
</span><del>-template<>
-struct SVGPropertyTraits<SVGMarkerOrientType> {
</del><ins>+template<> struct SVGPropertyTraits<SVGMarkerOrientType> {
</ins><span class="cx"> static unsigned highestEnumValue() { return SVGMarkerOrientAutoStartReverse; }
</span><span class="cx">
</span><span class="cx"> // toString is not needed, synchronizeOrientType() handles this on its own.
</span><span class="lines">@@ -93,12 +92,10 @@
</span><span class="cx"> return SVGMarkerOrientAuto;
</span><span class="cx"> if (value == "auto-start-reverse")
</span><span class="cx"> return SVGMarkerOrientAutoStartReverse;
</span><del>-
- ExceptionCode ec = 0;
- angle.setValueAsString(value, ec);
- if (!ec)
- return SVGMarkerOrientAngle;
- return SVGMarkerOrientUnknown;
</del><ins>+ auto setValueResult = angle.setValueAsString(value);
+ if (setValueResult.hasException())
+ return SVGMarkerOrientUnknown;
+ return SVGMarkerOrientAngle;
</ins><span class="cx"> }
</span><span class="cx"> };
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGMatrixh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGMatrix.h (207715 => 207716)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGMatrix.h        2016-10-22 20:46:34 UTC (rev 207715)
+++ trunk/Source/WebCore/svg/SVGMatrix.h        2016-10-22 20:56:47 UTC (rev 207716)
</span><span class="lines">@@ -17,17 +17,14 @@
</span><span class="cx"> * Boston, MA 02110-1301, USA.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-#ifndef SVGMatrix_h
-#define SVGMatrix_h
</del><ins>+#pragma once
</ins><span class="cx">
</span><span class="cx"> #include "AffineTransform.h"
</span><ins>+#include "ExceptionOr.h"
</ins><span class="cx"> #include "SVGException.h"
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>-typedef int ExceptionCode;
-
-// Only used in the bindings.
</del><span class="cx"> class SVGMatrix final : public AffineTransform {
</span><span class="cx"> public:
</span><span class="cx"> SVGMatrix() { }
</span><span class="lines">@@ -43,88 +40,85 @@
</span><span class="cx">
</span><span class="cx"> SVGMatrix translate(double tx, double ty)
</span><span class="cx"> {
</span><del>- AffineTransform copy = *this;
</del><ins>+ AffineTransform copy { *this };
</ins><span class="cx"> copy.translate(tx, ty);
</span><del>- return static_cast<SVGMatrix>(copy);
</del><ins>+ return SVGMatrix { copy };
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> SVGMatrix scale(double s)
</span><span class="cx"> {
</span><del>- AffineTransform copy = *this;
</del><ins>+ AffineTransform copy { *this };
</ins><span class="cx"> copy.scale(s, s);
</span><del>- return static_cast<SVGMatrix>(copy);
</del><ins>+ return SVGMatrix { copy };
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> SVGMatrix scaleNonUniform(double sx, double sy)
</span><span class="cx"> {
</span><del>- AffineTransform copy = *this;
</del><ins>+ AffineTransform copy { *this };
</ins><span class="cx"> copy.scale(sx, sy);
</span><del>- return static_cast<SVGMatrix>(copy);
</del><ins>+ return SVGMatrix { copy };
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> SVGMatrix rotate(double d)
</span><span class="cx"> {
</span><del>- AffineTransform copy = *this;
</del><ins>+ AffineTransform copy { *this };
</ins><span class="cx"> copy.rotate(d);
</span><del>- return static_cast<SVGMatrix>(copy);
</del><ins>+ return SVGMatrix { copy };
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> SVGMatrix flipX()
</span><span class="cx"> {
</span><del>- AffineTransform copy = *this;
</del><ins>+ AffineTransform copy { *this };
</ins><span class="cx"> copy.flipX();
</span><del>- return static_cast<SVGMatrix>(copy);
</del><ins>+ return SVGMatrix { copy };
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> SVGMatrix flipY()
</span><span class="cx"> {
</span><del>- AffineTransform copy = *this;
</del><ins>+ AffineTransform copy { *this };
</ins><span class="cx"> copy.flipY();
</span><del>- return static_cast<SVGMatrix>(copy);
</del><ins>+ return SVGMatrix { copy };
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> SVGMatrix skewX(double angle)
</span><span class="cx"> {
</span><del>- AffineTransform copy = *this;
</del><ins>+ AffineTransform copy { *this };
</ins><span class="cx"> copy.skewX(angle);
</span><del>- return static_cast<SVGMatrix>(copy);
</del><ins>+ return SVGMatrix { copy };
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> SVGMatrix skewY(double angle)
</span><span class="cx"> {
</span><del>- AffineTransform copy = *this;
</del><ins>+ AffineTransform copy { *this };
</ins><span class="cx"> copy.skewY(angle);
</span><del>- return static_cast<SVGMatrix>(copy);
</del><ins>+ return SVGMatrix { copy };
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> SVGMatrix multiply(const SVGMatrix& other)
</span><span class="cx"> {
</span><del>- AffineTransform copy = *this;
</del><ins>+ AffineTransform copy { *this };
</ins><span class="cx"> copy *= static_cast<const AffineTransform&>(other);
</span><del>- return static_cast<SVGMatrix>(copy);
</del><ins>+ return SVGMatrix { copy };
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- SVGMatrix inverse(ExceptionCode& ec) const
</del><ins>+ ExceptionOr<SVGMatrix> inverse() const
</ins><span class="cx"> {
</span><span class="cx"> if (auto inverse = AffineTransform::inverse())
</span><del>- return inverse.value();
</del><ins>+ return SVGMatrix { inverse.value() };
</ins><span class="cx">
</span><del>- ec = SVGException::SVG_MATRIX_NOT_INVERTABLE;
- return AffineTransform();
</del><ins>+ return Exception { SVGException::SVG_MATRIX_NOT_INVERTABLE };
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- SVGMatrix rotateFromVector(double x, double y, ExceptionCode& ec)
</del><ins>+ ExceptionOr<SVGMatrix> rotateFromVector(double x, double y)
</ins><span class="cx"> {
</span><span class="cx"> if (!x || !y)
</span><del>- ec = SVGException::SVG_INVALID_VALUE_ERR;
</del><ins>+ return Exception { SVGException::SVG_INVALID_VALUE_ERR };
</ins><span class="cx">
</span><del>- AffineTransform copy = *this;
</del><ins>+ AffineTransform copy { *this };
</ins><span class="cx"> copy.rotateFromVector(x, y);
</span><del>- return static_cast<SVGMatrix>(copy);
</del><ins>+ return SVGMatrix { copy };
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span><del>-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCoresvgSVGMatrixidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGMatrix.idl (207715 => 207716)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGMatrix.idl        2016-10-22 20:46:34 UTC (rev 207715)
+++ trunk/Source/WebCore/svg/SVGMatrix.idl        2016-10-22 20:56:47 UTC (rev 207716)
</span><span class="lines">@@ -31,15 +31,14 @@
</span><span class="cx"> attribute unrestricted double f;
</span><span class="cx">
</span><span class="cx"> SVGMatrix multiply(SVGMatrix secondMatrix);
</span><del>- [MayThrowLegacyException] SVGMatrix inverse();
</del><ins>+ [MayThrowException] SVGMatrix inverse();
</ins><span class="cx"> [Immutable] SVGMatrix translate(unrestricted float x, unrestricted float y);
</span><span class="cx"> [Immutable] SVGMatrix scale(unrestricted float scaleFactor);
</span><span class="cx"> [Immutable] SVGMatrix scaleNonUniform(unrestricted float scaleFactorX, unrestricted float scaleFactorY);
</span><span class="cx"> [Immutable] SVGMatrix rotate(unrestricted float angle);
</span><del>- [MayThrowLegacyException] SVGMatrix rotateFromVector(unrestricted float x, unrestricted float y);
</del><ins>+ [MayThrowException] SVGMatrix rotateFromVector(unrestricted float x, unrestricted float y);
</ins><span class="cx"> [Immutable] SVGMatrix flipX();
</span><span class="cx"> [Immutable] SVGMatrix flipY();
</span><span class="cx"> [Immutable] SVGMatrix skewX(unrestricted float angle);
</span><span class="cx"> [Immutable] SVGMatrix skewY(unrestricted float angle);
</span><span class="cx"> };
</span><del>-
</del></span></pre></div>
<a id="trunkSourceWebCoresvgSVGNumberListh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGNumberList.h (207715 => 207716)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGNumberList.h        2016-10-22 20:46:34 UTC (rev 207715)
+++ trunk/Source/WebCore/svg/SVGNumberList.h        2016-10-22 20:56:47 UTC (rev 207716)
</span><span class="lines">@@ -18,8 +18,7 @@
</span><span class="cx"> * Boston, MA 02110-1301, USA.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-#ifndef SVGNumberList_h
-#define SVGNumberList_h
</del><ins>+#pragma once
</ins><span class="cx">
</span><span class="cx"> #include "SVGPropertyTraits.h"
</span><span class="cx"> #include <wtf/Vector.h>
</span><span class="lines">@@ -28,14 +27,11 @@
</span><span class="cx">
</span><span class="cx"> class SVGNumberList final : public Vector<float> {
</span><span class="cx"> public:
</span><del>- SVGNumberList() { }
-
</del><span class="cx"> void parse(const String&);
</span><span class="cx"> String valueAsString() const;
</span><span class="cx"> };
</span><span class="cx">
</span><del>-template<>
-struct SVGPropertyTraits<SVGNumberList> {
</del><ins>+template<> struct SVGPropertyTraits<SVGNumberList> {
</ins><span class="cx"> typedef float ListItemType;
</span><span class="cx">
</span><span class="cx"> static SVGNumberList initialValue() { return SVGNumberList(); }
</span><span class="lines">@@ -43,5 +39,3 @@
</span><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span><del>-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCoresvgSVGNumberListidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGNumberList.idl (207715 => 207716)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGNumberList.idl        2016-10-22 20:46:34 UTC (rev 207715)
+++ trunk/Source/WebCore/svg/SVGNumberList.idl        2016-10-22 20:56:47 UTC (rev 207716)
</span><span class="lines">@@ -27,11 +27,11 @@
</span><span class="cx"> interface SVGNumberList {
</span><span class="cx"> readonly attribute unsigned long numberOfItems;
</span><span class="cx">
</span><del>- [MayThrowLegacyException] void clear();
- [MayThrowLegacyException] SVGNumber initialize(SVGNumber item);
- [MayThrowLegacyException] SVGNumber getItem(unsigned long index);
- [MayThrowLegacyException] SVGNumber insertItemBefore(SVGNumber item, unsigned long index);
- [MayThrowLegacyException] SVGNumber replaceItem(SVGNumber item, unsigned long index);
- [MayThrowLegacyException] SVGNumber removeItem(unsigned long index);
- [MayThrowLegacyException] SVGNumber appendItem(SVGNumber item);
</del><ins>+ [MayThrowException] void clear();
+ [MayThrowException] SVGNumber initialize(SVGNumber item);
+ [MayThrowException] SVGNumber getItem(unsigned long index);
+ [MayThrowException] SVGNumber insertItemBefore(SVGNumber item, unsigned long index);
+ [MayThrowException] SVGNumber replaceItem(SVGNumber item, unsigned long index);
+ [MayThrowException] SVGNumber removeItem(unsigned long index);
+ [MayThrowException] SVGNumber appendItem(SVGNumber item);
</ins><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGPaintcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGPaint.cpp (207715 => 207716)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGPaint.cpp        2016-10-22 20:46:34 UTC (rev 207715)
+++ trunk/Source/WebCore/svg/SVGPaint.cpp        2016-10-22 20:56:47 UTC (rev 207716)
</span><span class="lines">@@ -64,9 +64,9 @@
</span><span class="cx"> // The setters are the most problematic part so we remove the support for those first.
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void SVGPaint::setPaint(unsigned short, const String&, const String&, const String&, ExceptionCode& ec)
</del><ins>+ExceptionOr<void> SVGPaint::setPaint(unsigned short, const String&, const String&, const String&)
</ins><span class="cx"> {
</span><del>- ec = NO_MODIFICATION_ALLOWED_ERR;
</del><ins>+ return Exception { NO_MODIFICATION_ALLOWED_ERR };
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> String SVGPaint::customCSSText() const
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGPainth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGPaint.h (207715 => 207716)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGPaint.h        2016-10-22 20:46:34 UTC (rev 207715)
+++ trunk/Source/WebCore/svg/SVGPaint.h        2016-10-22 20:56:47 UTC (rev 207716)
</span><span class="lines">@@ -20,11 +20,9 @@
</span><span class="cx"> * Boston, MA 02110-1301, USA.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-#ifndef SVGPaint_h
-#define SVGPaint_h
</del><ins>+#pragma once
</ins><span class="cx">
</span><span class="cx"> #include "SVGColor.h"
</span><del>-#include <wtf/text/WTFString.h>
</del><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="lines">@@ -81,7 +79,7 @@
</span><span class="cx"> String uri() const { return m_uri; }
</span><span class="cx">
</span><span class="cx"> void setUri(const String&);
</span><del>- void setPaint(unsigned short paintType, const String& uri, const String& rgbColor, const String& iccColor, ExceptionCode&);
</del><ins>+ ExceptionOr<void> setPaint(unsigned short paintType, const String& uri, const String& rgbColor, const String& iccColor);
</ins><span class="cx">
</span><span class="cx"> String customCSSText() const;
</span><span class="cx">
</span><span class="lines">@@ -110,5 +108,3 @@
</span><span class="cx"> } // namespace WebCore
</span><span class="cx">
</span><span class="cx"> SPECIALIZE_TYPE_TRAITS_CSS_VALUE(SVGPaint, isSVGPaint())
</span><del>-
-#endif // SVGPaint_h
</del></span></pre></div>
<a id="trunkSourceWebCoresvgSVGPaintidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGPaint.idl (207715 => 207716)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGPaint.idl        2016-10-22 20:46:34 UTC (rev 207715)
+++ trunk/Source/WebCore/svg/SVGPaint.idl        2016-10-22 20:56:47 UTC (rev 207716)
</span><span class="lines">@@ -41,6 +41,5 @@
</span><span class="cx"> readonly attribute DOMString uri;
</span><span class="cx">
</span><span class="cx"> void setUri(DOMString uri);
</span><del>- [MayThrowLegacyException] void setPaint(unsigned short paintType, DOMString uri, DOMString rgbColor, DOMString iccColor);
</del><ins>+ [MayThrowException] void setPaint(unsigned short paintType, DOMString uri, DOMString rgbColor, DOMString iccColor);
</ins><span class="cx"> };
</span><del>-
</del></span></pre></div>
<a id="trunkSourceWebCoresvgSVGPathSegListh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGPathSegList.h (207715 => 207716)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGPathSegList.h        2016-10-22 20:46:34 UTC (rev 207715)
+++ trunk/Source/WebCore/svg/SVGPathSegList.h        2016-10-22 20:56:47 UTC (rev 207716)
</span><span class="lines">@@ -17,13 +17,11 @@
</span><span class="cx"> * Boston, MA 02110-1301, USA.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-#ifndef SVGPathSegList_h
-#define SVGPathSegList_h
</del><ins>+#pragma once
</ins><span class="cx">
</span><span class="cx"> #include "SVGListProperty.h"
</span><span class="cx"> #include "SVGPathSeg.h"
</span><span class="cx"> #include "SVGPropertyTraits.h"
</span><del>-
</del><span class="cx"> #include <wtf/Vector.h>
</span><span class="cx"> #include <wtf/text/WTFString.h>
</span><span class="cx">
</span><span class="lines">@@ -33,7 +31,7 @@
</span><span class="cx">
</span><span class="cx"> class SVGPathSegList : public Vector<RefPtr<SVGPathSeg>> {
</span><span class="cx"> public:
</span><del>- SVGPathSegList(SVGPathSegRole role)
</del><ins>+ explicit SVGPathSegList(SVGPathSegRole role)
</ins><span class="cx"> : m_role(role)
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="lines">@@ -47,12 +45,9 @@
</span><span class="cx"> SVGPathSegRole m_role;
</span><span class="cx"> };
</span><span class="cx">
</span><del>-template<>
-struct SVGPropertyTraits<SVGPathSegList> {
</del><ins>+template<> struct SVGPropertyTraits<SVGPathSegList> {
</ins><span class="cx"> static SVGPathSegList initialValue() { return SVGPathSegList(PathSegUndefinedRole); }
</span><span class="cx"> typedef RefPtr<SVGPathSeg> ListItemType;
</span><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span><del>-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCoresvgSVGPathSegListidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGPathSegList.idl (207715 => 207716)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGPathSegList.idl        2016-10-22 20:46:34 UTC (rev 207715)
+++ trunk/Source/WebCore/svg/SVGPathSegList.idl        2016-10-22 20:56:47 UTC (rev 207716)
</span><span class="lines">@@ -27,11 +27,11 @@
</span><span class="cx"> interface SVGPathSegList {
</span><span class="cx"> readonly attribute unsigned long numberOfItems;
</span><span class="cx">
</span><del>- [MayThrowLegacyException] void clear();
- [MayThrowLegacyException] SVGPathSeg initialize(SVGPathSeg? newItem); // FIXME: Should not be nullable.
- [MayThrowLegacyException] SVGPathSeg getItem(unsigned long index);
- [MayThrowLegacyException] SVGPathSeg insertItemBefore(SVGPathSeg? newItem, unsigned long index); // FIXME: Should not be nullable.
- [MayThrowLegacyException] SVGPathSeg replaceItem(SVGPathSeg? newItem, unsigned long index); // FIXME: Should not be nullable.
- [MayThrowLegacyException] SVGPathSeg removeItem(unsigned long index);
- [MayThrowLegacyException] SVGPathSeg appendItem(SVGPathSeg? newItem); // FIXME: Should not be nullable.
</del><ins>+ [MayThrowException] void clear();
+ [MayThrowException] SVGPathSeg initialize(SVGPathSeg? newItem); // FIXME: Should not be nullable.
+ [MayThrowException] SVGPathSeg getItem(unsigned long index);
+ [MayThrowException] SVGPathSeg insertItemBefore(SVGPathSeg? newItem, unsigned long index); // FIXME: Should not be nullable.
+ [MayThrowException] SVGPathSeg replaceItem(SVGPathSeg? newItem, unsigned long index); // FIXME: Should not be nullable.
+ [MayThrowException] SVGPathSeg removeItem(unsigned long index);
+ [MayThrowException] SVGPathSeg appendItem(SVGPathSeg? newItem); // FIXME: Should not be nullable.
</ins><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGPointListh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGPointList.h (207715 => 207716)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGPointList.h        2016-10-22 20:46:34 UTC (rev 207715)
+++ trunk/Source/WebCore/svg/SVGPointList.h        2016-10-22 20:56:47 UTC (rev 207716)
</span><span class="lines">@@ -18,8 +18,7 @@
</span><span class="cx"> * Boston, MA 02110-1301, USA.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-#ifndef SVGPointList_h
-#define SVGPointList_h
</del><ins>+#pragma once
</ins><span class="cx">
</span><span class="cx"> #include "SVGPoint.h"
</span><span class="cx"> #include "SVGPropertyTraits.h"
</span><span class="lines">@@ -29,17 +28,12 @@
</span><span class="cx">
</span><span class="cx"> class SVGPointList final : public Vector<SVGPoint> {
</span><span class="cx"> public:
</span><del>- SVGPointList() { }
-
</del><span class="cx"> String valueAsString() const;
</span><span class="cx"> };
</span><span class="cx">
</span><del>-template<>
-struct SVGPropertyTraits<SVGPointList> {
</del><ins>+template<> struct SVGPropertyTraits<SVGPointList> {
</ins><span class="cx"> static SVGPointList initialValue() { return SVGPointList(); }
</span><span class="cx"> typedef SVGPoint ListItemType;
</span><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span><del>-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCoresvgSVGPointListidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGPointList.idl (207715 => 207716)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGPointList.idl        2016-10-22 20:46:34 UTC (rev 207715)
+++ trunk/Source/WebCore/svg/SVGPointList.idl        2016-10-22 20:56:47 UTC (rev 207716)
</span><span class="lines">@@ -26,11 +26,11 @@
</span><span class="cx"> interface SVGPointList {
</span><span class="cx"> readonly attribute unsigned long numberOfItems;
</span><span class="cx">
</span><del>- [MayThrowLegacyException] void clear();
- [MayThrowLegacyException] SVGPoint initialize(SVGPoint item);
- [MayThrowLegacyException] SVGPoint getItem(unsigned long index);
- [MayThrowLegacyException] SVGPoint insertItemBefore(SVGPoint item, unsigned long index);
- [MayThrowLegacyException] SVGPoint replaceItem(SVGPoint item, unsigned long index);
- [MayThrowLegacyException] SVGPoint removeItem(unsigned long index);
- [MayThrowLegacyException] SVGPoint appendItem(SVGPoint item);
</del><ins>+ [MayThrowException] void clear();
+ [MayThrowException] SVGPoint initialize(SVGPoint item);
+ [MayThrowException] SVGPoint getItem(unsigned long index);
+ [MayThrowException] SVGPoint insertItemBefore(SVGPoint item, unsigned long index);
+ [MayThrowException] SVGPoint replaceItem(SVGPoint item, unsigned long index);
+ [MayThrowException] SVGPoint removeItem(unsigned long index);
+ [MayThrowException] SVGPoint appendItem(SVGPoint item);
</ins><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGPreserveAspectRatiocpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGPreserveAspectRatio.cpp (207715 => 207716)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGPreserveAspectRatio.cpp        2016-10-22 20:46:34 UTC (rev 207715)
+++ trunk/Source/WebCore/svg/SVGPreserveAspectRatio.cpp        2016-10-22 20:56:47 UTC (rev 207716)
</span><span class="lines">@@ -36,24 +36,22 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void SVGPreserveAspectRatio::setAlign(unsigned short align, ExceptionCode& ec)
</del><ins>+ExceptionOr<void> SVGPreserveAspectRatio::setAlign(unsigned short align)
</ins><span class="cx"> {
</span><del>- if (align == SVG_PRESERVEASPECTRATIO_UNKNOWN || align > SVG_PRESERVEASPECTRATIO_XMAXYMAX) {
- ec = NOT_SUPPORTED_ERR;
- return;
- }
</del><ins>+ if (align == SVG_PRESERVEASPECTRATIO_UNKNOWN || align > SVG_PRESERVEASPECTRATIO_XMAXYMAX)
+ return Exception { NOT_SUPPORTED_ERR };
</ins><span class="cx">
</span><span class="cx"> m_align = static_cast<SVGPreserveAspectRatioType>(align);
</span><ins>+ return { };
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void SVGPreserveAspectRatio::setMeetOrSlice(unsigned short meetOrSlice, ExceptionCode& ec)
</del><ins>+ExceptionOr<void> SVGPreserveAspectRatio::setMeetOrSlice(unsigned short meetOrSlice)
</ins><span class="cx"> {
</span><del>- if (meetOrSlice == SVG_MEETORSLICE_UNKNOWN || meetOrSlice > SVG_MEETORSLICE_SLICE) {
- ec = NOT_SUPPORTED_ERR;
- return;
- }
</del><ins>+ if (meetOrSlice == SVG_MEETORSLICE_UNKNOWN || meetOrSlice > SVG_MEETORSLICE_SLICE)
+ return Exception { NOT_SUPPORTED_ERR };
</ins><span class="cx">
</span><span class="cx"> m_meetOrSlice = static_cast<SVGMeetOrSliceType>(meetOrSlice);
</span><ins>+ return { };
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void SVGPreserveAspectRatio::parse(const String& value)
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGPreserveAspectRatioh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGPreserveAspectRatio.h (207715 => 207716)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGPreserveAspectRatio.h        2016-10-22 20:46:34 UTC (rev 207715)
+++ trunk/Source/WebCore/svg/SVGPreserveAspectRatio.h        2016-10-22 20:56:47 UTC (rev 207716)
</span><span class="lines">@@ -18,9 +18,9 @@
</span><span class="cx"> * Boston, MA 02110-1301, USA.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-#ifndef SVGPreserveAspectRatio_h
-#define SVGPreserveAspectRatio_h
</del><ins>+#pragma once
</ins><span class="cx">
</span><ins>+#include "ExceptionOr.h"
</ins><span class="cx"> #include "SVGPropertyTraits.h"
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -28,8 +28,6 @@
</span><span class="cx"> class AffineTransform;
</span><span class="cx"> class FloatRect;
</span><span class="cx">
</span><del>-typedef int ExceptionCode;
-
</del><span class="cx"> class SVGPreserveAspectRatio {
</span><span class="cx"> WTF_MAKE_FAST_ALLOCATED;
</span><span class="cx"> public:
</span><span class="lines">@@ -55,17 +53,15 @@
</span><span class="cx">
</span><span class="cx"> SVGPreserveAspectRatio();
</span><span class="cx">
</span><del>- void setAlign(unsigned short align, ExceptionCode&);
</del><ins>+ ExceptionOr<void> setAlign(unsigned short);
</ins><span class="cx"> unsigned short align() const { return m_align; }
</span><span class="cx">
</span><del>- void setMeetOrSlice(unsigned short, ExceptionCode&);
</del><ins>+ ExceptionOr<void> setMeetOrSlice(unsigned short);
</ins><span class="cx"> unsigned short meetOrSlice() const { return m_meetOrSlice; }
</span><span class="cx">
</span><span class="cx"> void transformRect(FloatRect& destRect, FloatRect& srcRect);
</span><span class="cx">
</span><del>- AffineTransform getCTM(float logicX, float logicY,
- float logicWidth, float logicHeight,
- float physWidth, float physHeight) const;
</del><ins>+ AffineTransform getCTM(float logicalX, float logicalY, float logicalWidth, float logicalHeight, float physicalWidth, float physicalHeight) const;
</ins><span class="cx">
</span><span class="cx"> void parse(const String&);
</span><span class="cx"> bool parse(const UChar*& currParam, const UChar* end, bool validate);
</span><span class="lines">@@ -79,12 +75,9 @@
</span><span class="cx"> bool parseInternal(const UChar*& currParam, const UChar* end, bool validate);
</span><span class="cx"> };
</span><span class="cx">
</span><del>-template<>
-struct SVGPropertyTraits<SVGPreserveAspectRatio> {
</del><ins>+template<> struct SVGPropertyTraits<SVGPreserveAspectRatio> {
</ins><span class="cx"> static SVGPreserveAspectRatio initialValue() { return SVGPreserveAspectRatio(); }
</span><span class="cx"> static String toString(const SVGPreserveAspectRatio& type) { return type.valueAsString(); }
</span><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span><del>-
-#endif // SVGPreserveAspectRatio_h
</del></span></pre></div>
<a id="trunkSourceWebCoresvgSVGPreserveAspectRatioidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGPreserveAspectRatio.idl (207715 => 207716)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGPreserveAspectRatio.idl        2016-10-22 20:46:34 UTC (rev 207715)
+++ trunk/Source/WebCore/svg/SVGPreserveAspectRatio.idl        2016-10-22 20:56:47 UTC (rev 207716)
</span><span class="lines">@@ -42,8 +42,6 @@
</span><span class="cx"> const unsigned short SVG_MEETORSLICE_MEET = 1;
</span><span class="cx"> const unsigned short SVG_MEETORSLICE_SLICE = 2;
</span><span class="cx">
</span><del>- [SetterMayThrowLegacyException] attribute unsigned short align;
-
- [SetterMayThrowLegacyException] attribute unsigned short meetOrSlice;
</del><ins>+ [SetterMayThrowException] attribute unsigned short align;
+ [SetterMayThrowException] attribute unsigned short meetOrSlice;
</ins><span class="cx"> };
</span><del>-
</del></span></pre></div>
<a id="trunkSourceWebCoresvgSVGSVGElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGSVGElement.cpp (207715 => 207716)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGSVGElement.cpp        2016-10-22 20:46:34 UTC (rev 207715)
+++ trunk/Source/WebCore/svg/SVGSVGElement.cpp        2016-10-22 20:56:47 UTC (rev 207716)
</span><span class="lines">@@ -153,7 +153,7 @@
</span><span class="cx"> SVGViewSpec& SVGSVGElement::currentView()
</span><span class="cx"> {
</span><span class="cx"> if (!m_viewSpec)
</span><del>- m_viewSpec = SVGViewSpec::create(this);
</del><ins>+ m_viewSpec = SVGViewSpec::create(*this);
</ins><span class="cx"> return *m_viewSpec;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGStringListh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGStringList.h (207715 => 207716)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGStringList.h        2016-10-22 20:46:34 UTC (rev 207715)
+++ trunk/Source/WebCore/svg/SVGStringList.h        2016-10-22 20:56:47 UTC (rev 207716)
</span><span class="lines">@@ -18,8 +18,7 @@
</span><span class="cx"> * Boston, MA 02110-1301, USA.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-#ifndef SVGStringList_h
-#define SVGStringList_h
</del><ins>+#pragma once
</ins><span class="cx">
</span><span class="cx"> #include "QualifiedName.h"
</span><span class="cx"> #include "SVGPropertyTraits.h"
</span><span class="lines">@@ -48,11 +47,8 @@
</span><span class="cx"> const QualifiedName& m_attributeName;
</span><span class="cx"> };
</span><span class="cx">
</span><del>-template<>
-struct SVGPropertyTraits<SVGStringList> {
</del><ins>+template<> struct SVGPropertyTraits<SVGStringList> {
</ins><span class="cx"> typedef String ListItemType;
</span><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span><del>-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCoresvgSVGStringListidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGStringList.idl (207715 => 207716)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGStringList.idl        2016-10-22 20:46:34 UTC (rev 207715)
+++ trunk/Source/WebCore/svg/SVGStringList.idl        2016-10-22 20:56:47 UTC (rev 207716)
</span><span class="lines">@@ -26,12 +26,11 @@
</span><span class="cx"> interface SVGStringList {
</span><span class="cx"> readonly attribute unsigned long numberOfItems;
</span><span class="cx">
</span><del>- [MayThrowLegacyException] void clear();
- [MayThrowLegacyException] DOMString initialize(DOMString item);
- [MayThrowLegacyException] DOMString getItem(unsigned long index);
- [MayThrowLegacyException] DOMString insertItemBefore(DOMString item, unsigned long index);
- [MayThrowLegacyException] DOMString replaceItem(DOMString item, unsigned long index);
- [MayThrowLegacyException] DOMString removeItem(unsigned long index);
- [MayThrowLegacyException] DOMString appendItem(DOMString item);
</del><ins>+ [MayThrowException] void clear();
+ [MayThrowException] DOMString initialize(DOMString item);
+ [MayThrowException] DOMString getItem(unsigned long index);
+ [MayThrowException] DOMString insertItemBefore(DOMString item, unsigned long index);
+ [MayThrowException] DOMString replaceItem(DOMString item, unsigned long index);
+ [MayThrowException] DOMString removeItem(unsigned long index);
+ [MayThrowException] DOMString appendItem(DOMString item);
</ins><span class="cx"> };
</span><del>-
</del></span></pre></div>
<a id="trunkSourceWebCoresvgSVGStyleElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGStyleElement.cpp (207715 => 207716)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGStyleElement.cpp        2016-10-22 20:46:34 UTC (rev 207715)
+++ trunk/Source/WebCore/svg/SVGStyleElement.cpp        2016-10-22 20:56:47 UTC (rev 207716)
</span><span class="lines">@@ -67,7 +67,7 @@
</span><span class="cx"> return n.isNull() ? defaultValue.get() : n;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void SVGStyleElement::setType(const AtomicString& type, ExceptionCode&)
</del><ins>+void SVGStyleElement::setType(const AtomicString& type)
</ins><span class="cx"> {
</span><span class="cx"> setAttribute(SVGNames::typeAttr, type);
</span><span class="cx"> }
</span><span class="lines">@@ -79,7 +79,7 @@
</span><span class="cx"> return n.isNull() ? defaultValue.get() : n;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void SVGStyleElement::setMedia(const AtomicString& media, ExceptionCode&)
</del><ins>+void SVGStyleElement::setMedia(const AtomicString& media)
</ins><span class="cx"> {
</span><span class="cx"> setAttributeWithoutSynchronization(SVGNames::mediaAttr, media);
</span><span class="cx"> }
</span><span class="lines">@@ -89,11 +89,6 @@
</span><span class="cx"> return attributeWithoutSynchronization(SVGNames::titleAttr);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void SVGStyleElement::setTitle(const AtomicString& title, ExceptionCode&)
-{
- setAttributeWithoutSynchronization(SVGNames::titleAttr, title);
-}
-
</del><span class="cx"> void SVGStyleElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
</span><span class="cx"> {
</span><span class="cx"> if (name == SVGNames::titleAttr) {
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGStyleElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGStyleElement.h (207715 => 207716)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGStyleElement.h        2016-10-22 20:46:34 UTC (rev 207715)
+++ trunk/Source/WebCore/svg/SVGStyleElement.h        2016-10-22 20:56:47 UTC (rev 207716)
</span><span class="lines">@@ -19,8 +19,7 @@
</span><span class="cx"> * Boston, MA 02110-1301, USA.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-#ifndef SVGStyleElement_h
-#define SVGStyleElement_h
</del><ins>+#pragma once
</ins><span class="cx">
</span><span class="cx"> #include "InlineStyleSheetOwner.h"
</span><span class="cx"> #include "SVGElement.h"
</span><span class="lines">@@ -38,14 +37,11 @@
</span><span class="cx"> void setDisabled(bool);
</span><span class="cx">
</span><span class="cx"> const AtomicString& type() const;
</span><del>- void setType(const AtomicString&, ExceptionCode&);
</del><ins>+ void setType(const AtomicString&);
</ins><span class="cx">
</span><span class="cx"> const AtomicString& media() const;
</span><del>- void setMedia(const AtomicString&, ExceptionCode&);
</del><ins>+ void setMedia(const AtomicString&);
</ins><span class="cx">
</span><del>- String title() const final;
- void setTitle(const AtomicString&, ExceptionCode&);
-
</del><span class="cx"> private:
</span><span class="cx"> SVGStyleElement(const QualifiedName&, Document&, bool createdByParser);
</span><span class="cx">
</span><span class="lines">@@ -63,10 +59,10 @@
</span><span class="cx"> void startLoadingDynamicSheet() final { m_styleSheetOwner.startLoadingDynamicSheet(*this); }
</span><span class="cx"> Timer* svgLoadEventTimer() final { return &m_svgLoadEventTimer; }
</span><span class="cx">
</span><ins>+ String title() const final;
+
</ins><span class="cx"> InlineStyleSheetOwner m_styleSheetOwner;
</span><span class="cx"> Timer m_svgLoadEventTimer;
</span><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span><del>-
-#endif // SVGStyleElement_h
</del></span></pre></div>
<a id="trunkSourceWebCoresvgSVGStyleElementidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGStyleElement.idl (207715 => 207716)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGStyleElement.idl        2016-10-22 20:46:34 UTC (rev 207715)
+++ trunk/Source/WebCore/svg/SVGStyleElement.idl        2016-10-22 20:56:47 UTC (rev 207716)
</span><span class="lines">@@ -25,9 +25,8 @@
</span><span class="cx"> */
</span><span class="cx">
</span><span class="cx"> interface SVGStyleElement : SVGElement {
</span><del>- attribute boolean disabled;
- [SetterMayThrowLegacyException] attribute DOMString type;
- [SetterMayThrowLegacyException] attribute DOMString media;
- [SetterMayThrowLegacyException] attribute DOMString title;
</del><ins>+ attribute boolean disabled;
+ attribute DOMString type;
+ attribute DOMString media;
+ [Reflect] attribute DOMString title;
</ins><span class="cx"> };
</span><del>-
</del></span></pre></div>
<a id="trunkSourceWebCoresvgSVGTextContentElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGTextContentElement.cpp (207715 => 207716)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGTextContentElement.cpp        2016-10-22 20:46:34 UTC (rev 207715)
+++ trunk/Source/WebCore/svg/SVGTextContentElement.cpp        2016-10-22 20:56:47 UTC (rev 207716)
</span><span class="lines">@@ -93,11 +93,10 @@
</span><span class="cx"> {
</span><span class="cx"> static NeverDestroyed<SVGLength> defaultTextLength(LengthModeOther);
</span><span class="cx"> if (m_specifiedTextLength == defaultTextLength)
</span><del>- m_textLength.value.newValueSpecifiedUnits(LengthTypeNumber, getComputedTextLength(), ASSERT_NO_EXCEPTION);
</del><ins>+ m_textLength.value.newValueSpecifiedUnits(LengthTypeNumber, getComputedTextLength());
</ins><span class="cx">
</span><span class="cx"> m_textLength.shouldSynchronize = true;
</span><span class="cx"> return static_reference_cast<SVGAnimatedLength>(lookupOrCreateTextLengthWrapper(this));
</span><del>-
</del><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> unsigned SVGTextContentElement::getNumberOfChars()
</span><span class="lines">@@ -112,65 +111,45 @@
</span><span class="cx"> return SVGTextQuery(renderer()).textLength();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-float SVGTextContentElement::getSubStringLength(unsigned charnum, unsigned nchars, ExceptionCode& ec)
</del><ins>+ExceptionOr<float> SVGTextContentElement::getSubStringLength(unsigned charnum, unsigned nchars)
</ins><span class="cx"> {
</span><del>- document().updateLayoutIgnorePendingStylesheets();
-
</del><span class="cx"> unsigned numberOfChars = getNumberOfChars();
</span><del>- if (charnum >= numberOfChars) {
- ec = INDEX_SIZE_ERR;
- return 0.0f;
- }
</del><ins>+ if (charnum >= numberOfChars)
+ return Exception { INDEX_SIZE_ERR };
</ins><span class="cx">
</span><span class="cx"> nchars = std::min(nchars, numberOfChars - charnum);
</span><span class="cx"> return SVGTextQuery(renderer()).subStringLength(charnum, nchars);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-SVGPoint SVGTextContentElement::getStartPositionOfChar(unsigned charnum, ExceptionCode& ec)
</del><ins>+ExceptionOr<SVGPoint> SVGTextContentElement::getStartPositionOfChar(unsigned charnum)
</ins><span class="cx"> {
</span><del>- document().updateLayoutIgnorePendingStylesheets();
</del><ins>+ if (charnum > getNumberOfChars())
+ return Exception { INDEX_SIZE_ERR };
</ins><span class="cx">
</span><del>- if (charnum > getNumberOfChars()) {
- ec = INDEX_SIZE_ERR;
- return SVGPoint();
- }
-
</del><span class="cx"> return SVGTextQuery(renderer()).startPositionOfCharacter(charnum);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-SVGPoint SVGTextContentElement::getEndPositionOfChar(unsigned charnum, ExceptionCode& ec)
</del><ins>+ExceptionOr<SVGPoint> SVGTextContentElement::getEndPositionOfChar(unsigned charnum)
</ins><span class="cx"> {
</span><del>- document().updateLayoutIgnorePendingStylesheets();
</del><ins>+ if (charnum > getNumberOfChars())
+ return Exception { INDEX_SIZE_ERR };
</ins><span class="cx">
</span><del>- if (charnum > getNumberOfChars()) {
- ec = INDEX_SIZE_ERR;
- return SVGPoint();
- }
-
</del><span class="cx"> return SVGTextQuery(renderer()).endPositionOfCharacter(charnum);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-FloatRect SVGTextContentElement::getExtentOfChar(unsigned charnum, ExceptionCode& ec)
</del><ins>+ExceptionOr<FloatRect> SVGTextContentElement::getExtentOfChar(unsigned charnum)
</ins><span class="cx"> {
</span><del>- document().updateLayoutIgnorePendingStylesheets();
</del><ins>+ if (charnum > getNumberOfChars())
+ return Exception { INDEX_SIZE_ERR };
</ins><span class="cx">
</span><del>- if (charnum > getNumberOfChars()) {
- ec = INDEX_SIZE_ERR;
- return FloatRect();
- }
-
</del><span class="cx"> return SVGTextQuery(renderer()).extentOfCharacter(charnum);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-float SVGTextContentElement::getRotationOfChar(unsigned charnum, ExceptionCode& ec)
</del><ins>+ExceptionOr<float> SVGTextContentElement::getRotationOfChar(unsigned charnum)
</ins><span class="cx"> {
</span><del>- document().updateLayoutIgnorePendingStylesheets();
</del><ins>+ if (charnum > getNumberOfChars())
+ return Exception { INDEX_SIZE_ERR };
</ins><span class="cx">
</span><del>- if (charnum > getNumberOfChars()) {
- ec = INDEX_SIZE_ERR;
- return 0.0f;
- }
-
</del><span class="cx"> return SVGTextQuery(renderer()).rotationOfCharacter(charnum);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -180,13 +159,11 @@
</span><span class="cx"> return SVGTextQuery(renderer()).characterNumberAtPosition(point);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void SVGTextContentElement::selectSubString(unsigned charnum, unsigned nchars, ExceptionCode& ec)
</del><ins>+ExceptionOr<void> SVGTextContentElement::selectSubString(unsigned charnum, unsigned nchars)
</ins><span class="cx"> {
</span><span class="cx"> unsigned numberOfChars = getNumberOfChars();
</span><del>- if (charnum >= numberOfChars) {
- ec = INDEX_SIZE_ERR;
- return;
- }
</del><ins>+ if (charnum >= numberOfChars)
+ return Exception { INDEX_SIZE_ERR };
</ins><span class="cx">
</span><span class="cx"> nchars = std::min(nchars, numberOfChars - charnum);
</span><span class="cx">
</span><span class="lines">@@ -205,6 +182,8 @@
</span><span class="cx"> end = end.next();
</span><span class="cx">
</span><span class="cx"> selection.setSelection(VisibleSelection(start, end));
</span><ins>+
+ return { };
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool SVGTextContentElement::isSupportedAttribute(const QualifiedName& attrName)
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGTextContentElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGTextContentElement.h (207715 => 207716)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGTextContentElement.h        2016-10-22 20:46:34 UTC (rev 207715)
+++ trunk/Source/WebCore/svg/SVGTextContentElement.h        2016-10-22 20:56:47 UTC (rev 207716)
</span><span class="lines">@@ -18,8 +18,7 @@
</span><span class="cx"> * Boston, MA 02110-1301, USA.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-#ifndef SVGTextContentElement_h
-#define SVGTextContentElement_h
</del><ins>+#pragma once
</ins><span class="cx">
</span><span class="cx"> #include "SVGAnimatedBoolean.h"
</span><span class="cx"> #include "SVGAnimatedEnumeration.h"
</span><span class="lines">@@ -35,8 +34,7 @@
</span><span class="cx"> SVGLengthAdjustSpacingAndGlyphs
</span><span class="cx"> };
</span><span class="cx">
</span><del>-template<>
-struct SVGPropertyTraits<SVGLengthAdjustType> {
</del><ins>+template<> struct SVGPropertyTraits<SVGLengthAdjustType> {
</ins><span class="cx"> static unsigned highestEnumValue() { return SVGLengthAdjustSpacingAndGlyphs; }
</span><span class="cx">
</span><span class="cx"> static String toString(SVGLengthAdjustType type)
</span><span class="lines">@@ -66,7 +64,6 @@
</span><span class="cx">
</span><span class="cx"> class SVGTextContentElement : public SVGGraphicsElement, public SVGExternalResourcesRequired {
</span><span class="cx"> public:
</span><del>- // Forward declare enumerations in the W3C naming scheme, for IDL generation.
</del><span class="cx"> enum {
</span><span class="cx"> LENGTHADJUST_UNKNOWN = SVGLengthAdjustUnknown,
</span><span class="cx"> LENGTHADJUST_SPACING = SVGLengthAdjustSpacing,
</span><span class="lines">@@ -75,13 +72,13 @@
</span><span class="cx">
</span><span class="cx"> unsigned getNumberOfChars();
</span><span class="cx"> float getComputedTextLength();
</span><del>- float getSubStringLength(unsigned charnum, unsigned nchars, ExceptionCode&);
- SVGPoint getStartPositionOfChar(unsigned charnum, ExceptionCode&);
- SVGPoint getEndPositionOfChar(unsigned charnum, ExceptionCode&);
- FloatRect getExtentOfChar(unsigned charnum, ExceptionCode&);
- float getRotationOfChar(unsigned charnum, ExceptionCode&);
</del><ins>+ ExceptionOr<float> getSubStringLength(unsigned charnum, unsigned nchars);
+ ExceptionOr<SVGPoint> getStartPositionOfChar(unsigned charnum);
+ ExceptionOr<SVGPoint> getEndPositionOfChar(unsigned charnum);
+ ExceptionOr<FloatRect> getExtentOfChar(unsigned charnum);
+ ExceptionOr<float> getRotationOfChar(unsigned charnum);
</ins><span class="cx"> int getCharNumAtPosition(const SVGPoint&);
</span><del>- void selectSubString(unsigned charnum, unsigned nchars, ExceptionCode&);
</del><ins>+ ExceptionOr<void> selectSubString(unsigned charnum, unsigned nchars);
</ins><span class="cx">
</span><span class="cx"> static SVGTextContentElement* elementFromRenderer(RenderObject*);
</span><span class="cx">
</span><span class="lines">@@ -126,5 +123,3 @@
</span><span class="cx"> static bool isType(const WebCore::SVGElement& element) { return element.isTextContent(); }
</span><span class="cx"> static bool isType(const WebCore::Node& node) { return is<WebCore::SVGElement>(node) && isType(downcast<WebCore::SVGElement>(node)); }
</span><span class="cx"> SPECIALIZE_TYPE_TRAITS_END()
</span><del>-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCoresvgSVGTextContentElementidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGTextContentElement.idl (207715 => 207716)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGTextContentElement.idl        2016-10-22 20:46:34 UTC (rev 207715)
+++ trunk/Source/WebCore/svg/SVGTextContentElement.idl        2016-10-22 20:56:47 UTC (rev 207716)
</span><span class="lines">@@ -25,23 +25,22 @@
</span><span class="cx">
</span><span class="cx"> interface SVGTextContentElement : SVGGraphicsElement {
</span><span class="cx"> // lengthAdjust Types
</span><del>- const unsigned short LENGTHADJUST_UNKNOWN = 0;
- const unsigned short LENGTHADJUST_SPACING = 1;
</del><ins>+ const unsigned short LENGTHADJUST_UNKNOWN = 0;
+ const unsigned short LENGTHADJUST_SPACING = 1;
</ins><span class="cx"> const unsigned short LENGTHADJUST_SPACINGANDGLYPHS = 2;
</span><span class="cx">
</span><del>- readonly attribute SVGAnimatedLength textLength;
</del><ins>+ readonly attribute SVGAnimatedLength textLength;
</ins><span class="cx"> readonly attribute SVGAnimatedEnumeration lengthAdjust;
</span><span class="cx">
</span><span class="cx"> long getNumberOfChars();
</span><span class="cx"> unrestricted float getComputedTextLength();
</span><del>- [MayThrowLegacyException] unrestricted float getSubStringLength(optional unsigned long offset = 0,
- optional unsigned long length = 0);
- [MayThrowLegacyException] SVGPoint getStartPositionOfChar(optional unsigned long offset = 0);
- [MayThrowLegacyException] SVGPoint getEndPositionOfChar(optional unsigned long offset = 0);
- [MayThrowLegacyException] SVGRect getExtentOfChar(optional unsigned long offset = 0);
- [MayThrowLegacyException] unrestricted float getRotationOfChar(optional unsigned long offset = 0);
</del><ins>+ [MayThrowException] unrestricted float getSubStringLength(optional unsigned long offset = 0, optional unsigned long length = 0);
+ [MayThrowException] SVGPoint getStartPositionOfChar(optional unsigned long offset = 0);
+ [MayThrowException] SVGPoint getEndPositionOfChar(optional unsigned long offset = 0);
+ [MayThrowException] SVGRect getExtentOfChar(optional unsigned long offset = 0);
+ [MayThrowException] unrestricted float getRotationOfChar(optional unsigned long offset = 0);
</ins><span class="cx"> long getCharNumAtPosition(SVGPoint point);
</span><del>- [MayThrowLegacyException] void selectSubString(optional unsigned long offset = 0, optional unsigned long length = 0);
</del><ins>+ [MayThrowException] void selectSubString(optional unsigned long offset = 0, optional unsigned long length = 0);
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> // FIXME: SVGTextContentElement is not supposed to implement SVGExternalResourcesRequired.
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGTransformListh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGTransformList.h (207715 => 207716)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGTransformList.h        2016-10-22 20:46:34 UTC (rev 207715)
+++ trunk/Source/WebCore/svg/SVGTransformList.h        2016-10-22 20:56:47 UTC (rev 207716)
</span><span class="lines">@@ -18,8 +18,7 @@
</span><span class="cx"> * Boston, MA 02110-1301, USA.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-#ifndef SVGTransformList_h
-#define SVGTransformList_h
</del><ins>+#pragma once
</ins><span class="cx">
</span><span class="cx"> #include "SVGPropertyTraits.h"
</span><span class="cx"> #include "SVGTransform.h"
</span><span class="lines">@@ -29,12 +28,9 @@
</span><span class="cx">
</span><span class="cx"> class SVGTransformList final : public Vector<SVGTransform, 1> {
</span><span class="cx"> public:
</span><del>- SVGTransformList() { }
-
</del><span class="cx"> SVGTransform createSVGTransformFromMatrix(const SVGMatrix&) const;
</span><span class="cx"> SVGTransform consolidate();
</span><span class="cx">
</span><del>- // Internal use only
</del><span class="cx"> bool concatenate(AffineTransform& result) const;
</span><span class="cx">
</span><span class="cx"> String valueAsString() const;
</span><span class="lines">@@ -41,8 +37,7 @@
</span><span class="cx"> void parse(const String&);
</span><span class="cx"> };
</span><span class="cx">
</span><del>-template<>
-struct SVGPropertyTraits<SVGTransformList> {
</del><ins>+template<> struct SVGPropertyTraits<SVGTransformList> {
</ins><span class="cx"> static SVGTransformList initialValue() { return SVGTransformList(); }
</span><span class="cx"> static String toString(const SVGTransformList& type) { return type.valueAsString(); }
</span><span class="cx"> typedef SVGTransform ListItemType;
</span><span class="lines">@@ -49,5 +44,3 @@
</span><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span><del>-
-#endif // SVGTransformList_h
</del></span></pre></div>
<a id="trunkSourceWebCoresvgSVGTransformListidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGTransformList.idl (207715 => 207716)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGTransformList.idl        2016-10-22 20:46:34 UTC (rev 207715)
+++ trunk/Source/WebCore/svg/SVGTransformList.idl        2016-10-22 20:56:47 UTC (rev 207716)
</span><span class="lines">@@ -27,15 +27,15 @@
</span><span class="cx"> interface SVGTransformList {
</span><span class="cx"> readonly attribute unsigned long numberOfItems;
</span><span class="cx">
</span><del>- [MayThrowLegacyException] void clear();
- [MayThrowLegacyException] SVGTransform initialize(SVGTransform item);
- [MayThrowLegacyException] SVGTransform getItem(unsigned long index);
- [MayThrowLegacyException] SVGTransform insertItemBefore(SVGTransform item, unsigned long index);
- [MayThrowLegacyException] SVGTransform replaceItem(SVGTransform item, unsigned long index);
- [MayThrowLegacyException] SVGTransform removeItem(unsigned long index);
- [MayThrowLegacyException] SVGTransform appendItem(SVGTransform item);
</del><ins>+ [MayThrowException] void clear();
+ [MayThrowException] SVGTransform initialize(SVGTransform item);
+ [MayThrowException] SVGTransform getItem(unsigned long index);
+ [MayThrowException] SVGTransform insertItemBefore(SVGTransform item, unsigned long index);
+ [MayThrowException] SVGTransform replaceItem(SVGTransform item, unsigned long index);
+ [MayThrowException] SVGTransform removeItem(unsigned long index);
+ [MayThrowException] SVGTransform appendItem(SVGTransform item);
</ins><span class="cx">
</span><del>- [MayThrowLegacyException] SVGTransform createSVGTransformFromMatrix(SVGMatrix matrix);
</del><ins>+ [MayThrowException] SVGTransform createSVGTransformFromMatrix(SVGMatrix matrix);
</ins><span class="cx">
</span><del>- [MayThrowLegacyException] SVGTransform consolidate();
</del><ins>+ [MayThrowException] SVGTransform consolidate();
</ins><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGViewSpeccpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGViewSpec.cpp (207715 => 207716)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGViewSpec.cpp        2016-10-22 20:46:34 UTC (rev 207715)
+++ trunk/Source/WebCore/svg/SVGViewSpec.cpp        2016-10-22 20:56:47 UTC (rev 207716)
</span><span class="lines">@@ -75,11 +75,9 @@
</span><span class="cx"> return s_propertyInfo;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-SVGViewSpec::SVGViewSpec(SVGElement* contextElement)
- : m_contextElement(contextElement)
- , m_zoomAndPan(SVGZoomAndPanMagnify)
</del><ins>+SVGViewSpec::SVGViewSpec(SVGElement& contextElement)
+ : m_contextElement(&contextElement)
</ins><span class="cx"> {
</span><del>- ASSERT(m_contextElement);
</del><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> const AtomicString& SVGViewSpec::viewBoxIdentifier()
</span><span class="lines">@@ -100,26 +98,12 @@
</span><span class="cx"> return s_identifier;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void SVGViewSpec::setZoomAndPan(unsigned short, ExceptionCode& ec)
</del><ins>+ExceptionOr<void> SVGViewSpec::setZoomAndPan(unsigned short)
</ins><span class="cx"> {
</span><span class="cx"> // SVGViewSpec and all of its content is read-only.
</span><del>- ec = NO_MODIFICATION_ALLOWED_ERR;
</del><ins>+ return Exception { NO_MODIFICATION_ALLOWED_ERR };
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void SVGViewSpec::setTransformString(const String& transform)
-{
- if (!m_contextElement)
- return;
-
- SVGTransformList newList;
- newList.parse(transform);
-
- if (auto wrapper = SVGAnimatedProperty::lookupWrapper<SVGElement, SVGAnimatedTransformList>(m_contextElement, transformPropertyInfo()))
- static_pointer_cast<SVGAnimatedTransformList>(wrapper)->detachListWrappers(newList.size());
-
- m_transform = newList;
-}
-
</del><span class="cx"> String SVGViewSpec::transformString() const
</span><span class="cx"> {
</span><span class="cx"> return SVGPropertyTraits<SVGTransformList>::toString(m_transform);
</span><span class="lines">@@ -127,12 +111,12 @@
</span><span class="cx">
</span><span class="cx"> String SVGViewSpec::viewBoxString() const
</span><span class="cx"> {
</span><del>- return SVGPropertyTraits<FloatRect>::toString(viewBoxBaseValue());
</del><ins>+ return SVGPropertyTraits<FloatRect>::toString(m_viewBox);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> String SVGViewSpec::preserveAspectRatioString() const
</span><span class="cx"> {
</span><del>- return SVGPropertyTraits<SVGPreserveAspectRatio>::toString(preserveAspectRatioBaseValue());
</del><ins>+ return SVGPropertyTraits<SVGPreserveAspectRatio>::toString(m_preserveAspectRatio);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> SVGElement* SVGViewSpec::viewTarget() const
</span><span class="lines">@@ -139,8 +123,8 @@
</span><span class="cx"> {
</span><span class="cx"> if (!m_contextElement)
</span><span class="cx"> return nullptr;
</span><del>- Element* element = m_contextElement->treeScope().getElementById(m_viewTargetString);
- if (!element || !element->isSVGElement())
</del><ins>+ auto* element = m_contextElement->treeScope().getElementById(m_viewTargetString);
+ if (!is<SVGElement>(element))
</ins><span class="cx"> return nullptr;
</span><span class="cx"> return downcast<SVGElement>(element);
</span><span class="cx"> }
</span><span class="lines">@@ -170,22 +154,22 @@
</span><span class="cx"> Ref<SVGAnimatedProperty> SVGViewSpec::lookupOrCreateViewBoxWrapper(SVGViewSpec* ownerType)
</span><span class="cx"> {
</span><span class="cx"> ASSERT(ownerType);
</span><del>- ASSERT(ownerType->contextElement());
- return SVGAnimatedProperty::lookupOrCreateWrapper<SVGElement, SVGAnimatedRect, FloatRect>(ownerType->contextElement(), viewBoxPropertyInfo(), ownerType->m_viewBox);
</del><ins>+ ASSERT(ownerType->m_contextElement);
+ return SVGAnimatedProperty::lookupOrCreateWrapper<SVGElement, SVGAnimatedRect, FloatRect>(ownerType->m_contextElement, viewBoxPropertyInfo(), ownerType->m_viewBox);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> Ref<SVGAnimatedProperty> SVGViewSpec::lookupOrCreatePreserveAspectRatioWrapper(SVGViewSpec* ownerType)
</span><span class="cx"> {
</span><span class="cx"> ASSERT(ownerType);
</span><del>- ASSERT(ownerType->contextElement());
- return SVGAnimatedProperty::lookupOrCreateWrapper<SVGElement, SVGAnimatedPreserveAspectRatio, SVGPreserveAspectRatio>(ownerType->contextElement(), preserveAspectRatioPropertyInfo(), ownerType->m_preserveAspectRatio);
</del><ins>+ ASSERT(ownerType->m_contextElement);
+ return SVGAnimatedProperty::lookupOrCreateWrapper<SVGElement, SVGAnimatedPreserveAspectRatio, SVGPreserveAspectRatio>(ownerType->m_contextElement, preserveAspectRatioPropertyInfo(), ownerType->m_preserveAspectRatio);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> Ref<SVGAnimatedProperty> SVGViewSpec::lookupOrCreateTransformWrapper(SVGViewSpec* ownerType)
</span><span class="cx"> {
</span><span class="cx"> ASSERT(ownerType);
</span><del>- ASSERT(ownerType->contextElement());
- return SVGAnimatedProperty::lookupOrCreateWrapper<SVGElement, SVGAnimatedTransformList, SVGTransformList>(ownerType->contextElement(), transformPropertyInfo(), ownerType->m_transform);
</del><ins>+ ASSERT(ownerType->m_contextElement);
+ return SVGAnimatedProperty::lookupOrCreateWrapper<SVGElement, SVGAnimatedTransformList, SVGTransformList>(ownerType->m_contextElement, transformPropertyInfo(), ownerType->m_transform);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void SVGViewSpec::reset()
</span><span class="lines">@@ -241,7 +225,7 @@
</span><span class="cx"> currViewSpec++;
</span><span class="cx"> if (currViewSpec >= end)
</span><span class="cx"> return false;
</span><del>- setViewTargetString(String(viewTargetStart, currViewSpec - viewTargetStart));
</del><ins>+ m_viewTargetString = String(viewTargetStart, currViewSpec - viewTargetStart);
</ins><span class="cx"> currViewSpec++;
</span><span class="cx"> } else
</span><span class="cx"> return false;
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGViewSpech"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGViewSpec.h (207715 => 207716)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGViewSpec.h        2016-10-22 20:46:34 UTC (rev 207715)
+++ trunk/Source/WebCore/svg/SVGViewSpec.h        2016-10-22 20:56:47 UTC (rev 207716)
</span><span class="lines">@@ -17,8 +17,7 @@
</span><span class="cx"> * Boston, MA 02110-1301, USA.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-#ifndef SVGViewSpec_h
-#define SVGViewSpec_h
</del><ins>+#pragma once
</ins><span class="cx">
</span><span class="cx"> #include "SVGAnimatedPreserveAspectRatio.h"
</span><span class="cx"> #include "SVGAnimatedRect.h"
</span><span class="lines">@@ -31,16 +30,9 @@
</span><span class="cx"> class SVGElement;
</span><span class="cx"> class SVGTransformListPropertyTearOff;
</span><span class="cx">
</span><del>-class SVGViewSpec final : public RefCounted<SVGViewSpec>
- , public SVGZoomAndPan
- , public SVGFitToViewBox {
</del><ins>+class SVGViewSpec final : public RefCounted<SVGViewSpec>, public SVGZoomAndPan, public SVGFitToViewBox {
</ins><span class="cx"> public:
</span><del>- virtual ~SVGViewSpec() { }
-
- using RefCounted<SVGViewSpec>::ref;
- using RefCounted<SVGViewSpec>::deref;
-
- static Ref<SVGViewSpec> create(SVGElement* contextElement)
</del><ins>+ static Ref<SVGViewSpec> create(SVGElement& contextElement)
</ins><span class="cx"> {
</span><span class="cx"> return adoptRef(*new SVGViewSpec(contextElement));
</span><span class="cx"> }
</span><span class="lines">@@ -49,22 +41,16 @@
</span><span class="cx"> void reset();
</span><span class="cx">
</span><span class="cx"> SVGElement* viewTarget() const;
</span><ins>+
+ String transformString() const;
</ins><span class="cx"> String viewBoxString() const;
</span><del>-
</del><span class="cx"> String preserveAspectRatioString() const;
</span><ins>+ const String& viewTargetString() const { return m_viewTargetString; }
</ins><span class="cx">
</span><del>- void setTransformString(const String&);
- String transformString() const;
-
- void setViewTargetString(const String& string) { m_viewTargetString = string; }
- String viewTargetString() const { return m_viewTargetString; }
-
</del><span class="cx"> SVGZoomAndPanType zoomAndPan() const { return m_zoomAndPan; }
</span><del>- void setZoomAndPan(unsigned short zoomAndPan) { setZoomAndPanBaseValue(zoomAndPan); }
- void setZoomAndPan(unsigned short, ExceptionCode&);
</del><ins>+ ExceptionOr<void> setZoomAndPan(unsigned short);
</ins><span class="cx"> void setZoomAndPanBaseValue(unsigned short zoomAndPan) { m_zoomAndPan = SVGZoomAndPan::parseFromNumber(zoomAndPan); }
</span><span class="cx">
</span><del>- SVGElement* contextElement() const { return m_contextElement; }
</del><span class="cx"> void resetContextElement() { m_contextElement = nullptr; }
</span><span class="cx">
</span><span class="cx"> // Custom non-animated 'transform' property.
</span><span class="lines">@@ -74,17 +60,15 @@
</span><span class="cx"> // Custom animated 'viewBox' property.
</span><span class="cx"> RefPtr<SVGAnimatedRect> viewBoxAnimated();
</span><span class="cx"> FloatRect& viewBox() { return m_viewBox; }
</span><del>- FloatRect viewBoxBaseValue() const { return m_viewBox; }
</del><span class="cx"> void setViewBoxBaseValue(const FloatRect& viewBox) { m_viewBox = viewBox; }
</span><span class="cx">
</span><span class="cx"> // Custom animated 'preserveAspectRatio' property.
</span><span class="cx"> RefPtr<SVGAnimatedPreserveAspectRatio> preserveAspectRatioAnimated();
</span><span class="cx"> SVGPreserveAspectRatio& preserveAspectRatio() { return m_preserveAspectRatio; }
</span><del>- SVGPreserveAspectRatio preserveAspectRatioBaseValue() const { return m_preserveAspectRatio; }
</del><span class="cx"> void setPreserveAspectRatioBaseValue(const SVGPreserveAspectRatio& preserveAspectRatio) { m_preserveAspectRatio = preserveAspectRatio; }
</span><span class="cx">
</span><span class="cx"> private:
</span><del>- SVGViewSpec(SVGElement*);
</del><ins>+ explicit SVGViewSpec(SVGElement&);
</ins><span class="cx">
</span><span class="cx"> static const SVGPropertyInfo* transformPropertyInfo();
</span><span class="cx"> static const SVGPropertyInfo* viewBoxPropertyInfo();
</span><span class="lines">@@ -99,8 +83,7 @@
</span><span class="cx"> static Ref<SVGAnimatedProperty> lookupOrCreatePreserveAspectRatioWrapper(SVGViewSpec* contextElement);
</span><span class="cx">
</span><span class="cx"> SVGElement* m_contextElement;
</span><del>- SVGZoomAndPanType m_zoomAndPan;
-
</del><ins>+ SVGZoomAndPanType m_zoomAndPan { SVGZoomAndPanMagnify };
</ins><span class="cx"> SVGTransformList m_transform;
</span><span class="cx"> FloatRect m_viewBox;
</span><span class="cx"> SVGPreserveAspectRatio m_preserveAspectRatio;
</span><span class="lines">@@ -108,5 +91,3 @@
</span><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span><del>-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCoresvgSVGViewSpecidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGViewSpec.idl (207715 => 207716)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGViewSpec.idl        2016-10-22 20:46:34 UTC (rev 207715)
+++ trunk/Source/WebCore/svg/SVGViewSpec.idl        2016-10-22 20:56:47 UTC (rev 207716)
</span><span class="lines">@@ -26,17 +26,18 @@
</span><span class="cx"> // SVGViewSpec intentionally doesn't inherit from SVGZoomAndPan & SVGFitToViewBox on the IDLs.
</span><span class="cx"> // It would require that any of those classes would be RefCounted, and we want to avoid that.
</span><span class="cx"> [
</span><del>- JSGenerateToJSObject
</del><ins>+ ImplementationLacksVTable,
+ JSGenerateToJSObject,
</ins><span class="cx"> ] interface SVGViewSpec {
</span><del>- readonly attribute SVGTransformList transform;
- readonly attribute SVGElement viewTarget;
- readonly attribute DOMString viewBoxString;
- readonly attribute DOMString preserveAspectRatioString;
- readonly attribute DOMString transformString;
- readonly attribute DOMString viewTargetString;
</del><ins>+ readonly attribute SVGTransformList transform;
+ readonly attribute SVGElement viewTarget;
+ readonly attribute DOMString viewBoxString;
+ readonly attribute DOMString preserveAspectRatioString;
+ readonly attribute DOMString transformString;
+ readonly attribute DOMString viewTargetString;
</ins><span class="cx">
</span><del>- // SVGZoomAndPan
- [SetterMayThrowLegacyException] attribute unsigned short zoomAndPan;
</del><ins>+ // SVGZoomAndPan
+ [SetterMayThrowException] attribute unsigned short zoomAndPan;
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> SVGViewSpec implements SVGFitToViewBox;
</span></span></pre></div>
<a id="trunkSourceWebCoresvgpropertiesSVGAnimatedEnumerationPropertyTearOffh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/properties/SVGAnimatedEnumerationPropertyTearOff.h (207715 => 207716)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/properties/SVGAnimatedEnumerationPropertyTearOff.h        2016-10-22 20:46:34 UTC (rev 207715)
+++ trunk/Source/WebCore/svg/properties/SVGAnimatedEnumerationPropertyTearOff.h        2016-10-22 20:56:47 UTC (rev 207716)
</span><span class="lines">@@ -49,14 +49,12 @@
</span><span class="cx"> return animVal;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- void setBaseVal(const unsigned& property, ExceptionCode& ec) final
</del><ins>+ ExceptionOr<void> setBaseVal(const unsigned& property) final
</ins><span class="cx"> {
</span><span class="cx"> // All SVG enumeration values, that are allowed to be set via SVG DOM start with 1, 0 corresponds to unknown and is not settable through SVG DOM.
</span><del>- if (!property || property > SVGIDLEnumLimits<EnumType>::highestExposedEnumValue()) {
- ec = SVGException::SVG_INVALID_VALUE_ERR;
- return;
- }
- SVGAnimatedStaticPropertyTearOff<unsigned>::setBaseVal(property, ec);
</del><ins>+ if (!property || property > SVGIDLEnumLimits<EnumType>::highestExposedEnumValue())
+ return Exception { SVGException::SVG_INVALID_VALUE_ERR };
+ return SVGAnimatedStaticPropertyTearOff<unsigned>::setBaseVal(property);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> static Ref<SVGAnimatedEnumerationPropertyTearOff<EnumType>> create(SVGElement* contextElement, const QualifiedName& attributeName, AnimatedPropertyType animatedPropertyType, EnumType& property)
</span></span></pre></div>
<a id="trunkSourceWebCoresvgpropertiesSVGAnimatedStaticPropertyTearOffh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/properties/SVGAnimatedStaticPropertyTearOff.h (207715 => 207716)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/properties/SVGAnimatedStaticPropertyTearOff.h        2016-10-22 20:46:34 UTC (rev 207715)
+++ trunk/Source/WebCore/svg/properties/SVGAnimatedStaticPropertyTearOff.h        2016-10-22 20:56:47 UTC (rev 207716)
</span><span class="lines">@@ -18,10 +18,9 @@
</span><span class="cx"> * Boston, MA 02110-1301, USA.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-#ifndef SVGAnimatedStaticPropertyTearOff_h
-#define SVGAnimatedStaticPropertyTearOff_h
</del><ins>+#pragma once
</ins><span class="cx">
</span><del>-#include "ExceptionCode.h"
</del><ins>+#include "ExceptionOr.h"
</ins><span class="cx"> #include "SVGAnimatedProperty.h"
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -43,10 +42,11 @@
</span><span class="cx"> return m_property;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- virtual void setBaseVal(const PropertyType& property, ExceptionCode&)
</del><ins>+ virtual ExceptionOr<void> setBaseVal(const PropertyType& property)
</ins><span class="cx"> {
</span><span class="cx"> m_property = property;
</span><span class="cx"> commitChange();
</span><ins>+ return { };
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool isAnimating() const override { return m_animatedProperty; }
</span><span class="lines">@@ -107,5 +107,3 @@
</span><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> }
</span><del>-
-#endif // SVGAnimatedStaticPropertyTearOff_h
</del></span></pre></div>
<a id="trunkSourceWebCoresvgpropertiesSVGListPropertyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/properties/SVGListProperty.h (207715 => 207716)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/properties/SVGListProperty.h        2016-10-22 20:46:34 UTC (rev 207715)
+++ trunk/Source/WebCore/svg/properties/SVGListProperty.h        2016-10-22 20:56:47 UTC (rev 207716)
</span><span class="lines">@@ -17,8 +17,7 @@
</span><span class="cx"> * Boston, MA 02110-1301, USA.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-#ifndef SVGListProperty_h
-#define SVGListProperty_h
</del><ins>+#pragma once
</ins><span class="cx">
</span><span class="cx"> #include "SVGException.h"
</span><span class="cx"> #include "SVGPropertyTearOff.h"
</span><span class="lines">@@ -42,18 +41,16 @@
</span><span class="cx"> public:
</span><span class="cx"> typedef SVGListProperty<PropertyType> Self;
</span><span class="cx">
</span><del>- typedef typename SVGPropertyTraits<PropertyType>::ListItemType ListItemType;
- typedef SVGPropertyTearOff<ListItemType> ListItemTearOff;
- typedef RefPtr<ListItemTearOff> PtrListItemTearOff;
- typedef SVGAnimatedListPropertyTearOff<PropertyType> AnimatedListPropertyTearOff;
- typedef typename SVGAnimatedListPropertyTearOff<PropertyType>::ListWrapperCache ListWrapperCache;
</del><ins>+ using ListItemType = typename SVGPropertyTraits<PropertyType>::ListItemType;
+ using ListItemTearOff = SVGPropertyTearOff<ListItemType>;
+ using PtrListItemTearOff = RefPtr<ListItemTearOff>;
+ using AnimatedListPropertyTearOff = SVGAnimatedListPropertyTearOff<PropertyType>;
+ using ListWrapperCache = typename AnimatedListPropertyTearOff::ListWrapperCache;
</ins><span class="cx">
</span><del>- bool canAlterList(ExceptionCode& ec) const
</del><ins>+ ExceptionOr<bool> canAlterList() const
</ins><span class="cx"> {
</span><del>- if (m_role == AnimValRole) {
- ec = NO_MODIFICATION_ALLOWED_ERR;
- return false;
- }
</del><ins>+ if (m_role == AnimValRole)
+ return Exception { NO_MODIFICATION_ALLOWED_ERR };
</ins><span class="cx">
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="lines">@@ -95,23 +92,31 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // SVGList::clear()
</span><del>- void clearValues(ExceptionCode& ec)
</del><ins>+ ExceptionOr<void> clearValues()
</ins><span class="cx"> {
</span><del>- if (!canAlterList(ec))
- return;
</del><ins>+ auto result = canAlterList();
+ if (result.hasException())
+ return result.releaseException();
+ if (!result.releaseReturnValue())
+ return { };
</ins><span class="cx">
</span><span class="cx"> m_values->clear();
</span><span class="cx"> commitChange();
</span><ins>+ return { };
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- void clearValuesAndWrappers(ExceptionCode& ec)
</del><ins>+ ExceptionOr<void> clearValuesAndWrappers()
</ins><span class="cx"> {
</span><del>- if (!canAlterList(ec))
- return;
</del><ins>+ auto result = canAlterList();
+ if (result.hasException())
+ return result.releaseException();
+ if (!result.releaseReturnValue())
+ return { };
</ins><span class="cx">
</span><span class="cx"> detachListWrappers(0);
</span><span class="cx"> m_values->clear();
</span><span class="cx"> commitChange();
</span><ins>+ return { };
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // SVGList::numberOfItems()
</span><span class="lines">@@ -121,10 +126,13 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // SVGList::initialize()
</span><del>- ListItemType initializeValues(const ListItemType& newItem, ExceptionCode& ec)
</del><ins>+ ExceptionOr<ListItemType> initializeValues(const ListItemType& newItem)
</ins><span class="cx"> {
</span><del>- if (!canAlterList(ec))
- return ListItemType();
</del><ins>+ auto result = canAlterList();
+ if (result.hasException())
+ return result.releaseException();
+ if (!result.releaseReturnValue())
+ return ListItemType { };
</ins><span class="cx">
</span><span class="cx"> // Spec: If the inserted item is already in a list, it is removed from its previous list before it is inserted into this list.
</span><span class="cx"> processIncomingListItemValue(newItem, 0);
</span><span class="lines">@@ -134,20 +142,22 @@
</span><span class="cx"> m_values->append(newItem);
</span><span class="cx">
</span><span class="cx"> commitChange();
</span><del>- return newItem;
</del><ins>+ return ListItemType { newItem };
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- PtrListItemTearOff initializeValuesAndWrappers(PtrListItemTearOff newItem, ExceptionCode& ec)
</del><ins>+ ExceptionOr<PtrListItemTearOff> initializeValuesAndWrappers(PtrListItemTearOff newItem)
</ins><span class="cx"> {
</span><span class="cx"> ASSERT(m_wrappers);
</span><del>- if (!canAlterList(ec))
</del><ins>+
+ auto result = canAlterList();
+ if (result.hasException())
+ return result.releaseException();
+ if (!result.releaseReturnValue())
</ins><span class="cx"> return nullptr;
</span><span class="cx">
</span><span class="cx"> // Not specified, but FF/Opera do it this way, and it's just sane.
</span><del>- if (!newItem) {
- ec = SVGException::SVG_WRONG_TYPE_ERR;
- return nullptr;
- }
</del><ins>+ if (!newItem)
+ return Exception { SVGException::SVG_WRONG_TYPE_ERR };
</ins><span class="cx">
</span><span class="cx"> ASSERT(m_values->size() == m_wrappers->size());
</span><span class="cx">
</span><span class="lines">@@ -162,33 +172,38 @@
</span><span class="cx"> m_wrappers->append(newItem);
</span><span class="cx">
</span><span class="cx"> commitChange();
</span><del>- return newItem;
</del><ins>+ return WTFMove(newItem);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // SVGList::getItem()
</span><del>- bool canGetItem(unsigned index, ExceptionCode& ec)
</del><ins>+ ExceptionOr<bool> canGetItem(unsigned index)
</ins><span class="cx"> {
</span><del>- if (index >= m_values->size()) {
- ec = INDEX_SIZE_ERR;
- return false;
- }
</del><ins>+ if (index >= m_values->size())
+ return Exception { INDEX_SIZE_ERR };
</ins><span class="cx">
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- ListItemType getItemValues(unsigned index, ExceptionCode& ec)
</del><ins>+ ExceptionOr<ListItemType> getItemValues(unsigned index)
</ins><span class="cx"> {
</span><del>- if (!canGetItem(index, ec))
- return ListItemType();
</del><ins>+ auto result = canGetItem(index);
+ if (result.hasException())
+ return result.releaseException();
+ if (!result.releaseReturnValue())
+ return ListItemType { };
</ins><span class="cx">
</span><span class="cx"> // Spec: Returns the specified item from the list. The returned item is the item itself and not a copy.
</span><del>- return m_values->at(index);
</del><ins>+ return ListItemType { m_values->at(index) };
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- PtrListItemTearOff getItemValuesAndWrappers(AnimatedListPropertyTearOff* animatedList, unsigned index, ExceptionCode& ec)
</del><ins>+ ExceptionOr<PtrListItemTearOff> getItemValuesAndWrappers(AnimatedListPropertyTearOff* animatedList, unsigned index)
</ins><span class="cx"> {
</span><span class="cx"> ASSERT(m_wrappers);
</span><del>- if (!canGetItem(index, ec))
</del><ins>+
+ auto result = canGetItem(index);
+ if (result.hasException())
+ return result.releaseException();
+ if (!result.releaseReturnValue())
</ins><span class="cx"> return nullptr;
</span><span class="cx">
</span><span class="cx"> // Spec: Returns the specified item from the list. The returned item is the item itself and not a copy.
</span><span class="lines">@@ -207,10 +222,13 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // SVGList::insertItemBefore()
</span><del>- ListItemType insertItemBeforeValues(const ListItemType& newItem, unsigned index, ExceptionCode& ec)
</del><ins>+ ExceptionOr<ListItemType> insertItemBeforeValues(const ListItemType& newItem, unsigned index)
</ins><span class="cx"> {
</span><del>- if (!canAlterList(ec))
- return ListItemType();
</del><ins>+ auto result = canAlterList();
+ if (result.hasException())
+ return result.releaseException();
+ if (!result.releaseReturnValue())
+ return ListItemType { };
</ins><span class="cx">
</span><span class="cx"> // Spec: If the index is greater than or equal to numberOfItems, then the new item is appended to the end of the list.
</span><span class="cx"> if (index > m_values->size())
</span><span class="lines">@@ -219,7 +237,7 @@
</span><span class="cx"> // Spec: If newItem is already in a list, it is removed from its previous list before it is inserted into this list.
</span><span class="cx"> if (!processIncomingListItemValue(newItem, &index)) {
</span><span class="cx"> // Inserting the item before itself is a no-op.
</span><del>- return newItem;
</del><ins>+ return ListItemType { newItem };
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // Spec: Inserts a new item into the list at the specified position. The index of the item before which the new item is to be
</span><span class="lines">@@ -227,24 +245,26 @@
</span><span class="cx"> m_values->insert(index, newItem);
</span><span class="cx">
</span><span class="cx"> commitChange();
</span><del>- return newItem;
</del><ins>+ return ListItemType { newItem };
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- PtrListItemTearOff insertItemBeforeValuesAndWrappers(PtrListItemTearOff newItem, unsigned index, ExceptionCode& ec)
</del><ins>+ ExceptionOr<PtrListItemTearOff> insertItemBeforeValuesAndWrappers(PtrListItemTearOff newItem, unsigned index)
</ins><span class="cx"> {
</span><span class="cx"> ASSERT(m_wrappers);
</span><del>- if (!canAlterList(ec))
</del><ins>+
+ auto result = canAlterList();
+ if (result.hasException())
+ return result.releaseException();
+ if (!result.releaseReturnValue())
</ins><span class="cx"> return nullptr;
</span><span class="cx">
</span><span class="cx"> // Not specified, but FF/Opera do it this way, and it's just sane.
</span><del>- if (!newItem) {
- ec = SVGException::SVG_WRONG_TYPE_ERR;
- return nullptr;
- }
</del><ins>+ if (!newItem)
+ return Exception { SVGException::SVG_WRONG_TYPE_ERR };
</ins><span class="cx">
</span><span class="cx"> // Spec: If the index is greater than or equal to numberOfItems, then the new item is appended to the end of the list.
</span><span class="cx"> if (index > m_values->size())
</span><del>- index = m_values->size();
</del><ins>+ index = m_values->size();
</ins><span class="cx">
</span><span class="cx"> ASSERT(m_values->size() == m_wrappers->size());
</span><span class="cx">
</span><span class="lines">@@ -264,35 +284,38 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // SVGList::replaceItem()
</span><del>- bool canReplaceItem(unsigned index, ExceptionCode& ec)
</del><ins>+ ExceptionOr<bool> canReplaceItem(unsigned index)
</ins><span class="cx"> {
</span><del>- if (!canAlterList(ec))
</del><ins>+ auto result = canAlterList();
+ if (result.hasException())
+ return result.releaseException();
+ if (!result.releaseReturnValue())
</ins><span class="cx"> return false;
</span><span class="cx">
</span><del>- if (index >= m_values->size()) {
- ec = INDEX_SIZE_ERR;
- return false;
- }
</del><ins>+ if (index >= m_values->size())
+ return Exception { INDEX_SIZE_ERR };
</ins><span class="cx">
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- ListItemType replaceItemValues(const ListItemType& newItem, unsigned index, ExceptionCode& ec)
</del><ins>+ ExceptionOr<ListItemType> replaceItemValues(const ListItemType& newItem, unsigned index)
</ins><span class="cx"> {
</span><del>- if (!canReplaceItem(index, ec))
- return ListItemType();
</del><ins>+ auto result = canReplaceItem(index);
+ if (result.hasException())
+ return result.releaseException();
+ if (!result.releaseReturnValue())
+ return ListItemType { };
</ins><span class="cx">
</span><span class="cx"> // Spec: If newItem is already in a list, it is removed from its previous list before it is inserted into this list.
</span><span class="cx"> // Spec: If the item is already in this list, note that the index of the item to replace is before the removal of the item.
</span><span class="cx"> if (!processIncomingListItemValue(newItem, &index)) {
</span><span class="cx"> // Replacing the item with itself is a no-op.
</span><del>- return newItem;
</del><ins>+ return ListItemType { newItem };
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if (m_values->isEmpty()) {
</span><span class="cx"> // 'newItem' already lived in our list, we removed it, and now we're empty, which means there's nothing to replace.
</span><del>- ec = INDEX_SIZE_ERR;
- return ListItemType();
</del><ins>+ return Exception { INDEX_SIZE_ERR };
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // Update the value at the desired position 'index'.
</span><span class="lines">@@ -299,20 +322,22 @@
</span><span class="cx"> m_values->at(index) = newItem;
</span><span class="cx">
</span><span class="cx"> commitChange();
</span><del>- return newItem;
</del><ins>+ return ListItemType { newItem };
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- PtrListItemTearOff replaceItemValuesAndWrappers(PtrListItemTearOff newItem, unsigned index, ExceptionCode& ec)
</del><ins>+ ExceptionOr<PtrListItemTearOff> replaceItemValuesAndWrappers(PtrListItemTearOff newItem, unsigned index)
</ins><span class="cx"> {
</span><span class="cx"> ASSERT(m_wrappers);
</span><del>- if (!canReplaceItem(index, ec))
</del><ins>+
+ auto result = canReplaceItem(index);
+ if (result.hasException())
+ return result.releaseException();
+ if (!result.releaseReturnValue())
</ins><span class="cx"> return nullptr;
</span><span class="cx">
</span><span class="cx"> // Not specified, but FF/Opera do it this way, and it's just sane.
</span><del>- if (!newItem) {
- ec = SVGException::SVG_WRONG_TYPE_ERR;
- return nullptr;
- }
</del><ins>+ if (!newItem)
+ return Exception { SVGException::SVG_WRONG_TYPE_ERR };
</ins><span class="cx">
</span><span class="cx"> ASSERT(m_values->size() == m_wrappers->size());
</span><span class="cx">
</span><span class="lines">@@ -319,13 +344,12 @@
</span><span class="cx"> // Spec: If newItem is already in a list, it is removed from its previous list before it is inserted into this list.
</span><span class="cx"> // Spec: If the item is already in this list, note that the index of the item to replace is before the removal of the item.
</span><span class="cx"> if (!processIncomingListItemWrapper(newItem, &index))
</span><del>- return newItem;
</del><ins>+ return WTFMove(newItem);
</ins><span class="cx">
</span><span class="cx"> if (m_values->isEmpty()) {
</span><span class="cx"> ASSERT(m_wrappers->isEmpty());
</span><span class="cx"> // 'newItem' already lived in our list, we removed it, and now we're empty, which means there's nothing to replace.
</span><del>- ec = INDEX_SIZE_ERR;
- return nullptr;
</del><ins>+ return Exception { INDEX_SIZE_ERR };
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // Detach the existing wrapper.
</span><span class="lines">@@ -338,39 +362,47 @@
</span><span class="cx"> m_wrappers->at(index) = newItem;
</span><span class="cx">
</span><span class="cx"> commitChange();
</span><del>- return newItem;
</del><ins>+ return WTFMove(newItem);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // SVGList::removeItem()
</span><del>- bool canRemoveItem(unsigned index, ExceptionCode& ec)
</del><ins>+ ExceptionOr<bool> canRemoveItem(unsigned index)
</ins><span class="cx"> {
</span><del>- if (!canAlterList(ec))
</del><ins>+ auto result = canAlterList();
+ if (result.hasException())
+ return result.releaseException();
+ if (!result.releaseReturnValue())
</ins><span class="cx"> return false;
</span><span class="cx">
</span><del>- if (index >= m_values->size()) {
- ec = INDEX_SIZE_ERR;
- return false;
- }
</del><ins>+ if (index >= m_values->size())
+ return Exception { INDEX_SIZE_ERR };
</ins><span class="cx">
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- ListItemType removeItemValues(unsigned index, ExceptionCode& ec)
</del><ins>+ ExceptionOr<ListItemType> removeItemValues(unsigned index)
</ins><span class="cx"> {
</span><del>- if (!canRemoveItem(index, ec))
- return ListItemType();
</del><ins>+ auto result = canRemoveItem(index);
+ if (result.hasException())
+ return result.releaseException();
+ if (!result.releaseReturnValue())
+ return ListItemType { };
</ins><span class="cx">
</span><span class="cx"> ListItemType oldItem = m_values->at(index);
</span><span class="cx"> m_values->remove(index);
</span><span class="cx">
</span><span class="cx"> commitChange();
</span><del>- return oldItem;
</del><ins>+ return WTFMove(oldItem);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- PtrListItemTearOff removeItemValuesAndWrappers(AnimatedListPropertyTearOff* animatedList, unsigned index, ExceptionCode& ec)
</del><ins>+ ExceptionOr<PtrListItemTearOff> removeItemValuesAndWrappers(AnimatedListPropertyTearOff* animatedList, unsigned index)
</ins><span class="cx"> {
</span><span class="cx"> ASSERT(m_wrappers);
</span><del>- if (!canRemoveItem(index, ec))
</del><ins>+
+ auto result = canRemoveItem(index);
+ if (result.hasException())
+ return result.releaseException();
+ if (!result.releaseReturnValue())
</ins><span class="cx"> return nullptr;
</span><span class="cx">
</span><span class="cx"> ASSERT(m_values->size() == m_wrappers->size());
</span><span class="lines">@@ -389,10 +421,13 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // SVGList::appendItem()
</span><del>- ListItemType appendItemValues(const ListItemType& newItem, ExceptionCode& ec)
</del><ins>+ ExceptionOr<ListItemType> appendItemValues(const ListItemType& newItem)
</ins><span class="cx"> {
</span><del>- if (!canAlterList(ec))
- return ListItemType();
</del><ins>+ auto result = canAlterList();
+ if (result.hasException())
+ return result.releaseException();
+ if (!result.releaseReturnValue())
+ return ListItemType { };
</ins><span class="cx">
</span><span class="cx"> // Spec: If newItem is already in a list, it is removed from its previous list before it is inserted into this list.
</span><span class="cx"> processIncomingListItemValue(newItem, 0);
</span><span class="lines">@@ -401,20 +436,22 @@
</span><span class="cx"> m_values->append(newItem);
</span><span class="cx">
</span><span class="cx"> commitChange(ListModificationAppend);
</span><del>- return newItem;
</del><ins>+ return ListItemType { newItem };
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- PtrListItemTearOff appendItemValuesAndWrappers(PtrListItemTearOff newItem, ExceptionCode& ec)
</del><ins>+ ExceptionOr<PtrListItemTearOff> appendItemValuesAndWrappers(PtrListItemTearOff newItem)
</ins><span class="cx"> {
</span><span class="cx"> ASSERT(m_wrappers);
</span><del>- if (!canAlterList(ec))
</del><ins>+
+ auto result = canAlterList();
+ if (result.hasException())
+ return result.releaseException();
+ if (!result.releaseReturnValue())
</ins><span class="cx"> return nullptr;
</span><span class="cx">
</span><span class="cx"> // Not specified, but FF/Opera do it this way, and it's just sane.
</span><del>- if (!newItem) {
- ec = SVGException::SVG_WRONG_TYPE_ERR;
- return nullptr;
- }
</del><ins>+ if (!newItem)
+ return Exception { SVGException::SVG_WRONG_TYPE_ERR };
</ins><span class="cx">
</span><span class="cx"> ASSERT(m_values->size() == m_wrappers->size());
</span><span class="cx">
</span><span class="lines">@@ -426,7 +463,7 @@
</span><span class="cx"> m_wrappers->append(newItem);
</span><span class="cx">
</span><span class="cx"> commitChange(ListModificationAppend);
</span><del>- return newItem;
</del><ins>+ return WTFMove(newItem);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> PropertyType& values()
</span><span class="lines">@@ -472,5 +509,3 @@
</span><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> }
</span><del>-
-#endif // SVGListProperty_h
</del></span></pre></div>
<a id="trunkSourceWebCoresvgpropertiesSVGListPropertyTearOffh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/properties/SVGListPropertyTearOff.h (207715 => 207716)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/properties/SVGListPropertyTearOff.h        2016-10-22 20:46:34 UTC (rev 207715)
+++ trunk/Source/WebCore/svg/properties/SVGListPropertyTearOff.h        2016-10-22 20:56:47 UTC (rev 207716)
</span><span class="lines">@@ -17,8 +17,7 @@
</span><span class="cx"> * Boston, MA 02110-1301, USA.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-#ifndef SVGListPropertyTearOff_h
-#define SVGListPropertyTearOff_h
</del><ins>+#pragma once
</ins><span class="cx">
</span><span class="cx"> #include "SVGListProperty.h"
</span><span class="cx">
</span><span class="lines">@@ -78,39 +77,39 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // SVGList API
</span><del>- void clear(ExceptionCode& ec)
</del><ins>+ ExceptionOr<void> clear()
</ins><span class="cx"> {
</span><del>- Base::clearValuesAndWrappers(ec);
</del><ins>+ return Base::clearValuesAndWrappers();
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- PtrListItemTearOff initialize(PtrListItemTearOff newItem, ExceptionCode& ec)
</del><ins>+ ExceptionOr<PtrListItemTearOff> initialize(PtrListItemTearOff newItem)
</ins><span class="cx"> {
</span><del>- return Base::initializeValuesAndWrappers(newItem, ec);
</del><ins>+ return Base::initializeValuesAndWrappers(newItem);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- PtrListItemTearOff getItem(unsigned index, ExceptionCode& ec)
</del><ins>+ ExceptionOr<PtrListItemTearOff> getItem(unsigned index)
</ins><span class="cx"> {
</span><del>- return Base::getItemValuesAndWrappers(m_animatedProperty.get(), index, ec);
</del><ins>+ return Base::getItemValuesAndWrappers(m_animatedProperty.get(), index);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- PtrListItemTearOff insertItemBefore(PtrListItemTearOff newItem, unsigned index, ExceptionCode& ec)
</del><ins>+ ExceptionOr<PtrListItemTearOff> insertItemBefore(PtrListItemTearOff newItem, unsigned index)
</ins><span class="cx"> {
</span><del>- return Base::insertItemBeforeValuesAndWrappers(newItem, index, ec);
</del><ins>+ return Base::insertItemBeforeValuesAndWrappers(newItem, index);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- PtrListItemTearOff replaceItem(PtrListItemTearOff newItem, unsigned index, ExceptionCode& ec)
</del><ins>+ ExceptionOr<PtrListItemTearOff> replaceItem(PtrListItemTearOff newItem, unsigned index)
</ins><span class="cx"> {
</span><del>- return Base::replaceItemValuesAndWrappers(newItem, index, ec);
</del><ins>+ return Base::replaceItemValuesAndWrappers(newItem, index);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- PtrListItemTearOff removeItem(unsigned index, ExceptionCode& ec)
</del><ins>+ ExceptionOr<PtrListItemTearOff> removeItem(unsigned index)
</ins><span class="cx"> {
</span><del>- return Base::removeItemValuesAndWrappers(m_animatedProperty.get(), index, ec);
</del><ins>+ return Base::removeItemValuesAndWrappers(m_animatedProperty.get(), index);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- PtrListItemTearOff appendItem(PtrListItemTearOff newItem, ExceptionCode& ec)
</del><ins>+ ExceptionOr<PtrListItemTearOff> appendItem(PtrListItemTearOff newItem)
</ins><span class="cx"> {
</span><del>- return Base::appendItemValuesAndWrappers(newItem, ec);
</del><ins>+ return Base::appendItemValuesAndWrappers(newItem);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> protected:
</span><span class="lines">@@ -214,5 +213,3 @@
</span><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> }
</span><del>-
-#endif // SVGListPropertyTearOff_h
</del></span></pre></div>
<a id="trunkSourceWebCoresvgpropertiesSVGPathSegListPropertyTearOffcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/properties/SVGPathSegListPropertyTearOff.cpp (207715 => 207716)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/properties/SVGPathSegListPropertyTearOff.cpp        2016-10-22 20:46:34 UTC (rev 207715)
+++ trunk/Source/WebCore/svg/properties/SVGPathSegListPropertyTearOff.cpp        2016-10-22 20:56:47 UTC (rev 207716)
</span><span class="lines">@@ -35,33 +35,26 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void SVGPathSegListPropertyTearOff::clear(ExceptionCode& ec)
</del><ins>+ExceptionOr<void> SVGPathSegListPropertyTearOff::clear()
</ins><span class="cx"> {
</span><span class="cx"> ASSERT(m_values);
</span><span class="cx"> if (m_values->isEmpty())
</span><del>- return;
</del><ins>+ return { };
</ins><span class="cx">
</span><span class="cx"> clearContextAndRoles();
</span><del>- SVGPathSegListPropertyTearOff::Base::clearValues(ec);
</del><ins>+ return SVGPathSegListPropertyTearOff::Base::clearValues();
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-SVGPathSegListPropertyTearOff::PtrListItemType SVGPathSegListPropertyTearOff::getItem(unsigned index, ExceptionCode& ec)
</del><ins>+ExceptionOr<SVGPathSegListPropertyTearOff::PtrListItemType> SVGPathSegListPropertyTearOff::getItem(unsigned index)
</ins><span class="cx"> {
</span><del>- ListItemType returnedItem = Base::getItemValues(index, ec);
- if (returnedItem) {
- ASSERT(static_cast<SVGPathSegWithContext*>(returnedItem.get())->contextElement() == contextElement());
- ASSERT(static_cast<SVGPathSegWithContext*>(returnedItem.get())->role() == m_pathSegRole);
- }
- return returnedItem;
</del><ins>+ return Base::getItemValues(index);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-SVGPathSegListPropertyTearOff::PtrListItemType SVGPathSegListPropertyTearOff::replaceItem(PtrListItemType newItem, unsigned index, ExceptionCode& ec)
</del><ins>+ExceptionOr<SVGPathSegListPropertyTearOff::PtrListItemType> SVGPathSegListPropertyTearOff::replaceItem(PtrListItemType newItem, unsigned index)
</ins><span class="cx"> {
</span><span class="cx"> // Not specified, but FF/Opera do it this way, and it's just sane.
</span><del>- if (!newItem) {
- ec = SVGException::SVG_WRONG_TYPE_ERR;
- return 0;
- }
</del><ins>+ if (!newItem)
+ return Exception { SVGException::SVG_WRONG_TYPE_ERR };
</ins><span class="cx">
</span><span class="cx"> if (index < m_values->size()) {
</span><span class="cx"> ListItemType replacedItem = m_values->at(index);
</span><span class="lines">@@ -69,15 +62,18 @@
</span><span class="cx"> static_cast<SVGPathSegWithContext*>(replacedItem.get())->setContextAndRole(nullptr, PathSegUndefinedRole);
</span><span class="cx"> }
</span><span class="cx">
</span><del>- return Base::replaceItemValues(newItem, index, ec);
</del><ins>+ return Base::replaceItemValues(newItem, index);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-SVGPathSegListPropertyTearOff::PtrListItemType SVGPathSegListPropertyTearOff::removeItem(unsigned index, ExceptionCode& ec)
</del><ins>+ExceptionOr<SVGPathSegListPropertyTearOff::PtrListItemType> SVGPathSegListPropertyTearOff::removeItem(unsigned index)
</ins><span class="cx"> {
</span><del>- SVGPathSegListPropertyTearOff::ListItemType removedItem = SVGPathSegListPropertyTearOff::Base::removeItemValues(index, ec);
</del><ins>+ auto result = SVGPathSegListPropertyTearOff::Base::removeItemValues(index);
+ if (result.hasException())
+ return result;
+ auto removedItem = result.releaseReturnValue();
</ins><span class="cx"> if (removedItem)
</span><del>- static_cast<SVGPathSegWithContext*>(removedItem.get())->setContextAndRole(nullptr, PathSegUndefinedRole);
- return removedItem;
</del><ins>+ static_cast<SVGPathSegWithContext&>(*removedItem).setContextAndRole(nullptr, PathSegUndefinedRole);
+ return WTFMove(removedItem);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> SVGPathElement* SVGPathSegListPropertyTearOff::contextElement() const
</span></span></pre></div>
<a id="trunkSourceWebCoresvgpropertiesSVGPathSegListPropertyTearOffh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/properties/SVGPathSegListPropertyTearOff.h (207715 => 207716)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/properties/SVGPathSegListPropertyTearOff.h        2016-10-22 20:46:34 UTC (rev 207715)
+++ trunk/Source/WebCore/svg/properties/SVGPathSegListPropertyTearOff.h        2016-10-22 20:56:47 UTC (rev 207716)
</span><span class="lines">@@ -17,8 +17,7 @@
</span><span class="cx"> * Boston, MA 02110-1301, USA.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-#ifndef SVGPathSegListPropertyTearOff_h
-#define SVGPathSegListPropertyTearOff_h
</del><ins>+#pragma once
</ins><span class="cx">
</span><span class="cx"> #include "SVGAnimatedListPropertyTearOff.h"
</span><span class="cx"> #include "SVGPathSegList.h"
</span><span class="lines">@@ -29,10 +28,10 @@
</span><span class="cx">
</span><span class="cx"> class SVGPathSegListPropertyTearOff final : public SVGListProperty<SVGPathSegList> {
</span><span class="cx"> public:
</span><del>- typedef SVGListProperty<SVGPathSegList> Base;
- typedef SVGAnimatedListPropertyTearOff<SVGPathSegList> AnimatedListPropertyTearOff;
- typedef SVGPropertyTraits<SVGPathSegList>::ListItemType ListItemType;
- typedef RefPtr<SVGPathSeg> PtrListItemType;
</del><ins>+ using Base = SVGListProperty<SVGPathSegList>;
+ using AnimatedListPropertyTearOff = SVGAnimatedListPropertyTearOff<SVGPathSegList>;
+ using ListItemType = SVGPropertyTraits<SVGPathSegList>::ListItemType;
+ using PtrListItemType = RefPtr<SVGPathSeg>;
</ins><span class="cx">
</span><span class="cx"> static Ref<SVGPathSegListPropertyTearOff> create(AnimatedListPropertyTearOff* animatedProperty, SVGPropertyRole role, SVGPathSegRole pathSegRole, SVGPathSegList& values, ListWrapperCache& wrappers)
</span><span class="cx"> {
</span><span class="lines">@@ -65,46 +64,40 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // SVGList API
</span><del>- void clear(ExceptionCode&);
</del><ins>+ ExceptionOr<void> clear();
</ins><span class="cx">
</span><del>- PtrListItemType initialize(PtrListItemType newItem, ExceptionCode& ec)
</del><ins>+ ExceptionOr<PtrListItemType> initialize(PtrListItemType newItem)
</ins><span class="cx"> {
</span><span class="cx"> // Not specified, but FF/Opera do it this way, and it's just sane.
</span><del>- if (!newItem) {
- ec = SVGException::SVG_WRONG_TYPE_ERR;
- return nullptr;
- }
</del><ins>+ if (!newItem)
+ return Exception { SVGException::SVG_WRONG_TYPE_ERR };
</ins><span class="cx">
</span><span class="cx"> clearContextAndRoles();
</span><del>- return Base::initializeValues(newItem, ec);
</del><ins>+ return Base::initializeValues(newItem);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- PtrListItemType getItem(unsigned index, ExceptionCode&);
</del><ins>+ ExceptionOr<PtrListItemType> getItem(unsigned index);
</ins><span class="cx">
</span><del>- PtrListItemType insertItemBefore(PtrListItemType newItem, unsigned index, ExceptionCode& ec)
</del><ins>+ ExceptionOr<PtrListItemType> insertItemBefore(PtrListItemType newItem, unsigned index)
</ins><span class="cx"> {
</span><span class="cx"> // Not specified, but FF/Opera do it this way, and it's just sane.
</span><del>- if (!newItem) {
- ec = SVGException::SVG_WRONG_TYPE_ERR;
- return 0;
- }
</del><ins>+ if (!newItem)
+ return Exception { SVGException::SVG_WRONG_TYPE_ERR };
</ins><span class="cx">
</span><del>- return Base::insertItemBeforeValues(newItem, index, ec);
</del><ins>+ return Base::insertItemBeforeValues(newItem, index);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- PtrListItemType replaceItem(PtrListItemType, unsigned index, ExceptionCode&);
</del><ins>+ ExceptionOr<PtrListItemType> replaceItem(PtrListItemType, unsigned index);
</ins><span class="cx">
</span><del>- PtrListItemType removeItem(unsigned index, ExceptionCode&);
</del><ins>+ ExceptionOr<PtrListItemType> removeItem(unsigned index);
</ins><span class="cx">
</span><del>- PtrListItemType appendItem(PtrListItemType newItem, ExceptionCode& ec)
</del><ins>+ ExceptionOr<PtrListItemType> appendItem(PtrListItemType newItem)
</ins><span class="cx"> {
</span><span class="cx"> // Not specified, but FF/Opera do it this way, and it's just sane.
</span><del>- if (!newItem) {
- ec = SVGException::SVG_WRONG_TYPE_ERR;
- return nullptr;
- }
</del><ins>+ if (!newItem)
+ return Exception { SVGException::SVG_WRONG_TYPE_ERR };
</ins><span class="cx">
</span><del>- return Base::appendItemValues(newItem, ec);
</del><ins>+ return Base::appendItemValues(newItem);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> private:
</span><span class="lines">@@ -161,5 +154,3 @@
</span><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> }
</span><del>-
-#endif // SVGListPropertyTearOff_h
</del></span></pre></div>
<a id="trunkSourceWebCoresvgpropertiesSVGPropertyTearOffh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/properties/SVGPropertyTearOff.h (207715 => 207716)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/properties/SVGPropertyTearOff.h        2016-10-22 20:46:34 UTC (rev 207715)
+++ trunk/Source/WebCore/svg/properties/SVGPropertyTearOff.h        2016-10-22 20:56:47 UTC (rev 207716)
</span><span class="lines">@@ -18,8 +18,7 @@
</span><span class="cx"> * Boston, MA 02110-1301, USA.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-#ifndef SVGPropertyTearOff_h
-#define SVGPropertyTearOff_h
</del><ins>+#pragma once
</ins><span class="cx">
</span><span class="cx"> #include "SVGAnimatedProperty.h"
</span><span class="cx"> #include "SVGElement.h"
</span><span class="lines">@@ -57,6 +56,13 @@
</span><span class="cx"> return adoptRef(*new Self(initialValue));
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ template<typename T> static ExceptionOr<Ref<Self>> create(ExceptionOr<T>&& initialValue)
+ {
+ if (initialValue.hasException())
+ return initialValue.releaseException();
+ return create(initialValue.releaseReturnValue());
+ }
+
</ins><span class="cx"> virtual PropertyType& propertyReference() { return *m_value; }
</span><span class="cx"> SVGAnimatedProperty* animatedProperty() const { return m_animatedProperty.get(); }
</span><span class="cx">
</span><span class="lines">@@ -172,5 +178,3 @@
</span><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> }
</span><del>-
-#endif // SVGPropertyTearOff_h
</del></span></pre></div>
<a id="trunkSourceWebCoresvgpropertiesSVGStaticListPropertyTearOffh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/properties/SVGStaticListPropertyTearOff.h (207715 => 207716)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/properties/SVGStaticListPropertyTearOff.h        2016-10-22 20:46:34 UTC (rev 207715)
+++ trunk/Source/WebCore/svg/properties/SVGStaticListPropertyTearOff.h        2016-10-22 20:56:47 UTC (rev 207716)
</span><span class="lines">@@ -17,68 +17,64 @@
</span><span class="cx"> * Boston, MA 02110-1301, USA.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-#ifndef SVGStaticListPropertyTearOff_h
-#define SVGStaticListPropertyTearOff_h
</del><ins>+#pragma once
</ins><span class="cx">
</span><span class="cx"> #include "SVGListProperty.h"
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>-template<typename PropertyType>
-class SVGStaticListPropertyTearOff final : public SVGListProperty<PropertyType> {
</del><ins>+template<typename PropertyType> class SVGStaticListPropertyTearOff final : public SVGListProperty<PropertyType> {
</ins><span class="cx"> public:
</span><del>- typedef SVGListProperty<PropertyType> Base;
</del><ins>+ using Base = SVGListProperty<PropertyType>;
+ using ListItemType = typename SVGPropertyTraits<PropertyType>::ListItemType;
+ using ListItemTearOff = SVGPropertyTearOff<ListItemType>;
</ins><span class="cx">
</span><del>- typedef typename SVGPropertyTraits<PropertyType>::ListItemType ListItemType;
- typedef SVGPropertyTearOff<ListItemType> ListItemTearOff;
-
</del><span class="cx"> using Base::m_role;
</span><span class="cx"> using Base::m_values;
</span><span class="cx">
</span><span class="cx"> static Ref<SVGStaticListPropertyTearOff<PropertyType>> create(SVGElement& contextElement, PropertyType& values)
</span><span class="cx"> {
</span><del>- return adoptRef(*new SVGStaticListPropertyTearOff<PropertyType>(&contextElement, values));
</del><ins>+ return adoptRef(*new SVGStaticListPropertyTearOff(contextElement, values));
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- // SVGList API
- void clear(ExceptionCode& ec)
</del><ins>+ ExceptionOr<void> clear()
</ins><span class="cx"> {
</span><del>- Base::clearValues(ec);
</del><ins>+ return Base::clearValues();
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- ListItemType initialize(const ListItemType& newItem, ExceptionCode& ec)
</del><ins>+ ExceptionOr<ListItemType> initialize(const ListItemType& newItem)
</ins><span class="cx"> {
</span><del>- return Base::initializeValues(newItem, ec);
</del><ins>+ return Base::initializeValues(newItem);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- ListItemType getItem(unsigned index, ExceptionCode& ec)
</del><ins>+ ExceptionOr<ListItemType> getItem(unsigned index)
</ins><span class="cx"> {
</span><del>- return Base::getItemValues(index, ec);
</del><ins>+ return Base::getItemValues(index);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- ListItemType insertItemBefore(const ListItemType& newItem, unsigned index, ExceptionCode& ec)
</del><ins>+ ExceptionOr<ListItemType> insertItemBefore(const ListItemType& newItem, unsigned index)
</ins><span class="cx"> {
</span><del>- return Base::insertItemBeforeValues(newItem, index, ec);
</del><ins>+ return Base::insertItemBeforeValues(newItem, index);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- ListItemType replaceItem(const ListItemType& newItem, unsigned index, ExceptionCode& ec)
</del><ins>+ ExceptionOr<ListItemType> replaceItem(const ListItemType& newItem, unsigned index)
</ins><span class="cx"> {
</span><del>- return Base::replaceItemValues(newItem, index, ec);
</del><ins>+ return Base::replaceItemValues(newItem, index);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- ListItemType removeItem(unsigned index, ExceptionCode& ec)
</del><ins>+ ExceptionOr<ListItemType> removeItem(unsigned index)
</ins><span class="cx"> {
</span><del>- return Base::removeItemValues(index, ec);
</del><ins>+ return Base::removeItemValues(index);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- ListItemType appendItem(const ListItemType& newItem, ExceptionCode& ec)
</del><ins>+ ExceptionOr<ListItemType> appendItem(const ListItemType& newItem)
</ins><span class="cx"> {
</span><del>- return Base::appendItemValues(newItem, ec);
</del><ins>+ return Base::appendItemValues(newItem);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> private:
</span><del>- SVGStaticListPropertyTearOff(SVGElement* contextElement, PropertyType& values)
- : SVGListProperty<PropertyType>(UndefinedRole, values, 0)
</del><ins>+ SVGStaticListPropertyTearOff(SVGElement& contextElement, PropertyType& values)
+ : SVGListProperty<PropertyType>(UndefinedRole, values, nullptr)
</ins><span class="cx"> , m_contextElement(contextElement)
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="lines">@@ -91,7 +87,7 @@
</span><span class="cx"> virtual void commitChange()
</span><span class="cx"> {
</span><span class="cx"> ASSERT(m_values);
</span><del>- m_values->commitChange(m_contextElement.get());
</del><ins>+ m_values->commitChange(m_contextElement.ptr());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> virtual bool processIncomingListItemValue(const ListItemType&, unsigned*)
</span><span class="lines">@@ -106,10 +102,7 @@
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-private:
- RefPtr<SVGElement> m_contextElement;
</del><ins>+ Ref<SVGElement> m_contextElement;
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> }
</span><del>-
-#endif // SVGStaticListPropertyTearOff_h
</del></span></pre></div>
<a id="trunkSourceWebCoresvgpropertiesSVGTransformListPropertyTearOffh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/properties/SVGTransformListPropertyTearOff.h (207715 => 207716)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/properties/SVGTransformListPropertyTearOff.h        2016-10-22 20:46:34 UTC (rev 207715)
+++ trunk/Source/WebCore/svg/properties/SVGTransformListPropertyTearOff.h        2016-10-22 20:56:47 UTC (rev 207716)
</span><span class="lines">@@ -17,8 +17,7 @@
</span><span class="cx"> * Boston, MA 02110-1301, USA.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-#ifndef SVGTransformListPropertyTearOff_h
-#define SVGTransformListPropertyTearOff_h
</del><ins>+#pragma once
</ins><span class="cx">
</span><span class="cx"> #include "SVGListPropertyTearOff.h"
</span><span class="cx"> #include "SVGTransformList.h"
</span><span class="lines">@@ -25,11 +24,10 @@
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>-// SVGTransformList contains two additional methods, that can be exposed to the bindings.
</del><span class="cx"> class SVGTransformListPropertyTearOff final : public SVGListPropertyTearOff<SVGTransformList> {
</span><span class="cx"> public:
</span><del>- typedef SVGAnimatedListPropertyTearOff<SVGTransformList> AnimatedListPropertyTearOff;
- typedef SVGAnimatedListPropertyTearOff<SVGTransformList>::ListWrapperCache ListWrapperCache;
</del><ins>+ using AnimatedListPropertyTearOff = SVGAnimatedListPropertyTearOff<SVGTransformList>;
+ using ListWrapperCache = AnimatedListPropertyTearOff::ListWrapperCache;
</ins><span class="cx">
</span><span class="cx"> static Ref<SVGListPropertyTearOff<SVGTransformList>> create(AnimatedListPropertyTearOff* animatedProperty, SVGPropertyRole role, SVGTransformList& values, ListWrapperCache& wrappers)
</span><span class="cx"> {
</span><span class="lines">@@ -37,21 +35,23 @@
</span><span class="cx"> return adoptRef(*new SVGTransformListPropertyTearOff(animatedProperty, role, values, wrappers));
</span><span class="cx"> }
</span><span class="cx">
</span><del>- RefPtr<SVGPropertyTearOff<SVGTransform>> createSVGTransformFromMatrix(SVGPropertyTearOff<SVGMatrix>* matrix, ExceptionCode& ec)
</del><ins>+ ExceptionOr<Ref<SVGPropertyTearOff<SVGTransform>>> createSVGTransformFromMatrix(SVGPropertyTearOff<SVGMatrix>* matrix)
</ins><span class="cx"> {
</span><span class="cx"> ASSERT(m_values);
</span><del>- if (!matrix) {
- ec = TYPE_MISMATCH_ERR;
- return nullptr;
- }
</del><ins>+ if (!matrix)
+ return Exception { TYPE_MISMATCH_ERR };
</ins><span class="cx"> return SVGPropertyTearOff<SVGTransform>::create(m_values->createSVGTransformFromMatrix(matrix->propertyReference()));
</span><span class="cx"> }
</span><span class="cx">
</span><del>- RefPtr<SVGPropertyTearOff<SVGTransform>> consolidate(ExceptionCode& ec)
</del><ins>+ ExceptionOr<RefPtr<SVGPropertyTearOff<SVGTransform>>> consolidate()
</ins><span class="cx"> {
</span><span class="cx"> ASSERT(m_values);
</span><span class="cx"> ASSERT(m_wrappers);
</span><del>- if (!canAlterList(ec))
</del><ins>+
+ auto result = canAlterList();
+ if (result.hasException())
+ return result.releaseException();
+ if (!result.releaseReturnValue())
</ins><span class="cx"> return nullptr;
</span><span class="cx">
</span><span class="cx"> ASSERT(m_values->size() == m_wrappers->size());
</span><span class="lines">@@ -65,7 +65,7 @@
</span><span class="cx"> m_wrappers->append(wrapper);
</span><span class="cx">
</span><span class="cx"> ASSERT(m_values->size() == m_wrappers->size());
</span><del>- return wrapper;
</del><ins>+ return WTFMove(wrapper);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> private:
</span><span class="lines">@@ -76,5 +76,3 @@
</span><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> }
</span><del>-
-#endif // SVGListPropertyTearOff_h
</del></span></pre>
</div>
</div>
</body>
</html>