English 中文(简体)
我如何计算服务器边应用的胎盘数量?
原标题:How can I calculate the amount of applied padding on server-side?

Is it possible to run on the server-side the same process that browsers run in order to apply CSS to the DOM?

例如,我可以采用超文本文件,适用所有中央支助事务规则(连接、嵌入和直线),为其属性拟订任何内容。 我对盒式模式(即位置、边远、边界和dding)大多数感到关切。

The only way I can think of so far is to use Selenium RC and jQuery to pass the values back. However, this seems very resource-intensive, so I m wondering if there s another way. I ve looked around Google and searches for parsing CSS only bring results for reading individual styles, not applying all CSS rules it to the whole DOM and then working out the results.

任何语言都会使用。

Example (not the real use case, but a similar one)

你们重新构建一个使了解超文本和中央安全局的人能够生成 Java全球信息。 公益物协会允许开发商以超文本形式通过,然后回到所有法文本中来构造全球倡议,所有要素的大小和位置相同。

最佳回答

Start by reading this document on how browsers work to realize that to calculate something like that requires a layout engine. Things like the dimensions of rendered fonts and images, as well as the box model with its complex rules for margin collapsing, and more all influence the final layout.

Unless you can host a layout engine (like WebKit) in your server-side application you are looking at implementing a layout engine, minus the actual painting to screen, just to establish the layout of your application (if I understand your requirements correctly).

她说,万维网Kit发动机被用于许多项目,但或其他客户边软件。 快速搜索谷歌确实产生了一个令人感兴趣的结果:

  • phantomjs ("headless WebKit with JavaScript API", so you could use JavaScript to inspect the DOM and the effects of the CSS applied)

如果你能够拥有现有的布局型动力,则可能有一些像超文本式的电离层技术。 也许这些是更好的选择? http://en.wikipedia.org/wiki/extensible_Application_ Markup_Language” conf=“noreferer”

问题回答

http://htmlunit.forge.net/“rel=“nofollow”http://htmlunit.sourceforge.net/。 图书馆努力在全力支持下培育浏览器。





相关问题
PHP DOM - accessing newly added nodes

I use the following to get a html document into DOM: $dom = new domDocument( 1.0 , utf-8 ); $dom->loadHTML($html) and then I add some new content to an element in the html: $element = $dom->...

XML DOM parsing br tag

I need to parse a xml string to obtain the xml DOM, the problem I m facing is with the self closing html tag like <br /> giving me the error of Tag mismatch expected </br>. I m aware this ...

How to get a flash url in a webpage using a webframe?

As we know , When we load frame from webpage of safari, we will invoke the delegate methods of webkit informal protocol(WebFrameLoadDelegate): webView:didStartProvisionalLoadForFrame: webView:...

热门标签