WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-70707-20111104115651.patch (text/plain), 24.65 KB, created by
Fady Samuel
on 2011-11-04 08:56:52 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Fady Samuel
Created:
2011-11-04 08:56:52 PDT
Size:
24.65 KB
patch
obsolete
>Subversion Revision: 99218 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index cb16e585f5de50a6da84e868277a831d08377299..0a10419f45dc204deb3c468106cd1d8ea99cb475 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,40 @@ >+2011-11-04 Fady Samuel <fsamuel@chromium.org> >+ >+ CSS Aspect Ratio Property Parsing Stage >+ https://bugs.webkit.org/show_bug.cgi?id=70707 >+ >+ Reviewed by Ojan Vafai. >+ >+ Added parsing support for -webkit-aspect-ratio CSS property. >+ The spec can be found here: http://www.xanthir.com/blog/b4810 >+ >+ Test: fast/css/aspect-ratio-parsing-tests.html >+ >+ * CMakeLists.txt: >+ * GNUmakefile.list.am: >+ * WebCore.gypi: >+ * WebCore.vcproj/WebCore.vcproj: >+ * css/CSSAspectRatioValue.cpp: Added. >+ (WebCore::CSSAspectRatioValue::~CSSAspectRatioValue): >+ (WebCore::CSSAspectRatioValue::cssText): >+ * css/CSSAspectRatioValue.h: Added. >+ (WebCore::CSSAspectRatioValue::create): >+ (WebCore::CSSAspectRatioValue::numeratorValue): >+ (WebCore::CSSAspectRatioValue::denominatorValue): >+ (WebCore::CSSAspectRatioValue::CSSAspectRatioValue): >+ * css/CSSComputedStyleDeclaration.cpp: >+ (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): >+ * css/CSSMutableStyleDeclaration.cpp: >+ * css/CSSParser.cpp: >+ (WebCore::CSSParser::parseValue): >+ (WebCore::CSSParser::parseAspectRatio): >+ * css/CSSParser.h: >+ * css/CSSProperty.cpp: >+ (WebCore::CSSProperty::isInheritedProperty): >+ * css/CSSPropertyNames.in: >+ * css/CSSStyleSelector.cpp: >+ (WebCore::CSSStyleSelector::applyProperty): >+ > 2011-11-03 Joshua Bell <jsbell@chromium.org> > > IndexedDB: Object stores not persisting between sessions >diff --git a/Source/WebCore/CMakeLists.txt b/Source/WebCore/CMakeLists.txt >index b92039023579bdbf9999ff3ccb8d468305056f3a..752969e9e2668aa6daa1c4c9ad5c2eef61d83ee1 100644 >--- a/Source/WebCore/CMakeLists.txt >+++ b/Source/WebCore/CMakeLists.txt >@@ -431,6 +431,7 @@ SET(WebCore_SOURCES > bindings/generic/ActiveDOMCallback.cpp > bindings/generic/RuntimeEnabledFeatures.cpp > >+ css/CSSAspectRatioValue.cpp > css/CSSBorderImageValue.cpp > css/CSSBorderImageSliceValue.cpp > css/CSSCanvasValue.cpp >diff --git a/Source/WebCore/GNUmakefile.list.am b/Source/WebCore/GNUmakefile.list.am >index 184825cccedb9be08b317ce019ee0e8a5fda4acc..23facde562a32a55952912b8cccbb4da4fb62f4d 100644 >--- a/Source/WebCore/GNUmakefile.list.am >+++ b/Source/WebCore/GNUmakefile.list.am >@@ -957,6 +957,8 @@ webcore_sources += \ > Source/WebCore/bridge/runtime_root.h \ > Source/WebCore/config.h \ > Source/WebCore/css/Counter.h \ >+ Source/WebCore/css/CSSAspectRatioValue.cpp \ >+ Source/WebCore/css/CSSAspectRatioValue.h \ > Source/WebCore/css/CSSBorderImageSliceValue.cpp \ > Source/WebCore/css/CSSBorderImageSliceValue.h \ > Source/WebCore/css/CSSBorderImageValue.cpp \ >diff --git a/Source/WebCore/WebCore.gypi b/Source/WebCore/WebCore.gypi >index 05f213e62ffbaa973f6719a2b0e2d16e206be2c1..23bedb3452c6c116fc5d5c689dfd86ab026e60ad 100644 >--- a/Source/WebCore/WebCore.gypi >+++ b/Source/WebCore/WebCore.gypi >@@ -2330,6 +2330,8 @@ > 'bridge/testbindings.mm', > 'bridge/testqtbindings.cpp', > 'config.h', >+ 'css/CSSAspectRatioValue.cpp', >+ 'css/CSSAspectRatioValue.h', > 'css/CSSBorderImageValue.cpp', > 'css/CSSBorderImageValue.h', > 'css/CSSBorderImageSliceValue.cpp', >diff --git a/Source/WebCore/WebCore.vcproj/WebCore.vcproj b/Source/WebCore/WebCore.vcproj/WebCore.vcproj >index fd69611fd8c4dbecc11e4ee5b260b2acb6904bea..dedb0e33aafa18cc942ba9a44069c2d38d079116 100755 >--- a/Source/WebCore/WebCore.vcproj/WebCore.vcproj >+++ b/Source/WebCore/WebCore.vcproj/WebCore.vcproj >@@ -32378,6 +32378,14 @@ > > > </File> > <File >+ RelativePath="..\css\CSSAspectRatioValue.cpp" >+ > >+ </File> >+ <File >+ RelativePath="..\css\CSSAspectRatioValue.h" >+ > >+ </File> >+ <File > RelativePath="..\css\CSSBorderImageSliceValue.cpp" > > > </File> >diff --git a/Source/WebCore/WebCore.xcodeproj/project.pbxproj b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >index 37328b3c59286f53672b8a220123bd3ed21b9af3..c7ddd60807912b9a3d21dfd2c7f57dca3480f188 100644 >--- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj >+++ b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >@@ -5455,6 +5455,8 @@ > C6F41047130C6E8900393DE4 /* EntryBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C6F41046130C6E8900393DE4 /* EntryBase.cpp */; }; > CA3BF67C10D99BAE00E6CE53 /* ScrollAnimator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CA3BF67B10D99BAE00E6CE53 /* ScrollAnimator.cpp */; }; > CA3BF67E10D99BAE00E6CE53 /* ScrollAnimator.h in Headers */ = {isa = PBXBuildFile; fileRef = CA3BF67D10D99BAE00E6CE53 /* ScrollAnimator.h */; settings = {ATTRIBUTES = (Private, ); }; }; >+ CAE9F90F146441F000C245B0 /* CSSAspectRatioValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CAE9F90D146441F000C245B0 /* CSSAspectRatioValue.cpp */; }; >+ CAE9F910146441F000C245B0 /* CSSAspectRatioValue.h in Headers */ = {isa = PBXBuildFile; fileRef = CAE9F90E146441F000C245B0 /* CSSAspectRatioValue.h */; }; > CD0DBF011422768500280263 /* IRC_Composite_C_R0195_T000_P000.wav in Copy Audio Resources */ = {isa = PBXBuildFile; fileRef = CD0DBD201422759500280263 /* IRC_Composite_C_R0195_T000_P000.wav */; }; > CD0DBF021422768500280263 /* IRC_Composite_C_R0195_T000_P015.wav in Copy Audio Resources */ = {isa = PBXBuildFile; fileRef = CD0DBD211422759500280263 /* IRC_Composite_C_R0195_T000_P015.wav */; }; > CD0DBF031422768500280263 /* IRC_Composite_C_R0195_T000_P030.wav in Copy Audio Resources */ = {isa = PBXBuildFile; fileRef = CD0DBD221422759500280263 /* IRC_Composite_C_R0195_T000_P030.wav */; }; >@@ -12735,6 +12737,8 @@ > C6F41046130C6E8900393DE4 /* EntryBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = EntryBase.cpp; path = fileapi/EntryBase.cpp; sourceTree = "<group>"; }; > CA3BF67B10D99BAE00E6CE53 /* ScrollAnimator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScrollAnimator.cpp; sourceTree = "<group>"; }; > CA3BF67D10D99BAE00E6CE53 /* ScrollAnimator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollAnimator.h; sourceTree = "<group>"; }; >+ CAE9F90D146441F000C245B0 /* CSSAspectRatioValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSAspectRatioValue.cpp; sourceTree = "<group>"; }; >+ CAE9F90E146441F000C245B0 /* CSSAspectRatioValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSAspectRatioValue.h; sourceTree = "<group>"; }; > CD0DBD201422759500280263 /* IRC_Composite_C_R0195_T000_P000.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; name = IRC_Composite_C_R0195_T000_P000.wav; path = platform/audio/resources/IRC_Composite_C_R0195_T000_P000.wav; sourceTree = SOURCE_ROOT; }; > CD0DBD211422759500280263 /* IRC_Composite_C_R0195_T000_P015.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; name = IRC_Composite_C_R0195_T000_P015.wav; path = platform/audio/resources/IRC_Composite_C_R0195_T000_P015.wav; sourceTree = SOURCE_ROOT; }; > CD0DBD221422759500280263 /* IRC_Composite_C_R0195_T000_P030.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; name = IRC_Composite_C_R0195_T000_P030.wav; path = platform/audio/resources/IRC_Composite_C_R0195_T000_P030.wav; sourceTree = SOURCE_ROOT; }; >@@ -20448,6 +20452,8 @@ > F523D18402DE42E8018635CA /* css */ = { > isa = PBXGroup; > children = ( >+ CAE9F90D146441F000C245B0 /* CSSAspectRatioValue.cpp */, >+ CAE9F90E146441F000C245B0 /* CSSAspectRatioValue.h */, > 93CA4C9C09DF93FA00DF8677 /* maketokenizer */, > A80E6CDA0A1989CA007FB8C5 /* Counter.h */, > 930705C709E0C95F00B17FE4 /* Counter.idl */, >@@ -24545,6 +24551,7 @@ > FD62F52E145898D80094B0ED /* AudioSourceProviderClient.h in Headers */, > 2D8FEBDD143E3EF70072502B /* CSSCrossfadeValue.h in Headers */, > 3169379C14609C6C00C01362 /* DragSession.h in Headers */, >+ CAE9F910146441F000C245B0 /* CSSAspectRatioValue.h in Headers */, > ); > runOnlyForDeploymentPostprocessing = 0; > }; >@@ -27391,6 +27398,7 @@ > A0EE0DF7144F825500F80B0D /* WebGLDebugShaders.cpp in Sources */, > A3BB59F31457A40D00AC56FE /* DocumentEventQueue.cpp in Sources */, > 2D8FEBDC143E3EF70072502B /* CSSCrossfadeValue.cpp in Sources */, >+ CAE9F90F146441F000C245B0 /* CSSAspectRatioValue.cpp in Sources */, > ); > runOnlyForDeploymentPostprocessing = 0; > }; >diff --git a/Source/WebCore/css/CSSAspectRatioValue.cpp b/Source/WebCore/css/CSSAspectRatioValue.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..6d8f9b105f77ce530c223e11b3436cb3b6ce69f2 >--- /dev/null >+++ b/Source/WebCore/css/CSSAspectRatioValue.cpp >@@ -0,0 +1,49 @@ >+/* >+ * Copyright (C) 2011 Google 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 Apple Computer, Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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 "CSSAspectRatioValue.h" >+ >+#include <wtf/text/StringBuilder.h> >+ >+namespace WebCore { >+ >+CSSAspectRatioValue::~CSSAspectRatioValue() >+{ >+} >+ >+String CSSAspectRatioValue::cssText() const >+{ >+ StringBuilder result; >+ result.append(String::number(m_numeratorValue)); >+ result.append("/"); >+ result.append(String::number(m_denominatorValue)); >+ return result.toString(); >+} >+ >+} >diff --git a/Source/WebCore/css/CSSAspectRatioValue.h b/Source/WebCore/css/CSSAspectRatioValue.h >new file mode 100644 >index 0000000000000000000000000000000000000000..fe0945e1dd4ce2e3f9614cbbb2b04169e66301dc >--- /dev/null >+++ b/Source/WebCore/css/CSSAspectRatioValue.h >@@ -0,0 +1,64 @@ >+/* >+ * Copyright (C) 2011 Google 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 Apple Computer, Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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. >+ */ >+ >+#ifndef CSSAspectRatioValue_h >+#define CSSAspectRatioValue_h >+ >+#include "CSSPrimitiveValue.h" >+#include "CSSValue.h" >+ >+namespace WebCore { >+ >+class CSSAspectRatioValue : public CSSValue { >+public: >+ static PassRefPtr<CSSAspectRatioValue> create(float numeratorValue, float denominatorValue) >+ { >+ return adoptRef(new CSSAspectRatioValue(numeratorValue, denominatorValue)); >+ } >+ >+ virtual ~CSSAspectRatioValue(); >+ >+ virtual String cssText() const; >+ >+ float numeratorValue() const { return m_numeratorValue; } >+ float denominatorValue() const { return m_denominatorValue; } >+ >+private: >+ CSSAspectRatioValue(float numeratorValue, float denominatorValue) >+ : m_numeratorValue(numeratorValue) >+ , m_denominatorValue(denominatorValue) >+ { >+ } >+ >+ float m_numeratorValue; >+ float m_denominatorValue; >+}; >+ >+} >+ >+#endif >diff --git a/Source/WebCore/css/CSSComputedStyleDeclaration.cpp b/Source/WebCore/css/CSSComputedStyleDeclaration.cpp >index d2a50dfcc67fde64ed437786b42b1d33cb0d2dea..956fb2a5b71a5f975e4d00b0563ee7204c7fefbd 100644 >--- a/Source/WebCore/css/CSSComputedStyleDeclaration.cpp >+++ b/Source/WebCore/css/CSSComputedStyleDeclaration.cpp >@@ -2033,6 +2033,7 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(int proper > break; > > /* Unimplemented CSS 3 properties (including CSS3 shorthand properties) */ >+ case CSSPropertyWebkitAspectRatio: > case CSSPropertyWebkitTextEmphasis: > case CSSPropertyTextLineThrough: > case CSSPropertyTextLineThroughColor: >diff --git a/Source/WebCore/css/CSSMutableStyleDeclaration.cpp b/Source/WebCore/css/CSSMutableStyleDeclaration.cpp >index 44cf807c6c613ac1bf9b08e562dcab14e45891a2..c4ebb8b06c12b62ee7737e2018f30d3505c1d9a1 100644 >--- a/Source/WebCore/css/CSSMutableStyleDeclaration.cpp >+++ b/Source/WebCore/css/CSSMutableStyleDeclaration.cpp >@@ -787,6 +787,7 @@ void CSSMutableStyleDeclaration::addSubresourceStyleURLs(ListHashSet<KURL>& urls > static const int blockProperties[] = { > CSSPropertyOrphans, > CSSPropertyOverflow, // This can be also be applied to replaced elements >+ CSSPropertyWebkitAspectRatio, > CSSPropertyWebkitColumnCount, > CSSPropertyWebkitColumnGap, > CSSPropertyWebkitColumnRuleColor, >diff --git a/Source/WebCore/css/CSSParser.cpp b/Source/WebCore/css/CSSParser.cpp >index d4fea74a3ebe2cd8bce93a68f8555924524e5954..61fe5a3733086d00615e55ef3f2989b27bcaa269 100644 >--- a/Source/WebCore/css/CSSParser.cpp >+++ b/Source/WebCore/css/CSSParser.cpp >@@ -25,6 +25,7 @@ > #include "config.h" > #include "CSSParser.h" > >+#include "CSSAspectRatioValue.h" > #include "CSSBorderImageValue.h" > #include "CSSCanvasValue.h" > #include "CSSCharsetRule.h" >@@ -1510,6 +1511,8 @@ bool CSSParser::parseValue(int propId, bool important) > return true; > } > case CSSPropertyBorderRadius: >+ case CSSPropertyWebkitAspectRatio: >+ return parseAspectRatio(important); > case CSSPropertyWebkitBorderRadius: > return parseBorderRadius(propId, important); > case CSSPropertyOutlineOffset: >@@ -5648,6 +5651,35 @@ bool CSSParser::parseBorderRadius(int propId, bool important) > return true; > } > >+bool CSSParser::parseAspectRatio(bool important) >+{ >+ unsigned num = m_valueList->size(); >+ if (num == 1 && m_valueList->valueAt(0)->id == CSSValueNone) { >+ addProperty(CSSPropertyWebkitAspectRatio, primitiveValueCache()->createIdentifierValue(CSSValueNone), important); >+ return true; >+ } >+ >+ if (num != 3) >+ return false; >+ >+ CSSParserValue* lvalue = m_valueList->valueAt(0); >+ CSSParserValue* op = m_valueList->valueAt(1); >+ CSSParserValue* rvalue = m_valueList->valueAt(2); >+ >+ if (op->unit != CSSParserValue::Operator || op->iValue != '/') >+ return false; >+ >+ if (!validUnit(lvalue, FNumber | FNonNeg, m_strict) || !validUnit(rvalue, FNumber | FNonNeg, m_strict)) >+ return false; >+ >+ if (!lvalue->fValue || !rvalue->fValue) >+ return false; >+ >+ addProperty(CSSPropertyWebkitAspectRatio, CSSAspectRatioValue::create(lvalue->fValue, rvalue->fValue), important); >+ >+ return true; >+} >+ > bool CSSParser::parseCounter(int propId, int defaultValue, bool important) > { > enum { ID, VAL } state = ID; >diff --git a/Source/WebCore/css/CSSParser.h b/Source/WebCore/css/CSSParser.h >index 744d3c75c95e0ca194ca2e58078b9d2eaf5720a2..b12e8c92187f5a01542aab9b072dd0a88e74d1d3 100644 >--- a/Source/WebCore/css/CSSParser.h >+++ b/Source/WebCore/css/CSSParser.h >@@ -171,6 +171,8 @@ public: > bool parseBorderImageOutset(RefPtr<CSSPrimitiveValue>&); > bool parseBorderRadius(int propId, bool important); > >+ bool parseAspectRatio(bool important); >+ > bool parseReflect(int propId, bool important); > > bool parseFlex(int propId, bool important); >diff --git a/Source/WebCore/css/CSSProperty.cpp b/Source/WebCore/css/CSSProperty.cpp >index 3e7df5115b9bea270b27cee8cc98031894880ae3..de7c9273b79d678dfd03648d736db77ac5ac8992 100644 >--- a/Source/WebCore/css/CSSProperty.cpp >+++ b/Source/WebCore/css/CSSProperty.cpp >@@ -317,6 +317,7 @@ bool CSSProperty::isInheritedProperty(unsigned propertyID) > case CSSPropertyTextShadow: > case CSSPropertyTextTransform: > case CSSPropertyVisibility: >+ case CSSPropertyWebkitAspectRatio: > case CSSPropertyWebkitBorderHorizontalSpacing: > case CSSPropertyWebkitBorderVerticalSpacing: > case CSSPropertyWebkitBoxDirection: >diff --git a/Source/WebCore/css/CSSPropertyNames.in b/Source/WebCore/css/CSSPropertyNames.in >index d1ef2aed25d4410ca6328a04cf7b6ae25dab734f..52944d82e9cda7bb57ddca66eeec9e9c6999bde1 100644 >--- a/Source/WebCore/css/CSSPropertyNames.in >+++ b/Source/WebCore/css/CSSPropertyNames.in >@@ -193,6 +193,7 @@ z-index > -webkit-animation-play-state > -webkit-animation-timing-function > -webkit-appearance >+-webkit-aspect-ratio > -webkit-backface-visibility > -webkit-background-clip > -webkit-background-composite >diff --git a/Source/WebCore/css/CSSStyleSelector.cpp b/Source/WebCore/css/CSSStyleSelector.cpp >index bae736f799ad60abe97c616a7c9761672a7c4aa8..34f063b87198105c6d9c827d76bc36a714daf4b4 100644 >--- a/Source/WebCore/css/CSSStyleSelector.cpp >+++ b/Source/WebCore/css/CSSStyleSelector.cpp >@@ -3772,6 +3772,7 @@ void CSSStyleSelector::applyProperty(int id, CSSValue *value) > case CSSPropertyTextUnderlineMode: > case CSSPropertyTextUnderlineStyle: > case CSSPropertyTextUnderlineWidth: >+ case CSSPropertyWebkitAspectRatio: > case CSSPropertyWebkitFontSizeDelta: > case CSSPropertyWebkitTextDecorationsInEffect: > case CSSPropertyWebkitTextStroke: >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 34a27ad4a2f92c55f1fc83b1d76bf4de9a1f190e..9b93a1c1dced5b351099939131b32a8c76493b77 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,13 @@ >+2011-11-04 Fady Samuel <fsamuel@chromium.org> >+ >+ CSS Aspect Ratio Property Parsing Stage >+ https://bugs.webkit.org/show_bug.cgi?id=70707 >+ >+ Reviewed by Ojan Vafai. >+ >+ * fast/css/aspect-ratio-parsing-tests-expected.txt: Added. >+ * fast/css/aspect-ratio-parsing-tests.html: Added. >+ > 2011-11-03 Csaba Osztrogonác <ossy@webkit.org> > > [Qt] Unreviewed evening gardening. >diff --git a/LayoutTests/fast/css/aspect-ratio-parsing-tests-expected.txt b/LayoutTests/fast/css/aspect-ratio-parsing-tests-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..d14eb4b624cdcc89db449f46c17f94a23496e06c >--- /dev/null >+++ b/LayoutTests/fast/css/aspect-ratio-parsing-tests-expected.txt >@@ -0,0 +1,27 @@ >+CSS Aspect Ratio Parsing Test >+ >+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". >+ >+ >+PASS testParsing("aspectRatioTest", "2/1", "-webkit-aspect-ratio") is "2/1" >+PASS testParsing("aspectRatioTest", "1/1", "-webkit-aspect-ratio") is "1/1" >+PASS testParsing("aspectRatioTest", "1/4", "-webkit-aspect-ratio") is "1/4" >+PASS testParsing("aspectRatioTest", "1 / 2", "-webkit-aspect-ratio") is "1/2" >+PASS testParsing("aspectRatioTest", "1.2 / 2", "-webkit-aspect-ratio") is "1.2/2" >+PASS testParsing("aspectRatioTest", "2 / 0.5", "-webkit-aspect-ratio") is "2/0.5" >+PASS testParsing("aspectRatioTest", "none", "-webkit-aspect-ratio") is "none" >+PASS testParsing("aspectRatioTest", "1 2", "-webkit-aspect-ratio") is "none" >+PASS testParsing("aspectRatioTest", "a/1", "-webkit-aspect-ratio") is "none" >+PASS testParsing("aspectRatioTest", "1/a", "-webkit-aspect-ratio") is "none" >+PASS testParsing("aspectRatioTest", "abc123", "-webkit-aspect-ratio") is "none" >+PASS testParsing("aspectRatioTest", "1", "-webkit-aspect-ratio") is "none" >+PASS testParsing("aspectRatioTest", "1 / 0", "-webkit-aspect-ratio") is "none" >+PASS testParsing("aspectRatioTest", "0 / 1", "-webkit-aspect-ratio") is "none" >+PASS testParsing("aspectRatioTest", "0 / 0", "-webkit-aspect-ratio") is "none" >+PASS testParsing("aspectRatioTest", "-1 / 8", "-webkit-aspect-ratio") is "none" >+PASS testParsing("aspectRatioTest", "1 / -9", "-webkit-aspect-ratio") is "none" >+PASS testParsing("aspectRatioTest", "-1 / -4", "-webkit-aspect-ratio") is "none" >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+ >diff --git a/LayoutTests/fast/css/aspect-ratio-parsing-tests.html b/LayoutTests/fast/css/aspect-ratio-parsing-tests.html >new file mode 100644 >index 0000000000000000000000000000000000000000..94ecd8406f316aa199094040b72797b3305ef67a >--- /dev/null >+++ b/LayoutTests/fast/css/aspect-ratio-parsing-tests.html >@@ -0,0 +1,43 @@ >+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> >+<html> >+ <head> >+ <link rel="stylesheet" href="../../fast/js/resources/js-test-style.css"> >+ <script src="../../fast/js/resources/js-test-pre.js"></script> >+ </head> >+ <body> >+ <p id="description"></p> >+ <div id="console"></div> >+ <div id="aspectRatioTest"></div> >+ <script> >+ description('CSS Aspect Ratio Parsing Test'); >+ function testParsing(elementId, value, styleAttribute) >+ { >+ var div = document.getElementById(elementId); >+ div.style[styleAttribute] = value; >+ return div.style[styleAttribute]; >+ } >+ >+ shouldBeEqualToString('testParsing("aspectRatioTest", "2/1", "-webkit-aspect-ratio")', '2/1'); >+ shouldBeEqualToString('testParsing("aspectRatioTest", "1/1", "-webkit-aspect-ratio")', '1/1'); >+ shouldBeEqualToString('testParsing("aspectRatioTest", "1/4", "-webkit-aspect-ratio")', '1/4'); >+ shouldBeEqualToString('testParsing("aspectRatioTest", "1 / 2", "-webkit-aspect-ratio")', '1/2'); >+ shouldBeEqualToString('testParsing("aspectRatioTest", "1.2 / 2", "-webkit-aspect-ratio")', '1.2/2'); >+ shouldBeEqualToString('testParsing("aspectRatioTest", "2 / 0.5", "-webkit-aspect-ratio")', '2/0.5'); >+ shouldBeEqualToString('testParsing("aspectRatioTest", "none", "-webkit-aspect-ratio")', 'none'); >+ >+ // The following are invalid and should get ignored. >+ shouldBeEqualToString('testParsing("aspectRatioTest", "1 2", "-webkit-aspect-ratio")', 'none'); >+ shouldBeEqualToString('testParsing("aspectRatioTest", "a/1", "-webkit-aspect-ratio")', 'none'); >+ shouldBeEqualToString('testParsing("aspectRatioTest", "1/a", "-webkit-aspect-ratio")', 'none'); >+ shouldBeEqualToString('testParsing("aspectRatioTest", "abc123", "-webkit-aspect-ratio")', 'none'); >+ shouldBeEqualToString('testParsing("aspectRatioTest", "1", "-webkit-aspect-ratio")', 'none'); >+ shouldBeEqualToString('testParsing("aspectRatioTest", "1 / 0", "-webkit-aspect-ratio")', 'none'); >+ shouldBeEqualToString('testParsing("aspectRatioTest", "0 / 1", "-webkit-aspect-ratio")', 'none'); >+ shouldBeEqualToString('testParsing("aspectRatioTest", "0 / 0", "-webkit-aspect-ratio")', 'none'); >+ shouldBeEqualToString('testParsing("aspectRatioTest", "-1 / 8", "-webkit-aspect-ratio")', 'none'); >+ shouldBeEqualToString('testParsing("aspectRatioTest", "1 / -9", "-webkit-aspect-ratio")', 'none'); >+ shouldBeEqualToString('testParsing("aspectRatioTest", "-1 / -4", "-webkit-aspect-ratio")', 'none'); >+ </script> >+ <script src="../../fast/js/resources/js-test-post.js"></script> >+ </body> >+</html>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 70707
:
112139
|
112144
|
112148
|
112980
|
113072
|
113241
|
113585
|
113609
|
113610
|
113612
|
113613
|
113654
|
113660
|
113662
|
113664
|
113685