joseph / Monocle

A silky, tactile browser-based ebook JavaScript library.
http://monocle.inventivelabs.com.au
MIT License
743 stars 200 forks source link

MathML issues #192

Open lmvco opened 11 years ago

lmvco commented 11 years ago

Hi,

When opening a chapter with MathML elements, I realized that Monocle throw some errors when calling methods from class reader.formatting (e.g. reader.formatting.setFontScale).

In fact, some internal functions assume that the style property is available for all DOM elemnts but for MathML elements it is not true.

Some references that needed to be protected:

function adjustFontScaleForDoc(doc, scale) { ... elems[j].style.cssText += newFs;
}

function sweepElements(doc, elems) { ... elems[i].pfsOriginalProp = elems[i].style.fontSize; ... }

joseph commented 11 years ago

Oh, that's annoying. Can you provide a failing test case in test/bugs/?