<!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>[204177] 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/204177">204177</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2016-08-05 10:43:45 -0700 (Fri, 05 Aug 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>Unreviewed, rolling out <a href="http://trac.webkit.org/projects/webkit/changeset/204147">r204147</a>.
https://bugs.webkit.org/show_bug.cgi?id=160602
Considering another implementation (Requested by eric_carlson
on #webkit).
Reverted changeset:
"Add long, boolean, double, and String Media Constraint
classes"
https://bugs.webkit.org/show_bug.cgi?id=160524
http://trac.webkit.org/changeset/204147</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="#trunkSourceWebCoreplatformmediastreamMediaConstraintsh">trunk/Source/WebCore/platform/mediastream/MediaConstraints.h</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreplatformmediastreamMediaConstraintscpp">trunk/Source/WebCore/platform/mediastream/MediaConstraints.cpp</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (204176 => 204177)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-08-05 17:08:22 UTC (rev 204176)
+++ trunk/Source/WebCore/ChangeLog        2016-08-05 17:43:45 UTC (rev 204177)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2016-08-05 Commit Queue <commit-queue@webkit.org>
+
+ Unreviewed, rolling out r204147.
+ https://bugs.webkit.org/show_bug.cgi?id=160602
+
+ Considering another implementation (Requested by eric_carlson
+ on #webkit).
+
+ Reverted changeset:
+
+ "Add long, boolean, double, and String Media Constraint
+ classes"
+ https://bugs.webkit.org/show_bug.cgi?id=160524
+ http://trac.webkit.org/changeset/204147
+
</ins><span class="cx"> 2016-08-05 John Wilander <wilander@apple.com>
</span><span class="cx">
</span><span class="cx"> Popups opened from a sandboxed iframe should themselves be sandboxed
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (204176 => 204177)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-08-05 17:08:22 UTC (rev 204176)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-08-05 17:43:45 UTC (rev 204177)
</span><span class="lines">@@ -1021,7 +1021,6 @@
</span><span class="cx">                 1AFE119A0CBFFCC4003017FA /* JSSQLResultSetRowList.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AFE11980CBFFCC4003017FA /* JSSQLResultSetRowList.h */; };
</span><span class="cx">                 1B124D8D1D380B7000ECDFB0 /* MediaSampleAVFObjC.h in Headers */ = {isa = PBXBuildFile; fileRef = 1B124D8C1D380B7000ECDFB0 /* MediaSampleAVFObjC.h */; };
</span><span class="cx">                 1B124D8F1D380BB600ECDFB0 /* MediaSampleAVFObjC.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1B124D8E1D380BB600ECDFB0 /* MediaSampleAVFObjC.mm */; };
</span><del>-                1BE5BFC21D515715001666D9 /* MediaConstraints.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1BE5BFC11D515715001666D9 /* MediaConstraints.cpp */; };
</del><span class="cx">                 1BF9DB3C1D3973AD0026AEB7 /* MediaSample.h in Headers */ = {isa = PBXBuildFile; fileRef = CD641EC7181ED60100EE4C41 /* MediaSample.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 1C010700192594DF008A4201 /* InlineTextBoxStyle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1C0106FE192594DF008A4201 /* InlineTextBoxStyle.cpp */; };
</span><span class="cx">                 1C010701192594DF008A4201 /* InlineTextBoxStyle.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C0106FF192594DF008A4201 /* InlineTextBoxStyle.h */; };
</span><span class="lines">@@ -8244,7 +8243,6 @@
</span><span class="cx">                 1AFE11980CBFFCC4003017FA /* JSSQLResultSetRowList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSSQLResultSetRowList.h; sourceTree = "<group>"; };
</span><span class="cx">                 1B124D8C1D380B7000ECDFB0 /* MediaSampleAVFObjC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MediaSampleAVFObjC.h; path = ../MediaSampleAVFObjC.h; sourceTree = "<group>"; };
</span><span class="cx">                 1B124D8E1D380BB600ECDFB0 /* MediaSampleAVFObjC.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MediaSampleAVFObjC.mm; sourceTree = "<group>"; };
</span><del>-                1BE5BFC11D515715001666D9 /* MediaConstraints.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaConstraints.cpp; sourceTree = "<group>"; };
</del><span class="cx">                 1C0106FE192594DF008A4201 /* InlineTextBoxStyle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InlineTextBoxStyle.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 1C0106FF192594DF008A4201 /* InlineTextBoxStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InlineTextBoxStyle.h; sourceTree = "<group>"; };
</span><span class="cx">                 1C0939E81A13E12900B788E5 /* CachedSVGFont.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CachedSVGFont.cpp; sourceTree = "<group>"; };
</span><span class="lines">@@ -15237,7 +15235,6 @@
</span><span class="cx">                 07221B9217CF0AD400848E51 /* mediastream */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><del>-                                1BE5BFC11D515715001666D9 /* MediaConstraints.cpp */,
</del><span class="cx">                                 0729B14D17CFCCA0004F1D60 /* mac */,
</span><span class="cx">                                 07D6A4F61BF2307D00174146 /* AudioTrackPrivateMediaStream.h */,
</span><span class="cx">                                 5EBB89301C7777E100C65D41 /* IceCandidate.h */,
</span><span class="lines">@@ -31374,7 +31371,6 @@
</span><span class="cx">                                 B2227A460D00BF220071B782 /* SVGMaskElement.cpp in Sources */,
</span><span class="cx">                                 B2227A4A0D00BF220071B782 /* SVGMetadataElement.cpp in Sources */,
</span><span class="cx">                                 B2A1F2B00CEF0ABF00442F6A /* SVGMissingGlyphElement.cpp in Sources */,
</span><del>-                                1BE5BFC21D515715001666D9 /* MediaConstraints.cpp in Sources */,
</del><span class="cx">                                 B2227A4D0D00BF220071B782 /* SVGMPathElement.cpp in Sources */,
</span><span class="cx">                                 A833C7CA0A2CF06B00D57664 /* SVGNames.cpp in Sources */,
</span><span class="cx">                                 B2227A500D00BF220071B782 /* SVGNumberList.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreamMediaConstraintscpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/mediastream/MediaConstraints.cpp (204176 => 204177)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/MediaConstraints.cpp        2016-08-05 17:08:22 UTC (rev 204176)
+++ trunk/Source/WebCore/platform/mediastream/MediaConstraints.cpp        2016-08-05 17:43:45 UTC (rev 204177)
</span><span class="lines">@@ -1,240 +0,0 @@
</span><del>-/*
- * Copyright (C) 2016 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- * 3. Neither the name of Google Inc. nor the names of its contributors
- * may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "MediaConstraints.h"
-
-#include "Dictionary.h"
-#include "Logging.h"
-#include "RealtimeMediaSourceCenter.h"
-#include "RealtimeMediaSourceSupportedConstraints.h"
-
-namespace WebCore {
-
-RefPtr<BaseConstraint> BaseConstraint::create(const String& name, const Dictionary& dictionary)
-{
- RefPtr<BaseConstraint> constraint = createEmptyDerivedConstraint(name);
- if (!constraint)
- return nullptr;
-
- constraint->initializeWithDictionary(dictionary);
- return constraint;
-}
-
-RefPtr<BaseConstraint> BaseConstraint::createEmptyDerivedConstraint(const String& name)
-{
- const RealtimeMediaSourceSupportedConstraints& supportedConstraints = RealtimeMediaSourceCenter::singleton().supportedConstraints();
- MediaConstraintType constraintType = supportedConstraints.constraintFromName(name);
-
- switch (constraintType) {
- case MediaConstraintType::Width:
- case MediaConstraintType::Height:
- case MediaConstraintType::SampleRate:
- case MediaConstraintType::SampleSize:
- return LongConstraint::create(name);
- case MediaConstraintType::AspectRatio:
- case MediaConstraintType::FrameRate:
- case MediaConstraintType::Volume:
- return DoubleConstraint::create(name);
- case MediaConstraintType::EchoCancellation:
- return BooleanConstraint::create(name);
- case MediaConstraintType::FacingMode:
- case MediaConstraintType::DeviceId:
- case MediaConstraintType::GroupId:
- return StringConstraint::create(name);
- case MediaConstraintType::Unknown:
- return nullptr;
- }
-}
-
-Ref<LongConstraint> LongConstraint::create(const String& name)
-{
- return adoptRef(*new LongConstraint(name));
-}
-
-void LongConstraint::setMin(long value)
-{
- m_min = value;
- setHasMin(true);
-}
-
-void LongConstraint::setMax(long value)
-{
- m_max = value;
- setHasMax(true);
-}
-
-void LongConstraint::setExact(long value)
-{
- m_exact = value;
- setHasExact(true);
-}
-
-void LongConstraint::setIdeal(long value)
-{
- m_ideal = value;
- setHasIdeal(true);
-}
-
-void LongConstraint::initializeWithDictionary(const Dictionary& dictionaryConstraintValue)
-{
-
- long minValue;
- if (dictionaryConstraintValue.get("min", minValue))
- setMin(minValue);
-
- long maxValue;
- if (dictionaryConstraintValue.get("max", maxValue))
- setMax(maxValue);
-
- long exactValue;
- if (dictionaryConstraintValue.get("exact", exactValue))
- setExact(exactValue);
-
- long idealValue;
- if (dictionaryConstraintValue.get("ideal", idealValue))
- setIdeal(idealValue);
-
- if (isEmpty())
- LOG(Media, "LongConstraint::initializeWithDictionary(%p) - ignoring constraint since it has no valid or supported key/value pairs.", this);
-}
-
-Ref<DoubleConstraint> DoubleConstraint::create(const String& name)
-{
- return adoptRef(*new DoubleConstraint(name));
-}
-
-void DoubleConstraint::setMin(double value)
-{
- m_min = value;
- setHasMin(true);
-}
-
-void DoubleConstraint::setMax(double value)
-{
- m_max = value;
- setHasMax(true);
-}
-
-void DoubleConstraint::setExact(double value)
-{
- m_exact = value;
- setHasExact(true);
-}
-
-void DoubleConstraint::setIdeal(double value)
-{
- m_ideal = value;
- setHasIdeal(true);
-}
-
-void DoubleConstraint::initializeWithDictionary(const Dictionary& dictionaryConstraintValue)
-{
- double minValue;
- if (dictionaryConstraintValue.get("min", minValue))
- setMin(minValue);
-
- double maxValue;
- if (dictionaryConstraintValue.get("max", maxValue))
- setMax(maxValue);
-
- double exactValue;
- if (dictionaryConstraintValue.get("exact", exactValue))
- setExact(exactValue);
-
- double idealValue;
- if (dictionaryConstraintValue.get("ideal", idealValue))
- setIdeal(idealValue);
-
- if (isEmpty())
- LOG(Media, "DoubleConstraints::initializeWithDictionary(%p) - ignoring constraint since it has no valid or supported key/value pairs.", this);
-}
-
-Ref<BooleanConstraint> BooleanConstraint::create(const String& name)
-{
- return adoptRef(*new BooleanConstraint(name));
-}
-
-void BooleanConstraint::setExact(bool value)
-{
- m_exact = value;
- m_hasExact = true;
-}
-
-void BooleanConstraint::setIdeal(bool value)
-{
- m_ideal = value;
- m_hasIdeal = true;
-}
-
-void BooleanConstraint::initializeWithDictionary(const Dictionary& dictionaryConstraintValue)
-{
- bool exactValue;
- if (dictionaryConstraintValue.get("exact", exactValue))
- setExact(exactValue);
-
- bool idealValue;
- if (dictionaryConstraintValue.get("ideal", idealValue))
- setIdeal(idealValue);
-
- if (isEmpty())
- LOG(Media, "BooleanConstraint::initializeWithDictionary(%p) - ignoring constraint since it has no valid or supported key/value pairs.", this);
-}
-
-Ref<StringConstraint> StringConstraint::create(const String& name)
-{
- return adoptRef(*new StringConstraint(name));
-}
-
-void StringConstraint::setExact(const String& value)
-{
- m_exact = value;
-}
-
-void StringConstraint::setIdeal(const String& value)
-{
- m_ideal = value;
-}
-
-void StringConstraint::initializeWithDictionary(const Dictionary& dictionaryConstraintValue)
-{
- String exactValue;
- if (dictionaryConstraintValue.get("exact", exactValue) && !exactValue.isNull() && !exactValue.isEmpty())
- setExact(exactValue);
-
- String idealValue;
- if (dictionaryConstraintValue.get("ideal", idealValue) && !idealValue.isNull() && !idealValue.isEmpty())
- setIdeal(idealValue);
-
- if (isEmpty())
- LOG(Media, "StringConstraint::initializeWithDictionary(%p) - ignoring constraint since it has no valid or supported key/value pairs.", this);
-}
-
-}
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreamMediaConstraintsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mediastream/MediaConstraints.h (204176 => 204177)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/MediaConstraints.h        2016-08-05 17:08:22 UTC (rev 204176)
+++ trunk/Source/WebCore/platform/mediastream/MediaConstraints.h        2016-08-05 17:43:45 UTC (rev 204177)
</span><span class="lines">@@ -1,6 +1,5 @@
</span><span class="cx"> /*
</span><span class="cx"> * Copyright (C) 2012 Google Inc. All rights reserved.
</span><del>- * Copyright (C) 2016 Apple Inc. All rights reserved.
</del><span class="cx"> *
</span><span class="cx"> * Redistribution and use in source and binary forms, with or without
</span><span class="cx"> * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -39,175 +38,6 @@
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>-class Dictionary;
-
-class BaseConstraint : public RefCounted<BaseConstraint> {
-public:
- static RefPtr<BaseConstraint> create(const String& name, const Dictionary&);
-
- virtual ~BaseConstraint() { };
- virtual bool isEmpty() const = 0;
- virtual bool isMandatory() const = 0;
-
- virtual bool hasIdeal() const = 0;
-
- String name() const { return m_name; }
-
-protected:
- explicit BaseConstraint(const String& name)
- : m_name(name)
- {
- }
-
-private:
- static RefPtr<BaseConstraint> createEmptyDerivedConstraint(const String& name);
-
- virtual void initializeWithDictionary(const Dictionary&) = 0;
-
- String m_name;
-};
-
-class NumericConstraint : public BaseConstraint {
-public:
- void setHasMin(bool value) { m_hasMin = value; }
- void setHasMax(bool value) { m_hasMax = value; }
- void setHasExact(bool value) { m_hasExact = value; }
- void setHasIdeal(bool value) { m_hasIdeal = value; }
-
- bool hasMin() const { return m_hasMin; }
- bool hasMax() const { return m_hasMax; }
- bool hasExact() const { return m_hasExact; }
- bool hasIdeal() const override { return m_hasIdeal; }
-
- bool isEmpty() const override { return !m_hasMin && !m_hasMax && !m_hasExact && !m_hasIdeal; }
- bool isMandatory() const override { return m_hasMin || m_hasMax || m_hasExact; }
-
-protected:
- explicit NumericConstraint(const String& name)
- : BaseConstraint(name)
- {
- }
-
-private:
- bool m_hasMin { false };
- bool m_hasMax { false };
- bool m_hasExact { false };
- bool m_hasIdeal { false };
-};
-
-class LongConstraint final : public NumericConstraint {
-public:
- static Ref<LongConstraint> create(const String& name);
-
- void setMin(long value);
- void setMax(long value);
- void setExact(long value);
- void setIdeal(long value);
-
- long min() const { return m_min; }
- long max() const { return m_max; }
- long exact() const { return m_exact; }
- long ideal() const { return m_ideal; }
-
-private:
- explicit LongConstraint(const String& name)
- : WebCore::NumericConstraint(name)
- {
- }
-
- void initializeWithDictionary(const Dictionary&) override;
-
- long m_min;
- long m_max;
- long m_exact;
- long m_ideal;
-};
-
-class DoubleConstraint final : public NumericConstraint {
-public:
- static Ref<DoubleConstraint> create(const String& name);
-
- void setMin(double value);
- void setMax(double value);
- void setExact(double value);
- void setIdeal(double value);
-
- double min() const { return m_min; }
- double max() const { return m_max; }
- double exact() const { return m_exact; }
- double ideal() const { return m_ideal; }
-
-private:
- explicit DoubleConstraint(const String& name)
- : WebCore::NumericConstraint(name)
- {
- }
-
- void initializeWithDictionary(const Dictionary&) override;
-
- double m_min;
- double m_max;
- double m_exact;
- double m_ideal;
-};
-
-class BooleanConstraint final : public BaseConstraint {
-public:
- static Ref<BooleanConstraint> create(const String& name);
-
- void setExact(bool value);
- void setIdeal(bool value);
-
- bool exact() const { return m_exact; }
- bool ideal() const { return m_ideal; }
- bool hasExact() const { return m_hasExact; }
- bool hasIdeal() const override { return m_hasIdeal; }
-
- bool isEmpty() const override { return !m_hasExact && !m_hasIdeal; };
- bool isMandatory() const override { return m_hasExact; }
-
-private:
- explicit BooleanConstraint(const String& name)
- : BaseConstraint(name)
- {
- }
-
- void initializeWithDictionary(const Dictionary&) override;
-
- bool m_exact { false };
- bool m_ideal { false };
- bool m_hasExact { false };
- bool m_hasIdeal { false };
-};
-
-class StringConstraint final : public BaseConstraint {
-public:
- static Ref<StringConstraint> create(const String& name);
-
- void setExact(const String&);
- void setIdeal(const String&);
-
- const String& exact() const { return m_exact; }
- const String& ideal() const { return m_ideal; }
-
- bool hasExact() const { return !m_exact.isEmpty(); }
- bool hasIdeal() const override { return !m_ideal.isEmpty(); }
-
- bool isEmpty() const override { return m_exact.isEmpty() && m_ideal.isEmpty(); }
- bool isMandatory() const override { return !m_exact.isEmpty(); }
-
-private:
- explicit StringConstraint(const String& name)
- : BaseConstraint(name)
- {
- }
-
- void initializeWithDictionary(const Dictionary&) override;
-
- String m_exact;
- String m_ideal;
-};
-
</del><span class="cx"> struct MediaConstraint {
</span><span class="cx"> MediaConstraint(String name, String value)
</span><span class="cx"> : m_name(name)
</span></span></pre>
</div>
</div>
</body>
</html>