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 8148005
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T14:32:50+00:00 2026-06-06T14:32:50+00:00

Similar to how ‘Pause on exceptions’ works, is it possible to pause whenever you

  • 0

Similar to how ‘Pause on exceptions’ works, is it possible to pause whenever you create a svg element and sets invalid attributes on it?

This example (test on jsfiddle):

circle.setAttribute('fill', 'steelblue');
circle.setAttribute('r', 'big'); // A 'big' circle is obviously wrong

will generate the following error in chrome, but there is no mapping back to the javascript call that generated the svg so it can be hard to find the error:

enter image description here

  • 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-06T14:32:52+00:00Added an answer on June 6, 2026 at 2:32 pm

    This is not possible because of how svg is rendered in the browser. Imagine that svg is a like XML, or (HTML) for that matter. Its not executed in a step process like lines of code. Its read into a rendering engine that quickly renders the object and its attributes. The pause would have to happen during this rendering, inside of the engine, and this would cause all sorts of rendering issues.

    In reference to your example, javascript doesn’t do any sort of type checking on what you pass into the setAttribute value, (I mean it really couldn’t as different attributes require different types), but rather adds that key value pair to the element object. (try logging the circle object, before and after and you’ll see what I mean). Later when you add your circle to the DOM, it simply takes the object and parses it like I stated above.

    Basically this type of error handling will never exist in the browser because the code that you have in your example is correct and executes properly, however you as a programmer need to make sure that you are passing the correct type of value to the setAttribute method. So its not an error in the javascript and that is why you do not get the breakpoint there.

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

Sidebar

Related Questions

Similar to this question only the other way of flow. Insert Picture into SQL
Similar to this thread, but not exactly: How To Cache Information In A Threadsafe
Similar to this question: link However I have already mastered that. My problem is
Similar to this question , except the console program being wrapped up in the
Similar to this post IEnumerable model property in an ASP.NET MVC 3 Editor Template
Similar to this Java question . I would like to specify that a variable
Similar to XPath: How to match attributes that contain a certain string but without
Similar to how spell checking works. I have a custom syntax I wish to
Similar to approach in Convert SVG to PDF the svg2pdf conversion runs successfully under
Similar to this question I am porting a web application to 4.0. It has

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.