-
Notifications
You must be signed in to change notification settings - Fork 548
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resolves ClassCastException for grid layouts #19
Conversation
whats the status of this? any reason why it has not yet been merged? |
Also interested to know if and when this will be merged. thx |
It's not an appropriate fix. There isn't any guarantee that the render tree is in a good state after a runtime exception is thrown. If somebody can boil down the problem to say 10-15 lines of XML, I'll take a look at a proper fix. |
The following will reproduce this defect. It seems that just including the twitter bootstrap css is one way to reproduce the problem. I'm not sure that I agree with this fix (it seems to mask the problem rather than fix it), but I am also confused @pbrant 's comment...there is not exception thrown because this fix prevents the code from ever attempting the cast. Can you provide more detail?
|
I boiled it down to this:
It seems to only happen in a combination of display "table" and a content: "" specification inside a :before or :after pseudo class. @pbrant Would you take a look at this? |
Awesome test case reduction! The problem is actually in BoxBuilder, around line 949 and the subsequent @dalelotts I think it's fine actually. I think there was another fix Jan, if you want to look at this, please don't hesitate! Otherwise I'll Pete On Thu, Feb 21, 2013 at 4:01 AM, Jan notifications@github.com wrote:
|
I believe my latest commit on my fork (See #22 ) fixes this properly. https://github.com/habermann24/flyingsaucer/commit/1640fcf2d9766a238c45dbb9b7be04ef043455e4 |
Hi everyone - great to see a fix here, any sense of whether a new release incorporating it will be coming out soon? Or should we build a custom version for now? If the latter do you recommend we just cherry pick that commit @habermann24 or use your fork in it's entirety? Thanks! |
@megamattron I am using my fork in two of my "production apps", so feel free to use it in its entirety. It's not that many changes after all and i recently rebased all the improvements from upstream. I desperately wanted opacity to work and had issues with some font loading, that's why i did all this. Not sure if this will get merged. I would appreciate that of course :) |
If there is no way to get this stuff merged, then i will probably do another pull request for the bug fixes made, so we can at least get those merged! |
Great, thanks @habermann24 I'll probably use your fork for now then. Are you loading the bootstrap.css file successfully now with your fork? |
Yes it's loading it without the Exception. |
Hi Jan, It's better to use a topic branch per change. It helps keeps review
On Tue, Mar 5, 2013 at 5:36 PM, Jan notifications@github.com wrote:
|
In taking a closer look, I'm not sure this is quite the right approach. We should be modifying the CascadedStyle and deriving a new CalculatedStyle from that (vs. deriving a new CalculatedStyle using the previous one as a parent). I'm closing this pull request. See pull request #30 for my changes here. |
@pbrant Thank you very much for your support on this! |
I solve with changing Become |
Hello, could you detail your workaround please ? |
@pelodelfuego You need to find 'display: table;' in each of ::after and replace them to 'display: block;' |
Thanks for your reactivity, I added:
to my print stylesheet. But it doesn't seems to work... I'll keep digging but maybe you have another idea ? |
solved by adding:
Thanks for your help ! |
The Problem
When running
ITextRenderer.layout()
on a grid formatted html file, you would get:A great example would be to tagsoup http://twitter.github.com/bootstrap/
The Solution
An extra check to block the exception from bubbling to the surface. This simple change resolves:
Thank you for a such a great library!