Changeset 109807 in webkit
- Timestamp:
- Mar 5, 2012 3:31:50 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r109806 r109807 1 2012-03-05 Mihnea Ovidenie <mihnea@adobe.com> 2 3 [CSSRegions][CSSOM]Prevent creation of NamedFlow object for invalid flow name 4 https://bugs.webkit.org/show_bug.cgi?id=79685 5 6 Reviewed by David Hyatt. 7 8 Asking for a named flow with an invalid flow name should return a null object. 9 10 * fast/regions/webkit-named-flow-invalid-name-expected.txt: Added. 11 * fast/regions/webkit-named-flow-invalid-name.html: Added. 12 1 13 2012-03-02 Ryosuke Niwa <rniwa@webkit.org> 2 14 -
trunk/Source/WebCore/ChangeLog
r109806 r109807 1 2012-03-05 Mihnea Ovidenie <mihnea@adobe.com> 2 3 [CSSRegions][CSSOM]Prevent creation of NamedFlow object for invalid flow name 4 https://bugs.webkit.org/show_bug.cgi?id=79685 5 6 Reviewed by David Hyatt. 7 8 Asking for a named flow with an invalid flow name should return a null object. 9 10 Test: fast/regions/webkit-named-flow-invalid-name.html 11 12 * css/CSSParser.cpp: 13 (WebCore::CSSParser::parseFlowThread): 14 (WebCore): 15 * css/CSSParser.h: 16 * dom/Document.cpp: 17 (WebCore::validFlowName): 18 (WebCore): 19 (WebCore::Document::webkitGetFlowByName): 20 1 21 2012-03-05 Ryosuke Niwa <rniwa@webkit.org> 2 22 -
trunk/Source/WebCore/css/CSSParser.cpp
r109806 r109807 7109 7109 } 7110 7110 7111 // auto | <ident> 7111 bool CSSParser::parseFlowThread(const String& flowName, Document* doc) 7112 { 7113 ASSERT(doc); 7114 ASSERT(doc->cssRegionsEnabled()); 7115 7116 RefPtr<CSSStyleSheet> dummyStyleSheet = CSSStyleSheet::create(doc); 7117 setStyleSheet(dummyStyleSheet.get()); 7118 7119 setupParser("@-webkit-decls{-webkit-flow-into:", flowName, "}"); 7120 cssyyparse(this); 7121 7122 m_rule = 0; 7123 7124 return (m_numParsedProperties && m_parsedProperties[0]->m_id == CSSPropertyWebkitFlowInto); 7125 } 7126 7127 // none | <ident> 7112 7128 bool CSSParser::parseFlowThread(int propId, bool important) 7113 7129 { -
trunk/Source/WebCore/css/CSSParser.h
r108750 r109807 216 216 217 217 bool cssRegionsEnabled() const; 218 bool parseFlowThread(const String& flowName, Document*); 218 219 bool parseFlowThread(int propId, bool important); 219 220 bool parseRegionThread(int propId, bool important); -
trunk/Source/WebCore/dom/Document.cpp
r109785 r109807 34 34 #include "Attribute.h" 35 35 #include "CDATASection.h" 36 #include "CSSParser.h" 36 37 #include "CSSStyleDeclaration.h" 37 38 #include "CSSStyleSelector.h" … … 1021 1022 } 1022 1023 1024 static bool validFlowName(const String& flowName) 1025 { 1026 if (equalIgnoringCase(flowName, "auto") 1027 || equalIgnoringCase(flowName, "default") 1028 || equalIgnoringCase(flowName, "inherit") 1029 || equalIgnoringCase(flowName, "initial") 1030 || equalIgnoringCase(flowName, "none")) 1031 return false; 1032 return true; 1033 } 1034 1023 1035 PassRefPtr<WebKitNamedFlow> Document::webkitGetFlowByName(const String& flowName) 1024 1036 { 1025 if (!cssRegionsEnabled() )1037 if (!cssRegionsEnabled() || flowName.isEmpty() || !validFlowName(flowName) || !renderer()) 1026 1038 return 0; 1027 if (!renderer()) 1039 1040 // Make a slower check for invalid flow name 1041 CSSParser p(true); 1042 if (!p.parseFlowThread(flowName, this)) 1028 1043 return 0; 1044 1029 1045 if (RenderView* view = renderer()->view()) 1030 1046 return view->ensureRenderFlowThreadWithName(flowName)->ensureNamedFlow();
Note: See TracChangeset
for help on using the changeset viewer.