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

  • Home
  • SEARCH
  • 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 8524223
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T07:37:43+00:00 2026-06-11T07:37:43+00:00

I noticed inconsistent between bounding boxes of shapes between browsers. I made SVG containing

  • 0

I noticed inconsistent between bounding boxes of shapes between browsers. I made SVG containing this:

<rect x="100" y="100" width="100" height="100" id="rect" fill="gray" stroke="black" stroke-width="2px" />
<path d="M100 100 L100 200 L200 200 L200 100 z" id="path" fill="red" stroke="white" stroke-width="2px"/>

When I trying to get their bounding boxes (element.getClientBoundingBox) on Chrome and IE the sizes are w=100, h=100 and their positions are x=100,y=100 for both shapes.
But on FireFox for the first shape I am getting w=102,h=102 (size + borders) and x=99,y=99.
On path the values are even more strange – w=116,h=116, x=92,y=92.

Is this a Firefox bug – should be posted to Bugzilla? Do SVG specification says anything about that? (I could not find any information related to this).
Have any one know about any way of working around this problem? Especially path element is kind of unpredictable for me.

  • 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-06-11T07:37:44+00:00Added an answer on June 11, 2026 at 7:37 am

    Firefox includes the stroke in the bounding box. We have asked for the specification to change to reflect that this is correct.

    For paths the size is too large because we don’t do a very good job of working out the actual size of the stroked shape because of the complexity of estimating the size for pointy shapes. We use stroke-miterlimit to give an upper limit but it’s not that great.

    You could use the SVG DOM getBBox method, that excludes the shape’s stroke and just gives you the fill dimensions.

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

Sidebar

Related Questions

I've noticed some inconsistent (inconsistent to me) behaviour in data.table when using different assignment
I've noticed that the word monad seems to be used in a somewhat inconsistent
Noticed this today when a patch was submitted with the following line: lblCompletionTime.Text =
I've noticed I've been doing this inconsistently within the same project. In some places,
Noticed this today. Given that a file named existing exists in the PWD of
I noticed that every tutorial on how to do JavaScript inheritance does this: SubClass.prototype
I am working with multi-dimensional Numpy arrays. I have noticed some inconsistent behavior when
I have noticed that my geocoder is inconsistent in the code shown below because
In VisualStudio (Pro 2008), I have just noticed some inconsistent behaviour and wondered if
--- Note to moderators: Today (July 15), I've noticed that someone already faced this

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.