aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Geerken <devnull@localhost>2014-11-21 21:58:27 +0100
committerSebastian Geerken <devnull@localhost>2014-11-21 21:58:27 +0100
commit5d1472c4d56614e2a99b838e35bb893d3e6b67d4 (patch)
tree95a9101c8875254d44f3ceaa9ca123a402acdf9d
parentc8d70be980c0ff809e204db089d30aa06c2d06ca (diff)
No BREAKs anymore around a float.
-rw-r--r--dw/outofflowmgr.cc22
-rw-r--r--dw/outofflowmgr.hh11
-rw-r--r--dw/textblock.cc2
-rw-r--r--dw/textblock.hh8
-rw-r--r--src/html.cc8
5 files changed, 19 insertions, 32 deletions
diff --git a/dw/outofflowmgr.cc b/dw/outofflowmgr.cc
index cd42a9a5..23e30d86 100644
--- a/dw/outofflowmgr.cc
+++ b/dw/outofflowmgr.cc
@@ -1295,28 +1295,6 @@ void OutOfFlowMgr::drawFloats (SortedFloatsVector *list, View *view,
}
}
-/**
- * This method consideres also the attributes not yet considered by
- * dillo, so that the containing block is determined correctly, which
- * leads sometimes to a cleaner rendering.
- */
-bool OutOfFlowMgr::isWidgetOutOfFlow (Widget *widget)
-{
- // This is only half-baked, will perhaps be reactivated:
- //
- //return
- // widget->getStyle()->vloat != FLOAT_NONE ||
- // widget->getStyle()->position == POSITION_ABSOLUTE ||
- // widget->getStyle()->position == POSITION_FIXED;
-
- return isWidgetHandledByOOFM (widget);
-}
-
-bool OutOfFlowMgr::isWidgetHandledByOOFM (Widget *widget)
-{
- return isWidgetFloat (widget);
-}
-
void OutOfFlowMgr::addWidgetInFlow (Textblock *textblock,
Textblock *parentBlock, int externalIndex)
{
diff --git a/dw/outofflowmgr.hh b/dw/outofflowmgr.hh
index 179d4aa0..1c17ecdb 100644
--- a/dw/outofflowmgr.hh
+++ b/dw/outofflowmgr.hh
@@ -313,8 +313,10 @@ private:
void tellFloatPosition (core::Widget *widget, int yReq);
+ static inline bool isStyleFloat (core::style::Style *style)
+ { return style->vloat != core::style::FLOAT_NONE; }
static inline bool isWidgetFloat (core::Widget *widget)
- { return widget->getStyle()->vloat != core::style::FLOAT_NONE; }
+ { return isStyleFloat (widget->getStyle()); }
/*
* Format for parent ref (see also below for isRefOutOfFlow,
@@ -370,8 +372,11 @@ public:
void markExtremesChange (int ref);
core::Widget *getWidgetAtPoint (int x, int y, int level);
- static bool isWidgetOutOfFlow (core::Widget *widget);
- static bool isWidgetHandledByOOFM (core::Widget *widget);
+ static bool isStyleOutOfFlow (core::style::Style *style)
+ { return isStyleFloat (style); }
+ static inline bool isWidgetOutOfFlow (core::Widget *widget)
+ { return isStyleOutOfFlow (widget->getStyle()); }
+
void addWidgetInFlow (Textblock *textblock, Textblock *parentBlock,
int externalIndex);
void addWidgetOOF (core::Widget *widget, Textblock *generatingBlock,
diff --git a/dw/textblock.cc b/dw/textblock.cc
index 5970319d..1db33eb1 100644
--- a/dw/textblock.cc
+++ b/dw/textblock.cc
@@ -2364,7 +2364,7 @@ void Textblock::addWidget (core::Widget *widget, core::style::Style *style)
DBG_OBJ_ASSOC (containingBlock, containingBlock->outOfFlowMgr);
}
- if (OutOfFlowMgr::isWidgetHandledByOOFM (widget)) {
+ if (OutOfFlowMgr::isWidgetOutOfFlow (widget)) {
PRINTF (" -> out of flow.\n");
widget->setParent (containingBlock);
diff --git a/dw/textblock.hh b/dw/textblock.hh
index 7dbb9d52..4bc74669 100644
--- a/dw/textblock.hh
+++ b/dw/textblock.hh
@@ -616,7 +616,7 @@ protected:
lout::misc::NotSoSimpleVector <Word> *words;
lout::misc::SimpleVector <Anchor> *anchors;
- struct {int index, nChar;}
+ struct { int index, nChar; }
hlStart[core::HIGHLIGHT_NUM_LAYERS], hlEnd[core::HIGHLIGHT_NUM_LAYERS];
int hoverLink; /* The link under the mouse pointer */
@@ -873,9 +873,9 @@ public:
void addText (const char *text, size_t len, core::style::Style *style);
inline void addText (const char *text, core::style::Style *style)
- {
- addText (text, strlen(text), style);
- }
+ { addText (text, strlen(text), style); }
+ static bool isStyleOutOfFlow (core::style::Style *style)
+ { return OutOfFlowMgr::isStyleOutOfFlow (style); }
void addWidget (core::Widget *widget, core::style::Style *style);
bool addAnchor (const char *name, core::style::Style *style);
void addSpace (core::style::Style *style);
diff --git a/src/html.cc b/src/html.cc
index 843b69ff..8fea74e9 100644
--- a/src/html.cc
+++ b/src/html.cc
@@ -374,6 +374,11 @@ static void Html_add_textblock(DilloHtml *html, bool addBreaks, int breakSpace)
S_TOP(html)->hand_over_break = true;
}
+static bool Html_will_textblock_be_out_of_flow(DilloHtml *html)
+{
+ return HT2TB(html)->isStyleOutOfFlow (html->style ());
+}
+
/*
* Create and initialize a new DilloHtml class
*/
@@ -3859,8 +3864,7 @@ static void Html_check_html5_obsolete(DilloHtml *html, int ni)
static void Html_display_block(DilloHtml *html)
{
- //HT2TB(html)->addParbreak (5, html->styleEngine->wordStyle ());
- Html_add_textblock(html, true, 0);
+ Html_add_textblock(html, !Html_will_textblock_be_out_of_flow (html), 0);
}
static void Html_display_inline_block(DilloHtml *html)