当前位置: 首页>>代码示例>>PHP>>正文


PHP Frame::get_next_sibling方法代码示例

本文整理汇总了PHP中Frame::get_next_sibling方法的典型用法代码示例。如果您正苦于以下问题:PHP Frame::get_next_sibling方法的具体用法?PHP Frame::get_next_sibling怎么用?PHP Frame::get_next_sibling使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Frame的用法示例。


在下文中一共展示了Frame::get_next_sibling方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _collapse_margins

 protected function _collapse_margins()
 {
     $cb = $this->_frame->get_containing_block();
     $style = $this->_frame->get_style();
     $t = $style->length_in_pt($style->margin_top, $cb["h"]);
     $b = $style->length_in_pt($style->margin_bottom, $cb["h"]);
     // Handle 'auto' values
     if ($t === "auto") {
         $style->margin_top = "0pt";
         $t = 0;
     }
     if ($b === "auto") {
         $style->margin_bottom = "0pt";
         $b = 0;
     }
     // Collapse vertical margins:
     $n = $this->_frame->get_next_sibling();
     if ($n && !in_array($n->get_style()->display, Style::$BLOCK_TYPES)) {
         while ($n = $n->get_next_sibling()) {
             if (in_array($n->get_style()->display, Style::$BLOCK_TYPES)) {
                 break;
             }
             if (!$n->get_first_child()) {
                 $n = null;
                 break;
             }
         }
     }
     if ($n) {
         $n_style = $n->get_style();
         $b = max($b, $n_style->length_in_pt($n_style->margin_top, $cb["h"]));
         $n_style->margin_top = "0pt";
         $style->margin_bottom = $b . "pt";
     }
     // Collapse our first child's margin
     /*$f = $this->_frame->get_first_child();
         if ( $f && !in_array($f->get_style()->display, Style::$BLOCK_TYPES) ) {
           while ( $f = $f->get_next_sibling() ) {
             if ( in_array($f->get_style()->display, Style::$BLOCK_TYPES) ) {
               break;
             }
             
             if ( !$f->get_first_child() ) {
               $f = null;
               break;
             }
           }
         }
     
         // Margin are collapsed only between block elements
         if ( $f ) {
           $f_style = $f->get_style();
           $t = max($t, $f_style->length_in_pt($f_style->margin_top, $cb["h"]));
           $style->margin_top = $t."pt";
           $f_style->margin_bottom = "0pt";
         }*/
 }
开发者ID:enderochoa,项目名称:tortuga,代码行数:57,代码来源:frame_reflower.cls.php

示例2: while

 /**
  * @return Frame_Decorator
  */
 function get_next_sibling()
 {
     $s = $this->_frame->get_next_sibling();
     if ($s && $deco = $s->get_decorator()) {
         while ($tmp = $deco->get_decorator())
             $deco = $tmp;
         return $deco;
     } else if ($s)
         return $s;
     else
         return null;
 }
开发者ID:rmuyinda,项目名称:dms-1,代码行数:15,代码来源:frame_decorator.cls.php

示例3: while

 /**
  * @return Frame_Decorator
  */
 function get_next_sibling()
 {
     $s = $this->_frame->get_next_sibling();
     if ($s && ($deco = $s->get_decorator())) {
         while ($tmp = $deco->get_decorator()) {
             $deco = $tmp;
         }
         return $deco;
     } else {
         if ($s) {
             return $s;
         }
     }
     return null;
 }
开发者ID:jmangarret,项目名称:ostickets,代码行数:18,代码来源:frame_decorator.cls.php

示例4: _collapse_margins

 protected function _collapse_margins()
 {
     $cb = $this->_frame->get_containing_block();
     $style = $this->_frame->get_style();
     $t = $style->length_in_pt($style->margin_top, $cb["h"]);
     $b = $style->length_in_pt($style->margin_bottom, $cb["h"]);
     // Handle 'auto' values
     if ($t === "auto") {
         $style->margin_top = "0pt";
         $t = 0;
     }
     if ($b === "auto") {
         $style->margin_bottom = "0pt";
         $b = 0;
     }
     // Collapse vertical margins:
     $n = $this->_frame->get_next_sibling();
     // FIXME If there is a non-empty inline frame between the blocks, it is not taken into account
     while ($n && !in_array($n->get_style()->display, Style::$BLOCK_TYPES)) {
         $n = $n->get_next_sibling();
     }
     if ($n) {
         // && !$n instanceof Page_Frame_Decorator ) {
         $b = max($b, $style->length_in_pt($n->get_style()->margin_top, $cb["h"]));
         $n->get_style()->margin_top = "0pt";
         $style->margin_bottom = $b . "pt";
     }
     // Collapse our first child's margin
     $f = $this->_frame->get_first_child();
     while ($f && !in_array($f->get_style()->display, Style::$BLOCK_TYPES)) {
         $f = $f->get_next_sibling();
     }
     // Margin are collapsed only between block elements
     if ($f && in_array($f->get_style()->display, Style::$BLOCK_TYPES)) {
         $t = max($t, $style->length_in_pt($f->get_style()->margin_top, $cb["h"]));
         $style->margin_top = $t . "pt";
         $f->get_style()->margin_bottom = "0pt";
     }
 }
开发者ID:rodolfobais,项目名称:proylectura,代码行数:39,代码来源:frame_reflower.cls.php

示例5: _collapse_margins

 protected function _collapse_margins()
 {
     $cb = $this->_frame->get_containing_block();
     $style = $this->_frame->get_style();
     $t = $style->length_in_pt($style->margin_top, $cb["h"]);
     $b = $style->length_in_pt($style->margin_bottom, $cb["w"]);
     // Handle 'auto' values
     if ($t === "auto") {
         $style->margin_top = "0pt";
         $t = 0;
     }
     if ($b === "auto") {
         $style->margin_bottom = "0pt";
         $b = 0;
     }
     // Collapse vertical margins:
     $n = $this->_frame->get_next_sibling();
     while ($n && !in_array($n->get_style()->display, Style::$BLOCK_TYPES)) {
         $n = $n->get_next_sibling();
     }
     if ($n) {
         // && !$n instanceof Page_Frame_Decorator ) {
         $b = max($b, $style->length_in_pt($n->get_style()->margin_top, $cb["w"]));
         $n->get_style()->margin_top = "{$b} pt";
         $style->margin_bottom = "0 pt";
     }
     // Collapse our first child's margin
     $f = $this->_frame->get_first_child();
     while ($f && !in_array($f->get_style()->display, Style::$BLOCK_TYPES)) {
         $f = $f->get_next_sibling();
     }
     if ($f) {
         $t = max($t, $style->length_in_pt($f->get_style()->margin_top, $cb["w"]));
         $style->margin_top = "{$t} pt";
         $f->get_style()->margin_top = "0 pt";
     }
 }
开发者ID:rifaiaja,项目名称:orpsystem,代码行数:37,代码来源:frame_reflower.cls.php

示例6: next

 /**
  * @return Frame
  */
 function next()
 {
     $ret = $this->_cur;
     if (!$ret) {
         return null;
     }
     $this->_cur = $this->_cur->get_next_sibling();
     $this->_num++;
     return $ret;
 }
开发者ID:nvdnkpr,项目名称:dompdf,代码行数:13,代码来源:frame.cls.php


注:本文中的Frame::get_next_sibling方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。