Changeset 10989
- Timestamp:
- 05/03/08 02:28:10 (5 years ago)
- Location:
- lang/actionscript/ascss/src
- Files:
-
- 3 modified
-
SelectTest.as (modified) (3 diffs)
-
SelectTest.swf (modified) (previous)
-
css/CSSStyleSelector.as (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
lang/actionscript/ascss/src/SelectTest.as
r10984 r10989 15 15 16 16 public static const TestCSS:String = 17 '.index em[title |="important"] {\n'+17 '.index em[title~="foobar"] {\n'+ 18 18 ' color: #940;\n'+ 19 19 '}\n\n'+ … … 21 21 ' background-color: #ffe;\n'+ 22 22 '}\n\n'+ 23 '.index em[title |="foobar"] {\n'+23 '.index em[title~="fooba"] {\n'+ 24 24 ' background-color: #f7e;\n'+ 25 25 '}\n\n'+ … … 30 30 public static const TestDoc:XML = 31 31 <body class="new index"> 32 <em class="em1" title="important-1 ">foobar</em>32 <em class="em1" title="important-1 foobar">foobar</em> 33 33 </body> 34 34 ; -
lang/actionscript/ascss/src/css/CSSStyleSelector.as
r10985 r10989 431 431 return false; 432 432 break; 433 case CSSSelector.List: 434 { 435 // Ignore empty selectors or selectors containing spaces 436 if (str_contains(sel.m_value, ' ', false) || sel.m_value == "") 437 return false; 438 439 var startSearchAt:int = 0; 440 var s_val:String = value; 441 var s_sel:String = sel.m_value; 442 443 if (caseSensitive) 444 { 445 s_val = s_val.toLowerCase(); 446 s_sel = s_sel.toLowerCase(); 447 } 448 449 while (true) { 450 var foundPos:int = s_val.indexOf(s_sel, startSearchAt); 451 if (foundPos == -1) 452 return false; 453 if (foundPos == 0 || value.charAt(foundPos-1) == ' ') { 454 var endStr:uint = foundPos + sel.m_value.length; 455 if (endStr == value.length || value.charAt(endStr) == ' ') 456 break; // We found a match. 457 } 458 459 // No match. Keep looking. 460 startSearchAt = foundPos + 1; 461 } 462 break; 463 } 433 464 case CSSSelector.Contain: 434 465 if (!str_contains(value, sel.m_value, caseSensitive))
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)