本文整理汇总了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";
}*/
}
示例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;
}
示例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;
}
示例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";
}
}
示例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";
}
}
示例6: next
/**
* @return Frame
*/
function next()
{
$ret = $this->_cur;
if (!$ret) {
return null;
}
$this->_cur = $this->_cur->get_next_sibling();
$this->_num++;
return $ret;
}