當前位置: 首頁>>代碼示例>>PHP>>正文


PHP csstidy::property_is_valid方法代碼示例

本文整理匯總了PHP中csstidy::property_is_valid方法的典型用法代碼示例。如果您正苦於以下問題:PHP csstidy::property_is_valid方法的具體用法?PHP csstidy::property_is_valid怎麽用?PHP csstidy::property_is_valid使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在csstidy的用法示例。


在下文中一共展示了csstidy::property_is_valid方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: parse


//.........這裏部分代碼省略.........
                             $this->at = $this->css_new_media_section(DEFAULT_AT);
                         }
                         $this->selector = $this->css_new_selector($this->at, $this->selector);
                         $this->_add_token(SEL_START, $this->selector);
                         $this->added = false;
                     } elseif ($string[$i] === '}') {
                         $this->_add_token(AT_END, $this->at);
                         $this->at = '';
                         $this->selector = '';
                         $this->sel_separate = array();
                     } elseif ($string[$i] === ',') {
                         $this->selector = trim($this->selector) . ',';
                         $this->sel_separate[] = strlen($this->selector);
                     } elseif ($string[$i] === '\\') {
                         $this->selector .= $this->_unicode($string, $i);
                     } elseif ($string[$i] === '*' && @in_array($string[$i + 1], array('.', '#', '[', ':'))) {
                         // remove unnecessary universal selector, FS#147
                     } else {
                         $this->selector .= $string[$i];
                     }
                 } else {
                     $lastpos = strlen($this->selector) - 1;
                     if ($lastpos == -1 || !((ctype_space($this->selector[$lastpos]) || csstidy::is_token($this->selector, $lastpos) && $this->selector[$lastpos] === ',') && ctype_space($string[$i]))) {
                         $this->selector .= $string[$i];
                     }
                 }
                 break;
                 /* Case in-property */
             /* Case in-property */
             case 'ip':
                 if (csstidy::is_token($string, $i)) {
                     if (($string[$i] === ':' || $string[$i] === '=') && $this->property != '') {
                         $this->status = 'iv';
                         if (!$this->get_cfg('discard_invalid_properties') || csstidy::property_is_valid($this->property)) {
                             $this->property = $this->css_new_property($this->at, $this->selector, $this->property);
                             $this->_add_token(PROPERTY, $this->property);
                         }
                     } elseif ($string[$i] === '/' && @$string[$i + 1] === '*' && $this->property == '') {
                         $this->status = 'ic';
                         ++$i;
                         $this->from[] = 'ip';
                     } elseif ($string[$i] === '}') {
                         $this->explode_selectors();
                         $this->status = 'is';
                         $this->invalid_at = false;
                         $this->_add_token(SEL_END, $this->selector);
                         $this->selector = '';
                         $this->property = '';
                         if ($this->next_selector_at) {
                             $this->at = $this->css_new_media_section($this->next_selector_at);
                             $this->next_selector_at = '';
                         }
                     } elseif ($string[$i] === ';') {
                         $this->property = '';
                     } elseif ($string[$i] === '\\') {
                         $this->property .= $this->_unicode($string, $i);
                     } elseif ($this->property == '' and !ctype_space($string[$i]) or ($this->property == '/' or $string[$i] == "/")) {
                         $this->property .= $string[$i];
                     }
                 } elseif (!ctype_space($string[$i])) {
                     $this->property .= $string[$i];
                 }
                 break;
                 /* Case in-value */
             /* Case in-value */
             case 'iv':
開發者ID:nicolasembleton,項目名稱:CSSTidy,代碼行數:67,代碼來源:class.csstidy.php

示例2: parse


//.........這裏部分代碼省略.........
                         $this->status = 'is';
                     } elseif ($string[$i] == '{') {
                         $this->status = 'ip';
                         $this->_add_token(SEL_START, $this->selector);
                         $this->added = false;
                     } elseif ($string[$i] == '}') {
                         $this->_add_token(AT_END, $this->at);
                         $this->at = '';
                         $this->selector = '';
                         $this->sel_separate = array();
                     } elseif ($string[$i] == ',') {
                         $this->selector = trim($this->selector) . ',';
                         $this->sel_separate[] = strlen($this->selector);
                     } elseif ($string[$i] == '\\') {
                         $this->selector .= $this->_unicode($string, $i);
                     } else {
                         if (!($string[$i] == '*' && @in_array($string[$i + 1], array('.', '#', '[', ':')))) {
                             $this->selector .= $string[$i];
                         }
                     }
                 } else {
                     $lastpos = strlen($this->selector) - 1;
                     if ($lastpos == -1 || !((ctype_space($this->selector[$lastpos]) || csstidy::is_token($this->selector, $lastpos) && $this->selector[$lastpos] == ',') && ctype_space($string[$i]))) {
                         $this->selector .= $string[$i];
                     }
                 }
                 break;
                 /* Case in-property */
             /* Case in-property */
             case 'ip':
                 if (csstidy::is_token($string, $i)) {
                     if (($string[$i] == ':' || $string[$i] == '=') && $this->property != '') {
                         $this->status = 'iv';
                         if (!$this->get_cfg('discard_invalid_properties') || csstidy::property_is_valid($this->property)) {
                             $this->_add_token(PROPERTY, $this->property);
                         }
                     } elseif ($string[$i] == '/' && @$string[$i + 1] == '*' && $this->property == '') {
                         $this->status = 'ic';
                         ++$i;
                         $this->from = 'ip';
                     } elseif ($string[$i] == '}') {
                         $this->explode_selectors();
                         $this->status = 'is';
                         $this->invalid_at = false;
                         $this->_add_token(SEL_END, $this->selector);
                         $this->selector = '';
                         $this->property = '';
                     } elseif ($string[$i] == ';') {
                         $this->property = '';
                     } elseif ($string[$i] == '\\') {
                         $this->property .= $this->_unicode($string, $i);
                     }
                 } elseif (!ctype_space($string[$i])) {
                     $this->property .= $string[$i];
                 }
                 break;
                 /* Case in-value */
             /* Case in-value */
             case 'iv':
                 $pn = ($string[$i] == "\n" || $string[$i] == "\r") && $this->property_is_next($string, $i + 1) || $i == strlen($string) - 1;
                 if (csstidy::is_token($string, $i) || $pn) {
                     if ($string[$i] == '/' && @$string[$i + 1] == '*') {
                         $this->status = 'ic';
                         ++$i;
                         $this->from = 'iv';
                     } elseif ($string[$i] == '"' || $string[$i] == "'" || $string[$i] == '(') {
開發者ID:robertsonmello,項目名稱:projetos,代碼行數:67,代碼來源:class.csstidy.php

示例3: parse


//.........這裏部分代碼省略.........
                             $this->at = $this->css_new_media_section(DEFAULT_AT);
                         }
                         $this->selector = $this->css_new_selector($this->at, $this->selector);
                         $this->_add_token(SEL_START, $this->selector);
                         $this->added = false;
                     } elseif ($string[$i] === '}') {
                         $this->_add_token(AT_END, $this->at);
                         $this->at = '';
                         $this->selector = '';
                         $this->sel_separate = array();
                     } elseif ($string[$i] === ',') {
                         $this->selector = trim($this->selector) . ',';
                         $this->sel_separate[] = strlen($this->selector);
                     } elseif ($string[$i] === '\\') {
                         $this->selector .= $this->_unicode($string, $i);
                     } elseif ($string[$i] === '*' && @in_array($string[$i + 1], array('.', '#', '[', ':'))) {
                         // remove unnecessary universal selector, FS#147
                     } else {
                         $this->selector .= $string[$i];
                     }
                 } else {
                     $lastpos = strlen($this->selector) - 1;
                     if ($lastpos == -1 || !((ctype_space($this->selector[$lastpos]) || csstidy::is_token($this->selector, $lastpos) && $this->selector[$lastpos] === ',') && ctype_space($string[$i]))) {
                         $this->selector .= $string[$i];
                     }
                 }
                 break;
                 /* Case in-property */
             /* Case in-property */
             case 'ip':
                 if (csstidy::is_token($string, $i)) {
                     if (($string[$i] === ':' || $string[$i] === '=') && $this->property != '') {
                         $this->status = 'iv';
                         if (!$this->get_cfg('discard_invalid_properties') || csstidy::property_is_valid($this->property)) {
                             $this->property = $this->css_new_property($this->at, $this->selector, $this->property);
                             $this->_add_token(PROPERTY, $this->property);
                         }
                     } elseif ($string[$i] === '/' && @$string[$i + 1] === '*' && $this->property == '') {
                         $this->status = 'ic';
                         ++$i;
                         $this->from = 'ip';
                     } elseif ($string[$i] === '}') {
                         $this->explode_selectors();
                         $this->status = 'is';
                         $this->invalid_at = false;
                         $this->_add_token(SEL_END, $this->selector);
                         $this->selector = '';
                         $this->property = '';
                     } elseif ($string[$i] === ';') {
                         $this->property = '';
                     } elseif ($string[$i] === '\\') {
                         $this->property .= $this->_unicode($string, $i);
                     } elseif ($this->property == '' and !ctype_space($string[$i])) {
                         $this->property .= $string[$i];
                     }
                 } elseif (!ctype_space($string[$i])) {
                     $this->property .= $string[$i];
                 }
                 break;
                 /* Case in-value */
             /* Case in-value */
             case 'iv':
                 $pn = ($string[$i] === "\n" || $string[$i] === "\r") && $this->property_is_next($string, $i + 1) || $i == strlen($string) - 1;
                 if (csstidy::is_token($string, $i) || $pn) {
                     if ($string[$i] === '/' && @$string[$i + 1] === '*') {
                         $this->status = 'ic';
開發者ID:lunavod,項目名稱:bunker_stable,代碼行數:67,代碼來源:class.csstidy.php


注:本文中的csstidy::property_is_valid方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。