Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7093609
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T08:27:39+00:00 2026-05-28T08:27:39+00:00

Is it possible to run on the server-side the same process that browsers run

  • 0

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

For example, could I take a HTML document, apply all the CSS rules (linked, embedded and inline) to work out for any element its attributes. I’m mostly concerned about the box model (i.e. its position, margin, border and padding).

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.

Any language will do.

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

You’re building an API which allows people who know HTML and CSS to generate Java GUIs. The API allows the developer to pass in their HTML, and it then returns back all the code to construct the GUI, with the same sizes and positions for all the elements.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T08:27:39+00:00Added an answer on May 28, 2026 at 8:27 am

    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).

    Having said that, the WebKit engine is used in a lot of projects, but most of them are browsers or other client-side software. A quick search on Google did turn up one interesting result:

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

    If you can’t host an existing layout engine, there may be some HTML-like (XML) UI layout technologies available. perhaps those are a better option? E.g. Microsoft’s Silverlight/XAML, Adobe’s MXML (supports some CSS rules as well), UIML, or Mozilla’s XUL.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Call php function from javascript I understand that php is server side
Possible Duplicate: ASP.Net:Best way to run scheduled tasks How to fire a server side
Is it possible to run javascript server side? Is it possible to access a
Is it possible to run SQL Server 2005 on localhost, with a schema of
Is it possible to set up somehow Microsoft SQL Server to run a stored
Is it possible to run an external process from Perl, capture its stderr, stdout
Is it possible to run both debuggers within the same PHP installation simultaneously. They
I am trying to run a .exe from the server side on GWT but
I have a DropDownList that fires off some server-side databinding in its OnSelectedIndexChanged event.
I was wondering if there is any way to always run some server side

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.