From cf52a2aee0600d4a568a3d68c6691280545bd11f Mon Sep 17 00:00:00 2001 From: corvid Date: Sun, 25 Jan 2015 05:45:11 +0000 Subject: HTML 5.1 draft permits LINK with itemprop in body, so we might as well be quiet about it. --- src/html.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/html.cc b/src/html.cc index 364f48d4..8d214841 100644 --- a/src/html.cc +++ b/src/html.cc @@ -3341,7 +3341,13 @@ static void Html_tag_open_link(DilloHtml *html, const char *tag, int tagsize) /* Ignore LINK outside HEAD */ if (!(html->InFlags & IN_HEAD)) { - BUG_MSG(" must be inside the HEAD section."); + if (!((html->DocType == DT_HTML && html->DocTypeVersion >= 5.0f) && + a_Html_get_attr(html, tag, tagsize, "itemprop"))) { + /* With the HTML 5.1 draft spec, link with itemprop may appear + * in the body. + */ + BUG_MSG("This element must be inside the HEAD section."); + } return; } /* Remote stylesheets enabled? */ -- cgit v1.2.3 From 014a83d2f53cd49bd2540c53ee56f26d880fe2f5 Mon Sep 17 00:00:00 2001 From: Sebastian Geerken Date: Tue, 27 Jan 2015 10:23:26 +0100 Subject: Some debugging code. --- dw/fltkimgbuf.cc | 38 ++++++++++++++++++++++++++++++++++++++ lout/misc.cc | 6 +++++- lout/misc.hh | 2 +- 3 files changed, 44 insertions(+), 2 deletions(-) diff --git a/dw/fltkimgbuf.cc b/dw/fltkimgbuf.cc index 01bce455..df387dfb 100644 --- a/dw/fltkimgbuf.cc +++ b/dw/fltkimgbuf.cc @@ -145,6 +145,12 @@ void FltkImgbuf::init (Type type, int width, int height, double gamma, deleteOnUnref = true; copiedRows = new lout::misc::BitSet (height); + DBG_IF_RTFL { + lout::misc::StringBuffer sb; + copiedRows->intoStringBuffer (&sb); + DBG_OBJ_SET_SYM ("copiedRows", sb.getChars ()); + } + // The list is only used for root buffers. if (isRoot()) scaledBuffers = new lout::container::typed::List (true); @@ -219,6 +225,13 @@ inline void FltkImgbuf::scaleRowSimple (int row, const core::byte *data) if (copiedRows->get(sr)) continue; copiedRows->set (sr, true); + + DBG_IF_RTFL { + lout::misc::StringBuffer sb; + copiedRows->intoStringBuffer (&sb); + DBG_OBJ_SET_SYM ("copiedRows", sb.getChars ()); + } + if (sr == sr1) { for (int px = 0; px < root->width; px++) { int px1 = px * width / root->width; @@ -249,6 +262,12 @@ inline void FltkImgbuf::scaleRowBeautiful (int row, const core::byte *data) // Mark scaled rows done for (int sr = sr1; sr < sr2 || sr == sr1; sr++) copiedRows->set (sr, true); + + DBG_IF_RTFL { + lout::misc::StringBuffer sb; + copiedRows->intoStringBuffer (&sb); + DBG_OBJ_SET_SYM ("copiedRows", sb.getChars ()); + } } else { assert (sr1 == sr2 || sr1 + 1 == sr2); int row1 = backscaledY(sr1), row2 = backscaledY(sr1 + 1); @@ -263,6 +282,12 @@ inline void FltkImgbuf::scaleRowBeautiful (int row, const core::byte *data) bpp, gamma); // Mark scaled row done copiedRows->set (sr1, true); + + DBG_IF_RTFL { + lout::misc::StringBuffer sb; + copiedRows->intoStringBuffer (&sb); + DBG_OBJ_SET_SYM ("copiedRows", sb.getChars ()); + } } } } @@ -333,6 +358,13 @@ void FltkImgbuf::copyRow (int row, const core::byte *data) if (row < height) { // Flag the row done and copy its data. copiedRows->set (row, true); + + DBG_IF_RTFL { + lout::misc::StringBuffer sb; + copiedRows->intoStringBuffer (&sb); + DBG_OBJ_SET_SYM ("copiedRows", sb.getChars ()); + } + memcpy(rawdata + row * width * bpp, data, width * bpp); // Update all the scaled buffers of this root image. @@ -350,6 +382,12 @@ void FltkImgbuf::newScan () for (Iterator it = scaledBuffers->iterator(); it.hasNext();){ FltkImgbuf *sb = it.getNext (); sb->copiedRows->clear(); + + DBG_IF_RTFL { + lout::misc::StringBuffer sb; + copiedRows->intoStringBuffer (&sb); + DBG_OBJ_SET_SYM ("copiedRows", sb.getChars ()); + } } } } diff --git a/lout/misc.cc b/lout/misc.cc index 8d630efc..9b333c93 100644 --- a/lout/misc.cc +++ b/lout/misc.cc @@ -133,6 +133,7 @@ void StringBuffer::clear () BitSet::BitSet(int initBits) { + numBits = initBits; numBytes = bytesForBits(initBits); bits = (unsigned char*)malloc(numBytes * sizeof(unsigned char)); clear(); @@ -146,7 +147,7 @@ BitSet::~BitSet() void BitSet::intoStringBuffer(misc::StringBuffer *sb) { sb->append("["); - for (int i = 0; i < numBytes; i++) + for (int i = 0; i < numBits; i++) sb->append(get(i) ? "1" : "0"); sb->append("]"); } @@ -161,6 +162,9 @@ bool BitSet::get(int i) const void BitSet::set(int i, bool val) { + if (i > numBits) + numBits = i; + if (8 * i >= numBytes) { int newNumBytes = numBytes; while (8 * i >= newNumBytes) diff --git a/lout/misc.hh b/lout/misc.hh index a0beb1b6..50c655eb 100644 --- a/lout/misc.hh +++ b/lout/misc.hh @@ -579,7 +579,7 @@ class BitSet { private: unsigned char *bits; - int numBytes; + int numBits, numBytes; inline int bytesForBits(int bits) { return bits == 0 ? 1 : (bits + 7) / 8; } -- cgit v1.2.3